767 lines
		
	
	
		
			50 KiB
		
	
	
	
		
			PHP
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			767 lines
		
	
	
		
			50 KiB
		
	
	
	
		
			PHP
		
	
	
		
			Executable File
		
	
	
	
	
<!--sidebar end-->
 | 
						|
<!--main content start-->
 | 
						|
 | 
						|
 | 
						|
<div class="app-content content">
 | 
						|
    <section class="content-wrapper">
 | 
						|
        <div class="row">
 | 
						|
            <div class="col-12">
 | 
						|
                <div class="top_header">
 | 
						|
                    <div class="card-header">
 | 
						|
                        <div class="row">
 | 
						|
                            <div class="col-md-12">
 | 
						|
                              <h3 class="font-weight-bold" style="text-align: center;"><?php echo lang('Patient Schedule '); ?> </h3>
 | 
						|
                            </div>
 | 
						|
                        </div>
 | 
						|
                    </div>
 | 
						|
                    <hr class="mt-0 mb-0" />
 | 
						|
                    <div class="panel-body2">
 | 
						|
                        <div class="row">
 | 
						|
                        <div class="col-12">
 | 
						|
                            <div class="adv-table editable-table ">
 | 
						|
                                <div class="space15"></div>
 | 
						|
                                <h4>Patient Info</h4>
 | 
						|
                                <div class="row">
 | 
						|
                                    <div class="col-md-3">
 | 
						|
                                        <h2>patient Id: <?php echo $patient['patient_id']; ?></h2>
 | 
						|
                                    </div>
 | 
						|
                                    <div class="col-md-3">
 | 
						|
                                        <h2>Name: <?php echo $patient['patient_fullname']; ?></h2>
 | 
						|
                                    </div>
 | 
						|
                                    <div class="col-md-3">
 | 
						|
                                        <h2>Phone: <?php echo $patient['telephone']; ?></h2>
 | 
						|
                                    </div>
 | 
						|
                                    <div class="col-md-3">
 | 
						|
                                        <h2>Care Needed: <?php echo $patient['level_service']; ?></h2>
 | 
						|
                                    </div>
 | 
						|
                                </div>
 | 
						|
                              </div>
 | 
						|
                            </div>
 | 
						|
                        </div>
 | 
						|
                    </div>
 | 
						|
                </div>
 | 
						|
 | 
						|
                <div class="card">
 | 
						|
                    <div class="card-content collapse show">
 | 
						|
                        <div class="card-body card-dashboard">
 | 
						|
                            <div class="panel-body">
 | 
						|
                                <div class="row">
 | 
						|
                                    <div class="col-12">
 | 
						|
                                        <div class="adv-table editable-table ">
 | 
						|
                                            <div class="space15"></div>
 | 
						|
                                            <h4>Caregiver Info</h4>
 | 
						|
                                            <hr class="mt-0 mb-0" />
 | 
						|
 | 
						|
                                            <div id="myTab" class="nav nav-tabs nav_tab_cus" role="tablist">
 | 
						|
                                                <a class="nav-item nav-link active" id="nav-home-tab" data-toggle="tab" href="#nav-home" role="tab" aria-controls="nav-home" aria-selected="true">Caregiver List</a>
 | 
						|
                                                <a class="nav-item nav-link" id="nav-profile-tab" data-toggle="tab" href="#nav-profile" role="tab" aria-controls="nav-profile" aria-selected="false">Caregiver Time Schedule</a>
 | 
						|
                                            </div>
 | 
						|
 | 
						|
                                            <div class="tab-content" id="nav-tabContent">
 | 
						|
                                                <!-- <div class="tab-pane active" id="nav-home" role="tabpanel" aria-labelledby="nav-home-tab"> -->
 | 
						|
                                                <div class="active" id="nav-home" role="tabpanel" aria-labelledby="nav-home-tab">
 | 
						|
                                                    <table class="table table-striped table-bordered dom-jQuery-events" id="editable-sample" cellspacing="0" width="100%">
 | 
						|
                                                        <thead>
 | 
						|
                                                            <tr>
 | 
						|
                                                                <th><?php echo lang('Sl.No'); ?></th>
 | 
						|
                                                                <th><?php echo lang('Caregiver Id'); ?></th>
 | 
						|
                                                                <th><?php echo lang('name'); ?></th>
 | 
						|
                                                                <th><?php echo lang('Phone'); ?></th>
 | 
						|
                                                                <th><?php echo lang('Distance(Mi)'); ?></th>
 | 
						|
                                                                <th class="no-print"><?php echo lang('options'); ?></th>
 | 
						|
                                                            </tr>
 | 
						|
                                                        </thead>
 | 
						|
                                                        <tbody>
 | 
						|
                                                            <?php 
 | 
						|
                                                            $sl=1;
 | 
						|
                                                            // pre($caregivers);
 | 
						|
                                                            foreach($caregivers as $caregiver)
 | 
						|
                                                            { 
 | 
						|
                                                                ?>
 | 
						|
                                                                <tr>
 | 
						|
                                                                    <td><?php echo $sl; ?></td>
 | 
						|
                                                                    <td><a href="<?php echo base_url()?>caregivers/AddNewView?id=<?php echo $caregiver['caregiver_table_id']?>" onclick="ShowCaregiverModal(<?php echo $caregiver['caregiver_table_id']; ?>)">
 | 
						|
                                                                            <?php echo $caregiver['caregiver_id']; ?>
 | 
						|
                                                                        </a>
 | 
						|
                                                                    </td>
 | 
						|
                                                                    <td><?php echo $caregiver['full_name'];?></td>
 | 
						|
                                                                    <td><?php echo $caregiver['cellphone'];?></td>
 | 
						|
                                                                    <td><?php echo $caregiver['distance'];?></td>
 | 
						|
                                                                    <td>
 | 
						|
                                                                        <a href="javascript:void(0);" class="badge badge-info" data-toggle="modal" data-target="#matchModal<?php echo $sl; ?>">
 | 
						|
                                                                            Select
 | 
						|
                                                                        </a>
 | 
						|
                                                                    </td>
 | 
						|
                                                                </tr>
 | 
						|
                                                                
 | 
						|
                                                                <div class="modal fade" id="matchModal<?php echo $sl;?>" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
 | 
						|
                                                                    <div class="modal-dialog modal-dialog2" role="document">
 | 
						|
                                                                        <div class="modal-content margn_1">
 | 
						|
                                                                            <form class="matchPatintcaregiver" cid="<?php echo $caregiver['caregiver_table_id']; ?>">
 | 
						|
                                                                               <!--  <input type="hidden" id="matchCaregiverId" value="<?php echo $caregiver['caregiver_table_id']; ?>"> -->
 | 
						|
                                                                              <div class="modal-header">
 | 
						|
                                                                                <h5 class="modal-title brder_rght col-md-6" id="exampleModalLabel">Patient Requirements</h5>
 | 
						|
                                                                                <h5 class="modal-title mar-2 col-md-6" >Caregiver Matchings</h5>
 | 
						|
                                                                              </div>
 | 
						|
                                                                              <div class="modal-body">
 | 
						|
                                                                                <div class="row">
 | 
						|
                                                                                    <div class="col-md-6" style="padding-right:0px">
 | 
						|
                                                                                        <div class="prt1">
 | 
						|
                                                                                            <ul>
 | 
						|
                                                                                                <li>
 | 
						|
                                                                                                    <h4>Care Needed</h4> 
 | 
						|
                                                                                                    <span>
 | 
						|
                                                                                                        <?php echo $patient['level_service'];?>
 | 
						|
                                                                                                    </span>
 | 
						|
                                                                                                </li>
 | 
						|
                                                                                                <li>
 | 
						|
                                                                                                    <h4>Distance</h4> 
 | 
						|
                                                                                                    <span>
 | 
						|
                                                                                                        <?php 
 | 
						|
                                                                                                        if($patient['distance']>30){
 | 
						|
                                                                                                            echo "more than 30";
 | 
						|
                                                                                                        }else{
 | 
						|
                                                                                                            echo $patient['distance'];
 | 
						|
                                                                                                        }
 | 
						|
                                                                                                        
 | 
						|
                                                                                                        ?>
 | 
						|
                                                                                                    </span>
 | 
						|
                                                                                                </li>
 | 
						|
                                                                                                <li>
 | 
						|
                                                                                                    <h4>Gender</h4> 
 | 
						|
                                                                                                    <span>
 | 
						|
                                                                                                        <?php echo $patient['gender'];?>
 | 
						|
                                                                                                    </span>
 | 
						|
                                                                                                </li>
 | 
						|
                                                                                                <li>
 | 
						|
                                                                                                    <h4>Languages</h4> 
 | 
						|
                                                                                                    <span>
 | 
						|
                                                                                                        <?php echo $patient['primary_language'];?>
 | 
						|
                                                                                                    </span>
 | 
						|
                                                                                                </li>
 | 
						|
                                                                                            </ul>
 | 
						|
                                                                                        </div>
 | 
						|
                                                                                    </div>
 | 
						|
                                                                                    <div class="col-md-6">
 | 
						|
                                                                                        <div class="prt2">
 | 
						|
                                                                                            <ul>
 | 
						|
                                                                                                <li>
 | 
						|
                                                                                                    <?php 
 | 
						|
                                                                                                    if($patient['level_service']==$caregiver['skill_info']['skill']) 
 | 
						|
                                                                                                    { 
 | 
						|
                                                                                                        ?>
 | 
						|
                                                                                                        <i class="la la-check pull-left"></i>
 | 
						|
                                                                                                        <?php 
 | 
						|
                                                                                                    }
 | 
						|
                                                                                                    else
 | 
						|
                                                                                                    { 
 | 
						|
                                                                                                        ?>
 | 
						|
                                                                                                        <i class="la la-close pull-left"></i>
 | 
						|
                                                                                                        <?php 
 | 
						|
                                                                                                    } 
 | 
						|
                                                                                                    ?>
 | 
						|
                                                                                                    <span class="pull-right">
 | 
						|
                                                                                                        <?php echo $caregiver['skill_info']['skill'];?>
 | 
						|
                                                                                                    </span>
 | 
						|
                                                                                                </li>
 | 
						|
                                                                                                <li>
 | 
						|
                                                                                                    <?php 
 | 
						|
                                                                                                    if($caregiver['distance']=="")
 | 
						|
                                                                                                    {
 | 
						|
                                                                                                        ?>
 | 
						|
                                                                                                        <i class="la la-close pull-left"></i>
 | 
						|
                                                                                                        <?php 
 | 
						|
                                                                                                    }
 | 
						|
                                                                                                    else
 | 
						|
                                                                                                    {
 | 
						|
                                                                                                        if($patient['distance']>30){$patient['distance']=999999999;}
 | 
						|
                                                                                                        if($patient['distance']>=$caregiver['distance']) 
 | 
						|
                                                                                                        { 
 | 
						|
                                                                                                            ?>
 | 
						|
                                                                                                            <i class="la la-check pull-left"></i>
 | 
						|
                                                                                                            <?php 
 | 
						|
                                                                                                        }
 | 
						|
                                                                                                        else
 | 
						|
                                                                                                        {
 | 
						|
                                                                                                            ?>
 | 
						|
                                                                                                            <i class="la la-close pull-left"></i>
 | 
						|
                                                                                                            <?php 
 | 
						|
                                                                                                        }
 | 
						|
                                                                                                    } 
 | 
						|
                                                                                                    ?>
 | 
						|
                                                                                                    <span class="pull-right">
 | 
						|
                                                                                                        <?php 
 | 
						|
                                                                                                        if($caregiver['distance']==""){
 | 
						|
                                                                                                            echo "Not Available";
 | 
						|
                                                                                                        }else{echo $caregiver['distance'];}
 | 
						|
                                                                                                        ?>
 | 
						|
                                                                                                    </span>
 | 
						|
                                                                                                </li>
 | 
						|
                                                                                                <li>
 | 
						|
                                                                                                    <?php 
 | 
						|
                                                                                                    if($patient['gender']==$caregiver['gendar']) 
 | 
						|
                                                                                                    { 
 | 
						|
                                                                                                        ?>
 | 
						|
                                                                                                        <i class="la la-check pull-left"></i>
 | 
						|
                                                                                                        <?php 
 | 
						|
                                                                                                    }
 | 
						|
                                                                                                    else
 | 
						|
                                                                                                    { 
 | 
						|
                                                                                                        ?>
 | 
						|
                                                                                                        <i class="la la-close pull-left"></i>
 | 
						|
                                                                                                        <?php 
 | 
						|
                                                                                                    } 
 | 
						|
                                                                                                    ?>
 | 
						|
                                                                                                    <span class="pull-right">
 | 
						|
                                                                                                        <?php echo $caregiver['gendar'];?>
 | 
						|
                                                                                                    </span>
 | 
						|
                                                                                                </li>
 | 
						|
                                                                                                <li>
 | 
						|
                                                                                                    <?php 
 | 
						|
                                                                                                    $caregiver_language_array=explode("/", $caregiver['language']);
 | 
						|
                                                                                                    if(in_array($patient['primary_language'], $caregiver_language_array)) 
 | 
						|
                                                                                                    { 
 | 
						|
                                                                                                        ?>
 | 
						|
                                                                                                        <i class="la la-check pull-left"></i>
 | 
						|
                                                                                                        <?php 
 | 
						|
                                                                                                    }
 | 
						|
                                                                                                    else
 | 
						|
                                                                                                    { 
 | 
						|
                                                                                                        ?>
 | 
						|
                                                                                                        <i class="la la-close pull-left"></i>
 | 
						|
                                                                                                        <?php 
 | 
						|
                                                                                                    } 
 | 
						|
                                                                                                    ?>
 | 
						|
                                                                                                    <span class="pull-right">
 | 
						|
                                                                                                        <?php echo $caregiver['language'];?>
 | 
						|
                                                                                                    </span>
 | 
						|
                                                                                                </li>
 | 
						|
                                                                                            </ul>
 | 
						|
                                                                                        </div>
 | 
						|
                                                                                    </div>
 | 
						|
                                                                                </div>
 | 
						|
                                                                              </div>
 | 
						|
                                                                              <div class="modal-footer">
 | 
						|
                                                                                <button type="button" class="btn btn-secondary" data-dismiss="modal">Back</button>
 | 
						|
                                                                                <!-- <button type="button" class="btn btn-primary" data-dismiss="modal" id="btn_proces">Proceed</button> -->
 | 
						|
                                                                                <button type="submit" class="btn btn-primary" >Proceed</button>
 | 
						|
                                                                              </div>
 | 
						|
                                                                            </form>
 | 
						|
                                                                        </div>
 | 
						|
                                                                    </div>
 | 
						|
                                                                </div>
 | 
						|
                                                            <?php 
 | 
						|
                                                                $sl++;
 | 
						|
                                                                } 
 | 
						|
                                                            ?>
 | 
						|
                                                        </tbody>
 | 
						|
                                                    </table>
 | 
						|
                                                </div>
 | 
						|
 | 
						|
                                                <div class="tab-pane" id="nav-profile" role="tabpanel" aria-labelledby="nav-profile-tab">
 | 
						|
                                                        <!--<div class="col-12 schedule-calender-container" id="calendar_view">
 | 
						|
                                                            <div id='calendar'></div>
 | 
						|
                                                        </div>-->
 | 
						|
                                                    <div class="headng col-md-12">
 | 
						|
                                                        <h2 id="selected_caregiver_name">Caregiver Name: caregiver1 lname</h2>
 | 
						|
                                                    </div>
 | 
						|
                                                    <div class="row">
 | 
						|
                                                        <div class="col-md-3">
 | 
						|
                                                           <div id='calendar-view' class="Lft_calndr"></div>
 | 
						|
                                                           <ul class="dropdwn">
 | 
						|
                                                                <li class="marker-available"><span></span>  <p>Available Zone</p></li>
 | 
						|
                                                                <li class="marker-patient-schedule"><span></span>  <p>Schedule with other</p></li>
 | 
						|
                                                                <li class="marker-patient-schedule2"><span></span>  <p>Schedule with the caregiver</p></li>
 | 
						|
                                                            </ul>
 | 
						|
                                                        </div>
 | 
						|
                                                        <div class="col-md-8 right_cal_zone">
 | 
						|
                                                            <div id='calendar' class="rght_calndr"></div>
 | 
						|
                                                        </div>
 | 
						|
                                                        <div class="col-md-1">
 | 
						|
                                                            <div class="align-items-center">
 | 
						|
                                                                <!--- second modal ---->
 | 
						|
                                                                <a href="#" class="modal2 tooltip" data-toggle="modal" data-target="#exampleModal3">
 | 
						|
                                                                    <span class="tooltiptext">Upcoming Schedule</span>
 | 
						|
                                                                    <i class="la la-calendar-o"></i>
 | 
						|
                                                                </a><br>
 | 
						|
                                                                <div class="modal fade" id="exampleModal3" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
 | 
						|
                                                                    <div class="modal-dialog modal-dialog2 modal-dialog-centered" role="document">
 | 
						|
                                                                        <div class="modal-content">
 | 
						|
                                                                        <div class="modal-header">
 | 
						|
                                                                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
 | 
						|
                                                                            <span aria-hidden="true"><i class="la la-angle-right"></i></span>
 | 
						|
                                                                        </button>
 | 
						|
                                                                        <h5 class="modal-title" id="exampleModalLabel">Upcoming Schedule</h5>
 | 
						|
                                                                        </div>
 | 
						|
                                                                        <div class="modal-body">
 | 
						|
                                                                        <div id="patient-Schedule">
 | 
						|
                                                                        <table class="table table-striped table-bordered dom-jQuery-events"  id="upcoming_schedule" cellspacing="0" width="100%">
 | 
						|
                                                                            
 | 
						|
                                                                        </table>
 | 
						|
                                                                    </div>
 | 
						|
                                                                        </div>
 | 
						|
                                                                        </div>
 | 
						|
                                                                    </div>
 | 
						|
                                                                </div>
 | 
						|
 | 
						|
                                                                <!--- third modal ---->
 | 
						|
                                                                <a href="#" class="modal3 tooltip" data-toggle="modal" data-target="#exampleModal4">
 | 
						|
                                                                    <span class="tooltiptext">PREVIOUS SCHEDULE</span>
 | 
						|
                                                                    <i class="la la-calendar-o"></i><br>
 | 
						|
                                                                </a>
 | 
						|
                                                                <div class="modal fade" id="exampleModal4" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
 | 
						|
                                                                    <div class="modal-dialog modal-dialog2 modal-dialog-centered" role="document">
 | 
						|
                                                                        <div class="modal-content">
 | 
						|
                                                                            <div class="modal-header">
 | 
						|
                                                                                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
 | 
						|
                                                                                    <span aria-hidden="true"><i class="la la-angle-right"></i></span>
 | 
						|
                                                                                </button>
 | 
						|
                                                                                <h5 class="modal-title" id="exampleModalLabel">Previous Schedule</h5>
 | 
						|
                                                                            </div>
 | 
						|
                                                                            <div class="modal-body">
 | 
						|
                                                                                <div id="Caregiver-Schedule2">
 | 
						|
                                                                                    <table class="table table-striped table-bordered dom-jQuery-events"  id="previous_schedule" cellspacing="0" width="100%">
 | 
						|
                                                                                        
 | 
						|
                                                                                    </table>
 | 
						|
                                                                                </div>
 | 
						|
                                                                            </div>
 | 
						|
                                                                        </div>
 | 
						|
                                                                    </div>
 | 
						|
                                                                </div>
 | 
						|
                                                            </div>
 | 
						|
                                                        </div>
 | 
						|
                                                    </div>  
 | 
						|
                                                </div>
 | 
						|
                                            </div>
 | 
						|
                                        </div>
 | 
						|
                                    </div>
 | 
						|
                                </div>
 | 
						|
                            </div>
 | 
						|
                        </div>
 | 
						|
                    </div>
 | 
						|
                </div>
 | 
						|
            </div>
 | 
						|
        </section>
 | 
						|
    </div>
 | 
						|
    <div id="modal_container"></div>
 | 
						|
    
 | 
						|
    <input type="hidden" id="caregiver_name">
 | 
						|
    <!-- Add Event Modal -->
 | 
						|
    <div class="modal fade" id="addEvent" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
 | 
						|
      <div class="modal-dialog modal-lg modal-dialog-centered" role="document">
 | 
						|
        <div class="modal-content">
 | 
						|
            <form action="<?php echo base_url(); ?>PatientSchedule/saveSchedule" use="saveScheduleData" method="post">
 | 
						|
                <input type="hidden" name="caregiver_id" id="caregiver_id" value="">
 | 
						|
                <input type="hidden" name="patient_id" id="patient_id" value="<?php echo $patient['patient_table_id']; ?>">
 | 
						|
                <input type="hidden" name="title" value="<?php echo $patient['patient_fullname']; ?>">
 | 
						|
                <input type="hidden" name="<?php echo $this->security->get_csrf_token_name(); ?>" value="<?php echo $this->security->get_csrf_hash(); ?>" />
 | 
						|
                <div class="modal-header">
 | 
						|
                    <h5 class="modal-title" id="exampleModalLongTitle">Add Schedule</h5>
 | 
						|
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
 | 
						|
                      <span aria-hidden="true">×</span>
 | 
						|
                    </button>
 | 
						|
                </div>
 | 
						|
                <div class="modal-body">
 | 
						|
                    <div class="row">
 | 
						|
                        <div class="col-12">
 | 
						|
                            <div class="row">
 | 
						|
                            <div class="form-group col-6">
 | 
						|
                                <label for="exampleInputEmail1" class="required-field"><?php echo lang('Caregiver Name'); ?></label>
 | 
						|
                                <input type="text" class="form-control" id="caregiver_fullName" value='' readonly>
 | 
						|
                            </div>
 | 
						|
                            <div class="form-group col-6">
 | 
						|
                                <label for="exampleInputEmail1" class="required-field"><?php echo lang('Date'); ?></label>
 | 
						|
                                <input type="date" name="Sdate" id="Sdate" class="form-control" readonly>
 | 
						|
                            </div>
 | 
						|
                            </div>
 | 
						|
                            <div class="row">
 | 
						|
                            <div class="form-group col-6">
 | 
						|
                                <label for="exampleInputEmail1" class="required-field"><?php echo lang('From'); ?></label>
 | 
						|
                                <input type="time" name="startTime" id="startTime" class="form-control">
 | 
						|
                                <div class="error alert alert-light text-danger" id="startError" style="display:none;"></div> 
 | 
						|
                            </div>
 | 
						|
                            <div class="form-group col-6">
 | 
						|
                                <label for="exampleInputEmail1" class="required-field"><?php echo lang('To'); ?></label>
 | 
						|
                                <input type="time" name="endTime" id="endTime" class="form-control">
 | 
						|
                                <div class="error alert alert-light text-danger" id="endError" style="display:none;"></div> 
 | 
						|
                            </div>
 | 
						|
                            </div>
 | 
						|
                            <div class="row" id="OldScheduleInfo">
 | 
						|
                                
 | 
						|
                            </div>
 | 
						|
                            <div class="row error" id="saveError"></div>
 | 
						|
                        </div>    
 | 
						|
                    </div>    
 | 
						|
                </div>
 | 
						|
                <div class="modal-footer">
 | 
						|
                    <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
 | 
						|
                    <!-- <button type="button" class="btn btn-primary">Check Available</button> -->
 | 
						|
                    <button type="submit" id="SubmitsaveEvent" class="btn btn-primary" onclick="return check_conflict();">Save</button>
 | 
						|
                </div>
 | 
						|
            </form>
 | 
						|
        </div>
 | 
						|
      </div>
 | 
						|
    </div>
 | 
						|
<!--main content end-->
 | 
						|
<!--footer start-->
 | 
						|
 | 
						|
<script>
 | 
						|
    
 | 
						|
    $(document).ready(function () {
 | 
						|
        $('#editable-sample').DataTable();
 | 
						|
    });
 | 
						|
    $(document).on("click","input[type='radio']", function(){             
 | 
						|
        //alert(this.value);
 | 
						|
        //console.log(this);
 | 
						|
        $.ajax({
 | 
						|
            url:"<?php echo base_url(); ?>PatientSchedule/getEventDetailsById",
 | 
						|
            type:"GET",
 | 
						|
            data:{id:this.value},
 | 
						|
            dataType:"JSON",
 | 
						|
            success:function(data){
 | 
						|
                //console.log(data);
 | 
						|
                var start=data.start;
 | 
						|
                var stime=start.split(" ");
 | 
						|
                var end=data.end;
 | 
						|
                var etime=end.split(" ");
 | 
						|
                $("#startTime").val(stime[1]);
 | 
						|
                $("#endTime").val(etime[1]);
 | 
						|
                //console.log(stime[1],etime[1]);
 | 
						|
 | 
						|
            }
 | 
						|
        });
 | 
						|
        $("#startTime").attr('ReadOnly','true');
 | 
						|
        $("#endTime").attr('ReadOnly','true');
 | 
						|
    });
 | 
						|
    function check_conflict(){
 | 
						|
        var startTime=$("#startTime").val();
 | 
						|
        var endTime=$("#endTime").val();
 | 
						|
        var caregiver_id=$("#caregiver_id").val();
 | 
						|
        var patient_id=$("#patient_id").val();
 | 
						|
        var scheduleDate=$("#Sdate").val();
 | 
						|
 | 
						|
        $(".error").html('');
 | 
						|
        $("#startError").hide();
 | 
						|
        $("#endError").hide();
 | 
						|
        if(startTime==""){
 | 
						|
            $("#startError").html('Please Enter From Time.').show();
 | 
						|
            return false;
 | 
						|
        }else
 | 
						|
        if(endTime==""){
 | 
						|
            $("#endError").html('Please Enter To Time.').show();
 | 
						|
            return false;
 | 
						|
        }else
 | 
						|
        if(startTime>=endTime){
 | 
						|
            $("#saveError").append('<div class="alert alert-light text-danger col-12">To Time Must be Greater Then From Time.</div>');
 | 
						|
            return false;
 | 
						|
        }else{
 | 
						|
            //alert('check');
 | 
						|
            $.ajax({
 | 
						|
                url:"<?php echo base_url(); ?>caregivers/CheckAvailability",
 | 
						|
                type:"GET",
 | 
						|
                data:{caregiver_id:caregiver_id,scheduleDate:scheduleDate,startTime:startTime,endTime:endTime},
 | 
						|
                success:function(data){
 | 
						|
                   // console.log(data);
 | 
						|
                    if(data==""){
 | 
						|
                        $("#saveError").append('<div class="alert alert-light text-danger col-12">Caregiver Not Available.</div>');
 | 
						|
                        return false;
 | 
						|
                    }else{
 | 
						|
                        // var switchwith="";
 | 
						|
                        // switchwith=$("input[type='radio'][name='switch_with']:checked").val();
 | 
						|
                        // alert(switchwith);
 | 
						|
                        //if(switchwith=="" || switchwith=="undefined"){
 | 
						|
                            $.get('<?php echo base_url(); ?>PatientSchedule/CheckSchedule',
 | 
						|
                                { caregiver_id:caregiver_id, patient_id:patient_id, scheduleDate:scheduleDate, startTime:startTime, endTime:endTime },
 | 
						|
                                function(data){
 | 
						|
                                    //console.log(data);
 | 
						|
                                    if(data!=""){
 | 
						|
                                        $("#saveError").append('<div class="alert alert-light text-danger col-12">'+data+'</div>');
 | 
						|
                                        return false;
 | 
						|
                                    }else{
 | 
						|
                                        $(".error").html('');
 | 
						|
                                        //alert('1');
 | 
						|
                                        $("form[use=saveScheduleData]").submit();
 | 
						|
                                        return true;
 | 
						|
                                    }
 | 
						|
                                    
 | 
						|
                                }
 | 
						|
                            );
 | 
						|
                        // }else{
 | 
						|
                        //     $(".error").html('');
 | 
						|
                        //     alert('2');
 | 
						|
                        //     //$("form[use=saveScheduleData]").submit();
 | 
						|
                        // }
 | 
						|
                    }
 | 
						|
                }
 | 
						|
            });
 | 
						|
            return false;
 | 
						|
        }
 | 
						|
        
 | 
						|
        return false;
 | 
						|
    }
 | 
						|
    function loadModal(caregiverId,CaregiverName,scheduleDate){
 | 
						|
            var patient_id=$("#patient_id").val();
 | 
						|
            $.get('<?php echo base_url(); ?>PatientSchedule/PreviousSchedule',
 | 
						|
                    {patientId:patient_id,caregiverId:caregiverId,scheduleDate:scheduleDate},
 | 
						|
                    function(data){
 | 
						|
                        //console.log(data);
 | 
						|
                        $('#OldScheduleInfo').html(data);
 | 
						|
                    }
 | 
						|
                );
 | 
						|
            var CaregiverName=$("#caregiver_name").val();
 | 
						|
            $(".Error").html('');
 | 
						|
            $('#caregiver_fullName').val(CaregiverName);
 | 
						|
            $('#Sdate').val(scheduleDate);
 | 
						|
            $('#caregiver_id').val(caregiverId);
 | 
						|
            $('#startTime').val('');
 | 
						|
            $('#startTime').removeAttr("readonly");
 | 
						|
            $('#endTime').val('');
 | 
						|
            $('#endTime').removeAttr("readonly");
 | 
						|
            //$.noConflict();
 | 
						|
            $("#addEvent").modal('show');
 | 
						|
        }
 | 
						|
    
 | 
						|
    function deleteSchedule(schedule_id,patientId,caregiverId){
 | 
						|
        $.post('<?php echo base_url(); ?>caregivers/caregiverEventDelete/',
 | 
						|
                {
 | 
						|
                    id: schedule_id,
 | 
						|
                    '<?php echo $this->security->get_csrf_token_name(); ?>' : '<?php echo $this->security->get_csrf_hash(); ?>'
 | 
						|
                },
 | 
						|
                function(data, status){
 | 
						|
                    if(status=='success'){
 | 
						|
                        Swal.fire({
 | 
						|
                          position: 'center',
 | 
						|
                          icon: 'success',
 | 
						|
                          title: 'Schedule deleted.',
 | 
						|
                          showConfirmButton: false,
 | 
						|
                          timer: 3500
 | 
						|
                        });
 | 
						|
                        var CaregiverName=$("#caregiver_name").val();
 | 
						|
                        load_calendar(patientId,caregiverId,CaregiverName)
 | 
						|
                        //$("#calendar").fullCalendar('refetchEvents');
 | 
						|
                    }
 | 
						|
                }
 | 
						|
            );
 | 
						|
    }
 | 
						|
    function updateSchedule(schedule_id,start,end){
 | 
						|
        $.post('<?php echo base_url(); ?>caregivers/caregiverEventUpdate/',
 | 
						|
                {
 | 
						|
                    event_id: schedule_id,
 | 
						|
                    start: start,
 | 
						|
                    end: end,
 | 
						|
                },
 | 
						|
                function(data, status){
 | 
						|
                    console.log(data);
 | 
						|
                    console.log(status);
 | 
						|
                    if(status=='success'){
 | 
						|
                        Swal.fire({
 | 
						|
                          position: 'center',
 | 
						|
                          icon: 'success',
 | 
						|
                          title: 'Schedule Updated.',
 | 
						|
                          showConfirmButton: false,
 | 
						|
                          timer: 3500
 | 
						|
                        });
 | 
						|
                    }
 | 
						|
                }
 | 
						|
            );
 | 
						|
    }
 | 
						|
    
 | 
						|
 | 
						|
    var __SCHEDULE_DATA__ = new Array();
 | 
						|
 | 
						|
    function load_calendar(patientId,caregiverId,CaregiverName){
 | 
						|
        // alert(patientId);
 | 
						|
        // alert(caregiverId);
 | 
						|
        // alert(CaregiverName);
 | 
						|
        //$("#caregiver_name").val(CaregiverName);
 | 
						|
        var today=new Date();
 | 
						|
        $(".right_cal_zone").empty();
 | 
						|
        $(".right_cal_zone").append('<div id="calendar" class="rght_calndr"></div>');
 | 
						|
        //var start=
 | 
						|
        var calendar1=$('#calendar-view').fullCalendar({
 | 
						|
            defaultView:"month",
 | 
						|
            allDaySlot: false,
 | 
						|
            editable: false,
 | 
						|
            selectable: true,
 | 
						|
            droppable: false, 
 | 
						|
            defaultDate: today,
 | 
						|
            dayNamesShort: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
 | 
						|
            select: function(info,start) {
 | 
						|
                var today=info.format('YYYY-MM-DD');
 | 
						|
                $("#calendar").fullCalendar('changeView', 'agendaWeek')
 | 
						|
                $("#calendar").fullCalendar('gotoDate', today);
 | 
						|
            }
 | 
						|
        });
 | 
						|
        $.get('<?php echo base_url(); ?>PatientSchedule/getEventDetails',{patientId : patientId, caregiverId: caregiverId},
 | 
						|
                function(data){
 | 
						|
                    __SCHEDULE_DATA__ = JSON.parse(data);
 | 
						|
                    //console.log(JSON.parse(__SCHEDULE_DATA__));
 | 
						|
                    var calendar=$('#calendar').fullCalendar({
 | 
						|
                            defaultView:"agendaWeek",
 | 
						|
                            defaultDate: today,
 | 
						|
                            selectable: true,
 | 
						|
                            selectHelper: true,
 | 
						|
                            editable: false,
 | 
						|
                            allDaySlot: false, 
 | 
						|
                            columnHeaderFormat: 'D - ddd',
 | 
						|
                            events: __SCHEDULE_DATA__,
 | 
						|
                            select: function(info,start,event) {
 | 
						|
                               //console.log(event);
 | 
						|
                               
 | 
						|
                                var scheduleDate=info.format('YYYY-MM-DD');
 | 
						|
                                    if(start.isBefore(moment())) {
 | 
						|
                                        $('#calendar').fullCalendar('unselect');
 | 
						|
                                        //console.log('Previous date');
 | 
						|
                                        return false;
 | 
						|
                                    }else{
 | 
						|
                                        if(info){
 | 
						|
                                          loadModal(caregiverId,CaregiverName,scheduleDate);
 | 
						|
                                        }else{
 | 
						|
                                          //loadModal(caregiverId,CaregiverName);  
 | 
						|
                                        }
 | 
						|
                                    }
 | 
						|
                                },
 | 
						|
                            eventClick: function(event) {
 | 
						|
                                //console.log(event);
 | 
						|
                               if(confirm("Are you sure you want to delete schedule?")){
 | 
						|
                                   deleteSchedule(event.id,event.patientId,event.caregiverId);
 | 
						|
                                }
 | 
						|
 | 
						|
                            },
 | 
						|
                            eventDrop: function (info,event) {
 | 
						|
                                if(info.start.isBefore(moment())) {
 | 
						|
                                    console.log('Previous date');
 | 
						|
                                    return false;
 | 
						|
                                }else{
 | 
						|
                                    updateSchedule(info.id,info.start.format(),info.end.format());
 | 
						|
                                }
 | 
						|
                            },
 | 
						|
 | 
						|
                    });
 | 
						|
                }
 | 
						|
            );
 | 
						|
        //$('#calendar').fullCalendar( 'refetchEvents' );        
 | 
						|
    }
 | 
						|
    
 | 
						|
</script>
 | 
						|
<script>
 | 
						|
    function ShowCaregiverModal(caregiverId){
 | 
						|
        $.ajax({
 | 
						|
            url:"<?php echo base_url(); ?>home/getCaregiverInfo",
 | 
						|
            type:"GET",
 | 
						|
            data:{caregiver_id:caregiverId},
 | 
						|
            dataType:"html",
 | 
						|
            success:function(caregiverData){
 | 
						|
                //console.log(caregiverData);
 | 
						|
                $.noConflict();
 | 
						|
                $("#modal_container").html(caregiverData);
 | 
						|
                $("#CaregiverInfo").modal('show');
 | 
						|
            },
 | 
						|
            error : function(err){
 | 
						|
                    alert("error");
 | 
						|
                }
 | 
						|
        });
 | 
						|
    }
 | 
						|
</script>
 | 
						|
<?php if($this->session->flashdata('feedback_success')){ ?>
 | 
						|
    <script>
 | 
						|
    Swal.fire({
 | 
						|
              position: 'center',
 | 
						|
              icon: 'success',
 | 
						|
              title: '<?php echo $this->session->flashdata('feedback_success'); ?>',
 | 
						|
              showConfirmButton: false,
 | 
						|
              timer: 3500
 | 
						|
            })
 | 
						|
    </script>
 | 
						|
<?php } ?>
 | 
						|
<script>
 | 
						|
$(document).ready(function () {
 | 
						|
        //alert('1');
 | 
						|
        //$("#hambargar-menu").hide();
 | 
						|
        
 | 
						|
        //var caregiverId=<?php echo $caregiver->id; ?>;
 | 
						|
        
 | 
						|
        
 | 
						|
    });
 | 
						|
</script>
 | 
						|
<script>
 | 
						|
$(document).ready(function () {
 | 
						|
 | 
						|
    $(document).on("click","#btn_proces", function(){ 
 | 
						|
        console.log(this);
 | 
						|
    // alert("exampleModal");
 | 
						|
        $("#nav-profile-tab").attr('pointer-events','block');
 | 
						|
        $("#cursor").attr('cursor','pointer');
 | 
						|
        $("#nav-home").hide();
 | 
						|
        $("#nav-profile").show();
 | 
						|
    });
 | 
						|
 | 
						|
    $(document).on("click","#nav-home-tab", function(){ 
 | 
						|
    // alert("exampleModal");
 | 
						|
        $("#nav-profile-tab").attr('pointer-events','block');
 | 
						|
        $("#cursor").attr('cursor','pointer');
 | 
						|
        $("#nav-home").show();
 | 
						|
        $("#nav-profile").hide();
 | 
						|
    });
 | 
						|
 | 
						|
});
 | 
						|
</script>
 | 
						|
<script>
 | 
						|
    $('.btn').click(function() {
 | 
						|
    $('.modal')
 | 
						|
        .prop('class', 'modal fade') // revert to default
 | 
						|
        .addClass( $(.bottom-right).data('direction') );
 | 
						|
    $('.modal').modal('show');
 | 
						|
    });
 | 
						|
</script>
 | 
						|
<script>
 | 
						|
    $(".matchPatintcaregiver").submit(function(e){
 | 
						|
        e.preventDefault();
 | 
						|
        var caregiverId = $(this).attr('cid');
 | 
						|
        var patientId = $("#patient_id").val();
 | 
						|
        
 | 
						|
        $.get('<?php echo base_url(); ?>PatientSchedule/getCaregiverName',
 | 
						|
                    {caregiverId:caregiverId},
 | 
						|
                    function(data){
 | 
						|
                        //console.log(data);
 | 
						|
                        caregiver_name=data;
 | 
						|
                        $('#selected_caregiver_name').html('Caregiver Name : '+data);
 | 
						|
                        $("#caregiver_name").val(data);
 | 
						|
                    }
 | 
						|
                );
 | 
						|
        var caregiver_name="ABC";
 | 
						|
        load_calendar(patientId,caregiverId,caregiver_name);
 | 
						|
        
 | 
						|
        $.get('<?php echo base_url(); ?>PatientSchedule/getCaregiverPreviousSchedule',
 | 
						|
                    {caregiverId:caregiverId},
 | 
						|
                    function(data){
 | 
						|
                        //console.log(data);
 | 
						|
                        $("#previous_schedule").html(data)
 | 
						|
                    }
 | 
						|
                );
 | 
						|
        $.get('<?php echo base_url(); ?>PatientSchedule/getCaregiverUpcomingSchedule',
 | 
						|
                    {caregiverId:caregiverId},
 | 
						|
                    function(data){
 | 
						|
                        //console.log(data);
 | 
						|
                        $("#upcoming_schedule").html(data)
 | 
						|
                    }
 | 
						|
                );
 | 
						|
        //alert(patientId);
 | 
						|
        $('.modal').modal('hide');
 | 
						|
        $("#nav-home").hide();
 | 
						|
        $("#nav-profile").show();
 | 
						|
    });
 | 
						|
</script>
 | 
						|
<script>
 | 
						|
$("document").ready(function(){
 | 
						|
    // setTimeout(
 | 
						|
    //   function() 
 | 
						|
    //   {
 | 
						|
    //     $("#hambargar-menu").trigger("click");
 | 
						|
    //   }, 500);
 | 
						|
});
 | 
						|
</script>
 | 
						|
 | 
						|
 | 
						|
 |