%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/ugotscom/public_html/boniface/Admin/application/modules/bsales/views/
Upload File :
Create Path :
Current File : /home/ugotscom/public_html/boniface/Admin/application/modules/bsales/views/sales.php

<script src="https:cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.3/Chart.min.js"></script>
  <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
    <style>
.form-controlbox{
    display: inline-block;
    width: 20%;
    height: calc(2.25rem + 2px);
    padding: .375rem .75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #495057;
background-color:#fff;
background-clip: padding-box;
border: 1px solid #ced4da;
border-radius: .25rem;
box-shadow: inset 0 0 0
    transparent;
    transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out;
}
  </style>
<div class="content-wrapper">
     <section class="content-header">
          <h1>Sales OverView</h1>

     
            <form method="post" action="<?=base_url()?>bsales/salessearch">
    
<input name="date1" type="date" placeholder="date1">
<input name="date2" type="date" placeholder="date2">
    
 <select name="branch_id" class="form-controlbox" placeholder="enquiry_source" required>
  <option value="">Select Branch</option>
                              <?php foreach ($branches->result() as $row) :?>
                              <option value="<?php echo $row->branch_id;?>"><?php echo $row->branch_name;?></option>
                            <?php endforeach;?>
                         </select>
<button class="" type="submit" value="submit">SEARCH</button>

  </form>
  <?php 
if ($_SERVER['REQUEST_METHOD'] == 'POST'){

foreach ($branch->result() as $row) 
  echo 'Sales Overview Data for &nbsp;'.$row->branch_name.'&nbsp;for date &nbsp;'.date("d-F-Y", strtotime($date1) ).'&nbsp;and &nbsp;'.date("d-F-Y", strtotime($date2) );
}

  ?>
     </section>

     <section class="content">
          <div class="row">

        
               <div class="col-lg-3 col-xs-6">
                    <div class="small-box bg-yellow">
                         <div class="inner">
                              <h3><?=$details;?></h3>
                              <p>Leads</p>
                         </div>
                         <div class="icon">
                              <i class="ion ion-person-add"></i>
                         </div>
                         
                              <a href="<?=base_url();?>emp/" class="small-box-footer">More info <i class="fa fa-arrow-circle-right"></i></a>    
                         
                    </div>
               </div>
        
               <div class="col-lg-3 col-xs-6">
                    <div class="small-box bg-green">
                         <div class="inner">
                              <h3><?=$hot_leads;?></h3>
                              <p>Hot Leads</p>
                         </div>
                         <div class="icon">
                              <i class="fa fa-tag"></i>
                         </div>
                          
                              <a href="<?=base_url();?>user" class="small-box-footer">More info <i class="fa fa-arrow-circle-right"></i></a>  
                    </div>
               </div>
                <div class="col-lg-3 col-xs-6">
                    <div class="small-box bg-green">
                         <div class="inner">
                              <h3><?=$warm_leads;?></h3>
                              <p>Warm Leads</p>
                         </div>
                         <div class="icon">
                              <i class="fa fa-tag"></i>
                         </div>
                          
                              <a href="<?=base_url();?>user" class="small-box-footer">More info <i class="fa fa-arrow-circle-right"></i></a>  
                    </div>
               </div>
          
               <div class="col-lg-3 col-xs-6">
                    <div class="small-box bg-blue">
                         <div class="inner">
                              <h3><?=$closed_leads;?></h3>
                              <p>Sold Leads</p>
                         </div>
                         <div class="icon">
                              <i class="fa fa-shopping-cart"></i>
                         </div>
                            <a href="<?=base_url();?>user" class="small-box-footer">More info <i class="fa fa-arrow-circle-right"></i></a>  
                    </div>
               </div>
          </div>
                  <div class="row">
                     <div class="col-md-6">
                     <canvas id="myChart"></canvas>
                     </div>
                     <div class="col-md-6">
                     <canvas id="pie"></canvas>
                     </div>
                     </div>
          <div class="row">
<div class="col-md-6">
 
  <p>Total Leads Generated by Each Staff</p>
       <table id="example1" class="table table-bordered table-striped">
                            <thead>
                                <tr>
                                  
                            <th class="text-center">Name</th>
                                  <th class="text-center">Leads Generated</th>
                                     <th class="text-center">Target</th>
                                                              
                                </tr>
                            </thead>
                            <tbody>
                                <?php $i=1;
                                foreach ($totalno as $value) { ?>
                                <tr>
                                  
                                    <td class="text-center"><?=$value['name'];?></td>
                            <td class="text-center"><?=$value['total'];?></td>
                             <td class="text-center"><?php if($value['total'] >30){
                            ?>
<button type="button" class="btn btn-success">Achieved</button>
                            <?php   

                             }  else { ?> <button type="button" class="btn btn-danger">Not</button> <?php } ?>
                           </td>
                       
                            </tr>
                          <?php } ?>
                            </tbody>
                        </table>
</div>
<div class="col-md-6">
  <p>Total Sold</p>
       <table id="example1" class="table table-bordered table-striped">
                            <thead>
                                <tr>
                                  
                            <th class="text-center">Name</th>
                                  <th class="text-center">Leads Closed</th>
                                                              
                                </tr>
                            </thead>
                            <tbody>
                                <?php $i=1;
                                foreach ($closedtotalno as $value) { ?>
                                <tr>
                                   
                                    <td class="text-center"><?=$value['name'];?></td>
                            <td class="text-center"><?=$value['total'];?></td>
                            
                       
                            </tr>
                          <?php } ?>
                            </tbody>
                        </table>
</div>

          </div>
        
       
 

     </section>
</div>
 

   <script type="text/javascript">
 var paramNombres = [];
var paramEdades = [];

  $.post("<?php echo base_url().'bsales/charttotalno/'.$branch.'/'.$date1.'/'.$date2 ?>",
      function(data){
          var obj = JSON.parse(data);

          paramNombres = [];
          paramEdades = [];
          $.each(obj, function(i,item){
              paramNombres.push(item.name);
              paramEdades.push(item.total);
          });
            
         
          var ctx = $("#myChart");
          var myChart = new Chart(ctx, {
              type: 'line',
              data: {
                  labels: paramNombres, 
                  datasets: [
                      {
                          label: "Leads Generated",
                          fill: true,
                          lineTension: 0.1,
                          
                          borderColor: "rgba(75,192,192,1)",
                          borderCapStyle: 'butt',
                          borderDash: [],
                          borderDashOffset: 0.0,
                          borderJoinStyle: 'miter',
                          pointBorderColor: "rgba(75,192,192,1)",
                          pointBackgroundColor: "#fff",
                          pointBorderWidth: 10,
                          pointHoverRadius: 5,
                          pointHoverBackgroundColor: "rgba(75,192,192,1)",
                          pointHoverBorderColor: "rgba(220,220,220,1)",
                          pointHoverBorderWidth: 5,
                          pointRadius: 1,
                          pointHitRadius: 10,
                          data: paramEdades, 
                          spanGaps: false,
                      }
                  ]
              },
              options: {
                  scales: {
                      yAxes: [{
                          ticks: {
                              beginAtZero:true
                          }
                      }]
                  }
              }
          });
      });

</script>
        <script type="text/javascript">
 var paramNombres = [];
var paramEdades = [];
    $.post("<?php echo base_url().'bsales/enquirytotalbranch/'.$branch.'/'.$date1.'/'.$date2 ?>",  
      function(data){

         var obj = JSON.parse(data);
//console.log(data);
          paramNombres = [];
          paramEdades = [];
          $.each(obj, function(i,item){
              paramNombres.push(item.source);
              paramEdades.push(item.total);
          });
            
         
          var ctx = $("#pie");
          var myChart = new Chart(ctx, {
              type: 'doughnut',
              data: {
                  labels: paramNombres, 
                  datasets: [
                      {
                          label: "Leads Generated",
                          fill: true,
                          lineTension: 0.1,
                          backgroundColor: ["#3e95cd", "#8e5ea2","#3cba9f","#e8c3b9","#c45850"],
                          borderCapStyle: 'butt',
                          borderDash: [],
                          borderDashOffset: 0.0,
                          borderJoinStyle: 'miter',
                          pointBorderColor: "rgba(75,192,192,1)",
                          pointBackgroundColor: "#fff",
                          pointBorderWidth: 10,
                          pointHoverRadius: 5,
                          pointHoverBackgroundColor: "rgba(75,192,192,1)",
                          pointHoverBorderColor: "rgba(220,220,220,1)",
                          pointHoverBorderWidth: 5,
                          pointRadius: 1,
                          pointHitRadius: 10,
                          data: paramEdades, 
                          spanGaps: false,
                      }
                  ]
              },
              options: {
                title: {
        display: true,
        text: 'Most Leads Generated Source'
      }
              }
          });
      });

</script>

Zerion Mini Shell 1.0