<?php
define('YUKEY', true);

require(str_replace('sicms','',dirname(__FILE__)) . '/includes/init.php');

	if($_SESSION['tbRank']<100) {
		exit('Access Denied');
	}

//check_login();
/*
require(ROOT_PATH . 'includes/lib_reports.php');
$active=!empty($_GET['active']) ? intval($_GET['active']) : 2;
$act=!empty($_REQUEST['act']) ? $_REQUEST['act'] : 'ready';
if($act=='ready')
{
	$total=count_item('tbResult','Rejected','reports',''); //总记录条数
	$page_num=20;  //每页显示的记录数
	$allpage=ceil($total/$page_num); //总页数
	$current_page=!empty($_GET['nowpage']) ? intval($_GET['nowpage']) : 1; //目前页数 
	$start_num=$page_num*($current_page-1); //$start_num 起始笔数
	$smarty->assign('active',$active);
	$smarty->assign('list_rep',report_list('tbResult','Rejected',$start_num,$page_num));
	$smarty->assign('all_page',$allpage);
	$smarty->assign('all_pages',listpage($allpage));
	$smarty->assign('now_page',$current_page);
	$smarty->display('rejected.dwt');
}

elseif($act=='loadsum'){
	     $id=!empty($_POST['id']) ? $_POST['id'] : '';
		 $s=get_row('',"tbPN,tbReportNumber,tbProductName,tbInspectionDate,tbLotQty,tbReInspectionNo","tbPN",$id,"reports");
		 echo json_encode($s);
}

elseif($act=='chgtrack'){
	$tbPN = !empty($_POST['tbPN']) ? $_POST['tbPN'] : '';
	$tbTrack = !empty($_POST['tbTrack']) ? $_POST['tbTrack'] : '';
	$sql="UPDATE " .$GLOBALS['prefix']->table('reports'). " SET" . " tbReInspectionNo='$tbTrack' WHERE tbPN='$tbPN'";
	if($tbPN!=''){
		if($GLOBALS['db']->query($sql)){
			echo $tbPN;
		}else{
			echo "<script type='text/JavaScript'>alert('Modify Fail,query error!');</script>";
			exit;
		}
	}else{
			echo "<script type='text/JavaScript'>alert('Get report id fail!');</script>";
			exit;
	}
}*/
?>