| 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/workgroup/กลุ่มงานเทคนิคการแพทย์/ |
Upload File : |
<?php
if (isset($_GET['Month'])) $MonthRP = $_GET['Month'];
else $MonthRP = date('m');
if (isset($_GET['Year'])) $YearRP = $_GET['Year'];
else $YearRP = date('Y')+543;
$nyear = $YearRP-543;
if ( $MonthRP == 'All' ) {
$startd = ($nyear-1).'-10-01';
$stopd = $nyear.'-09-30';
} else {
$startd = $nyear.'-'.$MonthRP.'-01';
$stopd = $nyear.'-'.($MonthRP+1).'-01';
}
//ตั้งค่าการเชื่อมต่อฐานข้อมูล
$database_host = '192.168.1.39';
$database_port = '3306';
$database_username = 'root';
$database_password = '090407';
$database_name = 'report';
$mysqli = new mysqli($database_host, $database_username, $database_password, $database_name, $database_port);
$mysqli->set_charset("utf8");
if ($mysqli->connect_error) {
die('Error : ('. $mysqli->connect_errno .') '. $mysqli->connect_error);
}
$get_user = $mysqli->query('SELECT * FROM lab where date>= "'.$startd.'" AND date<"'.$stopd.'"');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<script type="text/javascript">
function getValue(vname)
{
var n = document.getElementById(vname).value
return n;
}
function changeFunc() {
var URL;
URL = "<?php echo $_SERVER['PHP_SELF'] ?>";
URL += "?&Month=";
URL += getValue('MonthRP');
URL+="&Year=";
URL+=getValue('Cyear');
//alert(URL);
//"RedirectURL('.$RepId.','.$row["ItemID"].','.$RepYear.',\''.$RepMonth.'\','.$RepYCP.',\''.$RepMCP.'\');return false;"
window.location= URL;
}
</script>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>รายงานLab</title>
<!-- Bootstrap -->
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<table width = "67%" height="28" border="0" cellpadding="0" cellspacing="2">
<tr>
<td width="62%" height="28" ><div align="right">รายงานสถิติผู้มารับบริการประจำ</div></td>
<td width="8%" height="28"><div align="right">เดือน </div></td>
<td width="7%" height="28" >
<select name="MonthRP" id="MonthRP" onChange="changeFunc()" >
<option value="All" <?php if($MonthRP == 'All'){echo("selected");}?>>All</option>
<option value="01" <?php if($MonthRP == '01'){echo("selected");}?>>มกราคม</option>
<option value="02" <?php if($MonthRP == '02'){echo("selected");}?>>กุมภาพันธ์</option>
<option value="03" <?php if($MonthRP == '03'){echo("selected");}?>>มีนาคม</option>
<option value="04" <?php if($MonthRP == '04'){echo("selected");}?>>เมษายน</option>
<option value="05" <?php if($MonthRP == '05'){echo("selected");}?>>พฤษภาคม</option>
<option value="06" <?php if($MonthRP == '06'){echo("selected");}?>>มิถุนายน</option>
<option value="07" <?php if($MonthRP == '07'){echo("selected");}?>>กรกฎาคม</option>
<option value="08" <?php if($MonthRP == '08'){echo("selected");}?>>สิงหาคม</option>
<option value="09" <?php if($MonthRP == '09'){echo("selected");}?>>กันยายน</option>
<option value="10" <?php if($MonthRP == '10'){echo("selected");}?>>ตุลาคม</option>
<option value="11" <?php if($MonthRP == '11'){echo("selected");}?>>พฤศจิกายน</option>
<option value="12" <?php if($MonthRP == '12'){echo("selected");}?>>ธันวาคม</option>
</select>
<td width="16%" height="28" ><div align="right">ปีงบประมาณ </div></td>
<td width="7%" height="28"><font size="2" face="Microsoft Sans Serif, MS Sans Serif, sans-serif">
<?php echo '<input name="regist" type="text" id="Cyear" value = "'.$YearRP.'" size="4" maxlength="4" >'; ?></font></td>
</tr>
</table>
<div align="right">
<style>
table, td, th {
border: 2px solid green; //กำหนดความหนาและสีของเส้นขอบ
}
th {
background-color: #3366cc; //กำหนดสีพื้นหลังของหัวตาราง
}
</style>
<table width="7%" class="table" id="datatable">
<thead>
<th>วันที่</th>
<th>IPD</th>
<th>ER</th>
<th>LR</th>
<th>OPD</th>
<th>ต่างด้าว</th>
<th>เคสคดี</th>
<th>รพ.สต.</th>
<th>รวม</th>
<th>เวรดึก</th>
<th>จำนวนผู้เจาะเลือด(ราย)</th>
<th>จำนวนผู้ป่วยนอกเวลา(ราย)</th>
<th>จำนวนส่งตรวจLabนอก(ราย)</th>
</thead>
<?php
$a1=0;
$b1=0;
$c1=0;
$d1=0;
$e1=0;
$f1=0;
$g1=0;
$h1=0;
$i1=0;
$j1=0;
$k1=0;
$l1=0;
while($lab = $get_user->fetch_array()){
echo "<td>".$lab['date']."</td>";
echo "<td align='right'><span>".$lab['a1']."</span></td>";
echo "<td align='right'><span>".$lab['b1']."</span></td>";
echo "<td align='right'><span>".$lab['c1']."</span></td>";
echo "<td align='right'><span>".$lab['d1']."</span></td>";
echo "<td align='right'><span>".$lab['e1']."</span></td>";
echo "<td align='right'><span>".$lab['f1']."</span></td>";
echo "<td align='right'><span>".$lab['g1']."</span></td>";
echo "<td align='right'><span>".$lab['h1']."</span></td>";
echo "<td align='right'><span>".$lab['i1']."</span></td>";
echo "<td align='right'><span>".$lab['j1']."</span></td>";
echo "<td align='right'><span>".$lab['k1']."</span></td>";
echo "<td align='right'><span>".$lab['l1']."</span></td>";
echo"</tr>";
$a1=$a1+$lab['a1'];
$b1=$b1+$lab['b1'];
$c1=$c1+$lab['c1'];
$d1=$d1+$lab['d1'];
$e1=$e1+$lab['e1'];
$f1=$f1+$lab['f1'];
$g1=$g1+$lab['g1'];
$h1=$h1+$lab['h1'];
$i1=$i1+$lab['i1'];
$j1=$j1+$lab['j1'];
$k1=$k1+$lab['k1'];
$l1=$l1+$lab['l1'];
}
echo "<tr><td>รวม</td>";
echo "<td align='right'>".$a1."</td>";
echo "<td align='right'>".$b1."</td>";
echo "<td align='right'>".$c1."</td>";
echo "<td align='right'>".$d1."</td>";
echo "<td align='right'>".$e1."</td>";
echo "<td align='right'>".$f1."</td>";
echo "<td align='right'>".$g1."</td>";
echo "<td align='right'>".$h1."</td>";
echo "<td align='right'>".$i1."</td>";
echo "<td align='right'>".$j1."</td>";
echo "<td align='right'>".$k1."</td>";
echo "<td align='right'>".$l1."</td>";
echo"</tr>";
mysqli_free_result($get_user);
?>
</tbody>
</table>
</div>