id = $context['id']; $this->status_table = $context['status_table']; $this->status_id = $context['status']; $this->department_id = $context['dept_id']; $this->sign_counter = 0; } public function set(){ global $database; $id = $this->id; $status_id = $this->status_id; $this->client_type = 1; if(!empty($id)){ $result = common_quotes::get_details($id); // bug::bug_array('',$result); $this->company_id = $result['client_id']; $this->client_id = $result['client_id']; $this->qid = $result['id']; $this->description = $result['description']; $this->complete_address = $result['address']; $this->suburb= $result['suburb']; $this->state = $result['state']; $this->postcode = $result['post_code']; $this->address_nice = $result['address_nice']; $this->company_name = common_clients::get_client_name($result['client_id']); $this->contacts_first_name = $result['contacts'][0]['first_name']; $this->contacts_last_name = $result['contacts'][0]['last_name']; $this->primary_location_id = $result['primary_location_id']; $this->location_id = $result['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->first_name = $result['first_name']; $this->last_name = $result['last_name']; $this->phone = $result['phone']; $this->email = $result['email']; $this->job_tag = $result['job_tag']; $this->job_number = $result['job_number']; $this->job_name = $result['job_name']; $this->description = $result['description']; $this->phone = $result['phone']; $this->flag = $result['flag']; $this->status = $result['dqstatus']; } if($_POST['Submit'] == "Save"){ } $this->config['client_id'] = array("id"=> $id,"value"=> $this->client_id, "input_name" => "client_id", "name" => "Client","rule" => "required"); $this->config['status'] = array("id"=> $id,"value"=> $this->status, "input_name" => "status", "name" => "Status","rule" => ""); foreach($_POST as $post => $pp){ if (preg_match("/jobtype/i", $post)) { //echo $post; $this->config{$post} = array("id"=> $id,"value"=> $pp, "input_name" => $post, "name" => $post,"rule" => ""); } } foreach($_POST as $sign => $ss){ if (preg_match("/signtype/i", $sign)) { //echo $post; $this->config{$sign} = array("id"=> $id,"value"=> $ss, "input_name" => $sign, "name" => $sign,"rule" => "required"); } } self::run_validation(); } public function run_validation() { $static_function = (($_POST['Submit'] == "")) ? "initial" : "validate"; $this->reasons = validation::formalise($this->validation); } public function quote_template(){ $id= $this->id; $job_name = $this->job_name; $client_id = $this->client_id; $description = $this->description; $client_name = common_clients::get_client_name($client_id); $sheets = common_quotesheets::get_total_sales($id); $address= explode(',',$this->complete_address); $address1 = $address[0]; $address2 = $address[1].','.$address[2].','.$address[3]; $add = explode(',' , $this->address_nice); $address2 = $add[1].', '.$add[2].', '.$add[3]; $postcode = $this->postcode; $first_name = $this->contacts_first_name; $last_name = $this->contacts_last_name; ?>

Include : Terms & Conditions