 <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.1.3/Chart.min.js"></script>	
 <div class="content-wrapper">
            <!-- Content Header (Page header) -->
            <section class="content-header">
                <h1>
                   Dashboard
                </h1>
                <ol class="breadcrumb">
                    <li><a href="<?php echo base_url();?>admin"><i class="fa fa-home"></i>Home</a></li>
                    <li class="active">Dashboard</li>
                </ol>
            </section>
            <!-- Main content -->
            <div class="content">
                <!-- Your Page Content Here -->
                <!-- header widgets -->
                <div class="row">
                    <div class="col-lg-3 col-sm-6">
                        <div class="widget widget-tile">
                            <!--<div id="spark1" class="chart sparkline"></div>-->
                            <div class="data-info">
                                <div class="value"><span class="indicator fa-green fa fa-user"></span><span data-toggle="counter" data-end="<?php echo $this->db->get("users")->num_rows();?>" class="number">0</span>
                                </div>
                                <div class="desc">Registered Users</div>
                                <a class="text-center" href="<?php echo base_url();?>admin/users">View All</a>
                            </div>
                        </div>
                    </div>
                    <div class="col-lg-3 col-sm-6">
                        <div class="widget widget-tile">
                            <!--<div id="spark1" class="chart sparkline"></div>-->
                            <div class="data-info">
                                <div class="value"><span class="indicator fa-blue fa fa-user"></span><span data-toggle="counter" data-end="<?php echo $this->db->get("products")->num_rows();?>" class="number">0</span>
                                </div>
                                <div class="desc">No of Total Products</div>
                                <a class="text-center" href="<?php echo base_url();?>admin/products">View All</a>
                            </div>
                        </div>
                    </div>
                    <div class="col-lg-3 col-sm-6">
                        <div class="widget widget-tile">
                            <!--<div id="spark1" class="chart sparkline"></div>-->
                            <div class="data-info">
                                <div class="value"><span class="indicator fa-blue fa fa-user"></span><span data-toggle="counter" data-end="<?php echo $this->db->get("contact")->num_rows();?>" class="number">0</span>
                                </div>
                                <div class="desc">No of Contact Enquiries</div>
                                <a class="text-center" href="<?php echo base_url();?>admin/ContactEnquiries">View All</a>
                            </div>
                        </div>
                    </div>
                    <div class="col-lg-3 col-sm-6">
                        <div class="widget widget-tile">
                         
                            <div class="data-info">
                                <div class="value"><span class="indicator fa fa-orange fa-xs fa-angle-right"></span><span data-toggle="counter" data-end="<?php echo $this->db->get("orders")->num_rows();?>" class="number">0</span>
                                </div>
                                <div class="desc">Orders</div>
                                <a class="text-center" href="<?php echo base_url();?>admin/orders">View All</a>
                            </div>
                        </div>
                    </div>
                </div>
              
                
                <!-- end fourth row  -->
                <!-- Fifth row   -->
                <div class="row">
                	<div class="col-md-8">
                    <section class="panel">
								<div class="panel-body">
                                <canvas id="myChart" width="400" height="200"></canvas>
                                </div>
                                </section>
                    </div>
                    <div class="col-md-4">
                        <div class="panel">
                            <h3 class="panel-heading">10 Recent User Registrations</h3>
                            <div class="panel-body">
                                <ul class="chat-list-wrap">
                                    <li class="chat-list">
                                        <div class="chat-body">
                                          <?php foreach($users as $user){?>
                                            <a class="" target="_new" href="<?php echo base_url();?>admin/ads/<?php echo $user->id;?>">
                                                <div class="chat-data">
            <img class="user-img img-circle" src="<?php echo base_url();?>newadminassets/img/avatars/avatar.png" alt="user">
                                                    <div class="user-data">
                     <span class="name block capitalize-font"><?php echo $user->first_name.' '.$user->last_name;?></span>
                                   <span class="time block text-gray"> <i class="fa fa-envelope"></i> <?php echo $user->email;?></span>
                                                    </div>
                                                    <div class="status online"></div>
                                                    <div class="clearfix"></div>
                                                </div>
                                            </a>
                                          <?php }?>
                                        </div>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </div>
                    <!-- User Activity -->
                    <div class="col-md-8">
                        <div class="panel">
                            <h3 class="panel-heading">10 Recent Orders <a class="pull-right" href="<?php echo base_url();?>admin/orders">View All</a></h3>
                            <div class="panel-body">
                                <table class="table table-striped table-responsive table-bordered dataTable" id="example-2">
        	<thead>
												<tr>
													<th>S.No.</th>
													<th>OrderId</th>
                                                    <th>OrderDate</th>
													<th>UserDetails</th>
													<th>OrderTotal</th>
													<th>Total Images</th>
												</tr>
											</thead>
			<tbody>
                                            <?php  $i=1;foreach($orders as $order){?>
                                            <tr data-category="active">
													<td data-title=""><?php echo $i;?></td>
                            <td data-title="Title">
                                <h4>VK<?php echo $order->oid;?></h4>
                            </td>
                              <td><?php echo date("d M Y",strtotime($order->odate));?></td>
                           <td><i class="fa fa-user"></i> <?php echo $order->first_name.' '.$order->last_name;?><br/>
                           	   <i class="fa fa-envelope"></i> <?php echo $order->email;?></td>
                               <td>$<?php echo $order->ototal;?><br/><span class="label label-default"><?php echo $order->pay_status;?></span></td>
                        <td>
                          <a href="#" id="<?php echo $order->oid;?>" data-toggle="modal" data-target="#md-default" class="btn btn-xs btn-success vieworder"><i class="fa fa-picture-o"> <?php echo $this->db->get_where("order_items",array("oid"=>$order->oid))->num_rows();?> Images</i></a>
                        </td>
                        
												</tr>
                                            <?php $i++;}?>
                                            </tbody><div class="modal fade" id="md-default" tabindex="-1" role="dialog">
                                <div class="modal-dialog">
                                    <div class="modal-content">
                                        <div class="modal-header">
                                            <button class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                                        </div>
                                        <div class="modal-body">
                                            <div class="text-center">
                                                <div class="modal-icon"><i class="fa fa-snowflake-o"></i></div>
                                                <h4>Wait! Loading Images.....</h4>
                                            </div>
                                        </div>
                                        <div class="modal-footer">
                                            <button class="btn btn-default" data-dismiss="modal">Close</button>
                                        </div>
                                    </div>
                                    <!-- /.modal-content -->
                                </div>
                                <!-- /.modal-dialog -->
                            </div>
        </table>
                            </div>
                        </div>
                    </div>
                    <!-- End User Activity -->
                    <!-- User lists -->
                    
                    <!-- end User lists -->
                    <!-- Chat Room -->
                    <div class="col-md-4">
                        <div class="panel login-panel">
                            <div class="panel-heading text-center">
                                <h3>Change Password</h3>
                            </div>
                            
                            <div class="panel-body">
                                <form class="form-horizontal" action="" method="post" id="changepass">
                                    
                                    <div class="form-group">
                                        <label for="inputPassword3" class="col-sm-2 control-label">
                                            <i class="fa fa-lock"></i>
                                        </label>
                                        <div class="col-sm-10">
                                            <input type="password" name="opass" required class="form-control" id="inputPassword3" placeholder="Old Password">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="inputPassword3"  class="col-sm-2 control-label">
                                            <i class="fa fa-lock"></i>
                                        </label>
                                        <div class="col-sm-10">
                                            <input type="password"  name="npass" required class="form-control" id="inputPassword3" placeholder="New Password">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="inputPassword3" class="col-sm-2 control-label">
                                            <i class="fa fa-lock"></i>
                                        </label>
                                        <div class="col-sm-10">
                                            <input type="password"  name="cpass" required class="form-control" id="inputPassword3" placeholder="Confirm Password">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                     <b class="text-warning" id="passch"></b>
                                        <button type="submit" class="btn btn-primary btn-block">Change Password</button>
                                    </div>
                                </form>
<h3>Payment Gateway</h3>
                                
                                <div class="form-group">
                                	<select name="pay" id="pay" class="form-control">
                                    	<option value="live" <?php if($admin->pay_gate=="live"){echo "selected";}?>>Live</option>
                                        <option value="" <?php if($admin->pay_gate==""){echo "selected";}?>>Sandbox</option>
                                    </select>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- End Chat Room -->
                </div>
                <!-- end Fifth row -->
                <!-- sixth row -->
                
                <!-- ens sixth row -->
            </div>
            <!-- /.content -->
        </div>
        <!-- /.content-wrapper -->
        <!-- Main Footer -->
        <footer class="main-footer">
            <!-- To the right -->
           <!-- <div class="pull-right hidden-xs">
                Developed by <i class="fa fa-heart"></i> Floatin
            </div>-->
            <!-- Default to the left -->
            <strong>Copyright &copy; 2018 <a href="#">HadesIndia</a>.</strong> All rights reserved.
        </footer>
    </div>
    <script src="<?php echo base_url();?>newadminassets/plugins/js/jquery.sparkline.min.js"></script>
    <script>
	$(document).ready(function(){
$("#pay").change(function(){
				var st=$(this).val();
				$.ajax({
							 type: "POST",
							 url: '<?php echo base_url();?>admin/pay_gate_change',
							 data: {st:st},
							 success: function(res){
								//$(".modal-body").html(res);
							 }
							 });
		});
$(".vieworder").click(function(){//alert("asdfa");
			var id=$(this).attr('id');
			$.ajax({
							 type: "POST",
							 url: '<?php echo base_url();?>admin/vieworder',
							 data: {id:id},
							 success: function(res){
								$(".modal-body").html(res);
							 }
							 });
		});
		$("#changepass").submit(function(e){e.preventDefault();//alert("Asdf"); 
								var formdata=$(this).serialize();
								$.ajax({
								 type: "POST",
								 url: '<?php echo base_url();?>admin/change_pass',
								 data: {formdata:formdata},
								 success: function(res){
								//alert(res);
								$("#passch").html(res);
								}
								 }); 
										});
	});
	var canvas = document.getElementById('myChart');
var data = {
    labels: ["January", "February", "March", "April", "May", "June", "July"],
    datasets: [
        {
            label: "Monthly Sales",
            backgroundColor: "rgba(255,99,132,0.2)",
            borderColor: "rgba(255,99,132,1)",
            borderWidth: 2,
            hoverBackgroundColor: "rgba(255,99,132,0.4)",
            hoverBorderColor: "rgba(255,99,132,1)",
            data: [65, 59, 20, 81, 56, 55, 40],
        }
		
    ]
};
var option = {
	scales: {
  	yAxes:[{
    		stacked:true,
        gridLines: {
        	display:true,
          color:"rgba(255,99,132,0.2)"
        }
    }],
    xAxes:[{
    		gridLines: {
        	display:false
        }
    }]
  }
};

var myBarChart = Chart.Bar(canvas,{
	data:data,
  options:option
});
	</script>
    <script src="<?php echo base_url();?>newadminassets/plugins/js/countUp.min.js"></script>
    <script src="<?php echo base_url();?>newadminassets/plugins/js/raphael.min.js"></script>
    <script src="<?php echo base_url();?>newadminassets/plugins/js/morris.min.js"></script>
    <script src="<?php echo base_url();?>newadminassets/plugins/js/jquery-jvectormap-2.0.2.min.js"></script>
    <script src="<?php echo base_url();?>newadminassets/plugins/js/jquery-jvectormap-world-mill-en.js"></script>
    <script src="<?php echo base_url();?>newadminassets/plugins/js/material.min.js"></script>
    <script src="<?php echo base_url();?>newadminassets/plugins/js/ripples.min.js"></script>
    <script src="<?php echo base_url();?>newadminassets/plugins/rendro-easy-pie-chart/dist/jquery.easypiechart.min.js"></script>
    <script src="<?php echo base_url();?>newadminassets/plugins/js/Chart.bundle.min.js"></script>
    <script src="<?php echo base_url();?>newadminassets/plugins/js/jquery.slimscroll.min.js"></script>
    <script src="<?php echo base_url();?>newadminassets/js/dashboard.js"></script>
    <script src="<?php echo base_url();?>newadminassets/js/widgets.js"></script>
    <script src="<?php echo base_url();?>newadminassets/js/app.js"></script>

    <!-- Color Switcher -->
    
    <!-- END Skin switcher -->


</body>

