Differences
This shows you the differences between two versions of the page.
proc_help_garage [2017-09-01 12:54] |
proc_help_garage [2022-07-18 11:20] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Hjälp genomgång ====== | ||
+ | |||
+ | <code php> | ||
+ | <?php | ||
+ | class Garage extends mysqli { | ||
+ | |||
+ | public function __construct($settings) { | ||
+ | parent:: | ||
+ | if ($this-> | ||
+ | echo " | ||
+ | exit; | ||
+ | } | ||
+ | $query = "SET NAMES utf8"; | ||
+ | $this-> | ||
+ | } | ||
+ | | ||
+ | public function parkVehicle($vehicle) { | ||
+ | $query =" | ||
+ | $this-> | ||
+ | } | ||
+ | | ||
+ | public function checkoutVehicle($reg_id) { | ||
+ | // Hämta alla från databasen | ||
+ | $query = " | ||
+ | $result = $this-> | ||
+ | while ($row = $result-> | ||
+ | // unserilize | ||
+ | $object = unserialize($row[' | ||
+ | // jämför regid om reg_id är rätt | ||
+ | if ($reg_id == $object-> | ||
+ | // Ta bort från databas | ||
+ | $query = " | ||
+ | $this-> | ||
+ | // retunera objektet | ||
+ | return $object; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | } | ||
+ | |||
+ | </ |