Esempio n. 1
0
     $ect = "having chronicc like '%01%' and chronicc not like '%10%'";
 } elseif ($chronic == '04') {
     $ect = "having chronicc like '%10%'";
 } elseif ($chronic == '05') {
     $ect = "having chronicc like '%01%'";
 } else {
 }
 $sql = "select villname,concat(ifnull(titlename,'..') ,fname,' ',lname) as pname, FLOOR((TO_DAYS(NOW())-TO_DAYS(person.birth))/365.25) as age, house.hno,house.villcode,house.xgis,house.ygis,person.idcard,person.pcucodeperson,person.pid,pc.datefirstdiag,pc.datedxfirst,pc.datedischart,\nCASE\nwhen pc.typedischart='01' then 'หาย'\nwhen pc.typedischart='02' then 'ตาย'\nwhen pc.typedischart='03' then 'ยังรักษาอยู่ฯ'\nwhen pc.typedischart='04' then 'ไม่ทราบ(ไม่มีข้อมูล)'\nwhen pc.typedischart='05' then 'รอการจำหน่าย/เฝ้าระวัง'\nwhen pc.typedischart='06' then 'ยังรักษาอยู่ฯ'\nwhen pc.typedischart='07' then 'ครบการรักษาฯ'\nwhen pc.typedischart='08' then 'โรคอยู่ในภาวะสงบฯ'\nwhen pc.typedischart='09' then 'ปฏิเสธการรักษาฯ'\nwhen pc.typedischart='10' then 'ออกจากพื้นที่'\nelse null end AS typedischart,pc.cup\n,group_concat(dc.groupcode) as chronicc\n,group_concat(dc.groupname) as chronicx\nFROM personchronic pc\nleft join person ON pc.pid = person.pid and pc.pcucodeperson = person.pcucodeperson\nleft join house ON person.hcode = house.hcode and person.pcucodeperson = house.pcucode\nleft join village ON house.villcode = village.villcode\nleft join ctitle ON person.prename = ctitle.titlecode\nleft Join cdisease d ON pc.chroniccode = d.diseasecode\nleft Join cdiseasechronic dc ON d.codechronic = dc.groupcode\nwhere SUBSTRING(house.villcode,7,2) <> '00' AND pc.typedischart NOT IN  ('01', '02','07','10') and person.pid NOT IN (SELECT persondeath.pid FROM persondeath WHERE persondeath.pcucodeperson= person.pcucodeperson and (persondeath.deaddate IS NULL OR persondeath.deaddate<=now())) {$wvill}\ngroup by pc.pcucodeperson, pc.pid\n{$ect}\nORDER BY village.villcode,person.fname";
 $result = mysql_query($sql);
 $txt = '<p align=\'center\'><b>รายชื่อผู้ป่วยโรคเบาหวานความดันโลหิตสูง ';
 $txt .= "  {$mu} </b></p><br><b>{$hosp}</b><div class='table-responsive'><table width='98%' border='0' cellspacing='1' cellpadding='1' class='table table-striped table-hover table-bordered'>\n  <tr>\n    <th width='5%' scope='col'><div align='center'>ลำดับ</div></th>\n    <th width='14%' scope='col'><div align='center'>ชื่อ - สกุล</div></th>\n\t<th width='4%' scope='col'><div align='center'>อายุ</div></th>\n    <th width='5%' scope='col'><div align='center'>บ้านเลขที่</div></th>\n    <th width='4%' scope='col'><div align='center'>หมู่ที่</div></th>\n    <th width='13%' scope='col'><div align='center'>โรคเรื้อรัง</div></th>\n\t<th width='9%' scope='col'><div align='center'>วันที่วินิจฉัยครั้งแรก</div></th>\n\t<th width='7%' scope='col'><div align='center'>สถานะปัจจุบัน</div></th>\n\t<th width='17%' scope='col'><div align='center'>รพ.ประจำ</div></th>\n  </tr>";
 while ($row = mysql_fetch_array($result)) {
     $moo = substr($row[villcode], 6, 2);
     $vill = getMooVillage($row[villcode]);
     $title = getTitle($row[prename]);
     $pcuname = gethospname($row[cup]);
     if ($row[datefirstdiag] == "") {
         $sick = "...";
     } else {
         $sick = retDatets($row[datefirstdiag]);
     }
     if ($row[datedxfirst] == "") {
         $last = "...";
     } else {
         $last = retDatets($row[datedxfirst]);
     }
     ++$i;
     if ($i % 2 == 1) {
         $cr = " class='altrow'";
     } else {
         $cr = "";
Esempio n. 2
0
<?php

$user = $_SESSION[user_id];
$sql = "SELECT * FROM `user` where `user`.username = '******'";
$result = mysql_query($sql) or die(mysql_error());
$row = mysql_fetch_array($result);
$mtitle = $row['prename'];
$mpassword = $row['password'];
$mtitlename = getTitle($row['prename']);
$mfname = $row['fname'];
$mlname = $row['lname'];
$mname = $row['username'];
$mavatar = getavatar($row['username']);
$musername = getusername($row['username']);
$midcard = $row['idcard'];
$hospname = gethospname($row['pcucode']);
$mposition = getuserposition($row['username']);
?>
<section class="content-header">
	<h1>
	ข้อมูลส่วนตัว
   	</h1>
		<ol class="breadcrumb">
			<li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
			<li class="active">profile</li>
		</ol>
</section>
<section class="content">
	<div class="row">
		<div class="col-md-12">
			<!-- Primary box -->