id = $context['id']; $this->status_table = $context['status_table']; $this->status_id = $context['status']; $this->department_id = $context['department_id']; $this->sign_counter = 0; } public function set() { global $database; $id = $this->id; //$database->debug = true; $this->client_type = 1; if(!empty($id)) { // $client = common_ref_client::get_client($id); //$this->suggestion = $client['suggestion']; //$this->description = $client['description']; $job = common_jobs::get_jobs_details($id); //bug::bug_array('',$job); $this->company_id = $job['client_id']; $this->primary_location_id = $job['primary_location_id']; $location_details = common_ref_client::get_client_location($this->primary_location_id); $this->address = $location_details['address']; $this->suburb = $location_details['suburb']; $this->state = $location_details['state']; $this->post_code = $location_details['post_code']; $this->phone = $job['phone']; //print_r($client); //print_r($job); $this->job_number = $job['job_number']; $this->company = $job['company_name']; $this->address = $job['address']; $this->job_name = $job['job_name']; $this->description = $job['description']; $this->phone = $job['phone']; $this->sitesurvey_notes = $job['sitesurvey_notes']; $this->qualification_notes = $job['qualification_notes']; $this->production_notes = $job['production_notes']; $this->management_notes = $job['management_notes']; $this->finance_notes = $job['finance_notes']; $this->visualmockup_notes = $job['visualmockup_notes']; $this->flag = $job['flag']; $this->jobtypes= unserialize($job['jobtype']); } if($_POST['Submit'] == "Save") { //$this->client_type = $_POST['client_type']; $this->company_name = $_POST['company_name']; $this->company_id = $_POST['company_id']; $this->address = $_POST['address']; $this->job_number = $_POST['job_number']; $this->description = $_POST['description']; $this->job_type = $_POST['jobtype']; $this->company = $_POST['company']; $this->sitesurvey_notes =$_POST['sitesurvey_notes']; $this->qualification_notes =$_POST['qualification_notes']; $this->production_notes =$_POST['production_notes']; $this->management_notes =$_POST['management_notes']; $this->finance_notes =$_POST['finance_notes']; $this->visualmockup_notes =$_POST['visualmockup_notes']; $this->flag =$_POST['flag']; foreach($_POST as $post => $pp) { if (preg_match("/jobtype/i", $post)) { //echo $post; $this->$post = $pp; } } foreach($_POST as $sign => $ss) { if (preg_match("/signtype/i", $sign)) { //echo $post; $this->$sign = $ss; } } if($this->sign_counter > 0) { $this->reasons .= "Required at least one"; } } $this->config['company_name'] = array("id"=> $id,"value"=> $this->company_name, "input_name" => "company_name", "name" => "Company Name","rule" => ""); $this->config['company'] = array("id"=> $id,"value"=> $this->company, "input_name" => "company", "name" => "Company Name","rule" => "required"); $this->config['company_id'] = array("id"=> $id,"value"=> $this->company_id, "input_name" => "company_id", "name" => "Company ID","rule" => ""); $this->config['address'] = array("id"=> $id,"value"=> $this->address, "input_name" => "address", "name" => "Address","rule" => "required"); $this->config['job_number'] = array("id"=> $id,"value"=> $this->job_number, "input_name" => "job_number", "name" => "Job Number","rule" => "required"); $this->config['description'] = array("id"=> $id,"value"=> $this->description, "input_name" => "description", "name" => "Description","rule" => "required"); $this->config['jobtype_id'] = array("id"=> $id,"value"=> $this->jobtype_id, "input_name" => "jobtype_id", "name" => "Job Type ID","rule" => ""); self::run_validation(); } public function run_validation() { $static_function = (($_POST['Submit'] == "")) ? "initial" : "validate"; $this->validation['company_name'] = validation::$static_function($this->config['company_name']); $this->validation['company'] = validation::$static_function($this->config['company']); $this->validation['company_id'] = validation::$static_function($this->config['company_id']); $this->validation['address'] = validation::$static_function($this->config['address']); $this->validation['job_number'] = validation::$static_function($this->config['job_number']); $this->validation['description'] = validation::$static_function($this->config['description']); $this->validation['sitesurvey_notes'] = validation::$static_function($this->config['sitesurvey_notes']); $this->validation['qualification_notes'] = validation::$static_function($this->config['qualification_notes']); $this->validation['production_notes'] = validation::$static_function($this->config['production_notes']); $this->validation['management_notes'] = validation::$static_function($this->config['management_notes']); $this->validation['finance_notes'] = validation::$static_function($this->config['finance_notes']); $this->validation['visualmockup_notes'] = validation::$static_function($this->config['visualmockup_notes']); $this->validation['jobtype_id'] = validation::$static_function($this->config['jobtype_id']); $this->reasons = validation::formalise($this->validation); } public function form_temp() { ?>
Jobs Current Status Here
id; $status_table = $this->status_table; $status_id = $this->status_id; $department_id = $this->department_id; $flag = $this->flag; $company = $this->company; $job_number = $this->job_number; $company_id = $this->company_id; $address = $this->address; $job_name = $this->job_name; $description = $this->description; $phone = $this->phone; $fax = $this->fax; $jobtypes=$this->jobtypes; /* $sql ="SELECT * FROM job_current_status WHERE job_id='$id'"; $results = $database->getAll($sql);*/ ?>