-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmatch.php
More file actions
166 lines (157 loc) · 6.75 KB
/
match.php
File metadata and controls
166 lines (157 loc) · 6.75 KB
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>EggCheck</title>
<meta name="viewport" content="width=device-width, user-scalable=no">
<link rel="apple-touch-icon" sizes="57x57" href="./favicon/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="./favicon/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="./favicon/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="./favicon/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="./favicon/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="./favicon/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="./favicon/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="./favicon/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="./favicon/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="./favicon/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="./favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="./favicon/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="./favicon/favicon-16x16.png">
<link rel="manifest" href="./favicon/manifest.json">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="./favicon/ms-icon-144x144.png">
<meta name="theme-color" content="#ffffff">
</head>
<body>
<link rel="stylesheet" href="./css/main.css">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<meta name="viewport" content="width=device-width, user-scalable=no">
<?php
include("./head.html");
include("./DB/DBinfo.php");
$string = $_POST["string"];
$match = $_POST["matchSelect"];
$connect = mysql_connect($hostname,$username,$passwd) or die("connect 실패");
mysql_select_db($dbname,$connect) or die("db연결 실패");
if ($match=="select") {
echo "<script>
alert('선택해주세요');
</script>";
$sql = "select * from eggcheck";
$result = mysql_query($sql,$connect)or die("sql 실패");
}
elseif ($match=="전체보기") {
$sql = "select * from eggcheck";
$result = mysql_query($sql,$connect)or die("sql 실패");
}
elseif ($match=="난각코드") {
$sql = "select * from eggcheck where code like \"%{$string}%\"";
$result = mysql_query($sql,$connect)or die("sql 실패");
}
elseif ($match=="농가명") {
$sql = "select * from eggcheck where name like \"%{$string}%\"";
$result = mysql_query($sql,$connect)or die("sql 실패");
}
elseif ($match=="주소") {
$sql = "select * from eggcheck where address like \"%{$string}%\"";
$result = mysql_query($sql,$connect)or die("sql 실패");
}?>
<article class="wrapTable">
<?php
$num = mysql_num_rows($result);
if ($num == 0 ) {
echo "<p style='text-align : center'>확인된 계란이 없습니다.</p>";
}
else {
echo "<table>";
echo "
<thead>
<tr>
<td style='width : 30px' class='num'>연번</td>
<td style='width : 30px' class='city'>시도</td>
<td class='name'>농가명</td>
<td class='adress'>주소</td>
<td style='width : 70px' class='scale'>사육 규모<br />(수)</td>
<td style='width : 60px' class='product'>생산량</td>
<td style='width : 60px' class='certifications'>인증<br />사항</td>
<td style='width : 60px' class='InspectionAgency'>검사<br />기관</td>
<td style='width : 80px' class='collectionDay'>시료<br />채취일</td>
<td style='width : 80px' class='nongyak'>검출 농약</td>
<td style='width : 50px' class='nongAmount'>검출양<br />(mg/kg)</td>
<td style='width : 50px' class='nongStandard'>기준치<br />(mg/kg)</td>
<td class='code'>난각코드</td>
</tr>
</thead>
<tbody>";
while ($row=mysql_fetch_array($result)) {
echo "<tr>";
echo "
<td class='num'>{$row[num]}</td>
<td class='city'>{$row[city]}</td>
<td class='name'>{$row[name]}</td>
<td class='adress'>{$row[address]}</td>
<td class='scale'>{$row[scale]}</td>
<td class='product'>{$row[product]}</td>
<td class='certifications'>{$row[certifications]}</td>
<td class='InspectionAgency'>{$row[InspectionAgency]}</td>
<td class='collectionDay'>{$row[collectionDay]}</td>
<td class='nongyak'>{$row[nongyak]}</td>
<td class='nongAmount'>{$row[nongAmount]}</td>
<td class='nongStandard'>{$row[nongStandard]}</td>
";
if (strpos($row[code], ",") !== false) {
$row[code]=str_replace(",","<br />",$row[code]);
echo "<td class='code'>{$row[code]}</td>";
}
else {
echo "<td class='code'>{$row[code]}</td>";
}
echo "</tr>";
}
echo "</tbody>
</table>";
}
mysql_close();
?>
</article>
<script type="text/javascript">
var headerSize;
if (screen.availWidth < 800) {
headerSize=160;
}
else{
headerSize=200;
}
$(window).scroll(function() {
if ($(window).scrollTop() <= headerSize) {
if (screen.availWidth < 800) {
$("header").css("height","160px");
$(".head").css("font-size","30px");
}
else{
$("header").css("height","200px");
$(".head").css("font-size","50px");
}
$("header").css("position","absolute");
$("header").css("margin-top","0");
$("header").css("top","0");
$("header").css("transition","margin .0s");
}
else if ($(window).scrollTop() > headerSize && $(window).scrollTop() <= 350) {
$("header").css("height","150px");
$(".head").css("font-size","20px");
$("header").css("position","fixed");
$("header").css("margin-top",$(window).scrollTop());
$("header").css("top","-350px");
}
else if ($(window).scrollTop() > 350) {
$("header").css("height","150px");
$(".head").css("font-size","20px");
$("header").css("position","fixed");
$("header").css("margin-top","350px");
$("header").css("top","-350px");
}
});
</script>
</body>
</html>