403Webshell
Server IP : 210.245.233.93  /  Your IP : 216.73.216.226
Web Server : Apache/2.2.15 (CentOS)
System : Linux webserver2.onesolution.com.hk 2.6.32-754.35.1.el6.x86_64 #1 SMP Sat Nov 7 12:42:14 UTC 2020 x86_64
User : apache ( 48)
PHP Version : 5.3.3
Disable Function : exec, shell_exec, system, passthru, popen, proc_open, pcntl_exec
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/hkosl.com/e-ims/file_manager/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/hkosl.com/e-ims/file_manager/report.php
<script type="text/javascript">
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
</script>
<script type="text/javascript">
$(document).ready(function() {
	$('#check_all')
		.click(function() {
			if($(this).is(':checked')) {
				$(".checkbox").prop('checked', true);
			}	else	{
				$(".checkbox").prop('checked', false);
			}
	});
	$('#export_report_btn')
		.click(function() {
			$('#searchreport').attr('action', "export_report.php").submit();
	});
	$('#addreport_btn')
		.click(function() {
			$('#addreport').submit();
	});
	$('#year')
		.change(function() {
			$('#searchreport').submit();
	});
	$("#addreport").validate({
		rules: {
			add_report_date: "required",
			field_a: {
				required: true,
				number: true
			},
			field_b: {
				required: true,
				number: true
			},
			field_c: {
				required: true,
				number: true
			},
			field_d: {
				required: true,
				number: true
			}
		},
		messages: {
			add_report_date: {
				required: "Please Select a Date"
			}
		}
	});
});
</script>
<!--- Select Calendar Date --->
<link rel="stylesheet" href="css/datepicker.css">
<script>
$(function() {
	$( "#add_report_date" ).datepicker({
		dateFormat: 'yy-mm-dd'
	});	
});
</script>
<!--- End Select Calendar Date --->
<?php
include 'config.php';

// Check if the user is logged in

if ((!isSet($_SESSION['loginname'])) || ($loggin <> '1'))
{
header("Location: login.php");
exit;
}
?>
<?php
$index = (int)$_GET["index"];

if (!empty($_GET["year"])){
	$year = (int)$_GET["year"];
	$date_form = htmlspecialchars($_GET["year"],ENT_QUOTES)."-01-01";
	$date_to = htmlspecialchars($_GET["year"],ENT_QUOTES)."-12-31";
}	else	{
	$year = date("Y");
	$date_form = date("Y")."-01-01";
	$date_to = date("Y")."-12-31";
}

if($_SESSION['role'] == 'User'){
	$company_check_sql = "SELECT * FROM file_company_user Where userid=:userid";
	$company_check = Db::getDbh()->prepare($company_check_sql);
	$company_check->execute(array(":userid" => $_SESSION['loginid']));
	if( $error = $company_check->getError(array(":userid" => $_SESSION['loginid'])) ){
		var_dump($error);
	}
	$row_company_check = $company_check->fetch(PDO::FETCH_ASSOC);
	$companyid = $row_company_check{'companyid'};
}	else	{
	if(empty($_GET["companyid"])){
		$company_check_sql = "SELECT * FROM file_company Where status = '1' order by sort ASC Limit 1";
		$company_check = Db::getDbh()->prepare($company_check_sql);
		$company_check->execute();
		if( $error = $company_check->getError() ){
			var_dump($error);
		}
		$row_company_check = $company_check->fetch(PDO::FETCH_ASSOC);
		$companyid = $row_company_check{'companyid'};
	}	else	{
		$companyid = (int)$_GET["companyid"];
	}
}


$user_role_check_sql = "SELECT file_role.title FROM file_role_user INNER JOIN file_role ON file_role.roleid = file_role_user.roleid WHERE userid=:userid";
$user_role_check = Db::getDbh()->prepare($user_role_check_sql);
$user_role_check->execute(array(":userid" => $_SESSION['loginid']));
if( $error = $user_role_check->getError(array(":userid" => $_SESSION['loginid'])) ){
	var_dump($error);
}
$role_count = $user_role_check->rowCount();
if ($role_count > 0) {
	$row_user_role_check = $user_role_check->fetch(PDO::FETCH_ASSOC);
}

?>
<script type="text/javascript">
$(document).ready(function(e) {
	$('#cancel_btn')
		.click(function() {
			window.location.href = 'index.php?index=<?=$index;?>&companyid=<?=$companyid;?>';
	});
});
</script>
<?php
//print_r($date_to); 
//exit;

if($_REQUEST["addreport"] == "1"){
    echo"<form action='add_report.php' method='post' name='addreport' id='addreport' enctype='multipart/form-data'>
			<input type='hidden' name='index' value='".$index."' />
			<input type='hidden' name='companyid' value='".$companyid."' />
			<input type='hidden' name='folderid' value='0' />";
	echo"	<div class='tab_title'>Report</div>
			<div class='tab_content'>
				<table class='tab_report_addtable' width='600' border='0' cellspacing='0' cellpadding='0'>";
	if(($_SESSION['role'] == 'Superadmin') || ($_SESSION['role'] == 'Admin')){
		echo"	  <tr>
					<td width='100'>Company</td>
					<td width='300'>";
					echo"<select name='select_companyid' onChange=\"MM_jumpMenu('self',this,0)\">";
					$company_list_sql = "SELECT * FROM file_company Where status = '1' ORDER BY sort ASC";
					$company_list = Db::getDbh()->prepare($company_list_sql);
					$company_list->execute();
					if( $error = $company_list->getError() ){
						var_dump($error);
					}
					while ($row_company_list = $company_list->fetch(PDO::FETCH_ASSOC)){
						echo"<option value='index.php?index=".$index."&companyid=".$row_company_list{'companyid'}."&addreport=1' ".getSelect($companyid, $row_company_list{'companyid'}).">".$row_company_list{'title'}."</option>";
					}
					echo"</select>
					</td>
				  </tr>";
	}
	echo"		  <tr>
					<td width='100'>Date</td>
					<td width='100'>
						<input type='text' id='add_report_date' name='add_report_date' readonly>
					</td>
					<td colspan='4'></td>
				  </tr>
				  <tr>
					<td colspan='6'>
						<div class='subtitle2'>For cargo assigned for carriage onboard</div>
						<div class='title2'>PASSENGER AIRCRAFT</div>
					</td>
				  </tr>
				  <tr>
					<td width='300' colspan='3'>Gross Weight of Cargo screened by x-ray(kg)</td>
					<td width='100'></td>
					<td width='200' colspan='2'>Gross Weight of Cargo(kg)</td>
				  </tr>
				  <tr>
					<td width='100'>(a)</td>
					<td width='100'>
						<input type='text' name='field_a' id='field_a'>
					</td>
					<td></td>
					<td></td>
					<td width='100'>(b)</td>
					<td width='100'>
						<input type='text' name='field_b' id='field_b'>
					</td>
				  </tr>
				  <tr>
					<td colspan='6'>
						<div class='subtitle2'>For cargo assigned for carriage onboard</div>
						<div class='title2'>ALL-CARGO AIRCRAFT</div>
					</td>
				  </tr>
				  <tr>
					<td width='300' colspan='3'>Gross Weight of Cargo screened by x-ray(kg)</td>
					<td width='100'></td>
					<td width='200' colspan='2'>Gross Weight of Cargo(kg)</td>
				  </tr>
				  <tr>
					<td width='100'>(c)</td>
					<td width='100'>
						<input type='text' name='field_c' id='field_c'>
					</td>
					<td></td>
					<td></td>
					<td width='100'>(d)</td>
					<td width='100'>
						<input type='text' name='field_d' id='field_d'>
					</td>
				  </tr>
				  <tr>
					<td colspan='6'>
						<input type='file' name='filename[1]' style='border:none;'>
					</td>
				  </tr>
				  <tr>
					<td colspan='6'>
						<input type='file' name='filename[2]' style='border:none;'>
					</td>
				  </tr>
				  <tr>
					<td colspan='6'>
						<input type='file' name='filename[3]' style='border:none;'>
					</td>
				  </tr>
				  <tr>
					<td colspan='6'>
						<input type='file' name='filename[4]' style='border:none;'>
					</td>
				  </tr>
				  <tr>
					<td colspan='6'>
						<input type='file' name='filename[5]' style='border:none;'>
					</td>
				  </tr>
				  <tr>
					<td colspan='6'>
						<a href='#' id='addreport_btn'><div class='tab_content_btn' style='width:50px; background:url(images/save_btn.png) center center no-repeat;'></div></a>
						<a href='#' id='cancel_btn'><div class='tab_content_btn' style='width:50px; background:url(images/cancel_btn.png) center center no-repeat;'></div></a>
					</td>
				  </tr>
				</table>
			</div>
		</table>";

}	else	{
	echo"<form action='index.php' method='post' name='searchreport' id='searchreport' enctype='multipart/form-data'>
			<input type='hidden' name='index' value='".$index."' />
			<input type='hidden' name='companyid' value='".$companyid."' />";
	if(($_SESSION['role'] == 'Superadmin') || ($_SESSION['role'] == 'Admin')){
		echo"<br>";
		echo"<select name='select_companyid' onChange=\"MM_jumpMenu('self',this,0)\">";
		$company_list_sql = "SELECT * FROM file_company Where status = '1' ORDER BY sort ASC";
		$company_list = Db::getDbh()->prepare($company_list_sql);
		$company_list->execute();
		if( $error = $company_list->getError() ){
			var_dump($error);
		}
		while ($row_company_list = $company_list->fetch(PDO::FETCH_ASSOC)){
			echo"<option value='index.php?index=".$index."&companyid=".$row_company_list{'companyid'}."' ".getSelect($companyid, $row_company_list{'companyid'}).">".$row_company_list{'title'}."</option>";
		}
		echo"</select>";
	}
	echo"	<div class='tab_title'>Report</div>
			<div class='tab_content'>
				<div class='date_frame'>Year
				<select name='year' id='year'>";
	for($i=2014;$i<=2100;$i++){	
		echo"<option value='".$i."' ".getSelect($i, $year).">".$i."</option>";
	}
	echo"		</select>
				</div>
				<a href='#' id='export_report_btn'><div class='tab_content_btn' style='width: 80px; background:url(images/export_btn.png) center center no-repeat;'></div></a>";
	echo"</form>";
	echo"<form action='delete_report.php' method='post' name='deletereport' enctype='multipart/form-data'>
			<input type='hidden' name='index' value='".$index."' />";
	if($_SESSION['role'] == 'Superadmin' || $_SESSION['role'] == 'Admin' || $row_user_role_check{'title'} == 'Admin'){
		echo"	<a href='#' onclick='deletereport.submit()'><div class='tab_content_btn' style='width: 80px; background: url(images/delete_btn.png) center center no-repeat; float: right; margin-right: 0px;'></div></a>
				<a href='index.php?index=".$index."&companyid=".$companyid."&addreport=1'><div class='tab_content_btn' style='width:60px; background:url(images/add_btn.png) center center no-repeat; float: right;'></div></a>";
	}
	echo"		<div style='clear:both;'></div>
				<table class='tab_report_table' width='100%' border='0' cellspacing='0' cellpadding='0'>
				  <tr>
					<td style='border-right:none;'></td>
					<td colspan='2' style='border-left:none;' valign='bottom'><div class='title' style='text-align:left;'>DATE</div></td>
					<td colspan='2' valign='bottom'>
						<div class='subtitle'>For cargo assigned for carriage onboard</div>
						<div class='title'>PASSENGER AIRCRAFT</div>
					</td>
					<td colspan='2' valign='bottom'>
						<div class='subtitle'>For cargo assigned for carriage onboard</div>
						<div class='title'>ALL-CARGO AIRCRAFT</div>
					</td>
					<td colspan='3' valign='bottom'>
						<div class='title'>TOTAL</div>
					</td>
				  </tr>
				  <tr>
					<td class='title_cell' width='20' valign='top' style='border-right:none;'>";
	if($_SESSION['role'] == 'Superadmin' || $_SESSION['role'] == 'Admin' || $row_user_role_check{'title'} == 'Admin'){
		echo"		<input type='checkbox' class='check_all' id='check_all'>";
	}
	echo"			</td>
					<td class='title_cell' width='55' valign='top' style='border-left:none;'>";
	if($_SESSION['role'] == 'Superadmin' || $_SESSION['role'] == 'Admin' || $row_user_role_check{'title'} == 'Admin'){
		echo"			Select All";
	}
	echo"			</td>
					<td class='title_cell' width='86' valign='top'>File</td>
					<td class='title_cell' width='100' valign='top'>Gross Weight of Cargo screened by x-ray (kg)<br>(a)</td>
					<td class='title_cell' width='100' valign='top'>Gross Weight of Cargo (kg)<br><br>(b)</td>
					<td class='title_cell' width='100' valign='top'>Gross Weight of Cargo screened by x-ray (kg)<br>(c)</td>
					<td class='title_cell' width='100' valign='top'>Gross Weight of Cargo (kg)<br><br>(d)</td>
					<td class='title_cell' width='98' valign='top'>Gross Weight of Cargo screened by x-ray (kg)<br>(e) = (a) +(c)</td>
					<td class='title_cell' width='98' valign='top'>Gross Weight of Cargo (kg)<br><br>(f) = (b) +(d)</td>
					<td class='title_cell' width='98' valign='top'>Percentage (%)<br><br><br>(e) / (f) x100%</td>
				  </tr>";
	$i = 0;
	$report_list_sql = "select * from report_content where companyid=:companyid AND status = '1' AND date>=:date_form AND date<=:date_to order by date DESC";
	$report_list = Db::getDbh()->prepare($report_list_sql);
	$report_list->execute(array(":companyid" => $companyid, ":date_form" => $date_form, ":date_to" => $date_to));
	if( $error = $report_list->getError(array(":companyid" => $companyid, ":date_form" => $date_form, ":date_to" => $date_to)) ){
		var_dump($error);
	}
	while ($row_report_list = $report_list->fetch(PDO::FETCH_ASSOC)){
		$field_a = $row_report_list{'field_a'};
		$total_a[] = $field_a;
		$field_b = $row_report_list{'field_b'};
		$total_b[] = $field_b;
		$field_c = $row_report_list{'field_c'};
		$total_c[] = $field_c;
		$field_d = $row_report_list{'field_d'};
		$total_d[] = $field_d;
		$field_e = $row_report_list{'field_a'} + $row_report_list{'field_c'};
		$total_e[] = $field_e;
		$field_f = $row_report_list{'field_b'} + $row_report_list{'field_d'};
		$total_f[] = $field_f;
		$field_g = round(($field_e / $field_f * 100), 2);
		echo"	  <tr>
					<td valign='top' style='border-right:none;'>";
		if($_SESSION['role'] == 'Superadmin' || $_SESSION['role'] == 'Admin' || $row_user_role_check{'title'} == 'Admin'){
			echo"		<input type='checkbox' class='checkbox' name='reportid[".$i."]' value='".$row_report_list{'reportid'}."'>";
		}
		echo"		</td>
					<td valign='top' style='border-left:none;'>".date('Y/m', strtotime($row_report_list{'date'}))."</td>
					<td valign='top' style='text-align:left;'>";
		$file_info_sql = "select * from file_content where companyid=:companyid AND refid=:refid AND status = '1'";
		$file_info = Db::getDbh()->prepare($file_info_sql);
		$file_info->execute(array(":companyid" => $companyid, ":refid" => $row_report_list{'reportid'}));
		if( $error = $file_info->getError(array(":companyid" => $companyid, ":refid" => $row_report_list{'reportid'})) ){
			var_dump($error);
		}
		$i= 1;
		while($row_file_info = $file_info->fetch(PDO::FETCH_ASSOC)){
			echo"<a href='getfile.php?id=".$row_file_info{'hash'}."'>QCP record 0".$i."</a><br>";
			$i++;
		}
		echo"		</td>
					<td valign='top'>".$field_a."</td>
					<td valign='top'>".$field_b."</td>
					<td valign='top'>".$field_c."</td>
					<td valign='top'>".$field_d."</td>
					<td valign='top'>".$field_e."</td>
					<td valign='top'>".$field_f."</td>
					<td valign='top'>".$field_g."</td>
				  </tr>";
		$i++;
	}
	if(is_array($total_a)){
		$display_a = array_sum($total_a);
	}	else	{
		$display_a = 0;
	}
	if(is_array($total_b)){
		$display_b = array_sum($total_b);
	}	else	{
		$display_b = 0;
	}
	if(is_array($total_c)){
		$display_c = array_sum($total_c);
	}	else	{
		$display_c = 0;
	}
	if(is_array($total_d)){
		$display_d = array_sum($total_d);
	}	else	{
		$display_d = 0;
	}
	if(is_array($total_e)){
		$display_e = array_sum($total_e);
	}	else	{
		$display_e = 0;
	}
	if(is_array($total_f)){
		$display_f = array_sum($total_f);
	}	else	{
		$display_f = 0;
	}
	if(is_array($total_e) && is_array($total_f)){
		$display_g = round((array_sum($total_e) / array_sum($total_f) * 100), 2);
	}	else	{
		$display_g = 0;
	}
	echo"		  <tr>
					<td style='border-right:none;'></td>
					<td class='title_total' style='border-left:none;text-align:left;'>TOTAL</td>
					<td class='title_total'></td>
					<td class='title_total'>".$display_a."</td>
					<td class='title_total'>".$display_b."</td>
					<td class='title_total'>".$display_c."</td>
					<td class='title_total'>".$display_d."</td>
					<td class='title_total'>".$display_e."</td>
					<td class='title_total'>".$display_f."</td>
					<td class='title_total'>".$display_g."</td>
				  </tr>
				</table>
				</form>
			</div>";
}
function getSelect($field1, $field2)
{
	if ($field1 == $field2)
	{
		return "selected";
	}
	else
	{
		return "";
	}
}

?>

Youez - 2016 - github.com/yon3zu
LinuXploit