<?php
defined('BASEPATH') OR exit('No direct script access allowed');?>
<!DOCTYPE html>
<head>
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="" />
<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
<!-- bootstrap-css -->
<link rel="stylesheet" href="<?php echo base_url();?>/assets/css/bootstrap.min.css" />
<!-- //bootstrap-css -->
<!-- Custom CSS -->
<link href="<?php echo base_url();?>/assets/css/style.css" rel='stylesheet' type='text/css' />
<link href="<?php echo base_url();?>/assets/css/style-responsive.css" rel="stylesheet"/>
<!-- font CSS -->
<link href='//fonts.googleapis.com/css?family=Roboto:400,100,100italic,300,300italic,400italic,500,500italic,700,700italic,900,900italic' rel='stylesheet' type='text/css'>
<!-- font-awesome icons -->
<link rel="stylesheet" href="<?php echo base_url();?>/assets/assets/css/font.css" type="text/css"/>
<link href="<?php echo base_url();?>/assets/css/font-awesome.css" rel="stylesheet"/> 
<!-- //font-awesome icons -->
<script src="<?php echo base_url();?>/assets/js/jquery2.0.3.min.js"></script>
</head>
<body>
<section id="container">
<!--header start-->
<header class="header fixed-top clearfix">
<!--logo start-->
<div class="brand">
    <a href="<?php echo base_url();?>home/dashboard" class="logo">
        <img src="" style="  display: block;  margin-left: auto;  margin-right: auto;  width: 80%;margin-top: -22px;"/>
    </a>
    <div class="sidebar-toggle-box">
        <div class="fa fa-bars"></div>
    </div>
</div>
<!--logo end-->
<?php include_once 'common/notification_bar.php';?>
<?php include_once 'common/aside.php';?>
<section id="main-content">
	<section class="wrapper">
		<div class="table-agile-info">
  <div class="panel panel-default">
    <div class="panel-heading">
     College List
    </div>
    <div class="row w3-res-tb">
      <form method="post" action="<?php echo base_url();?>home/college_list">
      <div class="col-sm-12 m-b-xs">
	  <input type="text" name="name" style="margin:5px;" placeholder="By Name" class="col-sm-4 input-sm form-control w-sm inline v-middle" value="<?php if($filter_data['name']!=''){echo $filter_data['name'];}?>"/>
	  
	  <input type="text" name="added_on" style="margin:5px;" placeholder="by created date" class="col-sm-4 input-sm form-control datepicker1 w-sm inline v-middle" value="<?php if($filter_data['added_on']!=''){echo $filter_data['added_on'];}?>"/>
		
		<div class="clearfix"></div>
        <button class="btn btn-sm btn-primary" name="submit" >Apply</button>                
        <a href="<?php echo base_url();?>home/reset" class="btn btn-sm btn-default">Reset</a> 
<input class="btn btn-sm btn-default assign" type="submit" value="Delete" />		
      </div>
      </form>
    </div>
    <div class="table-responsive"><p id="msg"></p>
	<?php echo $this->session->flashdata('msg'); ?> <br/>
      <table class="table table-striped b-t b-light">
        <thead>
          <tr>
            <th style="width:20px;">
              <label class="i-checks m-b-none">
                <input type="checkbox" class="assignmentAll"><i></i>
              </label>
            </th>
            <th>Name</th>
            <th>City</th>
            <th>State</th>
            <th>Status</th>
            <th>Date</th>
           <?php $user=$this->session->userdata('user_login');
		   if($user[0]['user_type']!=3){ ?>
		   <th >Action</th>
		   <?php } ?>
          </tr>
        </thead>
        <tbody>
		<?php foreach($leads as $get){?>
          <tr>
           <td><label class="i-checks m-b-none"><input type="checkbox" type="checkbox" name="select_<?php echo $get->id ?>" class="assignment <?php echo $get->phone; ?>" id="select_<?php echo $get->id ?>" value="<?php echo $get->id; ?>" ><i></i></label></td>
            <td><input type="text" value="<?php echo $get->name;?>" class="form-control ctrl" name="name" id="name_<?php echo $get->id;?>" style="width: 100px !important;"/></td>
            <td><select class="form-control ctrl" name="city" required="" id="city_<?php echo $get->id;?>" style="width: 100px !important;">
											<option value="">Select City</option>
											<?php foreach(getCity() as $gets){?>
											<option  <?php if($gets->id==$get->city){echo "selected";}?> value="<?php echo $gets->id;?>-<?php echo $gets->state_name;?>"><?php echo $gets->city_name;?></option>
											<?php } ?>
											</select></td>
			 <td><input type="text" value="<?php echo $get->state;?>" class="form-control ctrl" name="state" id="state_<?php echo $get->id;?>" style="width: 100px !important;"/></td>
									
            <td><select class="form-control ctrl" name="status" required="" id="status_<?php echo $get->id;?>" style="width: 100px !important;">
											<option value="">Select Status</option>
											<option  <?php if('Active'==$get->status){echo "selected";}?> value="Active">Active</option>
											<option  <?php if('Inactive'==$get->status){echo "selected";}?> value="Inactive">Inactive</option>
											</select></td>
            <td><?php echo $get->added_on;?></td>
             <?php $user=$this->session->userdata('user_login');
		   if($user[0]['user_type']!=3){ ?><td>
              <a id="updaterow_<?php echo $get->id;?>" class="active updaterow" style="cursor:pointer" ui-toggle-class=""><i class="fa fa-check text-success text-active"></i></a>
			   <a href="<?php echo base_url();?>home/deletecollege/<?php echo $get->id;?>" class="active" ui-toggle-class=""><i class="fa fa-times text-danger text"></i></a>
            </td>
		   <?php } ?>
          </tr>
		<?php } ?>
        </tbody>
      </table>
    </div>
 <footer class="panel-footer">
      <div class="row">
       <div class="col-sm-6 ">          
           <ul class="pagi-nation" style="float: right;">
			<li><?php echo $links; ?></li>
		</ul>
		  
        </div>
      </div>
    </footer>
  </div>
</div>
</section>
 <!-- footer -->
 <style>
.footnav{display:none;}
@media(max-width:750px){
.footnav{display:block;}	
}
</style>

<div style="width:100%;padding:16px;background:#1a20c3;color:#fff;position:fixed;bottom:0px;border-top:3px solid #d01525" class="footnav">
<?php if($userid[0]['user_type']==1){?>
<a href="<?php echo base_url();?>home/dashboard" style="color:#fff;margin:0 15px 0 15px;"><i class="fa fa-dashboard" > Dashboard</i></a>
<a href="<?php echo base_url();?>home/lead_info" style="color:#fff;margin:0 15px 0 15px;"><i class="fa fa-list-alt" > Leads</i></a>
<a href="<?php echo base_url();?>home/report" style="color:#fff;margin:0 15px 0 15px;"><i class="fa fa-bar-chart" > Report</i></a>
<a href="<?php echo base_url();?>home/logout" style="color:#fff;margin:0 15px 0 15px;"><i class="fa fa-sign-out" > logout</i></a>
<?php } ?>
<?php if($userid[0]['user_type']==2){?>
<a href="<?php echo base_url();?>home/dashboard" style="color:#fff;margin:0 15px 0 15px;"><i class="fa fa-dashboard" > Dashboard</i></a>
<a href="<?php echo base_url();?>home/lead_info" style="color:#fff;margin:0 15px 0 15px;"><i class="fa fa-list-alt" > Leads</i></a>
<a href="<?php echo base_url();?>home/my_team" style="color:#fff;margin:0 15px 0 15px;"><i class="fa fa-list" > My Team</i></a>
<a href="<?php echo base_url();?>home/logout" style="color:#fff;margin:0 15px 0 15px;"><i class="fa fa-sign-out" > logout</i></a>
<?php } ?>
<?php if($userid[0]['user_type']==3){?>
<a href="<?php echo base_url();?>home/dashboard" style="color:#fff;margin:0 15px 0 15px;"><i class="fa fa-dashboard" > Dashboard</i></a>
<a href="<?php echo base_url();?>home/lead_info" style="color:#fff;margin:0 15px 0 15px;"><i class="fa fa-list-alt" > Leads</i></a>
<a href="<?php echo base_url();?>home/logout" style="color:#fff;margin:0 15px 0 15px;"><i class="fa fa-sign-out" > logout</i></a>
<?php } ?>
</div>
		  <div class="footer">
			<div class="wthree-copyright">
			 	<p >Develped by <a href="https://www.tenacioushub.com/" target="_blank"><img src="<?php echo base_url;?>/assets/images/logo.png" style="height:25px;"/></a></p>
			</div>
		  </div>
  <!-- / footer -->
</section>

<!--main content end-->
</section>
<script src="<?php echo base_url();?>/assets/js/bootstrap.js"></script>
<script src="<?php echo base_url();?>/assets/js/jquery.dcjqaccordion.2.7.js"></script>
<script src="<?php echo base_url();?>/assets/js/scripts.js"></script>
<script src="<?php echo base_url();?>/assets/js/jquery.slimscroll.js"></script>
<script src="<?php echo base_url();?>/assets/js/jquery.nicescroll.js"></script>
<!--[if lte IE 8]><script language="javascript" type="text/javascript" src="js/flot-chart/excanvas.min.js"></script><![endif]-->
<script src="<?php echo base_url();?>/assets/js/jquery.scrollTo.js"></script>
<script>
$(document).on("click",".updaterow",function(){
 var rowid=$(this).attr('id');
 var str = rowid.split('_');
var name = $("#name_"+str[1]).val(); 
var city = $("#city_"+str[1]).val();  
var status = $("#status_"+str[1]).val(); 
$.ajax({
									type: "POST",
									url:window.location.origin+"/baga/index.php/home/updatecollege/",
									data:{"id":str[1],"name":name,"city":city,"status":status},
									success: function(data){
									$("#msg").addClass("alert alert-success").text('College Updated');							
									}
									});	
});
</script>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
	  <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.8.0/js/bootstrap-datepicker.min.js"></script>
	  <script src="<?php echo base_url;?>/assets/assets/js/datetimepicker.min.js"></script>
	  <script type="text/javascript">
	  $("body").on("click", ".datetimepicker1", function(){
    $(this).datetimepicker({
    timezone: 'Asia/Kolkata',
    format: 'yyyy-mm-dd hh:ii:ss',
	startDate: '-0m',
    autoclose: true
    }); });
	$('.datepicker1').datepicker({
    format: 'yyyy-mm-dd',
    autoclose: true
    });
$(document).ready(function(){
$(".assignmentAll").click(function(){
         if(this.checked){
   $(".assignment").prop('checked', true);   
        }else{
 $(".assignment").prop('checked', false); 
        }
    });
	 });
	$(".assign").click(function(){
	 var leads = [];
    $(".assignment:checked").each(function(){            
     leads.push($(this).val());
    });
	if(leads.length==0){
		$("#error_msg").show().text('select leads to assign');
	}else{$("#error_msg").show().text('');}
	if($("#error_msg").show().text()==''){
		  $.ajax({
			   type:'POST',
			   url: window.location.origin+'/real-estate-demo/index.php/home/deleteProperty/',
			   data : {'leads':leads},
			   dataType:'json',
			   success: function(data){	
			   	$("#student_succ").html(data.message);					
                    window.location.reload();
				
				  }
	});
	//ConfirmDialog('Are you sure','Assign Confirmation',counsellor,leads);	
	}
});
        </script>
		<style>
.pagi-nation {
    width: 100%;
    float: left;
    margin: 0px;
    padding: 0px;
    list-style-type: none;
    text-align: center;
}
ul, li, li a {
    list-style: none;
        list-style-type: none;
    margin: 0;
    padding: 0;
}
.pagi-nation li strong {
    background-color: #086099;
    border: 1px solid;
    border-radius: 5px;
    padding: 0.1em 0.5em;
    color: #fff;
}

element {

}
.pagi-nation li a {

    background-color: #ccc;
    border: 1px solid #7A7878;
    border-radius: 5px;
    padding: 0.1em 0.5em;
    color: #000;

}
</style>
</body>
</html>
