-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathawards.php
135 lines (107 loc) · 4.73 KB
/
awards.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
<?php session_start();
include("menu.php");
include("dbh.php");
if(!isset($_SESSION['id'])){
header("location:index.php");
}
?>
<!DOCTYPE html>
<html>
<head>
<title>navbar</title>
<link rel="stylesheet" type="text/css" href="innerstyle.css?version=1.0.1">
<link rel="stylesheet" type="text/css" href="form.css">
<link rel="stylesheet" type="text/css" href="js/slick.css">
</head>
<body>
<div class="content">
<?php create_topmenu(11); ?>
<div class="clr">
<h3>Awards For State Level Winners</h3>
<div class="container">
<form action="awardsave.php" method="POST">
Participant code             
<select id="pcode" name="pcode">
<option value="--select--">--select--</option>
<?php
$sql="SELECT a.p_code FROM entry a,state b where a.p_code=b.p_code ORDER BY p_code";
//$result=$conn->query($sql);
$result = mysqli_query($conn,$sql);
//var_dump($result);
$rows = mysqli_num_rows($result);
// get number of rows returned
//var_dump($rows);
if ($rows) {
while ($row = mysqli_fetch_array($result)) {
echo '<option value="'.$row['p_code'].'">'.$row['p_code'].'</option>';
}
}
?>
</select><br>
Participant Name            <input type="text" id="fname" name="pname" placeholder="--Enter Participant name--"><br>
Gender                          
<input type="text" id="gen" name="gender" placeholder="--gender--"><br>
School Address              <input type="text" id="school" name="sadddress" placeholder="--Enter School address--"><br>
Class                              <input type="text" id="cls" name="class" placeholder="--Enter Class--"><br>
Phone no.                       <input type="text" id="pno" name="pno" placeholder="--Enter Your phone no.--"><br>
Competition Details        <input type="text" id="com" name="cdetails" placeholder="--Enter Competition Details--"><br>
Rank                               <input type="text" id="rank" name="rank" placeholder="--Rank--"><br>
Prize                              
<select id="prize" name="prize">
<option value="--select--">--select--</option>
<option value="Rs15000">Rs15000</option>
<option value="Rs10000">Rs10000</option>
<option value="Rs5000">Rs5000</option>
<option value="Rs3000">Rs3000</option>
<option value="Rs2000">Rs2000</option>
</select><br>
<br>
<input type="submit" value="Submit">
</div>
</div>
</div>
<script type="text/javascript" src="js/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="js/slick.js"></script>
<script>
<?php if(isset($_GET['success']) && $_GET['success']=="true"){
?>
alert("Data Saved");
<?php } ?>
$(document).ready(function(){
$('.slide').slick({
autoplay: true,
accessibility: false,
arrows: false,
autoplaySpeed: 3000
});
$("#pcode").change(function(){
var did=$(this).val();
//alert(did);
$.ajax({
url : 'awardaction.php',
type : "GET",
data : "pid="+did,
cache: false,
processData:false,
mimeType:"multipart/form-data"
}).done(function(res){
console.log(res);
if(res){
var data=jQuery.parseJSON(res);
$("#fname").val(data[1]);
$("#school").val(data[2]);
$("#cls").val(data[3]);
$("#pno").val(data[4]);
$("#com").val(data[5]);
$("#state").val(data[6]);
$("#district").val(data[7]);
$("#bl").val(data[8]);
$("#gen").val(data[9]);
$("#rank").val(data[10]);
}
});
});
});
</script>
</body>
</html>