-
Notifications
You must be signed in to change notification settings - Fork 2
/
sms.php
204 lines (181 loc) · 5.87 KB
/
sms.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
<html>
<?php
$host="localhost";
$uname="root";
$pass="";
$db="codechef";
$link=@mysql_connect($host,$uname,$pass) or
die("<script>alert('Server Error')</script>");
@mysql_select_db($db) or
die("<script><alert>Database error</alert></script>");
?>
<head>
<style>
textarea {
min-height: 75px;
resize: none;
width: 100%;
background: transparent;
border: none;
font-family: inherit;
font-size: 18px;
outline: none;
color: #fff;
}
</style>
<!--find-->
<?php
if(isset($_POST['find']))
{
$uid=$_POST['team_id'];
$qry="select * from registrations where team_id=$uid";
$rs=mysql_query($qry) or die(mysql_error());
$row=mysql_fetch_array($rs);
}
if(isset($_POST['update']))
{ $uid=$_POST['uid'];
$uname=$_POST['uname'];
$upass=$_POST['upass'];
$ufname=$_POST['ufname'];
$uemail=$_POST['uemail'];
$umobile=$_POST['umobile'];
$uaddress=$_POST['uaddress'];
$qry="update usermaster set UserName='$uname', Password='$upass', FullName='$ufname',
Email='$uemail', Mobile= $umobile, Address='$uaddress' where UserId=$uid";
mysql_query($qry) or die(mysql_error());
if(mysql_affected_rows()>0)
{
echo "<script><alert>Records Updated</alert></script>";
}
}
?>
<link href="style1.css" type="text/css" rel="stylesheet" />
</head>
<body>
<center><h1>Code-A-Strike</h1>
<hr>
<form method="post" enctype="multipart/form-data">
<div align="left">
<table align="center">
<tr><th colspan="3"><center>TEAM DETAILS</center></th></tr>
<tr>
<td>Team Id</td><td><input type="text" name="team_id" placeholder="Enter Team ID"
value="<?php if(isset($row)){ echo $row[0]; } ?>"/></td>
<td><center><input type="submit" name="find" value="Find Info"/></center></td></tr>
<tr><td>Team Name</td><td><input type="text" name="team_name"
value="<?php if(isset($row)){echo $row[1];} ?>" /></td><td><input type="text" name="team_name"
value="<?php if(isset($row)){echo "ROUND 1";} ?>" /></td></tr>
<tr><td>Gamer 1 </td><td><input type="text" name="name1"
value="<?php if(isset($row)){echo $row[3];} ?>" /></td><td><input type="text" name="name1"
value="<?php if(isset($row)){echo $row[5];} ?>" /></td></tr>
<tr><td>Gamer 2 </td><td><input type="text" name="name1"
value="<?php if(isset($row)){echo $row[7];} ?>" /></td><td><input type="text" name="name1"
value="<?php if(isset($row)){echo $row[9];} ?>" /></td></tr>
<tr><td>Coder </td><td><input type="text" name="name1"
value="<?php if(isset($row)){echo $row[11];} ?>" /></td><td><input type="text" name="name1"
value="<?php if(isset($row)){echo $row[13];} ?>" /></td></tr>
<tr><th colspan="3"><center>WRITE THE MESSAGE</center></th></tr>
<tr><td colspan="3">
<textarea name="msg" placeholder="Write message" ></textarea>
</td></tr>
<tr><td colspan="3">
<center>
<input type="submit" name="start_game" value="SEND SMS"/>
<input type="submit" name="view_email" value="VIEW EMAILS"/>
<input type="submit" name="view_registered" value="VIEW MOBILE"/>
<input type="submit" name="view_playing" value="SEND ALL"/>
</center>
</td>
</tr>
</table>
</div>
</form>
</center>
</body>
</html>
<!--display-->
<?php
if(isset($_POST['view_registered']))
{
echo "<center><table>";
$qry="select * from registrations";
$rs=mysql_query($qry)
or die(mysql_error());
$count=mysql_num_fields($rs);
echo "<tr><th>TEAM ID</th><th>TEAM NAME</th><th ><center>GAMER 1</center></th><th><center>GAMER 2</center></th>
<th><center>CODER</center></th></tr>";
while($row=mysql_fetch_array($rs))
{
echo "<tr>";
echo "<td>$row[0]</td>";
echo "<td>$row[1]</td>";
echo "<td>$row[5]</td>";
echo "<td>$row[9]</td>";
echo "<td>$row[13]</td>";
echo "</tr>";
}
echo "</table></center>";
}
?>
<!--view email-->
<?php
if(isset($_POST['view_email']))
{
echo "<center><table>";
$qry="select * from registrations";
$rs=mysql_query($qry)
or die(mysql_error());
$count=mysql_num_fields($rs);
echo "<tr><th>TEAM ID</th><th>TEAM NAME</th><th ><center>GAMER 1</center></th><th><center>GAMER 2</center></th>
<th><center>CODER</center></th></tr>";
while($row=mysql_fetch_array($rs))
{
echo "<tr>";
echo "<td>$row[0]</td>";
echo "<td>$row[1]</td>";
echo "<td>$row[6]</td>";
echo "<td>$row[10]</td>";
echo "<td>$row[14]</td>";
echo "</tr>";
}
echo "</table></center>";
}
?>
<!--view email-->
<!---INSERT-->
<?php
if(isset($_POST['insert']))
{
$uid=$_POST['uid'];
$uname=$_POST['uname'];
$upass=$_POST['upass'];
$ufname=$_POST['ufname'];
$uemail=$_POST['uemail'];
$umobile=$_POST['umobile'];
$uaddress=$_POST['uaddress'];
$filename=$_FILES['fil']['name'];
$filetname=$_FILES['fil']['tmp_name'];
$filesize=$_FILES['fil']['size'];
$filetype=$_FILES['fil']['type'];
$filerror=$_FILES['fil']['error'];
$imagepath=fopen($filename,"r");
$bfil=fread($imagepath,$filesize);
$image=addslashes($bfil);
$qry="insert into usermaster
values($uid,'$uname','$upass','$ufname','$uemail',$umobile,'$image', '$uaddress')";
mysql_query($qry) or die(mysql_error());
if(mysql_affected_rows()>0)
{
echo "<script><alert>Records inserted</alert></script>";
}
}
?>
<!---Delete-->
<?php
if(isset($_POST['delete']))
{
$uid=$_POST['uid'];
$qry="delete from usermaster where UserId=$uid";
mysql_query($qry) or die(mysql_error());
}
?>