-
Notifications
You must be signed in to change notification settings - Fork 0
/
topnames.php
164 lines (152 loc) · 5.45 KB
/
topnames.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
<!--A Design by W3layouts
Author: W3layout
Author URL: http://w3layouts.com
License: Creative Commons Attribution 3.0 Unported
License URL: http://creativecommons.org/licenses/by/3.0/
-->
<!DOCTYPE HTML>
<html>
<head>
<title>The Educare Website Template | Home :: w3layouts</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link href='http://fonts.googleapis.com/css?family=Pompiere' rel='stylesheet' type='text/css'>
<link href="web/css/style.css" rel="stylesheet" type="text/css" media="all" />
<!--slider-->
<link href="web/css/flexslider.css" rel="stylesheet" type="text/css" media="all" />
<script src="web/js/jquery-1.7.1.min.js" type="text/javascript"></script>
<script src="web/js/jquery.flexslider.js" type="text/javascript"></script>
<script type="text/javascript">
$(function(){
SyntaxHighlighter.all();
});
$(window).load(function(){
$('.flexslider').flexslider({
animation: "slide",
animationLoop: false,
itemWidth: 210,
itemMargin: 5,
minItems: 2,
maxItems: 4,
start: function(slider){
$('body').removeClass('loading');
}
});
});
</script>
</head>
<body>
<div class="h-bg">
<div class="wrap">
<div class="header">
<div class="logo">
<a href="index.html"><img src="web/images/logo.jpg"> </a>
</div>
<div class="header-right">
<ul class="nav">
<li class="active"><a href="index.php" title="Home">Home</a></li>
<li><a href="topnames.php">Find Top Names</a></li>
<li><a href="namepopularity.php">Name Popularity </a></li>
<li><a href="contact.html">Contact</a></li>
</ul>
</div>
<div class="clear"></div>
</div>
</div>
</div>
<br /><br /><br />
<div class="cont_bg">
<div class="wrap">
<div class="content">
<div class="main">
<h2>Find Top Popular Names Of the Year </h2>
<br /><br /><br />
<form method="POST">
YEAR : <select name="year" id="year" >
<option value="-1">---Select Year---</option>
<?php
require 'config.php';
$qry="select * from year";
$res=@mysql_query($qry) or die(mysql_error());
while($row=mysql_fetch_array($res))
{
echo "<option value=$row[0]>$row[0]</option>";
}
?>
</select> <br /><br />
Gender: <input type="radio" name="gender" value="male" required="" /> Male <input type="radio" required="" value="female" name="gender"/> Female
<br /> <br />
Top Names: <input type="radio" required="" name="topname" value="5" /> 5 <input type="radio" required="" name="topname" value="20" /> 20 <input type="radio" name="topname" value="40" />40 <input type="radio" name="topname" value="80" /> 80 <input type="radio" required="" name="topname" value="100" /> 100
<br /><br /> <input type="submit" name="find" value="Find"/>
</form>
<hr color=red />
<?php
if(isset($_POST['find']))
{
//echo "helo";
require 'config.php';
$year= $_POST['year'];
$gender= $_POST['gender'];
$topname=$_POST['topname'];
$table= $gender.'_'.$year;
//echo $table;
$qry="Select * from $table limit $topname ";
$result=@mysql_query($qry) or die(mysql_error());
echo "<h2 style='text-align: center; color: red;'> Top $topname $gender Name of Year $year</h2><br /><br />";
//echo "<br />"."Sr No."."           "."Name"."         "."Popularity"."         "."Rank";
echo "<table align=center><tr><td>Sr No.</td><td>    NAME</td><td>  no.Of births</td><td>  </td></tr>";
for($i=0;$i<$topname;$i++)
{
mysql_data_seek($result,$i);
$row=mysql_fetch_array($result);
$srno=$i+1;
//echo "<br />".$srno."             ".$row[0]."              ".$row[1]."              ".$row[2];
echo "<tr><td>$srno</td><td>    $row[0]</td><td>    $row[1]</td><td>    </td></tr>";
}
//echo "<br />".$row[0][1]." ".$row[0][1]." ";
echo "</table> <hr color=red />";
}
?>
</div>
</div>
<div class="clear"></div>
</div>
</div>
<br /><br /><br /><br />
<div class="f_bg">
<div class="wrap">
<div class="footer">
<div class="f_logo">
<a href=""><img src="web/images/logo.jpg" alt=""></a>
<div class="copy">
<p class="w3-link">© All Rights Reserved | Design by <a href=""> ABC </a></p>
</div>
</div>
<div class="f_grid">
<div class="social">
<ul class="follow_icon">
<li><a href="#" style="opacity: 1;">Get Updates Via</a></li>
<li><a href="#" style="opacity: 1;"><img src="web/images/fb.png" alt=""></a></li>
<li><a href="#" style="opacity: 1;"><img src="web/images/g+.png" alt=""></a></li>
<li><a href="#" style="opacity: 1;"><img src="web/images/tw.png" alt=""></a></li>
<li><a href="#" style="opacity: 1;"><img src="web/images/rss.png" alt=""></a></li>
</ul>
</div>
</div>
<div class="f_grid1">
<div class="f_icon">
<img src="web/images/f_icon.png" alt="" />
</div>
<div class="f_address">
<p>500 Lorem Ipsum Dolor Sit,</p>
<p>22-56-323 Lorem Ipsum Dolor Sit Sit Amet,</p>
<p>Fax: (000) 000 00 00 0</p>
<p>Email: <span>info@mycompany.com</span></p>
</div>
</div>
<div class="clear"></div>
</div>
</div>
</div>
</body>
</html>