<?php session_start(); ob_start(); ?>

<?php  include 'header.php'; ?>

<?php
ini_set('display_errors', 0);
if(empty($_SESSION['LOGINID']) && empty($_SESSION['LOGINNM']) ){

	header("Location:index.php");
}

date_default_timezone_set('Asia/Dhaka');
                    $date_c = date('Y-m-d H:i:s', time());
									
include("user.php");
$t_type=$_GET['type'];
$search_t=$_GET['search_t'];

$filter_value_all="checked";


$prmaxSQL = mysqli_query($connection, "SELECT max(t1.date) pr_max_date FROM `events` as t1 left join bookings as t2 on t1.temp_id=t2.id WHERE t1.pr='checked' AND t2.booking_id!=0 LIMIT 1");
$prmaxSQL = mysqli_fetch_object($prmaxSQL);
$max_date= $prmaxSQL->pr_max_date;


if($_SESSION['DATE1']==""){
	
	$dayBookDate1=date('Y-m-d');
    $dayBookDate2=$max_date;	
	$_SESSION['DATE1']=$dayBookDate1;
    $_SESSION['DATE2']=$dayBookDate2;
	}






	
if (isset($_POST['day_submit'])) {
	$dayBookDate1=$_POST['date1'];
	$dayBookDate2=$_POST['date2'];
	$_SESSION['DATE1']=$dayBookDate1;
    $_SESSION['DATE2']=$dayBookDate2;
	$sub=2;
	$filter=$_POST['filter'];
}

$dayBookDate1=$_SESSION['DATE1'];
$dayBookDate2=$_SESSION['DATE2'];

$sqlSelectedLG = "select * from (select * from (SELECT v1.* , GROUP_CONCAT(v2.name ORDER BY v2.id) as vd_names FROM (SELECT p1.* , GROUP_CONCAT(p2.name ORDER BY p2.id) as ph_names FROM (select a1.* , a2.name as event_type from (SELECT t1.*, t2.name as client_name, t2.booking_id,t2.booking_name, t2.cell_1,t2.cell_2 FROM `events` as t1 left join bookings as t2 on t1.temp_id=t2.id order by t1.date) as a1 left join event_types as a2 on a1.type=a2.id) as p1 left join artists as p2 ON FIND_IN_SET(p2.id, p1.photographers) group by p1.id) as v1 left join artists as v2 ON FIND_IN_SET(v2.id, v1.videographers) group by v1.id ORDER BY TIMESTAMP(v1.date,v1.time) ) as evtbl where booking_id!=0 AND (date BETWEEN '$dayBookDate1' AND '$dayBookDate2' )) as kl where kl.pr='checked' ";

						if($sub=="2") 
								{
									
									if($filter=="all") {
									
									$sqlSelectedLG = "select * from (  select * from (SELECT v1.* , GROUP_CONCAT(v2.name ORDER BY v2.id) as vd_names FROM (SELECT p1.* , GROUP_CONCAT(p2.name ORDER BY p2.id) as ph_names FROM (select a1.* , a2.name as event_type from (SELECT t1.*, t2.name as client_name, t2.booking_id,t2.booking_name, t2.cell_1,t2.cell_2 FROM `events` as t1 left join bookings as t2 on t1.temp_id=t2.id order by t1.date) as a1 left join event_types as a2 on a1.type=a2.id) as p1 left join artists as p2 ON FIND_IN_SET(p2.id, p1.photographers) group by p1.id) as v1 left join artists as v2 ON FIND_IN_SET(v2.id, v1.videographers) group by v1.id ORDER BY TIMESTAMP(v1.date,v1.time) ) as evtbl where booking_id!=0 AND (date BETWEEN '$dayBookDate1' AND '$dayBookDate2' ) ) as kl where kl.pr='checked'";
							}
							
							if($filter=="done") {
								$filter_value_all="";
								$filter_value_done="checked";
								$sqlSelectedLG = "select l1.* from (select h1.*,IFNULL(h2.status,0) meeting_sts,IFNULL(h2.date,0) meeting_date from (select * from (select * from (SELECT v1.* , GROUP_CONCAT(v2.name ORDER BY v2.id) as vd_names FROM (SELECT p1.* , GROUP_CONCAT(p2.name ORDER BY p2.id) as ph_names FROM (select a1.* , a2.name as event_type from (SELECT t1.*, t2.name as client_name, t2.booking_id,t2.booking_name, t2.cell_1,t2.cell_2 FROM `events` as t1 left join bookings as t2 on t1.temp_id=t2.id order by t1.date) as a1 left join event_types as a2 on a1.type=a2.id) as p1 left join artists as p2 ON FIND_IN_SET(p2.id, p1.photographers) group by p1.id) as v1 left join artists as v2 ON FIND_IN_SET(v2.id, v1.videographers) group by v1.id ORDER BY TIMESTAMP(v1.date,v1.time) ) as evtbl where booking_id!=0 AND (date BETWEEN '$dayBookDate1' AND '$dayBookDate2' )) as kl where kl.pr='checked') as h1 left join (SELECT * FROM `pr_meetings`) as h2 on h1.temp_id=h2.temp_id) as l1 where l1.meeting_sts='checked'";
								
							}
							
							
							if($filter=="not_fixed") {
								$filter_value_all="";
								$filter_value_notfixed="checked";
								$sqlSelectedLG = "select l1.* from (select h1.*,IFNULL(h2.status,0) meeting_sts,IFNULL(h2.date,0) meeting_date from (select * from (select * from (SELECT v1.* , GROUP_CONCAT(v2.name ORDER BY v2.id) as vd_names FROM (SELECT p1.* , GROUP_CONCAT(p2.name ORDER BY p2.id) as ph_names FROM (select a1.* , a2.name as event_type from (SELECT t1.*, t2.name as client_name, t2.booking_id,t2.booking_name, t2.cell_1,t2.cell_2 FROM `events` as t1 left join bookings as t2 on t1.temp_id=t2.id order by t1.date) as a1 left join event_types as a2 on a1.type=a2.id) as p1 left join artists as p2 ON FIND_IN_SET(p2.id, p1.photographers) group by p1.id) as v1 left join artists as v2 ON FIND_IN_SET(v2.id, v1.videographers) group by v1.id ORDER BY TIMESTAMP(v1.date,v1.time) ) as evtbl where booking_id!=0 AND (date BETWEEN '$dayBookDate1' AND '$dayBookDate2' )) as kl where kl.pr='checked') as h1 left join (SELECT * FROM `pr_meetings`) as h2 on h1.temp_id=h2.temp_id) as l1 where l1.meeting_sts='0' AND l1.meeting_date='0'";
								
							}
							
							if($filter=="pending") {
								$filter_value_all="";
								$filter_value_pending="checked";
								$sqlSelectedLG = "select l1.* from (select h1.*,(case when h2.status is NULL then 0 when h2.status = '' then 0 else h2.status end) meeting_sts,IFNULL(h2.date,0) meeting_date from (select * from (select * from (SELECT v1.* , GROUP_CONCAT(v2.name ORDER BY v2.id) as vd_names FROM (SELECT p1.* , GROUP_CONCAT(p2.name ORDER BY p2.id) as ph_names FROM (select a1.* , a2.name as event_type from (SELECT t1.*, t2.name as client_name, t2.booking_id,t2.booking_name, t2.cell_1,t2.cell_2 FROM `events` as t1 left join bookings as t2 on t1.temp_id=t2.id order by t1.date) as a1 left join event_types as a2 on a1.type=a2.id) as p1 left join artists as p2 ON FIND_IN_SET(p2.id, p1.photographers) group by p1.id) as v1 left join artists as v2 ON FIND_IN_SET(v2.id, v1.videographers) group by v1.id ORDER BY TIMESTAMP(v1.date,v1.time) ) as evtbl where booking_id!=0 AND (date BETWEEN '$dayBookDate1' AND '$dayBookDate2' )) as kl where kl.pr='checked') as h1 left join (SELECT * FROM `pr_meetings`) as h2 on h1.temp_id=h2.temp_id) as l1 where l1.meeting_sts='0' AND l1.meeting_date!='0'";
								
							}
							
							
							}
							
							
?>

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Events</title>
    <!-- ================= Favicon ================== -->
    <!-- Standard -->
    <link rel="shortcut icon" href="http://placehold.it/64.png/000/fff">
    <!-- Retina iPad Touch Icon-->
    <link rel="apple-touch-icon" sizes="144x144" href="http://placehold.it/144.png/000/fff">
    <!-- Retina iPhone Touch Icon-->
    <link rel="apple-touch-icon" sizes="114x114" href="http://placehold.it/114.png/000/fff">
    <!-- Standard iPad Touch Icon-->
    <link rel="apple-touch-icon" sizes="72x72" href="http://placehold.it/72.png/000/fff">
    <!-- Standard iPhone Touch Icon-->
    <link rel="apple-touch-icon" sizes="57x57" href="http://placehold.it/57.png/000/fff">
    <!-- Styles -->
     <link href="assets/css/lib/data-table/buttons.bootstrap.min.css" rel="stylesheet" />
    <link href="assets/css/lib/font-awesome.min.css" rel="stylesheet">
    <link href="assets/css/lib/themify-icons.css" rel="stylesheet">
    <link href="assets/css/lib/owl.carousel.min.css" rel="stylesheet" />
    <link href="assets/css/lib/owl.theme.default.min.css" rel="stylesheet" />
    <link href="assets/css/lib/weather-icons.css" rel="stylesheet" />
    <link href="assets/css/lib/menubar/sidebar.css" rel="stylesheet">
    <link href="assets/css/lib/bootstrap.min.css" rel="stylesheet">
    <link href="assets/css/lib/unix.css" rel="stylesheet">
    <link href="assets/css/style.css" rel="stylesheet">
	   <link href="assets/css/lib/select2/select2.min.css" rel="stylesheet">
</head>

<body>

    
	
	  <?php include("sidebar.php"); ?>
	
	
    <!-- /# sidebar -->
     <?php include("top.php"); ?>
	<!-- /# topebar --> 
	
	
    <div class="content-wrap">
        <div class="main">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-lg-8 p-r-0 title-margin-right">
                        <div class="page-header">
                            <div class="page-title">
                                <h1>Hello, <span>Welcome Here</span></h1>
                            </div>
                        </div>
                    </div>
                    <!-- /# column -->
                    <div class="col-lg-4 p-l-0 title-margin-left">
                        <div class="page-header">
                            <div class="page-title">
                                <ol class="breadcrumb text-right">
                                    <li><a href="#">Dashboard</a></li>
                                    <li class="active">Home</li>
                                </ol>
                            </div>
                        </div>
                    </div>
                    <!-- /# column -->
                </div>
                <!-- /# row -->
				
					<?php if ($user_type==1){ ?>
                <section id="main-content">
				
				
			
				
				
				
				
				
				<div class="row">
				
				        <div class="col-lg-12">
						
						<div class="panel panel-info m-t-15">
                                            <div class="panel-heading">PR Event List</div>
                                            <div class="panel-body">
						
                           <?php
								  if (isset($_POST['submit_del'])) {
								  
									  $edit_id = $_POST["ev_id"];
									  
$sqlUpdate = "INSERT INTO events_deleted
  SELECT * FROM events where id = '$edit_id'	           
";
$sqlUpdate = mysqli_query($connection, $sqlUpdate); 									  
									  
									  
$sqlUpdate = "DELETE FROM `events` WHERE `events`.`id` = '$edit_id'	   ";
$sqlUpdate = mysqli_query($connection, $sqlUpdate); 


$sqlUpdate = "DELETE FROM `photo_edit` WHERE `photo_edit`.`event_id` = '$edit_id'	   ";
$sqlUpdate = mysqli_query($connection, $sqlUpdate); 
$sqlUpdate = "DELETE FROM `vd_edit` WHERE `vd_edit`.`event_id` = '$edit_id'	   ";
$sqlUpdate = mysqli_query($connection, $sqlUpdate); 




											 
 echo "<div>
 </br>
 </div>";
 include_once('updated.html');
									  
								  }
								  if (isset($_POST['submit'])) {
									  
									  $edit_id = $_POST["ev_id"];
									  $edit_ev_notes = $_POST["ev_notes"];
									  $new_asst = $_POST["asst"];
									  $new_photographers = $_POST['ph_ids'];
									  $new_photographers=array_unique($new_photographers);
									  
									$new_photographers = implode(',', $new_photographers);
									
									$first_comma= $new_photographers[0];
									if($first_comma==","){
										$new_photographers = substr($new_photographers, 1);
									}
									$last_comma= $new_photographers[-1];
									if($last_comma==","){
										$new_photographers = substr_replace($new_photographers ,"",-1);
									}
									
									
									
									$new_videographers = $_POST['vd_ids'];
									$new_videographers=array_unique($new_videographers);
									$new_videographers = implode(',', $new_videographers);
									
									$first_commav= $new_videographers[0];
									if($first_commav==","){
										$new_videographers = substr($new_videographers, 1);
									}
									$last_commav= $new_videographers[-1];
									if($last_commav==","){ 
									  $new_videographers = substr_replace($new_videographers ,"",-1);
									}
									
									
									
									$sqlUpdate = "UPDATE events SET
 photographers = '$new_photographers',
 videographers = '$new_videographers',
 ev_notes = '$edit_ev_notes',
  asst = '$new_asst',
 updated_at = '$date_c'
												  											  
 WHERE
 id = '$edit_id'           
";
$sqlUpdate = mysqli_query($connection, $sqlUpdate); 


$sqlUpdate = "INSERT INTO `activity_log` (`id`, `user`, `activity`, `time`) VALUES (NULL, '$ad_id', 'updated event $edit_id from event list page', '$date_c')";
$sqlUpdate = mysqli_query($connection, $sqlUpdate); 
											 
 echo "<div>
 </br>
 </div>";
 include_once('updated.html');
 

 
								  }
								  
								  ?>

								  
								  
								  	<div class="row-form clearfix">
					       <form action='pr_events.php'  method='POST'> 

						   
						   
						   
                           <div class="col-sm-10"> 
						   
							<table>
							<tr>
							<td>
							From <input class="date" type="date" value="<?php echo $dayBookDate1; ?>" name="date1" id="datetimepicker2"/>
							</td>
							<td>
							To <input class="date" type="date"  value="<?php echo $dayBookDate2; ?>" name="date2" id="datetimepicker2"/>
							</td>
							
					<td>&nbsp; &nbsp; All <input  type="radio"  <?php echo $filter_value_all; ?> value="all" name="filter" /> </td>
							<td> | Meeting Done <input  type="radio" <?php echo $filter_value_done; ?> value="done" name="filter" /> </td>
							<td> | Meeting Pending <input  type="radio"  <?php echo $filter_value_pending; ?> value="pending" name="filter" /> </td>
							<td> | Neet to Fix Meeting <input type="radio"  <?php echo $filter_value_notfixed; ?> value="not_fixed" name="filter" /> &nbsp; &nbsp;
							</td>
							
							<td>
							&nbsp; &nbsp; <input class="submit" type="submit"  name="day_submit"  value="Search" /> 
							</td>
							</tr>
							</table>
						    
						   </div>
						     
                           
							
							
							
							 <div class="col-sm-2">  <div class="span3"> <a href="pr_events.php"> <span class="badge badge-danger">Reload</span></a>  <a href="pr_events.php?type=export"> <span class="badge badge-primary">exportable</span>  </a>   
							 </div>  </div>
							 
							 
						</form>	
                     </div> 
								  
								  
								  
								  
								  
								  
								  
								  
								  
								  
								  
								  
								  
								  
								  

                                    <div class="row">
                        <div class="col-lg-12">
                            <div class="card alert">
                               
							   
							   <?php if($t_type=="export") { ?>
								
								 <div class="bootstrap-data-table-panel">
                                    <div class="table-responsive">
                                        <table id="bootstrap-data-table-export" data-page-length="100" class="table table-striped table-bordered">
										
								<?php } ?>	
								
								
								<?php if($t_type!="export") { ?>
								
								<div class="card-body">
                                    <div class="table-responsive">
                                        <table class="table table-bordered">
										
								<?php } ?>	
							   
							   
							   
							   
							   
							   
							   
							   
							   
							   
                                            <thead>
                                                <tr>
												     <th> SL</th>
                                                    <th>Date</th>
													<th>Remarks</th>
                                                    <th>Diary of</th>
													<th>PR Meeting</th>
                                                    <th>ID</th>
                                                    <th>Mobile</th>
													<th>Event</th>
													<th>Venue</th>
													<th>Time</th>
													<th>Pkg</th>
													<th>PR</th>
													
													
                                                </tr>
                                            </thead>
                                            <tbody>
											
											
											<?php
                            
							$sl=0;
							
						
						
						
						
						
						
						
						
						
$sqlSelectedLG = mysqli_query($connection, $sqlSelectedLG);
while ($list = mysqli_fetch_object($sqlSelectedLG)) {

                                    
                                   
                                    $idn = $list->id;
								    $date = $list->date;
									$time = $list->time;
									
									$t_color="info";
									$danger_time="16:00:00";
									
									$today=date('Y-m-d');
									
									if(strtotime($danger_time) > strtotime($time)) {$t_color="danger";}
									
									
									
									
									$eventSQL = mysqli_query($connection, "SELECT t1.* FROM `events` as t1 left join bookings as t2 on t1.temp_id=t2.id WHERE t2.booking_id!=0 AND t1.date = '$date' ORDER BY t1.time LIMIT 1");
									$eventSQL = mysqli_fetch_object($eventSQL);
									$dateid= $eventSQL->id;
									if($idn==$dateid){
										$new_date=$date;
										$new_date = date("M d, Y", strtotime($new_date));
										}
									else {
										$new_date = date("M d", strtotime($date));
										}
									
									
									
									$name = $list->client_name;
									$diary_of = $list->booking_name;
									$booking_id = $list->booking_id;
									$temp_id = $list->temp_id;
									
									$eventCT = mysqli_query($connection, "SELECT count(id) e_total FROM `events` WHERE `temp_id` = '$temp_id' ");
									$eventCT = mysqli_fetch_object($eventCT);
									$eventCT= $eventCT->e_total;
									
									if($eventCT==1){$star="&#9733;";}
									if($eventCT==2){$star="&#9733;&#9733;";}
									if($eventCT==3){$star="&#9733;&#9733;&#9733;";}
									if($eventCT==4){$star="&#9733;&#9733;&#9733;&#9733;";}
									if($eventCT==5){$star="&#9733;&#9733;&#9733;&#9733;&#9733;";}
									if($eventCT==6){$star="&#9733;&#9733;&#9733;&#9733;&#9733;&#9733;";}
									if($eventCT==7){$star="&#9733;&#9733;&#9733;&#9733;&#9733;&#9733;&#9733;";}
									if($eventCT==8){$star="&#9733;&#9733;&#9733;&#9733;&#9733;&#9733;&#9733;&#9733;";}
									if($eventCT==9){$star="&#9733;&#9733;&#9733;&#9733;&#9733;&#9733;&#9733;&#9733;&#9733;";}
									if($eventCT==10){$star="&#9733;&#9733;&#9733;&#9733;&#9733;&#9733;&#9733;&#9733;&#9733;&#9733;";}
									
									$cell_1 = $list->cell_1;
									$cell_2 = $list->cell_2;
									$event_type = $list->event_type;
									$venue = $list->venue;
									$time=strtotime($time);
									$time=date("h.i A", $time);
								
									
									$ph_package = $list->ph_package;
									$pr = $list->pr;
									if($pr=="checked"){$pr="Yes";}
										$pr_time=$list->pr_time;
										$sp = $list->sp;
									if($sp=="checked"){$sp="Yes";}
										$sp_time=$list->sp_time;
									$photographers = $list->photographers;
									$ph_names = $list->ph_names;
									$vd_package = $list->vd_package;
									$videographers = $list->videographers;
									$vd_names = $list->vd_names;
									$no_of_ph = $list->no_of_ph;
									$no_of_vd = $list->no_of_vd;
									 $asst = $list->asst;
									 $makeover = $list->parlar;
									 $decor = $list->decor;
									 	$ev_notes = $list->ev_notes;
										
										$ph_namesArray = explode(',', $ph_names);
										$photographersArray = explode(',', $photographers);
										asort($photographersArray);
										$vd_namesArray = explode(',', $vd_names);
										$videographersArray = explode(',', $videographers);
										asort($videographersArray);
										$sl=$sl+1;
											$videoincluded = $list->videoincluded;
									$PR_meetingrs = mysqli_query($connection, "SELECT * FROM `pr_meetings` WHERE `temp_id` = '$temp_id' ");
									$PR_meeting = mysqli_fetch_object($PR_meetingrs);
									$prrowcount = mysqli_num_rows($PR_meetingrs);
									if($prrowcount>0){
                                    $meeting_date= $PR_meeting->date; $meeting_date = date("M d, Y", strtotime($meeting_date));
                                    $meeting_time= $PR_meeting->time;	 $meeting_time= date("g:i a", strtotime($meeting_time));
                                    $meeting_status= $PR_meeting->status;								
									}
									$pr_calendar=$list->pr_calendar;
									
                                ?>
											
											
											
											
                                                <tr>
												
												<form method="POST">
                                                    <td> <?php echo $sl;  ?> 
													
													  
													     <?php if($t_type!="export") { ?>
													  
													<input type="hidden" name="ev_id" value="<?php echo $idn;  ?>">
													
													<button class="info" type="submit" name="submit"> <i class="ti-save-alt"></i> </button>
													<?php if($prrowcount>0){ ?>
												<a href="pr_meeting_sms.php?id=<?php echo $idn;  ?>">	 <i class="ti-email"></i>    </a>
                                                    <?php } ?>


												<a href="event_log.php?id=<?php echo $idn;  ?>" target="popup" onclick="window.open('event_log.php?id=<?php echo $idn;  ?>','popup','width=800,height=600');   
    return false;">  <font color="red"> <b><i class="ti-menu-alt"></i> </b> </font>
</a>
											
													   <?php } ?>
													
													
													
													
													
													
													
													</td>
													 <td>
													 <?php echo $new_date;  ?>
													 </td>
													  <td>
													  <?php if($t_type=="export") { ?>
													   <?php echo $ev_notes;  ?>
													   
													   <?php } ?>
													 
													   <?php if($t_type!="export") { ?>
													  
													  
													 	  <textarea name="ev_notes"> <?php echo $ev_notes;  ?> </textarea>
													  
													     <?php } ?>
													  
													  
													  </td>
                                                   <td><?php echo $diary_of; echo " ".$star; ?> </td>
												    <td>
													<?php if($prrowcount>0){ ?>
													<?php echo $meeting_date; ?>  | <?php echo $meeting_time; ?>  <a href="pr_meeting.php?temp_id=<?php echo $temp_id; ?>">	 <i class="ti-pencil-alt"></i>    </a> 
													<?php
if($meeting_status=="checked"){ ?> <span class="badge badge-success">Meeting Done</span> <?php }


													} ?>
													
													<?php if($prrowcount=="0"){
														?>
													Meeting Time Not Fixed <a href="pr_meeting.php" target="blank" >+</a>
													<?php 
													
													
													
													} 
													
													
													?>
													
													<div id="calendar_<?php echo $idn;  ?>" >
													<?php if($pr_calendar==0) { ?>
													<a class="btn btn-danger waves-effect waves-light btn-sm m-b-5 btn-rounded" href="#" onclick="calendar(<?php echo $idn;  ?>);" style="padding: 0px 5px">Calendar Pending</a>
													</div>
													<?php } ?>
													<?php if($pr_calendar==1) { ?>
													<a class="btn btn-success waves-effect waves-light btn-sm m-b-5 btn-rounded" href="#" onclick="calendar(<?php echo $idn;  ?>);" style="padding: 0px 5px">Calendar Done</a>
													</div>
													<?php } ?>
													 </td>
                                                    <td><a href="booking_details.php?id=<?php echo $temp_id;  ?>" target="_blank"> <?php echo $booking_id;  ?></a></td>
                                                   <td><?php echo $cell_1.' , '.$cell_2;  ?></td>
													 <td><?php echo $event_type;  ?></td>
													 <td><?php echo $venue;  ?></td>
												 <td><span class="badge badge-<?php echo $t_color;  ?>"><?php echo $time;  ?></span> </td>
													 <td><?php echo $ph_package;  ?></td>
												 <td><?php echo $pr;  ?> <?php echo $pr_time;  ?></td>
												 
												
</form>												
                                                </tr>
                                                
												 <?php } ?>		
												 
												 
                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>
                            <!-- /# card -->
                        </div>
                        <!-- /# column -->
                    </div>

                                   


							 </div> </div>
							
                        </div>
				
				
                        <!-- /# column -->
                        
                    </div>
				
				
				
				
				
                    <!-- /# row -->
                   
				   
				   
				           <?php include("footer.php"); ?>
						   
						   
                </section>
				
				<?php } ?>
				
            </div>
        </div>
    </div>

   <div id="search">
        <button type="button" class="close">×</button>
        <form action="search.php">
            <input type="search" name="search" value="" placeholder="type keyword(s) here" />
            <button type="submit" class="btn btn-primary">Search</button>
        </form>
    </div>


    </div>
    <script src="assets/js/lib/jquery.min.js"></script>
    <!-- jquery vendor -->
    <script src="assets/js/lib/jquery.nanoscroller.min.js"></script>
    <!-- nano scroller -->
    <script src="assets/js/lib/menubar/sidebar.js"></script>
    <script src="assets/js/lib/preloader/pace.min.js"></script>
    <!-- sidebar -->
    <script src="assets/js/lib/bootstrap.min.js"></script>
    <!-- bootstrap -->
   
    <script src="assets/js/scripts.js"></script>
	
	 <script src="assets/js/lib/data-table/datatables.min.js"></script>
    <script src="assets/js/lib/data-table/buttons.dataTables.min.js"></script>
    <script src="assets/js/lib/data-table/dataTables.buttons.min.js"></script>
    <script src="assets/js/lib/data-table/buttons.flash.min.js"></script>
    <script src="assets/js/lib/data-table/jszip.min.js"></script>
    <script src="assets/js/lib/data-table/pdfmake.min.js"></script>
    <script src="assets/js/lib/data-table/vfs_fonts.js"></script>
    <script src="assets/js/lib/data-table/buttons.html5.min.js"></script>
    <script src="assets/js/lib/data-table/buttons.print.min.js"></script>
    <script src="assets/js/lib/data-table/datatables-init.js"></script>
	
	<script>
        $(document).ready(function() {
            $('.select2').select2();
		
        });
    
        
		
	
	function calendar(ev_id) {
	
	  $.ajax({
            type: "POST",
            url: 'inc/calendar_check.php?pr=1&ev_id='+ev_id,
			error: function (request, error) {
            console.log(arguments);
            alert(" Can't do because: " + error);
           },
            data:{
                    ev_id:ev_id
		 },
            success:function(data){
                $("#calendar_"+ev_id).html(data);
				alert("Calendar Status Chnaged");

            }
        });
        
    }	
	
	
	
	
	</script>
	
		 <script src="assets/js/lib/select2/select2.full.min.js"></script>
		 
		 
</body>

</html>