<style type="text/css">
		.card {
		    position: relative;
		    display: -webkit-box;
		    display: -ms-flexbox;
		    display: flex;
		    -webkit-box-orient: vertical;
		    -webkit-box-direction: normal;
		    -ms-flex-direction: column;
		    flex-direction: column;
		    min-width: 0;
		    word-wrap: break-word;
		    background-color: #fff;
		    background-clip: border-box;
		    border: 1px solid #ebedf2;
		    border-radius: 0.25rem;
		    padding: 25px;
		}
		.overlay {
			z-index: 1;
			position: absolute;
			left: 0;
			top: 0;
			bottom: 0;
			right: 0;
			background-color: rgba(255,255,255,.96);
		}
		.overlay .loader {
			z-index: 2;
			position: absolute;			
			left: 50%;
			top: 50%;
			transform: translate(-50%,-50%);
		}
		.overlay .loader span {
			width: 50px;
			height: 50px;
			display: inline-block;
			border: 1px solid rgba(113,106,202,.5);
			border-bottom: 0;
			border-left: 0;
			border-radius: 50px;
			animation: circle 1s linear infinite;
			-webkit-animation: circle 1s linear infinite;
		}
		@keyframes circle {
			0% { transform: rotate(0deg); }
			100% { transform: rotate(-360deg); }
		}
		@-webkit-keyframes circle {
			0% { transform: rotate(0deg); }
			100% { transform: rotate(-360deg); }
		}
	</style>
<!-- begin:: Subheader -->
<div class="kt-subheader   kt-grid__item" id="kt_subheader">
<div class="kt-container  kt-container--fluid ">
    <div class="kt-subheader__main">
        <div class="kt-subheader__breadcrumbs">
            <a class="kt-subheader__breadcrumbs-link">
                Leads </a>
            <span class="kt-subheader__breadcrumbs-separator"></span>
            <a class="kt-subheader__breadcrumbs-link">
                Leads Details </a>
            <span class="kt-subheader__breadcrumbs-separator"></span>
            
        </div>
    </div>
    <div class="kt-subheader__toolbar">        
        <a href="<?=base_url();?>leads/view_leads" class="btn btn-label-brand btn-bold">
         Back</a>
    </div>                                        
</div>
</div>
<!-- begin:: Content -->
<div class="kt-container  kt-container--fluid  kt-grid__item kt-grid__item--fluid form-bg">
   <div class="kt-portlet">
      <div class="kt-portlet__body kt-portlet__body--fit">
	        <div class="kt-portlet__body">  
	            <div class="row">
				   <div class="col-md-12">    
				      <div class="card">
				         <div class="card-header">
				            <h3 class="card-title" id="lead_details" style="float: left;">Lead Details</h3>
				            <div style="float: right;">
					            <a href="javascript:void(0);" id="addActivity" class="btn btn-brand btn-elevate btn-icon-sm"><i class="la la-plus"></i>Activity</a>
								<a href="javascript:void(0);" id="addTask" class="btn btn-brand btn-elevate btn-icon-sm">
								<i class="flaticon2-tag"></i>Task</a>
								<a href="javascript:void(0);" id="salesActivity" class="btn btn-brand btn-elevate btn-icon-sm"><i class="la la-plus"></i>Sales Activity</a>			 
								<input type="hidden" name="lead_id" id="lead_id" value="<?=$lead_details['id']?>">
								<input type="hidden" name="user_id" id="user_id" value="<?=session()->get('user_id');?>">
							</div>
				         </div>
				         <div class="card-body">
				            <div class="table-responsive">
				               <table class="table card-table table-vcenter border text-nowrap">
				                  <thead>
				                     <tr>
				                        <th></th>
				                        <th></th>
				                        <th></th>
				                        <th><strong>Lead Details</strong></th>
				                        <th></th>
				                        <th></th>
				                        <th></th>
				                     </tr>
				                  </thead>
				                  <tbody>
				                    <tr>					                        
				                        <td><strong>Lead Id</strong></td>
				                        <td><strong>Name</strong></td>				
				                        <td><strong>Email</strong></td>				
				                        <td><strong>Mobile</strong></td>					
				                        <td><strong>Course</strong></td>					
				                        <td><strong>State</strong></td>					
				                        <td><strong>City</strong></td>					
				                    </tr>
				                     <tr>
				                     	<td><?=$lead_details['id']?></td>
				                        <td><?=$lead_details['name']?></td>
				                        <td><?=$lead_details['email']?></td>
				                        <td><?=$lead_details['phone']?></td>
				                        <td><?=$lead_details['enquiry_for']?></td>
				                        <td><?=$lead_details['state']?></td>
				                        <td><?=$lead_details['city']?></td>
				                     </tr>
				                      <tr>				                     	
				                        <td>Comment:</td>
				                        <td colspan="6"><?=$lead_details['remarks']?></td>
				                     </tr>						                    
				                  </tbody>
				               </table>
				               <table class="table card-table table-vcenter border text-nowrap">
				                  <thead>
				                  	 <?php $user_type = session()->get('user_type'); ?>
				                     <tr>
				                        <th></th>
				                         <th></th>
				                        <th><strong>Lead Properties</strong></th>                   
				                        <th></th>
				                        <th></th>
				                     </tr>
				                  </thead>
				                  <tbody>
				                    <tr>
				                    	<td><strong>Lead Owner</strong></td>
				                    	<?php if ($user_type == 1 || $user_type == 2) { ?>  
		                                      <td><strong>Lead Source</strong></td> 
		                                <?php }  ?> 
				                        <td><strong>Lead Age</strong></td>					
				                        <td><strong>Lead Stage</strong></td>
				                        <td><strong>Status</strong></td>					
				                    </tr>
				                     <tr>
				                     	<td><?php $center_details    = get_center_by_id($lead_details['user_id']); ?>
				                     		<?=$center_details[0]['user_name'];?>
				                     	</td>				                       
				                        <?php if ($user_type == 1 || $user_type == 2) { ?>  
		                                       <td><?=$lead_details['lead_source'];?></td>
		                                <?php }  ?> 
				                        <td><?php
				                         $validlity = date('Y-m-d', strtotime($lead_details['created_at'].' +30 days'));
				                            $diff = strtotime($validlity) - strtotime(date("Y-m-d H:i:s")); 
				                            echo abs(round($diff / 86400)) .' Days'; 
				                        ?></td>
				                         <td>Open</td> 
				                        <td>
				                        <?php
				                        if($lead_details['status']=='1'){
				                        	echo 'Active';
				                        }else{
				                        	if($lead_details['delete_status']=='1'){
				                        		echo 'Deleted';
				                        	}else{
				                        		echo 'In Active';
				                        	}
				                        }?>
				                        	
				                        </td>				                       
				                     </tr>					                    
				                  </tbody>
				               </table>
				            </div>
				         </div>
				      </div>
				       <div class="card" id="leadActivity">					         
				       </div>
				   </div>
				</div>
			</div>
		</div>
	</div>
</div>
<div id="activity"></div>             