<?php 
session_start();
ob_start();
include("../../pidbco/pidbjoin.php");
$sujpath="./";
?>
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Projects</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- Bootstrap 3.3.5 -->
    <link rel="stylesheet" href="<?php echo $sujpath; ?>bootstrap/css/bootstrap.min.css">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="<?php echo $sujpath; ?>font-awesome/font-awesome.min.css">
    <!-- Ionicons -->
    <link rel="stylesheet" href="<?php echo $sujpath; ?>font-awesome/ionicons.min.css">
    <!-- DataTables -->
    <link rel="stylesheet" href="<?php echo $sujpath; ?>plugins/datatables/dataTables.bootstrap.css">
    <!-- Theme style -->
    <link rel="stylesheet" href="<?php echo $sujpath; ?>dist/css/AdminLTE.min.css">
    <!-- AdminLTE Skins. Choose a skin from the css/skins
         folder instead of downloading all of them to reduce the load. -->
    <link rel="stylesheet" href="<?php echo $sujpath; ?>dist/css/skins/_all-skins.min.css">
   <script>
    function add_new_task(){
             var taskfrom = $('#taskfrom').val();
             var taskto = $('#taskto').val();
             var taskaction = $('#taskaction').val();
             var taskstatus = $('#taskstatus').val();
             if(taskfrom == ''){
                alert("Select Employee");   	
             } else if(taskto == ''){
             	alert("Select Employee");
             } else if(taskaction == ''){
             	alert("Enter Action");
             } else if(taskstatus == ''){
             	alert("Select Status");
             } else {                    
                  $.ajax({
                    type: "POST",
                    url: "ajaxmarket.php",
                     data: {
                          add_new_taskreg : 1,
                          taskfrom        : taskfrom,
                          taskto          : taskto,
                          taskaction      : taskaction,
                          taskstatus      : taskstatus                          
                     },
                     cache: true,
                     success: function(res23)
                     {
                     	   	$('#taskfrom').val('');
                     	   	$('#taskto').val('');
                     	   	$('#taskaction').val('');
                           	$("#marketingdiv123").load("task_register.php #marketingdiv123");   
                            datat2();                    
                      }
                   }); 
    	    }
        }
              
    	
    	
   function edit_new_task()
   {
             var taskfrom = $('#taskfrom').val();
             var taskto = $('#taskto').val();
             var taskaction = $('#taskaction').val();
             var taskstatus = $('#taskstatus').val();
             var hidvall = $('#hidvall').val();
             if($("#tasksign").is(':checked'))
                 var tasksign =1;
             else
                 var tasksign =0;
                 
             if(taskfrom == ''){
                alert("Select Employee");   	
             } else if(taskto == ''){
             	alert("Select Employee");
             } else if(taskaction == ''){
             	alert("Enter Action");
             } else if(taskstatus == ''){
             	alert("Select Status");
             } else {                    
                  $.ajax({
                    type: "POST",
                    url: "ajaxmarket.php",
                     data: {
                          edit_new_taskreg : 1,
                          taskfrom        : taskfrom,
                          taskto          : taskto,
                          taskaction      : taskaction,
                          taskstatus      : taskstatus,
                          hidvall         : hidvall,
                          tasksign        : tasksign                          
                     },
                     cache: true,
                     success: function(res23)
                     {
                     	   	$('#taskfrom').val('');
                     	   	$('#taskto').val('');
                     	   	$('#taskaction').val('');
                     	   	$('#tasksign').val('');
                     	   	   $("#marketingdiv123").load("task_register.php #marketingdiv123");
                     	   	var idd = '';
                           	$("#marketingdiv2").load("task_register.php?idd2="+idd+" #marketingdiv2");   
                            datat2();                    
                      }
                   }); 
    	    }   
   }
        
        
    	
    	    	
    	function delete_task(id)
    	{
    		var result = confirm("Want to delete?");
			if (result) 
			{
     		$.ajax({
			type: "POST",
			url: "ajaxmarket.php",
			data: {
			btn_delete_taskk: 1,
			id:id
			},
			cache: true,
			success: function(res)
			{
			      $("#marketingdiv123").load("task_register.php #marketingdiv123");
			      datat();
        	}  
			});
   			}
    	}
    	
    	
    	function edit_task(id)
    	{
    		$.ajax({
			type: "POST",
			url: "ajaxmarket.php",
			data: {
			btn_edit_market: 1,
			id:id
			},
			cache: true,
			success: function(res)
			{
		     	$("#marketingdiv2").load("task_register.php?idd2="+id+" #marketingdiv2"); 	
			}  
			});
    	}
    	
    	function inter_connect(idd)
    	{
    		var interconnect = $('#interconnect'+idd).val();
    		$.ajax({
			type: "POST",
			url: "ajaxmarket.php",
			data: {
			add_new_interconct : 1,
			interconnect   : interconnect,
			idd            : idd
			},
			cache: true,
			success: function(res)
			{
				alert("Data Updated");
		     	window.location.href="task_register.php"; 	
			}  
			});
    	}
    	
    	
function state_change(str)
{
var xmlhttp;
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("cdistrict").innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open("GET","ajaxmarket.php?state_idd="+str,true);
xmlhttp.send();
}

        function search_task()
    	{
    		var searchfrom = $('#searchfrom').val();
    		var searchto = $('#searchto').val();
    		var srchstatus = $('#srchstatus').val();
    		
    		if(srchstatus == ''){
    		   alert("Select Status");	
    		} else {	
    		$.ajax({
			type: "POST",
			url: "ajaxmarket.php",
			data: {
			btn_edit_market: 1
			},
			cache: true,
			success: function(res)
			{
			 	$("#example1").load("task_register.php?tfrom="+searchfrom+"&tto="+searchto+"&tstatus="+srchstatus+" #example1"); 	
			}  
			});
			}
    	}
    	
    </script>
    
  </head>
  <body class="hold-transition skin-blue sidebar-mini">
     <div class="wrapper">
  <?php include("head.php");
    include("left.php"); ?> 
	 
      <!-- Content Wrapper. Contains page content -->
      <div class="content-wrapper" >
        <!-- Content Header (Page header) -->
        <section class="content-header">
          <h1> Task Register
          	<small>- Control panel</small>
          	</h1>
          <ol class="breadcrumb">
            <li><a href="dash_board.php"><i class="fa fa-dashboard"></i> Home</a></li>
            <li class="active">Task Register</li> 
          </ol>
        </section>
  <!-- Main content -->
        <section class="content" >
   
<div class="box-body2" id="marketingdiv2" >
 <?php
      $idd2 = strip_tags(base64_decode($_GET['idd2']));
	  $sq = mysqli_query($con, "SELECT * FROM `p_task` WHERE `tid`='$idd2' " );
	  $rs = mysqli_fetch_assoc($sq);	  
 ?>	  	
<div class="box-body" >
 <div class="row" >	
 <div class="col-md-12" style="" >

 <div class="col-md-1"  style=" padding-left: 2px; padding-right: 0px; ">			
 <div class="form-group">
   <select name="taskfrom" id="taskfrom" class="form-control">
   	<option value="">From</option>
   	<?php
   	$sq1 = mysqli_query($con, "SELECT * FROM `employee_registration` ");
	while($res1 = mysqli_fetch_array($sq1)){
		if($rs['t_from'] == $res1['id']){
   	?>
   	<option value="<?php echo $res1['id']; ?>" selected><?php echo $res1['emp_name']; ?></option>
   	<?php } else { ?>
   	<option value="<?php echo $res1['id']; ?>"><?php echo $res1['emp_name']; ?></option>
   	<?php } } ?>
   </select>		
 </div></div>
 
 <div class="col-md-1"  style=" padding-left: 2px; padding-right: 0px; ">			
 <div class="form-group">
  <select class="form-control" id="taskto" name="taskto" onchange="state_change(this.value);">
  	<option value="">To</option>
    <?php
   	$sq1 = mysqli_query($con, "SELECT * FROM `employee_registration` ");
	while($res1 = mysqli_fetch_array($sq1)){
		if($rs['t_to'] == $res1['id']){
   	?>
   	<option value="<?php echo $res1['id']; ?>" selected><?php echo $res1['emp_name']; ?></option>
   	<?php } else { ?>
   	<option value="<?php echo $res1['id']; ?>"><?php echo $res1['emp_name']; ?></option>
   	<?php } } ?>  
  </select> 
 </div></div>

 <div class="col-md-6" style=" padding-left: 2px; padding-right: 0px; " >
 <div class="form-group">
      <textarea name="taskaction" id="taskaction" class="form-control"  placeholder="TODO" style=" height: 35px;" ><?php echo $rs['t_action']; ?></textarea>
 </div></div>

 <?php if($idd2 != ''){ ?>	
 	<div class="col-md-1" style=" padding-left: 2px; padding-right: 0px; ">
 <?php } else { ?>	
    <div class="col-md-2"  style=" padding-left: 2px; padding-right: 0px; ">
 <?php } ?>				
 <div class="form-group">
  <select class="form-control" id="taskstatus" name="taskstatus" >
  	<option value="0" <?php if($rs['t_action'] == 0){ ?> selected <?php } ?>>Open</option>
  	<option value="1" <?php if($rs['t_action'] == 1){ ?> selected <?php } ?>>Closed</option>
  </select> 
 </div></div>

 <div class="col-md-2" style=" padding-left: 2px; padding-right: 0px; ">					
 <div class="form-group">
    <?php if($idd2 != ''){ ?>
  	<input type="checkbox" name="tasksign" id="tasksign" placeholder="Signature" style=" margin-left: 15px;" <?php if($rs['t_sign'] == 1){ ?> checked <?php } ?> />Signature
    <input type="hidden" name="hidvall" id="hidvall" value="<?php echo $rs['tid']; ?>" />
    <input type="submit" class="btn btn-primary" name="frasubmit" id="frasubmit" value="Update" onclick="edit_new_task();" style=" float: right;margin-right: 5px; " /> 
 <?php } else { ?>
    <input type="submit" class="btn btn-primary" name="frasubmit" id="frasubmit" value="Submit" onclick="add_new_task();" style=" float: left;margin-right: 5px; " />	
 <?php } ?> 
 </div>
 </div>

</div></div>

</div>
</div>
  
  
  
  
  
  
<div id="marketingdiv123">

<div class="box" >
   <div class="box-body" >
        <div class="box-body table-responsive no-padding" >
        	

 <div class="row">	
 <div class="col-md-12" >

 <div class="col-md-5"  style=" padding-left: 2px; padding-right: 0px; ">			
 <div class="form-group">
</div></div>

 <div class="col-md-2"  style=" padding-left: 2px; padding-right: 0px; ">			
 <div class="form-group">
   <select name="searchfrom" id="searchfrom" class="form-control" style=" height: 30px;">
   	<option value="">From</option>
   	<?php
   	$sq1 = mysqli_query($con, "SELECT * FROM `employee_registration` ");
	while($res1 = mysqli_fetch_array($sq1)){
		if($rs['t_from'] == $res1['id']){
   	?>
   	<option value="<?php echo $res1['id']; ?>" selected><?php echo $res1['emp_name']; ?></option>
   	<?php } else { ?>
   	<option value="<?php echo $res1['id']; ?>"><?php echo $res1['emp_name']; ?></option>
   	<?php } } ?>
   </select>		
 </div></div>
 <div class="col-md-2"  style=" padding-left: 2px; padding-right: 0px; ">			
 <div class="form-group">
  <select class="form-control" id="searchto" name="searchto" onchange="state_change(this.value);" style=" height: 30px;">
  	<option value="">To</option>
    <?php
   	$sq1 = mysqli_query($con, "SELECT * FROM `employee_registration` ");
	while($res1 = mysqli_fetch_array($sq1)){
		if($rs['t_to'] == $res1['id']){
   	?>
   	<option value="<?php echo $res1['id']; ?>" selected><?php echo $res1['emp_name']; ?></option>
   	<?php } else { ?>
   	<option value="<?php echo $res1['id']; ?>"><?php echo $res1['emp_name']; ?></option>
   	<?php } } ?>  
  </select> 
 </div></div>


<div class="col-md-2"  style=" padding-left: 2px; padding-right: 0px; ">			
 <div class="form-group">
  <select class="form-control" id="srchstatus" name="srchstatus" style=" height: 30px;">
  	<option value="">Status</option>
  	<option value="All" selected>All</option>
    <option value="Open">Open</option>
    <option value="Closed">Closed</option>  
  </select> 
 </div></div>
<div class="col-md-1"  style=" padding-left: 2px; padding-right: 0px; ">			
 <div class="form-group">
 <input type="submit" class="btn btn-primary" name="frasubmit" id="frasubmit" value="Search" onclick="search_task();" style=" float: left;margin-right: 5px; height: 30px;" />
 </div></div>
 </div></div></div>
 
 
  	                 	
                  <table id="example1" class="table table-bordered table-striped" >
                    <thead >
                    <tr >
                    <th style=" display: none;"></th>
                    <th>#</th>   
                    <th>Date/Time</th>                 	
                    <th>From</th>
                    <th>To</th>
                    <th>Todo</th>
                    <th>Status</th>
                    <th></th>
                    </tr>
                    </thead>
                    <tbody>
   <?php
   $tfrom = $_GET['tfrom'];
   $tto = $_GET['tto'];
   $tstatus = $_GET['tstatus'];

   if($tstatus != ''){
   	      if($tstatus == 'All'){
   	          $s1 = " 1=1";
		  } else if($tstatus == 'Open'){
		  	  $s1 = "`t_status`='0'";
		  } else if($tstatus == 'Closed'){
		  	  $s1 = "`t_status`='1'";
		  }		  
			  
   } else {
   	  $s1 = "`t_status`='0'";
   }
   if($tfrom != ''){
   	  $s2 = " AND `t_from`='$tfrom'";
   }
   if($tto != ''){
   	  $s3 = " AND `t_to`='$tto'";
   }
  
   $sqtask = mysqli_query($con, "SELECT * FROM `p_task` WHERE ".$s1.$s2.$s3." ORDER BY `tid` DESC");
   while($rstask = mysqli_fetch_array($sqtask)){
   	$empfrom = $rstask['t_from'];
	$empto = $rstask['t_to'];
   	
   	$sqemp = mysqli_query($con, "SELECT emp_name FROM `employee_registration` WHERE `id`='$empfrom' ");
	$resemp = mysqli_fetch_array($sqemp);
   	$fromemp = $resemp['emp_name'];
	
	$sqemp2 = mysqli_query($con, "SELECT emp_name FROM `employee_registration` WHERE `id`='$empto' ");
	$resemp2 = mysqli_fetch_array($sqemp2);
   	$toemp = $resemp2['emp_name'];
   ?>
                   <tr>
                   	<td  style=" display: none;"></td>
                   	<td>
<?php if($rstask['t_status'] == 1){
 $datetime1 = new DateTime($rstask['t_dat']);
 $datetime2 = new DateTime($rstask['t_closedat']);
 $interval = $datetime1->diff($datetime2);
 $days_between = $interval->format('%a');
if($days_between == 0){
$days_between = 1;
}	
	 ?>
 <small class="label label-danger" ><?php echo $days_between; ?></small>  
 <?php   } else {
 $datetime11 = new DateTime($rstask['t_dat']);
 $datetime22 = new DateTime(date('Y-m-d'));
 $interval = $datetime11->diff($datetime22);
 $days_between2 = $interval->format('%a');
if($days_between2 != 0){
 ?> 
 <small class="label label-info" title="Days"> <?php echo $days_between2; ?></small>
 <?php } } ?>
                   	 <?php echo $rstask['tid']; ?> 
                   	</td>
                   	<td><?php echo $rstask['t_dat']; ?> &nbsp; <?php echo $rstask['t_time']; ?></td>
                   	<td><?php echo $fromemp; ?></td>
                   	<td><?php echo $toemp; ?></td>
                   	<td>
                   	<a href="" data-toggle="modal" data-target="#myModal8<?php echo $rstask['tid']; ?>" style=" cursor: pointer; color: #000;">	
                   		<?php echo $rstask['t_action']; ?>
                   	</a></td>
                   	<td><?php if($rstask['t_status'] == 1){ echo "Closed"; } else { echo "Open"; } ?></td>
                   	<td>
    &nbsp;<a href="" data-toggle="modal" data-target="#myModal<?php echo $rstask['tid']; ?>" style=" cursor: pointer;"><span class="glyphicon glyphicon-eye-open" style="font-size:14px;"></span></a> &nbsp;                	
    <a onClick="edit_task('<?php echo base64_encode($rstask['tid']); ?>');" style=" cursor: pointer;" ><span class="fa fa-pencil" style="font-size:14px;"></span></a> &nbsp; 
    <a onClick="delete_task('<?php echo base64_encode($rstask['tid']); ?>');" style=" cursor: pointer;" ><span class="fa fa-trash-o" style="font-size:14px;"></span></a> &nbsp;	
    
    <a href="" data-toggle="modal" data-target="#myModal9<?php echo $rstask['tid']; ?>" style=" cursor: pointer;"><span class="fa fa-connectdevelop" style="font-size:14px;"></span></a> &nbsp;
    
 
                   	</td>
                   </tr>
                   
                   
  <div class="modal fade" id="myModal9<?php echo $rstask['tid']; ?>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" >
  <div class="modal-dialog" role="document" style=" width: 600px;">
    <div class="modal-content">
      <div class="modal-header" style=" background-color: #E8E8E8;">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">InterConnected Todos</h4>
        </div>
        <div class="modal-body" id="myModal2" >
        <div class="row">	
        	
            <div class="col-md-12" >
            	Enter Related Action Numbers :
            <div class="col-md-10"  style=" padding-left: 2px; padding-right: 0px; ">					
            <div class="form-group">
            <input type="text" name="interconnect<?php echo $rstask['tid']; ?>" id="interconnect<?php echo $rstask['tid']; ?>" class="form-control" placeholder="Eg: 1,2,5,100,129" value="<?php echo $rstask['t_connect']; ?>" />
        	</div></div>
        	<div class="col-md-2"  style=" padding-left: 2px; padding-right: 0px; ">					
            <div class="form-group">
            <input type="submit" class="btn btn-primary" name="frasubmit" id="frasubmit" value="Submit" style=" float: right;margin-right: 5px; " onclick="inter_connect('<?php echo $rstask['tid']; ?>');" />		
            </div></div>	
        	</div>
        	
     </div></div></div></div></div>
       
       
        
 <div class="modal fade" id="myModal8<?php echo $rstask['tid']; ?>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" >
   <div class="modal-dialog" role="document" style=" width: 600px;">
     <div class="modal-content">
       <div class="modal-header" style=" background-color: #E8E8E8;">
         <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
         <h4 class="modal-title" id="myModalLabel">TODO</h4>
        </div>
        <div class="modal-body" id="myModal2" >
        <div class="row">	
        	
            <div class="col-md-12" >
            <div class="col-md-12"  style=" padding-left: 2px; padding-right: 0px; ">					
            <div class="form-group">
            <?php echo $rstask['t_action']; ?>
        	</div></div>
        	</div>
        	
       </div></div></div></div></div>   	
        	
        	
        	                 
                   
  <div class="modal fade" id="myModal<?php echo $rstask['tid']; ?>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" >
  <div class="modal-dialog" role="document" style=" width: 800px;">
    <div class="modal-content">
      <div class="modal-header" style=" background-color: #E8E8E8;">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">Task Register</h4>
        </div>
        <div class="modal-body" id="myModal2" >
      
        <div class="row">	
     	 
         
        <div class="col-md-12" >
	     <div class="col-md-5"  style=" padding-left: 2px; padding-right: 0px; ">					
         <div class="form-group">
         	From
         </div></div>
         <div class="col-md-7"  style=" padding-left: 2px; padding-right: 0px; ">					
         <div class="form-group">
         	 : &nbsp; <?php echo $fromemp; ?>
         </div></div>
         </div>
         
          <div class="col-md-12" >
          <div class="col-md-5"  style=" padding-left: 2px; padding-right: 0px; ">					
         <div class="form-group">
         	To. 
         </div></div>
	     <div class="col-md-7"  style=" padding-left: 2px; padding-right: 0px; ">					
         <div class="form-group">
         	: &nbsp; <?php echo $toemp; ?>
	     </div></div>
	     </div>
	     
	     <div class="col-md-12" >
	     <div class="col-md-5"  style="  padding-left: 2px; padding-right: 0px; ">					
         <div class="form-group">
         	Task 
      	 </div></div>
      	 <div class="col-md-7"  style=" padding-left: 2px; padding-right: 0px;  ">					
         <div class="form-group">
         	: &nbsp; <?php echo $rstask['t_action']; ?>
      	 </div></div>
         </div>
         
         
         <div class="col-md-12" >
	     <div class="col-md-5"  style="  padding-left: 2px; padding-right: 0px; ">					
         <div class="form-group">
         	Date & Time 
      	 </div></div>
      	 <div class="col-md-7"  style=" padding-left: 2px; padding-right: 0px;  ">					
         <div class="form-group">
         	: &nbsp; <?php echo $rstask['t_dat']; ?>&nbsp;&nbsp;<?php echo $rstask['t_time']; ?>
      	 </div></div>
         </div>
         
         
         <div class="col-md-12" >
	     <div class="col-md-5"  style="  padding-left: 2px; padding-right: 0px; ">					
         <div class="form-group">
         	Status 
      	 </div></div>
      	 <div class="col-md-7"  style=" padding-left: 2px; padding-right: 0px;  ">					
         <div class="form-group">
         	: &nbsp; <?php if($rstask['t_status'] == 1){ echo "Closed"; } else { echo "Open"; } ?>
      	 </div></div>
         </div>
         
          <div class="col-md-12" >
	     <div class="col-md-5"  style="  padding-left: 2px; padding-right: 0px; ">					
         <div class="form-group">
         	Signature 
      	 </div></div>
      	 <div class="col-md-7"  style=" padding-left: 2px; padding-right: 0px;  ">					
         <div class="form-group">
         	: &nbsp; <?php if($rstask['t_sign'] == 1){ echo $toemp; } else { echo "-"; } ?>
      	 </div></div>
         </div>
        
         
         <?php if($rstask['t_closedat'] != '') { ?>          
         <div class="col-md-12" >
	     <div class="col-md-5"  style="  padding-left: 2px; padding-right: 0px; ">					
         <div class="form-group">
         	Closed Date 
      	 </div></div>
      	 <div class="col-md-7"  style=" padding-left: 2px; padding-right: 0px;  ">					
         <div class="form-group">
         	: &nbsp; <?php echo $rstask['t_closedat']; ?>
      	 </div></div>
         </div>
         <?php } ?>
         
         
     
     </div>  
       
       
        </div>
        <div class="modal-footer">
        
      </div>
    </div>
  </div>
</div> 

   <?php  } ?>
                    </tbody>
                    </table>
  
         		  </div>
                </div><!-- /.box-body -->
              </div><!-- /.box -->
	
      </div>
	
		
			
			
			
    </section><!-- /.content -->
    </div><!-- /.content-wrapper -->
    </div>
	<!-- jQuery 2.1.4 -->
    <script src="<?php echo $sujpath; ?>plugins/jQuery/jQuery-2.1.4.min.js"></script>
    <!-- Bootstrap 3.3.5 -->
    <script src="<?php echo $sujpath; ?>bootstrap/js/bootstrap.min.js"></script>
    <!-- DataTables -->
	<script src="<?php echo $sujpath; ?>plugins/datatables/jquery.dataTables.min.js"></script>
    <script src="<?php echo $sujpath; ?>plugins/datatables/dataTables.bootstrap.min.js"></script>
    <!-- SlimScroll -->
    <script src="<?php echo $sujpath; ?>plugins/slimScroll/jquery.slimscroll.min.js"></script>
    <!-- FastClick -->
    <script src="<?php echo $sujpath; ?>plugins/fastclick/fastclick.min.js"></script>
    <!-- AdminLTE App -->
    <script src="<?php echo $sujpath; ?>dist/js/app.min.js"></script>
    <!-- AdminLTE for demo purposes -->
    <script src="<?php echo $sujpath; ?>dist/js/demo.js"></script>
    <!-- page script -->
    
   <script>
      $(document).ready(function() {
        $("#example1").DataTable();
      });
      
	function datat(){
	  alert("Data Deleted Successfully.");
      $(document).ready(function() {
        $("#example1").DataTable();
       
      });
    }
    function datat2(){
	  alert("Data Added Successfully");
      $(document).ready(function() {
        $("#example1").DataTable();
       
      });
    }
    function datat3(){
	  alert("Updated Successfully");
      $(document).ready(function() {
        $("#example1").DataTable();
       
      });
    }
   </script>  
   
  </body>
</html>