* Sunda Cyber Army 2k17 *
Indonesia Defacer ~
<?php
if(empty($_REQUEST['recordid'])) {
echo "Please go through <a href='search.php'>search</a> page.";
exit();
}
//the page does link back to search when data is missing
$host = "webdev.iyaclasses.com";
$userid = "dent_guest";
$userpw = "Acad276_Ttrojan_Dev2Ex@m";
$db = "dent_exam";
include '../pdloginvariables.php';
$mysql = new mysqli(
$host,
$userid,
$userpw,
$db
);
if($mysql->connect_errno) {
echo "db connection error : " . $mysql->connect_error;
exit();
}
?>
<html>
<head>
<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="search.php"><< Back to Search Page</a>
</div>
<div class="details">
<table>
<tr>
<td rowspan="5" class="img">
<img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQLSc5M0hh5A5s91IIVx16V05mno_XhawYhSZB1_wmlSpZHfbw2" class="img">
</td>
//hardcoded data should be replaced with dynamic data
//unfortunately i have not been successful in executing this
//the while loop is here to fetch the current row of the data, but it doesnt work
//in the select i should be asking the table to give me the data i would like, i tried a request but this didnt work
<?php
$sql = "SELECT * from devices WHERE device_id = " .
$_REQUEST['device_id'];
$results = $mysql->query($sql);
if(!$results) {
echo "<hr>Your SQL:<br> " . $sql . "<br><br>";
echo "SQL Error: " . $mysql->error . "<hr>";
exit();
}
while($currentrow = $results->fetch_assoc()) {
?>
<td class="label">Name:</td>
<td class="data"><strong><em>Pixel</em></strong></td>
<?php echo $currentrow['name']; ?>
</tr>
<tr>
<td class="label">Price:</td>
<td><strong>549.00</strong></td>
<?php echo $currentrow['price']; ?>
</tr>
<tr>
<td class="label">Manufacturer:</td>
<td>Apple</td>
<?php echo $currentrow['manufacturer']; ?>
</tr>
<tr>
<td class="label">System:</td>
<td>iOS</td>
<?php echo $currentrow['system']; ?>
</tr>
<tr>
<td class="label">Type:</td>
<td>Smartphone</td>
<?php echo $currentrow['type']; ?>
</tr>
</table>
</div>
</div>
</body>
</html>