Sunda Cyber Army


* Sunda Cyber Army 2k17 *
Indonesia Defacer ~


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

<!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="manufacture_result.php">
            <div class="label">Device Name:</div>
            <div class="input">
                <input type="text" name="device_name"/>
            </div>
            <br clear="all"/>

            <div class="label">Manufacture:</div>
            <form action="results.php">
                <!--    //you can call it whatever you want-->
                <select name="classname">
                    <option value="ALL">
                        Select a Manufacturer
                    </option>
                    <option value="ALL">

                    </option>
                </select>

            <br clear="all"/>

            <div class="label">Operating System:</div>
                <form action="system_result.php">
                    <!--    //you can call it whatever you want-->
                    <select name="systems">
                        <!--All the results from the database listed -->
                        <option value="ALL">
                            Select a Operating System
                        </option>
                        <!--All the results from the database listed -->
                        <option value="ALL">
                        </option>
            <br clear="all"/>

                            <div class="label">Type:</div>
                            <form action="types_result.php">
                                <!--    //you can call it whatever you want-->
                                <select name="types">
                        <option value="ALL">
                            Select a Type
                        </option>
                        <option value="ALL">
                        </option>
                            <br clear="all"/>

            <input class="search-submit" type="submit" value="Search"/>
        </form>
    </div>
    <br clear="all"/>
</div>
</body>
<html>
<?php
//1. We must connect to the database called dent_exam
$mysql = new mysqli(
    'webdev.iyaclasses.com',
    'dent_guest',
    'Acad276_Ttrojan_Dev2Ex@m',
    'dent_exam'
);

//Check for errors in the actual connection of the database
if($mysql->connet_error){
    echo "db connection error:" . $mysql->connect_error;
    exit();
}

//2. Write the SQL to slect from the lookup table from the database
$sql = "SELECT * FROM manufacturers";

//3. Run SQL against the database and get results of the database
$manufacture_result = $mysql->query($sql);

//4. Display the data in $Manufacture_results
//while should compare one row from the results of the manufacture table to output the results one at a time within the dropdown
while($currentrow = $manufacture_result->fetch_assoc()){
  echo "<option value" . $currentrow["manufacture_id"] . ">";
  echo $currentrow["manufacturer"];
  echo "</option>";
}


//2. Write the SQL
// I realize you have to connect the SQL tables together so there can be information even listed
$sql2 = "SELECT * FROM systems";

//3. Run SQL against db and get results
$system_result = $mysql->query($sql2);

//4. Display the data in $results
while($currentrow = $system_result->fetch_assoc()){
echo "<option value" . $currentrow["system_id"] . ">";
echo $currentrow["system"];
echo "</option>";
}

$sql3 = "SELECT * FROM types";

//3. Run SQL against db and get results
$types_result = $mysql->query($sql3);

//4. Display the data in $results
while($currentrow = $types_result->fetch_assoc()){
    echo "<option value" . $currentrow["type_id"] . ">";
    echo $currentrow["types"];
    echo "</option>";
}
?>
</html>