-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtutorial_save.php
144 lines (105 loc) · 3.6 KB
/
tutorial_save.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
$registered_session_id = $_POST['registered_session_id'];
include('inc/db_conn.php');
//==========================
// Check for already registered
//==========================
$sql_check = "SELECT id ";
$sql_check .= "FROM registered_tutorials ";
$sql_check .= "WHERE registered_session_id = \"$registered_session_id\"";
$total_check = @mysql_query($sql_check, $connection) or die("Error #". mysql_errno() . ": " . mysql_error());
$total_found_check = @mysql_num_rows($total_check);
if ($total_found_check > 0)
{
$display_block .="<p>You have already registered for tuotrials. If you would like to change your selection(s) please call (512) 536-1057.</p>";
}
else
{
//==========================
// record registered tutorials
//==========================
$tutorial_0706_AM = $_POST['tutorial_0706_AM'];
$tutorial_0706_PM = $_POST['tutorial_0706_PM'];
$tutorial_0707_AM = $_POST['tutorial_0707_AM'];
$tutorial_0707_PM = $_POST['tutorial_0707_PM'];
if ($tutorial_0706_AM != "")
{
$selected_tutorials[0] = $tutorial_0706_AM;
}
if ($tutorial_0706_PM != "")
{
$selected_tutorials[1] = $tutorial_0706_PM;
}
if ($tutorial_0707_AM != "")
{
$selected_tutorials[2] = $tutorial_0707_AM;
}
if ($tutorial_0707_PM != "")
{
$selected_tutorials[3] = $tutorial_0707_PM;
}
foreach ($selected_tutorials as $key =>$value)
{
$sql_register_tutorials = "INSERT INTO registered_tutorials ";
$sql_register_tutorials .= "(registered_session_id, ";
$sql_register_tutorials .= "talk_id, ";
$sql_register_tutorials .= "created_at, ";
$sql_register_tutorials .= "updated_at) ";
$sql_register_tutorials .= "VALUES ";
$sql_register_tutorials .= "(\"$registered_session_id\", ";
$sql_register_tutorials .= "\"$value\", ";
$sql_register_tutorials .= "NOW(), ";
$sql_register_tutorials .= "NOW())";
$result_register_tutorials = @mysql_query($sql_register_tutorials, $connection) or die("Error #". mysql_errno() . ": " . mysql_error());
}
$display_block .="<p>The following tutorials have been recorded.</p>
<ul>";
$sql_registered_tutorials = "SELECT ";
$sql_registered_tutorials .= "title, ";
$sql_registered_tutorials .= "track, ";
$sql_registered_tutorials .= "DATE_FORMAT(start_time, '%W - %b %D %h:%i %p' ) AS date_time ";
$sql_registered_tutorials .= "FROM registered_tutorials ";
$sql_registered_tutorials .= "LEFT JOIN talks ON registered_tutorials.talk_id = talks.id ";
$sql_registered_tutorials .= "LEFT JOIN schedules ON schedules.talk_id = talks.id ";
$sql_registered_tutorials .= "WHERE registered_session_id = \"$registered_session_id\"";
$total_registered_tutorials = @mysql_query($sql_registered_tutorials, $connection) or die("Error #". mysql_errno() . ": " . mysql_error());
do {
if ($row['title'] != '')
{
$display_block .="<li>" . $row['track'] . " - <strong>" . $row['title'] . "</strong> | <em>" . $row['date_time'] . "</em></li>";
}
}
while($row = mysql_fetch_array($total_registered_tutorials));
$display_block .="</ul><br />
<p>Look forward to seeing you there!</p>";
}
?>
<!DOCTYPE html>
<html>
<?php $thisPage="Register"; ?>
<head>
<?php include('inc/force_ssl.php') ?>
</script>
<?php include('inc/header.php') ?>
</head>
<body>
<div id="container">
<?php include('inc/page_headers.php') ?>
<section id="sidebar">
</section>
<section id="main-content">
<h1>2014 Conference Registration</h1>
<form id="formID" class="formular" method="post" action="tutorial_save.php">
<div class="form_row">
<h2>Tutorial Selection</h2>
<?php echo $display_block ?>
</form>
</section>
<div style="clear:both;"></div>
<footer id="page_footer">
<?php include('inc/page_footer.php') ?>
</footer>
</div>
</body>
</html>