-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdistrict_summary.php
55 lines (51 loc) · 2.14 KB
/
district_summary.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
session_start();
include 'connection/config.php';
$year=$_POST['year'];
$epiweek=$_POST['epiweek'];
$district=$_SESSION['district_name'];
?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>IDSR</title>
<link href="css/idsr.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="scripts/jquery-1.6.1.min.js"></script>
</head>
<body>
<div class="fb1" align="center"><img name="accounts" src="images/naslogo.jpg" alt="" align="center" /><br><font color="#3B5998" >Integrated Disease Surveillance and Response<br></font>
<?php
echo "Epiweek:<font color=\"#008000\" ><u>".$epiweek."</u></font> District:<font color=\"#008000\" ><u>".$district."</u></font>";
?>
</div>
<div class="fb3"><a href="post_index.php"><img src="images/larrow.png" width="10" height="15" alt="" /> Back</a> </div>
<div class="fb3" align="center">
<?php
$sql="SELECT id FROM districts WHERE name = '$district'";
$rs=mysql_query($sql);
if($row=mysql_fetch_array($rs))
$district=$row['id'];
$sql="SELECT DISTINCT (facility) as facility FROM surveillance WHERE epiweek =$epiweek AND DATE =$year AND district =$district";
$rst=mysql_query($sql);
echo "Facilities with data:";
while($value=mysql_fetch_array($rst)){
$id=$value['facility'];
$sql="SELECT name FROM facilitys WHERE facilitycode = $id";
$res=mysql_query($sql);
$facility=mysql_fetch_array($res);
echo "<font color=\"green\">".$facility['name']."</font>";
echo "<br>";
}
echo "<br><br>Facilities WITHOUT data:<br>";
$sql="SELECT name FROM facilitys WHERE facilitycode NOT IN (SELECT DISTINCT (facility) as facility FROM surveillance WHERE epiweek =$epiweek AND DATE =$year AND district =$district) AND district =$district";
$rst=mysql_query($sql);
while($value=mysql_fetch_array($rst)){
$facility_name=$value['name'];
echo "<font color=\"red\">".$facility_name."</font>";
echo "<br>";
}
?>
</div>
</body>
</html>