"; // make the database work. include_once ('dbConnect.php'); include_once ('includes/dbh.inc.php'); session_start(); #print_r($_SESSION); //Get required Session variables $session_id = $_SESSION['LoginMemberID']; $LoginAccessLevel = $_SESSION['LoginAccessLevel']; $strDate = $_SESSION['strDate']; $ViewID = $_SESSION['ViewID']; function groupRoles($roles) { $grouped = []; $current = null; foreach ($roles as $row) { list($start, $end) = explode('-', $row['year']); if ($current && $current['role'] === $row['role'] && $current['start_year'] == $end) { // Extend the range backwards $current['start_year'] = $start; } else { if ($current) $grouped[] = $current; $current = [ 'role' => $row['role'], 'start_year' => (int)$start, 'end_year' => (int)$end ]; } } if ($current) $grouped[] = $current; return $grouped; } // get the 'id' value from the URL (if it exists), making sure that it is valid (checking that it is numeric/larger than 0) if (isset($_GET['user_id']) && is_numeric($_GET['user_id']) && $_GET['user_id'] > 0) { if ($_SESSION['member_view']!=0 or $session_id==$_GET['user_id']) {} else { header("location:Access-denied.php");} $user_id = $_GET['user_id']; $user_name = $mysqli->query("SELECT COUNT(*) AS NumRows FROM Inspectors where user_id='$user_id'") or die ($mysqli->error); $row4 = $user_name->fetch_array(); if ($row4['NumRows'] == 0) { // query db user $result = $mysqli->query("SELECT * FROM user WHERE user_id='$user_id'") or die($mysqli->error); $row = $result->fetch_array(MYSQLI_ASSOC); foreach ($row as $key => $value) { $output[$key] = $value; } } else { // query db user $user_id = $_GET['user_id']; $result = $mysqli->query("SELECT * FROM user JOIN Inspectors ON user.user_id = Inspectors.user_id WHERE user.user_id='$user_id'") or die($mysqli->error); $row = $result->fetch_array(MYSQLI_ASSOC); foreach ($row as $key => $value) { $output[$key] = $value; } } // now we get the user information and add it to the $output array. $result = $mysqli->query("SELECT data_type,data_value FROM user_data WHERE data_user_id='$user_id'") or die($mysqli->error); while($row = $result->fetch_array(MYSQLI_ASSOC)) { $output['user_data'][$row['data_type']] = $row['data_value']; } $full_name = $output['user_first']." ".$output['user_surname']; //print_r($output); } if (isset($_POST['submit-record'])) { if ($_SESSION['system_admin']=='0' or $session_id=$user_id){ // get form data, making sure it is valid $user_id = $_POST['user_id']; $user_first = ucwords($_POST['user_first']); $user_surname = ucwords($_POST['user_surname']); $user_first = htmlspecialchars($user_first,ENT_QUOTES); $user_surname =htmlentities($user_surname,ENT_QUOTES); $user_email = strtolower($_POST['user_email']); $user_access_level = $_POST['user_access_level']; $user_active = $_POST['user_active']; $date_joined = $_POST['date_joined']; $membertype = $_POST['membertype']; $inspector = $_POST['inspector']; $notice_type1=$_POST['notice_type1']; $notice_type2=$_POST['notice_type2']; $notice_type3=$_POST['notice_type3']; $edit_data=$_POST['edit_data']; $fsrtrainer=$_POST['fsrtrainer']; $news=$_POST['news']; $member_view=$_POST['member_view']; $eng_admin=$_POST['eng_admin']; $purchase_order=$_POST['purchase_order']; $add_users=$_POST['add_users']; $menu=$_POST['menu']; $mute=$_POST['mute']; $gender=$_POST['gender']; $session_id=$_SESSION['LoginMemberID']; if (!isset($_POST['user_first']) OR empty($_POST['user_first'])) { $_error[] = 'no_firstname'; } if (!isset($_POST['user_surname']) OR empty($_POST['user_surname'])) { $_error[] = 'no_surname'; } if (isset($_GET['user_id']) && is_numeric($_GET['user_id']) && $_GET['user_id'] > 0) { } else { //check it member exists $sql = "SELECT * FROM user WHERE user_first='$user_first' AND user_surname='$user_surname'"; $result = mysqli_query($mysqli, $sql); if (mysqli_num_rows($result) > 0) { $_error[] = 'Member exists'; } } if (!isset($_error)) { if (isset($_GET['user_id']) && is_numeric($_GET['user_id']) && $_GET['user_id'] > 0) { // update the data to the database if ($LoginAccessLevel >='6' ) { $insert_sql="UPDATE user SET user_first='$user_first', user_surname='$user_surname', user_email='$user_email', user_access_level='$user_access_level', user_active='$user_active', date_joined='$date_joined', inspector='$inspector', trainer='$fsrtrainer', notice_type1='$notice_type1', notice_type2='$notice_type2', notice_type3='$notice_type3', user_updated_date=NOW(), edit_data='$edit_data', news='$news', member_view='$member_view', membertype='$membertype' , eng_admin='$eng_admin', mute='$mute', gender='$gender', purchase_order='$purchase_order', last_saved_by='$session_id', add_users='$add_users', menu='$menu' WHERE user_id='$user_id'"; if ($_SESSION['LoginMemberID']==$user_id ){ $_SESSION['menu'] = $menu; $_SESSION['edit_data'] = $edit_data; $_SESSION['purchase_order'] = $purchase_order; } } else { $insert_sql="UPDATE user SET user_first='$user_first', user_surname='$user_surname', user_email='$user_email', user_active='$user_active', date_joined='$date_joined', news='$news', gender='$gender', last_saved_by='$session_id', membertype='$membertype' , user_updated_date=NOW() WHERE user_id='$user_id'"; } $mysqli->query($insert_sql) or die ($mysqli->error); #echo $insert_sql; $push_data['profile_Spouse'] = htmlentities($_POST ['Spouse'],ENT_QUOTES); $push_data['spouse_contact_num'] = $_POST ['spouse_contact_num']; $push_data['profile_Street'] = ucwords($_POST ['Street']); $push_data['profile_Suburb'] = ucwords($_POST ['Suburb']); $push_data['profile_City'] = $_POST ['City']; $push_data['profile_Post_code'] = $_POST ['Post_code']; $push_data['profile_Phone_no'] = $_POST ['landline']; if ($_POST ['date_of_birth']!='1970-01-01'){ $push_data['profile_date_of_birth'] = $_POST ['date_of_birth'];} else { $push_data['profile_date_of_birth']='0000-00-00';} $push_data['profile_Cell'] = $_POST ['Cell']; $push_data['profile_DRlic'] = strtoupper($_POST ['DRlic']); $push_data['profile_DRlic_date'] = $_POST ['DRlic_date']; $push_data['profile_occupation'] = ucwords($_POST ['occupation']); $push_data['profile_membertype'] = $_POST ['membertype']; $push_data['profile_comments'] = mysqli_real_escape_string($mysqli, $_POST ['comments']); $push_data['profile_payment'] = $_POST ['payment']; foreach ($push_data as $key => $value) $mysqli->query("UPDATE user_data SET data_value = '".$value."' WHERE data_user_id = '".$user_id."' AND data_type = '".$key."'") or die($mysqli->error); $user_spouse = $mysqli->query("SELECT COUNT(*) AS NumRows FROM user_data where data_user_id='".$user_id."' and data_type='spouse_contact_num'") or die ($mysqli->error); $row3sp = $user_spouse->fetch_array(); if ($row3sp['NumRows'] == 0) { $push_data2['spouse_contact_num'] = $_POST ['spouse_contact_num']; foreach ($push_data2 as $key => $value) $mysqli->query("INSERT user_data SET data_user_id = '".$user_id."', data_type = '".$key."', data_value = '".$value."'") or die($mysqli->error); } if ($LoginAccessLevel >='6' ) { //adding user to the trainers table $fullname=$_POST['fullname']; $user_name = $mysqli->query("SELECT COUNT(*) AS NumRows FROM trainers where user_id='$user_id'") or die ($mysqli->error); $row3 = $user_name->fetch_array(); if ($_POST['fsrtrainer']==1) { // echo('post = yes '); if ($row3['NumRows'] == 0) { echo('inserting data now '); $mysqli->query("INSERT trainers SET user_name='$fullname', user_id='$user_id', insertedby='".$session_id."'") or die ($mysqli->error); }//END of NUMrows else { $name = $_POST['user_first']." ".$_POST['user_surname']; $mysqli->query("UPDATE trainers SET user_name='$name', removed='0' WHERE user_id='$user_id' ") or die ($mysqli->error); } } /*else { $name = $_POST['user_first']." ".$_POST['user_surname']; echo ('removing trainer'); $mysqli->query("UPDATE trainers SET removed='1' WHERE user_id='$user_id' ") or die ($mysqli->error); }*/ //adding user to the Inspectors table if ($_POST['inspector']==1) { // echo('inserting'); if ($row4['NumRows'] == 0) { // echo('inserting data'); $mysqli->query("INSERT Inspectors SET user_name='$fullname', user_id='$user_id', insertedby='".$session_id."'") or die ($mysqli->error); }else { $name = $_POST['user_first']." ".$_POST['user_surname']; $mysqli->query("UPDATE Inspectors SET user_name='$name', removed='0' WHERE user_id='$user_id' ") or die ($mysqli->error); } } /*else { $name = $_POST['user_first']." ".$_POST['user_surname']; $mysqli->query("UPDATE Inspectors SET removed='1' WHERE user_id='$user_id' ") or die ($mysqli->error); }*/ }//if a admin to insert data } else { if (!isset($user_email)) { $user_email ='no@email.com';} // Insert into the database. $user_pass = md5($user_pass_1);//encrypt the user_pass before saving in the database code for insert statment user_pass='md5($user_pass)', $mysqli->query("INSERT user SET membertype='$membertype',user_first='$user_first', user_surname='$user_surname',user_pass='md5($user_pass)', date_joined='$date_joined', user_email='$user_email', inserted_by='$session_id'") or die($mysqli->error); $user_id = $mysqli->insert_id; $push_data['profile_Spouse'] = $mysqli->real_escape_string(htmlspecialchars(ucwords($_POST['Spouse']))); $push_data['profile_Street'] = ucwords($_POST ['Street']); $push_data['profile_Suburb'] = ucwords($_POST ['Suburb']); $push_data['profile_City'] = $_POST ['City']; $push_data['profile_Post_code'] = $_POST ['Post_code']; $push_data['profile_Phone_no'] = $_POST ['Phone']; if ($_POST ['date_of_birth']!='1970-01-01'){ $push_data['profile_date_of_birth'] = $_POST ['date_of_birth'];} else { $push_data['profile_date_of_birth']='0000-00-00';} $push_data['profile_Cell'] = $_POST ['Cell']; $push_data['profile_DRlic'] = strtoupper($_POST ['DRlic']); $push_data['profile_DRlic_date'] = $_POST ['DRlic_date']; $push_data['Cert_First Aid'] = $_POST ['FAid_date']; $push_data['profile_occupation'] = ucwords($_POST ['occupation']); $push_data['profile_comments'] = htmlspecialchars($_POST ['comments'],ENT_QUOTES); $push_data['profile_payment'] = $_POST ['payment']; foreach ($push_data as $key => $value) $mysqli->query("INSERT user_data SET data_user_id = '".$user_id."', data_type = '".$key."', data_value = '".$value."'") or die($mysqli->error); echo "
"; echo ""; echo "

"; echo ""; echo "

".$user_first." ".$user_surname." has been added to the Database
"; } if ($_POST['submit-record']=='Submit Changes + add town') { header("location:Add-town.php?user_id='$user_id'"); } else { echo ""; } } // END if $_error. }else { echo "

Sorry can not edit System Admin account

";} } // END if $_POST /* if ($LoginAccessLevel > '9' ) { print_r($_POST); echo "
"; echo $insert_sql; #echo $output['spouse_contact_num']; } */ if (isset($_GET['user_id']) && is_numeric($_GET['user_id']) && $_GET['user_id'] > 0) { $title = $output['user_first'].' '.$output['user_surname']."'s Staff Record"; } else { $title ="New Staff Record";} ?> <?php echo $title; ?>
='4'){ echo "Created by:"; $inserted_by=$output['inserted_by']; if (is_numeric($output['inserted_by'])) { $sqlType_12 = "SELECT * FROM user where user_id='$inserted_by'"; $resultType_12 = $mysqli->query($sqlType_12) or die ("Error in Query: $sqlType" . Mysql_error()); while ($row_12 = $resultType_12->fetch_array(MYSQLI_ASSOC)) { echo $row_12['user_first'].' '.$row_12['user_surname']; echo " - ".date('d-M-Y h:ia',strtotime($output['user_registered'])); } } else { echo $output['inserted_by']; } } ?>
0) { if($LoginAccessLevel>='3') { echo "View printer version ";}}?>
='4'){ $saved_by=$output['last_saved_by']; $sqlType_1 = "SELECT * FROM user where user_id='$saved_by'"; $resultType_1 = $mysqli->query($sqlType_1) or die ("Error in Query: $sqlType" . Mysql_error()); while ($row_1 = $resultType_1->fetch_array(MYSQLI_ASSOC)) { echo $row_1['user_first'].' '.$row_1['user_surname'].' - '.date('d-M-Y h:ia',strtotime($output['last_save'])); } } } ?>

$value) { if ($value == 'no_firstname') { ?>
You need to add a first name.
You need to add a last name.
You need to add a Landline number.
You need to add a Cell contact number (if you don't have one just put -).
You need to add your Date of Birth.
You need to add a email.
Please select Membership type.
Please enter password in password.
Please enter password in confirm password.
Please reenter passwords, they don't match.
Please select payment type
Member already exists

='3') {?> 0) { if ($LoginAccessLevel >= '2' ) { if (($Access_edit !=0) or ($session_id ==$user_id)) { ?> ' class="btn btn-success btn-xs " >
0) { include_once ('family-members.php'); } else { $output['user_photo']='NA.JPG'; }?>
'8' ) { ?> ='3') or ($session_id ==$_GET['user_id'])) {?> '9' ) { ?> ='3') or ($session_id ==$user_id)) {?> '2' ) { ?> ='3') or ($session_id ==$_GET['user_id'])) {?> '2' ) { ?> ";?>

0) { echo $output['user_first'];?>'s  Staff Record

Access level: query($sqlType) or die ("Error in Query: $sqlType" . Mysql_error()); echo ""; } else { ?> 0) { $privilege_id=$output['user_access_level']; $sqlType = "SELECT * FROM privileges where privilege_id=$privilege_id "; $resultType = $mysqli->query($sqlType) or die ("Error in Query: $sqlType" . Mysql_error()); while ($row = $resultType->fetch_array(MYSQLI_NUM)) { echo "".$row[0]." ". $row[1] .""; } } } if($output['user_access_level']>='2' && $output['eng_admin']=='1') { ?> - Engineering Admin ID:
BORDER=1 WIDTH=320 >

'8' ) { ?> " class="btn btn-warning">
Last updated:
Name: Aged: format('%y'); } ?>
D.O.B: Gender:
Land line: Cell Phone:
Emergency Contact: Contact number:
Address:
Suburb:
City:
query($sqlType) or die ("Error in Query: $sqlType" . Mysql_error()); echo ""?>
Post Code:
Occupation:
Email:
Years of service: format('%y'); ?> Sub status: query("SELECT * FROM Subscription WHERE user_id='$user_id' and MemberPaid ='Y' AND SubscriptionYear = '$SubYear' AND MemberType !='Family Membership'") or die($mysqli->error); $row = $result->fetch_array(MYSQLI_ASSOC); foreach ($row as $key => $value) { $sub[$key] = $value; } $result1 =$mysqli->query("SELECT * FROM Subscription INNER JOIN Family_members ON Subscription.user_id = Family_members.Fam_id where Subscription.MemberPaid ='Y' AND Subscription.MemberType='Family Membership'and (Family_members.Adult_1 ='$user_id' or Family_members.Adult_2 ='$user_id' or Family_members.Kid_1 ='$user_id' or Family_members.Kid_2 ='$user_id') AND SubscriptionYear = '$SubYear' ") or die($mysqli->error); $row = $result1->fetch_array(MYSQLI_ASSOC); foreach ($row as $key => $value) { $sub[$key] = $value; } #print_r($sub); if ($sub['paid_date']>'0') { echo "Paid:"; echo date('d-m-Y',strtotime($sub['paid_date'])); } else { echo "not financial ";} ?>
Active member at the depot: Member since:
Driver Licence: Expiry Date:
Member Type: query($sqlType) or die ("Error in Query: $sqlType" . Mysql_error()); echo " Newsletter sent by:
'4' ) { ?>
Inspector: Trainer: Mute expiry items

'8' ) { ?>
  • Site settings

  • Alert Notices


Notes:
'3' ) && ($Access_edit !=0) or ($session_id ==$user_id) ) { ?> 0) { $result = $mysqli->query(" SELECT * FROM Club_Positions WHERE user_id = $user_id ORDER BY SubscriptionYear DESC ") or die($mysqli->error); if ($result->num_rows > 0) { $roles = []; while ($row = $result->fetch_assoc()) { // Clean role name $role = str_replace("_", " ", $row['RoleType']); $role = preg_replace('/\s+/', ' ', $role); $role = trim($role); // Committee Member 1, 2, 3 etc all group together $isCommitteeMember = preg_match('/^Committee Member\s+\d+$/i', $role); if ($isCommitteeMember) { $role = preg_replace('/\s+\d+$/', '', $role); } // Group by role_type_id, except Committee Member roles $groupKey = $isCommitteeMember ? 'committee_member' : 'role_type_' . (int)($row['role_type_id'] ?? 0); list($start, $end) = explode('-', $row['SubscriptionYear']); $roles[] = [ 'group_key' => $groupKey, 'role' => $role, 'start' => (int)$start, 'end' => (int)$end, 'period' => $row['SubscriptionYear'], 'resigned' => (int)($row['resigned'] ?? 0), 'resigned_date' => $row['resigned_date'] ?? null, 'resigned_period' => ((int)($row['resigned'] ?? 0) === 1) ? $row['SubscriptionYear'] : '' ]; } $grouped = []; foreach ($roles as $r) { $merged = false; foreach ($grouped as &$g) { $isSameRole = ($g['group_key'] === $r['group_key']); // Only merge when years connect $isConsecutive = ( $r['end'] == $g['start'] || $r['start'] == $g['end'] ); if ($isSameRole && $isConsecutive) { $g['start'] = min($g['start'], $r['start']); $g['end'] = max($g['end'], $r['end']); if ($r['resigned'] == 1) { $g['resigned'] = 1; $g['resigned_date'] = $r['resigned_date']; $g['resigned_period'] = $r['resigned_period']; } $merged = true; break; } } unset($g); if (!$merged) { $grouped[] = $r; } } usort($grouped, function($a, $b) { if ($b['end'] == $a['end']) { return $b['start'] <=> $a['start']; } return $b['end'] <=> $a['end']; }); ?>
Club Roles
= (int)date('Y')); $period = $isCurrent ? $g['start'] . " – Present" : $g['start'] . " – " . $g['end']; $roleIcon = 'fa-user'; if (stripos($g['role'], 'chair') !== false) { $roleIcon = 'fa-gavel'; } elseif (stripos($g['role'], 'committee') !== false) { $roleIcon = 'fa-users'; } elseif (stripos($g['role'], 'fleet') !== false) { $roleIcon = 'fa-train'; } elseif (stripos($g['role'], 'engineering') !== false) { $roleIcon = 'fa-cogs'; } elseif (stripos($g['role'], 'safety') !== false) { $roleIcon = 'fa-shield-alt'; } elseif (stripos($g['role'], 'manager') !== false) { $roleIcon = 'fa-clipboard-list'; } ?>
Period Role Status
Current Resigned during Past

Internal records

query("SELECT * FROM training_data LEFT JOIN training ON training_data.training_type = training.id WHERE user_id=$user_id AND training LIKE '$like' and superseded!=1 and training_data.removed!=1 ORDER BY training.training ASC ") or die($mysqli->error); if ($result->num_rows > 0) { // loop through results of database query, displaying them in the table while($row = $result ->fetch_array()) { // echo out the contents of each row into a table //echo ""; if ($row['learning']=='1') { echo ""; } elseif ($row['archive']=='1') { echo ""; } elseif ($row['training_value_expiry'] <=$today && $row['life']!="on") { echo ""; $expired='1';} else { echo ""; } if ($LoginAccessLevel >'8'){ echo "' ;} if ($row['doc']!='') { ?>';} echo "'; if ($row['learning']=='0') { if (($row['training_value_expiry']!='1970-01-01') && ($row['life']!='on')){ echo "';} else { echo "";} } echo ''; if (($row['archive']=='1') or ($row['flagged']!='0') && ($row['life']!='on')) { echo ""; } else { echo "';} echo "'; } ?>
id Name Initial date Expiry Date Status
" . $row['data_id'] ." "; } else { echo "" . $row['data_id'].' ';} if ($row['learning']=='1') { ?> '; if ($row['learning']=='0') { echo ''.$row['training']; if (!empty($row['conditions'])) { ?> - Conditions apply ';} else { echo ''.$row['training_name'] .'"; if ($row['learning']=='0') { echo date('d-m-Y',strtotime($row['training_value'])); } echo '". date('d-m-Y',strtotime($row['training_value_expiry'])). ' - ". $row['status2']. "". $row['status']. '"; if ($row['learning']=='0') { ?>
No data
query("SELECT * FROM training_data LEFT JOIN training ON training_data.training_type = training.id WHERE user_id=$user_id AND training LIKE '%Unit%' and superseded!=1 and training_data.removed!=1 ORDER BY training.training DESC ") or die($mysqli->error); if ($result->num_rows > 0) { // loop through results of database query, displaying them in the table while($row = $result ->fetch_array()) { // echo out the contents of each row into a table if ($row['learning']=='1') { echo ""; } else { echo "";} if ($LoginAccessLevel >'8'){ echo "';} else { echo '';} echo "'; echo "'; } }else { // No pages to Display echo ''; } ?>
Unit standards records
id Name Initial date Status
" . $row['data_id'] .""; } else { echo "" . $row['data_id'] ;} if ($row['doc']!='') { ?> ';} if ($row['learning']=='1') { ?> '; if ($row['learning']=='0') { echo ''.$row['training'] .''.$row['training_name'] .'"; if ($row['learning']=='0') { echo date('d-m-Y',strtotime($row['training_value'])); } echo '". $row['status']. '
No data
query("SELECT * FROM training_data LEFT JOIN training ON training_data.training_type = training.id WHERE user_id=$user_id AND training NOT LIKE '%Unit%' and training NOT LIKE '%FDSRS%' and training NOT LIKE '%NRS -%' and training NOT LIKE '%Loco%' and training NOT LIKE '%Carriage%' and superseded!=1 and training_data.removed!=1 ORDER BY training_type DESC ") or die($mysqli->error); if ($result_other->num_rows > 0) { // loop through results of database query, displaying them in the table while($row_other = $result_other ->fetch_array()) { if ($row_other['archive']=='1') { echo ""; } elseif ($row_other['training_value_expiry'] <=$today && $row_other['life']!="1" && $row_other['training_value_expiry']!='1970-01-01') { echo ""; } else { echo ""; } if ($LoginAccessLevel >'8'){ echo "'; echo ''; echo "'; if ($row_other['training_value_expiry']!='1970-01-01'){ echo "';} else { echo "";} if (($row_other['archive']!='0') or ($row_other['flagged']!='0') && ($row_other['life']!='on')) { echo ""; } else { echo "';} echo""; } }else { // No pages to Display echo ''; } ?>
Other Certificates
id Name Initial date Expiry Date Status
" . $row_other['data_id'] .""; } else { echo "" . $row_other['data_id'] ;} if ($row_other['doc']!='') { ?> ';} echo ''. $row_other['training'] .'" . date('d-m-Y',strtotime($row_other['training_value'])) .'". date('d-m-Y',strtotime($row_other['training_value_expiry'])). ' - ". $row_other['status2']. "". $row_other['status']. '
No data

Mainline Crewing info

query("SELECT * FROM training_data LEFT JOIN training ON training_data.training_type = training.id WHERE user_id=$user_id AND training LIKE '%Loco -%' and superseded!=1 and training_data.removed!=1 ORDER BY training_type DESC ") or die($mysqli->error); if ($result->num_rows > 0) { // loop through results of database query, displaying them in the table while($row = $result ->fetch_array()) { // echo out the contents of each row into a table echo ""; if ($LoginAccessLevel >'8'){ echo ""; } else { echo "';} echo ''; echo "'; } }else { // No pages to Display echo ''; } ?>
Locomotive
id Name Status
" . $row['data_id'] ."" . $row['data_id'] .'' . $row['training'] .'" . $row['status'] .'
No data
query("SELECT * FROM training_data LEFT JOIN training ON training_data.training_type = training.id WHERE user_id=$user_id AND training LIKE '%Carriage -%' and superseded!=1 and training_data.removed!=1 ORDER BY training_type DESC ") or die($mysqli->error); if ($result->num_rows > 0) { // loop through results of database query, displaying them in the table while($row = $result ->fetch_array()) { // echo out the contents of each row into a table echo ""; if ($LoginAccessLevel >'8'){ echo ""; } else { echo "';} echo ''; echo "'; } }else { // No pages to Display echo ''; } ?>
Carriage
id Name Status
" . $row['data_id'] ."" . $row['data_id'] .'' . $row['training'] .'" . $row['status'] .'
No data
query("SELECT * FROM training_data LEFT JOIN training ON training_data.training_type = training.id WHERE user_id=$user_id AND training LIKE '%team Leader%' and superseded!=1 and training_data.removed!=1 ORDER BY training_type DESC ") or die($mysqli->error); if ($result->num_rows > 0) { // loop through results of database query, displaying them in the table while($row = $result ->fetch_array()) { // echo out the contents of each row into a table echo ""; if ($LoginAccessLevel >'8'){ echo ""; } else { echo "';} echo ''; echo "'; } }else { // No pages to Display echo ''; } ?>
Team leaders
id Name Status
" . $row['data_id'] ."" . $row['data_id'] .'' . $row['training'] .'" . $row['status'] .'
No data

NRS training

query("SELECT * FROM training_data LEFT JOIN training ON training_data.training_type = training.id WHERE user_id=$user_id AND training LIKE '%NRS%' and superseded!=1 and training_data.removed!=1 ORDER BY training.training ASC, training_value ASC ") or die($mysqli->error); if ($result->num_rows > 0) { // loop through results of database query, displaying them in the table while($row = $result ->fetch_array()) { // echo out the contents of each row into a table if ($row['learning']=='1') { echo ""; } elseif ($row['archive']!='0') { echo ""; } elseif ($row['training_value_expiry'] <=$today && $row['life']!="on") { echo ""; $expired='1';} else { echo ""; } if ($LoginAccessLevel >'8'){ echo "';} if ($row['learning']=='1') { ?> '; if ($row['learning']=='0') { echo '';} else { echo '';} echo "'; echo "'; if (($row['archive']!='0') or ($row['flagged']!='0') && ($row['life']!='on')) { echo ""; } else { echo "';} } }else { // No pages to Display echo ''; } ?>
id Name Initial date Expiry Date Status
" . $row['data_id'] .""; } else { echo "" . $row['data_id'] ;} if ($row['doc']!='') { ?> '.$row['training'] .''.$row['training_name'] .'"; if ($row['learning']=='0') { echo date('d-m-Y',strtotime($row['training_value'])); } echo '"; if ($row['life']!="on") { if ($row['learning']=='0') { echo date('d-m-Y',strtotime($row['training_value_expiry'])); } } echo '". $row['status2']. "". $row['status']. '
No data
' class="btn btn-secondary"> ' class="btn btn-success">