-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathform_job.php
211 lines (154 loc) · 6.08 KB
/
form_job.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
<?php
require 'backend/connect.php';
?>
<!DOCTYPE html>
<html>
<head>
<title>Job Form</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!--
Style Sheet and query file reference link below
-->
<link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
<link rel="stylesheet" type="text/css" href="css/sidebar.css">
<script src="bootstrap/js/jquery.min.js"></script>
<script src="bootstrap/js/bootstrap.min.js"></script>
<!--
Custom styles below
-->
<style>
/* Below style is for form */
.panel-bg{
margin-top:2%;
background-color: #001832;
}
.field-label{
color:#fff;
font-weight: bold;
margin-left: 25%;
}
.form-group{
padding-bottom: 10px;
}
.field-length{
width: 300px;
height: 30px;
}
.reg_date{
float:left;
}
.reg_date_field{
width: 200px;
}
#alert{margin-top:3%;
width: 50%;
margin-left: 24.5%;
text-align: center;
}
</style>
</head>
<body>
<?php require 'backend/navbar.php';
?>
<div id="main">
<div id="alert">
<?php
if(!empty($_GET['entry'])){
if($_GET['entry']=='true'){
?>
<div class="alert alert-success alert-dismissable">
<a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>
<strong>Success!</strong>!! Data Entered .
</div>
<?php }
elseif($_GET['entry']=='false'){ ?>
<div class="alert alert-danger alert-dismissable">
<a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>
<strong>Failed!</strong> Failed Entry,Try again.
</div>
<?php }} ?>
</div>
<!-- Form Field labels -->
<div class="container"><div class="panel panel-primary panel-bg">
<div class="panel-heading">
<h2>Project Register Form</h2>
</div>
<div class="panel-body">
<form action="backend/form_job_script.php" method="post" id="list">
<div class="row">
<div class="col-lg-offset-1 col-md-offset-1 col-sm-offset-1 col-xs-offset-1 col-lg-4 col-md-4 col-sm-4 col-xs-4">
<!-- Next field -->
<div class="form-group" style='padding-top: 10px;'>
<label>Customer Name:</label>
<input type="text" name="cust_name" required="true" class="form-control field-length" >
</div>
<!-- Next field -->
<div class='form-group'>
<label>Type of Job:</label>
<select name="job_type" form="list" class="form-control field-length">
<option selected disabled>Choose a type</option>
<?php
$sql ='SELECT * FROM `job_type`';
$result = mysqli_query($link2,$sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) { ?>
<option value="<?php echo $row["type"]; ?>">
<?php echo $row["type"]; ?></option>
<?php }} ?>
</select></div>
<!-- Next field -->
<div class='form-group'>
<label>Project description:</label>
<textarea name="job_desc" class="form-control" required="true" style="width:300px;height:190px;">
</textarea></div>
<!-- Next field -->
<div class="form-group">
<label>Start Date</label>
<input type="text" name="start_date" required="true" class="form-control field-length" onfocus="(this.type='date')">
</div>
<!-- Next field -->
</div>
<!-- Next field labels -->
<div class="col-lg-offset-1 col-md-offset-1 col-sm-offset-1 col-xs-offset-1 col-lg-4 col-md-4 col-sm-4 col-xs-4" style="margin-left: 13%;">
<!-- Next field -->
<div class="form-group" style='padding-top: 10px;'>
<label>Registration Date:</label>
<input type="text" name="reg_date" required="true" class="form-control field-length" onfocus="(this.type='date')">
</div>
<!-- Next field -->
<div class="form-group">
<label>Document Reference:</label>
<input type="text" name="doc_ref" class="form-control field-length"></div>
<!-- Next field -->
<div class="form-group">
<label>Project Cost:<span style="color:#bd0e0e;"><?php if(!empty($_GET["j"])){ echo $_GET['j'];}?></span></label>
<input type="number" name="job_cost" required="true" step="0.01" class="form-control field-length">
</div>
<!-- Next field -->
<div class="form-group">
<label>Cost Expected:<span style="color:#bd0e0e;"><?php if(!empty($_GET["e"])){echo $_GET['e'];}?></span></label>
<input type="number" name="exp_cost" required="true" step="0.01" class="form-control field-length">
</div>
<!-- Next field -->
<div class="form-group">
<label>Profit Projected:<span style="color:#bd0e0e;"><?php if(!empty($_GET["p"])){echo $_GET['p'];}?></span></label>
<input type="number" name="profit" required="true" step="0.01" class="form-control field-length">
</div>
<!-- Next field -->
<div class="form-group">
<label>End Date</label>
<input type="text" name="end_date" required="true" class="form-control field-length" onfocus="(this.type='date')">
</div>
<!-- Next field -->
</div></div>
<div class="row">
<div style="margin-bottom: 10px; margin-left: 45%;">
<input class="btn btn-danger" type="submit" value='Save' style="width: 100px;">
</div>
</div>
</form></div></div></div>
</div>
</body>
</html>