<?php
session_start();
include 'actions/dbconnection.php';

$sql = "SELECT * FROM leads where sno=".$_GET['sno']."";
$result = $conn->query($sql);

?>

<!DOCTYPE html>
<html lang="en">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="" />
    <meta name="keywords" content="" />
	<title>Wisibles</title>
    <link rel="icon" href="images/fav-icon.svg" type="image/svg" sizes="16x16"> 
    
    <link rel="stylesheet" href="css/main.min.css">
    <link rel="stylesheet" href="css/style.css">
    <link rel="stylesheet" href="css/color.css">
    <link rel="stylesheet" href="css/responsive.css">
	<link href="plugins/apex/apexcharts.css" rel="stylesheet" type="text/css">

</head>
<body>
<div class="page-loader" id="page-loader">
	 <div class="lds-ellipsis"><div></div><div></div><div></div><div></div></div>
	 <span>Loading...</span>
</div><!-- page loader -->
<div class="theme-layout">
	
	<?php include 'header.php'; ?>
	<div class="top-sub-bar">
		<div class="container-fluid">
			<div class="row">
				<div class="col-lg-6 col-md-6 col-sm-6">
					<div class="menu-btn">
						<i class="">
                           <svg id="menu-btn" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-menu"><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="18" x2="21" y2="18"></line></svg></i>
					</div>
<!--
					<div class="page-title d-none d-sm-block">
						<h4>Lead Management</h4>
					</div>
-->
				</div>
				<div class="col-lg-6 col-md-6 col-sm-6">
					<ul class="breadcrumb">
						<li><a href="#" title="">Home</a></li>
						<li><a href="#" title="">Lead Management</a></li>
					</ul>
				</div>
			</div>
		</div>	
	</div><!-- top sub bar -->
	<?php include 'left_menu.php'; ?>
	

	<div class="container-fluid">
		<div class="row">
			<?php 
			while($row = $result->fetch_assoc()){
			?>
            <form action="actions/edit_leads_exec.php" method="post" enctype="multipart/form-data">
			<div class="col-lg-12">
				<div class="panel-content">
					<h4 class="main-title"></h4>
					<div class="row merged20 mb-4">
						
						<div class="col-lg-12">
						
							
								 	<div class="streamline ">
										
        <div class="col-lg-11">
				<div class="panel-content1 ">
				
					<div class="row merged20 mb-4">
						
						<div class="main-wraper1 ">
                            <div class="tab-content" id="components-nav">
                                <!-- settings -->
                                <div class="tab-pane active fade show" id="account">
									<div class="uk-width">
										<div class="setting-card">
											<h3>Edit Lead</h3>
											<br>
											<p style="color:red"><?php if(isset($_GET['msg']))  echo $_GET['msg'];  ?></p>
												<fieldset class="row merged-10">
												<input type="hidden" class="uk-input" placeholder="sno" name="sno" value="<?php echo $row['sno']; ?>">    
												<input type="hidden" class="uk-input" placeholder="Source" name="source" value="<?php echo $row['source'] ?>">
                                                <input type="hidden" class="uk-input" placeholder="Assigned By" name="assign_by" value="<?php echo $row['assign_by'] ?>">
                                                <input type="hidden" class="uk-input" placeholder="Status" name="status" value="Pending" value="<?php echo $row['status'] ?>">
                                               

													<div class="mb-4 col-lg-6">
														<input class="uk-input" type="text" placeholder="Date" onfocus="(this.type='date')" onblur="(this.type='text')" name="date" value="<?php echo $row['date'] ?>" required>
													</div>
													<div class="mb-4 col-lg-6">
														<input class="uk-input" type="text" placeholder="Name" name="name" value="<?php echo $row['name'] ?>" required>
													</div>
													<div class="mb-4 col-lg-6">
														<input class="uk-input" type="text" placeholder="Mobile" name="mobile" value="<?php echo $row['mobile'] ?>" required>
													</div>
                                                    
                                                    <div class="mb-4 col-lg-6">
														<input class="uk-input" type="email" placeholder="Email" name="email" value="<?php echo $row['email'] ?>" required>
													</div>


                                                    
                                                    <div class="mb-4 col-lg-6">
														<input class="uk-input" type="text" placeholder="Sales Person Name" name="s_person" value="<?php echo $row['s_person'] ?>" required>
													</div>
													
                                                    <div class="mb-4 col-lg-6">
														<select name="lead_source" required style="width:470px;">
                                                            <option value="">Lead Source</option>
                                                            <option value="Inside Sales" <?php  if($row['lead_source']=='Inside Sales'){?>selected<?php }?>>Inside Sales</option>
                                                            <option value="Sales Team" <?php  if($row['lead_source']=='Sales Team'){?>selected<?php }?>>Sales Team</option>
                                                            <option value="Channel Partner" <?php  if($row['lead_source']=='Channel Partner'){?>selected<?php }?>>Channel Partner</option>
															<option value="Digital Marketing" <?php  if($row['lead_source']=='Digital Marketing'){?>selected<?php }?>>Digital Marketing</option>
                                                            <option value="Referrals" <?php  if($row['lead_source']=='Referrals'){?>selected<?php }?>>Referrals</option>
                                                            <option value="Trade Shows and Events" <?php  if($row['lead_source']=='Trade Shows and Events'){?>selected<?php }?>>Trade Shows and Events</option>
															<option value="Inbound Calls" <?php  if($row['lead_source']=='Inbound Calls'){?>selected<?php }?>>Inbound Calls</option>
                                                        </select>
													</div>

                                                    <div class="mb-4 col-lg-6">
														<input class="uk-input" type="text" placeholder="State" name="state" value="<?php echo $row['state'] ?>" required>
													</div>

													<div class="mb-4 col-lg-6">
														<input class="uk-input" type="text" placeholder="District" name="district" value="<?php echo $row['district'] ?>" required>
													</div>




													<div class="mb-4 col-lg-6">
														<input class="uk-input" type="text" placeholder="School Name" name="school_name" value="<?php echo $row['school_name'] ?>" required>
													</div>

													<div class="mb-4 col-lg-6">
														<input class="uk-input" type="text" placeholder="School Type" name="school_type" value="<?php echo $row['school_type'] ?>" required>
													</div>

													<div class="mb-4 col-lg-6">
														<input class="uk-input" type="text" placeholder="Establishment Year" name="establishment_year" value="<?php echo $row['establishment_year'] ?>" required>
													</div>

													<div class="mb-4 col-lg-6">
														<input class="uk-input" type="text" placeholder="School Address" name="school_address" value="<?php echo $row['school_address'] ?>" required>
													</div>

													<div class="mb-4 col-lg-6">
														<input class="uk-input" type="text" placeholder="Board of Affiliation" name="affiliation" value="<?php echo $row['affiliation'] ?>" required>
													</div>




													<div class="mb-4 col-lg-6">
														<input class="uk-input" type="text" placeholder="UDISE Code" name="udise" value="<?php echo $row['udise'] ?>" required>
													</div>

													<div class="mb-4 col-lg-6">
														<input class="uk-input" type="text" placeholder="No of Students" name="students" value="<?php echo $row['students'] ?>" required>
													</div>

													<div class="mb-4 col-lg-6">
														<input class="uk-input" type="text" placeholder="Potential WSU" name="potential" value="<?php echo $row['potential'] ?>" required>
													</div>

													<div class="mb-4 col-lg-6">
														<select name="lead_status" required style="width:470px;">
                                                            <option value="">Lead Status</option>
															<option value="Hot" <?php  if($row['lead_status']=='Hot'){?>selected<?php }?>>Hot</option>
                                                            <option value="Cold" <?php  if($row['lead_status']=='Cold'){?>selected<?php }?>>Cold</option>
                                                            <option value="Demo Scheduled" <?php  if($row['lead_status']=='Demo Scheduled'){?>selected<?php }?>>Demo Scheduled</option>
                                                            <option value="Demo Done" <?php  if($row['lead_status']=='Demo Done'){?>selected<?php }?>>Demo Done</option>
                                                            <option value="Proposal Sent" <?php  if($row['lead_status']=='Proposal Sent'){?>selected<?php }?>>Proposal Sent</option>
															<option value="Agreement Sent" <?php  if($row['lead_status']=='Agreement Sent'){?>selected<?php }?>>Agreement Sent</option>
                                                            <option value="Negotiation" <?php  if($row['lead_status']=='Negotiation'){?>selected<?php }?>>Negotiation</option>
                                                            <option value="Finance Pending" <?php  if($row['lead_status']=='Finance Pending'){?>selected<?php }?>>Finance Pending</option>
															<option value="Closed-Won" <?php  if($row['lead_status']=='Closed-Won'){?>selected<?php }?>>Closed-Won</option>
                                                            <option value="Closed-Lost" <?php  if($row['lead_status']=='Closed-Lost'){?>selected<?php }?>>Closed-Lost</option>
															
                                                        </select>
													</div>




													<div class="mb-4 col-lg-6">
														<input class="uk-input" type="text" placeholder="Products Signed" name="products_signed" value="<?php echo $row['products_signed'] ?>" required>
													</div>

													<div class="mb-4 col-lg-6">
														<input class="uk-input" type="text" placeholder="Total Signed WSU" name="total_signed" value="<?php echo $row['total_signed'] ?>" required>
													</div>

													<div class="mb-4 col-lg-6">
														<input class="uk-input" type="text" placeholder="Remark" name="remark" value="<?php echo $row['remark'] ?>" required>
													</div>

													<div class="mb-4 col-lg-6">
														<input class="uk-input" type="text" onfocus="(this.type='date')" onblur="(this.type='text')" placeholder="Sign-Up Payment Date" name="payment_date" value="<?php echo $row['payment_date'] ?>" required>
													</div>

													<div class="mb-4 col-lg-6">
														<input class="uk-input" type="text" placeholder="Sign-Up Amount" name="signup_amount" value="<?php echo $row['signup_amount'] ?>" required>
													</div>




													<div class="mb-4 col-lg-6">
														<input class="uk-input" type="text" placeholder="Mode of Payment" name="payment_mode" value="<?php echo $row['payment_mode'] ?>" required>
													</div>
													<div class="mb-4 col-lg-6">
														<input class="uk-input" type="text" placeholder="Payment ID" name="payment_id" value="<?php echo $row['payment_id'] ?>" required>
													</div>
													<div class="mb-4 col-lg-6">
														<input class="uk-input" type="text" placeholder="Payment Remark" name="payment_remark" value="<?php echo $row['payment_remark'] ?>" required>
													</div>
													<div class="mb-4 col-lg-6">
														<input class="uk-input" type="text" placeholder="Drop School WSU" name="school_wsu" value="<?php echo $row['school_wsu'] ?>" required>
													</div>

													<div class="mb-4 col-lg-6">
														<input class="uk-input" type="text" placeholder="One Time Implementation Fees" name="implementation_fees" value="<?php echo $row['implementation_fees'] ?>" required>
													</div>




													<div class="mb-4 col-lg-6">
														<input class="uk-input" type="text" placeholder="One Time Customisation Fees" name="customisation_fees" value="<?php echo $row['customisation_fees'] ?>" required>
													</div>
													<div class="mb-4 col-lg-6">
														<input class="uk-input" type="text" placeholder="Subscription Fees (PSPY)" name="subscription_fees" value="<?php echo $row['subscription_fees'] ?>" required>
													</div>
													<div class="mb-4 col-lg-6">
														<input class="uk-input" type="text" placeholder="GST (included/excluded)" name="gst" value="<?php echo $row['gst'] ?>" required>
													</div>
													<div class="mb-4 col-lg-6">
														<input class="uk-input" type="text" placeholder="Training Fees (Per session)" name="training_fees" value="<?php echo $row['training_fees'] ?>" required>
													</div>
                                             
													
													
													<div class="mb-0 col-lg-12">
													<br>
														<button type="submit" class="button primary circle">Edit Lead</button>
													</div>	
												</fieldset>
											
										</div>
									</div>
                                </div>
                                
                            </div>
                        </div>
					</div>	
				</div>
			</div>

									
									</div>	
								
							
						</div>
					</div>	
				</div>
			</div>
         </form>

		 <?php } ?>
		</div>
	</div>
	
	<!-- side slide message & popup -->
</div>
	
	<script src="js/main.min.js"></script>
	<script src="js/vivus.min.js"></script>
	<script src="js/script.js"></script>
	
	<script src="plugins/apex/apexcharts.min.js"></script>
	<script src="js/graphs-scripts.js"></script>

	

</body>	

</html>