-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinsert_master.php
196 lines (153 loc) · 5.41 KB
/
insert_master.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
<?php
include_once 'lib/dao.php';
include_once 'lib/model.php';
$d = new dao();
$m = new model();
$a1;
if(isset($_POST["add_feedback"]))
{
extract(array_map("test_input" , $_POST));
/*$imagetype=$_FILES["file"]['type'];
$imagesize=$_FILES["file"]['size'];
$image_Arr = $_FILES['file'];
move_uploaded_file($image_Arr['tmp_name'],'img/' .$image_Arr['name']);
$file_name = $image_Arr['name'];*/
$m->set_data('name',$name);
$m->set_data('email',$email);
$m->set_data('comments',$comments);
$a1= array ('name'=> $m->get_data('name'),
'email'=> $m->get_data('email'),
'comments'=> $m->get_data('comments'));
$insert=$d->insert('feedback',$a1);
if($insert>0)
{
header("location:index.php?msg=Inserted.");
}
else {
header("location:index.php?msg=Not Inserted.");
}
}
else if(isset($_POST["reg_members"]))
{
extract(array_map("test_input" , $_POST));
$imagetype=$_FILES["file"]['type'];
$imagesize=$_FILES["file"]['size'];
$image_Arr = $_FILES['file'];
move_uploaded_file($image_Arr['tmp_name'],'img/' .$image_Arr['name']);
$file_name = $image_Arr['name'];
$m->set_data('cname',$cname);
$m->set_data('email',$email);
$m->set_data('username',$username);
$m->set_data('password',$password);
$m->set_data('file_name',$file_name);
$m->set_data('active_flag',$active_flag);
$a1 = array('cname'=>$m->get_data('cname'),
'email'=>$m->get_data('email'),
'username'=>$m->get_data('username'),
'password'=>$m->get_data('password'),
'file'=>$m->get_data('file_name'),
'active_flag'=>$m->get_data('active_flag'));
$insert=$d->insert('members',$a1);
if($insert>0)
{
header("location:index.php?msg=User Account Created .");
}
else
{
header("location:index.php?msg=Please Try Again.");
}
}
else if(isset($_POST["forgot"]))
{
extract(array_map("test_input" , $_POST));
$query = $d -> select("members","email='$email'");
$data = mysqli_fetch_array($query);
if($data>0)
{
//$_POST['email'];= $email;
$token = md5(uniqid(rand()));
$m->set_data('email',$email);
$m->set_data('token',$token);
$a1 = array('email'=>$m->get_data('email'),
'token'=>$m->get_data('token'));
$insert=$d->insert('forgot',$a1);
$subject = "Reset password template";
$header = "from :vinay91098@gmail.com";
$message = "Hi we have recieved a password change request from your account.\r \n";
$message = "Click on this link to set your new account password\r\n";
$message = "http://localhost/pixeladmin/set_new_pass.php?token=$token";
$sentmail = mail($email,$subject,$message,$header);
header("location:index1.php?msg=please check email and reset your password");
}
else{
header("location:index1.php?msg1=Wrong Email");
}
}
else if(isset($_POST["insert_question"]))
{
extract(array_map("test_input" , $_POST));
$m->set_data('question',$question);
$a1 = array('question'=>$m->get_data('question'));
$insert=$d->insert('faq',$a1);
if($insert>0)
{
header("location:faq.php?msg=Question Send.");
}
else
{
header("location:faq.php?msg=Please Try Again.");
}
}
else if(isset($_POST["book_event"]))
{
extract(array_map("test_input" , $_POST));
session_start();
$cname = $_SESSION['cname'];
$m->set_data('cname',$cname);
$m->set_data('etitle',$etitle);
$m->set_data('edate',$edate);
$m->set_data('etime',$etime);
$m->set_data('amount',$amount);
$a1= array ('cname'=>$m->get_data('cname'),
'etitle'=>$m->get_data('etitle'),
'edate'=>$m->get_data('edate'),
'etime'=>$m->get_data('etime'),
'amount'=>$m->get_data('amount'));
$insert=$d->insert('booking',$a1);
if($insert>0)
{
header("location:events.php?msg=Details send");
}
else {
header("location:events.php?msg=Please try again");
}
}
else if(isset($_POST["book_hall"]))
{
extract(array_map("test_input" , $_POST));
session_start();
$cname= $_SESSION['cname'];
$name = $_SESSION['name'];
$m->set_data('cname',$cname);
$m->set_data('name',$name);
$m->set_data('date',$date);
$m->set_data('stime',$stime);
$m->set_data('etime',$etime);
$a1 = array('cname'=>$m->get_data('cname'),
'name'=>$m->get_data('name'),
'date'=>$m->get_data('date'),
'stime'=>$m->get_data('stime'),
'etime'=>$m->get_data('etime'));
$active_flag =1;
$m->set_data('active_flag',$active_flag);
$insert=$d->insert('hall_booking',$a1);
if($insert>0)
{
header("location:hall.php?msg:You Succesfully booked seminar hall");
}
else
{
header("location:hall.php?msg=Please Try Again.");
}
}
?>