'; echo get_module_title("Users",'Roles', true); global $adb; global $theme; $theme_path="themes/".$theme."/"; $image_path=$theme_path."images/"; require_once($theme_path.'layout_utils.php'); $xtpl=new XTemplate ('modules/Users/listroles.html'); $sql = "select * from role"; $roleListResult = $adb->query($sql); $noofrows = $adb->num_rows($roleListResult); $standCustFld = getStdOutput($roleListResult, $noofrows, $mod_strings); //Standard PickList Fields function getStdOutput($roleListResult, $noofrows, $mod_strings) { global $adb; global $app_strings; //echo get_form_header("Profiles", "", false ); $standCustFld= ''; $standCustFld .= ''; $standCustFld .= ''; $standCustFld .= '
'; $standCustFld .= '

'; $standCustFld .= ''; $standCustFld .= ''; $standCustFld .= ''; $standCustFld .= ''; $standCustFld .= ''; $row=1; for($i=0; $i<$noofrows; $i++,$row++) { if ($row%2==0) { $trowclass = 'evenListRow'; } else { $trowclass = 'oddListRow'; } $standCustFld .= ''; $role_name = $adb->query_result($roleListResult,$i,"name"); $role_id = $adb->query_result($roleListResult,$i,"roleid"); $standCustFld .= ''; $standCustFld .= ''; } $standCustFld .='
Operation
'.$mod_strings['LBL_ROLE_NAME'].'
'; $standCustFld .= ''.$app_strings['LNK_EDIT'].''; global $current_user; $current_role = fetchUserRole($current_user->id); if($role_id != 1 && $role_id != 2 && $role_id != $current_role) { $standCustFld .=' | '.$app_strings['LNK_DELETE'].''; } $standCustFld .= '
'.$role_name.'
'; //echo $standCustFld; return $standCustFld; } $xtpl->assign("MOD", $mod_strings); $xtpl->assign("ROLES", $standCustFld); $xtpl->parse("main"); $xtpl->out("main"); ?>