title = 'Report MP';
?>
registerCssFile(Yii::getAlias('@web') . '/js/datepickerth/css/bootstrap-datepicker.css')?>
registerJsFile('//cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.6.4/js/bootstrap-datepicker.min.js', ['depends' => ['class' => 'yii\web\JqueryAsset']])?>
registerJsFile('//cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.6.4/locales/bootstrap-datepicker.th.min.js', ['depends' => ['class' => 'yii\web\JqueryAsset']])?>
registerJsFile(Yii::getAlias('@web') . '/js/datepickerth/js/bootstrap-datepicker-BE.js', ['depends' => ['class' => 'yii\web\JqueryAsset']])?>
registerJs("
$('.datepicker').datepicker({
format: 'dd/mm/yyyy',
todayBtn: true,
autoclose: true,
todayHighlight: true,
language: 'th', //เปลี่ยน label ต่างของ ปฏิทิน ให้เป็น ภาษาไทย (ต้องใช้ไฟล์ bootstrap-datepicker.th.min.js นี้ด้วย)
thaiyear: true //Set เป็นปี พ.ศ.
}).datepicker(); //กำหนดเป็นวันปัจุบัน
")?>
one();
if ($const->load(Yii::$app->request->get())) {
$const_name = $_GET['ConstServiceCharge']['search'];
$const->search = $const_name;
if($const_name){
$matches = "'".implode("','", $const_name)."'";
$AndRight = "and s.name in (".$matches.") ";
$AndDate = "and s.register_at between '".Yii::$app->iop->searchDateStart($_GET['ConstServiceCharge']['date_start'])."' and '".Yii::$app->iop->searchDateStart($_GET['ConstServiceCharge']['date_end'])."' ";
}else{
$AndRight = "";
$AndDate = "";
$matches = "";
}
}else{
$AndRight = "";
$AndDate = "";
$matches = "";
$const_name ="";
}
//echo $AndRight;
$form = ActiveForm::begin(['method' => 'get', 'action' => 'report1'])?>
=$form->field($const, 'date_start')->textInput(['maxlength' => true, 'class' => 'form-control datepicker'])?>
=$form->field($const, 'date_end')->textInput(['maxlength' => true, 'class' => 'form-control datepicker'])?>
= $form->field($const, 'search')->widget(Select2::classname(),
[ 'data' => ArrayHelper::map(ConstServiceCharge::find()
->select('name')
->andwhere("lab = 'molecular' ")
->all()
,'name','name'),
'options' =>
['placeholder' => 'Select receivers...', 'multiple' => true],
'pluginOptions' =>
[ 'tags' => true,
'maximumInputLength' => 10
],
]);
?>
=Html::submitButton(' ค้นหา', ['class' => 'btn btn-success'])?>
= PrintThis::widget([
'htmlOptions' => [
'id' => 'PrintThis',
'btnClass' => 'btn btn-info',
'btnId' => 'btnPrintThis',
'btnText' => 'พิมพ์หน้านี้',
'btnIcon' => 'fa fa-print'
],
]) ?>
ส่งออกเป็นไฟล์ EXCEL
registerJs('$("[id$=idExcelHisto]").click(function(e) {
window.open(\'data:application/vnd.ms-excel,\' + encodeURIComponent( $(\'div[id$=PrintThis]\').html()));
e.preventDefault();
});') ?>
registerCss("
@media print {
.noprint {display:none !important;}
a:link:after, a:visited:after {
display: none;
content: \"\";
}
}
") ?>