-
Notifications
You must be signed in to change notification settings - Fork 2
/
rec_stcourses.php
165 lines (131 loc) · 6.82 KB
/
rec_stcourses.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
<?php
require 'rec_server.php';
session_start();
$firstname=$_SESSION['name'];
$lastname=$_SESSION['lastname'];
$department=$_SESSION['department'];
$post=$_SESSION['post'];
$img_url="images/".$_SESSION['id'].".jpg";
if(!file_exists($img_url))
{
$img_url = "images/generic.jpg";
}
if(isset($_GET['name']))
{
$name = $_GET['name'];
$short_description= $_GET['short_description'];
$start_date = $_GET['start_date'];
$end_date = $_GET['end_date'];
$stmt = $conn->prepare("INSERT INTO stcourses (id, name, short_description, start_date,end_date) VALUES (?,?,?,?,?)");
$stmt->bind_param("sssss", $_SESSION['id'], $name, $short_description, $start_date,$end_date);
$stmt->execute();
}
?>
<!DOCTYPE html>
<html lang="en" class=" "><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- Meta, title, CSS, favicons, etc. -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="scroll-viewwport" content="width=device-width, initial-scale=1">
<title>Short term Courses</title>
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Font Awesome -->
<link href="css/font-awesome.min.css" rel="stylesheet">
<!-- NProgress -->
<link href="css/nprogress.css" rel="stylesheet">
<link href="css/bootstrap-progressbar-3.3.4.min.css" rel="stylesheet">
<link href="css/select2.min.css" rel="stylesheet">
<!-- Custom Theme Style -->
<link href="css/custom.min.css" rel="stylesheet">
</head>
<body class="nav-md" cz-shortcut-listen="true">
<div class="container body">
<div class="main_container">
<div class="col-md-3 left_col">
<?php include "./rec_header.php" ?>
<!-- page content -->
<div class="right_col" role="main" style="min-height: 1087px;">
<div class="">
<div class="page-title">
<div class="title_left">
<h3>Short term Courses</h3>
</div>
</div>
<div class="row">
<div class="col-md-12 col-sm-12 col-xs-12">
<div class="x_panel">
<div class="x_title">
<h2> Please provide your latest information for the post of <?php echo " ".$post."(".$department.")" ?><br>You can add as many entries as you want.</h2>
<div class="clearfix"></div>
</div>
<?php
$sql = "SELECT i, id, name, short_description, start_date, end_date FROM stcourses WHERE id=".$_SESSION['id'];
$result = $conn->query($sql);
echo $conn->error;
$i=1;
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
echo "<div class='bg-success'>";
echo "<strong>Entry</strong>".$i."<br>";
echo "<strong>name:</strong> ".$row['name'];
echo "  <strong>short_description:</strong> ".$row['short_description'];
echo "  <strong>start_date:</strong> ".$row['start_date'];
echo "  <strong>end_date:</strong> ".$row['end_date'];
echo "</div><br>";
$i=$i+1;
}
}
?>
<div class="x_content">
<div class="jumbotron">
<form method="get">
<div class="form-group">
<label for="id_name">Name of the course<span class="required">*</span></label>
<input class="form-control" id="id_name" maxlength="500" name="name" type="text">
</div>
<div class="form-group">
<label for="id_short_description">Short description<span class="required">*</span></label>
<textarea class="form-control" cols="40" id="id_short_description" name="short_description" rows="10"></textarea>
</div>
<div class="form-group">
<label for="id_start_date">Start Date<span class="required">*</span></label>
<input class="form-control" id="id_start_date" name="start_date" type="date" min="1950-01-01" max="2020-01-01">
</div>
<div class="form-group">
<label for="id_end_date">End Date<span class="required">*</span></label>
<input class="form-control" id="id_end_date" name="end_date" type="date" min="1950-01-01" max="2020-01-01">
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary">Submit</button> <a class="btn btn-danger" href="rec_clear.php?table=stcourses">Clear</a>
</div>
</form> </div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- /page content -->
</div>
</div>
<!-- jQuery -->
<script src="js/jquery.min.js.download"></script>
<!-- Bootstrap -->
<script src="js/bootstrap.min.js.download"></script>
<!-- FastClick -->
<script src="js/fastclick.js.download"></script>
<!-- NProgress -->
<script src="js/nprogress.js.download"></script>
<script src="js/jquery.easypiechart.min.js.download"></script>
<script src="js/bootstrap-progressbar.min.js.download"></script>
<script src="js/moment.min.js.download"></script>
<script src="js/daterangepicker.js.download"></script>
<script src="js/daterangepicker.js.download"></script>
<script src="js/select2.full.min.js.download"></script>
<!-- Custom Theme Scripts -->
<script src="js/custom.min.js.download"></script>
<script type="text/javascript">
</script>
</body>
</html>