<?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/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="form-w3layouts">
            <!-- page start-->
          <div class="row">
                <div class="col-lg-12">
                    <section class="panel">
                        <header class="panel-heading">
                        Upload Leads
                            <span class="tools pull-right">
                                <a class="fa fa-chevron-down" href="javascript:;"></a>
                              
                             </span>
                        </header>
                        <div class="panel-body">
                            <div class="form">
						<?php echo $this->session->flashdata('msg'); ?> <br/>
						<div class="text-center"><?php echo $this->session->flashdata('message');?></div>
                                <form class="cmxform form-horizontal "  method="post" enctype="multipart/form-data" action="<?php echo base_url();?>home/upload_lead" novalidate="novalidate">
                                    <div class="form-group ">
                                        <div class="col-lg-4">
                                            <input class=" form-control" id="name" name="csv" type="file" value="" required="">
                                        </div>
										<label for="Username" class="control-label col-lg-2">Download template</label>
                                        <div class="col-lg-4">
                                            <a href="<?php echo base_url();?>/assets/uploads/template_upload.csv" target="_blank"  class="btn btn-primary" >Download</a>
                                        </div>
									 </div>
                                  
							
                                    <div class="form-group">
                                        <div class="col-lg-offset-3 col-lg-6">
                                            <button class="btn btn-primary" type="submit" name="submit">Upload</button>
                                           <a href="<?php echo base_url();?>home/reset" class="btn btn-sm btn-default">Reset</a>
                                        </div>
                                    </div>
                                </form><br/><br/>
<div class="tabledataf" style="height:400px;overflow-y:scroll;display:none;"></div>
<div style="height:400px;overflow-y:scroll;" class="tabledatas">
<?php if(!empty($_SESSION['heading']) && (count($_SESSION['heading']) > 0)){?>	
<form method="post" action="<?php echo base_url()?>home/updatesource">
      <div class="col-lg-3">
                                            <select class="form-control" name="college" required="">
											<option value="">Select College</option>
											<?php foreach(getColleges() as $get){?>
											<option value="<?php echo $get->id;?>"><?php echo $get->name;?> | <?php echo $get->state;?></option>
											<?php } ?>
											</select>
                                        </div>
										      <div class="col-lg-3">
                                            <select class="form-control" name="course" required="">
											<option value="">Select Courses</option>
											<?php foreach(getProjects() as $get){?>
											<option value="<?php echo $get->id;?>"><?php echo $get->name;?></option>
											<?php } ?>
											</select>
                                        </div>
                                        <div class="col-lg-3">
                                            <select class="form-control" name="source_id" required="">
											<option value="">Select Source</option>
											<?php foreach(getSource() as $get){?>
											<option value="<?php echo $get->id;?>"><?php echo $get->source;?></option>
											<?php } ?>
											</select>
                                        </div>
                                        <div class="col-lg-3">
                                            <select class="form-control" name="caller_id" >
										<option value="">Select Caller</option>
											<?php $userid=$this->session->userdata('user_login');
											foreach(getCaller($userid[0]['id'],$userid[0]['user_type']) as $get){?>
											<option <?php if($filter_data['caller_id']==$get->id){echo "selected";}?> value="<?php echo $get->id;?>"><?php echo $get->username;?></option>
											<?php } ?>
											</select>
                                        </div>										
   <div class="col-lg-3">
                                            <button class="btn btn-primary updatesource" type="submit" name="submit">Update</button>
                                         
                                        </div>										
</form><br/><br/>
<table style="border:1px solid;width:100%;" >
<tr>
<?php foreach($_SESSION['heading'] as $head){?>
<td style="border:1px solid;"> <b><?php if($head=='partner_name'){echo $partnerblock=$head;}else{echo $head;}; ?></b></td>
<?php } ?>
<td style="border:1px solid;"> <b>Valid Flag</b></td>

</tr>
<?php for($i=0;$i<count($uploaddata);$i++){
?>
<tr <?php if($uploaddata[$i]->valid_flg=='DEL'){echo "style='background:red;'";}?>><?php
foreach($uploaddata[$i] as $key =>$datas){
?>
<td style="border:1px solid;padding:4px;">
<?php echo $datas; ?>
</td>
<?php
}?>

</tr><?php } ?>
</table>
<form method="post" action="<?php echo base_url()?>home/uploadlead">
  <div class="col-lg-offset-3 col-lg-6">
                                            <button class="btn btn-primary" type="submit" name="submit">Add Lead</button>
                                        
                                        </div>										
</form>	
<?php } ?>
</div>				
						</div>
                        </div>
                    </section>
                </div>
            </div>
            <!-- page end-->
        </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>

</body>
</html>
