<style type="text/css">

   .widget-user-header {

      padding-left: 20px !important;

   }
   #hideinwebversion{
       display:none!important;
   }

</style>



<link rel="stylesheet" href="<?= BASE_ASSET; ?>admin-lte/plugins/morris/morris.css">



<section class="content-header">

    <h1>

        <?= cclang('control_panel') ?>

        <small>

            

        <!--<?= cclang('control_panel') ?>-->

        </small>

    </h1>

    <ol class="breadcrumb">

        <li>

            <a href="#">

                <i class="fa fa-dashboard">

                </i>

                <?= cclang('home') ?>

            </a>

        </li>

        <li class="active">

            <?= cclang('dashboard') ?>

        </li>

    </ol>

</section>

<style>

    .weather-widget{

        zoom:80%;

    }

</style>

<?php

$re= json_decode(file_get_contents("https://".(explode('.', $_SERVER['HTTP_HOST']))[0].".agritun.com/api_stats/home.php"), true);

$pourcentage= number_format(100*$re["nbr_p_r"]/$re["nbr_p_t"],2);

$total=$re["total"];

$vente=$re["vente"];

$rev=$re["rev"];

/*

$re= json_decode(file_get_contents("https://app.agritun.com/api_prix_zitoun/price.php"), true);

$ladate= $re["date"];

$priceEV=$re["priceEV"];

$priceV=$re["priceV"];

$priceL=$re["priceL"];

*/

?>

<section class="content">

    <div class="row" style="background-color:white;margin:0 0px 10px 0px;padding-bottom: 10px;">

        <div class="col-md-6 col-sm-6 col-xs-12">

        <h5>نسبة تقدم عمليات الجمعان</h5>

            <div class="progress">

                <div class="progress-bar" role="progressbar" style="width: <?= $pourcentage ?>%;" aria-valuenow="<?= $pourcentage ?>" aria-valuemin="0" aria-valuemax="100"><?= $pourcentage ?>%</div>

            </div>

        </div>



        <div class="col-md-2 col-sm-6 col-xs-12 soumzitoun" style="text-align: center;">

        <h5 style=" background-color:hsl(54deg 82% 53%);color:white; " class="btn"><i class="fa fa-tint" aria-hidden="true"></i>  بكر ممتاز </h5></br>

        

           <b class="evierge">

           <div class="progress"><div class="progress-bar progress-bar-success progress-bar-striped"></div></div>

           </b>

        </div>

        <div class="col-md-2 col-sm-6 col-xs-12" style="text-align: center;">

        <h5 style=" background-color:hsl(54deg 55% 44%);color:white; " class="btn"><i class="fa fa-tint" aria-hidden="true"></i>  بكر </h5></br>

            <b class="vierge">

                <div class="progress"><div class="progress-bar progress-bar-success progress-bar-striped"></div></div>

            </b>

        </div>

        <div class="col-md-2 col-sm-6 col-xs-12" style="text-align: center;">

        <h5 style=" background-color:hsl(46deg 50% 32%);color:white; " class="btn"><i class="fa fa-tint" aria-hidden="true"></i>  لامبونت </h5></br>

            <b class="lampante">

                <div class="progress"><div class="progress-bar progress-bar-success progress-bar-striped"></div></div>

            </b>

        </div>





    </div>

    <div class="row">

      <?php cicool()->eventListen('dashboard_content_top'); ?>

        <div class="col-md-6 col-sm-6 col-xs-12">

            <div class="info-box">

                <div class="meteo" style="padding:10%;height:400px;">

                </div>

            </div>

        </div>



        <div class="col-md-6 col-sm-6 col-xs-12">

            <div class="info-box" style="height:400px;">

                <div class="" id="columnchart_values" style="height:400px;">



                </div>

            </div>

        </div>        

        <script>

    $.get( "https://app.agritun.com/api_prix_zitoun/price.php", function( data ) {

        $( ".evierge" ).html( data['priceEV'] );

        $( ".vierge" ).html( data['priceV'] );

        $( ".lampante" ).html( data['priceL'] );

    });

    $.get( "https://<?php echo (explode('.', $_SERVER['HTTP_HOST']))[0] ?>.agritun.com/api/meteo.php", function( data ) {

        $( ".meteo" ).html( data );

    });



//charts



google.charts.load("current", {packages:['corechart']});

    google.charts.setOnLoadCallback(drawChart);

    function drawChart() {





      var data = google.visualization.arrayToDataTable([

        ["التكلفة الجملية", "Density", { role: "style" } ],

        ["التكلفة الجملية", <?= $total ?>, "#ffc338"],

        ["المداخيل", <?= $vente ?>, "#f7597b"],

        ["المرابيح", <?= $rev ?>, "#4d92fa"],

      ]);



      var view = new google.visualization.DataView(data);

      view.setColumns([0, 1,

                       { calc: "stringify",

                         sourceColumn: 1,

                         type: "string",

                         role: "annotation" },

                       2]);



      var options = {

        title: "الإحصائيات العامة",

        height: 400,

        bar: {groupWidth: "95%"},

        legend: { position: "none" },

      };

      var chart = new google.visualization.ColumnChart(document.getElementById("columnchart_values"));

      chart.draw(view, options);

  }



</script>



    </div>

  

      <!-- /.row -->

      <?php cicool()->eventListen('dashboard_content_bottom'); ?>



</section>

<!-- /.content -->