class form_job_requirements { public $id; public $type; public function __construct($context) { $this->id = $context['id']; $this->type = $context['type']; } public function set() { global $database; $id = $this->id; $type = $this->type; if($type == "quotes") $request = common_quotes::get_details($id); else $request = common_jobs::get_jobs_details($id); $this->job_types = unserialize($request['jobtype']); $this->other_note = $request['other_note_clean']; return $this; } public function form() { global $database; $current_job_types = $this->job_types; $other_note = $this->other_note; $current_keys = array(); if(count($current_job_types) > 0) foreach($current_job_types AS $key => $job_types) $current_keys[] = $key; $job_types = common_jobtypes::get_jobtypes(); $sign_types = common_jobtypes::get_signtypes(); $job_arry = array(); foreach($job_types AS $key => $job_type) if(in_array($key,$current_keys)) $job_arr[$key] = array("name" => $job_type['job_name'],"value" => $current_job_types[$key],"input_type" => $job_type['input_type']); $sign_arry = array(); foreach($sign_types AS $key => $sign_type) if(in_array($key,$current_job_types)) $sign_arry[$key] = array("name" => $sign_type['job_name'],"value" => $current_job_types[$key],"input_type" => $sign_type['input_type']); if(count($job_arr) > 0) { ?>