Your IP : 216.73.216.79


Current Path : /var/www/html/crm/views/stockdelivery/
Upload File :
Current File : /var/www/html/crm/views/stockdelivery/reporting2.php

<?php

use yii\helpers\Html;
use yii\grid\GridView;
use yii\helpers\Url;
use app\models\Menu;
use yii\widgets\ActiveForm;
use app\models\ParamList;
use app\models\Product;
use app\models\StockDelivery;
use yii\helpers\ArrayHelper;
use app\models\Rider;
use app\assets\DuallistAsset;

DuallistAsset::register($this);
$Menu = new Menu();
$ParamList = new ParamList();
$this->title = 'Report';
?>
<style>
    .table td{vertical-align:middle;}
    .btn-outline-secondary, select{border-color:  #aaa;}
    label{margin-bottom:0;}
</style>
<div class="kt-subheader  kt-grid__item" id="kt_subheader">
    <div class="kt-container  kt-container--fluid ">
        <div class="kt-subheader__main">
            <h3 class="kt-subheader__title"><?= $this->title ?></h3>
            <div class="kt-subheader__breadcrumbs">
                <?= $Menu->getbreadcrumbs($menu_id, ''); ?>
            </div>
        </div>
    </div>
</div>
<div class="kt-container kt-grid__item kt-grid__item--fluid">
    <div class="kt-portlet">
        <div class="kt-portlet__body">
            <div class="kt-portlet__content">
                <?php $form = ActiveForm::begin(['action' => ['reporting2'], 'method' => 'post']); ?>
                <h4 style="margin-bottom:1em;"  class="text-center">Fill in the below form for searching data</h4>
                <table class="table">
                    <tr>
                        <td class="text-right" width="15%"><label>Company</label></td>
                        <td width="35%"><?= Html::textInput('company_name', Yii::$app->request->post('company_name'), ['class' => 'form-control']) ?></td>
                        <td class="text-right" width="15%"><label>Industry</label></td>
                        <td width="35%"><?= Html::textInput('industry', Yii::$app->request->post('industry'), ['class' => 'form-control']) ?></td>
                    </tr>
                    <tr>
                        <td class="text-right"><label>Receiver Name</label></td>
                        <td><?= Html::textInput('customer_name', Yii::$app->request->post('customer_name'), ['class' => 'form-control']) ?></td>
                        <td class="text-right"><label>Phone Number</label></td>
                        <td><?= Html::textInput('customer_phone', Yii::$app->request->post('customer_phone'), ['class' => 'form-control']) ?></td>
                    </tr>
                    <tr>
                        <td class="text-right"><label>Email Address</label></td>
                        <td><?= Html::textInput('customer_email', Yii::$app->request->post('customer_email'), ['class' => 'form-control']) ?></td>
                        <td class="text-right"><label>Address</label></td>
                        <td><?= Html::textInput('customer_address', Yii::$app->request->post('customer_address'), ['class' => 'form-control']) ?></td>
                    </tr>
                    <tr>
                        <td class="text-right"><label>Postcode</label></td>
                        <td><?= Html::textInput('customer_postcode', Yii::$app->request->post('customer_postcode'), ['class' => 'form-control']) ?></td>
                        <td class="text-right"><label>City</label></td>
                        <td><?= Html::textInput('customer_city', Yii::$app->request->post('customer_city'), ['class' => 'form-control']) ?></td>
                    </tr>
                    <tr>
                        <td class="text-right"><label>State</label></td>
                        <td>
                            <?=
                            Html::dropDownList('customer_state', Yii::$app->request->post('customer_state'), $ParamList->getparamlist(3),
                                    ['class' => 'form-control kt-selectpicker', 'prompt' => '-- Please choose --', 'data-live-search' => 'true'])
                            ?>
                        </td>
                        <td class="text-right"><label>Reference Number</label></td>
                        <td><?= Html::textInput('ref_no', Yii::$app->request->post('ref_no'), ['class' => 'form-control']) ?></td>
                    </tr>
                    <tr>
                        <td class="text-right"><label>Item</label></td>
                        <td>
                            <?=
                            Html::dropDownList('stock_details', Yii::$app->request->post('stock_details'), ArrayHelper::map(Product::find()->where(['=', 'status', '1'])->orderBy(['name' => SORT_ASC])->all(), 'id', 'name'),
                                    ['class' => 'form-control kt-selectpicker', 'prompt' => '-- Please choose --', 'data-live-search' => 'true'])
                            ?>
                        </td>
                        <td class="text-right"><label>Information Status</label></td>
                        <td>
                            <?=
                            Html::dropDownList('details_status', Yii::$app->request->post('details_status'), $ParamList->getparamlist(48),
                                    ['class' => 'form-control kt-selectpicker', 'prompt' => '-- Please choose --', 'data-live-search' => 'true'])
                            ?>
                        </td>
                    </tr>
                    <tr>
                        <td class="text-right"><label>Delivery Status</label></td>
                        <td>
                            <?=
                            Html::dropDownList('delivery_status', Yii::$app->request->post('delivery_status'), $ParamList->getparamlist(46),
                                    ['class' => 'form-control kt-selectpicker', 'prompt' => '-- Please choose --', 'data-live-search' => 'true'])
                            ?>
                        </td>
                        <td class="text-right"><label>Delivery Date</label></td>
                        <td>
                            <div class="input-group input-daterange" data-provide="datepicker" data-date-format="yyyy-mm-dd">
                                <?= Html::textInput('delivery_date_start', Yii::$app->request->post('delivery_date_start'), ['class' => 'form-control', 'placeholder' => 'Start Date']) ?>
                                <div class="input-group-append"><span class="input-group-text"><i class="la la-ellipsis-h"></i></span></div>
                                <?= Html::textInput('delivery_date_end', Yii::$app->request->post('delivery_date_end'), ['class' => 'form-control', 'placeholder' => 'End Date']) ?>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td class="text-right"><label>DO Number</label></td>
                        <td><?= Html::textInput('do_id', Yii::$app->request->post('do_id'), ['class' => 'form-control']) ?></td>
                        <td class="text-right"><label>Courier</label></td>
                        <td>
                            <?=
                            Html::dropDownList('courier', Yii::$app->request->post('courier'), $ParamList->getparamlist(47),
                                    ['class' => 'form-control kt-selectpicker', 'prompt' => '-- Please choose --', 'data-live-search' => 'true'])
                            ?>
                        </td>
                    </tr>
                    <tr>
                        <td class="text-right"><label>Tracking No</label></td>
                        <td><?= Html::textInput('tracking_no', Yii::$app->request->post('tracking_no'), ['class' => 'form-control']) ?></td>
                        <td class="text-right"><label>Receive Date</label></td>
                        <td>
                            <div class="input-group input-daterange" data-provide="datepicker" data-date-format="yyyy-mm-dd">
                                <?= Html::textInput('receive_date_start', Yii::$app->request->post('receive_date_start'), ['class' => 'form-control', 'placeholder' => 'Start Date']) ?>
                                <div class="input-group-append"><span class="input-group-text"><i class="la la-ellipsis-h"></i></span></div>
                                <?= Html::textInput('receive_date_end', Yii::$app->request->post('receive_date_end'), ['class' => 'form-control', 'placeholder' => 'End Date']) ?>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td class="text-right"><label>Remarks</label></td>
                        <td><?= Html::textInput('remarks', Yii::$app->request->post('remarks'), ['class' => 'form-control']) ?></td>
                        <td class="text-right"><label>Rider</label></td>
                        <td>
                            <?=
                            Html::dropDownList('rider_id', Yii::$app->request->post('rider_id'), ArrayHelper::map(Rider::find()->orderBy(['name' => SORT_ASC])->all(), 'id', 'name'),
                                    ['class' => 'form-control kt-selectpicker', 'prompt' => '-- Please choose --', 'data-live-search' => 'true'])
                            ?>
                        </td>
                    </tr>
                    <tr>
                        <td class="text-right"><label>Rider Wages Status</label></td>
                        <td>
                            <?=
                            Html::dropDownList('rider_wages_status', Yii::$app->request->post('rider_wages_status'), ['pending' => 'Pending', 'paid' => 'Paid'],
                                    ['class' => 'form-control kt-selectpicker', 'prompt' => '-- Please choose --', 'data-live-search' => 'true'])
                            ?>
                        </td>
                        <td class="text-right"><label>Rider Wages Amount(RM)</label></td>
                        <td><?= Html::textInput('rider_wages_amount', Yii::$app->request->post('rider_wages_amount'), ['class' => 'form-control']) ?></td>
                    </tr>
                    <tr>
                        <td class="text-right"><label>Year</label></td>
                        <td>
                            <?php
                            $year_arr = [];
                            for ($y = date('Y'); $y > 2021; $y--) {
                                $year_arr[$y] = $y;
                            }

                            echo Html::dropDownList('search_year', Yii::$app->request->post('search_year'), $year_arr,
                                    ['class' => 'form-control kt-selectpicker', 'prompt' => '-- Please choose --', 'data-live-search' => 'true'])
                            ?>
                        </td>
                    </tr>
                </table>
                <h4 style="margin-bottom:1em;" class="text-center">Select data to display at the report</h4>
                <?=
                Html::dropDownList('data_list[]', Yii::$app->request->post('data_list'), [
                    'company_name' => 'Company',
                    'industry' => 'Industry',
                    'customer_name' => 'Receiver Name',
                    'customer_phone' => 'Phone Number',
                    'customer_email' => 'Email Address',
                    'customer_address1' => 'Address Line 1',
                    'customer_address2' => 'Address Line 2',
                    'customer_address3' => 'Address Line 3',
                    'customer_postcode' => 'Postcode',
                    'customer_city' => 'City',
                    'customer_state' => 'State',
                    'ref_no' => 'Reference Number',
                    'stock_details' => 'Item',
                    'details_status' => 'Information Status',
                    'delivery_status' => 'Delivery Status',
                    'delivery_date' => 'Delivery Date',
                    'do_id' => 'DO Number',
                    'courier' => 'Courier',
                    'tracking_no' => 'Tracking No',
                    'receive_date' => 'Receive Date',
                    'remarks' => 'Remarks',
                    'rider_id' => 'Rider',
                    'rider_wages_status' => 'Rider Wages Status',
                    'rider_wages_amount' => 'Rider Wages Amount(RM)',
                        ], ['class' => 'data_list', 'multiple' => 'multiple', 'size' => '10'])
                ?><br><br><br>
                <center>
                    <?= Html::a('Back', ['index'], ['class' => 'btn btn-warning']) ?>
                    <?= Html::a('Reset', ['reporting2'], ['class' => 'btn btn-brand']) ?>
                    <?= Html::submitButton('Export as Excel', ['class' => 'btn btn-success btn-excel', 'name' => 'excel', 'value' => '1']) ?>
                    <?= Html::submitButton('Export as PDF', ['class' => 'btn btn-danger btn-pdf', 'name' => 'pdf', 'value' => '1']) ?>
                </center>

                <?php ActiveForm::end(); ?>
            </div>
        </div>
    </div>
</div>
<?php
$this->registerJs('
    $(".data_list").bootstrapDualListbox();
    $(".btn-excel").click(function(){
        $(".btn-pdf").hide();
    });
    $(".btn-pdf").click(function(){
        $(".btn-excel").hide();
    });
    ');
?>