<?php
/* Smarty version 3.1.33, created on 2020-07-06 21:06:16
  from '/Users/codeworldweb.com/websites/uvocorp/content/modules/overview/views/chart_js.tpl' */

/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
  'version' => '3.1.33',
  'unifunc' => 'content_5f0392484e3f56_35690944',
  'has_nocache_code' => false,
  'file_dependency' => 
  array (
    '46166dc300d22053085232474472200a8aef27fa' => 
    array (
      0 => '/Users/codeworldweb.com/websites/uvocorp/content/modules/overview/views/chart_js.tpl',
      1 => 1594069562,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
  ),
),false)) {
function content_5f0392484e3f56_35690944 (Smarty_Internal_Template $_smarty_tpl) {
?><!-- Admin Charts -->
<?php echo '<script'; ?>
 src="https://code.highcharts.com/highcharts.js"><?php echo '</script'; ?>
>
<?php echo '<script'; ?>
 src="https://code.highcharts.com/modules/exporting.js"><?php echo '</script'; ?>
>

<?php echo '<script'; ?>
 type="text/javascript">
    var xAxis = {
        categories: [
            "Jan",
            "Feb",
            "Mar",
            "Apr",
            "May",
            "Jun",
            "Jul",
            "Aug",
            "Sep",
            "Oct",
            "Nov",
            "Dec"
        ],
        crosshair: true
    };

    var yAxis = {
        min: 0,
        title: {
            text: "<?php echo htmlspecialchars(date('Y'), ENT_QUOTES, 'UTF-8');?>
"
        }
    };

    var tooltip = {
        headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
        pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
            '<td style="padding:0"><b>{point.y}</b></td></tr>',
        footerFormat: '</table>',
        shared: true,
        useHTML: true
    };

    var plotOptions = {
        column: {
            pointPadding: 0.2,
            borderWidth: 0
        }
    };
<?php echo '</script'; ?>
>

<?php if ($_smarty_tpl->tpl_vars['user']->value['is_admin'] || $_smarty_tpl->tpl_vars['user']->value['is_sub_admin']) {?>
    <?php echo '<script'; ?>
 type="text/javascript">
        $(function () {
            $('#admin-chart-orders').highcharts({
                chart: {
                    type: 'column'
                },
                title: {
                    text: "Monthly Orders Average"
                },
                xAxis,
                yAxis,
                tooltip,
                plotOptions,
                series: [{
                    name: "Orders",
                    data: [<?php echo htmlspecialchars(implode(',',$_smarty_tpl->tpl_vars['chart']->value['orders']), ENT_QUOTES, 'UTF-8');?>
]
                }]
            });

            $('#admin-chart-customers').highcharts({
                chart: {
                    type: 'column'
                },
                title: {
                    text: "Monthly Customers Average"
                },
                xAxis,
                yAxis,
                tooltip,
                plotOptions,
                series: [{
                    name: "Customers",
                    data: [<?php echo htmlspecialchars(implode(',',$_smarty_tpl->tpl_vars['chart']->value['customers']), ENT_QUOTES, 'UTF-8');?>
]
                }]
            });

            $('#admin-chart-sales').highcharts({
                chart: {
                    type: 'line'
                },
                title: {
                    text: "Monthly Sales"
                },
                xAxis,
                yAxis,
                tooltip : {
                    headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
                    pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
                        '<td style="padding:0"><b>${point.y}</b></td></tr>',
                    footerFormat: '</table>',
                    shared: true,
                    useHTML: true
                },
                plotOptions,
                series: [{
                    name: "Sales",
                    data: [<?php echo htmlspecialchars(implode(',',$_smarty_tpl->tpl_vars['chart']->value['sales']), ENT_QUOTES, 'UTF-8');?>
]
                }]
            });

            $('#admin-chart-payments').highcharts({
                chart: {
                    type: 'line'
                },
                title: {
                    text: "Monthly Payments"
                },
                xAxis,
                yAxis,
                tooltip : {
                    headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
                    pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
                        '<td style="padding:0"><b>${point.y}</b></td></tr>',
                    footerFormat: '</table>',
                    shared: true,
                    useHTML: true
                },
                plotOptions,
                series: [{
                    name: "Payments",
                    data: [<?php echo htmlspecialchars(implode(',',$_smarty_tpl->tpl_vars['chart']->value['payments']), ENT_QUOTES, 'UTF-8');?>
]
                }]
            });
        });
    <?php echo '</script'; ?>
>
<?php }?>

<?php if ($_smarty_tpl->tpl_vars['user']->value['is_writer'] || $_smarty_tpl->tpl_vars['user']->value['is_editor']) {?>
    <?php echo '<script'; ?>
 type="text/javascript">
        $(function () {
            $('#admin-chart-income').highcharts({
                chart: {
                    type: 'line'
                },
                title: {
                    text: "Monthly Income Average"
                },
                xAxis,
                yAxis,
                tooltip : {
                    headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
                    pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
                        '<td style="padding:0"><b>${point.y}</b></td></tr>',
                    footerFormat: '</table>',
                    shared: true,
                    useHTML: true
                },
                plotOptions,
                series: [{
                    name: "Income",
                    data: [<?php echo htmlspecialchars(implode(',',$_smarty_tpl->tpl_vars['chart']->value['income']), ENT_QUOTES, 'UTF-8');?>
]
                }]
            });
        });
    <?php echo '</script'; ?>
>
<?php }
}
}
