Пример #1
0
 static function send_email_to_toursit_client($reservation_id, $vouchers_state)
 {
     $reservation = self::get_reservation_by_id($reservation_id);
     $our_email = '*****@*****.**';
     $to = $reservation['client_email'];
     $subject = "SEGWAY reservation";
     $body = "";
     $body .= '<div style="width: 500px; border: 1px solid; padding: 30px;">
                     <table style="width: 100%;">
                         <tr><th style="width: 400px;">Name: </th><td style="width: 400px;">' . $reservation['client_name'] . '</td></tr>
                         <tr><th style="width: 400px;">Email:</th><td style="width: 400px;"> ' . $reservation['client_email'] . '</td></tr>
                         <tr><th style="width: 400px;">Phone: </th><td style="width: 400px;">' . $reservation['client_telefon'] . '</td></tr>
                         <tr><th style="width: 400px;">Date of reservation: </th><td style="width: 400px;">' . $reservation['reservation_date'] . '</td></tr>
                     </table>
                     <br><br>';
     $body .= '<div class="events_wrapper">';
     for ($j = 0; $j < count($reservation['event']); $j++) {
         $body .= '<div style="border: 1px solid; padding: 10px; margin-bottom: 15px;">
                    <table style="width: 100%;">
                     <tr><th style="width: 400px;">Event date: </th><td style="width: 400px;">' . $reservation['event'][$j]['date'] . '</td></tr>
                     <tr><th style="wid th: 400px;">Direction: </th><td style="width: 400px;">' . $reservation['event'][$j]['direction'] . '</td></tr>
                     <tr><th style="width: 400px;">Time: </th><td style="width: 400px;">' . $reservation['event'][$j]['hours'] . '</td></tr>
                     <tr><th style="width: 400px;">Places: </th><td style="width: 400px;">' . $reservation['event'][$j]['choosen_places'] . '</td></tr>
                   </table></div>';
     }
     $body .= '</div>
                 </div>';
     Dispatcher::send_email($to, $subject, $body);
     $instructors_array = instructorController::getInstructors();
     $to = $instructors_array[0]['email'];
     $subject = "SEGWAY tourist reservation";
     $body = "";
     $body .= '<div style="width: 500px; border: 1px solid; padding: 30px;">
                     <table style="width: 100%;">
                         <tr><th style="width: 400px;">Name: </th><td style="width: 400px;">' . $reservation['client_name'] . '</td></tr>
                         <tr><th style="width: 400px;">Email:</th><td style="width: 400px;"> ' . $reservation['client_email'] . '</td></tr>
                         <tr><th style="width: 400px;">Phone: </th><td style="width: 400px;">' . $reservation['client_telefon'] . '</td></tr>
                         <tr><th style="width: 400px;">Reservation date: </th><td style="width: 400px;">' . $reservation['reservation_date'] . '</td></tr>
                     </table>
                     <br><br>';
     $body .= '<div class="events_wrapper">';
     for ($j = 0; $j < count($reservation['event']); $j++) {
         $body .= '<div style="border: 1px solid; padding: 10px; margin-bottom: 15px;">
                    <table style="width: 100%;">
                     <tr><th style="width: 400px;">Event date: </th><td style="width: 400px;">' . $reservation['event'][$j]['date'] . '</td></tr>
                     <tr><th style="wid th: 400px;">Direction: </th><td style="width: 400px;">' . $reservation['event'][$j]['direction'] . '</td></tr>
                     <tr><th style="width: 400px;">Time: </th><td style="width: 400px;">' . $reservation['event'][$j]['hours'] . '</td></tr>
                     <tr><th style="width: 400px;">Choosen places: </th><td style="width: 400px;">' . $reservation['event'][$j]['choosen_places'] . '</td></tr>
                   </table></div>';
     }
     $body .= '</div>
                 </div>';
     //        Dispatcher::send_email($to, $subject, $body);
     //        Dispatcher::send_email("*****@*****.**", $subject, $body);
 }
Пример #2
0
 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);
 }
Пример #3
0
    clientsTable(CalendarController::getDateHoursReservations());
}
if ($action == 'booking_add_instructor') {
    instructorController::addInstructor();
}
if ($action == 'booking_edit_instructor') {
    instructorController::editInstructor();
}
if ($action == 'booking_remove_instructor') {
    instructorController::removeInstructor();
}
if ($action == 'booking_change_instructor') {
    instructorController::changeInstructor();
}
if ($action == 'booking_change_instructor_color') {
    instructorController::changeColor();
}
if ($action == 'addVoucherInfo') {
    $name = $_POST['name'];
    $variant = $_POST['variant'];
    $variant_api = $_POST['variant_api'];
    $price_czk = $_POST['price_czk'];
    $price_eur = $_POST['price_eur'];
    $places = $_POST['places'];
    $reserve_type = $_POST['reserve_type'];
    voucherController::addVoucherInfo($name, $variant, $variant_api, $price_czk, $price_eur, $places, $reserve_type);
}
if ($action == "booking_check_voucher") {
    $voucherCode = $_POST['voucherCode'];
    $voucher_index = $_POST['voucherCount'];
    $voucherController = new voucherController();
<?php

require_once "../core/core.inc";
require_once "../core/view.php";
//$days_array = Dispatcher::get_days_info();
$instructors_array = instructorController::getInstructors();
?>

<div class="modal fade" id="add-instructors-modal" tabindex="-1" role="dialog" aria-labelledby="instructors-modal" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content timetable-modal-content">
            <div class="modal-header timetable-modal-header">
                <button type="button" class="global-close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <!--<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>-->
                <div class="modal-title" id="myModalLabel">Instructors</div>
            </div>
            <div class="modal-body timetable-modal-body">

                <button id="add-instructor-btn" class="add-instructor-btn popover-dismiss" data-placement="bottom">
                    <span class="add_instructor_plus"></span><span class="add-instructor-label">Add instuctor</span>
                </button>

                <!--                <button id="add-instructor-btn" type="button" data-placement="bottom" class="add-instructor-btn popover-dismiss btn btn-default btn-lg">
                                    <span class="glyphicon glyphicon-plus-sign"></span> Add instuctor
                                </button>-->

<!--<input type="text" name='instructor-name' value=""/>-->
                <table class="list-of-instructors">
                    <?php 
get_instructors_view($instructors_array);
?>
Пример #5
0
function booking_hours_table_view($date, $result, $type, $action, $default_hours, $type_index, $create_type)
{
    $vouchers_info_array = Dispatcher::booking_get_booking_info("slevomat", "");
    $booking_info_array = Dispatcher::booking_get_booking_info("tourists", "");
    $instructor_info_array = instructorController::getInstructors();
    $directions_info = MainController::getDirInfo();
    //    MainController::printArray($result);
    if ($type == "morning") {
        ?>
        <td class="tours_wrapper_table_left_td">
            <?php 
    }
    if ($type == "evening") {
        ?>
        <td class="tours_wrapper_table_right_td">
            <?php 
    }
    ?>
        <table class="<?php 
    echo $type;
    ?>
_tours">
            <tbody>
                <?php 
    $lang = "en";
    for ($i = 0; $i < count($result); $i++) {
        if ($result[$i]['display'] == 1) {
            if ($result[$i]['reserve_type'] == "" || $result[$i]['reserve_type'] == "tourists") {
                $slevomat_checked = "";
                $tourists_checked = "checked";
            } else {
                $slevomat_checked = "checked";
                $tourists_checked = "";
            }
            if ($result[$i]['create_type'] == 'default') {
                $default_hours = true;
            } else {
                $default_hours = false;
            }
            ?>
                        <tr id="row_<?php 
            echo $result[$i]['hourID'];
            ?>
">
                            <td>
                                <?php 
            if ($result[$i]['create_type'] == "Date" || $result[$i]['has_changes'] == 1) {
                ?>
                                    <div class="day-contents-has-changes"></div>
                                <?php 
            }
            ?>
                            </td>
                            <?php 
            if ($create_type == "Date") {
                ?>
                                <td width="5px"></td>
                                <td class="hours_td"><?php 
                echo $result[$i]['free_places'];
                ?>
</td>
                            <?php 
            }
            ?>
                            <td width="5px"></td>
                            <td class="reserve-admin-plus">
                                <?php 
            if ($create_type == "Date" && $result[$i]['choosen_places'] < $result[$i]['max_places'] && Date($date) >= Date("Y-m-d")) {
                ?>
                                    <button onclick="get_free_places_qty()" id="add-<?php 
                echo $type;
                ?>
-reserve-plus-<?php 
                echo $result[$i]['hourID'];
                ?>
"
                                            class="create_reserve_plus morning_class popover-dismiss" 
                                            data-placement="bottom"
                                            data-title="Create reservation"
                                            data-date=""
                                            data-weekday=""
                                            data-action="create_reserve"
                                            data-content="<?php 
                get_create_reserve_btn_view($result, $type, $i, $directions_info, $booking_info_array, $action, $tourists_checked, $slevomat_checked, $type_index);
                ?>
">
                                    </button>
                                <?php 
            }
            ?>
                            </td>     
                            <td width="5px"></td>
                            <td class="reserve-type-label">               
                                <?php 
            if ($result[$i]['reserve_type'] == "" || $result[$i]['reserve_type'] == "tourists") {
                ?>
                                    <span class="reserve-type-label-inner label label-warning" 
                                          data-toggle="tooltip" 
                                          data-placement="top" 
                                          title="Tourists">T</span>
                                          <?php 
            } else {
                ?>
                                    <span class="reserve-type-label-inner label label-info" 
                                          data-toggle="tooltip" 
                                          data-placement="top" 
                                          title="Slevomat">S</span>
                                      <?php 
            }
            ?>
                            </td>
                            <td>
                                <span class="label label-during-type" 
                                      data-toggle="tooltip" 
                                      data-placement="top" 
                                      title="Voucher type"><?php 
            echo $result[$i]['variant'];
            ?>
</span>
                            </td>
                            <td width="5px"></td>
                            <?php 
            $disabled = "";
            if ($result[$i]['reserve_type'] == "slevomat") {
            }
            if (($result[$i]['create_type'] == 'Default' || $result[$i]['create_type'] == "Weekday") && $create_type == "Date" || $result[$i]['create_type'] == "Default" && $create_type == "Weekday") {
                $act = "default";
                $disabled = "disabled";
            } else {
                if ($result[$i]['create_type'] == 'Default' && $create_type == "Default") {
                    $act = "default";
                    $disabled = "";
                } else {
                    $act = "date";
                }
            }
            ?>
                            <?php 
            if ($result[$i]['state'] == 0) {
                ?>
                                <td>
                                    <input id="<?php 
                echo $type;
                ?>
_tours_checkbox_<?php 
                echo $i;
                ?>
" 
                                           type="checkbox"
                                           onchange="change_hour_state(this,
                                                           '<?php 
                echo $type;
                ?>
',
                                                           '<?php 
                echo $result[$i]['hourID'];
                ?>
',
                                                           '<?php 
                echo $lang;
                ?>
',
                                                           '<?php 
                echo $i;
                ?>
',
                                                           '<?php 
                echo $create_type;
                ?>
',
                                                           '<?php 
                echo $result[$i]['create_type'];
                ?>
');">
                                </td>
                                <?php 
            } else {
                if ($result[$i]['state'] == 1) {
                    ?>
                                <td>
                                    <input id="<?php 
                    echo $type;
                    ?>
_tours_checkbox_<?php 
                    echo $i;
                    ?>
" type="checkbox" checked="on"
                                           onchange="change_hour_state(this,
                                                           '<?php 
                    echo $type;
                    ?>
',
                                                           '<?php 
                    echo $result[$i]['hourID'];
                    ?>
',
                                                           '<?php 
                    echo $lang;
                    ?>
',
                                                           '<?php 
                    echo $i;
                    ?>
',
                                                           '<?php 
                    echo $create_type;
                    ?>
',
                                                           '<?php 
                    echo $result[$i]['create_type'];
                    ?>
');">
                                </td>
                                <?php 
                }
            }
            ?>
                            <td width="10px"></td> 
                            <?php 
            if ($result[$i]['state'] == 1) {
                ?>
                                <td id="<?php 
                echo $type;
                ?>
-hours-id-<?php 
                echo $i;
                ?>
" class="hours_td">
                                    <?php 
                echo $result[$i]["hours"];
                ?>
                                </td>
                                <?php 
                //                            echo $result[$i]['hourState'] . '<br>';
            } else {
                if ($result[$i]['state'] == 0) {
                    ?>
                                                
                                <td id="<?php 
                    echo $type;
                    ?>
-hours-id-<?php 
                    echo $i;
                    ?>
" class="hours_td inactive">
                                    <?php 
                    echo $result[$i]["hours"];
                    ?>
                                </td>
                            <?php 
                }
            }
            ?>
                            <td>
                                <button id="choose-instructor-<?php 
            echo $type;
            ?>
-tours-hour-btn-<?php 
            echo $i;
            ?>
"
                                        class="btn btn-xs label-during-type choose-instructor-tours-hour-btn" 
                                        data-placement="bottom" 
                                        title="Choose instructor"
                                        data-reserve-type="<?php 
            echo $result[$i]['reserve_type'];
            ?>
"
                                        data-create-type="<?php 
            echo $result[$i]['create_type'];
            ?>
"
                                        data-action="<?php 
            echo $action;
            ?>
"
                                        data-hour-type="<?php 
            echo $type;
            ?>
"
                                        data-date="<?php 
            echo $date;
            ?>
"
                                        data-weekday="<?php 
            echo $result[$i]['weekday'];
            ?>
"
                                        data-content="<?php 
            get_choose_instructor_btn_view($result, $type, $i, $instructor_info_array, $create_type);
            ?>
" 
                                        style="cursor: pointer; background-color: <?php 
            echo $result[$i]['color'];
            ?>
; color: <?php 
            echo $result[$i]['color'];
            ?>
;">&nbsp;&nbsp;&nbsp;&nbsp;</button>

                                <button id="edit-<?php 
            echo $type;
            ?>
-tours-hour-btn-<?php 
            echo $i;
            ?>
"
                                        type="button" class="btn btn-default btn-xs edit-tours-hour-btn popover-dismiss" 
                                        data-placement="bottom" 
                                        data-title="Edit hours" 
                                        data-toggle="tooltip"
                                        data-reserve-type="<?php 
            echo $result[$i]['reserve_type'];
            ?>
"
                                        title="Edit"
                                        data-create-type="<?php 
            echo $result[$i]['create_type'];
            ?>
"
                                        data-action="<?php 
            echo $action;
            ?>
"
                                        data-hour-type="<?php 
            echo $type;
            ?>
"
                                        data-date="<?php 
            echo $date;
            ?>
"
                                        data-weekday="<?php 
            echo $result[$i]['weekday'];
            ?>
"
                                        data-content="<?php 
            get_edit_hour_btn_view($result, $type, $i, $vouchers_info_array, $booking_info_array, $action, $tourists_checked, $slevomat_checked, $type_index, $directions_info);
            ?>
">
                                    <span class="glyphicon glyphicon-pencil"></span>
                                </button>
                                <button onclick="remove_hours('<?php 
            echo $date;
            ?>
', '<?php 
            echo $result[$i]['weekday'];
            ?>
', '<?php 
            echo $type;
            ?>
', <?php 
            echo $result[$i]['hourID'];
            ?>
, 'en', '<?php 
            echo $result[$i]['create_type'];
            ?>
');" 
                                        type="button" class="btn btn-default btn-xs  remove-tours-hour-btn"
                                        data-toggle="tooltip"  <?php 
            echo $disabled;
            ?>
                                        title="Remove" 
                                        data-weekday="<?php 
            echo $result[$i]['weekday'];
            ?>
"> 
                                    <span class="glyphicon glyphicon-trash"></span>
                                </button>
                            </td>
                        </tr>
                                                                                                                                                                                                                <!--</td><td width="40px"></td></tr>-->
                        <?php 
        }
    }
    ?>
            </tbody>
        </table>
        <div id="current-date" style="display: none;"><?php 
    echo $date;
    ?>
</div>
        <!--        <div class='add-hours-reserve-type'>
                    <div class='slevomat-radio-input'><input type='radio' name='slevomat'/>Slevomat</div>
                    <div class='tourists-radio-input'><input name='toutists' type='radio'/>Tourists</div>
                </div>-->
    </td>
    <script>

        $(document).ready(function () {




            popupInitialize();


        });
    </script>
    <?php 
}
Пример #6
0
 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);
 }