Sunda Cyber Army


* Sunda Cyber Army 2k17 *
Indonesia Defacer ~


Path : /home/dent/public_html/exams/emilie/
File Upload :
Current File : /home/dent/public_html/exams/emilie/phoneResult.php

<?php
$deviceName = $_REQUEST['device_name'];
$manufacturerName = $_REQUEST['manufacturer_name'];
$os = $_REQUEST['operating_system'];
$type = $_REQUEST['device_type'];
$price = $_REQUEST['device_price'];

$host = "webdev.iyaserver.com";
$userid = "dent_test";
$password = "Acad276_Ttrojan_Dev2Ex@m";
$db = "dent_exam";
$mysqli = new mysqli($host, $userid, $password, $db);
if ($mysqli->connect_errno) {
    echo "Failed to connect to MySQL: " . $mysqli->connect_error;
    exit();
}
$sql = 		"SELECT * FROM device WHERE 1=1";

if($deviceName != "ALL") {
    $sql .= " AND device_name = '" . $deviceName. "'";
}

if($manufacturerName != "ALL") {
    $sql .= " AND manufacturer_name = '" . $manufacturerName. "'";
}
if($os != "ALL") {
    $sql .= " AND operating_system = '" . $os. "'";
}

if($type != "ALL") {
    $sql .= " AND device_type = '" . $type. "'";
}

$results = $mysqli->query($sql);
if (!$results) {
    echo "<hr> Error! " . $mysql->error;
    echo "<br> SQL: " . $sql;
    exit();
}
else {
    echo "You searched for device names that match: (" . $deviceName . ")  and manufacturer names that match (" . $manufacturerName . ")<br>";
    echo "Your search  returned ". $results->num_rows . " results.  <br>";
    echo "The sql statement used in the search is " . $sql . "<br> <br>";

}
echo "<table border='1' cellpadding='6' cellspacing='0' style='border-collapse: collapse; text-align:center;'>";
echo "<tr>
        <th>Name</th>
        <th>Price</th>
        <th>Manufacturer</th>
        <th>System</th>
        <th>Type</th>
      </tr>";

while($currentrow = $results->fetch_assoc()) {

    echo "<tr>";
    echo "<td><a href='phoneDetails.php?id=" . $currentrow['ID'] . "'>" . $currentrow['device_type'] . "</a></td>";
    echo "<td>" . price("H:i", price($currentrow["price"])) . "</td>"; //displays price in results
    echo "<td>" . $currentrow["manufacturer_name"] . "</td>";
    echo "<td>" . $currentrow["operating_system"] . "</td>";
    echo "<td>" . $currentrow["device_type"] . "</td>";
    echo "</tr>";
}
echo "</table>";
?>