| Current Path : /var/www/html/crm/views/stockdelivery/ |
| Current File : /var/www/html/crm/views/stockdelivery/view.php |
<?php
use yii\helpers\Html;
use yii\grid\GridView;
use yii\helpers\Url;
use app\models\Menu;
use app\models\ParamList;
use app\models\Product;
use app\models\Rider;
$ParamList = new ParamList();
$Menu = new Menu();
$this->title = $Menu->getmenutitle($menu_id);
$this->registerCss('.kt-portlet__body{min-height:400px;}');
?>
<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, ''); ?>
<span class="kt-subheader__breadcrumbs-separator"></span><span class="kt-subheader__breadcrumbs-link">View <?= $this->title ?></span>
</div>
</div>
</div>
</div>
<div class="kt-container kt-grid__item kt-grid__item--fluid">
<p><?= Html::a('<i class="fas fa-arrow-left"></i> Back', Url::previous(), ['class' => 'btn btn-warning']) ?></p>
<div class="row">
<div class="col-6">
<div class="kt-portlet kt-portlet--mobile">
<div class="kt-portlet__head"><div class="kt-portlet__head-label"><h5>Receiver Details</h5></div></div>
<div class="kt-portlet__body">
<table class="table">
<tr>
<td class="text-right" width="30%">Company</td>
<td><?= $model->company_name ?></td>
</tr>
<tr>
<td class="text-right">Industry</td>
<td><?= $model->industry; ?></td>
</tr>
<tr>
<td class="text-right">Receiver Name</td>
<td><?= $model->customer_name ?></td>
</tr>
<tr>
<td class="text-right">Phone Number</td>
<td><?= $model->customer_phone ?></td>
</tr>
<tr>
<td class="text-right">Email Address</td>
<td><?= $model->customer_email ?></td>
</tr>
<tr>
<td class="text-right">Address</td>
<td>
<?=
$model->customer_address1 . ' ' .
$model->customer_address2 . ' ' .
$model->customer_address3 . ' ' .
$model->customer_postcode . ' ' .
$model->customer_city . ' ' . $ParamList->getlabel(3, $model->customer_state)
?>
</td>
</tr>
<tr>
<td class="text-right">Reference Number</td>
<td><?= $model->ref_no ?></td>
</tr>
</table>
</div>
</div>
</div>
<div class="col-6">
<div class="kt-portlet kt-portlet--mobile">
<div class="kt-portlet__head"><div class="kt-portlet__head-label"><h5>Item Details</h5></div></div>
<div class="kt-portlet__body">
<div class="row">
<div class="col-9"><h6>Item</h6></div>
<div class="col-3"><h6>Quantity</h6></div>
</div>
<?php
$item_arr = json_decode($model->stock_details, true);
if (!empty($item_arr)) {
foreach ($item_arr as $item_data) {
if (($modelProduct = Product::findOne([$item_data['product_id']])) !== null) {
echo '<div class="pt-2 pb-2 row" style="border-top:1px solid whitesmoke;">
<div class="col-9">' . $modelProduct->name . '</div>
<div class="col-3 text-center">' . $item_data['product_qty'] . '</div>
</div>';
}
}
}
?>
</div>
</div>
</div>
<div class="col-6">
<div class="kt-portlet kt-portlet--mobile">
<div class="kt-portlet__head"><div class="kt-portlet__head-label"><h5>Delivery Details</h5></div></div>
<div class="kt-portlet__body">
<table class="table">
<tr>
<td class="text-right" width="30%">Information Status</td>
<td><?= $ParamList->getlabel(48, $model->details_status); ?></td>
</tr>
<tr>
<td class="text-right">Delivery Date</td>
<td>
<?php
if (!empty($model->delivery_date))
echo date("d M Y", strtotime($model->delivery_date));
?>
</td>
</tr>
<tr>
<td class="text-right">Delivery Status</td>
<td><?= $ParamList->getlabel(46, $model->delivery_status); ?></td>
</tr>
<tr>
<td class="text-right">Upload File</td>
<td>
<?php
if (!empty($model->upload_file)) {
$upload_file_arr = explode('.', $model->upload_file);
if (!empty($upload_file_arr) && !empty($upload_file_arr[1])) {
$upload_file_format = strtolower($upload_file_arr[1]);
if ($upload_file_format == 'png' || $upload_file_format == 'jpg' || $upload_file_format == 'jpeg') {
echo '<a href="uploads/stock_delivery/' . $model->upload_file . '" target="_blank"><img src="uploads/stock_delivery/' . $model->upload_file . '" height="200"></a>';
} else {
echo '<a href="uploads/stock_delivery/' . $model->upload_file . '" target="_blank">Click here to view file</a>';
}
}
}
?>
</td>
</tr>
<tr>
<td class="text-right">Courier</td>
<td><?= $ParamList->getlabel(47, $model->courier); ?></td>
</tr>
<?php
if ($model->courier == 'rider' && !empty($model->rider_id)) {
if (($modelRider = Rider::findOne($model->rider_id)) !== null) {
echo '<tr>
<td class="text-right">Rider Name</td>
<td>' . $modelRider->name . '</td>
</tr>';
echo '<tr>
<td class="text-right">Rider Contact Number</td>
<td>' . $modelRider->phone . '</td>
</tr>';
echo '<tr>
<td class="text-right">Rider ID Number</td>
<td>' . $modelRider->code . '</td>
</tr>';
}
}
?>
<tr>
<td class="text-right">Tracking No</td>
<td><?= $model->tracking_no; ?></td>
</tr>
<tr>
<td class="text-right">Delivery Proof</td>
<td>
<?php
if (!empty($model->delivery_proof)) {
$delivery_proof_arr = explode('.', $model->delivery_proof);
if (!empty($delivery_proof_arr) && !empty($delivery_proof_arr[1])) {
$delivery_proof_format = strtolower($delivery_proof_arr[1]);
if ($delivery_proof_format == 'png' || $delivery_proof_format == 'jpg' || $delivery_proof_format == 'jpeg') {
echo '<a href="uploads/stock_delivery/' . $model->delivery_proof . '" target="_blank"><img src="uploads/stock_delivery/' . $model->delivery_proof . '" height="200"></a>';
} else {
echo '<a href="uploads/stock_delivery/' . $model->delivery_proof . '" target="_blank">Click here to view file</a>';
}
}
}
?>
</td>
</tr>
<tr>
<td class="text-right">Receive Date</td>
<td>
<?php
if (!empty($model->receive_date))
echo date("d M Y", strtotime($model->receive_date));
?>
</td>
</tr>
<tr>
<td class="text-right">Receive Proof</td>
<td>
<?php
if (!empty($model->receive_proof)) {
$receive_proof_arr = explode('.', $model->receive_proof);
if (!empty($receive_proof_arr) && !empty($receive_proof_arr[1])) {
$receive_proof_format = strtolower($receive_proof_arr[1]);
if ($receive_proof_format == 'png' || $receive_proof_format == 'jpg' || $receive_proof_format == 'jpeg') {
echo '<a href="uploads/stock_delivery/' . $model->receive_proof . '" target="_blank"><img src="uploads/stock_delivery/' . $model->receive_proof . '" height="200"></a>';
} else {
echo '<a href="uploads/stock_delivery/' . $model->receive_proof . '" target="_blank">Click here to view file</a>';
}
}
}
?>
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="col-6">
<div class="kt-portlet kt-portlet--mobile">
<div class="kt-portlet__head"><div class="kt-portlet__head-label"><h5>Remarks Details</h5></div></div>
<div class="kt-portlet__body">
<?php
if (!empty($model->rider_remarks)) {
echo '<p class="pb-3" style="border-bottom:1px solid whitesmoke;">Remarks from rider :<br>' . $model->rider_remarks . '</p>';
}
$remarks_arr = json_decode($model->remarks);
if (!empty($remarks_arr)) {
foreach ($remarks_arr as $remarks) {
echo '<p class="pb-3" style="border-bottom:1px solid whitesmoke;">' . $remarks . '</p>';
}
}
?>
</div>
</div>
</div>
</div>
</div>