Differences
This shows you the differences between two versions of the page.
proc_help_garage [2012-11-29 14:12] Joakim Forsgren |
proc_help_garage [2022-07-18 13:20] |
||
---|---|---|---|
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; | ||
- | } | ||
- | } | ||
- | } | ||
- | |||
- | } | ||
- | |||
- | </ |