<?php
include("common/connection.php");
//login_check();
$Lead_Req_Id=base64_decode($_REQUEST['Lid']);


$lead_sql="select Lead_Name from lead_master where Lead_ID ='".$Lead_Req_Id."'";
$rs_sql=mysqli_query($con,$lead_sql);
$RowLead=mysqli_fetch_array($rs_sql);

?>

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

<head>
    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <title>Current Leads | KPS Institute of Polytechnic</title>
    <?php include("headerlink.php"); ?> 
    
    <script src="https://cdn.ckeditor.com/4.10.0/standard/ckeditor.js"></script>	
     <link rel="stylesheet" href="css/form/all-type-forms.css">
     
     <script type="text/javascript">
	 function GetEmailContent()
	 {
	    var Email_Name=$('#Email_Name').val();
		var Email_To=$('#Email_To').val();
		
	   // alert(Email_Name);
	    $.ajax({
		url:"ajax_email_content.php",
		type:"POST",
		data:{'Email_Name':Email_Name,'Email_To':Email_To},
		success:function(f)
		{
		  // alert(f);
		
 			$('#Email_Content').val(f);
		}
		});
	 }
	 </script>
     
     <script type="text/javascript">
	 function SendEmail()
	 {
	    var Lead_Id=$('#Lead_Id').val();
		var Email_Name=$('#Email_Name').val();
		
		$.ajax({
		url:"ajax_email_send.php",
		type:"POST",
		data:{'Email_Name':Email_Name,'Lead_Id':Lead_Id},
		success:function(f)
		{
		   //alert(f);
		
 			$('#email_content').hide();
			$('#send_email_msg').show();
			
			
		}
		});
		
		
	 
	 }
	 </script>
 
</head>

<body style="background-color:#e7eff9">




					<div align="center" class="sparkline9-hd" style="background-color:#f9f9f9; padding:10px 0">
                    		<div class="main-sparkline9-hd">
                            		<h1>SEND EMAIL</h1>
                               </div></div>



   								 <div class="heide_1">
                                 <p style="text-align:center;color:#000000"></p>
                                 </div>
    
 
                                     
                                     
                                <div class="main-sparkline9-hd" style=" padding-top:5px;padding-right:10px; background-color:#e7eff9; padding-left:10px; padding-bottom:0px">   			
                                
                               <div id="email_content">
                               
                               <div class="form-group"><label>Email To</label>
                                <input name="Email_To" id="Email_To" class="form-control dt-tb" style="width:100%; displayx:none; background-color:#FFFFFF" value="<?php echo $RowLead['Lead_Name']; ?>" readonly> </div>
                                
                                <input type="hidden" name="Lead_Id" id="Lead_Id" value="<?php echo $Lead_Req_Id; ?>">
                                
                                	
                                <div class="form-group" style="margin-top: 15px"><label>Email Name</label>
                                <select name="Email_Name" id="Email_Name" class="form-control dt-tb" style="width:100%; displayx:none" onChange="GetEmailContent();">
											<option selected value="">Please select email name</option>
                                            
                                            <?php
											$SqlEmilName="select distinct Email_Name,SLN from email_content_master";
											$RsEmailName=mysqli_query($con,$SqlEmilName);
											while($RowEmail=mysqli_fetch_array($RsEmailName))
											{
											?>
											<option  value="<?php echo $RowEmail['SLN']; ?>"><?php echo $RowEmail['Email_Name']; ?></option>
                                            <?php
											}
											?>
											
								</select>
                                </div>
                                     
                              	  <div class="form-group" style="margin-top: 15px"><label>Email Body</label>
                                  <!--<textarea class="form-control dt-tb" style="width:100%; resize:none; height:95px;" name="Email_Content" id="Email_Content"></textarea>-->
                                  
                                  <textarea name="editor1" id="Email_Content"></textarea>
                                  </div>
                                 
                                  <div class="form-group" style="margin-top: 15px">
                                 <input class="btn btn-custon-rounded-three
                                    				btn-primary" type="button" value="Send Email" name="update_status" onClick="SendEmail()"></input></div>
                                                    
                                 </div>
                                 
                                  
                               <div id="send_email_msg" style="text-align:center; color:#006600; font-size:18px; text-transform:uppercase; font-weight:600; padding-top:120px; display:none;">Successfully Sent</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>

      <!-- 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>
    
    
 <script>
$(document).ready(function() {
   $("body").tooltip({ 
   	selector: '[data-toggle=tooltip]' 
	 });
});
 
</script>  

 <!--<script>
CKEDITOR.replace( 'editor1', {
height: 170,
width: 350,
} );
	</script> -->   
     
    
</body>

</html>