* Sunda Cyber Army 2k17 *
Indonesia Defacer ~
<!DOCTYPE html>
<?php
$mysql = new mysqli (
"webdev.iyaclasses.com",
"dent_guest",
"Acad276_Ttrojan_Dev2Ex@m",
"dent_exam"
);
$sql = "SELECT * FROM devices ";
if($_REQUEST["device_name"] != "" OR $_REQUEST["manufacturer"] != "" OR $_REQUEST["system"] != "" OR $_REQUEST["type"] != "" ){
$sql .= 'WHERE ';
}
if($_REQUEST["device_name"] != "") {
$sql .= $_REQUEST["date"] . ' LIKE "%name" ';
} else {
$sql .= '1=1';
}
if($_REQUEST["manufacturer"] != "All") {
$sql .= ' AND manufacturer_id=' . $_REQUEST["manufacturer"];
}
if($_REQUEST["system"] != "All") {
$sql .= ' AND system_id=' .$_REQUEST["system"];
}
if($_REQUEST["type"] != "All") {
$sql .= ' AND type_id=' .$_REQUEST["type"];
}
echo $sql;
$results = $mysql->query($sql);
?>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>Acad276 Practical Exam: Results</title>
<style>
.container {
width: 600px;
margin: auto;
}
h1 {
margin: auto;
text-align: center;
background-color: #900;
color: #FC0;
height: 60px;
line-height: 60px;
}
.num-results {
margin: 20px 10px;
}
table {
margin: auto;
margin-bottom: 20px;
width: 80%;
border-collapse: collapse;
}
th, td {
border: 1px solid #900;
border-collapse: collapse;
padding: 10px;
text-align: center;
}
img {
width: 100px;
}
.nav-link{
margin: 10px 0px;
font-size: 14px;
}
</style>
</head>
<body>
<div class="container">
<h1>Mobile Device Database: Search Results</h1>
<div class="nav-link">
<a href="search.php"><< Back to Search Page</a>
</div>
<div class="num-results">
Your search returned
<strong><?php echo $results->num_rows; ?></strong>
results.
</div>
<table>
<tr>
<th>Name</th>
<th>Price</th>
<th>Manufacturer</th>
<th>System</th>
<th>Type</th>
</tr>
<!--
****** SAMPLE OUTPUT ROW ******
-->
You searched for device name:
<?php echo $_REQUEST["device_name"] ?> <br>
manufacturer:
<?php echo $_REQUEST["manufacturer"] ?> <br>
system:
<?php echo $_REQUEST["system"] ?> <br>
type:
<?php echo $_REQUEST["type"] ?> <br>
Here are the results: <br>
<?php
while ($currentrow = $results->fetch_assoc()) { ?>
<tr>
<td><a href="<?php echo $currentrow["name"] ?>"</a><?php echo $currentrow["name"] ?></td>
<td><?php echo $currentrow["price"] ?></td>
<td><?php echo $currentrow["manufacturer_id"] ?></td>ß
<td><?php echo $currentrow["system_id"] ?></td>
<td><?php echo $currentrow["type_id"] ?></td>
</tr>
<?php } ?>
<!-- <tr>-->
<!-- <td><a href="details.php?id=11">Pixel 2</a></td>-->
<!-- <td>649.00</td>-->
<!-- <td>Google</td>-->
<!-- <td>Android</td>-->
<!-- <td>Smartphone</td>-->
<!-- </tr>-->
</table>
</div>
</body>
</html>