-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheditpolicestation.php
144 lines (139 loc) · 6.9 KB
/
editpolicestation.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
<?php
error_reporting(0);
include("header.php");
include("config.php");
$pstationname = $_GET['psname'];
$selectQuery = "select *from mstr_policestation where policestation_name= '".$pstationname."' ";
$rs = mysql_query($selectQuery);
$record = mysql_fetch_array($rs);
if(mysql_num_rows($rs)==0)
//header("location:viewpolice.php");
?>
<body>
<h1>police Information</h1>
<form name="editpolicestation.php" action="updatepolicestation.php" method="post">
<table>
<tr>
<th colspan="3" class="first"><strong>Policestation informaion:</strong></th>
</tr>
<tr>
<td align="right" valign="middle" bgcolor="#FFFFFF"> </td>
<td colspan="3" align="left" bgcolor="#FFFFFF"> </td>
</tr>
<tr>
<td width="165" align="right" valign="middle" bgcolor="#FFFFFF">
<span class="style3">Police Station Name: </span> </td>
<td colspan="3" align="left" bgcolor="#FFFFFF"><span class="style3">
<input type="text" value="<?php echo $record["policestation_name"]; ?>"
name="psname" id="psname" />
<script type="text/javascript">
var f1 = new LiveValidation('psname');
f1.add(Validate.Presence,{failureMessage: " Please enter Firstname"});
// f1.add(Validate.Format,{pattern: /^[a-zA-Z\s]+$/i ,
//failureMessage:" It allows only characters"});
f1.add(Validate.Format,{pattern: /^[a-zA-Z][a-zA-Z\s]{0,}$/,
failureMessage:" Invalid name"});
</script>
</span></td>
</tr>
<tr bgcolor="#993366">
<td align="right" valign="middle" bgcolor="#FFFFFF">
<span class="style19" style="color: #000000">Area Name: </span> </td>
<td colspan="3" align="left" bgcolor="#FFFFFF"><span class="style15 style3">
<select name="area" size="1" id="area" >
<?php
$areaQuery = "select *from mstr_area";
$rsArea = mysql_query($areaQuery);
while($rowArea = mysql_fetch_array($rsArea))
{
?>
<option value="<?php echo $rowArea['area_id']?>" <?php if($record["area_id"]==$rowArea['area_id']) echo "selected"; ?>> <?php echo $rowArea['area_name']?></option>
<?php }?>
<script type="text/javascript">
var f1 = new LiveValidation('area');
f1.add(Validate.Presence,{failureMessage: "Please enter area name"});
</script>
</select>
</span></td>
</tr>
<tr>
<td height="60" align="right" valign="middle" bgcolor="#FFFFFF">
<span class="style19" style="color: #000000"> Address:</span> </td>
<td width="207" align="left" bgcolor="#FFFFFF"><span class="style15 style3">
<label>
<TEXTAREA ROWS="5" COLS="30" name="address" id="address" style="background-color: #EEEEEE"><?php echo $record["address"]; ?></TEXTAREA>
<script type="text/javascript">
var f1 = new LiveValidation('address');
f1.add(Validate.Presence,{failureMessage: " Please enter Address"});
//f1.add(Validate.Format,{pattern: /^[a-zA-Z\s]+$/i ,failureMessage:
// " It allows only characters"});
//f1.add(Validate.Format,{pattern: /^[a-zA-Z][a-zA-Z\s]{0,}$/,failureMessage:
//" Invalid Address"});
</script>
</label>
</span></td>
<td width="74" align="right" valign="middle" bgcolor="#FFFFFF">
<span class="style19" style="color: #000000">City:</span></td>
<td width="296" align="left" bgcolor="#FFFFFF"><span class="style15 style3">
<select name="city" size="1" id="city" >
<?php
$cityQuery = "select *from mstr_city";
$rsCity = mysql_query($cityQuery);
while($rowCity = mysql_fetch_array($rsCity))
{
?>
<option value="<?php echo $rowCity['city_id']?>" <?php if($record["city_id"]==$rowCity['city_id']) echo "selected"; ?>>
<?php echo $rowCity['city_name']?></option>
<?php }?>
<script type="text/javascript">
var f1 = new LiveValidation('city');
f1.add(Validate.Presence,{failureMessage: "Please enter city name"});
</script>
</select>
</span></td>
</tr>
<tr bgcolor="#999999">
<td align="right" valign="middle" bgcolor="#FFFFFF"><span class="style19" style="color: #000000">Email-id</span>: </td>
<td colspan="3" align="left" bgcolor="#FFFFFF"><span class="style15 style3">
<input type="text" value="<?php echo $record["Email_id"]; ?>" name="emailid" maxlength="254"/>
<script type="text/javascript">
var f1 = new LiveValidation('emailid');
f1.add(Validate.Presence,{failureMessage: " Please enter email-id"});
f1.add( Validate.Email );
</script>
</span></td>
</tr>
<tr bgcolor="#993366">
<td align="right" valign="middle" bgcolor="#FFFFFF">
<span class="style19" style="color: #000000">
<span class="style19" style="color: #000000">Contact number: </span></span> </td>
<td colspan="3" align="left" bgcolor="#FFFFFF">
<input type="text" value="<?php echo $record["contact_no"]; ?>" name="contactno" maxlength="12" />
<script type="text/javascript">
var f1 = new LiveValidation('contactno');
f1.add(Validate.Presence,{failureMessage: " It cannot be empty"});
f1.add(Validate.Format,{pattern: /^[0-9]+$/ ,
failureMessage: " It allows only numbers"});
f1.add( Validate.Length, { minimum: 6, maximum: 12 } );
</script> </td>
</tr>
<tr bgcolor="#993366">
<td align="right" valign="middle" bgcolor="#FFFFFF">
<span class="style19" style="color: #000000">Contact Person:</span> </td>
<td colspan="3" align="left" bgcolor="#FFFFFF">
<input type="text" value="<?php echo $record["contact_person"]; ?>" name="contactperson" />
<script type="text/javascript">
var f1 = new LiveValidation('contactperson');
f1.add(Validate.Presence,{failureMessage: " Please enter contact person name"});
// f1.add(Validate.Format,{pattern: /^[a-zA-Z\s]+$/i ,
//failureMessage:" It allows only characters"});
f1.add(Validate.Format,{pattern: /^[a-zA-Z][a-zA-Z\s]{0,}$/,
failureMessage:" Invalid contact person names"});
</script> </td>
</tr>
<tr><td><input type="submit" value="Update" /></td>
</tr>
</table>
</form>
</body>
</html>