-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathedit_task.php
262 lines (236 loc) · 12.3 KB
/
edit_task.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
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
<?php
// top part of the page
include_once "include/header.php";
// ends top part
include_once "include/config.php";
session_start();
// code for edit task, related to any type
if(isset($_GET['id']))
{
$result = mysql_fetch_assoc(mysql_query("SELECT * FROM tasks WHERE id='".$_GET['id']."' AND userid='".$_SESSION['userid']."'"));
$tdisplay = 'style="display:none;"';
$mdisplay = 'style="display:none;"';
$hdisplay = 'style="display:none;"';
$tutoring = 'style="display:none;"';
$general = 'style="display:none;"';
$dt = explode(' ',$result['taskdate']);
$date = $dt[0];
$time = $dt[1];
switch($result['tasktype'])
{
case 'transportation':
$tdisplay = 'style="display:block;"';
break;
case 'movinghelp':
$mdisplay = 'style="display:block;"';
break;
case 'handy man':
$hdisplay = 'style="display:block;"';
break;
case 'tutoring':
$tutoring = 'style="display:block;"';
break;
case 'general':
$general = 'style="display:block;"';
break;
}
}
?>
<!-- Project One -->
<div class="row" id="con1">
<div class="col-md-12">
<h4 class="hdg" style="border-bottom:none;line-height: 16px;">Post A Request:</h4>
<hr class="clr" style=" margin: 16px 0 13px;">
</div>
<div class="col-md-12">
<div class="tccont5">
<div class="col-xs-4">
<ul class="icg">
<li <?=$tdisplay;?>><span style="background:url(images/trc.png) no-repeat left;" class="navicns"><a href="javascript:void(0)" onclick="showForm('tskfrm-1');" class="task">Transportation</a></span></li>
<li <?=$mdisplay;?>><span style="background:url(images/manui.png) no-repeat left;" class="navicns"><a href="javascript:void(0)" onclick="showForm('tskfrm-2');" class="task">Moving Help</a></span></li>
<li <?=$hdisplay;?>><span style="background:url(images/waliy.png) no-repeat left;" class="navicns"><a href="javascript:void(0)" onclick="showForm('tskfrm-3');" class="task">Handy Man</a></span></li>
<li <?=$tutoring;?>><span style="background:url(images/tutio.png) no-repeat left;" class="navicns"><a href="javascript:void(0)" onclick="showForm('tskfrm-4');" class="task">Tutoring</a></span></li>
<li <?=$general;?>><span style="background:url(images/tutio.png) no-repeat left;" class="navicns"><a href="javascript:void(0)" onclick="showForm('tskfrm-5');" class="task">General</a></span></li>
<!--<li><span style="background:url(images/info.png) no-repeat left;" class="navicns"><a href="javascript:void(0)" onclick="">Information</a></span></li>-->
</ul>
</div>
<div class="col-xs-8" id="tskfrm-1" <?=$tdisplay;?>>
<form action="" method="get" id="frm89" onsubmit="return updateTask('frm89','89')">
<table width="" border="0" class="col-xs-8">
<tr>
<td width="92">Task Name</td>
<td width="300"><input name="tname" type="text" value="<?=$result['taskname'];?>" placeholder=""></td>
</tr>
<tr>
<td width="92">From</td>
<td width="300"><input name="tfrom" type="text" value="<?=$result['taskfrom'];?>" placeholder=""></td>
</tr>
<tr>
<td width="92">To</td>
<td width="300"><input name="tto" type="text" value="<?=$result['taskto'];?>" placeholder=""></td>
</tr>
<tr>
<td width="92">Time</td>
<td width="300"><input name="tdate" editable id="datepicker3" type="text" value="<?=$date?>" id="datepicker" placeholder="" class="tmn"><input name="ttime" id="stepExample3" type="text" value="<?=$time;?>" placeholder="" class="tmn2"></td>
</tr>
<tr>
<td width="92">People</td>
<td width="300"><input name="tpeople" type="text" value="<?=$result['people'];?>" placeholder="" class="bid-amount"></td>
</tr>
<tr>
<td width="92">Other</td>
<td width="300"><input name="tother" type="text" value="<?=$result['other'];?>" placeholder=""></td>
</tr>
<tr style="display:None">
<td width="92">Task Type</td>
<td width="300"><input type="radio" value="0" name="multi" id="single1" style="width:10px;" <?php if($result['taskmulti'] == 0) echo 'checked="checked"'; ?>><label for="single1">Single Tasker</label> <input type="radio" value="1" name="multi" id="multi1" style="width:10px;" <?php if($result['taskmulti'] == 1) echo 'checked="checked"'; ?>><label for="multi1">Multiple Taskers</label></td>
</tr>
<tr>
<td width="92"></td>
<td><input name="submit" type="submit" value="Update" class="sbtbtns"> <img src="images/ajax-loader.gif" id="hire-img89" style="display:none;"><input type="hidden" name="id" value="<?=$_GET['id'];?>"><input type="hidden" name="ttype" value="transportation"></td>
</tr>
</table>
</form>
</div>
<div class="col-xs-8" id="tskfrm-2" <?=$mdisplay;?>>
<form action="" method="get" class="frm89" id="frm90" onsubmit="return updateTask('frm90','90')">
<table width="" border="0" class="col-xs-8">
<tr>
<td width="92">Task Name</td>
<td width="300"><input name="tname" type="text" value="<?=$result['taskname'];?>" placeholder=""></td>
</tr>
<tr>
<td width="92">From</td>
<td width="300"><input name="tfrom" type="text" value="<?=$result['taskfrom'];?>" placeholder=""></td>
</tr>
<tr>
<td width="92">To</td>
<td width="300"><input name="tto" type="text" value="<?=$result['taskto'];?>" placeholder=""></td>
</tr>
<tr>
<td width="92">Time</td>
<td width="300"><input name="tdate" editable id="datepicker2" type="text" value="<?=$date;?>" placeholder="" class="tmn"><input type="hidden" name="id" value="<?=$_GET['id'];?>"><input name="ttime" id="stepExample2" type="text" value="<?=$time?>" placeholder="" class="tmn2"></td>
</tr>
<tr>
<td width="92">Duration (hrs)</td>
<td width="300"><input name="tduration" type="text" value="<?=$result['taskduration'];?>" placeholder=""></td>
</tr>
<tr>
<td width="92">Description</td>
<td width="300"><input name="tdescription" type="text" value="<?=$result['taskdescription'];?>" placeholder=""></td>
</tr>
<tr style="display:None">
<td width="92">Task Type</td>
<td width="300"><input type="radio" value="0" name="multi" id="single1" style="width:10px;" <?php if($result['taskmulti'] == 0) echo 'checked="checked"'; ?>><label for="single1">Single Tasker</label> <input type="radio" value="1" name="multi" id="multi1" style="width:10px;" <?php if($result['taskmulti'] == 1) echo 'checked="checked"'; ?>><label for="multi1">Multiple Taskers</label></td>
</tr>
<tr>
<td width="92"></td>
<td><input name="submit" type="submit" value="Update" class="sbtbtns"> <img src="images/ajax-loader.gif" id="hire-img90" style="display:none;"><input type="hidden" name="ttype" value="movinghelp"></td>
</tr>
</table>
</form>
</div>
<div class="col-xs-8" id="tskfrm-3" <?=$hdisplay;?>>
<form action="" method="get" class="frm89" id="frm91" onsubmit="return updateTask('frm91','91')">
<table width="" border="0" class="col-xs-8">
<tr>
<td width="92">Task Name</td>
<td width="300"><input name="tname" type="text" value="<?=$result['taskname'];?>" placeholder=""></td>
</tr>
<tr>
<td width="92">Location</td>
<td width="300"><input name="tlocation" type="text" value="<?=$result['tasklocation'];?>" placeholder=""></td>
</tr>
<tr>
<td width="92">Time</td>
<td width="300"><input name="tdate" editable id="datepicker1" type="text" value="<?=$date;?>" placeholder="" class="tmn"><input name="ttime" id="stepExample1" type="text" value="<?=$time?>" placeholder="" class="tmn2"></td>
</tr>
<tr>
<td width="92">Description</td>
<td width=""><textarea name="tdescription" cols="" rows="" placeholder=""><?=$result['taskdescription'];?></textarea></td>
</tr>
<tr style="display:None">
<td width="92">Task Type</td>
<td width="300"><input type="radio" value="0" name="multi" id="single1" style="width:10px;" <?php if($result['taskmulti'] == 0) echo 'checked="checked"'; ?>><label for="single1">Single Tasker</label> <input type="radio" value="1" name="multi" id="multi1" style="width:10px;" <?php if($result['taskmulti'] == 1) echo 'checked="checked"'; ?>><label for="multi1">Multiple Taskers</label></td>
</tr>
<tr>
<td width="92"></td>
<td><input name="submit" type="submit" value="Update" class="sbtbtns"> <img src="images/ajax-loader.gif" id="hire-img91" style="display:none;"><input type="hidden" name="id" value="<?=$_GET['id'];?>"><input type="hidden" name="ttype" value="handy man"></td>
</tr>
</table>
</form>
</div>
<div class="col-xs-8" id="tskfrm-4" <?=$tutoring;?>>
<form action="" method="get" id="frm92" class="frm89" onsubmit="return updateTask('frm92','92')">
<table width="" border="0" class="col-xs-8">
<tr>
<td width="92">Task Name</td>
<td width="300"><input name="tname" type="text" value="<?=$result['taskname'];?>" placeholder=""></td>
</tr>
<tr>
<td width="92">Location</td>
<td width="300"><input name="tlocation" type="text" value="<?=$result['tasklocation'];?>" placeholder=""></td>
</tr>
<tr>
<td width="92">Time</td>
<td width="300"><input name="tdate" editable id="datepicker" type="text" value="<?=$date;?>" placeholder="" class="tmn"><input name="ttime" id="stepExample" type="text" value="<?=$time?>" placeholder="" class="tmn2"></td>
</tr>
<tr>
<td width="92">Description</td>
<td width=""><textarea name="tdescription" cols="" rows="" placeholder=""><?=$result['taskdescription'];?></textarea></td>
</tr>
<tr style="display:None">
<td width="92">Task Type</td>
<td width="300"><input type="radio" value="0" name="multi" id="single1" style="width:10px;" <?php if($result['taskmulti'] == 0) echo 'checked="checked"'; ?>><label for="single1">Single Tasker</label> <input type="radio" value="1" name="multi" id="multi1" style="width:10px;" <?php if($result['taskmulti'] == 1) echo 'checked="checked"'; ?>><label for="multi1">Multiple Taskers</label></td>
</tr>
<tr>
<td width="92"></td>
<td><input name="submit" type="submit" value="Update" class="sbtbtns"> <img src="images/ajax-loader.gif" id="hire-img92" style="display:none;"><input type="hidden" name="id" value="<?=$_GET['id'];?>"><input type="hidden" name="ttype" value="tutoring"></td>
</tr>
</table>
</form>
</div>
<div class="col-xs-8" id="tskfrm-5" <?=$general;?>>
<form action="" method="get" id="frm93" class="frm89" onsubmit="return updateTask('frm93','93')">
<table width="" border="0" class="col-xs-8">
<tr>
<td width="92">Task Name</td>
<td width="300"><input name="tname" type="text" value="<?=$result['taskname'];?>"></td>
</tr>
<tr>
<td width="92">Location</td>
<td width="300"><input name="tlocation" type="text" value="<?=$result['tasklocation'];?>"></td>
</tr>
<tr>
<td width="92">Time</td>
<td width="300"><input name="tdate" editable type="text" id="datepicker4" value="<?=$date;?>" class="tmn"><input name="ttime" id="stepExample4" type="text" value="<?=$time?>" class="tmn2"></td>
</tr>
<tr>
<td width="92">Description</td>
<td width=""><textarea name="tdescription" cols="" rows=""><?=$result['taskdescription'];?></textarea></td>
</tr>
<tr style="display:None">
<td width="92">Task Type</td>
<td width="300"><input type="radio" value="0" name="multi" id="single1" style="width:10px;" <?php if($result['taskmulti'] == 0) echo 'checked="checked"'; ?>><label for="single1">Single Tasker</label> <input type="radio" value="1" name="multi" id="multi1" style="width:10px;" <?php if($result['taskmulti'] == 1) echo 'checked="checked"'; ?>><label for="multi1">Multiple Taskers</label></td>
</tr>
<tr>
<td width="92"></td>
<td><input name="submit" type="submit" value="Update" class="sbtbtns"> <img src="images/ajax-loader.gif" id="hire-img93" style="display:none;"><input type="hidden" name="id" value="<?=$_GET['id'];?>"><input type="hidden" name="ttype" value="general"></td>
</tr>
</table>
</form>
</div>
</div>
</div>
<!-- /.row -->
</div>
<?php // bottom starts here
include_once "include/footer.php";
// bottom ends here
;?>
<script>
$('.task').click(function(){
$('.task').parent('span').parent('li').css('background-color','#f4f5f5');
$(this).parent('span').parent('li').css('background-color','#e0e0e0');
});
</script>