function snippet() { /* get sort order from session */ //session_start(); // Make a reference to the current session object,set order //$_SESSION['regnamesort']= 'test' ; Set a value in a session variable //$GLOBALS['log']->fatal('start display'); //var_dump($this->bean); $smarty = new Sugar_Smarty(); //parent::display(); $db = DBManagerFactory::getInstance(); $myquery = "SELECT tab4a.first_name fname, tab4a.last_name lname, tab5a.mrn_c mrn, tab4a.gender gender FROM reg_patient tab4a , reg_patient_cstm tab5a WHERE tab4a.id = tab5a.id_c AND tab4a.id = '" . $_REQUEST['patid'] . "'"; $result = $db->query($myquery); $patdata = null; $row = $db->fetchRow($result); $smarty->assign("patdata", $row); $risk = new RiskEvaluation(); //when week filter need to add week interval //get patient risk if exists //if ($_POST['mysort'] == 'week') if (!empty($_REQUEST['patid'])) { $risk->getRisk($_REQUEST['patid']); $smarty->assign("pid", $_REQUEST['patid']); } //echo 'request'.$_REQUEST['patid']; //else return false; //param not found //var_dump($risk); $smarty->assign("myrisk", $risk); global $current_user; $smarty->assign("myuser", $current_user); $smarty->assign("test", "test"); return $smarty->fetch('custom/modules/REG_Patient/tpls/RiskEvaluationREG_Patient.tpl'); }
<?php if (!defined('sugarEntry') || !sugarEntry) { die('Not A Valid Entry Point'); } require_once 'custom/modules/REG_Patient/RiskEvaluation.php'; /////////////////////////////////////////////////////////////////////////////// //// SAVE RISK EVALUATIONS $focus = new RiskEvaluation(); // if the id is set, then this is update, else generate new id //var_dump($_POST); foreach ($focus->comm_labels as $label) { if (isset($_POST[$label . '_radio'])) { $focus->comm_terms[$label] = $_POST[$label . '_radio']; } echo ">>>> " . $focus->comm_terms[$label]; } //var_dump($focus->comm_terms); if (isset($_POST['ORT-1A_check'])) { if (!empty($_POST['ORT-1A_check'])) { $focus->ort1a = 1; } } else { $focus->ort1a = null; } if (isset($_POST['ORT-1B_check'])) { if (!empty($_POST['ORT-1B_check'])) { $focus->ort1b = 1; } } else { $focus->ort1b = null;