Database->insert('Ride', array('SeatCount' => $SeatCount, 'Details' => $Details, 'Car' => $Car, 'Driver' => $this->System->ModuleManager->Modules['User']->User['Id'])); $RideId = $this->Database->insert_id; foreach($_SESSION['Track'] as $Index => $TrackItem) { $this->Database->insert('RideStop', array( 'Ride' => $RideId, 'Place' => $TrackItem['Destination'], 'Time' => TimeToMysqlDateTime($TrackItem['Time']), 'Price' => $TrackItem['Price'], 'Sequence' => $Index, 'PassengerCount' => 0, )); } } function GetTrack() { return($Track); } function Remove($Id) { $this->Database->delete('Passenger', 'Ride='.$Id); $this->Database->delete('RideStop', 'Ride='.$Id); $this->Database->delete('Ride', 'Id='.$Id); } }