source: trunk/Modules/Ride/Ride.php

Last change on this file was 8, checked in by chronos, 19 months ago
  • Modified: Updated Common package.
  • Modified: Form types made as separate FormManager package.
  • Fixed: PHP 8.1 support.
File size: 924 bytes
Line 
1<?php
2
3class Ride extends Model
4{
5 function Add($Track, $SeatCount, $Car, $Details)
6 {
7 $this->Database->insert('Ride', array('SeatCount' => $SeatCount, 'Details' => $Details,
8 'Car' => $Car, 'Driver' => $this->System->ModuleManager->Modules['User']->User['Id']));
9 $RideId = $this->Database->insert_id;
10
11 foreach($_SESSION['Track'] as $Index => $TrackItem)
12 {
13 $this->Database->insert('RideStop', array(
14 'Ride' => $RideId,
15 'Place' => $TrackItem['Destination'],
16 'Time' => TimeToMysqlDateTime($TrackItem['Time']),
17 'Price' => $TrackItem['Price'],
18 'Sequence' => $Index,
19 'PassengerCount' => 0,
20 ));
21 }
22 }
23
24 function GetTrack()
25 {
26 return($Track);
27 }
28
29 function Remove($Id)
30 {
31 $this->Database->delete('Passenger', 'Ride='.$Id);
32 $this->Database->delete('RideStop', 'Ride='.$Id);
33 $this->Database->delete('Ride', 'Id='.$Id);
34 }
35}
Note: See TracBrowser for help on using the repository browser.