<?php
$source = app()->locale->aMName.'_'.app()->locale->pMName;
$search = array(
    app()->locale->aMName,
    app()->locale->pMName
);
$replace  = array('am','pm');
$result = str_replace($search,$replace ,$source);
$result = explode('_',$result);

?>

<script>
$.fn.datetimepicker.dates['en'] = {
    days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"],
    meridiem: [<?php echo (json_encode($result[0])); ?>, <?php echo(json_encode($result[1])); ?>],
    daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
    daysMin:<?php echo(json_encode(array_values(Yii::app()->locale->getWeekDayNames('abbreviated', true))));?>,
    months:<?php echo(json_encode(array_values(Yii::app()->locale->getMonthNames('wide', true))));?>,
    monthsShort: <?php echo(json_encode(array_values(Yii::app()->locale->getMonthNames('abbreviated', true))));?>,
    today: "<?php echo  __("CALENDAR_TODAY");?>",
    suffix: ["st", "nd", "rd", "th"],
};
</script>
<?php 

$this->renderPartial('navbar',array('items'=>$items));
$xAxisTranslationTag = 'ANALYTIC_DAILY_REPORT_X_AXIS_LABEL_FOR_'.Statistic::readable(Statistic::StatisticTimeRangeTypeDay,true);
if (isset($_GET['range'])) {
 $xAxisTranslationTag = 'ANALYTIC_DAILY_REPORT_X_AXIS_LABEL_FOR_'.Statistic::readable($_GET['range'],true);
 
}
if (app()->user->translateMode) {
  for ($i=0;$i<4;$i++) {

    $tag = 'ANALYTIC_DAILY_REPORT_X_AXIS_LABEL_FOR_'.Statistic::readable($i,true);
    echo "<i data-translation-id='".$tag."'>".$tag."= ".__($tag)."</i><br>";
  }
}

$_GET['id'] = !isset($_GET['id']) ? $model->id : $_GET['id'];
$_GET['targetType'] = !isset($_GET['targetType']) ? $this->getTargetType($model) : $_GET['targetType'];

$dataUrl = url('analyticsDailyReport/default/createReport',array_merge($_GET,array('week'=>(int)date('W'))));
echo $this->getParentView('index',array('dataUrl'=>$dataUrl,'xAxisTranslationTag'=>$xAxisTranslationTag));
