-
Notifications
You must be signed in to change notification settings - Fork 1
/
request.php
70 lines (70 loc) · 2.69 KB
/
request.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
<?php
require_once('Request.php');
require_once('check_cookie.php');
require_once('show_list.php');
if (check_cookie($_SERVER['PHP_SELF'], null)) {
if (!empty($_POST)) {
$req = new Request();
$req->uid = $_COOKIE['uid'];
$req->name = $_POST['name'];
// Remove '-' from phone number.
$req->phone = str_replace('-', '',$_POST['phone']);
$req->description = $_POST['description'];
// Force date into correct format.
$req->deadline = parse_date($_POST);
$req->insert();
header('Location: index.php?conf=true');
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Job Request Form</title>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="style.css" />
<script type="text/javascript" src="jquery-1.7.min.js"></script>
<script type="text/javascript" src="validator.js"></script>
<script type="text/javascript" src="validate_request.js"></script>
</head>
<body onload="loadEventHandlers();">
<?php include('header.php'); ?>
<a href="logout.php">Logout</a>
<form id="form" method="post" action="request.php">
<div class="form">
<h1>Job Request Form</h1>
<table border="0">
<tr><td>Name:</td>
<td><input type="text" id="name" name="name" readonly="readonly" /></td>
</tr>
<tr><td>Phone #:</td>
<td><input type="text" id="phone" name="phone" /></td>
</tr>
<tr><td>Job Deadline:</td><td><select id="year" name="year"></select>
<select id="month" name="month">
<option id="month_0" value="January">January</option>
<option id="month_1" value="February">February</option>
<option id="month_2" value="March">March</option>
<option id="month_3" value="April">April</option>
<option id="month_4" value="May">May</option>
<option id="month_5" value="June">June</option>
<option id="month_6" value="July">July</option>
<option id="month_7" value="August">August</option>
<option id="month_8" value="September">September</option>
<option id="month_9" value="October">October</option>
<option id="month_10" value="November">November</option>
<option id="month_11" value="December">December</option>
</select>
<select id="day" name="day"></select></td></tr>
<tr><td>Job Description:</td>
<td>
<textarea id="description" name="description" rows="10" cols="40"></textarea>
</td>
</tr>
</table>
<input type="submit" value="Submit" />
</div>
</form>
<?php show_list('request', 0, true, false); ?>
</body>
</html>
<?php } ?>