Example #1
0
<?php

function getCars($query)
{
    $db = new SQLite3('car.db');
    $results = $db->query($query);
    echo "<table class=\"single-car\">";
    $numRows = 0;
    while ($row = $results->fetchArray()) {
        $numRows++;
    }
    if ($numRows === 0) {
        echo "<tr><td colspan=\"8\">Inga resultat för: \"" . $_POST['search'] . "\"</td></tr>";
    } else {
        while ($row = $results->fetchArray()) {
            echo "\n                <tr><th>Reg nummer</th><td class=\"car-regnr\"><a data-id=\"{$row['id']}\" href=\"#\" class=\"car-info\">{$row['regnr']}</td></tr>\n                <tr><th>Märke</th> <td class=\"car-brand\">{$row['brand']}</td></tr>\n                <tr><th>Modell</th><td class=\"car-model\">{$row['model']}</td></tr>\n                <tr><th>Pris</th><td class=\"car-price\">{$row['price']}</td></tr>\n                <tr><th>Antal mil</th><td class=\"car-milage\">{$row['milage']}</td></tr>\n                <tr><th>Årsmodell</th><td class=\"car-year\">{$row['year']}</td></tr>\n                ";
        }
        echo "</table>";
        echo '<button id="update">Uppdatera</button>';
        echo '<button id="remove">Ta bort</button><br />';
    }
    $db->close();
}
$query = "SELECT * FROM cars WHERE id=" . $_POST['id'] . "";
getCars($query);
Example #2
0
				<div class="hero-unit">
					<h1 style="color:#ffffff;">Scrap your vehicle</h1>
					<p style ="color:#ffffff;">We will pay you for your end of life vehicle</p>
					<p><a href="#" class="btn btn-primary btn-large">Learn more »</a></p>
				</div>

		
      

			<div id = "search_results">
        
          </div>
          <div id = "results">
              <?php 
echo $links;
echo getCars();
echo $links;
?>
        
         </div>
          <!-- Trigger the modal with a button -->
         <button type="button"  class="btn btn-info btn-lg" style="float:right margin-left:5px;" data-toggle="modal" data-target="#myModal">Find more</button> 

<!-- Modal -->

	</div>
   
  
</div>
</div>
</div>