4 class C_X12Partner
extends Controller
11 function __construct($template_mod = "general")
13 parent
::__construct();
14 $this->x12_partner
= array();
15 $this->template_mod
= $template_mod;
16 $this->assign("FORM_ACTION", $GLOBALS['webroot']."/controller.php?" . $_SERVER['QUERY_STRING']);
17 $this->assign("CURRENT_ACTION", $GLOBALS['webroot']."/controller.php?" . "practice_settings&x12_partner&");
18 $this->assign("STYLE", $GLOBALS['style']);
19 $this->assign("WEB_ROOT", $GLOBALS['webroot']);
22 function default_action()
24 return $this->list_action();
27 function edit_action($id = "", $x_obj = null)
29 if ($x_obj != null && get_class($x_obj) == "x12partner") {
30 $this->x12_partners
[0] = $x_obj;
31 } elseif (is_numeric($id)) {
32 $this->x12_partners
[0] = new X12Partner($id);
34 $this->x12_partners
[0] = new X12Partner();
37 $this->assign("partner", $this->x12_partners
[0]);
38 return $this->fetch($GLOBALS['template_dir'] . "x12_partners/" . $this->template_mod
. "_edit.html");
41 function list_action()
44 $x = new X12Partner();
45 //$x->set_name("Medi-Cal");
46 //$x->set_x12_sender_id("123454");
47 //$x->set_x12_receiver_id("123454");
51 $this->assign("partners", $x->x12_partner_factory());
52 return $this->fetch($GLOBALS['template_dir'] . "x12_partners/" . $this->template_mod
. "_list.html");
56 function edit_action_process()
58 if ($_POST['process'] != "true") {
63 if (is_numeric($_POST['id'])) {
64 $this->x12_partner
[0] = new X12Partner($_POST['id']);
66 $this->x12_partner
[0] = new X12Partner();
69 parent
::populate_object($this->x12_partner
[0]);
71 $this->x12_partner
[0]->persist();
72 //insurance numbers need to be repopulated so that insurance_company_name recieves a value
73 $this->x12_partner
[0]->populate();
75 //echo "action processeed";
76 $_POST['process'] = "";
77 $this->_state
= false;
78 header('Location:'.$GLOBALS['webroot']."/controller.php?" . "practice_settings&x12_partner&action=list");//Z&H
79 //return $this->edit_action(null,$this->x12_partner[0]);