%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/ugotscom/public_html/dg/application/modules/performance/views/
Upload File :
Create Path :
Current File : /home/ugotscom/public_html/dg/application/modules/performance/views/performance_view.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>
<div class="content-wrapper">
     <section class="content-header">
          <h1>Employee Performance</h1>
     </section>

     <section class="content">
      <div class="row">
<div class="col-md-6">
<canvas id="myChart"></canvas>
</div>
<div class="col-md-6">
<canvas id="closedchart"></canvas>
</div>
      </div>
          <div class="row">
        
          <div class="col-md-12">
                    <!-- BEGIN EXAMPLE TABLE PORTLET-->

    <p>Total Leads Generated For December</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'] >780){
                            ?>
<button type="button" class="btn btn-success">Achieved</button>
                            <?php   

                             }  else { ?> <button type="button" class="btn btn-danger">Not Achieved</button> <?php } ?>
                           </td>
                       
                            </tr>
                          <?php } ?>
                            </tbody>
                        </table>
<!-- Modal Add Product-->
	  <form id="add-row-form" action="<?php echo site_url('emp/save');?>" method="post">
	     <div class="modal fade" id="myModalAdd" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	        <div class="modal-dialog">
	           <div class="modal-content">
	               <div class="modal-header">
	                   <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
	                   <h4 class="modal-title" id="myModalLabel">Add New</h4>
	               </div>
	               <div class="modal-body">
	                   <div class="form-group">
	                       <input type="text" name="user_id" class="form-control" placeholder="user_id" required>
	                   </div>
										 <div class="form-group">
	                       <input type="text" name="product_name" class="form-control" placeholder="Product Name" required>
	                   </div>
										 <div class="form-group">
	                       <select name="category" class="form-control" placeholder="Category" required>
													  <?php foreach ($category->result() as $row) :?>
													 		<option value="<?php echo $row->category_id;?>"><?php echo $row->category_name;?></option>
													 	<?php endforeach;?>
												 </select>
	                   </div>
										 <div class="form-group">
	                       <input type="text" name="price" class="form-control" placeholder="Price" required>
	                   </div>

	               </div>
	               <div class="modal-footer">
	                   	<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
	                  	<button type="submit" class="btn btn-success">Save</button>
	               </div>
	      			</div>
	        </div>
	     </div>
	 </form>
	 <!-- Modal Update Product-->
 	  <form id="add-row-form" action="<?php echo site_url('emp/update');?>" method="post">
 	     <div class="modal fade" id="ModalUpdate" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
 	        <div class="modal-dialog">
 	           <div class="modal-content">
 	               <div class="modal-header">
 	                   <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
 	                   <h4 class="modal-title" id="myModalLabel">Update Product</h4>
 	               </div>
 	               <div class="modal-body">
 	                   <div class="form-group">
 	                       <input type="text" name="user_id" class="form-control" placeholder="user_id" readonly>
 	                   </div>
 										 <div class="form-group">
 	                       <input type="text" name="product_name" class="form-control" placeholder="Product Name" required>
 	                   </div>
 										 <div class="form-group">
 	                       <select name="category" class="form-control" required>
													 <?php foreach ($category->result() as $row) :?>
														 <option value="<?php echo $row->category_id;?>"><?php echo $row->category_name;?></option>
													 <?php endforeach;?>
 												 </select>
 	                   </div>
 										 <div class="form-group">
 	                       <input type="text" name="price" class="form-control" placeholder="Price" required>
 	                   </div>

 	               </div>
 	               <div class="modal-footer">
 	                   	<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
 	                  	<button type="submit" class="btn btn-success">Update</button>
 	               </div>
 	      			</div>
 	        </div>
 	     </div>
 	 </form>

<!-- Modal delete Product-->
 	  <form id="add-row-form" action="<?php echo site_url('emp/delete');?>" method="post">
 	     <div class="modal fade" id="ModalDelete" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
 	        <div class="modal-dialog">
 	           <div class="modal-content">
 	               <div class="modal-header">
 	                   <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
 	                   <h4 class="modal-title" id="myModalLabel">Delete Product</h4>
 	               </div>
 	               <div class="modal-body">
 	                       <input type="hidden" name="user_id" class="form-control" required>
												 <strong>Are you sure to delete this record?</strong>
 	               </div>
 	               <div class="modal-footer">
 	                   	<button type="button" class="btn btn-default" data-dismiss="modal">No</button>
 	                  	<button type="submit" class="btn btn-success">Yes</button>
 	               </div>
 	      			</div>
 	        </div>
 	     </div>
 	 </form>

                    
                    <!-- END EXAMPLE TABLE PORTLET-->
                </div>
              
          


          </div>
     </section>
</div>
  



<script type="text/javascript">
 var paramNombres = [];
var paramEdades = [];
  $.post("<?php echo base_url();?>chart/totalno",
      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: 'bar',
              data: {
                  labels: paramNombres, 
                  datasets: [
                      {
                          label: "Leads Generated by employees",
                          fill: true,
                          lineTension: 0.1,
                          backgroundColor: ["#3e95cd", "#8e5ea2","#3cba9f","#e8c3b9","#c45850"],
                          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();?>chart/closedno",
      function(data){
          var obj = JSON.parse(data);

          paramNombres = [];
          paramEdades = [];
          $.each(obj, function(i,item){
              paramNombres.push(item.name);
              paramEdades.push(item.total);
          });
            
         
          var ctx = $("#closedchart");
          var myChart = new Chart(ctx, {
              type: 'horizontalBar',
              data: {
                  labels: paramNombres, 
                  datasets: [
                      {
                          label: "Leads closed by employees",
                          fill: true,
                          lineTension: 0.1,
                          backgroundColor: [
                                            'rgba(255, 99, 132)',
                                            'rgba(54, 162, 235)',
                                            'rgba(255, 206, 86)',
                                            'rgba(75, 192, 192)',
                                            'rgba(153, 102, 255)',
                                            'rgba(255, 159, 64)'
                                             ],
                          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>


Zerion Mini Shell 1.0