Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once("design/top.php");
- ?>
- <section id="content">
- <div class="g12">
- <?php notification($error, $message);?>
- <form id="" action="" method="post" data-ajax="false">
- <fieldset>
- <label>Robothistorikk</label>
- <section>
- <table>
- <tbody>
- <tr>
- <td><span><strong>Robot: </strong> </span><input id="integer" name="searchRobot" type="number" class="integer" maxlength="2"></td>
- <td><span><strong>Dato: </strong> </span><input id="date" name="searchDate" type="text" class="date"></td>
- <td><span><strong>Feilkode: </strong> </span><input id="integer" name="searchErrorcode" type="number" class="errorcode" maxlength="3"></td>
- <td><span><strong>Koordinat:</strong> </span><input type="text" class="xy" id="" name="searchCoordinate"></td>
- <td><span><strong>Logget av:</strong> </span></span><input id="nick" name="searchLoggedBy" type="number" class="nick"></td>
- <td><button class="submit" name="search">Søk</button></td>
- </tr>
- <tbody>
- </table>
- </section>
- </fieldset>
- </form>
- <table>
- <thead>
- <tr>
- <th>Status </th>
- <th>Dato</th>
- <th>Robot </th>
- <th>X/Y </th>
- <th>Port </th>
- <th>Feilkode </th>
- <th>Feilmedling</th>
- <th>Observasjon</th>
- <th>Løsning</th>
- <th>Nedetid </th>
- </tr>
- </thead>
- <tbody>
- <?php
- if(isset($_POST['search'])) {
- $s_robot = $_POST['searchRobot'];
- $s_date = $_POST['searchDate'];
- $s_code = $_POST['searchErrorcode'];
- $s_position = $_POST['searchCoordinate'];
- $s_nick = $_POST['searchLoggedBy'];
- //Check witch query to select. Can be made simplier, not priority
- if(!empty($s_robot)) {
- $searchQuery = mysql_query("SELECT * FROM robot_error WHERE robot = '$s_robot' ORDER BY id DESC");
- }
- elseif(!empty($s_date)) {
- $searchQuery = mysql_query("SELECT * FROM robot_error WHERE date = '$s_date' ORDER BY id DESC");
- }
- elseif(!empty($s_code)) {
- $searchQuery = mysql_query("SELECT * FROM robot_error WHERE error_code = '$s_code' ORDER BY id DESC");
- }
- elseif(!empty($s_position)) {
- $searchQuery = mysql_query("SELECT * FROM robot_error WHERE position = '$s_position' ORDER BY id DESC");
- }
- elseif(!empty($s_nick)) {
- $searchQuery = mysql_query("SELECT * FROM robot_error WHERE logged_by = '$s_nick' ORDER BY id DESC");
- }
- if($s_robot != "") {
- $search_robot = $s_robot;
- }
- else {
- $inf = mysql_fetch_array($searchSQL);
- $search_robot = $inf['robot'];
- }
- }
- ?>
- </tbody>
- </table>
- </div>
- </section>
- <?php
- require_once("design/bottom.php");
- ?>
Add Comment
Please, Sign In to add comment