public function getSpecimenInfoRow($specimen, $rem_specs, $admin) { # Returns HTML table row containing specimen info # Called by getPatientHistory() function $specimenBarcode = specimenBarcodeCheck(); ?> <tr valign='top'> <?php if($_SESSION['s_addl'] != 0) { ?> <td> <?php echo $specimen->getAuxId(); ?> </td> <?php } ?> <td> <?php echo get_specimen_name_by_id($specimen->specimenTypeId); ?> </td> <td> <?php echo DateLib::mysqlToString($specimen->dateRecvd); ?> </td> <td> <?php $removed = false; //print_r($rem_specs); if($admin == 1) { if(in_array($specimen->specimenId, $rem_specs)) { echo "Removed"; $removed = true; } else { echo $specimen->getStatus(); } } else { echo $specimen->getStatus(); } ?> </td> <td> <a href='specimen_info.php?sid=<?php echo $specimen->specimenId; ?>' title='Click to View Details of this Specimen'><?php echo LangUtil::$generalTerms['DETAILS']; ?></a> </td> <?php $sid=$specimen->specimenId; $pid=$specimen->patientId; ?> <td> <a href="javascript:get_report(<?php echo $pid;?>,<?php echo $sid;?> )">Report</a> </td> <td><!-- <a href="javascript:update_specimen(<?php echo $sid;?>)"> Update</a> / --> <?php if($removed == false){?> <a href="javascript:delete_specimen(<?php echo $sid;?>)"> Delete</a> <?php } else { if(is_admin_check(get_user_by_id($_SESSION['user_id']))){ ?> <a href="javascript:retrieve_deleted(<?php echo $sid;?>,'specimen')"> Retrieve</a> <?php } else { echo "Request Admin to undo delete"; } }?> </td> <?php if($specimenBarcode) { ?> <td><a href="javascript:print_specimen_barcode(<?php echo $pid;?>,<?php echo $sid;?> )">Print Barcode</a> </td> <? } ?> </tr> <?php }
<?php # # Main page for showing patient profile, test history, # and options like updating profile, registering new specimen # include "redirect.php"; include "includes/header.php"; LangUtil::setPageId("patient_profile"); $pid = $_REQUEST['pid']; $script_elems->enableJQueryForm(); $script_elems->enableDatePicker(); $script_elems->enableTableSorter(); $script_elems->enableLatencyRecord(); $admin = 0; if (is_admin_check(get_user_by_id($_SESSION['user_id']))) { $admin = 1; } $rem_recs = get_removed_specimens($_SESSION['lab_config_id'], "test"); foreach ($rem_recs as $rem_rec) { $rem_specs[] = $rem_rec['r_id']; $rem_remarks[] = $rem_rec['remarks']; } $labsection = 0; if (isset($_REQUEST['labsection'])) { $labsection = $_REQUEST['labsection']; } //print_r($rem_specs); ?> <script type='text/javascript'> function toggle_profile_divs()
public function start_session($username, $password) { session_start(); $sid = session_id(); //$_SESSION['tok'] = $sid; $user = get_user_by_name($username); $_SESSION['username'] = $username; $_SESSION['user_id'] = $user->userId; $_SESSION['user_actualname'] = $user->actualName; $_SESSION['user_level'] = $user->level; $_SESSION['level'] = $user->level; $_SESSION['locale'] = $user->langId; if ($user->level == 17) { $combinedString = $user->rwoptions; $_SESSION['doctorConfig'] = $combinedString; } if (is_admin_check($user)) { $lab_id = get_lab_config_id_admin($user->userId); $_SESSION['lab_config_id'] = $lab_id; $_SESSION['db_name'] = "blis_" . $lab_id; $_SESSION['dformat'] = $DEFAULT_DATE_FORMAT; $_SESSION['country'] = $user->country; } else { $_SESSION['lab_config_id'] = $user->labConfigId; echo $user->labConfigId; $_SESSION['country'] = $user->country; $lab_config = get_lab_config_by_id($user->labConfigId); $_SESSION['db_name'] = $lab_config->dbName; $_SESSION['dformat'] = $lab_config->dateFormat; $_SESSION['dnum_reset'] = $lab_config->dailyNumReset; $_SESSION['pnamehide'] = $lab_config->hidePatientName; # Config values for registration fields if ($user->level != 17) { $_SESSION['p_addl'] = $lab_config->patientAddl; $_SESSION['s_addl'] = $lab_config->specimenAddl; $_SESSION['dnum'] = $lab_config->dailyNum; $_SESSION['sid'] = $lab_config->sid; $_SESSION['pid'] = $lab_config->pid; $_SESSION['comm'] = $lab_config->comm; $_SESSION['age'] = $lab_config->age; $_SESSION['dob'] = $lab_config->dob; $_SESSION['rdate'] = $lab_config->rdate; $_SESSION['refout'] = $lab_config->refout; $_SESSION['pname'] = $lab_config->pname; $_SESSION['sex'] = $lab_config->sex; $_SESSION['doctor'] = $lab_config->doctor; } else { $arr1 = str_split($combinedString); $_SESSION['p_addl'] = $arr1[0]; $_SESSION['s_addl'] = $arr1[1]; $_SESSION['dnum'] = $arr1[2]; $_SESSION['sid'] = $arr1[3]; $_SESSION['pid'] = $arr1[4]; $_SESSION['comm'] = $arr1[5]; $_SESSION['age'] = $arr1[6]; $_SESSION['dob'] = $arr1[7]; $_SESSION['rdate'] = $arr1[8]; $_SESSION['refout'] = $arr1[9]; $_SESSION['pname'] = $arr1[10]; $_SESSION['sex'] = $arr1[11]; $_SESSION['doctor'] = $arr1[12]; } if ($SERVER == $ON_PORTABLE) { $_SESSION['langdata_path'] = $LOCAL_PATH . "langdata_" . $lab_config->id . "/"; } else { $_SESSION['langdata_path'] = $LOCAL_PATH . "langdata_revamp/"; } } # Set session variables for recording latency/user props $_SESSION['PROPS_RECORDED'] = false; $_SESSION['DELAY_RECORDED'] = false; #TODO: Add other session variables here $_SESSION['user_role'] = "garbage"; return 1; }