<?php
/*
* date last modified 28-11-2017
* Edited by PI-Digi Logical Solutions
* HTML Files - add_user.html.php
* Mysql Tables - tbl_designation, tbl_staff
*/
include('includes/imgFunctions.php');
include('includes/functions.php'); # general functions
require_once('./classes/class.noseo_pagination.php'); # pagination class

$pageVars = '';

if(isset($_REQUEST['id']) && $_REQUEST['id']!=''){		
	$editId = mysqli_real_escape_string($con, trim($_REQUEST['id']));		
	mysqli_query($con, "UPDATE tbl_technician SET viewed = 'yes' WHERE id = '".$editId."'");
	$editRs = mysqli_query($con, "SELECT * FROM tbl_technician WHERE id = '".$editId."'");
	if(mysqli_num_rows($editRs)>0){
		$resEdit = mysqli_fetch_array($editRs);
		
		//check if operator
		$isOperator = FALSE;
		$chkOperatorRs = mysqli_query($con, "SELECT id FROM tbl_operator_locations WHERE operator_id = '".$editId."'");
		if(mysqli_num_rows($chkOperatorRs)>0){
			$isOperator = TRUE;
		}
		
		
		//get payments
		$select = "SELECT * FROM tbl_technician_paid WHERE technician_id = '".$editId."'";
		// Using pagination class
		$pagination = new pagination_noseo($select);
		$execDetails = $pagination->createPages(30);		
		$pageLnk = 'index.php?page='.$page.'&'.$pageVars;
		$pageNums = $pagination->pageNumber(5, $pageLnk);
		
		
	} else {
		$error = 'Technician does not exist!';
	}

} 


?>