<?php
include('common/connection.php');
login_check();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Buurtzorg</title>
 <script src="js/vendor/jquery-1.12.4.min.js"></script>
<style type="text/css">
body{
margin:0px;
padding:0px;
font-family:Arial, Helvetica, sans-serif;
}
.wrapper{
width:100%;
height:auto;
}

.image_div{
float:right;
width:25%;
height:auto;
margin-left:20px;
margin-bottom:20px;
-moz-box-shadow:0px 0px 2px #e2e2e2;
-webkit-box-shadow:0px 0px 2px #e2e2e2;
box-shadow:0px 0px 2px #e2e2e2;
border:5px solid #FFFFFF;
line-height:24px;
font-size:14px;
}

.maindiv{
float:left;
width:100%;
height:auto;
padding:0px 0%;
line-height:28px;
}

.document_details{
float:left;
width:100%;
height:auto;
}

.table_body{
text-align:left;
font-size:13px;
line-height:30px;
height:auto;
padding-left:8px;


}

.heading{
background-color:#2a3f54;
height:35px;
line-height:35px;
color:#FFFFFF;
font-weight:600;
text-align:left;
padding-left:10px;
}

.registant_details_div{
background-color:#f0eded; 
border: 1px solid #eaeaea;
padding:10px;
font-size:14px;
text-align:left;
line-height:24px;
color:#000000;
}


.form_maindiv select{
width: 100%;
height: 40px;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
text-indent: 0.01px;
text-overflow: '';
background: transparent url(img/select-icon1.png) no-repeat scroll 97% 17px;
@media (-webkit-min-device-pixel-ratio: 2), 
(min-resolution: 480dpi) {
background: transparent url(img/select-icon1.png) no-repeat scroll 97% 20px;
font-size: 13px;
font-family: 'Lato', sans-serif;
color:#666666;
width: 100%;
}

.txtbox_div {
    float: left;
    width: 96%;
    height: 40px;
    padding: 0px 2%;
    border: 1px solid rgb(204, 204, 204);
    background: none repeat scroll 0% 0% rgb(240, 239, 240);
    color: rgb(0, 0, 0);
    font-size: 13px;
    line-height: normal;
    border-radius: 2px 2px 2px 2px;
    box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.075) inset;
    font-family: "Helvetica Neue",Roboto,Arial,"Droid Sans",sans-serif;
}




</style>

<style type="text/css">

.verify_maindiv{
    width: 150px;
    height: auto;
    margin: 0px auto;
}

.submit_btn_new{
float:right;
width:100%;
height:40px;
background-color:#1f81c0 !Important;
text-align:center;
color:#FFFFFF;
font-size:14px;
border:0px;border-radius: 2px;
transition: 0.5s all;
cursor:pointer;
border-radius:5px;
}

.submit_btn_new:hover{
background-color:#000000;
}

.error-message{
text-align:center;
font-size:18px;
color:#FF0000;
font-weight:600;
}


.success_message{
text-align:center;
font-size:18px;
font-weight:600;
color:#000000;
}

</style>
<?php
$Lead_Id=base64_decode($_REQUEST['Lid']);
$SqlLead="select * from lead_master where Lead_ID='".$Lead_Id."'";
$RsLead=mysqli_query($con,$SqlLead);
$RowLead=mysqli_fetch_array($RsLead);
?>

<script type="text/javascript">
function AlocateDoctorNurse()
{
//alert(444);
   var doctor_name=$('#doctor_name').val();
   var nurse_name=$('#nurse_name').val();
  
    //alert(doctor_name);
   var lead_id='<?php echo $Lead_Id; ?>';
   
  
   
   if(doctor_name=="" && nurse_name=="")
   {
      
       $('.error-message').text("You have to select aleast one doctor/nurse");
	   return false;
   }
   
  /* if(((first_judge==second_judge) && (first_judge!='' && second_judge!='')) || ((first_judge==third_judge) && (first_judge!='' && third_judge!='')) || ((second_judge==third_judge) && (second_judge!='' && third_judge!='')))
   {
     
   
       $('.error-message').text("You have to select three individual judges");
	   return false;
	   
   }*/
   
  // alert(first_judge);
   
    $.ajax({
  	url:'ajax-allocate-doctor-nurse.php',
	type:'POST',
	data: 'lead_id=' + lead_id + '&doctor_name=' + doctor_name + '&nurse_name=' + nurse_name,
	success:function(f)
	{
	
	  //alert(f);
	   //window.location.href="all-registrant.php";
	   $('#judge_info').hide();
		$('#success_msg').show();
		
			setTimeout( function() {
			//javascript:parent.jQuery.fancybox.close();
			window.parent.location.href="qualified_leads.php";
			},2000);	
		
	}
   })


}
</script>
</head>

<body>

<div class="wrapper">
<div class="maindiv">
<!--<div class="image_div"><img src="../upload_image/passport-size-2.jpg" style="width:100%; height:auto;" /></div>-->
<div class="document_details">


<table width="100%" border="0" id="success_msg" style="display:none;">
  <tr>
    <td class="success_message" style="padding-top:150px; font-size:24px;">Successfully Allocated</td>
  </tr>
</table>





<table width="100%" border="0" cellspacing="0" cellpadding="0" id="judge_info">
  <tr>
    <td class="heading">LEAD DETAILS ( <?php echo $Lead_Id; ?> )</td>
  </tr>
  <tr>
    <td height="10"></td>
  </tr>
  <tr>
    <td class="registant_details_div"><span style="font-size:18px; font-weight:600;"><?php echo $RowLead['Lead_Name']; ?></span><br />
    <strong>Lead Creation Date :</strong> <?php if($RowLead['Lead_Creation_Date']!='0000-00-00') { echo date('d M, Y',strtotime($RowLead['Lead_Creation_Date'])); } ?><br />
    <strong>Phone  :</strong> <?php echo $RowLead['Phone']; ?><br />
    <strong>Email :</strong> <?php echo $RowLead['Email']; ?><br />
    <strong>Source :</strong> <?php echo $RowLead['Form_Source']; ?><br />
    <strong>Priority :</strong> <?php if ($leads_datas['Priority']<=2){echo 'Low';}
												else if ($leads_datas['Priority']<=3){echo 'Moderate';}
												else if($leads_datas['Priority']>3){echo 'High';} ?><br />
 
</td>
  </tr>
 <tr>
    <td height="10"></td>
  </tr>
  
  <tr>
    <td >
    
    <table width="100%" border="0">
  <tr>
    <th scope="col" class="heading" width="45%">Select Doctor</th>
    <th scope="col" width="10%">&nbsp;</th>
    <th scope="col" class="heading" width="45%">Select Nurse</th>
  </tr>
  <tr>
    <td colspan="3" style="height:10px;"></td>
    
  </tr>
  <tr>
    <td><div class="form_maindiv"><select name="doctor_name" class="txtbox_div" id="doctor_name" style="border:0px;  border: 1px solid rgb(204, 204, 204); background-color:#ebe7e7; width:100%;">

<option value="">Select Doctor</option>
<?php
$sql="select SLN,Doctor_Name from doctor_master where Active='Yes'";
$rs=mysqli_query($con,$sql);
while($Row=mysqli_fetch_array($rs))
{
?>
<option value="<?php echo $Row['SLN']; ?>"><?php echo $Row['Doctor_Name']; ?></option>
<?php
}
?>


</select></div></td>
    <td >&nbsp;</td>
    <td><div class="form_maindiv"><select name="nurse_name" class="txtbox_div" id="nurse_name" style="border:0px;  border: 1px solid rgb(204, 204, 204); background-color:#ebe7e7; width:100%;">

<option value="">Select Nurse</option>
<?php
$sqlN="select SLN,Nurse_Name from nurse_master where Active='Yes'";
$rsN=mysqli_query($con,$sqlN);
while($RowN=mysqli_fetch_array($rsN))
{
?>
<option value="<?php echo $RowN['SLN']; ?>"><?php echo $RowN['Nurse_Name']; ?></option>
<?php
}
?>


</select></div></td>
  </tr>
</table>

    
    
    
    
     </td>
  </tr>
 
  
   <tr>
    <td height="10"></td>
  </tr>
  
  <tr>
    <td class="error-message"></td>
  </tr>
  
  
   <tr>
    <td height="10"></td>
  </tr>
  
   <tr>
    <td><div class="verify_maindiv"><input name="Submit" type="button" value="ALLOCATE" class="submit_btn_new" onclick="AlocateDoctorNurse()" /></div></td>
  </tr>
  
</table>




</div>











</div>
</div>
</body>
</html>
