<?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['id']) && $_REQUEST['id']!=''){
	$projectId = trim($_REQUEST['id']);
	$projRec = mysqli_fetch_array(mysqli_query($con, "SELECT status FROM tbl_project WHERE id = '".$projectId."'"));
	$projStatus = $projRec['status'];
} else {
	header('Location:index.php?page=manage_projects');
			exit();
}

$totalExpense = 0;
$totalProfit = 0;
$accountsArray = array();


$expenseRs = mysqli_query($con, "SELECT * FROM tbl_project_expense WHERE project_id = '".$projectId."' ORDER BY id DESC");

$paymentsRs = mysqli_query($con, "SELECT * FROM tbl_project_income WHERE project_id = '".$projectId."' ORDER BY id DESC");

//for accounts view
$expenseRs1 = mysqli_query($con, "SELECT * FROM tbl_project_expense WHERE project_id = '".$projectId."' ORDER BY id DESC");
$paymentsRs1 = mysqli_query($con, "SELECT * FROM tbl_project_income WHERE project_id = '".$projectId."' ORDER BY id DESC");

?>