<commit_before><?php

use yii\helpers\Url;
use yii\web\JsExpression;
use yii\bootstrap\Modal;
use common\components\MyHelper;

$this->registerCss($this->render('custom.css'));
$this->registerCss($this->render('cursor.css'));
//$this->registerJs($this->render('click.js'));

$this->title = "CM...";
$this->params['breadcrumbs'][] = ['label' => 'รายชื่อ', 'url' => ['/patient']];
$this->params['breadcrumbs'][] = ['label' => 'ข้อมูล', 'url' => ['/patient/patient/view', 'pid' => $pid]];
$this->params['breadcrumbs'][] = "CP: " . $model->prename . $model->name . " " . $model->lname 
. "(ADL=" . $model->adl . ",TAI=" . $model->tai . " ,".$model->class_name.")";



$cm_click = "
    function(calEvent, jsEvent, view) {   
        console.log(view.name);
        if(view.name!='month'){ 
            //if (calEvent.url) return false;
        }
        if (calEvent.url) {  
            
            $('#modal').modal('show').find('#modalContent').load(calEvent.url);
            
            return false;
        }
         
    }
";

$cg_click = "
    function(calEvent, jsEvent, view) {   
        console.log(view.name);        
        if(view.name!='listDay' && view.name!='listWeek' && view.name!='agendaWeek'){ 
            //if (calEvent.url) return false;
        }
        if (calEvent.url) {  
            
            $('#modal').modal('show').find('#modalContent').load(calEvent.url);
            
            return false;
        }
         
    }
";

$event_click = MyHelper::isCg() ? $cg_click : $cm_click;
?>

<?php

echo \yii2fullcalendar\yii2fullcalendar::widget(array(
    'events' => $events,
    'options' => [
        'lang' => 'th',
        //'locale'=>'en',
        'id' => 'calendar',
    ],
    'header' => [
        'center' => 'title',
        'right' => 'month,agendaWeek,listWeek,listDay',
        'left' => 'prev,next today'
    ],
    'clientOptions' => [
        'firstDay' => '1',
        'height' => new JsExpression('function(e){return $(window).height() - 100;}'),
        //'defaultView' => 'listWeek',
        'eventClick' => new JsExpression($event_click),
        'timeFormat' => 'H:mm',
        'eventLimit' => true,
        'dayNamesShort' => ['อา', 'จ', 'อ', 'พ', 'พฤ', 'ศ', 'ส'],
        'slotLabelFormat'=>'H:mm',
        //'minTime'=>'06:00'
    ]
));


Modal::begin([
    'header' => 'เพิ่ม-แก้ไข แผนการดูแล',
    'size' => 'modal-lg',
    'id' => 'modal',
]);
echo "<div id='modalContent'></div>";

Modal::end();

$js = <<<JS
     $(document).on('click','.fc-day-number',function(){
    //$('.fc-day-number').click(function(){        
       var date = $(this).parent().attr('data-date');
       console.log(date);       
       $('#modal').modal('show').find('#modalContent').load('index.php?r=care/plan/create&start='+date+'&pid=$pid');
       return false;
    });      
JS;
if (MyHelper::isCm()) {
    $this->registerJs($js);
}






<commit_msg>utehn-smartcare<commit_after><?php

use yii\helpers\Url;
use yii\web\JsExpression;
use yii\bootstrap\Modal;
use common\components\MyHelper;

$this->registerCss($this->render('custom.css'));
$this->registerCss($this->render('cursor.css'));
//$this->registerJs($this->render('click.js'));

$this->title = $model->prename . $model->name . " " . $model->lname;
$this->params['breadcrumbs'][] = ['label' => 'รายชื่อ', 'url' => ['/patient']];
$this->params['breadcrumbs'][] = ['label' => 'ข้อมูล', 'url' => ['/patient/patient/view', 'pid' => $pid]];
//$this->params['breadcrumbs'][] = '';
?>
<div style="background-color:#ffc0cb;color: black; padding: 5px;margin-bottom: 5px">
    <?php
   echo "<b> แผนการดูแลของ : " . $model->prename . $model->name . " " . $model->lname 
        . " (ADL=" . $model->adl . ",TAI=" . $model->tai . " ,".$model->class_name.")</b>";
    ?>
</div>

<?php


$cm_click = "
    function(calEvent, jsEvent, view) {   
        console.log(view.name);
        if(view.name!='month'){ 
            //if (calEvent.url) return false;
        }
        if (calEvent.url) {  
            
            $('#modal').modal('show').find('#modalContent').load(calEvent.url);
            
            return false;
        }
         
    }
";

$cg_click = "
    function(calEvent, jsEvent, view) {   
        console.log(view.name);        
        if(view.name!='listDay' && view.name!='listWeek' && view.name!='agendaWeek'){ 
            //if (calEvent.url) return false;
        }
        if (calEvent.url) {  
            
            $('#modal').modal('show').find('#modalContent').load(calEvent.url);
            
            return false;
        }
         
    }
";

$event_click = MyHelper::isCg() ? $cg_click : $cm_click;
?>

<?php

echo \yii2fullcalendar\yii2fullcalendar::widget(array(
    'events' => $events,
    'options' => [
        'lang' => 'th',
        //'locale'=>'en',
        'id' => 'calendar',
    ],
    'header' => [
        'center' => 'title',
        'right' => 'month,agendaWeek,listWeek,listDay',
        'left' => 'prev,next today'
    ],
    'clientOptions' => [
        'firstDay' => '1',
        'height' => new JsExpression('function(e){return $(window).height() - 100;}'),
        //'defaultView' => 'listWeek',
        'eventClick' => new JsExpression($event_click),
        'timeFormat' => 'H:mm',
        'eventLimit' => true,
        'dayNamesShort' => ['อา', 'จ', 'อ', 'พ', 'พฤ', 'ศ', 'ส'],
        'slotLabelFormat'=>'H:mm',
        //'minTime'=>'06:00'
    ]
));


Modal::begin([
    'header' => 'เพิ่ม-แก้ไข แผนการดูแล',
    'size' => 'modal-lg',
    'id' => 'modal',
]);
echo "<div id='modalContent'></div>";

Modal::end();

$js = <<<JS
     $(document).on('click','.fc-day-number',function(){
    //$('.fc-day-number').click(function(){        
       var date = $(this).parent().attr('data-date');
       console.log(date);       
       $('#modal').modal('show').find('#modalContent').load('index.php?r=care/plan/create&start='+date+'&pid=$pid');
       return false;
    });      
JS;
if (MyHelper::isCm()) {
    $this->registerJs($js);
}







{'fraction_non_alphanumeric': 0.2385947385947386, 'fraction_numerical': 0.0038295038295038295, 'mean_word_length': 2.4904125508425334, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 106, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3508684', 'n_tokens_mistral': 2156, 'n_tokens_neox': 2166, 'n_words': 303}