<?php
require_once 'Connections/courier.php';
require_once 'functions/functions.php';
mysql_select_db($database_courier, $courier);
$qry = mysql_query("SELECT * FROM users where (security='MEDICAL OFFICER' or security='OPTICIAN' or security='DENTIST') order by title, surname, firstnames", $courier); ?>


<!-- <div style="display: none;position: fixed;right:-400px;" id="pop_up_modal" class="pop_up_modal col-md-6">
    <div class="portlet white box" id="pop_up_modal_2">
       
    </div>
        <div class="form-actions right form_action_buttons" style="background-color: white;border: none;padding: 0;margin-top: -15px;">
                            <a id="delete_event" class="btn red"><i class="icon-trash"></i> Delete </a>
                            <a id="create_event" class="btn default"><i class="icon-ok-circle"></i> Save </a>
			</div>
</div> -->

<!-- <div style="display: none;position: fixed;right:-400px;" id="pop_up_modal" class="pop_up_modal col-md-6">
<div class="portlet light " id="pop_up_modal_2">
</div>
<div class="form-actions">
    <hr>
                <a id="delete_event" class="btn blue">Save <i class="fa fa-ok"></i> </a>
                <a id="create_event" class="btn red">Delete <i class="fa fa-trash"></i> </a>
            </div>
</div> -->


<div class="modal fade bs-modal-lg" id="pop_up_modal" tabindex="-1" role="dialog" aria-hidden="true">
                                        <div class="modal-dialog modal-lg">
                                            <div class="modal-content">
                                                <div class="modal-header">
                                                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
                                                    <h4 class="modal-title">Appointment Booking / Events</h4>
                                                </div>
                                                <div class="modal-body" id="pop_up_modal_2"></div>
                                                <div class="modal-footer">
                                                    <button type="button" class="btn dark btn-outline" data-dismiss="modal">Close</button>
                                                    <button id="delete_event" type="button" class="btn red btn-outline">Delete</button>
                                                    <button id="create_event" type="button" class="btn green">Save changes</button>
                                                </div>
                                            </div>
                                        </div>
</div>



<div class="page-bar">
                        <ul class="page-breadcrumb">
                            <li>
                                <i class="icon-home"></i>
                                <a href="index.html">Home</a>
                                <i class="fa fa-angle-right"></i>
                            </li>
                            <li>
                                <span>Dashboard</span>
                            </li>
                        </ul>
                        <div class="page-toolbar">
                            <div class="btn-group pull-right">
                                <button type="button" class="btn btn-fit-height grey-salt dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-delay="1000" data-close-others="true"> Actions
                                    <i class="fa fa-angle-down"></i>
                                </button>
                                <ul class="dropdown-menu pull-right" role="menu">
                                    <li><a onclick="view_calendar('<?php echo $_GET['calendar'];?>');" href="javascript:;"><i class="icon-refresh"></i> Refresh </a> </li>
                                    <li><a onclick="view_calendar('<?php echo $_SESSION['myMM_Userid'];?>');" href="javascript:;"><i class="icon-calendar"></i> My Calendar </a> </li>
                                    <li><a onclick="getstep('gp_schedule_view');" href="javascript:;"><i class="icon-time"></i> Scheduler </a> </li>
                                </ul>
                            </div>
                        </div>
</div>

<div class="portlet light">
    <!-- <div class="portlet-title">
                <div   class="caption">
            <i class="icon-calendar"></i><?php if($_GET['calendar'] == $_SESSION['myMM_Userid']){ echo 'My Calendar';}else{ echo UserFullName($_GET['calendar'], $courier)." 's Calendar";} ?></div>
 </div> -->

    <div class="portlet-body">
        <div class="portlet white box">
            <div class="portlet-title">
                <div style="color:#000" class="caption col-md-3"><i class="icon-user-md"></i>
                    SELECT DOCTOR
                </div>
                <div class="col-md-9">
                    <select onchange="view_calendar(this.value);" class="form-control" style="width:100%;margin-top: -10px;" name="doctors_name" id="doctors_name">
                                            <option value="">Select Doctor</option>
                                            <?php while ($row = mysql_fetch_assoc($qry)) { ?>
                                                <option <?php if($_GET['calendar'] == $row['id']){echo 'selected=""';} ?> value="<?php echo $row['id']; ?>"><?php echo $row['title'] . " " . $row['surname'] . " " . $row['firstnames'] . " (" . $row['area_specialisation'] . ")"; ?></option>   
                                            <?php } ?>
                                        </select>
                </div>
            </div>
            <div class="portlet-body">
                <form name="form" class="form" role="form">
                    <div class="form-body">
                        
                        <div id='wrap'>
                            <div id='external-events'>
                                <h4><b>Drag Events</b></h4>
                                <div class='fc-event' style="text-align:center;font-size:12px">New Event</div>
                                <p>
                                    <i style="font-size:30px;margin-left:35px;color:red;" class="icon-trash" id="trash"></i>
                                </p>
                            </div>
                            <div id='calendar'></div>
                            <div style='clear:both'></div>
                        </div>
                       
                    </div>
                </form>
            </div>
        </div>

    </div>
</div>