Exemple #1
0
    MainController::removeInstaPhoto();
    $_POST['filter'] = "all";
    instagramView(MainController::getInstaPhotos(), "admin");
}
if ($action == 'editInstaPopupInfo') {
    MainController::editPopupInfo($_POST['language'], "instagram");
}
if ($action == 'createResrvationByAdmin') {
    reservationController::createResrvationByAdmin();
}
if ($action == 'booking_deleteClientReservation') {
    reservationController::deleteClientReservation();
    clientsTable(CalendarController::getDateHoursReservations());
}
if ($action == 'booking_deleteClientHoursReservation') {
    reservationController::booking_deleteClientHoursReservation();
}
if ($action == 'booking_change_day_state') {
    MainController::changeWeekdayState();
}
if ($action == 'booking_create_client') {
    MainController::booking_create_client();
}
if ($action == "booking_get_confirm_code") {
    MainController::booking_get_confirm_code();
}
if ($action == 'remove_hours') {
    HoursController::remove_hours();
}
if ($action == 'edit_hours') {
    HoursController::edit_hours();
 static function changeInstructor()
 {
     $instructor_id = $_POST['instructor_id'];
     $prev_instructor_id = $_POST['prev_instructor_id'];
     $hour_id = $_POST['hour_id'];
     $hour_create_type = $_POST['hour_create_type'];
     $clicked_create_type = $_POST['clicked_create_type'];
     $date = $_POST['date'];
     if ($hour_create_type == "Date") {
         Dispatcher::$mysqli->query("update instructor_has_hours set " . "instructor_id={$instructor_id} where " . "instructor_id={$prev_instructor_id} and hours_id={$hour_id}");
     } else {
         if ($hour_create_type == "Default") {
             $cursor = Dispatcher::$mysqli->query("select * from custom_intsructor where " . "create_type='Default' and date='{$date}' and hours_id={$hour_id} and instructor_id={$prev_instructor_id}");
             if ($cursor->num_rows > 0) {
                 Dispatcher::$mysqli->query("update custom_intsructor set " . "instructor_id={$instructor_id} where " . "instructor_id={$prev_instructor_id} " . "and hours_id={$hour_id} and create_type='Default' and date='{$date}'");
             } else {
                 Dispatcher::$mysqli->query("insert into custom_intsructor(instructor_id, hours_id, create_type, date) " . "values ({$instructor_id}, {$hour_id}, 'Default', '{$date}')");
             }
             print_r(Dispatcher::$mysqli->error);
         } else {
             if ($hour_create_type == "Weekday") {
                 echo '<br><br>' . $date . " " . $hour_id . " " . $prev_instructor_id . " in dateHours<br><br>";
                 $cursor = Dispatcher::$mysqli->query("select * from custom_intsructor where " . "date='{$date}' and hours_id={$hour_id} and instructor_id={$prev_instructor_id}");
                 if ($cursor->num_rows > 0) {
                     Dispatcher::$mysqli->query("update custom_intsructor set " . "instructor_id={$instructor_id} where " . "instructor_id={$prev_instructor_id} " . "and hours_id={$hour_id} and date='{$date}'");
                 } else {
                     Dispatcher::$mysqli->query("insert into custom_intsructor(instructor_id, hours_id, create_type, date) " . "values ({$instructor_id}, {$hour_id}, '', '{$date}')");
                 }
             }
         }
     }
     print_r(Dispatcher::$mysqli->error);
     $hoursInfo = HoursController::getHoursById($hour_id);
     $instructorInfo = instructorController::getInstructorByID($instructor_id);
     $prevInsrtuctorInfo = instructorController::getInstructorByID($prev_instructor_id);
     $reservationsInfo = reservationController::getResevationsByDateHour($date, $hoursInfo);
     $calendarEventController = new InstructorCalendarEvents();
     $calendarEventController->addInstructorCalendarEvent($reservationsInfo, $instructorInfo, $prevInsrtuctorInfo, $hoursInfo);
 }
 static function changeInstructor()
 {
     $instructor_id = $_POST['instructor_id'];
     $prev_instructor_id = $_POST['prev_instructor_id'];
     $hour_id = $_POST['hour_id'];
     $hour_create_type = $_POST['hour_create_type'];
     $clicked_create_type = $_POST['clicked_create_type'];
     $weekday = $_POST['weekday'];
     $modul = $_POST['modul'];
     if ($clicked_create_type == $hour_create_type) {
         Dispatcher::$mysqli->query("update instructor_has_hours set " . "instructor_id={$instructor_id} where " . "instructor_id={$prev_instructor_id} and hours_id={$hour_id}");
     }
     if ($clicked_create_type == "Default") {
         $cursor = Dispatcher::$mysqli->query("select * from custom_intsructor where " . "weekday='{$weekday}' and hours_id={$hour_id} and instructor_id={$prev_instructor_id}");
         if ($cursor->num_rows > 0) {
             Dispatcher::$mysqli->query("update custom_intsructor set " . "instructor_id={$instructor_id} where " . "instructor_id={$prev_instructor_id} and hours_id={$hour_id}");
         } else {
             Dispatcher::$mysqli->query("insert into custom_intsructor(instructor_id, hours_id, weekday) " . "values ({$instructor_id}, {$hour_id}, '{$weekday}')");
         }
         print_r(Dispatcher::$mysqli->error);
     }
     $weekdayDates = $_POST['weekdayDates'];
     $hoursInfo = HoursController::getHoursById($hour_id);
     $instructorInfo = instructorController::getInstructorByID($instructor_id);
     $previnstructorInfo = instructorController::getInstructorByID($prev_instructor_id);
     for ($i = 0; $i < count($weekdayDates); $i++) {
         //            $_POST['date'] = $weekdayDates[$i];
         $reservationsInfo = reservationController::getResevationsByDateHour($weekdayDates[$i], $hoursInfo);
         //            MainController::printArray($reservationsInfo);
         $calendarEventController = new InstructorCalendarEvents();
         $calendarEventController->addInstructorCalendarEvent($reservationsInfo, $instructorInfo, $previnstructorInfo, $hoursInfo);
     }
     print_r(Dispatcher::$mysqli->error);
 }