if( !(isCountryDir(get_user_by_id($_SESSION['user_id'])) && in_array(basename($_SERVER['PHP_SELF']), $countryDirPageList)) && !(isSuperAdmin(get_user_by_id($_SESSION['user_id'])) && in_array(basename($_SERVER['PHP_SELF']), $superAdminPageList)) && !(isAdmin(get_user_by_id($_SESSION['user_id'])) && in_array(basename($_SERVER['PHP_SELF']), $adminPageList)) ) header( 'Location: home.php' ); */ include("redirect.php"); include("../includes/db_lib.php"); include("../includes/user_lib.php"); LangUtil::setPageId("update"); $user = get_user_by_id($_SESSION['user_id']); $def = ''; if ( is_super_admin($user) || is_country_dir($user) ) { //$labConfigList = get_lab_configs($user->userId); //foreach($labConfigList as $labConfig) { //$labConfigId = $labConfig->id; //runUpdate($labConfigId); // } //runGlobalUpdate(); $db_name = "blis_revamp"; $ufile = "db_update_revamp"; blis_db_update($lab_config_id, $db_name, $ufile); update_language_files(); insertVersionDataEntry(); } else { $lab_config_id = $_SESSION['lab_config_id']; //runUpdate($labConfigId);
function get_lab_configs($admin_user_id = "") { # Returns all lab configs present in DB and accessible by admin-level user # If admin_user_id not supplied, all stored lab configs are returned $saved_db = DbUtil::switchToGlobal(); $user = null; if ($admin_user_id != "") { $user = get_user_by_id($admin_user_id); } if ($admin_user_id == "" || is_super_admin($user)) { # Super admin user: Fetch lab configs stored in DB $query_configs = "SELECT * FROM lab_config ORDER BY name"; } else { if (is_country_dir($user)) { # Country director: Fetch lab configs from lab_config_access table $query_configs = "SELECT * from lab_config lc " . "WHERE lc.lab_config_id IN ( " . "SELECT lca.lab_config_id from lab_config_access lca " . "WHERE lca.user_id={$admin_user_id} ) " . "ORDER BY lc.name"; } else { # Fetch all lab configs $query_configs = "SELECT * FROM lab_config " . "WHERE admin_user_id={$admin_user_id} " . "OR lab_config_id IN ( " . "\tSELECT lab_config_id FROM lab_config_access " . "\tWHERE user_id={$admin_user_id} " . ") ORDER BY name"; } } $retval = array(); $resultset = query_associative_all($query_configs, $row_count); if ($resultset == null) { DbUtil::switchRestore($saved_db); return $retval; } foreach ($resultset as $record) { $retval[] = LabConfig::getObject($record); } DbUtil::switchRestore($saved_db); return $retval; }
public function getPatientSearchAttribSelect($hide_patient_name=false) { $userrr = get_user_by_id($_SESSION['user_id']); global $LIS_TECH_RO, $LIS_TECH_RW, $LIS_CLERK; if ( $_SESSION['user_level'] == $LIS_TECH_RO || $_SESSION['user_level'] == $LIS_TECH_RW || $_SESSION['user_level'] == $LIS_CLERK || $_SESSION['user_level'] == $LIS_PHYSICIAN ) { $lab_config = LabConfig::getById($_SESSION['lab_config_id']); $patientBarcodeSearch = patientSearchBarcodeCheck(); if($hide_patient_name === false && $lab_config->pname != 0) { ?> <option value='1'><?php echo LangUtil::$generalTerms['PATIENT_NAME']; ?></option> <?php } if($lab_config->dailyNum == 1 || $lab_config->dailyNum == 11 || $lab_config->dailyNum == 2 || $lab_config->dailyNum == 12) { ?> <option value='3'><?php echo LangUtil::$generalTerms['PATIENT_DAILYNUM']; ?></option> <?php } if($lab_config->pid != 0) { ?> <option value='0'><?php echo LangUtil::$generalTerms['PATIENT_ID']; ?></option> <?php } if($lab_config->patientAddl != 0) { ?> <option value='2'><?php echo LangUtil::$generalTerms['ADDL_ID']; ?></option> <?php } if($patientBarcodeSearch != 0 && is_country_dir($userrr) != 1 && is_super_admin($userrr) != 1 ) { ?> <option value='9'><?php echo 'Barcode Search'; ?></option> <?php } } else if(User::onlyOneLabConfig($_SESSION['user_id'], $_SESSION['user_level'])) { # Lab admin $lab_config_list = get_lab_configs($_SESSION['user_id']); $lab_config = $lab_config_list[0]; $patientBarcodeSearch = patientSearchBarcodeCheck(); if($lab_config->pname != 0) { ?> <option value='1'><?php echo LangUtil::$generalTerms['PATIENT_NAME']; ?></option> <?php } if($lab_config->dailyNum == 1 || $lab_config->dailyNum == 11 || $lab_config->dailyNum == 2 || $lab_config->dailyNum == 12) { ?> <option value='3'><?php echo LangUtil::$generalTerms['PATIENT_DAILYNUM']; ?></option> <?php } if($lab_config->pid != 0) { ?> <option value='0'><?php echo LangUtil::$generalTerms['PATIENT_ID']; ?></option> <?php } if($lab_config->patientAddl != 0) { ?> <option value='2'><?php echo LangUtil::$generalTerms['ADDL_ID']; ?></option> <?php } if($patientBarcodeSearch != 0 && is_country_dir($userrr) != 1 && is_super_admin($userrr) != 1 ) { ?> <option value='9'><?php echo 'Barcode Search'; ?></option> <?php } } else { $patientBarcodeSearch = patientSearchBarcodeCheck(); # Show all options ?> <option value='1'><?php echo LangUtil::$generalTerms['PATIENT_NAME']; ?></option> <option value='3'><?php echo LangUtil::$generalTerms['PATIENT_DAILYNUM']; ?></option> <option value='0'><?php echo LangUtil::$generalTerms['PATIENT_ID']; ?></option> <option value='2'><?php echo LangUtil::$generalTerms['ADDL_ID']; ?></option> <?php if($patientBarcodeSearch != 0 && is_country_dir($userrr) != 1 && is_super_admin($userrr) != 1 ){ ?> <option value='9'><?php echo 'Barcode Search'; ?></option> <?php } ?> <?php } }
</input> </td> </tr> <tr id='cat_row13'> <td><?php echo LangUtil::$generalTerms['LAB_SECTION']; ?> </td> <td> <select name='cat_code' id='cat_code13' class='uniform_width'> <option value='0'><?php echo LangUtil::$generalTerms['ALL']; ?> </option> <?php if (is_country_dir(get_user_by_id($_SESSION['user_id']))) { $page_elems->getTestCategoryCountrySelect(); } else { $page_elems->getTestCategorySelect(); } ?> </select> </td> </tr> <tr id='ttype_row13'> <td><?php echo LangUtil::$generalTerms['TEST']; ?> </td> <td> <select name='ttype' id='ttype13' class='uniform_width'>
} } $count++; $lab_config_id = $lab_config->country."_".$count; */ $lab_config_id = $count; $lab_config->id = $lab_config_id; $lab_admin_id = checkAndAddAdmin($lab_admin, $lab_config_id); # Link admin user id to session variable of selection box value $lab_config->adminUserId = $lab_admin_id; # Add new lab configuration entry to DB add_lab_config($lab_config); $saved_config_id = $lab_config_id; $user = get_user_by_id($_SESSION['user_id']); if (is_country_dir($user)) { add_lab_config_access($_SESSION['user_id'], $lab_config_id); } //$revamp_db_name = "blis_revamp_".$lab_config_id; $db_name = "blis_" . $lab_config_id; set_lab_config_db_name($lab_config_id, $db_name); # Add user accounts $user_list = $_REQUEST['username']; $pwd_list = $_REQUEST['password']; $fullname_list = $_REQUEST['fullname']; for ($i = 0; $i < count($user_list); $i++) { $username = $user_list[$i]; $pwd = $pwd_list[$i]; $actual_name = $fullname_list[$i]; $access_level = $_REQUEST['access_priv_' . $i]; if ($username == "") {
public function getSpecimenTypeTable($lab_config_id) { # Returns HTML table listing all specimen types in catalog $stype_list = get_specimen_types_catalog($lab_config_id); if (count($stype_list) == 0) { echo "<div class='sidetip_nopos'>" . LangUtil::$pageTerms['TIPS_SPECIMENSNOTFOUND'] . "</div>"; return; } ?> <table class='hor-minimalist-b'> <tbody> <?php $count = 1; foreach ($stype_list as $key => $value) { ?> <tr> <td> <?php echo $count; ?> . </td> <td> <?php echo $value; ?> </td> <td> <a href='specimen_type_edit.php?sid=<?php echo $key; ?> ' title='Click to Edit Specimen Info'><?php echo LangUtil::$generalTerms['CMD_EDIT']; ?> </a> </td> <?php $user = get_user_by_id($_SESSION['user_id']); if (is_country_dir($user) || is_super_admin($user)) { ?> <td> <a href='specimen_type_delete.php?id=<?php echo $key; ?> '><?php echo LangUtil::$generalTerms['CMD_DELETE']; ?> </a> </td> <?php } ?> </tr> <?php $count++; } ?> </tbody> </table> <?php }