<?php
$this->load->view('includes/header.php');
echo '<font class="title">'.$menu_path.'</font>';
echo '<br>';
echo '<br>';
			/* Display system message */
			$this->fungsi->disp_sys_msg();
			echo validation_errors('<p class="field_error">', '</p>');
			
			//foreach ($cpv_pus  as $cpv_puss)
?>
<style type="text/css" media="print">
.no-print		{ display:none; }
</style>

<script src="<?php echo base_url();?>etc/canvasjs-1.6.2/canvasjs.min.js" type="text/javascript"></script>
<script language="Javascript1.2">
  <!--
  function printpage() {
  window.print();
  }
  //-->
</script>

<input type="button" class="no-print" value="Print this Page" onclick="window.print();">
<script type="text/javascript">
        $(document).ready(function () {

var url = "<?php echo base_url();?>admin/branch_report/branch_activity_disp_user_login_count/<?php echo $date1; ?>/<?php echo $date2; ?>";
            $.getJSON(url, function (result) {

                var chart = new CanvasJS.Chart("chartContainer", {
					title:{
        			text: "User Login From <?php echo  date("d-m-Y", strtotime($date1)); ?> To <?php echo  date("d-m-Y", strtotime($date2)); ?>"              
      						}, 
	 				animationEnabled: true,
                    data: [
                        {
							type: "column",
                            dataPoints: result
                        }
                    ]
                });

                chart.render();
            });
			
var url2 = "<?php echo base_url();?>admin/branch_report/branch_activity_disp_stb_sum/<?php echo $date1; ?>/<?php echo $date2; ?>";
            $.getJSON(url2, function (result) {

                var chart = new CanvasJS.Chart("chartContainer2", {
					title:{
        			text: "Used Oil Received (STB) From <?php echo  date("d-m-Y", strtotime($date1)); ?> To <?php echo  date("d-m-Y", strtotime($date2)); ?> In Liter"              
      						}, 
	 				animationEnabled: true,
                    data: [
                        {
							type: "column",
                            dataPoints: result
                        }
                    ]
                });

                chart.render();
            });
			
var url3 = "<?php echo base_url();?>admin/branch_report/branch_activity_disp_op_sum/<?php echo $date1; ?>/<?php echo $date2; ?>";
            $.getJSON(url3, function (result) {

                var chart = new CanvasJS.Chart("chartContainer3", {
					title:{
        			text: "Used Oil Purchase (OP) From <?php echo  date("d-m-Y", strtotime($date1)); ?> To <?php echo  date("d-m-Y", strtotime($date2)); ?> In Rp"              
      						}, 
	 				animationEnabled: true,
					axisY:{    
        valueFormatString:  "#,##0.##", // move comma to change formatting
        prefix: "Rp"
     },
                    data: [
                        {
							type: "column",
                            dataPoints: result
                        }
                    ]
                });

                chart.render();
            });
	
var url4 = "<?php echo base_url();?>admin/branch_report/branch_activity_disp_op_sum2/<?php echo date("Y-m", strtotime($date1)); ?>/<?php echo date("Y-m", strtotime($date2)); ?>";		
	 $.getJSON(url4, function (result) {
			var chart = new CanvasJS.Chart("chartContainer4",
			{
			  title:{
			  text: "Multi-Series Line Chart"  
			  },
			  animationEnabled: true,
			  axisY:{    
        valueFormatString:  "#,##0.##", // move comma to change formatting
        prefix: "Rp"
     },
      data: [
      {        
        type: "line",
        dataPoints: result
      }/*,
	  {        
        type: "line",
        dataPoints: result
      }*/
      ]
    });

    chart.render();
	});
	
	
var url5 = "<?php echo base_url();?>admin/branch_report/branch_activity_disp_po_sum/<?php echo $date1; ?>/<?php echo $date2; ?>";
            $.getJSON(url5, function (result) {

                var chart = new CanvasJS.Chart("chartContainer5", {
					title:{
        			text: "Purchase Order (PO) From <?php echo  date("d-m-Y", strtotime($date1)); ?> To <?php echo  date("d-m-Y", strtotime($date2)); ?> In Rp"              
      						}, 
	 				animationEnabled: true,
					axisY:{    
        valueFormatString:  "#,##0.##", // move comma to change formatting
        prefix: "Rp"
     },
                    data: [
                        {
							type: "column",
                            dataPoints: result
                        }
                    ]
                });

                chart.render();
            });
	
var url6 = "<?php echo base_url();?>admin/branch_report/branch_activity_disp_dn_sum/<?php echo $date1; ?>/<?php echo $date2; ?>";
     
      $.getJSON(url5, function (result) {
                var chart = new CanvasJS.Chart("chartContainer5", {
					title:{
        			text: "Delivery Note (SJ) From <?php echo  date("d-m-Y", strtotime($date1)); ?> To <?php echo  date("d-m-Y", strtotime($date2)); ?> In Liter"              
      						}, 
	 				animationEnabled: true,
                    data: [
                        {
							type: "column",
                            dataPoints: result
                        }
                    ]
                });

                chart.render();
         });
			
        });
    </script>
 <div id="chartContainer" style="height: 300px; width: 100%;">
  </div>
  <div id="chartContainer2" style="height: 300px; width: 100%;">
  </div>
   <div id="chartContainer3" style="height: 300px; width: 100%;">
  </div>
   <div id="chartContainer4" style="height: 300px; width: 100%;">
  </div>
  <div id="chartContainer5" style="height: 300px; width: 100%;">
  </div>
  <div id="chartContainer6" style="height: 300px; width: 100%;">
  </div>
<?php
if ( ! empty($link))
	{
		echo '<p id="bottom_link" class="no-print">';
		foreach($link as $links)
		{
			echo $links . ' ';
		}
		echo '</p>';
	}
$this->load->view('includes/footer.php');
	?>
