-
Notifications
You must be signed in to change notification settings - Fork 0
/
elec_list_daily_report_engg.php
227 lines (221 loc) · 9.03 KB
/
elec_list_daily_report_engg.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
<?
include("inc/elec_header.php");
?>
<script>
function overlay(id) {
el = document.getElementById("overlay");
document.getElementById("hidden_overlay").value=id;
el.style.visibility = (el.style.visibility == "visible") ? "hidden" : "visible";
}
function getDataInDiv(divId,page,byControl)
{
if(byControl=="DateFromTo")
{
var from=document.getElementById('RDFrom').value;
var to=document.getElementById('RDTo').value;
if(from=='' || to=='')
alert('Select Date');
else
{
var value=from+','+to;
strURL1=page+"?value="+value+"&byControl="+byControl;
strURL1=page+"?value="+value+"&byControl="+byControl;
//alert(strURL1);
var req = getXMLHTTP();
if (req)
{
req.onreadystatechange = function() {
if (req.readyState == 4) {
if (req.status == 200)
document.getElementById(divId).innerHTML=req.responseText;
else
alert("There was a problem while using XMLHTTP:\n" + req.statusText);
}
}
req.open("GET", strURL1, true);
req.send(null);
}
}
}
}
</script>
<?
$Page = "elec_list_daily_report_engg.php";
$PageTitle = "List Daily Report";
$PageFor = "Daily Report";
$PageKey = "DailyReportId";
$PageKeyValue = "";
$Message = "";
?>
<?
if(isset($_GET["Message"]))
{
$Message = $_GET["Message"];
}
if(isset($_POST["btn_del"]))
{
$PageKeyValue = $_POST["hidden_overlay"];
$sql = "delete from elec_daily_report_engg where $PageKey = '".$PageKeyValue."'";
if(mysql_query ($sql))
{
$Message = "Record Sucessfully Deleted";
}
//$Message = "Order Sucessfully Deleted";
redirect("$Page?Message=$Message");
}
?>
<?
$sql="select * from elec_daily_report_engg order by DailyReportDate asc";
$result=mysql_query($sql);
?>
<table width="98%" cellpadding="0" cellspacing="0" align="center" border="0">
<tr>
<td align="left" valign="top" width="230px" style="padding-top:5px;">
<? include ("inc/elec_snb.php"); ?>
</td>
<td style="padding-left:5px; padding-top:5px;" valign="top">
<table align="center" width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td align="center" class="gray_bg">
<img src="images/bullet.gif" width="15" height="22"/> List Daily Report
</td>
</tr>
<tr>
<td valign="top">
<table align="center" width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td align="center" class="border" >
<div id="div_message" style="color:#399;font-size:16px;font-weight:bold;"><?=$Message?></div>
<table id="" align="center" width="100%" border="1" class="table1 text_1">
<tr>
<td align="center" colspan="4"><b>Search Items</b></td>
</tr>
<tr>
<td align="left"><b>Date From</b></td>
<td align="left">
<input type="text" name="RDFrom" id="RDFrom" />
<a href="javascript:void(0)" onClick="gfPop.fPopCalendar(document.getElementById('RDFrom'));return false;" HIDEFOCUS>
<img name="popcal" align="absbottom" src="./calendar/calbtn.gif" width="34" height="22" border="0" alt="">
</a>
</td>
<td align="left"><b>Date To</b></td>
<td align="left">
<input type="text" name="RDTo" id="RDTo" />
<a href="javascript:void(0)" onClick="gfPop.fPopCalendar(document.getElementById('RDTo'));return false;" HIDEFOCUS>
<img name="popcal" align="absbottom" src="./calendar/calbtn.gif" width="34" height="22" border="0" alt="">
</a>
<input type="button" id="btnOk" name="btnOk" value="Ok" onclick="getDataInDiv('getDataInDiv','elec_get_list_daily_report_engg.php','DateFromTo')"/>
</td>
</tr>
</table>
<div id="getDataInDiv" style="margin:0 auto;width:100%;overflow:auto;height:600px">
<table align="center" width="100%" cellpadding="0" cellspacing="0" border="0" class="tableborder">
<tr>
<td valign="top">
<table align="center" id="tableEntry" width="100%" border="1" class="table1 text_1">
<tr>
<td class="gredBg">S.No.</td>
<td class="gredBg">DailyReportId</td>
<td class="gredBg">DailyReportDate</td>
<td class="gredBg">UnitConsumption</td>
<td class="gredBg">MaxDemand</td>
<td class="gredBg">LoadFactor</td>
<td class="gredBg">PowerFactor</td>
<td class="gredBg">LightingUnit</td>
<td class="gredBg">ColonyUnit</td>
<td class="gredBg">T. F. O.</td>
<td class="gredBg">CompressorUnit</td>
<td width="4%" class="gredBg">Edit</td>
<td width="4%" class="gredBg">Delete</td>
</tr>
<?
if(mysql_num_rows($result)>0)
{
$sno =1;
while($row=mysql_fetch_array($result))
{
$sql_idate="select * from elec_daily_report_engg where InsertDate='".date('Y-m-d')."' and DailyReportId='".$row['DailyReportId']."'";
$res_idate=mysql_query($sql_idate);
$row_idate=mysql_fetch_array($res_idate);
$insert_date=$row_idate['InsertDate'];
?>
<tr <? if ($sno%2==1) { ?> bgcolor="#F5F2F1" <? } ?>>
<td align="center"><?=$sno?></td>
<td align="center"><?= $row['DailyReportId']?></td>
<td align="center"><?= getDateFormate($row['DailyReportDate'])?></td>
<td align="center"><?= $row['UnitConsumption']?></td>
<td align="center"><?= $row['MaxDemand']?></td>
<td align="center"><?= $row['LoadFactor']?></td>
<td align="center"><?= $row['PowerFactor']?></td>
<td align="center"><?= $row['LightingUnit']?></td>
<td align="center"><?= $row['ColonyUnit']?></td>
<td align="center"><?= $row['TFO']?></td>
<td align="center"><?= $row['CompressorUnit']?></td>
<?
if(1)
{
//$SessionUserType=='Administrator' || (date('Y-m-d')==$insert_date)
?>
<td align="center">
<a href="elec_add_daily_report_engg.php?DailyReportId=<?=$row["DailyReportId"]?>&mode=edit">
<img src="images/icon_edit.gif" alt="Edit" title="Edit" border="0" />
</a>
</td>
<td align="center">
<a href="javascript:;" onClick="overlay(<?=$row["DailyReportId"]?>);">
<img src="images/delete_icon.gif" alt="Delete" title="Delete" border="0">
</a>
</td>
<?
}
else
{
?>
<td align="center"></td>
<td align="center"></td>
<?
}
?>
</tr>
<?
$sno++;
}
}
else
{
?>
<tr>
<td colspan="12" align="center"><b>No Records Found</b></td>
</tr>
<?
}
?>
</table>
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<iframe width=168 height=190 name="gToday:normal:agenda.js" id="gToday:normal:agenda.js" src="calendar/ipopeng.htm" scrolling="no" frameborder="0" style="border:2px ridge; visibility:visible; z-index:999; position:absolute; left:-500px; top:0px;">
</iframe>
<div id="overlay">
<div class="form_msg">
<p>Are you sure to delete this Item</p>
<form name="frm_del" action="<?=$_SERVER['PHP_SELF']?>" method="post">
<input type="hidden" name="hidden_overlay" id="hidden_overlay" value="" />
<input type="submit" name="btn_del" value="Yes" />
<input type="button" onClick="overlay();" name="btn_close" value="No" />
</form>
</div>
</div>
<?
include("inc/hr_footer.php");
?>