<?php
include("common/connection.php");
login_check();

$Lead_Req_Id=$_REQUEST['Lid'];
$user_type_sql="select User_Type from user_master where User_Name='".$_SESSION['user']."'";
$user_type_query=mysqli_query($con,$user_type_sql);
$user_type=mysqli_fetch_array($user_type_query);
?>

<!doctype html>
<html class="no-js" lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <title>Pending Agreement | Buurtzorg</title>
    <?php include("headerlink.php"); ?> 
    
    
   
    
    
    
    <link rel="stylesheet" href="css/data-table/bootstrap-table.css">
    	<link rel="stylesheet" href="css/data-table/bootstrap-editable.css">
        
        
        <style>
		table {overflow:inherit !important}
		table thead {overflow:inherit !important}
		table thead tr {overflow:inherit !important}
		
		table tbody {overflow:inherit !important}
		table tbody tr {overflow:inherit !important; }
		table tbody tr td {overflow:inherit !important}
		
		
		.fixed-table-body {overflow:inherit !important}
		.action_dropdown {padding:0 !important; min-width:460px !important;  left:-258px; background-color:rgba(0,0,0,0) !important;
		 box-shadow:none !important; border:none !important; margin-top:-70px}
										
		 .action_dropdown:after {
			  content:'';
			  width: 0;
			  height: 0;
			  border-left: 7px solid transparent;
			  border-right: 7px solid transparent;
			  border-top: 12px solid #337ab7;
			  margin-top:40px;
			  position:absolute;
			  top:-10px;
			  margin-left:-190px;
		}
		
		
		
		
		
		
		</style>
    
    
    
    
    
     <link rel="stylesheet" href="css/form/all-type-forms.css">
    <!-- x-editor CSS
		============================================ -->
    <link rel="stylesheet" href="css/editor/select2.css">
    <link rel="stylesheet" href="css/editor/datetimepicker.css">
    <link rel="stylesheet" href="css/editor/bootstrap-editable.css">
    <link rel="stylesheet" href="css/editor/x-editor-style.css">

    
    <script>
	function unlock_form() {
	 
	$('#edit_c_form  input'). prop("disabled", false);
	//$('#not_editable  input'). prop("disabled", true);
	$('#edit_c_form  textarea'). prop("disabled", false);
	$('#edit_c_form  select'). prop("disabled", false);
	$('#update_btn').show();
	$('#edit_btn_1').hide();
	
 
	}
	</script>
    
    <script>
	function personaliz_label(per) {
	 
	
	 $('#ps').text(per);
	
	}
	
 
	</script> 
    <?php
	 $lead_basic_sql="select * from allocation_master where Lead_ID='".$Lead_Req_Id."'";
	 $lead_basic_query=mysqli_query($con,$lead_basic_sql);
	 $lead_details=mysqli_fetch_array($lead_basic_query);
	?>   
    
    <script type="text/javascript">
	function ShowPersonalize()
	{
	   if(document.getElementById("personalize").checked==true)
	   {
	   
	      $('#personalize_div').show();
	   }
	   else
	   {
	      $('#personalize_div').hide();
	   }
	
	}
	</script> 
<script>
	function delete_service(per) 
	{
	  var response = confirm("Are You Sure to Delete Service!");
	  if (response == true) 
	  {
		$.ajax({
		url:"ajax_delete_service.php",
		type:"POST",
		data:{'per':per},
		success:function(data)
		{
 			//alert('Lead '+data+' Deleted Successfully');
			window.location.href="Pending_Agreement.php"
		}
		});
	  } 
	  else 
	  {
		alert('Lead Not Deleted');
	  }
	}
	</script>     
    
</head>

<body>
    <!--[if lt IE 8]>
		<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
	<![endif]-->
    <!-- Start Left menu area -->
    
    
    
    <?php include("left-menu.php"); ?>
    
    
    
    <!-- End Left menu area -->
    <!-- Start Welcome area -->
    <div class="all-content-wrapper">
        
        
       <?php include("header-menu.php"); ?> 
        
       
                                        	
        <!-- Static Table Start -->
        <div class="static-table-area">
        
       
        
        
        
            <div class="container-fluid">
                <div class="row">
                
                
                    
                    <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12" >
                        <div class="sparkline9-list mt-b-30 res-mg-t-30 analysis-progrebar-ctn" style="background-color:#FFFFFF">
                            <div class="sparkline9-hd">
                                <div class="main-sparkline9-hd">
                                    <h1 style="margin-bottom:15px; text-transform:uppercase">Pending Agreement</h1>
                                   
                                    
                                    
                                          <div class="row" style="background-color:#FFFFFF;">
                                           <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                                              
                              
                                
                                        
                                    <table id="table" data-toggle="table" data-pagination="true" data-search="false" data-show-columns="false" data-show-pagination-switch="false" data-show-refresh="false" data-key-events="false" data-show-toggle="false" data-resizable="false" data-cookie="false"
                                        data-cookie-id-table="saveId" data-show-export="false" data-click-to-select="true" data-toolbar="#toolbar">
                                       <thead>
                                        
                                           	<tr align="center">
                                                <!--<th data-field="state" data-checkbox="false"></th>-->
                                                <th  data-field="SLN" data-editable="false" >Lead_ID</th>
                                                <th data-field="Service Name" data-editable="false"> Lead Name</th>
                                                <th data-field="doctorN" data-editable="false">Doctor Name</th>
                                                <th data-field="nurseN" data-editable="false">Nurse Name</th>
                                                <th data-field="serviceP" data-editable="false">Service Provide</th>
                                                <th data-field="doctorR" data-editable="false">Doctor Remarks</th>
                                                
                                               
                                                <th style="text-align:center" data-field="action"><div align="center">Action</div></th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                       <?php
									   //query for allocation_master
									   $Sqlpnd="SELECT * FROM `allocation_master` WHERE  service_provide='Yes'";
                                       $pndres=mysqli_query($con,$Sqlpnd);
									   if(mysqli_num_rows($pndres)>0) 
									   {
									   		while($RowService=mysqli_fetch_array($pndres))
											{
									   
									   //query for employee_master
									   $sqlp = "SELECT First_Name, Last_Name FROM employee_master where SLN='".$RowService['doctor_name']."'";
									   $Pres = mysqli_query($con,$sqlp);
									   $Rowser = mysqli_fetch_array($Pres);
									   
									   $sqla = "select First_Name, Last_Name from employee_master where SLN='".$RowService['nurse_name']."'";
									   $Ares = mysqli_query($con,$sqla);
									   $RowA = mysqli_fetch_array($Ares);
									   
									   $sql_agree = "select Lead_ID from patient_agreement where Lead_ID='".$RowService['Lead_ID']."'";
									   $rs_agree = mysqli_query($con,$sql_agree);
									  
									   ?>
                                        
                                            <tr class="">
                                            		<?php
                                                    $full=$Rowser['First_Name']." ".$rowser['Last_Name'];
													$nFullname=$RowA['First_Name']." ".$RowA['Last_Name'];
                                                    
													?>
                                               <td><?php echo $RowService['Lead_ID']?></td>
                                                <td><?php echo $RowService['patient_name']; ?></td>
                                                <td><?php echo $full; ?></td>
                                                <td><?php echo $nFullname; ?></td>
                                                <td><?php echo $RowService['service_provide']; ?></td>
                                                <td><?php echo $RowService['doctor_remarks']; ?></td>

                                                <td class="datatable-ct" style="text-align:center !important;">
                                                
                                                  
                                               
		
		<div align="center"> 
                                     <?php
                                     if(mysqli_num_rows($rs_agree)==0)
									 {
									 ?>
                                      <a href="patient_agreement.php?Lid=<?php echo base64_encode($RowService['Lead_ID']); ?>" style="margin-left:8px"  data-toggle="tooltip" title="" class="various" data-fancybox-type="iframe" ><i class="fa fa-pencil-square" style="margin-left:8px; font-size:18px;" title="Generate Agreement" data-toggle="tooltip"></i></a>
                                       <?php
									   }
									   //else
									   {
									   ?>
                                        
                                        <a href="view_agreement.php?Lid=<?php echo base64_encode($RowService['Lead_ID']); ?>" style="margin-left:8px"  data-toggle="tooltip" class="various01" data-fancybox-type="iframe"><i class="fa fa-search" style="margin-left:8px; font-size:18px;" title="View Agreement" data-toggle="tooltip"></i></a>
                                        <?php
										}
										?>
                                        
                                        <!--<a href="Information_sheet.php?Lid=<?php echo base64_encode($RowService['Lead_ID']); ?>" style="margin-left:8px"  data-toggle="tooltip" title="" class="various02" data-fancybox-type="iframe" ><i class="fa fa-search" style="margin-left:8px; font-size:18px; display:none;" title="Information_sheet" data-toggle="tooltip"></i></a>
                                      -->
                                                
                                                
                                                
                                                </div>
                                              
                                                </td>
                                            </tr>
                                            
                                          <?php
										  		}//while ends
										  }//if ends
										  ?>  
                                     
                                        </tbody>
                                    </table>    
                                        
                                      </div>  
                                        
                                            </div>
                                        
                                          
                                         
                                         
                                         
                                         
                                           
                                </div>
                            </div>
                             
                         </div>
                         
                    </div> 
                    
                    
                                	
                              <div class="sparkline9-hd" style="padding-bottom: 0px;">
                              
                              
                                <div class="review-content-section">
                                    <div id="" class="pro-ad addcoursepro">
                                        
                                          
                                            
                                            
                                           
                                        
                                    </div>
                                </div>
                                        
                              
                              
                              </div>          
                        </div>
                    </div>
                </div>
                
                
            </div>
        </div>
        <!-- Static Table End -->
        <div class="footer-copyright-area">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-lg-12">
                        <div class="footer-copy-right">
                            <p>Copyright © 2019. All rights reserved. </p>
                           
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

     <!-- jquery
		============================================ -->
     
       <script src="js/vendor/jquery-1.12.4.min.js"></script>
    <!-- bootstrap JS
		============================================ -->
    <script src="js/bootstrap.min.js"></script>
    <!-- wow JS
		============================================ -->
    <script src="js/wow.min.js"></script>
    <!-- price-slider JS
		============================================ -->
    <script src="js/jquery-price-slider.js"></script>
    <!-- meanmenu JS
		============================================ -->
    <script src="js/jquery.meanmenu.js"></script>
    <!-- owl.carousel JS
		============================================ -->
    <script src="js/owl.carousel.min.js"></script>
    <!-- sticky JS
		============================================ -->
    <script src="js/jquery.sticky.js"></script>
    <!-- scrollUp JS
		============================================ -->
    <script src="js/jquery.scrollUp.min.js"></script>
    
    <script src="js/scrollbar/jquery.mCustomScrollbar.concat.min.js"></script>
    <script src="js/scrollbar/mCustomScrollbar-active.js"></script>
    
    
    <!-- data table JS
		============================================ -->
    <script src="js/data-table/bootstrap-table.js"></script>
    <script src="js/data-table/tableExport.js"></script>
    <script src="js/data-table/data-table-active.js"></script>
    <script src="js/data-table/bootstrap-table-editable.js"></script>
    <script src="js/data-table/bootstrap-editable.js"></script>
    <script src="js/data-table/bootstrap-table-resizable.js"></script>
    <script src="js/data-table/colResizable-1.5.source.js"></script>
    <script src="js/data-table/bootstrap-table-export.js"></script>

     
    
     <!--  editable JS
		============================================ -->
    <script src="js/editable/jquery.mockjax.js"></script>
    <script src="js/editable/mock-active.js"></script>
    <script src="js/editable/select2.js"></script>
    <script src="js/editable/moment.min.js"></script>
    <script src="js/editable/bootstrap-datetimepicker.js"></script>
    <script src="js/editable/bootstrap-editable.js"></script>
    <script src="js/editable/xediable-active.js"></script>
 <!-- datepicker JS
		============================================ -->
    <script src="js/datepicker/jquery-ui.min.js"></script>
    <script src="js/datepicker/datepicker-active.js"></script>
    
    <!-- mCustomScrollbar JS
		============================================ -->
    <script src="js/scrollbar/jquery.mCustomScrollbar.concat.min.js"></script>
    <script src="js/scrollbar/mCustomScrollbar-active.js"></script>
    <!-- metisMenu JS
		============================================ -->
    <script src="js/metisMenu/metisMenu.min.js"></script>
    <script src="js/metisMenu/metisMenu-active.js"></script>
    <!-- peity JS
		============================================ -->
    <script src="js/peity/jquery.peity.min.js"></script>
    <script src="js/peity/peity-active.js"></script>
    <!-- sparkline JS
		============================================ -->
    <script src="js/sparkline/jquery.sparkline.min.js"></script>
    <script src="js/sparkline/sparkline-active.js"></script>
    <!-- tab JS
		============================================ -->
    <script src="js/tab.js"></script>
    <!-- plugins JS
		============================================ -->
    <script src="js/plugins.js"></script>
    <!-- main JS
		============================================ -->
    <script src="js/main.js"></script>
    <!-- tawk chat JS
		============================================ -->
    <script src="js/tawk-chat.js"></script>
   <!-- form validate JS
		============================================ -->
    <script src="js/form-validation/jquery.form.min.js"></script>
    <script src="js/form-validation/jquery.validate.min.js"></script>
    <script src="js/form-validation/form-active.js"></script>
    
 <!---- Fancybox --->   
    <script type="text/javascript" src="lib/jquery.mousewheel.pack.js"></script>
    <script type="text/javascript" src="source/jquery.fancybox.pack.js?v=2.1.5"></script>
    <link rel="stylesheet" type="text/css" href="source/jquery.fancybox.css" media="screen"/>
    
    <script>
$(document).ready(function() {
   $("body").tooltip({ 
   	selector: '[data-toggle=tooltip]' 
	 });
});
 
</script> 
  
               
<script> 
$('button.call_btn_1').click(function() {
    //var text = $(this).text();
	var text = $(this).data('value_santanu');
	//alert(text)
	$('#hidden_call_box').val(text);
	$('#response').val(text);
    // do something with the text
});
</script> 
                                                
                                                
                                                
                                                
       <!-- bootstrap-clockpicker -->
      <link rel="stylesheet" type="text/css" href="css/bootstrap-clockpicker.min.css">
    <script type="text/javascript" src="js/bootstrap-clockpicker.min.js"></script>


 <script type="text/javascript">
$('.clockpicker').clockpicker()
	.find('input').change(function(){
		console.log(this.value);
	});
var input = $('#single-input').clockpicker({
	placement: 'bottom',
	align: 'left',
	autoclose: true,
	'default': 'now'
});

$('.clockpicker-with-callbacks').clockpicker({
		donetext: 'Done',
		init: function() { 
			console.log("colorpicker initiated");

		},
		beforeShow: function() {
			console.log("before show");
		},
		afterShow: function() {
			console.log("after show");
		},
		beforeHide: function() {
			console.log("before hide");
		},
		afterHide: function() {
			console.log("after hide");
		},
		beforeHourSelect: function() {
			console.log("before hour selected");
		},
		afterHourSelect: function() {
			console.log("after hour selected");
		},
		beforeDone: function() {
			console.log("before done");
		},
		afterDone: function() {
			console.log("after done");
		}
	})
	.find('input').change(function(){
		console.log(this.value);
	});

// Manually toggle to the minutes view
$('#check-minutes').click(function(e){
	// Have to stop propagation here
	e.stopPropagation();
	input.clockpicker('show')
			.clockpicker('toggleView', 'minutes');
});
if (/mobile/i.test(navigator.userAgent)) {
	$('input').prop('readOnly', true);
}
</script>                                          
                                                
                                                
  <script>
		CKEDITOR.replace( 'editor1', {
			height: 150,
			width: 700,
		} );
	</script>    
    
    
<!------------------------Fancybox---------------------------------->
  

<style type="text/css">
	.fancybox-custom .fancybox-skin {
		box-shadow: 0 0 50px #222;
	}
</style> 
<script>
$(document).ready(function() {
	$(".various").fancybox({
		maxWidth	: 480,
		maxHeight	: 410,
		fitToView	: true,
		width		: '100%',
		height		: '100%',
		autoSize	: false,
		closeClick	: false,
		openEffect	: 'none',
		closeEffect	: 'none',
		
		
		
		
	});
	
 
});

</script>

<script>
$(document).ready(function() {
	$(".various01").fancybox({
		maxWidth	: 950,
		maxHeight	: 610,
		fitToView	: true,
		width		: '100%',
		height		: '100%',
		autoSize	: false,
		closeClick	: false,
		openEffect	: 'none',
		closeEffect	: 'none',
		
		
		
		
	});
	
 
});

</script>                              


<script>
$(document).ready(function() {
	$(".various02").fancybox({
		maxWidth	: 890,
		maxHeight	: 610,
		fitToView	: true,
		width		: '100%',
		height		: '100%',
		autoSize	: false,
		closeClick	: false,
		openEffect	: 'none',
		closeEffect	: 'none',
		
		
		
		
	});
	
 
});

</script>               
                                                
    
</body>

</html>