<?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"/> 
<link rel="stylesheet" href="<?php echo base_url();?>assets/css/morris.css" type="text/css"/>
<!-- calendar -->
<link rel="stylesheet" href="<?php echo base_url();?>assets/css/monthly.css">
<!-- //calendar -->
<!-- //font-awesome icons -->
<script src="<?php echo base_url();?>assets/js/jquery2.0.3.min.js"></script>
<script src="<?php echo base_url();?>assets/js/raphael-min.js"></script>
<script src="<?php echo base_url();?>assets/js/morris.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';?>

<!--sidebar end-->
<!--main content start-->
<section id="main-content">
	<section class="wrapper">
	<?php //print_r($userid);?>
		<!-- //market-->
		<div class="market-updates">
			<div class="col-md-2 market-update-gd">
				<div class="market-update-block clr-block-1"  style="height:170px;">
					<div class="col-md-4 market-update-right">
						<i class="fa fa-eye"> </i>
					</div>
					<a href="<?php if($userid[0]['user_type']==2){ echo base_url();?>home/my_team<?php } else{ echo base_url();?>home/lead_info<?php } ?>">
					<div class="col-md-8 market-update-left">
					 <h4>Total Leads</h4>
					<h3><?php if($userid[0]['user_type']==2){
					$d=leadListcountstl();	
					}else{$d=leadListcounts();
					}
					echo count($d);?></h3>
					<p><i class="fa fa-long-arrow-right"></i></p>
				  </div></a>
				  <div class="clearfix"> </div>
				</div>
			</div>
			<div class="col-md-2 market-update-gd">
				<div class="market-update-block clr-block-4"  style="height:170px;">
					<div class="col-md-4 market-update-right">
						<i class="fa fa-eye"> </i>
					</div>
					 <form method="post" action="<?php if($userid[0]['user_type']==2){ echo base_url();?>home/my_team<?php } else{ echo base_url();?>home/lead_info<?php } ?>"><div class="col-md-8 market-update-left">
					 <h4>Follow Ups</h4>
					<h3><?php  if($userid[0]['user_type']==2){
					 $d=leadListcountstl(26);	echo count($d);
					}else{echo count(leadListcounts(26));}?></h3>
						<input type="hidden" name="lead_status" value="3"/>
					<button name="submit" type="submit" style="border: 0px;background: none;width: 100%;font-size: 14px;color: #fff;"><i class="fa fa-long-arrow-right"></i></button>
				  </div></form>
				  <div class="clearfix"> </div>
				</div>
			</div>
				<div class="col-md-2 market-update-gd">
				<div class="market-update-block clr-block-2"  style="height:170px;">
					<div class="col-md-4 market-update-right">
						<i class="fa fa-usd"></i>
					</div>
					<form method="post" action="<?php if($userid[0]['user_type']==2){ echo base_url();?>home/my_team<?php } else{ echo base_url();?>home/lead_info<?php } ?>"><div class="col-md-8 market-update-left">
						<h4>New </h4>
				<h3><?php if($userid[0]['user_type']==2){
					 $d=leadListcountstl(17);	echo count($d);
					}else{echo count(leadListcounts(17));}?></h3>
				<input type="hidden" name="lead_status" value="1"/>
					<button name="submit" type="submit" style="border: 0px;background: none;width: 100%;font-size: 14px;color: #fff;"><i class="fa fa-long-arrow-right"></i></button>
					</div></form>
				  <div class="clearfix"> </div>
				</div>
			</div>
			<div class="col-md-2 market-update-gd">
				<div class="market-update-block clr-block-3"  style="height:170px;">
					<div class="col-md-4 market-update-right">
						<i class="fa fa-usd"></i>
					</div>
					<form method="post" action="<?php if($userid[0]['user_type']==2){ echo base_url();?>home/my_team<?php } else{ echo base_url();?>home/lead_info<?php } ?>">
					<div class="col-md-8 market-update-left">
						<h4>Interested</h4>
					<h3><?php if($userid[0]['user_type']==2){
					 $d=leadListcountstl(3);	echo count($d);
					}else{echo count(leadListcountstl(3));}?></h3>
					<input type="hidden" name="lead_status" value="14"/>
					<button name="submit" type="submit" style="border: 0px;background: none;width: 100%;font-size: 14px;color: #fff;"><i class="fa fa-long-arrow-right"></i></button>
					</div></form>
				  <div class="clearfix"> </div>
				</div>
			</div>
		<div class="col-md-2 market-update-gd">
				<div class="market-update-block clr-block-1"  style="height:170px;">
					<div class="col-md-4 market-update-right">
						<i class="fa fa-usd"></i>
					</div>
					<form method="post" action="<?php if($userid[0]['user_type']==2){ echo base_url();?>home/my_team<?php } else{ echo base_url();?>home/lead_info<?php } ?>">
					<div class="col-md-8 market-update-left">
						<h4>Form Filled</h4>
					<h3><?php if($userid[0]['user_type']==2){
					 $d=leadListcountstl(11);	echo count($d);
					}else{echo count(leadListcounts(11));}?></h3>
					<input type="hidden" name="lead_status" value="5"/>
					<button name="submit" type="submit" style="border: 0px;background: none;width: 100%;font-size: 14px;color: #fff;">	<i class="fa fa-long-arrow-right"></i></button>
					</div></form>
				  <div class="clearfix"> </div>
				</div>
			</div>
			<div class="col-md-2 market-update-gd">
				<div class="market-update-block clr-block-2" style="height:170px;">
					<div class="col-md-4 market-update-right">
						<i class="fa fa-users" style="font-size:1.5em;"></i>
					</div>
					<form method="post" action="<?php if($userid[0]['user_type']==2){ echo base_url();?>home/my_team<?php } else{ echo base_url();?>home/lead_info<?php } ?>"><div class="col-md-8 market-update-left">
					<h4>Confirm</h4>
					<h3><?php if($userid[0]['user_type']==2){
					 $d=leadListcountstl(20);	echo count($d);
					}else{echo count(leadListcounts(20));}?></h3>
					<input type="hidden" name="lead_status" value="15"/>
					<button name="submit" type="submit" style="border: 0px;background: none;width: 100%;font-size: 14px;color: #fff;"><i class="fa fa-long-arrow-right"></i></button>
					</div></form>
				  <div class="clearfix"> </div>
				</div>
			</div>
		   <div class="clearfix"> </div>
		</div>	
		<!-- //market-->

		</div>	
		<!-- //market-->
		<div class="agil-info-calendar">
	
			<div class="market-updates">

			
			
	
			
		   <div class="clearfix"> </div>
</section>

<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>
 <!-- footer -->
		  <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>
<!-- morris JavaScript -->	
<script>

	$(".verify").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+'/leadmanagementcrm/index.php/home/verifyvisit/',
			   data : {'leads':leads},
			   dataType:'json',
			   success: function(data){	
			   	$("#student_succ").html(data.message);					
                    window.location.reload();
				
				  }
	});
	}
});
	$(document).ready(function() {
		//BOX BUTTON SHOW AND CLOSE
	   jQuery('.small-graph-box').hover(function() {
		  jQuery(this).find('.box-button').fadeIn('fast');
	   }, function() {
		  jQuery(this).find('.box-button').fadeOut('fast');
	   });
	   jQuery('.small-graph-box .box-close').click(function() {
		  jQuery(this).closest('.small-graph-box').fadeOut(200);
		  return false;
	   });
	   
	    //CHARTS
	    function gd(year, day, month) {
			return new Date(year, month - 1, day).getTime();
		}
		
		graphArea2 = Morris.Area({
			element: 'hero-area',
			padding: 10,
        behaveLikeLine: true,
        gridEnabled: false,
        gridLineColor: '#dddddd',
        axes: true,
        resize: true,
        smooth:true,
        pointSize: 0,
        lineWidth: 0,
        fillOpacity:0.85,
			data: [
				{period: '2015 Q1', iphone: 2668, ipad: null, itouch: 2649},
				{period: '2015 Q2', iphone: 15780, ipad: 13799, itouch: 12051},
				{period: '2015 Q3', iphone: 12920, ipad: 10975, itouch: 9910},
				{period: '2015 Q4', iphone: 8770, ipad: 6600, itouch: 6695},
				{period: '2016 Q1', iphone: 10820, ipad: 10924, itouch: 12300},
				{period: '2016 Q2', iphone: 9680, ipad: 9010, itouch: 7891},
				{period: '2016 Q3', iphone: 4830, ipad: 3805, itouch: 1598},
				{period: '2016 Q4', iphone: 15083, ipad: 8977, itouch: 5185},
				{period: '2017 Q1', iphone: 10697, ipad: 4470, itouch: 2038},
			
			],
			lineColors:['#eb6f6f','#926383','#eb6f6f'],
			xkey: 'period',
            redraw: true,
            ykeys: ['iphone', 'ipad', 'itouch'],
            labels: ['All Visitors', 'Returning Visitors', 'Unique Visitors'],
			pointSize: 2,
			hideHover: 'auto',
			resize: true
		});
		
	   
	});
	</script>
<!-- calendar -->
	<script type="text/javascript" src="<?php echo base_url();?>/assets/js/monthly.js"></script>
	<script type="text/javascript">
		$(window).load( function() {

			$('#mycalendar').monthly({
				mode: 'event',
				
			});

			$('#mycalendar2').monthly({
				mode: 'picker',
				target: '#mytarget',
				setWidth: '250px',
				startHidden: true,
				showTrigger: '#mytarget',
				stylePast: true,
				disablePast: true
			});

		switch(window.location.protocol) {
		case 'http:':
		case 'https:':
		// running on a server, should be good.
		break;
		case 'file:':
		alert('Just a heads-up, events will not work when run locally.');
		}

		});
	</script>
	<!-- //calendar -->
</body>
</html>
