3 class C_InsuranceCompany
extends Controller
8 function __construct($template_mod = "general")
10 parent
::__construct();
11 $this->icompanies
= array();
12 $this->template_mod
= $template_mod;
13 $this->assign("FORM_ACTION", $GLOBALS['webroot'] . "/controller.php?" . attr($_SERVER['QUERY_STRING']));
14 $this->assign("CURRENT_ACTION", $GLOBALS['webroot'] . "/controller.php?" . "practice_settings&insurance_company&");
15 $this->assign("STYLE", $GLOBALS['style']);
16 $this->InsuranceCompany
= new InsuranceCompany();
19 function default_action()
21 return $this->list_action();
24 function edit_action($id = "", $patient_id = "", $p_obj = null)
26 if ($p_obj != null && get_class($p_obj) == "insurancecompany") {
27 $this->icompanies
[0] = $p_obj;
28 } elseif (get_class($this->icompanies
[0]) != "insurancecompany") {
29 $this->icompanies
[0] = new InsuranceCompany($id);
32 $this->assign("insurancecompany", $this->icompanies
[0]);
33 return $this->fetch($GLOBALS['template_dir'] . "insurance_companies/" . $this->template_mod
. "_edit.html");
36 function list_action($sort = "")
40 $this->assign("icompanies", $this->InsuranceCompany
->insurance_companies_factory("", $sort));
42 $this->assign("icompanies", $this->InsuranceCompany
->insurance_companies_factory());
45 return $this->fetch($GLOBALS['template_dir'] . "insurance_companies/" . $this->template_mod
. "_list.html");
49 function edit_action_process()
51 if ($_POST['process'] != "true") {
56 if (is_numeric($_POST['id'])) {
57 $this->icompanies
[0] = new InsuranceCompany($_POST['id']);
59 $this->icompanies
[0] = new InsuranceCompany();
62 parent
::populate_object($this->icompanies
[0]);
63 //print_r($this->pharmacies[0]);
64 //echo $this->pharmacies[0]->toString(true);
66 $this->icompanies
[0]->persist();
68 //echo "action processeed";
69 $_POST['process'] = "";