static function booking_create_reservation_summary($reservation_id, $client_id, $resDate, $hours_array, $reserve_type) { $instructorCalendarEvents = new InstructorCalendarEvents(); for ($j = 0; $j < count($hours_array); $j++) { if ($hours_array[$j]['choosen_places'] > 0) { $hour_id = $hours_array[$j]['hours_id']; $cursor = Dispatcher::$mysqli->query("select * from event where hours_id={$hour_id} and date='{$resDate}'"); if ($cursor->num_rows > 0) { $row = $cursor->fetch_assoc(); $instructorCalendarEvents->updateEventAfterReservation($hours_array[$j], $row, $client_id, $resDate, $reservation_id, $reserve_type); } else { $instructorCalendarEvents->addEventAfterReservation($hours_array[$j], $client_id, $resDate, $reservation_id, $reserve_type); } } } print_r(Dispatcher::$mysqli->error); }