* Sunda Cyber Army 2k17 *
Indonesia Defacer ~
<?php
// disclosure: AI used to improve certain code snippets
if (empty($_REQUEST['id'])) {
echo "Please visit the <a href='search.php'>search</a> page.";
exit();
}
$deviceid = (int)$_REQUEST['id'];
$host = "webdev.iyaserver.com";
$userid = "dent_test";
$password = "Acad276_Ttrojan_Dev2Ex@m";
$db = "dent_exam";
$mysql = new mysqli($host, $userid, $password, $db);
if ($mysql->connect_errno) {
echo "Failed to connect to MySQL: " . $mysql->connect_error;
exit();
}
$sql = "SELECT d.device_id, d.name, d.price, d.img_url, ";
$sql .= " m.manufacturer, o.system, t.type ";
$sql .= "FROM device d ";
$sql .= "JOIN make m ON d.manufacturer_id = m.manufacturer_id ";
$sql .= "JOIN os o ON d.system_id = o.system_id ";
$sql .= "JOIN devicetype t ON d.type_id = t.type_id ";
$sql .= "WHERE d.device_id = " . $deviceid . " ";
$sql .= "LIMIT 1";
$results = $mysql->query($sql);
if (!$results) {
echo "SQL error: " . $mysql->error;
exit();
}
$row = $results->fetch_assoc();
if (!$row) {
echo "Record not found. <a href='search.php'>Search again</a>.";
exit();
}
?>
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>Acad276 Practical Exam: Details</title>
<style>
.container {
width: 800px;
margin: auto;
}
h1 {
margin: auto;
text-align: center;
background-color: #900;
color: #FC0;
height: 60px;
line-height: 60px;
}
.details {
border: 1px solid #990000;
width: 600px;
margin: auto;
margin-top: 20px;
padding: 20px;
}
table {
height: 300px;
width: 100%;
}
table img {
height: 300px;
}
img {
width: 300px;
}
.label {
text-align: right;
width: 20%;
padding: 3px 10px 3px;
}
.data {
width: 40%;
}
.input>input, .input>select {
width: 100%;
}
.nav-link{
margin: 10px 0px;
font-size: 14px;
}
</style>
</head>
<body>
<div class="container">
<h1>Mobile Device Database: Details Page</h1>
<div class="nav-link">
<a href="results.php"><< Back to Results Page</a><br>
<a href="search.php"><< Back to Search Page</a>
</div>
<div class="details">
<table>
<tr>
<td rowspan="5" class="img">
<img src="<?php echo $row['img_url']; ?>" class="img">
</td>
<td class="label">Name:</td>
<td class="data"><strong><em><?php echo $row['name']; ?></em></strong></td>
</tr>
<tr>
<td class="label">Price:</td>
<td><strong><?php echo $row['price']; ?></strong></td>
</tr>
<tr>
<td class="label">Manufacturer:</td>
<td><?php echo $row['manufacturer']; ?></td>
</tr>
<tr>
<td class="label">System:</td>
<td><?php echo $row['system']; ?></td>
</tr>
<tr>
<td class="label">Type:</td>
<td><?php echo $row['type']; ?></td>
</tr>
</table>
</div>
</div>
</body>
</html>