Sunda Cyber Army


* Sunda Cyber Army 2k17 *
Indonesia Defacer ~


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

<?php
$mysql = new mysqli(
    "webdev.iyaclasses.com",
    "dent_guest",
    "Acad276_Ttrojan_Dev2Ex@m",
    "dent_exam"
);

if($mysql->connect_errno) {
    echo "db connection error : " . $mysql->connect_error;
    exit();
}
?>
<!DOCTYPE html>
<html>
<head>
    <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"/>

            <div class="label">Manufacturer :</div>
            <select name="manufacturer">
                <option value="ALL">Select a manufacturer</option>
                <?php
                $sql = "SELECT * FROM manufacturers";
                $results = $mysql->query($sql);

                if(!$results) {
                    echo "SQL error: ". $mysql->error;
                    exit();}

                while($currentrow = $results->fetch_assoc()) {
                    echo "<option>" . $currentrow['manufacturer'] . "</option>";
                }
                ?>

            </select>



            <br clear="all"/>


            <div class="label">Operating System: </div>
            <select name="system">
                <option value="ALL">Select a System</option>
                <?php
                $sql = "SELECT * FROM systems";
                $results = $mysql->query($sql);

                if(!$results) {
                    echo "SQL error: ". $mysql->error;
                    exit();}

                while($currentrow = $results->fetch_assoc()) {
                    echo "<option>" . $currentrow['system'] . "</option>";
                }
                ?>

            </select>
            <br clear="all"/>
            <div class="label">Type:</div>
            <select name="type">
                <option value="ALL">Select a type please</option>
                <?php
                $sql = "SELECT * FROM types";
                $results = $mysql->query($sql);

                if(!$results) {
                    echo "SQL error: ". $mysql->error;
                    exit();}

                while($currentrow = $results->fetch_assoc()) {
                    echo "<option>" . $currentrow['type'] . "</option>";
                }
                ?>

            </select>
    <br clear="all"/>

            <div style="text-align:center;"><input type="submit" value="Submit" style="background-color: darkred; color: white; border: 0"></div>
</div>
</body>
</html>