403Webshell
Server IP : 134.236.49.22  /  Your IP : 216.73.216.114
Web Server : Apache/2.2.15 (Fedora)
System : Linux km10.dyndns.org 2.6.31.5-127.fc12.i686.PAE #1 SMP Sat Nov 7 21:25:57 EST 2009 i686
User : apache ( 48)
PHP Version : 5.3.3
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/html/KPI monitor/bak/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/KPI monitor/bak/ReportMonth_1.php
<?php
//ถ้า click ที่ กร๊าฟ  = DataInfo.php?&id_no=nnn&info=yyyymmdd
session_start();
include("dbconfig.php");
date_default_timezone_set('Asia/Bangkok');
mysql_select_db("KPI");
mysql_query("SET NAMES 'tis620'; ");
//mysql_query("SET NAMES utf8"); /*****/
if (!isset($_SESSION['pagecount'])) $_SESSION['pagecount']=0;
else $_SESSION['pagecount']=$_SESSION['pagecount']+1;
function chMonth($find){
	return  $_SESSION['mName'][$find-1];
}
$sql='select  *  from indicators where id_no='.$_SESSION['rIDNO'].' limit 1';
$result = mysql_query($sql);
$name1 ='';
$name2 ='';
while ($object = mysql_fetch_object($result)) {
	$name1 =iconv( 'TIS-620', 'UTF-8',$object -> name1);
	$name2 =iconv( 'TIS-620', 'UTF-8',$object -> name2);
}
if ($name1==='') $name1= 'จำนวนทั้งหมด';
if ($name2==='') $name2= 'ผลงานตัวชี้วัด';
if (isset($_GET['id_no'])) $idno = $_GET['id_no'];
else $idno='Unknown'; 
if (isset($_GET['st'])) $st = $_GET['st'];
else $st='N'; 
$pop=''; 
if ($st=='Y' && isset($_GET['pop'])) {
	$pop = $_GET['pop'];
	if ( $pop <>'') $pop = ' ( จำนวน:'.$pop.' )'; 
}	
if (isset($_GET['info'])) $subtitle = $_GET['info'];
else $subtitle='Unknown';
if (isset($_GET['RepName'])) $_SESSION['rName'] = $_GET['RepName'];
$cMonth= array_search(trim(substr($subtitle,0,strpos($subtitle,' '))),$_SESSION['mName']);//0-11
if ($cMonth <=2) $cMonth +=10;
else $cMonth = '0'.($cMonth-2);
$Savedate = (trim(substr($subtitle,strpos($subtitle,' ')))-543).'-'.$cMonth.'-01';
$LastDay = date('Y-m-t',strtotime($Savedate));
$sql="select * from result where  id_no=".$id_no." and date >= '".$Savedate."' and date <= '".$LastDay."' order by date" ;
$result=mysql_query($sql);
$numrows = mysql_num_rows($result);
$DList=''; //แสดงวันที่
$AList=''; //แสดงกร๊าฟจำนวนเป้า
$EList=''; //แสดงกร๊าฟจำนวน
$cur ='';
$last='00';
$suma=0;
$sumt=0;
while ($object = mysql_fetch_object($result)) {
	$day = substr(($object ->date),-2);
	//echo $day.'  '.$object ->amount.'   '.$object ->total.'<br>';
	if ($day == $last || $cur ==='') {  // วันที่ซ้ำหรือ ครั้งแรก
		if ($cur === '') $cur='00';  
		$last = $day;
		$suma += $object ->amount;
		$sumt += $object ->total;
	} else {
		for ($d = ($cur+1); $d <= $last; $d++) {
			//--Daylist
			if ($d <10) $d = '0'.($d+0);
			if ($DList==='') $DList='"'.$d.'"';
			else $DList .=',"'.$d.'"';
			
			if ($d == $last) {		//วันที่มีข้อมูล
				if ($EList === '') $EList=$suma;  //เศษ
				else $EList .= ','.$suma;
				
				if ($AList==='') $AList = $sumt; //ส่วน
				else $AList .= ','.$sumt;
				
			} else {						//วันที่ไม่มีข้อมูล
				if ($EList==='') $EList='"n"';
				else $EList .=',"n"';
				if ($AList==='') $AList='"n"';
				else $AList .=',"n"';
			}
		}
		$cur = $last;
		$last = $day;
		$suma = $object ->amount;
		$sumt = $object ->total;
	}
/*
	echo 'Dlist:'.$DList.'<br>';
	echo 'Elist:'.$EList.'<br>';
	echo 'Alist:'.$AList.'<br>';
*/
	
}
/*
echo '*******************<br>';
echo $last.'<br>';
*/
for ($d = ($cur+1); $d <= $last; $d++) {
	//--Daylist
	if ($d <10) $d = '0'.($d+0);
	if ($DList==='') $DList='"'.$d.'"';
	else $DList .=',"'.$d.'"';
	if ($d == $last) {
		if ($EList === '') $EList=$suma;  //เศษ
		else $EList .= ','.$suma;
				
		if ($AList==='') $AList = $sumt; //ส่วน
		else $AList .= ','.$sumt;

	} else {
		if ($EList==='') $EList='"n"';
		else $EList .=',"n"';
		if ($AList==='') $AList='"n"';
		else $AList .=',"n"';
	}
}
/*
	echo 'Dlist:'.$DList.'<br>';
	echo 'Elist:'.$EList.'<br>';
	echo 'Alist:'.$AList.'<br>';
*/
$cur = substr($LastDay,-2,2);
if ($last < $cur){
	for ($d = ($last+1); $d <= $cur; $d++) {
		if ($d <10) $d = '0'.($d+0);
		if ($DList==='') $DList='"'.$d.'"';
		else $DList .=',"'.$d.'"';
		if ($AList==='') $AList='"n"';
		else $AList .=',"n"';
		if ($EList==='') $EList='"n"';
		else $EList .=',"n"';
	}
}
/*
echo 'Dlist:'.$DList.'<br>';
echo 'Elist:'.$EList.'<br>';
echo 'Alist:'.$AList.'<br>';
*/
?>
<!DOCTYPE HTML>
<html>
  <head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title><?php echo $subtitle.'#'.$idno; ?></title>
	<style type="text/css">
	</style>
  </head>
  <body>
	<script src="Jcode/highcharts.js"></script>
	<script src="Jcode/modules/exporting.js"></script>
	<script src="Jcode/modules/export-data.js"></script>
	<div style="position: relative; padding: 10px;">
	<div id="container" style="min-width: 310px; height: 500px; margin: 0 auto"></div>
	<script type="text/javascript">
	Highcharts.chart('container', {
	  chart: {zoomType: 'xy',marginBottom: 80},
	  title: {text: '<?php echo iconv( 'TIS-620', 'UTF-8', $_SESSION['rName']).$pop ;  ?>'},
	  subtitle: {text: '<?php echo 'แสดงข้อมูลเดือน '.$subtitle.' แยกรายวัน'; ?>'},
	  xAxis: [{categories: [<?php echo $DList;?>],crosshair: true}],
	  yAxis: [
		{
		  title: {text: 'จำนวนผลงาน ',style: {color: Highcharts.getOptions().colors[4]}},
		  labels: {format: '{value} ',style: {color: Highcharts.getOptions().colors[4]}}},
		{ 
		  title: {text: '',style: {color: Highcharts.getOptions().colors[0]}},
		  labels: {format: '{value} ',style: {color: Highcharts.getOptions().colors[0]}},
		  opposite: true}
	  ],
	  plotOptions: {
            series: {
                cursor: 'pointer',
                point: {
                    events: {
                        click: function () { //DataInfo.php?&id_no=nnn&info=yyyymmdd
							var URL;
							URL="DataInfo.php?&id_no=<?php echo $_SESSION['rIDNO']; ?>";
							URL+= "&info=<?php echo substr($Savedate,0,8);?>";
							URL+= this.category;
						  	window.open(URL, '_blank');
						}
                    }
                }
            }
      },
	  
	  tooltip: {shared: true ,
		 
			formatter: function() {
				var points = this.points, 	tooltipArray = ['วันที่: <b>' + this.x + '</b>']
		  			points.forEach(function(point, index) {
					tooltipArray.push('<br>'+point.series.name+': <b>' + point.y + '</b>');
		  		});
		  		return tooltipArray;
			} 
			
	  
	  },
	  legend: {layout: 'vertical',align: 'left',x: 60, verticalAlign:  'bottom',y: 20,floating: true,
		backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF'},
	  series: [
		<?php 
			if ($st<>'Y') echo "{name: '".$name1."',type: 'column',yAxis: 0,data: [".$AList."],tooltip: {valueSuffix: ''}},";
		?>	
		{name: '<?php echo $name2;?>',type: 'column',yAxis: 0,data: [<?php echo $EList;?>],tooltip: {valueSuffix: ''}}
	  ]
	});
	function getValue(vname) 
	{ 
		var n = document.getElementById(vname).value
		return n;
	} 
	function changeFunc() {
    	var URL;
		URL= "<?php echo $_SERVER['PHP_SELF'] ?>";
		URL+= "?&MaxYear=";
		URL+= getValue('MaxYear');
		URL+= "&MaxMonth=";
		URL+= getValue('MaxMonth');
		URL+= "&MinYear=";
		URL+= getValue('MinYear');
		URL+= "&MinMonth=";
		URL+= getValue('MinMonth');
		URL+= "&id_no=<?php echo $_SESSION['rIDNO']; ?>";
		window.location= URL;
	}
</script>
	<p><p>หมายเหตุ ถ้าข้อมูลรวมในเดือนมีความคลาดเคลื่อน ให้ลงผลรายวัน วันใดวันหนึ่งใหม่ เพื่อให้ปรับปรุงยอดรวมของเดือนนั้นใหม่ทั้งหมด <br>
	พบการบันทึกข้อมูล = <?php  echo $numrows;?> Reccords<br>
	</body>
</html>

Youez - 2016 - github.com/yon3zu
LinuXploit