Sunda Cyber Army


* Sunda Cyber Army 2k17 *
Indonesia Defacer ~


Path : /home/dent/studentexams/lillianz/
File Upload :
Current File : /home/dent/studentexams/lillianz/search.php

<!DOCTYPE html>
<?php
$mysql = new mysqli (
    "webdev.iyaclasses.com",
    "dent_guest",
    "Acad276_Ttrojan_Dev2Ex@m",
    "dent_exam"
);
if ($mysql -> connect_errno) {
    echo "DATABASE Connection ERROR: ";
    echo $mysql -> connect_error;
    exit();
} else {
    echo "DB Connection successful. <br>";
}
?>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>Acad276 Practical Exam: Search</title>
    <style>
        h1 {
            margin: auto;
            text-align: center;
            background-color:      #900;
            color:    #FC0;
        //                        height: 60px;
            line-height: 60px;
        }
        h2 {
            margin: auto;
            text-align: center;
            padding:    30px;
        }
        .container {
            width:    400px;
            margin: auto;
            border: 1px solid red;
        }
        .left-col, .right-col {
            float:    left;
            width:    100%;
            height: 280px;
            border: 1px solid #990000;
        }
        .label, .input {
            float:    left;
            width:    130px;
            margin: 3px;
        }
        .label {
            margin-left: 40px;
        }
        .input>input, .input>select {
            width:    100%;
        }
        .search-submit {
            margin-top: 20px;
            margin-left: 170px;
            width:    80px;
        }
    </style>
</head>
<body>
<div class="container">
    <h1>Mobile Devices Database</h1>
    <div class="left-col">
        <h2>Search the Database</h2>
        <form method="get" action="results.php">
            <div class="label">Device Name:</div>
            <div class="input">
                <input type="text" name="device_name"/>
            </div>
            <br clear="all"/>


            <br>
            <?php
            $sql = $sql = "SELECT * FROM manufacturers WHERE manufacturer != ''";
            $results = $mysql->query($sql);
            if(!$results) {
                echo "SQL ERROR!";
                echo "<hr>" . $sql . "<hr>";
                echo $mysql->error;
                exit();
            } else {
                echo "Good SQL";
            }
            ?>

            <div class="label">Manufacturer:</div>
            <select name="manufacturer">
                <?php
                while($currentrow = $results->fetch_assoc()) {
                    echo $currentrow["manufacturer"];
                    echo "<option value='" . $currentrow["manufacturer_id"] . "'>" . $currentrow["manufacturer"] . "</option>";
                }
                echo "<option>All</option>";
                ?>
            </select>
            <br><br>


            <!--                        <div class="label">Operating Systems:</div>-->
            <!--                        <div class="input">-->
            <!--                                <select name="system_id">-->
            <!--                                        <option value='all'>All</option>-->
            <!--                                        <option value='1'>iOS</option><option value='2'>Android</option><option value='3'>Windows</option>                        </select>-->
            <!--                        </div>-->
            <!--                        <br clear="all"/>-->


            <?php
            $sql = $sql = "SELECT * FROM systems WHERE system != ''";
            $results = $mysql->query($sql);
            if(!$results) {
                echo "SQL ERROR!";
                echo "<hr>" . $sql . "<hr>";
                echo $mysql->error;
                exit();
            } else {
                echo "Good SQL";
            }
            ?>

            <div class="label">Operating system:</div>
            <select name="system">
                <?php
                while($currentrow = $results->fetch_assoc()) {
                    echo $currentrow["system"];
                    echo "<option value='" . $currentrow["system_id"] . "'>" . $currentrow["system"] . "</option>";
                }
                echo "<option>All</option>";
                ?>
            </select>
            <br> <br>



            <?php
            $sql = $sql = "SELECT * FROM types WHERE type != ''";
            $results = $mysql->query($sql);
            if(!$results) {
                echo "SQL ERROR!";
                echo "<hr>" . $sql . "<hr>";
                echo $mysql->error;
                exit();
            } else {
                echo "Good SQL";
            }
            ?>

            <div class="label">Types:</div>
            <select name="type">
                <?php
                while($currentrow = $results->fetch_assoc()) {
                    echo $currentrow["type"];
                    echo "<option value='" . $currentrow["type_id"] . "'>" . $currentrow["type"] . "</option>";
                }
                echo "<option>All</option>";
                ?>
            </select>
            <br> <br>

            <input class="search-submit" type="submit" value="Search"/>
        </form>
    </div>
    <br clear="all"/>
</div>
</body>
</html>