<?php
/*
* date last modified 03-10-2017
* Edited by PI-Digi Logical Solutions
* HTML Files - manage_staff.html.php
* Mysql Tables - tbl_admin, tbl_purchase_order, tbl_admin_type
*/
require_once('./classes/class.noseo_pagination.php'); # pagination class
require_once('./includes/functions.php'); # general functions

if(isset($_REQUEST['p']) && $_REQUEST['p']!=''){
	$p = trim($_REQUEST['p']);
} else {
	$p = 1;
}

if(isset($_REQUEST['shop_id']) && $_REQUEST['shop_id']!=''){		
	$shopId = mysqli_real_escape_string($con, trim($_REQUEST['shop_id']));	
} else {
	header('Location:index.php?page=manage_purchase_partner');
}

/*if(isset($_REQUEST['id']) && $_REQUEST['id']!=''){		
	$id = mysqli_real_escape_string($con, trim($_REQUEST['id']));
	if(isset($_REQUEST['action']) && $_REQUEST['action']=='delete'){
		$delete = mysqli_query($con, "DELETE FROM tbl_admin_tech_incomes WHERE id = '".$id."'");
		if($delete){
			$success = 'The record has been deleted';
			header('Location:index.php?page=tech_incomes&tech_id='.$techId.'&success='.$success);
			exit();
		} else {
			$error = 'Unable to delete';
		}
	}	
}*/ 


$select = "SELECT * FROM tbl_admin_shop_incomes WHERE purchase_id = '".$shopId."' ORDER BY id DESC";
//echo $select;
// Using pagination class
$pagination = new pagination_noseo($select);
$execDetails = $pagination->createPages(30);

$pageLnk = 'index.php?page='.$page.'&'.$pageVars;
$pageNums = $pagination->pageNumber(5, $pageLnk);
?>