-
Notifications
You must be signed in to change notification settings - Fork 0
/
addConstructionLabel.php
154 lines (137 loc) · 4.43 KB
/
addConstructionLabel.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
<?php
error_reporting(1);
ini_set('display_errors','1');
include("smartyConfig.php");
include("appWideConfig.php");
include("dbConfig.php");
include("includes/configs/configs.php");
if($constructionLead == false)
die("No Access");
include("builder_function.php");
AdminAuthentication();
if(!empty($_POST['label_txtbox']) && trim($_POST['label_txtbox']) !='' && $_POST['submit']=='Save'){
echo $QueryMember = "INSERT INTO updation_cycle (TIME_STAMP, LABEL, CYCLE_TYPE) values (now(), '".$_POST['label_txtbox']."', '".$_POST['cycleType']."')";
$QueryExecute = mysql_query($QueryMember) or die(mysql_error());
header("location:addConstructionLabel.php?m=1");
exit;
}
$labelDataArr = array();
$qry = "SELECT TIME_STAMP,LABEL,CYCLE_TYPE FROM updation_cycle where
cycle_type = 'construction' ORDER BY TIME_STAMP ASC";
$res = mysql_query($qry,$db);
while($data = mysql_fetch_array($res))
{
$labelDataArr[] = array($data['TIME_STAMP'],$data['LABEL'],$data['CYCLE_TYPE']);
}
?>
<script type="text/javascript" src="js/jquery.js"></script>
<script>
function GetXmlHttpObject()
{
var xmlHttp=null;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
//Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}
</script>
<script>
function addlabel()
{
label = $.trim($("#label_txtbox").val());
if(label == '')
{
alert("Please enter the label");
return false;
}
return true;
}
</script>
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Label Management</title>
<link href="<?php echo FORUM_SERVER_PATH?>/css/css.css" rel="stylesheet" type="text/css">
</head>
<body>
<TABLE cellSpacing=1 cellPadding=0 width="100%" bgColor=#b1b1b1 border=0><TBODY>
<TR>
<TD class=h1 align=left background=images/heading_bg.gif bgColor=#ffffff height=40>
<TABLE cellSpacing=0 cellPadding=0 width="99%" border=0><TBODY>
<TR>
<TD class=h1 width="67%"><IMG height=18 hspace=5 src="../images/arrow.gif" width=18>Add Quick Label</TD>
<TD align=right colSpan=3></TD>
</TR>
</TBODY></TABLE>
</TD>
</TR>
<TR>
<TD vAlign=top align=middle class="backgorund-rt" height=250><BR>
<table width="70%" border="0" align="centercityval" cellpadding="0" cellspacing="0" style="border:1px solid #c2c2c2;">
<td align='center'>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<form name="frm" method="post" onSubmit="return addlabel();">
<?php if ($_GET["m"] == '1') {?>
<tr><td height="15px" colspan="3"></td></tr>
<tr>
<td align="center" colspan="3">
<font color = 'red'>The records has been save successfully.</font></td>
</tr>
<?php } ?>
<tr><td height="15px" colspan="3"></td></tr>
<tr>
<td height="25" align="right" style="padding-right:10px;">
<b>Add Label</b></td>
<td height="25" align="left" >
<div id="maincity_txtbox">
<input type="text" name="label_txtbox" id="label_txtbox" maxLength="15" style='border:1px solid #333;padding:2px;height:28px;background:#c2c2c2;text-decoration:none;font-weight:bold;color:#fff;'>
<select name ="cycleType" id ="cycleType">
<option value ="construction">Construction</option>
</select>
<input type='submit' value='Save' name='submit' style='border:1px solid #333;padding:5px;background:#c2c2c2;text-decoration:none;font-weight:bold;color:#fff;'>
</div>
</td>
</tr>
<tr><td height="15px" colspan="3"></td></tr>
</form>
</table>
</td>
</tr>
</table>
<br>
<table cellspacing=1 bgcolor='#f2f2f2' border=0 width="90%">
<tr><td align='center' height='28' valign='middle' colspan='4'><b>Label Management</b></td></tr>
<tr bgcolor='#ffffff'>
<td height='30' align="center"><b>SNo.</b></td><td align="center"><b>Label</b></td>
<td align="center"><b>Cycle Type</b></td>
<td align="center"><b>Date</b></td></tr>
<?php
$i = 1;
foreach($labelDataArr as $k=>$valArr)
{
echo "<tr bgcolor='#ffffff'><td height='30' align='center'>".$i."</td><td align='center'>".$valArr[1]."</td><td align='center'>".ucwords($valArr[2])."</td><td align='center'>".$valArr[0]."</td></tr>";
$i++;
}
?>
</table>
</td>
</tr>
</table>
</body></html>