<?php
$msg = '';

include("include/settings.php");
include("checksession.php");


$memberdetailmaster = $mysqli->prepare("select * from rishta_leadmaster where lead_id=?");
$memberdetailmaster->bind_param("i", $_GET['leadid']);
$memberdetailmaster->execute();
$memberdetailresult = $memberdetailmaster->get_result();

			/* Mail to member when he gets registered */
			$mail_from="harkaran@3gcallnet.com";
			$mailTo=$_POST['txtemail'];
			$mailFrom=$mail_from;
			$mailSubject=$_POST['txtSubject'];  
				$mailBody='<html>
					<body style="background-color:#ddd; padding:0; margin:0; font-family:Verdana, Geneva, sans-serif; font-size:14px;">
						<section align="center">
							<div style="width:100%; max-width:710px; margin:auto; background:#fff; text-align: left;">
								<table style="width:100%;" border="0" cellspacing="0">
									<tr style="background-color:#cd5547;">
										<td style="width:30%; padding:10px 0 10px 35px;">
											<img src="'.$newsletterurl.'images/mail-logo.png" style="width:100%; max-width:68px; height:68px;">
										</td>
										<td style="width:70%; padding:10px 35px 10px 0 ;">
											<p style="text-align:right; color:#fff;">        
												<strong style="font-size:20px;">24x7 Support</strong><br/>
												+91-8968288460<br/>+91-8968288460<br/>
												<span style="color:#fff!important">info<span>@</span>Rista Dipot<span>.</span>in</span>
											</p>
										</td>
									</tr>
								</table>
								<div style="margin-bottom:30px;padding: 40px 30px 10px;">
									<p>
										'.$_POST['txtMessage'].'<br/><br/><br/> 
									</p>
								</div>

								<div style="background-color:#333; padding:40px 0;">
									<p style="text-align:center; color:#fff; font-size:12px; line-height:20px;">
										<a href="https://www.facebook.com/"><img src="'.$newsletterurl.'images/fb.png" style="margin-right:5px; margin-bottom:5px;"></a>
										<a href="https://twitter.com/"><img src="'.$newsletterurl.'images/twitter.png" style="margin-right:5px; margin-bottom:5px;"></a>
										<a href="https://www.linkedin.com/in/"><img src="'.$newsletterurl.'images/linked-in.png" style="margin-bottom:5px;"></a>
										<br/>
										Contact Address : Rista Dipot, Sector 82,  Mohali, 160071, Punjab, India<br/>&copy; Copyright 2020-2030 | Rista Dipot.<br/>All rights reserved
									</p>
								</div>
							</div>    
						</section>	
					</body>
				</html>';
						
				//		 Set content-type header for sending HTML email 
						
                        $headers = "MIME-Version: 1.0" . "\r\n"; 
                       $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n"; 

                     mail($mailTo,$mailSubject,$mailBody,$headers);

?>
<!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">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>3cx Calling Report - Rishta Depot</title>
  <?php include('./include/meta.php'); ?>

</head>

<?php include('./include/header.php'); ?>
  
  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
	  <div class="container-full">
		<!-- Content Header (Page header) -->
		<div class="content-header">
			<div class="d-flex align-items-center">
				<div class="me-auto">
					<h4 class="page-title">Data Tables</h4>
					<div class="d-inline-block align-items-center">
						<nav>
							<ol class="breadcrumb">
								<li class="breadcrumb-item"><a href="#"><i class="mdi mdi-home-outline"></i></a></li>
								<li class="breadcrumb-item" aria-current="page">Tables</li>
								<li class="breadcrumb-item active" aria-current="page">Data Tables</li>
							</ol>
						</nav>
					</div>
				</div>
				
			</div>
		</div>

		<!-- Main content -->
		<section class="content">
		  <div class="row">
			<div class="col-12">


    <div id="cover1">
        <div class="my_overlay_div">
            <div class="messsagedata">
                <div id="idMsg1">Email Send<br/>Please don't refresh the browser.</div>
            </div>
        </div>
    </div>







			  <!-- /.box -->          
			</div>
			<!-- /.col -->
		  </div>
		  <!-- /.row -->
		</section>
		<!-- /.content -->
	  
	  </div>
  </div>
  <!-- /.content-wrapper -->
  
  <script>
    function getLeads() {

        var txtFromDate = $('#txtFromDate').val();
        var txtToDate = $('#txtToDate').val();
        var txtSearch = $('#txtSearch').val();

        var ddlUserId = $('#ddlUserId').val();

    


        $('#loading').css('display', '');
        $.ajax({
            url: '3cx_total_ajax.php',
            type: 'post',
            data: {
                ddlUserId: ddlUserId,

            
                txtFromDate: txtFromDate,
                txtToDate: txtToDate,
                txtSearch: txtSearch,
      
            },
            datatype: 'html',
            success: function (rsp) {
                $('#ajaxcoursedata').html(rsp);
                $('#loading').css('display', 'none');
            }
        });
    }
    
    
 function getLeadsPagination(page_skip) {
        var txtFromDate = $('#txtFromDate').val();
        var txtToDate = $('#txtToDate').val();
        var txtSearch = $('#txtSearch').val();
       
        var ddlUserId = $('#ddlUserId').val();

        $('#loading').css('display', '');
        $.ajax({
            url: '3cx_total_ajax.php',
            type: 'post',
            data: {"ddlUserId": ddlUserId, "txtFromDate": txtFromDate, "txtToDate": txtToDate, "txtSearch": txtSearch, "page_skip": page_skip},
            datatype: 'html',
            success: function (rsp) {
                $('#ajaxcoursedata').html(rsp);
                $('#loading').css('display', 'none');
            }
        });
    }


    function changeLeadAllocation(executive_id, lead_id) {
        $('#loading').css('display', '');
        $.ajax({
            url: 'allocate_lead.php',
            type: 'post',
            data: {"executive_id": executive_id, "lead_id": lead_id},
            datatype: 'html',
            success: function (rsp) {
                $('#loading').css('display', 'none');
            }
        });
    }

  

    $(document).ready(function () {
        $("#txtFromDate,#txtToDate").datepicker({
            //dateFormat: 'yy-mm-dd',
			dateFormat: 'mm/dd/yy'
            // minDate: 0, // 0 days offset = today
        });
    });
</script>
  
   <?php include('./include/footer.php'); ?>