“; echo “
“.$Translation[‘tableAccessDenied’].”
“; exit; } $x = new DataList; $x->TableName = “personnel”; $x->DataHeight = 150; $x->AllowSelection = 1; $x->HideTableView = ($perm[2]==0 ? 1 : 0); $x->AllowDelete = $perm[4]; $x->AllowInsert = $perm[1]; $x->AllowUpdate = $perm[3]; $x->SeparateDV = 1; $x->AllowDeleteOfParents = 0; $x->AllowFilters = 1; $x->AllowSavingFilters = 0; $x->AllowSorting = 1; $x->AllowNavigation = 1; $x->AllowPrinting = 1; $x->AllowCSV = 0; $x->RecordsPerPage = 10; $x->QuickSearch = 3; $x->QuickSearchText = $Translation[“quick search”]; $x->ScriptFileName = “personnel_view.php”; $x->RedirectAfterInsert = “personnel_view.php”; $x->TableTitle = “personnel”; $x->PrimaryKey = “personnel.serialno”; $x->ColWidth = array(100, 120, 120, 120, 100, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150); $x->ColCaption = array(“Serial Number”, “Last Name”, “First Name”, “Middle Name(s) or Initial(s)”, “Date of Birth”, “Rank”, “Unit”, “Service”, “LST Number”, “Decoration(s)”, “Status”, “Place of Memorial/ Burial”, “Residence”, “Parents’ Names”, “Place of Enlistment”, “Date of Enlistment”, “Height(\”)/Weight(lbs)”, “Race”, “Citizenship”, “Religion”, “Birthplace”, “Education”, “Occupation”, “Marital Status”, “Photograph”); $x->ColNumber = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 26); $x->Template = ‘personnel_templateTV.html’; $x->SelectedTemplate = ‘personnel_templateTVS.html’; $x->ShowTableHeader = 1; $x->ShowRecordSlots = 1; $x->HighlightColor = ‘#FFF0C2’; if($HTTP_POST_VARS[“Filter_x”] != “” || $HTTP_POST_VARS[‘CSV_x’] != “”){ // Query used in filters page and CSV output // mm: build the query based on current member’s permissions if($perm[2]==1){ // view owner only $x->Query = $filtersCSVQuery.”, membership_userrecords where personnel.serialno=membership_userrecords.pkValue and membership_userrecords.tableName=’personnel’ and membership_userrecords.memberID='”.getLoggedMemberID().”‘”; }elseif($perm[2]==2){ // view group only $x->Query = $filtersCSVQuery.”, membership_userrecords where personnel.serialno=membership_userrecords.pkValue and membership_userrecords.tableName=’personnel’ and membership_userrecords.groupID='”.getLoggedGroupID().”‘”; }elseif($perm[2]==3){ // view all $x->Query = $filtersCSVQuery.””; }elseif($perm[2]==0){ // view none $x->Query = “select ‘Not enough permissions’ from personnel”; } }else{ // Query used in table view // mm: build the query based on current member’s permissions if($perm[2]==1){ // view owner only $x->Query = $tableViewQuery.”, membership_userrecords where personnel.serialno=membership_userrecords.pkValue and membership_userrecords.tableName=’personnel’ and membership_userrecords.memberID='”.getLoggedMemberID().”‘”; }elseif($perm[2]==2){ // view group only $x->Query = $tableViewQuery.”, membership_userrecords where personnel.serialno=membership_userrecords.pkValue and membership_userrecords.tableName=’personnel’ and membership_userrecords.groupID='”.getLoggedGroupID().”‘”; }elseif($perm[2]==3){ // view all $x->Query = $tableViewQuery.””; }elseif($perm[2]==0){ // view none $x->Query = “select ‘Not enough permissions’ from personnel”; } } // handle date sorting correctly if($HTTP_POST_VARS[‘SortField’]==’5′ || $HTTP_POST_VARS[‘SortField’]==’personnel.dob’){ $HTTP_POST_VARS[‘SortField’]=’personnel.dob’; $SortFieldNumeric=5; } if($HTTP_GET_VARS[‘SortField’]==’5′ || $HTTP_GET_VARS[‘SortField’]==’personnel.dob’){ $HTTP_GET_VARS[‘SortField’]=’personnel.dob’; $SortFieldNumeric=5; } if($HTTP_POST_VARS[‘SortField’]==’16’ || $HTTP_POST_VARS[‘SortField’]==’personnel.dateenlisted’){ $HTTP_POST_VARS[‘SortField’]=’personnel.dateenlisted’; $SortFieldNumeric=16; } if($HTTP_GET_VARS[‘SortField’]==’16’ || $HTTP_GET_VARS[‘SortField’]==’personnel.dateenlisted’){ $HTTP_GET_VARS[‘SortField’]=’personnel.dateenlisted’; $SortFieldNumeric=16; } // end of date sorting handler $x->Render(); include(dirname(__FILE__).”/header.php”); echo $x->HTML; include(dirname(__FILE__).”/footer.php”); ?>

Footer

Built with HTML5 and CSS3
Copyright © 2021 Exercise Tiger Trust. All rights reserved.