update
This commit is contained in:
663
app/Helper.php
663
app/Helper.php
@ -6,353 +6,380 @@ use App\Models\OrdersInvoices;
|
|||||||
|
|
||||||
class Helper
|
class Helper
|
||||||
{
|
{
|
||||||
|
const EARTH_RADIUS_M = 6371000;
|
||||||
|
const EARTH_RADIUS_KM = 6371;
|
||||||
|
const EARTH_RADIUS_MILES = 3959; // 3958.756 || 3959 || 3963
|
||||||
|
|
||||||
const EARTH_RADIUS_M = 6371000;
|
/**
|
||||||
const EARTH_RADIUS_KM = 6371;
|
* Calculates the great-circle distance between two points, with
|
||||||
const EARTH_RADIUS_MILES = 3959; // 3958.756 || 3959 || 3963
|
* the Haversine formula.
|
||||||
|
* @param float $latitudeFrom Latitude of start point in [deg decimal]
|
||||||
|
* @param float $longitudeFrom Longitude of start point in [deg decimal]
|
||||||
|
* @param float $latitudeTo Latitude of target point in [deg decimal]
|
||||||
|
* @param float $longitudeTo Longitude of target point in [deg decimal]
|
||||||
|
* @param float $earthRadius Mean earth radius in [m]
|
||||||
|
* @return float Distance between points in [m] (same as earthRadius)
|
||||||
|
* reference: https://stackoverflow.com/questions/14750275/haversine-formula-with-php
|
||||||
|
* tolak ukur: tarik garis lurus
|
||||||
|
* miles: 3958.756 || 3959
|
||||||
|
* km: 6371
|
||||||
|
* meters: 6371000
|
||||||
|
* more accurate using km/meters than miles i think
|
||||||
|
*/
|
||||||
|
public static function haversineGreatCircleDistance(
|
||||||
|
$latitudeFrom,
|
||||||
|
$longitudeFrom,
|
||||||
|
$latitudeTo,
|
||||||
|
$longitudeTo,
|
||||||
|
$earthRadius = self::EARTH_RADIUS_M
|
||||||
|
) {
|
||||||
|
// convert from degrees to radians
|
||||||
|
$latFrom = deg2rad($latitudeFrom);
|
||||||
|
$lonFrom = deg2rad($longitudeFrom);
|
||||||
|
$latTo = deg2rad($latitudeTo);
|
||||||
|
$lonTo = deg2rad($longitudeTo);
|
||||||
|
|
||||||
/**
|
$latDelta = $latTo - $latFrom;
|
||||||
* Calculates the great-circle distance between two points, with
|
$lonDelta = $lonTo - $lonFrom;
|
||||||
* the Haversine formula.
|
|
||||||
* @param float $latitudeFrom Latitude of start point in [deg decimal]
|
|
||||||
* @param float $longitudeFrom Longitude of start point in [deg decimal]
|
|
||||||
* @param float $latitudeTo Latitude of target point in [deg decimal]
|
|
||||||
* @param float $longitudeTo Longitude of target point in [deg decimal]
|
|
||||||
* @param float $earthRadius Mean earth radius in [m]
|
|
||||||
* @return float Distance between points in [m] (same as earthRadius)
|
|
||||||
* reference: https://stackoverflow.com/questions/14750275/haversine-formula-with-php
|
|
||||||
* tolak ukur: tarik garis lurus
|
|
||||||
* miles: 3958.756 || 3959
|
|
||||||
* km: 6371
|
|
||||||
* meters: 6371000
|
|
||||||
* more accurate using km/meters than miles i think ~ rafifmulia
|
|
||||||
*/
|
|
||||||
public static function haversineGreatCircleDistance(
|
|
||||||
$latitudeFrom,
|
|
||||||
$longitudeFrom,
|
|
||||||
$latitudeTo,
|
|
||||||
$longitudeTo,
|
|
||||||
$earthRadius = self::EARTH_RADIUS_M
|
|
||||||
) {
|
|
||||||
// convert from degrees to radians
|
|
||||||
$latFrom = deg2rad($latitudeFrom);
|
|
||||||
$lonFrom = deg2rad($longitudeFrom);
|
|
||||||
$latTo = deg2rad($latitudeTo);
|
|
||||||
$lonTo = deg2rad($longitudeTo);
|
|
||||||
|
|
||||||
$latDelta = $latTo - $latFrom;
|
$angle =
|
||||||
$lonDelta = $lonTo - $lonFrom;
|
2 *
|
||||||
|
asin(sqrt(pow(sin($latDelta / 2), 2) + cos($latFrom) * cos($latTo) * pow(sin($lonDelta / 2), 2)));
|
||||||
|
$distance = $angle * $earthRadius;
|
||||||
|
|
||||||
$angle = 2 * asin(sqrt(pow(sin($latDelta / 2), 2) + cos($latFrom) * cos($latTo) * pow(sin($lonDelta / 2), 2)));
|
return $distance;
|
||||||
$distance = $angle * $earthRadius;
|
}
|
||||||
|
|
||||||
return $distance;
|
public static function arccosineGreatCircleDistance(
|
||||||
}
|
$latitudeFrom,
|
||||||
|
$longitudeFrom,
|
||||||
|
$latitudeTo,
|
||||||
|
$longitudeTo,
|
||||||
|
$earthRadius = 6371000
|
||||||
|
) {
|
||||||
|
return $earthRadius *
|
||||||
|
acos(
|
||||||
|
cos(deg2rad($latitudeFrom)) *
|
||||||
|
cos(deg2rad($latitudeTo)) *
|
||||||
|
cos(deg2rad($longitudeTo) - deg2rad($longitudeFrom)) +
|
||||||
|
sin(deg2rad($latitudeFrom)) * sin(deg2rad($latitudeTo))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
public static function arccosineGreatCircleDistance(
|
public static function createPayload($array)
|
||||||
$latitudeFrom,
|
{
|
||||||
$longitudeFrom,
|
$string = "";
|
||||||
$latitudeTo,
|
|
||||||
$longitudeTo,
|
|
||||||
$earthRadius = 6371000
|
|
||||||
) {
|
|
||||||
return ($earthRadius * acos((cos(deg2rad($latitudeFrom))) * (cos(deg2rad($latitudeTo))) * (cos(deg2rad($longitudeTo) - deg2rad($longitudeFrom))) + ((sin(deg2rad($latitudeFrom))) * (sin(deg2rad($latitudeTo))))));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function createPayload($array)
|
foreach ($array as $key => $val) {
|
||||||
{
|
if (is_array($val)) {
|
||||||
$string = '';
|
self::createPayload($val);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$string .= $key . "=" . $val . "&";
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($array as $key => $val) {
|
return $string;
|
||||||
if (is_array($val)) {
|
}
|
||||||
self::createPayload($val);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
$string .= $key . '=' . $val . '&';
|
|
||||||
}
|
|
||||||
|
|
||||||
return $string;
|
static function req_post($url, $headers, $payload)
|
||||||
}
|
{
|
||||||
|
$ch = curl_init();
|
||||||
|
|
||||||
static function req_post($url, $headers, $payload)
|
$options = [
|
||||||
{
|
CURLOPT_URL => $url,
|
||||||
$ch = curl_init();
|
CURLOPT_HEADER => false,
|
||||||
|
CURLOPT_HTTPHEADER => $headers,
|
||||||
|
CURLOPT_POST => 1,
|
||||||
|
CURLOPT_POSTFIELDS => $payload,
|
||||||
|
CURLOPT_FOLLOWLOCATION => true,
|
||||||
|
CURLOPT_RETURNTRANSFER => true,
|
||||||
|
// CURLOPT_FAILONERROR => true,
|
||||||
|
];
|
||||||
|
curl_setopt_array($ch, $options);
|
||||||
|
|
||||||
$options = [
|
$resp = curl_exec($ch);
|
||||||
CURLOPT_URL => $url,
|
|
||||||
CURLOPT_HEADER => false,
|
|
||||||
CURLOPT_HTTPHEADER => $headers,
|
|
||||||
CURLOPT_POST => 1,
|
|
||||||
CURLOPT_POSTFIELDS => $payload,
|
|
||||||
CURLOPT_FOLLOWLOCATION => true,
|
|
||||||
CURLOPT_RETURNTRANSFER => true,
|
|
||||||
// CURLOPT_FAILONERROR => true,
|
|
||||||
];
|
|
||||||
curl_setopt_array($ch, $options);
|
|
||||||
|
|
||||||
$resp = curl_exec($ch);
|
if (curl_errno($ch)) {
|
||||||
|
$result = [
|
||||||
|
"type" => "error",
|
||||||
|
"message" => curl_error($ch),
|
||||||
|
];
|
||||||
|
return $result;
|
||||||
|
} else {
|
||||||
|
$result = ["type" => "success"];
|
||||||
|
try {
|
||||||
|
$data = json_decode($resp);
|
||||||
|
|
||||||
if (curl_errno($ch)) {
|
if (json_last_error() == JSON_ERROR_NONE) {
|
||||||
|
$result["data"] = $data;
|
||||||
|
} else {
|
||||||
|
$result["data"] = $resp;
|
||||||
|
}
|
||||||
|
|
||||||
$result = [
|
return $result;
|
||||||
'type' => 'error',
|
} catch (\Exception $e) {
|
||||||
'message' => curl_error($ch)
|
$result["data"] = $resp;
|
||||||
];
|
return $result;
|
||||||
return $result;
|
}
|
||||||
} else {
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$result = ['type' => 'success'];
|
static function req_get($url, $headers)
|
||||||
try {
|
{
|
||||||
$data = json_decode($resp);
|
$ch = curl_init();
|
||||||
|
|
||||||
if (json_last_error() == JSON_ERROR_NONE) {
|
$options = [
|
||||||
$result['data'] = $data;
|
CURLOPT_URL => $url,
|
||||||
} else {
|
CURLOPT_HTTPHEADER => $headers,
|
||||||
$result['data'] = $resp;
|
CURLOPT_FOLLOWLOCATION => true,
|
||||||
}
|
CURLOPT_RETURNTRANSFER => true,
|
||||||
|
// CURLOPT_FAILONERROR => true,
|
||||||
|
];
|
||||||
|
curl_setopt_array($ch, $options);
|
||||||
|
|
||||||
return $result;
|
$resp = curl_exec($ch);
|
||||||
} catch (\Exception $e) {
|
|
||||||
$result['data'] = $resp;
|
|
||||||
return $result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static function req_get($url, $headers)
|
if (curl_errno($ch)) {
|
||||||
{
|
$result = [
|
||||||
$ch = curl_init();
|
"type" => "error",
|
||||||
|
"message" => curl_error($ch),
|
||||||
|
];
|
||||||
|
return $result;
|
||||||
|
} else {
|
||||||
|
$result = ["type" => "success"];
|
||||||
|
try {
|
||||||
|
$data = json_decode($resp);
|
||||||
|
|
||||||
$options = [
|
if (json_last_error() == JSON_ERROR_NONE) {
|
||||||
CURLOPT_URL => $url,
|
$result["data"] = $data;
|
||||||
CURLOPT_HTTPHEADER => $headers,
|
} else {
|
||||||
CURLOPT_FOLLOWLOCATION => true,
|
$result["data"] = $resp;
|
||||||
CURLOPT_RETURNTRANSFER => true,
|
}
|
||||||
// CURLOPT_FAILONERROR => true,
|
|
||||||
];
|
|
||||||
curl_setopt_array($ch, $options);
|
|
||||||
|
|
||||||
$resp = curl_exec($ch);
|
return $result;
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$result["data"] = $resp;
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (curl_errno($ch)) {
|
public static function listBloods()
|
||||||
$result = [
|
{
|
||||||
'type' => 'error',
|
return [
|
||||||
'message' => curl_error($ch)
|
[
|
||||||
];
|
"id" => "A",
|
||||||
return $result;
|
"name" => "A",
|
||||||
} else {
|
],
|
||||||
$result = ['type' => 'success'];
|
[
|
||||||
try {
|
"id" => "A+",
|
||||||
$data = json_decode($resp);
|
"name" => "A+",
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"id" => "B",
|
||||||
|
"name" => "B",
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"id" => "B+",
|
||||||
|
"name" => "B+",
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"id" => "O",
|
||||||
|
"name" => "O",
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"id" => "O+",
|
||||||
|
"name" => "O+",
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"id" => "AB",
|
||||||
|
"name" => "AB",
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"id" => "AB+",
|
||||||
|
"name" => "AB+",
|
||||||
|
],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
if (json_last_error() == JSON_ERROR_NONE) {
|
public static function countAge($date_ymd)
|
||||||
$result['data'] = $data;
|
{
|
||||||
} else {
|
$then = date("Ymd", strtotime($date_ymd));
|
||||||
$result['data'] = $resp;
|
$diff = date("Ymd") - $then;
|
||||||
}
|
return (int) substr($diff, 0, -4);
|
||||||
|
}
|
||||||
|
|
||||||
return $result;
|
public static function terbilang($nilai)
|
||||||
} catch (\Exception $e) {
|
{
|
||||||
$result['data'] = $resp;
|
function penyebut($nilai)
|
||||||
return $result;
|
{
|
||||||
}
|
$nilai = abs($nilai);
|
||||||
}
|
$huruf = [
|
||||||
}
|
"",
|
||||||
|
"satu",
|
||||||
|
"dua",
|
||||||
|
"tiga",
|
||||||
|
"empat",
|
||||||
|
"lima",
|
||||||
|
"enam",
|
||||||
|
"tujuh",
|
||||||
|
"delapan",
|
||||||
|
"sembilan",
|
||||||
|
"sepuluh",
|
||||||
|
"sebelas",
|
||||||
|
];
|
||||||
|
$temp = "";
|
||||||
|
if ($nilai < 12) {
|
||||||
|
$temp = " " . $huruf[$nilai];
|
||||||
|
} elseif ($nilai < 20) {
|
||||||
|
$temp = penyebut($nilai - 10) . " belas";
|
||||||
|
} elseif ($nilai < 100) {
|
||||||
|
$temp = penyebut($nilai / 10) . " puluh" . penyebut($nilai % 10);
|
||||||
|
} elseif ($nilai < 200) {
|
||||||
|
$temp = " seratus" . penyebut($nilai - 100);
|
||||||
|
} elseif ($nilai < 1000) {
|
||||||
|
$temp = penyebut($nilai / 100) . " ratus" . penyebut($nilai % 100);
|
||||||
|
} elseif ($nilai < 2000) {
|
||||||
|
$temp = " seribu" . penyebut($nilai - 1000);
|
||||||
|
} elseif ($nilai < 1000000) {
|
||||||
|
$temp = penyebut($nilai / 1000) . " ribu" . penyebut($nilai % 1000);
|
||||||
|
} elseif ($nilai < 1000000000) {
|
||||||
|
$temp = penyebut($nilai / 1000000) . " juta" . penyebut($nilai % 1000000);
|
||||||
|
} elseif ($nilai < 1000000000000) {
|
||||||
|
$temp = penyebut($nilai / 1000000000) . " milyar" . penyebut(fmod($nilai, 1000000000));
|
||||||
|
} elseif ($nilai < 1000000000000000) {
|
||||||
|
$temp = penyebut($nilai / 1000000000000) . " trilyun" . penyebut(fmod($nilai, 1000000000000));
|
||||||
|
}
|
||||||
|
return $temp;
|
||||||
|
}
|
||||||
|
|
||||||
public static function listBloods()
|
if ($nilai < 0) {
|
||||||
{
|
$hasil = "minus " . trim(penyebut($nilai));
|
||||||
return [
|
} else {
|
||||||
[
|
$hasil = trim(penyebut($nilai));
|
||||||
'id' => 'A',
|
}
|
||||||
'name' => 'A',
|
return $hasil;
|
||||||
],
|
}
|
||||||
[
|
|
||||||
'id' => 'A+',
|
|
||||||
'name' => 'A+',
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'id' => 'B',
|
|
||||||
'name' => 'B',
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'id' => 'B+',
|
|
||||||
'name' => 'B+',
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'id' => 'O',
|
|
||||||
'name' => 'O',
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'id' => 'O+',
|
|
||||||
'name' => 'O+',
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'id' => 'AB',
|
|
||||||
'name' => 'AB',
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'id' => 'AB+',
|
|
||||||
'name' => 'AB+',
|
|
||||||
],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function countAge($date_ymd)
|
public static function lastDigitYear()
|
||||||
{
|
{
|
||||||
$then = date('Ymd', strtotime($date_ymd));
|
// 2023 => 3
|
||||||
$diff = date('Ymd') - $then;
|
return substr(date("Y"), -1);
|
||||||
return (int) substr($diff, 0, -4);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public static function terbilang($nilai)
|
public static function weekNumOfYear()
|
||||||
{
|
{
|
||||||
function penyebut($nilai) {
|
// 27 jul 2022 => 30
|
||||||
$nilai = abs($nilai);
|
return date("W");
|
||||||
$huruf = array("", "satu", "dua", "tiga", "empat", "lima", "enam", "tujuh", "delapan", "sembilan", "sepuluh", "sebelas");
|
}
|
||||||
$temp = "";
|
|
||||||
if ($nilai < 12) {
|
|
||||||
$temp = " ". $huruf[$nilai];
|
|
||||||
} else if ($nilai <20) {
|
|
||||||
$temp = penyebut($nilai - 10). " belas";
|
|
||||||
} else if ($nilai < 100) {
|
|
||||||
$temp = penyebut($nilai/10)." puluh". penyebut($nilai % 10);
|
|
||||||
} else if ($nilai < 200) {
|
|
||||||
$temp = " seratus" . penyebut($nilai - 100);
|
|
||||||
} else if ($nilai < 1000) {
|
|
||||||
$temp = penyebut($nilai/100) . " ratus" . penyebut($nilai % 100);
|
|
||||||
} else if ($nilai < 2000) {
|
|
||||||
$temp = " seribu" . penyebut($nilai - 1000);
|
|
||||||
} else if ($nilai < 1000000) {
|
|
||||||
$temp = penyebut($nilai/1000) . " ribu" . penyebut($nilai % 1000);
|
|
||||||
} else if ($nilai < 1000000000) {
|
|
||||||
$temp = penyebut($nilai/1000000) . " juta" . penyebut($nilai % 1000000);
|
|
||||||
} else if ($nilai < 1000000000000) {
|
|
||||||
$temp = penyebut($nilai/1000000000) . " milyar" . penyebut(fmod($nilai,1000000000));
|
|
||||||
} else if ($nilai < 1000000000000000) {
|
|
||||||
$temp = penyebut($nilai/1000000000000) . " trilyun" . penyebut(fmod($nilai,1000000000000));
|
|
||||||
}
|
|
||||||
return $temp;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($nilai < 0) {
|
public static function dayOfWeek()
|
||||||
$hasil = "minus " . trim(penyebut($nilai));
|
{
|
||||||
} else {
|
// monday => 01, sunday => 07
|
||||||
$hasil = trim(penyebut($nilai));
|
return date("N");
|
||||||
}
|
}
|
||||||
return $hasil;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function lastDigitYear()
|
public static function gnrtOrdCode($type)
|
||||||
{
|
{
|
||||||
// 2023 => 3
|
$ord_code = "";
|
||||||
return substr(date('Y'), -1);
|
$ord_code .= $type;
|
||||||
}
|
$ord_code .= Helper::lastDigitYear() . Helper::weekNumOfYear() . Helper::dayOfWeek();
|
||||||
|
// above before running number
|
||||||
|
$likeCode = \App\Models\Orders::getOrderLikeCode($ord_code);
|
||||||
|
// below after running number
|
||||||
|
if (count($likeCode) < 1 || $likeCode === false) {
|
||||||
|
$ord_code .= "001";
|
||||||
|
} else {
|
||||||
|
if ($likeCode[0]->total < 1) {
|
||||||
|
$ord_code .= "001";
|
||||||
|
} else {
|
||||||
|
$ord_code .= str_pad($likeCode[0]->total + 1, 3, "0", STR_PAD_LEFT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $ord_code;
|
||||||
|
}
|
||||||
|
|
||||||
public static function weekNumOfYear()
|
public static function gnrtInvcCode($ord_code)
|
||||||
{
|
{
|
||||||
// 27 jul 2022 => 30
|
$invc_code = "";
|
||||||
return date('W');
|
$type = substr($ord_code, 0, 1);
|
||||||
}
|
$invc_code .= Helper::lastDigitYear() . Helper::weekNumOfYear() . $type;
|
||||||
|
$first_invc_code = $invc_code;
|
||||||
|
// above before running number
|
||||||
|
$likeCode = \App\Models\OrdersInvoices::getLikeCode($invc_code);
|
||||||
|
// below after running number
|
||||||
|
if (count($likeCode) < 1 || $likeCode === false) {
|
||||||
|
$invc_code .= "001";
|
||||||
|
} else {
|
||||||
|
if ($likeCode[0]->total < 1) {
|
||||||
|
$invc_code .= "001";
|
||||||
|
} else {
|
||||||
|
$invc_code .= str_pad($likeCode[0]->total + 1, 3, "0", STR_PAD_LEFT);
|
||||||
|
$checkCode = OrdersInvoices::getByCode($invc_code);
|
||||||
|
if (count($checkCode) > 0) {
|
||||||
|
$invc_code = $first_invc_code;
|
||||||
|
$lastRN = OrdersInvoices::getLikeCodeLastRunningNumber($invc_code);
|
||||||
|
$newRN = (int) substr($lastRN[0]->code, -3);
|
||||||
|
$invc_code .= str_pad($newRN + 1, 3, "0", STR_PAD_LEFT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $invc_code;
|
||||||
|
}
|
||||||
|
|
||||||
public static function dayOfWeek()
|
public static function viewBillFncIsEnableBtn($prev_termin, $curr_termin)
|
||||||
{
|
{
|
||||||
// monday => 01, sunday => 07
|
if ($curr_termin->termin_ddln_type === \App\Models\OrdersTermins::DDLN_TERMIN_TYPE_ORD_FINISH) {
|
||||||
return date('N');
|
if ($curr_termin->drop_chk_at === 0) {
|
||||||
}
|
// Menunggu Pengantaran Selesai
|
||||||
|
// return 0;
|
||||||
|
if ($prev_termin->termin_is_paid === \App\Models\OrdersTermins::IS_PAID_YES) {
|
||||||
|
// Termin sebelumnya selesai dan show btn invoice
|
||||||
|
return 1;
|
||||||
|
} else {
|
||||||
|
// Menunggu Pengantaran Selesai
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if ($curr_termin->termin_is_paid === \App\Models\OrdersTermins::IS_PAID_YES) {
|
||||||
|
// invoice close
|
||||||
|
return 4;
|
||||||
|
} else {
|
||||||
|
if (
|
||||||
|
$prev_termin !== 0 &&
|
||||||
|
$prev_termin->termin_is_paid === \App\Models\OrdersTermins::IS_PAID_NO
|
||||||
|
) {
|
||||||
|
// Termin sebelumnya belum terkonfirmasi selesai
|
||||||
|
return 3;
|
||||||
|
}
|
||||||
|
// Pengantaran Selesai pada and show btn invoice
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if ($curr_termin->termin_is_paid === \App\Models\OrdersTermins::IS_PAID_YES) {
|
||||||
|
// invoice close
|
||||||
|
return 4;
|
||||||
|
} else {
|
||||||
|
if (
|
||||||
|
$prev_termin !== 0 &&
|
||||||
|
$prev_termin->termin_is_paid === \App\Models\OrdersTermins::IS_PAID_NO
|
||||||
|
) {
|
||||||
|
// Termin sebelumnya belum terkonfirmasi selesai
|
||||||
|
return 3;
|
||||||
|
}
|
||||||
|
// show btn invoice
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static function gnrtOrdCode($type) {
|
public static function changeIpToDomain($fullurl)
|
||||||
$ord_code = '';
|
{
|
||||||
$ord_code .= $type;
|
$replace = $fullurl;
|
||||||
$ord_code .= Helper::lastDigitYear() . Helper::weekNumOfYear() . Helper::dayOfWeek();
|
if (!strpos($fullurl, env("ORI_IP")) === false) {
|
||||||
// above before running number
|
$replace = str_replace(env("ORI_IP"), env("ORI_DOMAIN"), $replace);
|
||||||
$likeCode = \App\Models\Orders::getOrderLikeCode($ord_code);
|
}
|
||||||
// below after running number
|
return $replace;
|
||||||
if (count($likeCode) < 1 || $likeCode === false) {
|
}
|
||||||
$ord_code .= '001';
|
|
||||||
} else {
|
|
||||||
if ($likeCode[0]->total < 1) {
|
|
||||||
$ord_code .= '001';
|
|
||||||
} else {
|
|
||||||
$ord_code .= str_pad($likeCode[0]->total + 1, 3, '0', STR_PAD_LEFT);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $ord_code;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function gnrtInvcCode($ord_code) {
|
|
||||||
$invc_code = '';
|
|
||||||
$type = substr($ord_code, 0, 1);
|
|
||||||
$invc_code .= Helper::lastDigitYear() . Helper::weekNumOfYear() . $type;
|
|
||||||
$first_invc_code = $invc_code;
|
|
||||||
// above before running number
|
|
||||||
$likeCode = \App\Models\OrdersInvoices::getLikeCode($invc_code);
|
|
||||||
// below after running number
|
|
||||||
if (count($likeCode) < 1 || $likeCode === false) {
|
|
||||||
$invc_code .= '001';
|
|
||||||
} else {
|
|
||||||
if ($likeCode[0]->total < 1) {
|
|
||||||
$invc_code .= '001';
|
|
||||||
} else {
|
|
||||||
$invc_code .= str_pad($likeCode[0]->total + 1, 3, '0', STR_PAD_LEFT);
|
|
||||||
$checkCode = OrdersInvoices::getByCode($invc_code);
|
|
||||||
if (count($checkCode) > 0) {
|
|
||||||
$invc_code = $first_invc_code;
|
|
||||||
$lastRN = OrdersInvoices::getLikeCodeLastRunningNumber($invc_code);
|
|
||||||
$newRN = (int)substr($lastRN[0]->code, -3);
|
|
||||||
$invc_code .= str_pad($newRN + 1, 3, '0', STR_PAD_LEFT);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $invc_code;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function viewBillFncIsEnableBtn($prev_termin, $curr_termin)
|
|
||||||
{
|
|
||||||
if ($curr_termin->termin_ddln_type === \App\Models\OrdersTermins::DDLN_TERMIN_TYPE_ORD_FINISH) {
|
|
||||||
if ($curr_termin->drop_chk_at === 0) {
|
|
||||||
// Menunggu Pengantaran Selesai
|
|
||||||
// return 0;
|
|
||||||
if ($prev_termin->termin_is_paid === \App\Models\OrdersTermins::IS_PAID_YES) {
|
|
||||||
// Termin sebelumnya selesai dan show btn invoice
|
|
||||||
return 1;
|
|
||||||
} else {
|
|
||||||
// Menunggu Pengantaran Selesai
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if ($curr_termin->termin_is_paid === \App\Models\OrdersTermins::IS_PAID_YES) {
|
|
||||||
// invoice close
|
|
||||||
return 4;
|
|
||||||
} else {
|
|
||||||
if ($prev_termin !== 0 && $prev_termin->termin_is_paid === \App\Models\OrdersTermins::IS_PAID_NO) {
|
|
||||||
// Termin sebelumnya belum terkonfirmasi selesai
|
|
||||||
return 3;
|
|
||||||
}
|
|
||||||
// Pengantaran Selesai pada and show btn invoice
|
|
||||||
return 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if ($curr_termin->termin_is_paid === \App\Models\OrdersTermins::IS_PAID_YES) {
|
|
||||||
// invoice close
|
|
||||||
return 4;
|
|
||||||
} else {
|
|
||||||
if ($prev_termin !== 0 && $prev_termin->termin_is_paid === \App\Models\OrdersTermins::IS_PAID_NO) {
|
|
||||||
// Termin sebelumnya belum terkonfirmasi selesai
|
|
||||||
return 3;
|
|
||||||
}
|
|
||||||
// show btn invoice
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function changeIpToDomain($fullurl)
|
|
||||||
{
|
|
||||||
$replace = $fullurl;
|
|
||||||
if (!strpos($fullurl, env('ORI_IP')) === false) {
|
|
||||||
$replace = str_replace(env('ORI_IP'), env('ORI_DOMAIN'), $replace);
|
|
||||||
}
|
|
||||||
return $replace;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,65 +11,68 @@ use App\Helper;
|
|||||||
|
|
||||||
class LoggerController extends Controller
|
class LoggerController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* API
|
* API
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public function logger(Request $req)
|
public function logger(Request $req)
|
||||||
{
|
{
|
||||||
$now = time();
|
$now = time();
|
||||||
try {
|
try {
|
||||||
$input = [
|
$input = [
|
||||||
'label' => $req->label,
|
"label" => $req->label,
|
||||||
'level' => $req->level,
|
"level" => $req->level,
|
||||||
'logtype' => $req->logtype,
|
"logtype" => $req->logtype,
|
||||||
'keys' => $req->keys,
|
"keys" => $req->keys,
|
||||||
'act' => 'email',
|
"act" => "email",
|
||||||
'to' => ['rafifmreswara@gmail.com'],
|
"to" => ["emirsyafmun@gmail.com"],
|
||||||
'errors' => $req->errors,
|
"errors" => $req->errors,
|
||||||
'vers' => '1.2.1',
|
"vers" => "1.2.1",
|
||||||
'source' => 'service',
|
"source" => "service",
|
||||||
'payloads' => $req->payloads,
|
"payloads" => $req->payloads,
|
||||||
];
|
];
|
||||||
$rulesInput = [
|
$rulesInput = [
|
||||||
'label' => 'required|string',
|
"label" => "required|string",
|
||||||
'level' => 'required|numeric',
|
"level" => "required|numeric",
|
||||||
'logtype' => 'required|string',
|
"logtype" => "required|string",
|
||||||
'keys' => 'required|array',
|
"keys" => "required|array",
|
||||||
'act' => 'required|string',
|
"act" => "required|string",
|
||||||
'to' => 'nullable|array',
|
"to" => "nullable|array",
|
||||||
'errors' => 'nullable|string',
|
"errors" => "nullable|string",
|
||||||
'vers' => 'required|string',
|
"vers" => "required|string",
|
||||||
'source' => 'required|string',
|
"source" => "required|string",
|
||||||
'payloads' => 'nullable|string',
|
"payloads" => "nullable|string",
|
||||||
];
|
];
|
||||||
|
|
||||||
// validasi input
|
// validasi input
|
||||||
$isValidInput = Validator::make($input, $rulesInput);
|
$isValidInput = Validator::make($input, $rulesInput);
|
||||||
if (!$isValidInput->passes()) {
|
if (!$isValidInput->passes()) {
|
||||||
$apiResp = Responses::bad_input($isValidInput->messages()->first());
|
$apiResp = Responses::bad_input($isValidInput->messages()->first());
|
||||||
return new Response($apiResp, $apiResp['meta']['code']);
|
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$payload = Helper::createPayload([
|
$payload = Helper::createPayload([
|
||||||
'usnme' => 'rafif',
|
"usnme" => "emrsyf",
|
||||||
'paswd' => 12345678
|
"paswd" => 12345678,
|
||||||
]);
|
]);
|
||||||
$login = Helper::req_post('https://api.simerahputih.com/logger/login', [
|
$login = Helper::req_post(
|
||||||
'Content-Type: application/x-www-form-urlencoded',
|
"https://api.simerahputih.com/logger/login",
|
||||||
], $payload);
|
["Content-Type: application/x-www-form-urlencoded"],
|
||||||
|
$payload
|
||||||
|
);
|
||||||
|
|
||||||
// $payload = Helper::createPayload($input);
|
// $payload = Helper::createPayload($input);
|
||||||
// dd($payload);
|
// dd($payload);
|
||||||
$resp = Helper::req_post('https://api.simerahputih.com/logger/log', [
|
$resp = Helper::req_post(
|
||||||
'Content-Type: application/json',
|
"https://api.simerahputih.com/logger/log",
|
||||||
'x-api-key: ' . $login['data']->data->token
|
["Content-Type: application/json", "x-api-key: " . $login["data"]->data->token],
|
||||||
], json_encode($input));
|
json_encode($input)
|
||||||
|
);
|
||||||
|
|
||||||
$apiResp = Responses::success('success send log');
|
$apiResp = Responses::success("success send log");
|
||||||
return new Response($apiResp, $apiResp['meta']['code']);
|
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
dd($e);
|
dd($e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -226,16 +226,16 @@ class MenuController extends Controller
|
|||||||
)
|
)
|
||||||
->get();
|
->get();
|
||||||
foreach ($rawData as $_data) {
|
foreach ($rawData as $_data) {
|
||||||
$ehck = DB::table("t_orders_drivers_uploads")
|
// $ehck = DB::table("t_orders_drivers_uploads")
|
||||||
->select(
|
// ->select(
|
||||||
"id", //
|
// "id", //
|
||||||
"checklist_name",
|
// "checklist_name",
|
||||||
"checklist_desc",
|
// "checklist_desc",
|
||||||
"img",
|
// "img",
|
||||||
"updt"
|
// "updt"
|
||||||
)
|
// )
|
||||||
->where("ord_pck_drop_id", $_data->id)
|
// ->where("ord_pck_drop_id", $_data->id)
|
||||||
->get();
|
// ->get();
|
||||||
$data[] = [
|
$data[] = [
|
||||||
"id" => $_data->id,
|
"id" => $_data->id,
|
||||||
"pck_date" => $_data->pck_date,
|
"pck_date" => $_data->pck_date,
|
||||||
@ -244,11 +244,9 @@ class MenuController extends Controller
|
|||||||
"pck_addr" => $_data->pck_addr,
|
"pck_addr" => $_data->pck_addr,
|
||||||
"drop_name" => $_data->drop_name,
|
"drop_name" => $_data->drop_name,
|
||||||
"drop_addr" => $_data->drop_addr,
|
"drop_addr" => $_data->drop_addr,
|
||||||
"checklist_array" => $ehck,
|
"checklist_array" => [],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
// dd($data[0]["checklist_array"]);
|
|
||||||
// dd($data);
|
|
||||||
$data = [
|
$data = [
|
||||||
"data" => $data,
|
"data" => $data,
|
||||||
"orders" => $orders,
|
"orders" => $orders,
|
||||||
@ -317,11 +315,12 @@ class MenuController extends Controller
|
|||||||
$rate = OrdersRates::getById($order[0]->ord_rate_id);
|
$rate = OrdersRates::getById($order[0]->ord_rate_id);
|
||||||
$data = [
|
$data = [
|
||||||
"order" => $order[0],
|
"order" => $order[0],
|
||||||
"vendors" => OrdersVendors::searchVendorsByRate([
|
// "vendors" => OrdersVendors::searchVendorsByRate([
|
||||||
"active_rates" => $rate[0],
|
// "active_rates" => $rate[0],
|
||||||
"prefer_truck_type" => $order[0]->prefer_truck_type,
|
// "prefer_truck_type" => $order[0]->prefer_truck_type,
|
||||||
]),
|
// ]),
|
||||||
];
|
];
|
||||||
|
// dd($data["order"]);
|
||||||
return view("menu_v1._confirmTransactions", $data);
|
return view("menu_v1._confirmTransactions", $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -340,16 +339,22 @@ class MenuController extends Controller
|
|||||||
|
|
||||||
public function view_transactions_add(Request $req)
|
public function view_transactions_add(Request $req)
|
||||||
{
|
{
|
||||||
|
// dd(Users::ROLE_ADMIN);
|
||||||
|
$uclients = Users::listUsers([
|
||||||
|
"role" => Users::ROLE_ADMIN,
|
||||||
|
"status" => Users::STATUS_ACTIVE,
|
||||||
|
]);
|
||||||
|
// dd($uclients);
|
||||||
$data = [
|
$data = [
|
||||||
"uclients" => Users::listUsers([
|
"uclients" => [collect($uclients)->firstWhere("id", 1)],
|
||||||
"role" => Users::ROLE_CLIENT_ADMIN,
|
|
||||||
"status" => Users::STATUS_ACTIVE,
|
|
||||||
]),
|
|
||||||
"truck_types" => ConfTruckTypes::listTruckTypesRates(
|
"truck_types" => ConfTruckTypes::listTruckTypesRates(
|
||||||
ConfTruckTypes::IS_ACTIVE,
|
ConfTruckTypes::IS_ACTIVE,
|
||||||
ConfRates::LANE_EARTH
|
ConfRates::LANE_EARTH
|
||||||
),
|
),
|
||||||
|
"vehicle" => Vehicles::listVehicles([]),
|
||||||
|
"driver" => Drivers::getDrivers([]),
|
||||||
];
|
];
|
||||||
|
// dd($data["vehicle"]);
|
||||||
return view("menu_v2.Clients._addTransactions", $data);
|
return view("menu_v2.Clients._addTransactions", $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -36,6 +36,7 @@ class TrackController extends Controller
|
|||||||
];
|
];
|
||||||
if ($req->cptid) {
|
if ($req->cptid) {
|
||||||
$filter["company"] = $req->cptid;
|
$filter["company"] = $req->cptid;
|
||||||
|
// $filter["company"] = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($req->auth->is_tracking === Users::IS_TRACK_VHC_YES) {
|
if ($req->auth->is_tracking === Users::IS_TRACK_VHC_YES) {
|
||||||
@ -84,6 +85,7 @@ class TrackController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
$list = Tracks::listCurrentTracks($filter);
|
$list = Tracks::listCurrentTracks($filter);
|
||||||
|
// dd($list);
|
||||||
foreach ($list as $key => $row) {
|
foreach ($list as $key => $row) {
|
||||||
$list[$key]->DT_RowIndex = $key + 1;
|
$list[$key]->DT_RowIndex = $key + 1;
|
||||||
// $list[$key]->mileage_km = '-';
|
// $list[$key]->mileage_km = '-';
|
||||||
|
|||||||
@ -248,7 +248,7 @@ class TransactionController extends Controller
|
|||||||
$pdfPath = "",
|
$pdfPath = "",
|
||||||
$pdfTitle = "",
|
$pdfTitle = "",
|
||||||
$imgName = "",
|
$imgName = "",
|
||||||
$outputPdfFile = "",
|
$outputPdfFile = ""
|
||||||
) {
|
) {
|
||||||
if (empty($imgPathFile)) {
|
if (empty($imgPathFile)) {
|
||||||
return false;
|
return false;
|
||||||
@ -317,7 +317,7 @@ class TransactionController extends Controller
|
|||||||
$pdfPath,
|
$pdfPath,
|
||||||
"Data Penjemputan",
|
"Data Penjemputan",
|
||||||
"Foto Seal",
|
"Foto Seal",
|
||||||
"ord_pck_seal_img",
|
"ord_pck_seal_img"
|
||||||
);
|
);
|
||||||
if ($onePagePdf) {
|
if ($onePagePdf) {
|
||||||
$availToMergers[] = $onePagePdf;
|
$availToMergers[] = $onePagePdf;
|
||||||
@ -328,7 +328,7 @@ class TransactionController extends Controller
|
|||||||
$pdfPath,
|
$pdfPath,
|
||||||
"Data Penjemputan",
|
"Data Penjemputan",
|
||||||
"Foto Seal",
|
"Foto Seal",
|
||||||
"ord_pck_seal_img",
|
"ord_pck_seal_img"
|
||||||
);
|
);
|
||||||
if ($onePagePdf) {
|
if ($onePagePdf) {
|
||||||
$availToMergers[] = $onePagePdf;
|
$availToMergers[] = $onePagePdf;
|
||||||
@ -340,7 +340,7 @@ class TransactionController extends Controller
|
|||||||
$pdfPath,
|
$pdfPath,
|
||||||
"Data Penjemputan",
|
"Data Penjemputan",
|
||||||
"Foto Pengemudi + Armada",
|
"Foto Pengemudi + Armada",
|
||||||
"ord_pck_drv_armd_img",
|
"ord_pck_drv_armd_img"
|
||||||
);
|
);
|
||||||
if ($onePagePdf) {
|
if ($onePagePdf) {
|
||||||
$availToMergers[] = $onePagePdf;
|
$availToMergers[] = $onePagePdf;
|
||||||
@ -351,7 +351,7 @@ class TransactionController extends Controller
|
|||||||
$pdfPath,
|
$pdfPath,
|
||||||
"Data Penjemputan",
|
"Data Penjemputan",
|
||||||
"Foto Pengemudi + Armada",
|
"Foto Pengemudi + Armada",
|
||||||
"ord_pck_drv_armd_img",
|
"ord_pck_drv_armd_img"
|
||||||
);
|
);
|
||||||
if ($onePagePdf) {
|
if ($onePagePdf) {
|
||||||
$availToMergers[] = $onePagePdf;
|
$availToMergers[] = $onePagePdf;
|
||||||
@ -363,7 +363,7 @@ class TransactionController extends Controller
|
|||||||
$pdfPath,
|
$pdfPath,
|
||||||
"Data Penjemputan",
|
"Data Penjemputan",
|
||||||
"Nomor Polisi Kendaraan",
|
"Nomor Polisi Kendaraan",
|
||||||
"ord_pck_nopol_img",
|
"ord_pck_nopol_img"
|
||||||
);
|
);
|
||||||
if ($onePagePdf) {
|
if ($onePagePdf) {
|
||||||
$availToMergers[] = $onePagePdf;
|
$availToMergers[] = $onePagePdf;
|
||||||
@ -374,7 +374,7 @@ class TransactionController extends Controller
|
|||||||
$pdfPath,
|
$pdfPath,
|
||||||
"Data Penjemputan",
|
"Data Penjemputan",
|
||||||
"Nomor Polisi Kendaraan",
|
"Nomor Polisi Kendaraan",
|
||||||
"ord_pck_nopol_img",
|
"ord_pck_nopol_img"
|
||||||
);
|
);
|
||||||
if ($onePagePdf) {
|
if ($onePagePdf) {
|
||||||
$availToMergers[] = $onePagePdf;
|
$availToMergers[] = $onePagePdf;
|
||||||
@ -389,7 +389,7 @@ class TransactionController extends Controller
|
|||||||
$pdfPath,
|
$pdfPath,
|
||||||
"Data Penjemputan",
|
"Data Penjemputan",
|
||||||
"Dokumen Kelengkapan dari Client",
|
"Dokumen Kelengkapan dari Client",
|
||||||
"ord_pck_doc_client_img_" . $i,
|
"ord_pck_doc_client_img_" . $i
|
||||||
);
|
);
|
||||||
if ($onePagePdf) {
|
if ($onePagePdf) {
|
||||||
$availToMergers[] = $onePagePdf;
|
$availToMergers[] = $onePagePdf;
|
||||||
@ -400,7 +400,7 @@ class TransactionController extends Controller
|
|||||||
$pdfPath,
|
$pdfPath,
|
||||||
"Data Penjemputan",
|
"Data Penjemputan",
|
||||||
"Dokumen Kelengkapan dari Client",
|
"Dokumen Kelengkapan dari Client",
|
||||||
"ord_pck_doc_client_img_" . $i,
|
"ord_pck_doc_client_img_" . $i
|
||||||
);
|
);
|
||||||
if ($onePagePdf) {
|
if ($onePagePdf) {
|
||||||
$availToMergers[] = $onePagePdf;
|
$availToMergers[] = $onePagePdf;
|
||||||
@ -413,7 +413,7 @@ class TransactionController extends Controller
|
|||||||
$pdfPath,
|
$pdfPath,
|
||||||
"Data Penjemputan",
|
"Data Penjemputan",
|
||||||
"Foto Pemasangan Seal",
|
"Foto Pemasangan Seal",
|
||||||
"ord_pck_seal_install_img",
|
"ord_pck_seal_install_img"
|
||||||
);
|
);
|
||||||
if ($onePagePdf) {
|
if ($onePagePdf) {
|
||||||
$availToMergers[] = $onePagePdf;
|
$availToMergers[] = $onePagePdf;
|
||||||
@ -424,7 +424,7 @@ class TransactionController extends Controller
|
|||||||
$pdfPath,
|
$pdfPath,
|
||||||
"Data Penjemputan",
|
"Data Penjemputan",
|
||||||
"Foto Pemasangan Seal",
|
"Foto Pemasangan Seal",
|
||||||
"ord_pck_seal_install_img",
|
"ord_pck_seal_install_img"
|
||||||
);
|
);
|
||||||
if ($onePagePdf) {
|
if ($onePagePdf) {
|
||||||
$availToMergers[] = $onePagePdf;
|
$availToMergers[] = $onePagePdf;
|
||||||
@ -436,7 +436,7 @@ class TransactionController extends Controller
|
|||||||
$pdfPath,
|
$pdfPath,
|
||||||
"Data Penjemputan",
|
"Data Penjemputan",
|
||||||
"Foto Barang",
|
"Foto Barang",
|
||||||
"ord_pck_goods_img",
|
"ord_pck_goods_img"
|
||||||
);
|
);
|
||||||
if ($onePagePdf) {
|
if ($onePagePdf) {
|
||||||
$availToMergers[] = $onePagePdf;
|
$availToMergers[] = $onePagePdf;
|
||||||
@ -447,7 +447,7 @@ class TransactionController extends Controller
|
|||||||
$pdfPath,
|
$pdfPath,
|
||||||
"Data Penjemputan",
|
"Data Penjemputan",
|
||||||
"Foto Barang",
|
"Foto Barang",
|
||||||
"ord_pck_goods_img",
|
"ord_pck_goods_img"
|
||||||
);
|
);
|
||||||
if ($onePagePdf) {
|
if ($onePagePdf) {
|
||||||
$availToMergers[] = $onePagePdf;
|
$availToMergers[] = $onePagePdf;
|
||||||
@ -461,7 +461,7 @@ class TransactionController extends Controller
|
|||||||
if (count($availToMergers) > 0) {
|
if (count($availToMergers) > 0) {
|
||||||
$pdfMerge->merge(
|
$pdfMerge->merge(
|
||||||
"file",
|
"file",
|
||||||
storage_path("app/public/" . $pdfPath . "download_report_pickup.pdf"),
|
storage_path("app/public/" . $pdfPath . "download_report_pickup.pdf")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -579,7 +579,7 @@ class TransactionController extends Controller
|
|||||||
$pdfPath,
|
$pdfPath,
|
||||||
"Data Pengantaran",
|
"Data Pengantaran",
|
||||||
"Foto mobil tiba di tujuan",
|
"Foto mobil tiba di tujuan",
|
||||||
"ord_drop_arrived_img",
|
"ord_drop_arrived_img"
|
||||||
);
|
);
|
||||||
if ($onePagePdf) {
|
if ($onePagePdf) {
|
||||||
$availToMergers[] = $onePagePdf;
|
$availToMergers[] = $onePagePdf;
|
||||||
@ -590,7 +590,7 @@ class TransactionController extends Controller
|
|||||||
$pdfPath,
|
$pdfPath,
|
||||||
"Data Pengantaran",
|
"Data Pengantaran",
|
||||||
"Foto mobil tiba di tujuan",
|
"Foto mobil tiba di tujuan",
|
||||||
"ord_drop_arrived_img",
|
"ord_drop_arrived_img"
|
||||||
);
|
);
|
||||||
if ($onePagePdf) {
|
if ($onePagePdf) {
|
||||||
$availToMergers[] = $onePagePdf;
|
$availToMergers[] = $onePagePdf;
|
||||||
@ -602,7 +602,7 @@ class TransactionController extends Controller
|
|||||||
$pdfPath,
|
$pdfPath,
|
||||||
"Data Pengantaran",
|
"Data Pengantaran",
|
||||||
"Foto serah terima",
|
"Foto serah terima",
|
||||||
"ord_drop_handover_img",
|
"ord_drop_handover_img"
|
||||||
);
|
);
|
||||||
if ($onePagePdf) {
|
if ($onePagePdf) {
|
||||||
$availToMergers[] = $onePagePdf;
|
$availToMergers[] = $onePagePdf;
|
||||||
@ -613,7 +613,7 @@ class TransactionController extends Controller
|
|||||||
$pdfPath,
|
$pdfPath,
|
||||||
"Data Pengantaran",
|
"Data Pengantaran",
|
||||||
"Foto serah terima",
|
"Foto serah terima",
|
||||||
"ord_drop_handover_img",
|
"ord_drop_handover_img"
|
||||||
);
|
);
|
||||||
if ($onePagePdf) {
|
if ($onePagePdf) {
|
||||||
$availToMergers[] = $onePagePdf;
|
$availToMergers[] = $onePagePdf;
|
||||||
@ -625,7 +625,7 @@ class TransactionController extends Controller
|
|||||||
$pdfPath,
|
$pdfPath,
|
||||||
"Data Pengantaran",
|
"Data Pengantaran",
|
||||||
"Foto DO yg sudah di TTD",
|
"Foto DO yg sudah di TTD",
|
||||||
"ord_drop_do_ttd_img",
|
"ord_drop_do_ttd_img"
|
||||||
);
|
);
|
||||||
if ($onePagePdf) {
|
if ($onePagePdf) {
|
||||||
$availToMergers[] = $onePagePdf;
|
$availToMergers[] = $onePagePdf;
|
||||||
@ -636,7 +636,7 @@ class TransactionController extends Controller
|
|||||||
$pdfPath,
|
$pdfPath,
|
||||||
"Data Pengantaran",
|
"Data Pengantaran",
|
||||||
"Foto DO yg sudah di TTD",
|
"Foto DO yg sudah di TTD",
|
||||||
"ord_drop_do_ttd_img",
|
"ord_drop_do_ttd_img"
|
||||||
);
|
);
|
||||||
if ($onePagePdf) {
|
if ($onePagePdf) {
|
||||||
$availToMergers[] = $onePagePdf;
|
$availToMergers[] = $onePagePdf;
|
||||||
@ -648,7 +648,7 @@ class TransactionController extends Controller
|
|||||||
$pdfPath,
|
$pdfPath,
|
||||||
"Data Pengantaran",
|
"Data Pengantaran",
|
||||||
"Foto surat jalan di TTD",
|
"Foto surat jalan di TTD",
|
||||||
"ord_drop_spk_img",
|
"ord_drop_spk_img"
|
||||||
);
|
);
|
||||||
if ($onePagePdf) {
|
if ($onePagePdf) {
|
||||||
$availToMergers[] = $onePagePdf;
|
$availToMergers[] = $onePagePdf;
|
||||||
@ -659,7 +659,7 @@ class TransactionController extends Controller
|
|||||||
$pdfPath,
|
$pdfPath,
|
||||||
"Data Pengantaran",
|
"Data Pengantaran",
|
||||||
"Foto surat jalan di TTD",
|
"Foto surat jalan di TTD",
|
||||||
"ord_drop_spk_img",
|
"ord_drop_spk_img"
|
||||||
);
|
);
|
||||||
if ($onePagePdf) {
|
if ($onePagePdf) {
|
||||||
$availToMergers[] = $onePagePdf;
|
$availToMergers[] = $onePagePdf;
|
||||||
@ -768,7 +768,7 @@ class TransactionController extends Controller
|
|||||||
$pdfPath,
|
$pdfPath,
|
||||||
"Data Kecelakaan",
|
"Data Kecelakaan",
|
||||||
"Foto Pendukung",
|
"Foto Pendukung",
|
||||||
"ord_acdnt_img_" . $i,
|
"ord_acdnt_img_" . $i
|
||||||
);
|
);
|
||||||
if ($onePagePdf) {
|
if ($onePagePdf) {
|
||||||
$availToMergers[] = $onePagePdf;
|
$availToMergers[] = $onePagePdf;
|
||||||
@ -779,7 +779,7 @@ class TransactionController extends Controller
|
|||||||
$pdfPath,
|
$pdfPath,
|
||||||
"Data Kecelakaan",
|
"Data Kecelakaan",
|
||||||
"Foto Pendukung",
|
"Foto Pendukung",
|
||||||
"ord_acdnt_img_" . $i,
|
"ord_acdnt_img_" . $i
|
||||||
);
|
);
|
||||||
if ($onePagePdf) {
|
if ($onePagePdf) {
|
||||||
$availToMergers[] = $onePagePdf;
|
$availToMergers[] = $onePagePdf;
|
||||||
@ -794,7 +794,7 @@ class TransactionController extends Controller
|
|||||||
if (count($availToMergers) > 0) {
|
if (count($availToMergers) > 0) {
|
||||||
$pdfMerge->merge(
|
$pdfMerge->merge(
|
||||||
"file",
|
"file",
|
||||||
storage_path("app/public/" . $pdfPath . "download_report_acdnt.pdf"),
|
storage_path("app/public/" . $pdfPath . "download_report_acdnt.pdf")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1021,7 +1021,7 @@ class TransactionController extends Controller
|
|||||||
tod.drop_name,
|
tod.drop_name,
|
||||||
tod.drop_addr,
|
tod.drop_addr,
|
||||||
tod.pic_name as drp_pic_name,
|
tod.pic_name as drp_pic_name,
|
||||||
tod.pic_phone_val as drp_pic_phone",
|
tod.pic_phone_val as drp_pic_phone"
|
||||||
);
|
);
|
||||||
if (isset($req->point_id)) {
|
if (isset($req->point_id)) {
|
||||||
$rawData->where("topd.id", $req->point_id);
|
$rawData->where("topd.id", $req->point_id);
|
||||||
@ -1035,7 +1035,7 @@ class TransactionController extends Controller
|
|||||||
"checklist_name",
|
"checklist_name",
|
||||||
"checklist_desc",
|
"checklist_desc",
|
||||||
"img",
|
"img",
|
||||||
"updt",
|
"updt"
|
||||||
)
|
)
|
||||||
->where("ord_pck_drop_id", $_data->id)
|
->where("ord_pck_drop_id", $_data->id)
|
||||||
->get();
|
->get();
|
||||||
@ -1185,7 +1185,7 @@ class TransactionController extends Controller
|
|||||||
foreach ($req->packing_list as $k => $v) {
|
foreach ($req->packing_list as $k => $v) {
|
||||||
if (count(OrdersItems::getOrderItemByCode($v["Item Code"])) > 0) {
|
if (count(OrdersItems::getOrderItemByCode($v["Item Code"])) > 0) {
|
||||||
$apiResp = Responses::bad_request(
|
$apiResp = Responses::bad_request(
|
||||||
"Item Code: " . $v["Item Code"] . " not uniq, please reupload your packing list",
|
"Item Code: " . $v["Item Code"] . " not uniq, please reupload your packing list"
|
||||||
);
|
);
|
||||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||||
}
|
}
|
||||||
@ -1255,7 +1255,7 @@ class TransactionController extends Controller
|
|||||||
// }
|
// }
|
||||||
if ($calc_weight === 0 && $calc_cbm === 0) {
|
if ($calc_weight === 0 && $calc_cbm === 0) {
|
||||||
$apiResp = Responses::bad_request(
|
$apiResp = Responses::bad_request(
|
||||||
"You must fill in at least 1 of weight / dimension / volume on packing list.",
|
"You must fill in at least 1 of weight / dimension / volume on packing list."
|
||||||
);
|
);
|
||||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||||
}
|
}
|
||||||
@ -1330,7 +1330,7 @@ class TransactionController extends Controller
|
|||||||
}
|
}
|
||||||
if ($pck[0]->prid == 0) {
|
if ($pck[0]->prid == 0) {
|
||||||
$apiResp = Responses::bad_request(
|
$apiResp = Responses::bad_request(
|
||||||
"Pickup zone province not filled, please recheck input province zone",
|
"Pickup zone province not filled, please recheck input province zone"
|
||||||
);
|
);
|
||||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||||
}
|
}
|
||||||
@ -1342,13 +1342,13 @@ class TransactionController extends Controller
|
|||||||
}
|
}
|
||||||
if ($drop[0]->ktid == 0) {
|
if ($drop[0]->ktid == 0) {
|
||||||
$apiResp = Responses::bad_request(
|
$apiResp = Responses::bad_request(
|
||||||
"Drop zone city not filled, please recheck input city zone",
|
"Drop zone city not filled, please recheck input city zone"
|
||||||
);
|
);
|
||||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||||
}
|
}
|
||||||
if ($drop[0]->kcid == 0) {
|
if ($drop[0]->kcid == 0) {
|
||||||
$apiResp = Responses::bad_request(
|
$apiResp = Responses::bad_request(
|
||||||
"Drop zone district not filled, please recheck input district zone",
|
"Drop zone district not filled, please recheck input district zone"
|
||||||
);
|
);
|
||||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||||
}
|
}
|
||||||
@ -1380,7 +1380,7 @@ class TransactionController extends Controller
|
|||||||
} else {
|
} else {
|
||||||
$truck_types = ConfTruckTypes::listTruckTypesRates(
|
$truck_types = ConfTruckTypes::listTruckTypesRates(
|
||||||
ConfTruckTypes::IS_ACTIVE,
|
ConfTruckTypes::IS_ACTIVE,
|
||||||
ConfRates::LANE_EARTH,
|
ConfRates::LANE_EARTH
|
||||||
);
|
);
|
||||||
if (count($truck_types) < 1) {
|
if (count($truck_types) < 1) {
|
||||||
$apiResp = Responses::bad_request("No vehicle available");
|
$apiResp = Responses::bad_request("No vehicle available");
|
||||||
@ -1481,15 +1481,15 @@ class TransactionController extends Controller
|
|||||||
"pickup_at" => $req->pickup_at,
|
"pickup_at" => $req->pickup_at,
|
||||||
"pickup_zone_id" => $req->pickup_zone_id,
|
"pickup_zone_id" => $req->pickup_zone_id,
|
||||||
"drop_zone_id" => $req->drop_zone_id,
|
"drop_zone_id" => $req->drop_zone_id,
|
||||||
"truck_type_id" => $req->truck_type_id,
|
// "truck_type_id" => $req->truck_type_id,
|
||||||
"truck_type_name" => $req->truck_type_name,
|
// "truck_type_name" => $req->truck_type_name,
|
||||||
];
|
];
|
||||||
$rulesInput = [
|
$rulesInput = [
|
||||||
"pickup_at" => "required|integer",
|
"pickup_at" => "required|integer",
|
||||||
"pickup_zone_id" => "required|integer",
|
"pickup_zone_id" => "required|integer",
|
||||||
"drop_zone_id" => "required|integer",
|
"drop_zone_id" => "required|integer",
|
||||||
"truck_type_id" => "required|numeric",
|
// "truck_type_id" => "required|numeric",
|
||||||
"truck_type_name" => "nullable|string",
|
// "truck_type_name" => "nullable|string",
|
||||||
];
|
];
|
||||||
|
|
||||||
// validasi input
|
// validasi input
|
||||||
@ -1530,7 +1530,7 @@ class TransactionController extends Controller
|
|||||||
}
|
}
|
||||||
if ($pck[0]->prid == 0) {
|
if ($pck[0]->prid == 0) {
|
||||||
$apiResp = Responses::bad_request(
|
$apiResp = Responses::bad_request(
|
||||||
"Pickup zone province not filled, please recheck input province zone",
|
"Pickup zone province not filled, please recheck input province zone"
|
||||||
);
|
);
|
||||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||||
}
|
}
|
||||||
@ -1542,27 +1542,28 @@ class TransactionController extends Controller
|
|||||||
}
|
}
|
||||||
if ($drop[0]->ktid == 0) {
|
if ($drop[0]->ktid == 0) {
|
||||||
$apiResp = Responses::bad_request(
|
$apiResp = Responses::bad_request(
|
||||||
"Drop zone city not filled, please recheck input city zone",
|
"Drop zone city not filled, please recheck input city zone"
|
||||||
);
|
);
|
||||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||||
}
|
}
|
||||||
if ($drop[0]->kcid == 0) {
|
if ($drop[0]->kcid == 0) {
|
||||||
$apiResp = Responses::bad_request(
|
$apiResp = Responses::bad_request(
|
||||||
"Drop zone district not filled, please recheck input district zone",
|
"Drop zone district not filled, please recheck input district zone"
|
||||||
);
|
);
|
||||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$rates = ConfRates::getRateByDestDistrict($pck[0]->prid, $drop[0]->kcid);
|
// $rates = ConfRates::getRateByDestDistrict($pck[0]->prid, $drop[0]->kcid);
|
||||||
// dd($rates);
|
// // dd($rates);
|
||||||
if (count($rates) < 1) {
|
// if (count($rates) < 1) {
|
||||||
$rates = ConfRates::getRateByDestCity($pck[0]->prid, $drop[0]->ktid);
|
// $rates = ConfRates::getRateByDestCity($pck[0]->prid, $drop[0]->ktid);
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (count($rates) < 1) {
|
// if (count($rates) < 1) {
|
||||||
$apiResp = Responses::bad_request("No service available going to drop zone");
|
// $apiResp = Responses::bad_request("No service available going to drop zone");
|
||||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
// return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||||
}
|
// }
|
||||||
|
$rates = 0;
|
||||||
|
|
||||||
$client = Clients::getClientById($req->auth->client_group_id);
|
$client = Clients::getClientById($req->auth->client_group_id);
|
||||||
|
|
||||||
@ -1574,59 +1575,59 @@ class TransactionController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
$opts = [];
|
$opts = [];
|
||||||
foreach ($rates as $k => $v) {
|
// foreach ($rates as $k => $v) {
|
||||||
if ($check_truck_type) {
|
// if ($check_truck_type) {
|
||||||
if ($v->vhc_type !== $ttid) {
|
// if ($v->vhc_type !== $ttid) {
|
||||||
continue;
|
// continue;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
$opt = [
|
// $opt = [
|
||||||
"is_best" => 0,
|
// "is_best" => 0,
|
||||||
];
|
// ];
|
||||||
if ($k === 0) {
|
// if ($k === 0) {
|
||||||
$opt["is_best"] = 1;
|
// $opt["is_best"] = 1;
|
||||||
}
|
// }
|
||||||
$opt["lead_time_id"] = $v->id;
|
// $opt["lead_time_id"] = $v->id;
|
||||||
// $center_time = $v->long_time - $v->fast_time;
|
// // $center_time = $v->long_time - $v->fast_time;
|
||||||
$opt["lead_time"] = $v->long_time;
|
// $opt["lead_time"] = $v->long_time;
|
||||||
$price = $v->sell_ftl ?? 0;
|
// $price = $v->sell_ftl ?? 0;
|
||||||
|
|
||||||
// TRIGER JIKA HARGA 0
|
// // TRIGER JIKA HARGA 0
|
||||||
// if ($price < 1) {
|
// // if ($price < 1) {
|
||||||
// $apiResp = Responses::bad_request("No service provided");
|
// // $apiResp = Responses::bad_request("No service provided");
|
||||||
// return new Response($apiResp, $apiResp["meta"]["code"]);
|
// // return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||||
// }
|
// // }
|
||||||
$opt["price"] = $price;
|
// $opt["price"] = $price;
|
||||||
$opt["real_price"] = $price;
|
// $opt["real_price"] = $price;
|
||||||
$opt["disc_price"] = 0;
|
// $opt["disc_price"] = 0;
|
||||||
$opt["disc_type"] = $client[0]->disc_type;
|
// $opt["disc_type"] = $client[0]->disc_type;
|
||||||
$opt["disc_percent"] = 0;
|
// $opt["disc_percent"] = 0;
|
||||||
if ($client[0]->disc_type === Clients::DISC_TYPE_FIX) {
|
// if ($client[0]->disc_type === Clients::DISC_TYPE_FIX) {
|
||||||
$opt["disc_price"] = $client[0]->disc_amount;
|
// $opt["disc_price"] = $client[0]->disc_amount;
|
||||||
$opt["price"] = $opt["price"] - $opt["disc_price"];
|
// $opt["price"] = $opt["price"] - $opt["disc_price"];
|
||||||
} elseif ($client[0]->disc_type === Clients::DISC_TYPE_PERCENT) {
|
// } elseif ($client[0]->disc_type === Clients::DISC_TYPE_PERCENT) {
|
||||||
$opt["disc_percent"] = $client[0]->disc_amount;
|
// $opt["disc_percent"] = $client[0]->disc_amount;
|
||||||
$opt["disc_price"] = ($opt["price"] * $client[0]->disc_amount) / 100;
|
// $opt["disc_price"] = ($opt["price"] * $client[0]->disc_amount) / 100;
|
||||||
$opt["price"] = $opt["price"] - $opt["disc_price"];
|
// $opt["price"] = $opt["price"] - $opt["disc_price"];
|
||||||
}
|
// }
|
||||||
// group by lead_time and sell_price
|
// // group by lead_time and sell_price
|
||||||
$isSame = 0;
|
// $isSame = 0;
|
||||||
foreach ($opts as $key => $val) {
|
// foreach ($opts as $key => $val) {
|
||||||
if ($val["price"] == $opt["price"] && $val["lead_time"] == $opt["lead_time"]) {
|
// if ($val["price"] == $opt["price"] && $val["lead_time"] == $opt["lead_time"]) {
|
||||||
$isSame = 1;
|
// $isSame = 1;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
if ($isSame === 1) {
|
// if ($isSame === 1) {
|
||||||
continue;
|
// continue;
|
||||||
}
|
// }
|
||||||
array_push($opts, $opt);
|
// array_push($opts, $opt);
|
||||||
}
|
// }
|
||||||
// dd(count($opts));
|
// dd(count($opts));
|
||||||
if (count($opts) < 1 && $check_truck_type) {
|
// if (count($opts) < 1 && $check_truck_type) {
|
||||||
$apiResp = Responses::bad_request("No truck type available going to drop zone");
|
// $apiResp = Responses::bad_request("No truck type available going to drop zone");
|
||||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
// return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||||
}
|
// }
|
||||||
|
|
||||||
$apiResp = Responses::success("checkout success");
|
$apiResp = Responses::success("checkout success");
|
||||||
$apiResp["data"] = $opts;
|
$apiResp["data"] = $opts;
|
||||||
@ -2028,6 +2029,7 @@ class TransactionController extends Controller
|
|||||||
|
|
||||||
public function api_create_order_v2(Request $req)
|
public function api_create_order_v2(Request $req)
|
||||||
{
|
{
|
||||||
|
// dd($req->all());
|
||||||
try {
|
try {
|
||||||
// $apiResp = Responses::bad_request("Service on maintenance");
|
// $apiResp = Responses::bad_request("Service on maintenance");
|
||||||
// return new Response($apiResp, $apiResp["meta"]["code"]);
|
// return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||||
@ -2037,25 +2039,29 @@ class TransactionController extends Controller
|
|||||||
"pickup_at" => $req->pickup_at,
|
"pickup_at" => $req->pickup_at,
|
||||||
"pickup_zone_id" => $req->pickup_zone_id,
|
"pickup_zone_id" => $req->pickup_zone_id,
|
||||||
"drop_zone_id" => $req->drop_zone_id,
|
"drop_zone_id" => $req->drop_zone_id,
|
||||||
"lead_time" => $req->lead_time,
|
// "lead_time" => $req->lead_time,
|
||||||
"price" => $req->price,
|
// "price" => $req->price,
|
||||||
"real_price" => $req->real_price,
|
// "real_price" => $req->real_price,
|
||||||
"disc_price" => $req->disc_price,
|
// "disc_price" => $req->disc_price,
|
||||||
"lead_time_id" => $req->lead_time_id,
|
// "lead_time_id" => $req->lead_time_id,
|
||||||
"truck_type_id" => $req->truck_type_id,
|
"vehicle_id" => $req->vehicle_id,
|
||||||
"truck_type_name" => $req->truck_type_name,
|
"vehicle_name" => $req->vehicle_name,
|
||||||
|
"driver_id" => $req->driver_id,
|
||||||
|
"driver_name" => $req->driver_name,
|
||||||
];
|
];
|
||||||
$rulesInput = [
|
$rulesInput = [
|
||||||
"pickup_at" => "required|integer",
|
"pickup_at" => "required|integer",
|
||||||
"pickup_zone_id" => "required|integer",
|
"pickup_zone_id" => "required|integer",
|
||||||
"drop_zone_id" => "required|integer",
|
"drop_zone_id" => "required|integer",
|
||||||
"lead_time" => "required|numeric",
|
// "lead_time" => "required|numeric",
|
||||||
"price" => "required|numeric",
|
// "price" => "required|numeric",
|
||||||
"real_price" => "required|numeric",
|
// "real_price" => "required|numeric",
|
||||||
"disc_price" => "required|numeric",
|
// "disc_price" => "required|numeric",
|
||||||
"lead_time_id" => "required|integer|not_in:0",
|
// "lead_time_id" => "required|integer|not_in:0",
|
||||||
"truck_type_id" => "nullable|numeric",
|
"vehicle_id" => "nullable|numeric",
|
||||||
"truck_type_name" => "nullable|string",
|
"vehicle_name" => "nullable|string",
|
||||||
|
"driver_id" => "nullable|numeric",
|
||||||
|
"driver_name" => "nullable|string",
|
||||||
];
|
];
|
||||||
|
|
||||||
// validasi input
|
// validasi input
|
||||||
@ -2089,11 +2095,11 @@ class TransactionController extends Controller
|
|||||||
$crt_type_order = Orders::CRT_TYPE_ORDER_ADMIN;
|
$crt_type_order = Orders::CRT_TYPE_ORDER_ADMIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
$type_truck_name = $req->truck_type_name;
|
$vehicle_name = $req->vehicle_name;
|
||||||
if ($req->truck_type_id && $req->truck_type_id != 0) {
|
if ($req->vehicle_id && $req->vehicle_id != 0) {
|
||||||
$type_truck_name = $req->truck_type_name;
|
$vehicle_name = $req->vehicle_name;
|
||||||
} else {
|
} else {
|
||||||
$type_truck_name = "";
|
$vehicle_name = "";
|
||||||
$req->truck_type_id = 0;
|
$req->truck_type_id = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2110,7 +2116,7 @@ class TransactionController extends Controller
|
|||||||
} while ($doWhile);
|
} while ($doWhile);
|
||||||
|
|
||||||
$client = Clients::getClientById($req->auth->client_group_id);
|
$client = Clients::getClientById($req->auth->client_group_id);
|
||||||
$rate = ConfRates::getRateById($req->lead_time_id);
|
// $rate = ConfRates::getRateById(0);
|
||||||
$pck = Zone::getZoneById($req->pickup_zone_id);
|
$pck = Zone::getZoneById($req->pickup_zone_id);
|
||||||
// $pck_pic = Clients::getClientById($pck[0]->client_group_id);
|
// $pck_pic = Clients::getClientById($pck[0]->client_group_id);
|
||||||
$drop = Zone::getZoneById($req->drop_zone_id);
|
$drop = Zone::getZoneById($req->drop_zone_id);
|
||||||
@ -2142,16 +2148,16 @@ class TransactionController extends Controller
|
|||||||
"type" => Orders::TYPE_FCL,
|
"type" => Orders::TYPE_FCL,
|
||||||
"pck_total" => 1,
|
"pck_total" => 1,
|
||||||
"drop_total" => 1,
|
"drop_total" => 1,
|
||||||
"est_lead_time" => $req->lead_time,
|
"est_lead_time" => 0,
|
||||||
"lead_time" => $req->lead_time,
|
"lead_time" => 0,
|
||||||
"est_price" => $req->price,
|
"est_price" => 0,
|
||||||
"price" => $req->price,
|
"price" => 0,
|
||||||
"est_real_price" => $req->real_price,
|
"est_real_price" => 0,
|
||||||
"real_price" => $req->real_price,
|
"real_price" => 0,
|
||||||
"est_disc_price" => $req->disc_price,
|
"est_disc_price" => 0,
|
||||||
"disc_price" => $req->disc_price,
|
"disc_price" => 0,
|
||||||
"est_rate_id" => $req->lead_time_id,
|
"est_rate_id" => 0,
|
||||||
"rate_id" => $req->lead_time_id,
|
"rate_id" => 0,
|
||||||
"crt_type_order" => $crt_type_order,
|
"crt_type_order" => $crt_type_order,
|
||||||
"crt" => $now,
|
"crt" => $now,
|
||||||
"crt_by" => $req->auth->uid,
|
"crt_by" => $req->auth->uid,
|
||||||
@ -2161,13 +2167,6 @@ class TransactionController extends Controller
|
|||||||
];
|
];
|
||||||
$ord_id = Orders::addOrder($insOrd);
|
$ord_id = Orders::addOrder($insOrd);
|
||||||
|
|
||||||
// if ($pck[0]->boundary_bounds) {
|
|
||||||
// // $pck[0]->boundary_bounds = json_encode($pck[0]->boundary_bounds);
|
|
||||||
// }
|
|
||||||
// if ($pck[0]->boundary_latlngs) {
|
|
||||||
// // $pck[0]->boundary_latlngs = json_encode($pck[0]->boundary_latlngs);
|
|
||||||
// }
|
|
||||||
|
|
||||||
$insPck = [
|
$insPck = [
|
||||||
"ord_id" => $ord_id,
|
"ord_id" => $ord_id,
|
||||||
"ord_code" => $code,
|
"ord_code" => $code,
|
||||||
@ -2205,13 +2204,6 @@ class TransactionController extends Controller
|
|||||||
|
|
||||||
$pck_id = OrdersPickups::add($insPck);
|
$pck_id = OrdersPickups::add($insPck);
|
||||||
|
|
||||||
// if ($drop[0]->boundary_bounds) {
|
|
||||||
// // $drop[0]->boundary_bounds = json_encode($drop[0]->boundary_bounds);
|
|
||||||
// }
|
|
||||||
// if ($drop[0]->boundary_latlngs) {
|
|
||||||
// // $drop[0]->boundary_latlngs = json_encode($drop[0]->boundary_latlngs);
|
|
||||||
// }
|
|
||||||
|
|
||||||
$insDrop = [
|
$insDrop = [
|
||||||
"ord_id" => $ord_id,
|
"ord_id" => $ord_id,
|
||||||
"ord_code" => $code,
|
"ord_code" => $code,
|
||||||
@ -2271,44 +2263,10 @@ class TransactionController extends Controller
|
|||||||
"c_pt_pic_phone_val" => $client[0]->pic_phone,
|
"c_pt_pic_phone_val" => $client[0]->pic_phone,
|
||||||
"c_pt_pic_mail" => $client[0]->pic_mail,
|
"c_pt_pic_mail" => $client[0]->pic_mail,
|
||||||
"c_pt_pic_addr" => null,
|
"c_pt_pic_addr" => null,
|
||||||
"prefer_truck_type" => $req->truck_type_id,
|
"prefer_truck_type" => 1,
|
||||||
];
|
];
|
||||||
$ord_client_id = OrdersClients::add($insClient);
|
$ord_client_id = OrdersClients::add($insClient);
|
||||||
|
|
||||||
$insRate = [
|
|
||||||
"ord_id" => $ord_id,
|
|
||||||
"ord_code" => $code,
|
|
||||||
"rate_id" => $rate[0]->id,
|
|
||||||
"rate_code" => $rate[0]->code,
|
|
||||||
"origin_prov" => $rate[0]->origin_prov,
|
|
||||||
"origin_city" => $rate[0]->origin_city,
|
|
||||||
"origin_district" => $rate[0]->origin_district,
|
|
||||||
"origin_village" => $rate[0]->origin_village,
|
|
||||||
"lane" => $rate[0]->lane,
|
|
||||||
"dest_prov" => $rate[0]->dest_prov,
|
|
||||||
"dest_city" => $rate[0]->dest_city,
|
|
||||||
"dest_district" => $rate[0]->dest_district,
|
|
||||||
"dest_village" => $rate[0]->dest_village,
|
|
||||||
"fast_time" => $rate[0]->fast_time,
|
|
||||||
"long_time" => $rate[0]->long_time,
|
|
||||||
"unit_time" => $rate[0]->unit_time,
|
|
||||||
"sell_kg" => $rate[0]->sell_kg,
|
|
||||||
"buy_kg" => $rate[0]->buy_kg,
|
|
||||||
"margin_kg" => $rate[0]->margin_kg,
|
|
||||||
"percent_kg" => $rate[0]->percent_kg,
|
|
||||||
"sell_cbm" => $rate[0]->sell_cbm,
|
|
||||||
"buy_cbm" => $rate[0]->buy_cbm,
|
|
||||||
"margin_cbm" => $rate[0]->margin_cbm,
|
|
||||||
"percent_cbm" => $rate[0]->percent_cbm,
|
|
||||||
"sell_ftl" => $rate[0]->sell_ftl,
|
|
||||||
"buy_ftl" => $rate[0]->buy_ftl,
|
|
||||||
"margin_ftl" => $rate[0]->margin_ftl,
|
|
||||||
"percent_ftl" => $rate[0]->percent_ftl,
|
|
||||||
"vdr_id" => $rate[0]->vdr_id,
|
|
||||||
"vhc_type" => $rate[0]->vhc_type,
|
|
||||||
];
|
|
||||||
OrdersRates::add($insRate);
|
|
||||||
|
|
||||||
if (count($insurance) > 0) {
|
if (count($insurance) > 0) {
|
||||||
$insInsurance = [
|
$insInsurance = [
|
||||||
"ord_id" => $ord_id,
|
"ord_id" => $ord_id,
|
||||||
@ -2322,45 +2280,106 @@ class TransactionController extends Controller
|
|||||||
];
|
];
|
||||||
OrdersInsurances::add($insInsurance);
|
OrdersInsurances::add($insInsurance);
|
||||||
}
|
}
|
||||||
|
Orders::updateOrder($ord_id, [
|
||||||
|
"status" => Orders::STTS_HAVE_GET_VHC,
|
||||||
|
]);
|
||||||
|
Vehicles::updateVehicle($req->vehicle_id, [
|
||||||
|
"is_in_ord" => Vehicles::IN_ORD_YES,
|
||||||
|
"ord_id" => $ord_id,
|
||||||
|
"ord_code" => $code,
|
||||||
|
"c_did" => $req->driver_id,
|
||||||
|
"a_did" => $req->driver_id,
|
||||||
|
]);
|
||||||
|
Drivers::updateDriver($req->driver_id, [
|
||||||
|
"is_in_ord" => Drivers::IN_ORD_YES,
|
||||||
|
"ord_id" => $ord_id,
|
||||||
|
"ord_code" => $code,
|
||||||
|
]);
|
||||||
|
$order = Orders::showOrder([
|
||||||
|
"id" => $ord_id,
|
||||||
|
"get_exp_vendor" => 1,
|
||||||
|
// "vdr_id" => $req->auth->uid,
|
||||||
|
]);
|
||||||
|
$driver = Drivers::getDriverByIdAllData($req->driver_id);
|
||||||
|
$vehicle = Vehicles::getVehicleByIdAllData($req->vehicle_id);
|
||||||
|
OrdersDrivers::add([
|
||||||
|
"ord_id" => $order[0]->ord_id,
|
||||||
|
"ord_code" => $order[0]->ord_code,
|
||||||
|
"vdr_id" => $driver[0]->vendor_id,
|
||||||
|
"drv_id" => $driver[0]->drv_id,
|
||||||
|
"drv_name" => $driver[0]->fullname,
|
||||||
|
"drv_mail" => $driver[0]->email,
|
||||||
|
"drv_name2" => $driver[0]->fullname2,
|
||||||
|
"drv_phone_code" => $driver[0]->phone_code,
|
||||||
|
"drv_phone_val" => $driver[0]->phone,
|
||||||
|
"drv_phone2_code" => $driver[0]->phone2_code,
|
||||||
|
"drv_phone2_val" => $driver[0]->phone2,
|
||||||
|
"drv_addr" => $driver[0]->fulladdress,
|
||||||
|
"drv_cgroup_id" => $driver[0]->client_group_id,
|
||||||
|
"drv_nik" => $driver[0]->nik,
|
||||||
|
"drv_dob" => $driver[0]->dob,
|
||||||
|
"drv_age" => Helper::countAge($driver[0]->dob),
|
||||||
|
"drv_gender" => $driver[0]->gender,
|
||||||
|
"drv_blood" => $driver[0]->blood,
|
||||||
|
"em_fullname" => $driver[0]->em_fullname,
|
||||||
|
"em_phone_code" => $driver[0]->em_phone_code,
|
||||||
|
"em_phone_val" => $driver[0]->em_phone,
|
||||||
|
"em_relationship" => $driver[0]->em_relationship,
|
||||||
|
"drv_ktp_img" => $driver[0]->ktp_img,
|
||||||
|
"drv_npwp_img" => $driver[0]->npwp_img,
|
||||||
|
"drv_npwp_number" => $driver[0]->npwp_number,
|
||||||
|
"drv_npwp_string" => $driver[0]->npwp_string,
|
||||||
|
"drv_license_img" => $driver[0]->license_img,
|
||||||
|
"drv_license_number" => $driver[0]->license_number,
|
||||||
|
"drv_license_exp" => $driver[0]->license_exp,
|
||||||
|
]);
|
||||||
|
OrdersVehicles::add([
|
||||||
|
"ord_id" => $order[0]->ord_id,
|
||||||
|
"ord_code" => $order[0]->ord_code,
|
||||||
|
"vhc_id" => $vehicle[0]->vhc_id,
|
||||||
|
"vhc_name" => $vehicle[0]->name,
|
||||||
|
"vhc_device_id" => $vehicle[0]->device_id,
|
||||||
|
"vhc_cat_id" => $vehicle[0]->cat_id,
|
||||||
|
"vhc_brand_id" => $vehicle[0]->brand_id,
|
||||||
|
"vhc_type_id" => $vehicle[0]->type_id,
|
||||||
|
"vhc_model_id" => $vehicle[0]->model_id,
|
||||||
|
"vhc_c_did" => $vehicle[0]->c_did,
|
||||||
|
"vhc_a_did" => $vehicle[0]->a_did,
|
||||||
|
"vhc_nopol1" => $vehicle[0]->nopol1,
|
||||||
|
"vhc_nopol2" => $vehicle[0]->nopol2,
|
||||||
|
"vhc_nopol3" => $vehicle[0]->nopol3,
|
||||||
|
"vhc_is_track_holiday" => $vehicle[0]->is_track_holiday,
|
||||||
|
"vhc_track_sch_d" => $vehicle[0]->track_sch_d,
|
||||||
|
"vhc_track_sch_h" => $vehicle[0]->track_sch_h,
|
||||||
|
"vhc_cgroup_id" => $vehicle[0]->client_group_id,
|
||||||
|
"vhc_vdr_id" => $vehicle[0]->vendor_id,
|
||||||
|
"vhc_speed_limit" => $vehicle[0]->speed_limit,
|
||||||
|
"vhc_fuel_capacity" => $vehicle[0]->fuel_capacity,
|
||||||
|
"vhc_fuel_drop_treshold" => $vehicle[0]->fuel_drop_treshold,
|
||||||
|
"vhc_max_pressure" => $vehicle[0]->max_pressure,
|
||||||
|
"vhc_fvhc_img" => $vehicle[0]->fvhc_img,
|
||||||
|
"vhc_stnk_img" => $vehicle[0]->stnk_img,
|
||||||
|
"vhc_stnk_exp" => $vehicle[0]->stnk_exp,
|
||||||
|
"vhc_vyear" => $vehicle[0]->vyear,
|
||||||
|
"vhc_cc" => $vehicle[0]->cc,
|
||||||
|
"vhc_vin" => $vehicle[0]->vin,
|
||||||
|
"vhc_en" => $vehicle[0]->en,
|
||||||
|
"vhc_vcolor" => $vehicle[0]->vcolor,
|
||||||
|
"vhc_fuel_type" => $vehicle[0]->fuel_type,
|
||||||
|
"vhc_tnkb_color" => $vehicle[0]->tnkb_color,
|
||||||
|
"vhc_regis_year" => $vehicle[0]->regis_year,
|
||||||
|
"vhc_tax_exp" => $vehicle[0]->tax_exp,
|
||||||
|
]);
|
||||||
|
|
||||||
// JIKA PAKAI DANA
|
$dt_inst_pck_drop = [
|
||||||
// $url = env("API_URL_NODE") . "/order/create";
|
"ord_id" => $order[0]->ord_id,
|
||||||
// $guzReq = new GuzzleClient();
|
"ord_code" => $order[0]->ord_code,
|
||||||
// $respNode = $guzReq->request("POST", $url, [
|
"pck_id" => $pck_id,
|
||||||
// "headers" => [
|
"drop_id" => $drop_id,
|
||||||
// "Host" => $_SERVER["SERVER_ADDR"],
|
"is_active" => 1,
|
||||||
// "User-Agent" => "curl/7.65.3",
|
"stts" => 1,
|
||||||
// "Accept" => "*/*",
|
];
|
||||||
// "Accept-Encoding" => "gzip, deflate, br",
|
DB::table("t_orders_pck_drop")->insert($dt_inst_pck_drop);
|
||||||
// // 'Content-Type' => 'application/x-www-form-urlencoded; charset=UTF-8',
|
|
||||||
// // 'Connection' => 'keep-alive',
|
|
||||||
// ],
|
|
||||||
// "json" => [
|
|
||||||
// "trx_code" => $code,
|
|
||||||
// "trx_at" => $now,
|
|
||||||
// "client_id" => $req->auth->uid,
|
|
||||||
// "client_name" => $req->auth->first_name,
|
|
||||||
// "client_phone" =>
|
|
||||||
// $req->auth->phone_code .
|
|
||||||
// " " .
|
|
||||||
// implode(" ", str_split($req->auth->phone, 4)),
|
|
||||||
// "client_mail" => $req->auth->email,
|
|
||||||
// "client_addr" => "",
|
|
||||||
// "client_prefer_type_truck" => $type_truck_name,
|
|
||||||
// "pickup_zone_title" => $pck[0]->name,
|
|
||||||
// "pickup_zone_addr" => $pck[0]->fulladdress,
|
|
||||||
// "pickup_at" => $req->pickup_at,
|
|
||||||
// "drop_zone_title" => $drop[0]->name,
|
|
||||||
// "drop_zone_addr" => $drop[0]->fulladdress,
|
|
||||||
// "admins" => $admins_data,
|
|
||||||
// ],
|
|
||||||
// ]);
|
|
||||||
// if ($respNode->getStatusCode() != 200) {
|
|
||||||
// DB::rollBack();
|
|
||||||
// $apiResp = Responses::bad_request("fail create order 0");
|
|
||||||
// return new Response($apiResp, $apiResp["meta"]["code"]);
|
|
||||||
// }
|
|
||||||
// $body = json_decode($respNode->getBody()->getContents());
|
|
||||||
|
|
||||||
$apiResp = Responses::created("success create order");
|
$apiResp = Responses::created("success create order");
|
||||||
|
|
||||||
@ -2666,7 +2685,7 @@ class TransactionController extends Controller
|
|||||||
if ($found_prefer === 0) {
|
if ($found_prefer === 0) {
|
||||||
// $tt = ConfTruckTypes::getTypeById($order[0]->prefer_truck_type);
|
// $tt = ConfTruckTypes::getTypeById($order[0]->prefer_truck_type);
|
||||||
$apiResp = Responses::not_found(
|
$apiResp = Responses::not_found(
|
||||||
"no vehicle available with prefered type truck " . $order[0]->prefer_truck_type_name,
|
"no vehicle available with prefered type truck " . $order[0]->prefer_truck_type_name
|
||||||
);
|
);
|
||||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||||
}
|
}
|
||||||
@ -2893,7 +2912,7 @@ class TransactionController extends Controller
|
|||||||
|
|
||||||
$vhcs = Vehicles::getVehiclesInVendorIdsActiveNoInOrder(
|
$vhcs = Vehicles::getVehiclesInVendorIdsActiveNoInOrder(
|
||||||
"" . $vendor[0]->id,
|
"" . $vendor[0]->id,
|
||||||
$order[0]->prefer_truck_type,
|
$order[0]->prefer_truck_type
|
||||||
);
|
);
|
||||||
foreach ($vhcs as $vhc) {
|
foreach ($vhcs as $vhc) {
|
||||||
if ($vhc->type_id === $order[0]->prefer_truck_type) {
|
if ($vhc->type_id === $order[0]->prefer_truck_type) {
|
||||||
@ -2906,7 +2925,7 @@ class TransactionController extends Controller
|
|||||||
if ($found_prefer === 0) {
|
if ($found_prefer === 0) {
|
||||||
// $tt = ConfTruckTypes::getTypeById($order[0]->prefer_truck_type);
|
// $tt = ConfTruckTypes::getTypeById($order[0]->prefer_truck_type);
|
||||||
$apiResp = Responses::not_found(
|
$apiResp = Responses::not_found(
|
||||||
"no vehicle available with prefered type truck " . $order[0]->prefer_truck_type_name,
|
"no vehicle available with prefered type truck " . $order[0]->prefer_truck_type_name
|
||||||
);
|
);
|
||||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||||
}
|
}
|
||||||
@ -3108,11 +3127,11 @@ class TransactionController extends Controller
|
|||||||
// validate if another vendor want this order
|
// validate if another vendor want this order
|
||||||
$otherVendorsWantThisOrder = OrdersVendors::getOtherVendorsWantThisOrder(
|
$otherVendorsWantThisOrder = OrdersVendors::getOtherVendorsWantThisOrder(
|
||||||
$order[0]->ord_id,
|
$order[0]->ord_id,
|
||||||
$req->auth->uid,
|
$req->auth->uid
|
||||||
);
|
);
|
||||||
if (count($otherVendorsWantThisOrder) > 0) {
|
if (count($otherVendorsWantThisOrder) > 0) {
|
||||||
$apiResp = Responses::bad_request(
|
$apiResp = Responses::bad_request(
|
||||||
"There other vendor want this order, if next 10 minutes the vendor not take the order, we will send email again to you",
|
"There other vendor want this order, if next 10 minutes the vendor not take the order, we will send email again to you"
|
||||||
);
|
);
|
||||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||||
}
|
}
|
||||||
@ -3338,7 +3357,6 @@ class TransactionController extends Controller
|
|||||||
"vhc_regis_year" => $vehicle[0]->regis_year,
|
"vhc_regis_year" => $vehicle[0]->regis_year,
|
||||||
"vhc_tax_exp" => $vehicle[0]->tax_exp,
|
"vhc_tax_exp" => $vehicle[0]->tax_exp,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// $url = env("API_URL_NODE") . "/order/email_vendor_acc_order";
|
// $url = env("API_URL_NODE") . "/order/email_vendor_acc_order";
|
||||||
// $guzReq = new GuzzleClient();
|
// $guzReq = new GuzzleClient();
|
||||||
// $respNode = $guzReq->request("POST", $url, [
|
// $respNode = $guzReq->request("POST", $url, [
|
||||||
@ -3795,7 +3813,7 @@ class TransactionController extends Controller
|
|||||||
$clearBase64 = preg_replace(
|
$clearBase64 = preg_replace(
|
||||||
"/^data:(image|application)\/(png|jpg|jpeg|pdf);base64,/",
|
"/^data:(image|application)\/(png|jpg|jpeg|pdf);base64,/",
|
||||||
"",
|
"",
|
||||||
$req->seal_img_base64,
|
$req->seal_img_base64
|
||||||
);
|
);
|
||||||
$type = "jpeg";
|
$type = "jpeg";
|
||||||
if (strpos($req->seal_img_base64, "application/pdf") !== false) {
|
if (strpos($req->seal_img_base64, "application/pdf") !== false) {
|
||||||
@ -3818,7 +3836,7 @@ class TransactionController extends Controller
|
|||||||
$clearBase64 = preg_replace(
|
$clearBase64 = preg_replace(
|
||||||
"/^data:(image|application)\/(png|jpg|jpeg|pdf);base64,/",
|
"/^data:(image|application)\/(png|jpg|jpeg|pdf);base64,/",
|
||||||
"",
|
"",
|
||||||
$req->drv_armd_img_base64,
|
$req->drv_armd_img_base64
|
||||||
);
|
);
|
||||||
$type = "jpeg";
|
$type = "jpeg";
|
||||||
if (strpos($req->drv_armd_img_base64, "application/pdf") !== false) {
|
if (strpos($req->drv_armd_img_base64, "application/pdf") !== false) {
|
||||||
@ -3842,7 +3860,7 @@ class TransactionController extends Controller
|
|||||||
$clearBase64 = preg_replace(
|
$clearBase64 = preg_replace(
|
||||||
"/^data:(image|application)\/(png|jpg|jpeg|pdf);base64,/",
|
"/^data:(image|application)\/(png|jpg|jpeg|pdf);base64,/",
|
||||||
"",
|
"",
|
||||||
$req->nopol_img_base64,
|
$req->nopol_img_base64
|
||||||
);
|
);
|
||||||
$type = "jpeg";
|
$type = "jpeg";
|
||||||
if (strpos($req->nopol_img_base64, "application/pdf") !== false) {
|
if (strpos($req->nopol_img_base64, "application/pdf") !== false) {
|
||||||
@ -3872,7 +3890,7 @@ class TransactionController extends Controller
|
|||||||
$clearBase64 = preg_replace(
|
$clearBase64 = preg_replace(
|
||||||
"/^data:(image|application)\/(png|jpg|jpeg|pdf);base64,/",
|
"/^data:(image|application)\/(png|jpg|jpeg|pdf);base64,/",
|
||||||
"",
|
"",
|
||||||
$img,
|
$img
|
||||||
);
|
);
|
||||||
$type = "jpeg";
|
$type = "jpeg";
|
||||||
if (strpos($img, "application/pdf") !== false) {
|
if (strpos($img, "application/pdf") !== false) {
|
||||||
@ -3903,7 +3921,7 @@ class TransactionController extends Controller
|
|||||||
$clearBase64 = preg_replace(
|
$clearBase64 = preg_replace(
|
||||||
"/^data:(image|application)\/(png|jpg|jpeg|pdf);base64,/",
|
"/^data:(image|application)\/(png|jpg|jpeg|pdf);base64,/",
|
||||||
"",
|
"",
|
||||||
$req->install_seal_img_base64,
|
$req->install_seal_img_base64
|
||||||
);
|
);
|
||||||
$type = "jpeg";
|
$type = "jpeg";
|
||||||
if (strpos($req->install_seal_img_base64, "application/pdf") !== false) {
|
if (strpos($req->install_seal_img_base64, "application/pdf") !== false) {
|
||||||
@ -3932,7 +3950,7 @@ class TransactionController extends Controller
|
|||||||
$clearBase64 = preg_replace(
|
$clearBase64 = preg_replace(
|
||||||
"/^data:(image|application)\/(png|jpg|jpeg|pdf);base64,/",
|
"/^data:(image|application)\/(png|jpg|jpeg|pdf);base64,/",
|
||||||
"",
|
"",
|
||||||
$req->goods_img_base64,
|
$req->goods_img_base64
|
||||||
);
|
);
|
||||||
$type = "jpeg";
|
$type = "jpeg";
|
||||||
if (strpos($req->goods_img_base64, "application/pdf") !== false) {
|
if (strpos($req->goods_img_base64, "application/pdf") !== false) {
|
||||||
@ -4079,7 +4097,7 @@ class TransactionController extends Controller
|
|||||||
$clearBase64 = preg_replace(
|
$clearBase64 = preg_replace(
|
||||||
"/^data:(image|application)\/(png|jpg|jpeg|pdf);base64,/",
|
"/^data:(image|application)\/(png|jpg|jpeg|pdf);base64,/",
|
||||||
"",
|
"",
|
||||||
$req->arrived_img_base64,
|
$req->arrived_img_base64
|
||||||
);
|
);
|
||||||
$type = "jpeg";
|
$type = "jpeg";
|
||||||
if (strpos($req->arrived_img_base64, "application/pdf") !== false) {
|
if (strpos($req->arrived_img_base64, "application/pdf") !== false) {
|
||||||
@ -4102,7 +4120,7 @@ class TransactionController extends Controller
|
|||||||
$clearBase64 = preg_replace(
|
$clearBase64 = preg_replace(
|
||||||
"/^data:(image|application)\/(png|jpg|jpeg|pdf);base64,/",
|
"/^data:(image|application)\/(png|jpg|jpeg|pdf);base64,/",
|
||||||
"",
|
"",
|
||||||
$req->handover_img_base64,
|
$req->handover_img_base64
|
||||||
);
|
);
|
||||||
$type = "jpeg";
|
$type = "jpeg";
|
||||||
if (strpos($req->handover_img_base64, "application/pdf") !== false) {
|
if (strpos($req->handover_img_base64, "application/pdf") !== false) {
|
||||||
@ -4127,7 +4145,7 @@ class TransactionController extends Controller
|
|||||||
$clearBase64 = preg_replace(
|
$clearBase64 = preg_replace(
|
||||||
"/^data:(image|application)\/(png|jpg|jpeg|pdf);base64,/",
|
"/^data:(image|application)\/(png|jpg|jpeg|pdf);base64,/",
|
||||||
"",
|
"",
|
||||||
$req->do_ttd_img_base64,
|
$req->do_ttd_img_base64
|
||||||
);
|
);
|
||||||
$type = "jpeg";
|
$type = "jpeg";
|
||||||
if (strpos($req->do_ttd_img_base64, "application/pdf") !== false) {
|
if (strpos($req->do_ttd_img_base64, "application/pdf") !== false) {
|
||||||
@ -4170,7 +4188,7 @@ class TransactionController extends Controller
|
|||||||
$clearBase64 = preg_replace(
|
$clearBase64 = preg_replace(
|
||||||
"/^data:(image|application)\/(png|jpg|jpeg|pdf);base64,/",
|
"/^data:(image|application)\/(png|jpg|jpeg|pdf);base64,/",
|
||||||
"",
|
"",
|
||||||
$req->spk_img_base64,
|
$req->spk_img_base64
|
||||||
);
|
);
|
||||||
$type = "jpeg";
|
$type = "jpeg";
|
||||||
if (strpos($req->spk_img_base64, "application/pdf") !== false) {
|
if (strpos($req->spk_img_base64, "application/pdf") !== false) {
|
||||||
@ -4388,7 +4406,7 @@ class TransactionController extends Controller
|
|||||||
$clearBase64 = preg_replace(
|
$clearBase64 = preg_replace(
|
||||||
"/^data:(image|application)\/(png|jpg|jpeg|pdf);base64,/",
|
"/^data:(image|application)\/(png|jpg|jpeg|pdf);base64,/",
|
||||||
"",
|
"",
|
||||||
$img,
|
$img
|
||||||
);
|
);
|
||||||
$type = "jpeg";
|
$type = "jpeg";
|
||||||
if (strpos($img, "application/pdf") !== false) {
|
if (strpos($img, "application/pdf") !== false) {
|
||||||
@ -4582,12 +4600,12 @@ class TransactionController extends Controller
|
|||||||
$drvAppInsideCircle = Zone::insideOrdZoneCircle(
|
$drvAppInsideCircle = Zone::insideOrdZoneCircle(
|
||||||
$lastLocDriverAps[0]->latitude,
|
$lastLocDriverAps[0]->latitude,
|
||||||
$lastLocDriverAps[0]->longitude,
|
$lastLocDriverAps[0]->longitude,
|
||||||
["zid" => $order[0]->ord_pck_zone_id],
|
["zid" => $order[0]->ord_pck_zone_id]
|
||||||
);
|
);
|
||||||
$drvAppInsideShape = Zone::insideOrdZoneShape(
|
$drvAppInsideShape = Zone::insideOrdZoneShape(
|
||||||
$lastLocDriverAps[0]->latitude,
|
$lastLocDriverAps[0]->latitude,
|
||||||
$lastLocDriverAps[0]->longitude,
|
$lastLocDriverAps[0]->longitude,
|
||||||
["zid" => $order[0]->ord_pck_zone_id],
|
["zid" => $order[0]->ord_pck_zone_id]
|
||||||
);
|
);
|
||||||
if (count($drvAppInsideCircle) < 1 && count($drvAppInsideShape) < 1) {
|
if (count($drvAppInsideCircle) < 1 && count($drvAppInsideShape) < 1) {
|
||||||
$apiResp = Responses::bad_request("Lokasi GPS App Tracker tidak didalam zona pickup");
|
$apiResp = Responses::bad_request("Lokasi GPS App Tracker tidak didalam zona pickup");
|
||||||
@ -5159,7 +5177,7 @@ class TransactionController extends Controller
|
|||||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||||
} elseif ($order[0]->pck_chk_stts != OrdersPickups::CHK_STTS_SUBMIT) {
|
} elseif ($order[0]->pck_chk_stts != OrdersPickups::CHK_STTS_SUBMIT) {
|
||||||
$apiResp = Responses::bad_input(
|
$apiResp = Responses::bad_input(
|
||||||
'can\'t confirm price, checker pickup has not submitted data',
|
'can\'t confirm price, checker pickup has not submitted data'
|
||||||
);
|
);
|
||||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||||
}
|
}
|
||||||
@ -5229,7 +5247,7 @@ class TransactionController extends Controller
|
|||||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||||
} elseif ($order[0]->pck_chk_stts != OrdersPickups::CHK_STTS_SUBMIT) {
|
} elseif ($order[0]->pck_chk_stts != OrdersPickups::CHK_STTS_SUBMIT) {
|
||||||
$apiResp = Responses::bad_input(
|
$apiResp = Responses::bad_input(
|
||||||
'can\'t generate invoice, checker pickup has not submitted data',
|
'can\'t generate invoice, checker pickup has not submitted data'
|
||||||
);
|
);
|
||||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||||
}
|
}
|
||||||
@ -5306,7 +5324,7 @@ class TransactionController extends Controller
|
|||||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||||
} elseif ($order[0]->pck_chk_stts != OrdersPickups::CHK_STTS_SUBMIT) {
|
} elseif ($order[0]->pck_chk_stts != OrdersPickups::CHK_STTS_SUBMIT) {
|
||||||
$apiResp = Responses::bad_input(
|
$apiResp = Responses::bad_input(
|
||||||
'can\'t confirm payment, checker pickup has not submitted data',
|
'can\'t confirm payment, checker pickup has not submitted data'
|
||||||
);
|
);
|
||||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||||
}
|
}
|
||||||
@ -5389,7 +5407,7 @@ class TransactionController extends Controller
|
|||||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||||
} elseif ($order[0]->drop_chk_stts != OrdersDrops::CHK_STTS_SUBMIT) {
|
} elseif ($order[0]->drop_chk_stts != OrdersDrops::CHK_STTS_SUBMIT) {
|
||||||
$apiResp = Responses::bad_input(
|
$apiResp = Responses::bad_input(
|
||||||
'can\'t generate instruction payment, checker drop has not submitted data',
|
'can\'t generate instruction payment, checker drop has not submitted data'
|
||||||
);
|
);
|
||||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -131,7 +131,7 @@ class VehiclesController extends Controller
|
|||||||
"regis_year" => $req->regis_year,
|
"regis_year" => $req->regis_year,
|
||||||
"tax_exp" => $req->tax_exp,
|
"tax_exp" => $req->tax_exp,
|
||||||
"kir_exp" => $req->kir_exp,
|
"kir_exp" => $req->kir_exp,
|
||||||
"vendor_id" => $req->vendor_id,
|
// "vendor_id" => $req->vendor_id,
|
||||||
];
|
];
|
||||||
$rulesInput = [
|
$rulesInput = [
|
||||||
"front_vehicle_photo" => "required|string",
|
"front_vehicle_photo" => "required|string",
|
||||||
@ -163,7 +163,7 @@ class VehiclesController extends Controller
|
|||||||
"regis_year" => "required|digits:4",
|
"regis_year" => "required|digits:4",
|
||||||
"tax_exp" => "required|date_format:Y-m-d",
|
"tax_exp" => "required|date_format:Y-m-d",
|
||||||
"kir_exp" => "required|date_format:Y-m-d",
|
"kir_exp" => "required|date_format:Y-m-d",
|
||||||
"vendor_id" => "nullable|integer|not_in:0",
|
// "vendor_id" => "nullable|integer|not_in:0",
|
||||||
];
|
];
|
||||||
|
|
||||||
if ($req->auth->role == Users::ROLE_VENDOR) {
|
if ($req->auth->role == Users::ROLE_VENDOR) {
|
||||||
@ -221,11 +221,13 @@ class VehiclesController extends Controller
|
|||||||
"track_sch_d" => Vehicles::DEFAULT_TRACK_SCH_D,
|
"track_sch_d" => Vehicles::DEFAULT_TRACK_SCH_D,
|
||||||
"track_sch_h" => Vehicles::DEFAULT_TRACK_SCH_H,
|
"track_sch_h" => Vehicles::DEFAULT_TRACK_SCH_H,
|
||||||
"client_group_id" => $req->auth->client_group_id ?? null,
|
"client_group_id" => $req->auth->client_group_id ?? null,
|
||||||
|
"vendor_id" => $req->auth->client_group_id ?? 1,
|
||||||
"crt" => $now,
|
"crt" => $now,
|
||||||
"crt_by" => $req->auth->uid,
|
"crt_by" => $req->auth->uid,
|
||||||
"updt" => $now,
|
"updt" => $now,
|
||||||
"updt_by" => $req->auth->uid,
|
"updt_by" => $req->auth->uid,
|
||||||
];
|
];
|
||||||
|
// dd($insVhc);
|
||||||
if ($req->model_id) {
|
if ($req->model_id) {
|
||||||
$insVhc["model_id"] = $req->model_id;
|
$insVhc["model_id"] = $req->model_id;
|
||||||
}
|
}
|
||||||
@ -233,7 +235,7 @@ class VehiclesController extends Controller
|
|||||||
$insVhc["vendor_id"] = $req->auth->uid;
|
$insVhc["vendor_id"] = $req->auth->uid;
|
||||||
$insVhc["simcard"] = 0;
|
$insVhc["simcard"] = 0;
|
||||||
} else {
|
} else {
|
||||||
$insVhc["vendor_id"] = $req->vendor_id ?? 0;
|
$insVhc["vendor_id"] = $req->vendor_id ?? 1;
|
||||||
}
|
}
|
||||||
$vid = Vehicles::addVehicle($insVhc);
|
$vid = Vehicles::addVehicle($insVhc);
|
||||||
|
|
||||||
@ -316,7 +318,7 @@ class VehiclesController extends Controller
|
|||||||
$device_id = str_pad($req->device_id, Vehicles::MAX_DEVICE_ID, "0", STR_PAD_LEFT);
|
$device_id = str_pad($req->device_id, Vehicles::MAX_DEVICE_ID, "0", STR_PAD_LEFT);
|
||||||
|
|
||||||
$input = [
|
$input = [
|
||||||
"vid" => $vid,
|
"vid" => 1,
|
||||||
"front_vehicle_photo" => $req->fvhc_base64,
|
"front_vehicle_photo" => $req->fvhc_base64,
|
||||||
"dvc_id" => $req->dvc_id ?? 0,
|
"dvc_id" => $req->dvc_id ?? 0,
|
||||||
"simcard" => $req->simcard,
|
"simcard" => $req->simcard,
|
||||||
@ -346,7 +348,7 @@ class VehiclesController extends Controller
|
|||||||
"regis_year" => $req->regis_year,
|
"regis_year" => $req->regis_year,
|
||||||
"tax_exp" => $req->tax_exp,
|
"tax_exp" => $req->tax_exp,
|
||||||
"kir_exp" => $req->kir_exp,
|
"kir_exp" => $req->kir_exp,
|
||||||
"vendor_id" => $req->vendor_id,
|
// "vendor_id" => $req->vendor_id,
|
||||||
];
|
];
|
||||||
$rulesInput = [
|
$rulesInput = [
|
||||||
"vid" => "required|integer|not_in:0",
|
"vid" => "required|integer|not_in:0",
|
||||||
@ -379,7 +381,7 @@ class VehiclesController extends Controller
|
|||||||
"regis_year" => "required|digits:4",
|
"regis_year" => "required|digits:4",
|
||||||
"tax_exp" => "required|date_format:Y-m-d",
|
"tax_exp" => "required|date_format:Y-m-d",
|
||||||
"kir_exp" => "required|date_format:Y-m-d",
|
"kir_exp" => "required|date_format:Y-m-d",
|
||||||
"vendor_id" => "nullable|integer|not_in:0",
|
// "vendor_id" => "nullable|integer|not_in:0",
|
||||||
];
|
];
|
||||||
|
|
||||||
if ($req->auth->role == Users::ROLE_VENDOR) {
|
if ($req->auth->role == Users::ROLE_VENDOR) {
|
||||||
@ -471,6 +473,7 @@ class VehiclesController extends Controller
|
|||||||
"is_track_holiday" => Vehicles::DEFAULT_TRACK_HOLIDAY,
|
"is_track_holiday" => Vehicles::DEFAULT_TRACK_HOLIDAY,
|
||||||
"track_sch_d" => Vehicles::DEFAULT_TRACK_SCH_D,
|
"track_sch_d" => Vehicles::DEFAULT_TRACK_SCH_D,
|
||||||
"track_sch_h" => Vehicles::DEFAULT_TRACK_SCH_H,
|
"track_sch_h" => Vehicles::DEFAULT_TRACK_SCH_H,
|
||||||
|
"vendor_id" => 1,
|
||||||
"updt" => $now,
|
"updt" => $now,
|
||||||
"updt_by" => $req->auth->uid,
|
"updt_by" => $req->auth->uid,
|
||||||
];
|
];
|
||||||
@ -481,7 +484,7 @@ class VehiclesController extends Controller
|
|||||||
$updtVhc["vendor_id"] = $req->auth->uid;
|
$updtVhc["vendor_id"] = $req->auth->uid;
|
||||||
// $updtVhc["simcard"] = (int) $uniqDeviceId[0]->simcard;
|
// $updtVhc["simcard"] = (int) $uniqDeviceId[0]->simcard;
|
||||||
} else {
|
} else {
|
||||||
$updtVhc["vendor_id"] = $req->vendor_id ?? 0;
|
$updtVhc["vendor_id"] = $req->vendor_id ?? 1;
|
||||||
}
|
}
|
||||||
Vehicles::updateVehicle($vid, $updtVhc);
|
Vehicles::updateVehicle($vid, $updtVhc);
|
||||||
|
|
||||||
|
|||||||
@ -78,9 +78,7 @@ class ZoneController extends Controller
|
|||||||
$zone[0]->boundary_bounds = json_decode($zone[0]->boundary_bounds);
|
$zone[0]->boundary_bounds = json_decode($zone[0]->boundary_bounds);
|
||||||
}
|
}
|
||||||
if ($zone[0]->boundary_latlngs) {
|
if ($zone[0]->boundary_latlngs) {
|
||||||
$zone[0]->boundary_latlngs = json_decode(
|
$zone[0]->boundary_latlngs = json_decode($zone[0]->boundary_latlngs);
|
||||||
$zone[0]->boundary_latlngs
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
unset($zone[0]->boundary_points);
|
unset($zone[0]->boundary_points);
|
||||||
|
|
||||||
@ -136,9 +134,7 @@ class ZoneController extends Controller
|
|||||||
$zone[0]->boundary_bounds = json_decode($zone[0]->boundary_bounds);
|
$zone[0]->boundary_bounds = json_decode($zone[0]->boundary_bounds);
|
||||||
}
|
}
|
||||||
if ($zone[0]->boundary_latlngs) {
|
if ($zone[0]->boundary_latlngs) {
|
||||||
$zone[0]->boundary_latlngs = json_decode(
|
$zone[0]->boundary_latlngs = json_decode($zone[0]->boundary_latlngs);
|
||||||
$zone[0]->boundary_latlngs
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
unset($zone[0]->boundary_points);
|
unset($zone[0]->boundary_points);
|
||||||
|
|
||||||
@ -233,9 +229,7 @@ class ZoneController extends Controller
|
|||||||
// validasi input
|
// validasi input
|
||||||
$isValidInput = Validator::make($input, $rulesInput);
|
$isValidInput = Validator::make($input, $rulesInput);
|
||||||
if (!$isValidInput->passes()) {
|
if (!$isValidInput->passes()) {
|
||||||
$apiResp = Responses::bad_input(
|
$apiResp = Responses::bad_input($isValidInput->messages()->first());
|
||||||
$isValidInput->messages()->first()
|
|
||||||
);
|
|
||||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -307,9 +301,7 @@ class ZoneController extends Controller
|
|||||||
// validasi input
|
// validasi input
|
||||||
$isValidInput = Validator::make($input, $rulesInput);
|
$isValidInput = Validator::make($input, $rulesInput);
|
||||||
if (!$isValidInput->passes()) {
|
if (!$isValidInput->passes()) {
|
||||||
$apiResp = Responses::bad_input(
|
$apiResp = Responses::bad_input($isValidInput->messages()->first());
|
||||||
$isValidInput->messages()->first()
|
|
||||||
);
|
|
||||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -336,16 +328,13 @@ class ZoneController extends Controller
|
|||||||
"boundary_type" => $req->boundary_type,
|
"boundary_type" => $req->boundary_type,
|
||||||
"boundary_hex_color" => strtoupper($req->boundary_hex_color),
|
"boundary_hex_color" => strtoupper($req->boundary_hex_color),
|
||||||
"boundary_latlngs" => json_encode($req->boundary_latlngs),
|
"boundary_latlngs" => json_encode($req->boundary_latlngs),
|
||||||
"boundary_bounds" => $req->boundary_bounds
|
"boundary_bounds" => $req->boundary_bounds ? json_encode($req->boundary_bounds) : null, // $req->boundary_bounds ?? null,
|
||||||
? json_encode($req->boundary_bounds)
|
|
||||||
: null, // $req->boundary_bounds ?? null,
|
|
||||||
"boundary_radius" => $req->boundary_radius ?? 0,
|
"boundary_radius" => $req->boundary_radius ?? 0,
|
||||||
"boundary_diameter" => $req->boundary_diameter ?? 0,
|
"boundary_diameter" => $req->boundary_diameter ?? 0,
|
||||||
"boundary_area" => $req->boundary_area ?? 0,
|
"boundary_area" => $req->boundary_area ?? 0,
|
||||||
"boundary_ha" => $req->boundary_ha ?? 0,
|
"boundary_ha" => $req->boundary_ha ?? 0,
|
||||||
"status" => $req->status,
|
"status" => $req->status,
|
||||||
"client_group_id" =>
|
"client_group_id" => $req->zone_client ?? ($user[0]->client_group_id ?? null),
|
||||||
$req->zone_client ?? ($user[0]->client_group_id ?? null),
|
|
||||||
"crt" => $now,
|
"crt" => $now,
|
||||||
"crt_by" => $req->auth->uid,
|
"crt_by" => $req->auth->uid,
|
||||||
"updt" => $now,
|
"updt" => $now,
|
||||||
@ -356,14 +345,9 @@ class ZoneController extends Controller
|
|||||||
$insZone["boundary_points"] = "ST_GeomFromText('MULTIPOINT(";
|
$insZone["boundary_points"] = "ST_GeomFromText('MULTIPOINT(";
|
||||||
|
|
||||||
foreach ($req->boundary_latlngs as $key => $val) {
|
foreach ($req->boundary_latlngs as $key => $val) {
|
||||||
$insZone["boundary_points"] .=
|
$insZone["boundary_points"] .= $val["lng"] . " " . $val["lat"] . ", ";
|
||||||
$val["lng"] . " " . $val["lat"] . ", ";
|
|
||||||
}
|
}
|
||||||
$insZone["boundary_points"] = substr(
|
$insZone["boundary_points"] = substr($insZone["boundary_points"], 0, -2); // remove 2 last character
|
||||||
$insZone["boundary_points"],
|
|
||||||
0,
|
|
||||||
-2
|
|
||||||
); // remove 2 last character
|
|
||||||
$insZone["boundary_points"] .= ")')";
|
$insZone["boundary_points"] .= ")')";
|
||||||
$insZone["boundary_points"] = DB::raw($insZone["boundary_points"]);
|
$insZone["boundary_points"] = DB::raw($insZone["boundary_points"]);
|
||||||
|
|
||||||
@ -433,9 +417,7 @@ class ZoneController extends Controller
|
|||||||
// validasi input
|
// validasi input
|
||||||
$isValidInput = Validator::make($input, $rulesInput);
|
$isValidInput = Validator::make($input, $rulesInput);
|
||||||
if (!$isValidInput->passes()) {
|
if (!$isValidInput->passes()) {
|
||||||
$apiResp = Responses::bad_input(
|
$apiResp = Responses::bad_input($isValidInput->messages()->first());
|
||||||
$isValidInput->messages()->first()
|
|
||||||
);
|
|
||||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -454,9 +436,7 @@ class ZoneController extends Controller
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($notSameUser) {
|
if ($notSameUser) {
|
||||||
$apiResp = Responses::bad_request(
|
$apiResp = Responses::bad_request("zone name has been used");
|
||||||
"zone name has been used"
|
|
||||||
);
|
|
||||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -478,16 +458,13 @@ class ZoneController extends Controller
|
|||||||
"boundary_type" => $req->boundary_type,
|
"boundary_type" => $req->boundary_type,
|
||||||
"boundary_hex_color" => strtoupper($req->boundary_hex_color),
|
"boundary_hex_color" => strtoupper($req->boundary_hex_color),
|
||||||
"boundary_latlngs" => json_encode($req->boundary_latlngs),
|
"boundary_latlngs" => json_encode($req->boundary_latlngs),
|
||||||
"boundary_bounds" => $req->boundary_bounds
|
"boundary_bounds" => $req->boundary_bounds ? json_encode($req->boundary_bounds) : null, // $req->boundary_bounds ?? null,
|
||||||
? json_encode($req->boundary_bounds)
|
|
||||||
: null, // $req->boundary_bounds ?? null,
|
|
||||||
"boundary_radius" => $req->boundary_radius ?? 0,
|
"boundary_radius" => $req->boundary_radius ?? 0,
|
||||||
"boundary_diameter" => $req->boundary_diameter ?? 0,
|
"boundary_diameter" => $req->boundary_diameter ?? 0,
|
||||||
"boundary_area" => $req->boundary_area ?? 0,
|
"boundary_area" => $req->boundary_area ?? 0,
|
||||||
"boundary_ha" => $req->boundary_ha ?? 0,
|
"boundary_ha" => $req->boundary_ha ?? 0,
|
||||||
"status" => $req->status,
|
"status" => $req->status,
|
||||||
"client_group_id" =>
|
"client_group_id" => $req->zone_client ?? ($user[0]->client_group_id ?? null),
|
||||||
$req->zone_client ?? ($user[0]->client_group_id ?? null),
|
|
||||||
"updt" => $now,
|
"updt" => $now,
|
||||||
"updt_by" => $req->auth->uid,
|
"updt_by" => $req->auth->uid,
|
||||||
];
|
];
|
||||||
@ -496,18 +473,11 @@ class ZoneController extends Controller
|
|||||||
$updtZone["boundary_points"] = "ST_GeomFromText('MULTIPOINT(";
|
$updtZone["boundary_points"] = "ST_GeomFromText('MULTIPOINT(";
|
||||||
|
|
||||||
foreach ($req->boundary_latlngs as $key => $val) {
|
foreach ($req->boundary_latlngs as $key => $val) {
|
||||||
$updtZone["boundary_points"] .=
|
$updtZone["boundary_points"] .= $val["lng"] . " " . $val["lat"] . ", ";
|
||||||
$val["lng"] . " " . $val["lat"] . ", ";
|
|
||||||
}
|
}
|
||||||
$updtZone["boundary_points"] = substr(
|
$updtZone["boundary_points"] = substr($updtZone["boundary_points"], 0, -2); // remove 2 last character
|
||||||
$updtZone["boundary_points"],
|
|
||||||
0,
|
|
||||||
-2
|
|
||||||
); // remove 2 last character
|
|
||||||
$updtZone["boundary_points"] .= ")')";
|
$updtZone["boundary_points"] .= ")')";
|
||||||
$updtZone["boundary_points"] = DB::raw(
|
$updtZone["boundary_points"] = DB::raw($updtZone["boundary_points"]);
|
||||||
$updtZone["boundary_points"]
|
|
||||||
);
|
|
||||||
|
|
||||||
Zone::updateZone($zid, $updtZone);
|
Zone::updateZone($zid, $updtZone);
|
||||||
|
|
||||||
@ -537,9 +507,7 @@ class ZoneController extends Controller
|
|||||||
// validasi input
|
// validasi input
|
||||||
$isValidInput = Validator::make($input, $rulesInput);
|
$isValidInput = Validator::make($input, $rulesInput);
|
||||||
if (!$isValidInput->passes()) {
|
if (!$isValidInput->passes()) {
|
||||||
$apiResp = Responses::bad_input(
|
$apiResp = Responses::bad_input($isValidInput->messages()->first());
|
||||||
$isValidInput->messages()->first()
|
|
||||||
);
|
|
||||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -585,9 +553,7 @@ class ZoneController extends Controller
|
|||||||
// validasi input
|
// validasi input
|
||||||
$isValidInput = Validator::make($input, $rulesInput);
|
$isValidInput = Validator::make($input, $rulesInput);
|
||||||
if (!$isValidInput->passes()) {
|
if (!$isValidInput->passes()) {
|
||||||
$apiResp = Responses::bad_input(
|
$apiResp = Responses::bad_input($isValidInput->messages()->first());
|
||||||
$isValidInput->messages()->first()
|
|
||||||
);
|
|
||||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -599,15 +565,14 @@ class ZoneController extends Controller
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// $zones = Zone::getActiveZones($req->cptid, Zone::ZONE_TYPE_WAREHOUSE, $req->workflow_type);
|
||||||
$zones = Zone::getActiveZones(
|
$zones = Zone::getActiveZones(
|
||||||
$req->cptid,
|
$req->cptid,
|
||||||
Zone::ZONE_TYPE_WAREHOUSE,
|
[Zone::ZONE_TYPE_WAREHOUSE, Zone::ZONE_TYPE_AREA],
|
||||||
$req->workflow_type
|
$req->workflow_type
|
||||||
);
|
);
|
||||||
if (count($zones) < 1) {
|
if (count($zones) < 1) {
|
||||||
$apiResp = Responses::not_found(
|
$apiResp = Responses::not_found("no available zones for client " . $client[0]->c_name);
|
||||||
"no available zones for client " . $client[0]->c_name
|
|
||||||
);
|
|
||||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -643,9 +608,7 @@ class ZoneController extends Controller
|
|||||||
// validasi input
|
// validasi input
|
||||||
$isValidInput = Validator::make($input, $rulesInput);
|
$isValidInput = Validator::make($input, $rulesInput);
|
||||||
if (!$isValidInput->passes()) {
|
if (!$isValidInput->passes()) {
|
||||||
$apiResp = Responses::bad_input(
|
$apiResp = Responses::bad_input($isValidInput->messages()->first());
|
||||||
$isValidInput->messages()->first()
|
|
||||||
);
|
|
||||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -727,9 +690,7 @@ class ZoneController extends Controller
|
|||||||
// validasi input
|
// validasi input
|
||||||
$isValidInput = Validator::make($input, $rulesInput);
|
$isValidInput = Validator::make($input, $rulesInput);
|
||||||
if (!$isValidInput->passes()) {
|
if (!$isValidInput->passes()) {
|
||||||
$apiResp = Responses::bad_input(
|
$apiResp = Responses::bad_input($isValidInput->messages()->first());
|
||||||
$isValidInput->messages()->first()
|
|
||||||
);
|
|
||||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -748,9 +709,7 @@ class ZoneController extends Controller
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($notSameUser) {
|
if ($notSameUser) {
|
||||||
$apiResp = Responses::bad_request(
|
$apiResp = Responses::bad_request("zone name has been used");
|
||||||
"zone name has been used"
|
|
||||||
);
|
|
||||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -791,16 +750,13 @@ class ZoneController extends Controller
|
|||||||
"boundary_type" => $req->boundary_type,
|
"boundary_type" => $req->boundary_type,
|
||||||
"boundary_hex_color" => strtoupper($req->boundary_hex_color),
|
"boundary_hex_color" => strtoupper($req->boundary_hex_color),
|
||||||
"boundary_latlngs" => json_encode($req->boundary_latlngs),
|
"boundary_latlngs" => json_encode($req->boundary_latlngs),
|
||||||
"boundary_bounds" => $req->boundary_bounds
|
"boundary_bounds" => $req->boundary_bounds ? json_encode($req->boundary_bounds) : null, // $req->boundary_bounds ?? null,
|
||||||
? json_encode($req->boundary_bounds)
|
|
||||||
: null, // $req->boundary_bounds ?? null,
|
|
||||||
"boundary_radius" => $req->boundary_radius ?? 0,
|
"boundary_radius" => $req->boundary_radius ?? 0,
|
||||||
"boundary_diameter" => $req->boundary_diameter ?? 0,
|
"boundary_diameter" => $req->boundary_diameter ?? 0,
|
||||||
"boundary_area" => $req->boundary_area ?? 0,
|
"boundary_area" => $req->boundary_area ?? 0,
|
||||||
"boundary_ha" => $req->boundary_ha ?? 0,
|
"boundary_ha" => $req->boundary_ha ?? 0,
|
||||||
"status" => $req->status,
|
"status" => $req->status,
|
||||||
"client_group_id" =>
|
"client_group_id" => $req->zone_client ?? ($user[0]->client_group_id ?? null),
|
||||||
$req->zone_client ?? ($user[0]->client_group_id ?? null),
|
|
||||||
"updt" => $now,
|
"updt" => $now,
|
||||||
"updt_by" => $req->auth->uid,
|
"updt_by" => $req->auth->uid,
|
||||||
];
|
];
|
||||||
@ -809,18 +765,11 @@ class ZoneController extends Controller
|
|||||||
$updtZone["boundary_points"] = "ST_GeomFromText('MULTIPOINT(";
|
$updtZone["boundary_points"] = "ST_GeomFromText('MULTIPOINT(";
|
||||||
|
|
||||||
foreach ($req->boundary_latlngs as $key => $val) {
|
foreach ($req->boundary_latlngs as $key => $val) {
|
||||||
$updtZone["boundary_points"] .=
|
$updtZone["boundary_points"] .= $val["lng"] . " " . $val["lat"] . ", ";
|
||||||
$val["lng"] . " " . $val["lat"] . ", ";
|
|
||||||
}
|
}
|
||||||
$updtZone["boundary_points"] = substr(
|
$updtZone["boundary_points"] = substr($updtZone["boundary_points"], 0, -2); // remove 2 last character
|
||||||
$updtZone["boundary_points"],
|
|
||||||
0,
|
|
||||||
-2
|
|
||||||
); // remove 2 last character
|
|
||||||
$updtZone["boundary_points"] .= ")')";
|
$updtZone["boundary_points"] .= ")')";
|
||||||
$updtZone["boundary_points"] = DB::raw(
|
$updtZone["boundary_points"] = DB::raw($updtZone["boundary_points"]);
|
||||||
$updtZone["boundary_points"]
|
|
||||||
);
|
|
||||||
|
|
||||||
Zone::updateZone($req->zid, $updtZone);
|
Zone::updateZone($req->zid, $updtZone);
|
||||||
|
|
||||||
@ -830,25 +779,16 @@ class ZoneController extends Controller
|
|||||||
|
|
||||||
$drops = Zone::getZoneById($req->zid, ["region_name" => 1]);
|
$drops = Zone::getZoneById($req->zid, ["region_name" => 1]);
|
||||||
if (count($drops) < 1) {
|
if (count($drops) < 1) {
|
||||||
$apiResp = Responses::not_found(
|
$apiResp = Responses::not_found("Lokasi pengantaran tidak ditemukan");
|
||||||
"Lokasi pengantaran tidak ditemukan"
|
|
||||||
);
|
|
||||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||||
}
|
}
|
||||||
if (empty($drops[0]->boundary_points)) {
|
if (empty($drops[0]->boundary_points)) {
|
||||||
$apiResp = Responses::bad_request(
|
$apiResp = Responses::bad_request("Lokasi pengantaran tidak valid");
|
||||||
"Lokasi pengantaran tidak valid"
|
|
||||||
);
|
|
||||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($drops as $iDrop => $drop) {
|
foreach ($drops as $iDrop => $drop) {
|
||||||
if (
|
if ($drop->prid == 0 || $drop->ktid == 0 || $drop->kcid == 0 || $drop->klid == 0) {
|
||||||
$drop->prid == 0 ||
|
|
||||||
$drop->ktid == 0 ||
|
|
||||||
$drop->kcid == 0 ||
|
|
||||||
$drop->klid == 0
|
|
||||||
) {
|
|
||||||
$apiResp = Responses::bad_request(
|
$apiResp = Responses::bad_request(
|
||||||
"Zonasi wilayah(provinsi, kecamatan, ...) lokasi pengantaran " .
|
"Zonasi wilayah(provinsi, kecamatan, ...) lokasi pengantaran " .
|
||||||
$drop->name .
|
$drop->name .
|
||||||
@ -858,8 +798,7 @@ class ZoneController extends Controller
|
|||||||
}
|
}
|
||||||
$drops[$iDrop]->inpt_pic_name = $order->drop_pic_name;
|
$drops[$iDrop]->inpt_pic_name = $order->drop_pic_name;
|
||||||
$drops[$iDrop]->inpt_pic_phone_code = 62;
|
$drops[$iDrop]->inpt_pic_phone_code = 62;
|
||||||
$drops[$iDrop]->inpt_pic_phone_val =
|
$drops[$iDrop]->inpt_pic_phone_val = (int) $order->drop_pic_phone_val;
|
||||||
(int) $order->drop_pic_phone_val;
|
|
||||||
$drops[$iDrop]->inpt_pic_mail = null;
|
$drops[$iDrop]->inpt_pic_mail = null;
|
||||||
|
|
||||||
$updtDrop = [
|
$updtDrop = [
|
||||||
@ -973,9 +912,7 @@ class ZoneController extends Controller
|
|||||||
// validasi input
|
// validasi input
|
||||||
$isValidInput = Validator::make($input, $rulesInput);
|
$isValidInput = Validator::make($input, $rulesInput);
|
||||||
if (!$isValidInput->passes()) {
|
if (!$isValidInput->passes()) {
|
||||||
$apiResp = Responses::bad_input(
|
$apiResp = Responses::bad_input($isValidInput->messages()->first());
|
||||||
$isValidInput->messages()->first()
|
|
||||||
);
|
|
||||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1014,25 +951,16 @@ class ZoneController extends Controller
|
|||||||
|
|
||||||
$drops = Zone::getZoneById($req->drop_zid, ["region_name" => 1]);
|
$drops = Zone::getZoneById($req->drop_zid, ["region_name" => 1]);
|
||||||
if (count($drops) < 1) {
|
if (count($drops) < 1) {
|
||||||
$apiResp = Responses::not_found(
|
$apiResp = Responses::not_found("Lokasi pengantaran tidak ditemukan");
|
||||||
"Lokasi pengantaran tidak ditemukan"
|
|
||||||
);
|
|
||||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||||
}
|
}
|
||||||
if (empty($drops[0]->boundary_points)) {
|
if (empty($drops[0]->boundary_points)) {
|
||||||
$apiResp = Responses::bad_request(
|
$apiResp = Responses::bad_request("Lokasi pengantaran tidak valid");
|
||||||
"Lokasi pengantaran tidak valid"
|
|
||||||
);
|
|
||||||
return new Response($apiResp, $apiResp["meta"]["code"]);
|
return new Response($apiResp, $apiResp["meta"]["code"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($drops as $iDrop => $drop) {
|
foreach ($drops as $iDrop => $drop) {
|
||||||
if (
|
if ($drop->prid == 0 || $drop->ktid == 0 || $drop->kcid == 0 || $drop->klid == 0) {
|
||||||
$drop->prid == 0 ||
|
|
||||||
$drop->ktid == 0 ||
|
|
||||||
$drop->kcid == 0 ||
|
|
||||||
$drop->klid == 0
|
|
||||||
) {
|
|
||||||
$apiResp = Responses::bad_request(
|
$apiResp = Responses::bad_request(
|
||||||
"Zonasi wilayah(provinsi, kecamatan, ...) lokasi pengantaran " .
|
"Zonasi wilayah(provinsi, kecamatan, ...) lokasi pengantaran " .
|
||||||
$drop->name .
|
$drop->name .
|
||||||
@ -1042,8 +970,7 @@ class ZoneController extends Controller
|
|||||||
}
|
}
|
||||||
$drops[$iDrop]->inpt_pic_name = $order->drop_pic_name;
|
$drops[$iDrop]->inpt_pic_name = $order->drop_pic_name;
|
||||||
$drops[$iDrop]->inpt_pic_phone_code = 62;
|
$drops[$iDrop]->inpt_pic_phone_code = 62;
|
||||||
$drops[$iDrop]->inpt_pic_phone_val =
|
$drops[$iDrop]->inpt_pic_phone_val = (int) $order->drop_pic_phone_val;
|
||||||
(int) $order->drop_pic_phone_val;
|
|
||||||
$drops[$iDrop]->inpt_pic_mail = null;
|
$drops[$iDrop]->inpt_pic_mail = null;
|
||||||
|
|
||||||
$updtDrop = [
|
$updtDrop = [
|
||||||
|
|||||||
@ -24,214 +24,214 @@ class AuthUser
|
|||||||
|
|
||||||
if ($request->auth->role == Users::ROLE_ADMIN) {
|
if ($request->auth->role == Users::ROLE_ADMIN) {
|
||||||
// views
|
// views
|
||||||
if ($request->is("gps/home/*")) {
|
if ($request->is("home/*")) {
|
||||||
} elseif ($request->is("gps/home")) {
|
} elseif ($request->is("home")) {
|
||||||
} elseif ($request->is("gps/dashboard/*")) {
|
} elseif ($request->is("dashboard/*")) {
|
||||||
} elseif ($request->is("gps/dashboard")) {
|
} elseif ($request->is("dashboard")) {
|
||||||
} elseif ($request->is("gps/drivers/*")) {
|
} elseif ($request->is("drivers/*")) {
|
||||||
} elseif ($request->is("gps/drivers")) {
|
} elseif ($request->is("drivers")) {
|
||||||
} elseif ($request->is("gps/transactions/*")) {
|
} elseif ($request->is("transactions/*")) {
|
||||||
} elseif ($request->is("gps/transactions")) {
|
} elseif ($request->is("transactions")) {
|
||||||
} elseif ($request->is("gps/vehicles/*")) {
|
} elseif ($request->is("vehicles/*")) {
|
||||||
} elseif ($request->is("gps/vehicles")) {
|
} elseif ($request->is("vehicles")) {
|
||||||
} elseif ($request->is("gps/clients/*")) {
|
} elseif ($request->is("clients/*")) {
|
||||||
} elseif ($request->is("gps/clients")) {
|
} elseif ($request->is("clients")) {
|
||||||
} elseif ($request->is("gps/zone/*")) {
|
} elseif ($request->is("zone/*")) {
|
||||||
} elseif ($request->is("gps/zone")) {
|
} elseif ($request->is("zone")) {
|
||||||
} elseif ($request->is("gps/users/*")) {
|
} elseif ($request->is("users/*")) {
|
||||||
} elseif ($request->is("gps/users")) {
|
} elseif ($request->is("users")) {
|
||||||
} elseif ($request->is("gps/profile/*")) {
|
} elseif ($request->is("profile/*")) {
|
||||||
} elseif ($request->is("gps/profile")) {
|
} elseif ($request->is("profile")) {
|
||||||
} elseif ($request->is("gps/config/*")) {
|
} elseif ($request->is("config/*")) {
|
||||||
} elseif ($request->is("gps/config")) {
|
} elseif ($request->is("config")) {
|
||||||
} elseif ($request->is("gps/pocket/*")) {
|
} elseif ($request->is("pocket/*")) {
|
||||||
} elseif ($request->is("gps/pocket")) {
|
} elseif ($request->is("pocket")) {
|
||||||
} elseif ($request->is("gps/lgb_types/*")) {
|
} elseif ($request->is("lgb_types/*")) {
|
||||||
} elseif ($request->is("gps/lgb_types")) {
|
} elseif ($request->is("lgb_types")) {
|
||||||
} elseif ($request->is("gps/lgb_masters/*")) {
|
} elseif ($request->is("lgb_masters/*")) {
|
||||||
} elseif ($request->is("gps/lgb_masters")) {
|
} elseif ($request->is("lgb_masters")) {
|
||||||
} elseif ($request->is("gps/insurances/*")) {
|
} elseif ($request->is("insurances/*")) {
|
||||||
} elseif ($request->is("gps/static_insurances/*")) {
|
} elseif ($request->is("static_insurances/*")) {
|
||||||
}
|
}
|
||||||
// api
|
// api
|
||||||
elseif ($request->is("gps/api/conf/*")) {
|
elseif ($request->is("api/conf/*")) {
|
||||||
} elseif ($request->is("gps/api/conf")) {
|
} elseif ($request->is("api/conf")) {
|
||||||
} elseif ($request->is("gps/api/osm/*")) {
|
} elseif ($request->is("api/osm/*")) {
|
||||||
} elseif ($request->is("gps/api/osm")) {
|
} elseif ($request->is("api/osm")) {
|
||||||
} elseif ($request->is("gps/api/region/*")) {
|
} elseif ($request->is("api/region/*")) {
|
||||||
} elseif ($request->is("gps/api/region")) {
|
} elseif ($request->is("api/region")) {
|
||||||
} elseif ($request->is("gps/api/zones/*")) {
|
} elseif ($request->is("api/zones/*")) {
|
||||||
} elseif ($request->is("gps/api/zones")) {
|
} elseif ($request->is("api/zones")) {
|
||||||
} elseif ($request->is("gps/api/vehicles/*")) {
|
} elseif ($request->is("api/vehicles/*")) {
|
||||||
} elseif ($request->is("gps/api/vehicles")) {
|
} elseif ($request->is("api/vehicles")) {
|
||||||
} elseif ($request->is("gps/api/drivers/*")) {
|
} elseif ($request->is("api/drivers/*")) {
|
||||||
} elseif ($request->is("gps/api/drivers")) {
|
} elseif ($request->is("api/drivers")) {
|
||||||
} elseif ($request->is("gps/api/users/*")) {
|
} elseif ($request->is("api/users/*")) {
|
||||||
} elseif ($request->is("gps/api/users")) {
|
} elseif ($request->is("api/users")) {
|
||||||
} elseif ($request->is("gps/api/clients/*")) {
|
} elseif ($request->is("api/clients/*")) {
|
||||||
} elseif ($request->is("gps/api/clients")) {
|
} elseif ($request->is("api/clients")) {
|
||||||
} elseif ($request->is("gps/api/tracks/*")) {
|
} elseif ($request->is("api/tracks/*")) {
|
||||||
} elseif ($request->is("gps/api/tracks")) {
|
} elseif ($request->is("api/tracks")) {
|
||||||
} elseif ($request->is("gps/api/transactions/*")) {
|
} elseif ($request->is("api/transactions/*")) {
|
||||||
} elseif ($request->is("gps/api/transactions")) {
|
} elseif ($request->is("api/transactions")) {
|
||||||
} elseif ($request->is("gps/api/transactions_spc/*")) {
|
} elseif ($request->is("api/transactions_spc/*")) {
|
||||||
} elseif ($request->is("gps/api/transactions_spc")) {
|
} elseif ($request->is("api/transactions_spc")) {
|
||||||
} elseif ($request->is("gps/api/insurances/*")) {
|
} elseif ($request->is("api/insurances/*")) {
|
||||||
} elseif ($request->is("gps/api/insurances")) {
|
} elseif ($request->is("api/insurances")) {
|
||||||
} elseif ($request->is("gps/api/devices/*")) {
|
} elseif ($request->is("api/devices/*")) {
|
||||||
} elseif ($request->is("gps/api/devices")) {
|
} elseif ($request->is("api/devices")) {
|
||||||
} elseif ($request->is("gps/api/user/clients/*")) {
|
} elseif ($request->is("api/user/clients/*")) {
|
||||||
} elseif ($request->is("gps/api/user/clients")) {
|
} elseif ($request->is("api/user/clients")) {
|
||||||
} elseif ($request->is("gps/api/a_items/*")) {
|
} elseif ($request->is("api/a_items/*")) {
|
||||||
} elseif ($request->is("gps/api/a_items")) {
|
} elseif ($request->is("api/a_items")) {
|
||||||
} elseif ($request->is("gps/api/admin/*")) {
|
} elseif ($request->is("api/admin/*")) {
|
||||||
} elseif ($request->is("gps/api/admin")) {
|
} elseif ($request->is("api/admin")) {
|
||||||
} elseif ($request->is("gps/api/static_insurances/*")) {
|
} elseif ($request->is("api/static_insurances/*")) {
|
||||||
} elseif ($request->is("gps/api/static_insurances")) {
|
} elseif ($request->is("api/static_insurances")) {
|
||||||
} elseif ($request->is("gps/api/menu_permissions/*")) {
|
} elseif ($request->is("api/menu_permissions/*")) {
|
||||||
} elseif ($request->is("gps/api/menu_permissions")) {
|
} elseif ($request->is("api/menu_permissions")) {
|
||||||
} elseif ($request->is("gps/api/pocket/*")) {
|
} elseif ($request->is("api/pocket/*")) {
|
||||||
} elseif ($request->is("gps/api/pocket")) {
|
} elseif ($request->is("api/pocket")) {
|
||||||
} elseif ($request->is("gps/api/lgb_types/*")) {
|
} elseif ($request->is("api/lgb_types/*")) {
|
||||||
} elseif ($request->is("gps/api/lgb_types")) {
|
} elseif ($request->is("api/lgb_types")) {
|
||||||
} elseif ($request->is("gps/api/lgb_keys/*")) {
|
} elseif ($request->is("api/lgb_keys/*")) {
|
||||||
} elseif ($request->is("gps/api/lgb_keys")) {
|
} elseif ($request->is("api/lgb_keys")) {
|
||||||
} elseif ($request->is("gps/api/dtypes/*")) {
|
} elseif ($request->is("api/dtypes/*")) {
|
||||||
} elseif ($request->is("gps/api/dtypes")) {
|
} elseif ($request->is("api/dtypes")) {
|
||||||
} elseif ($request->is("gps/api/dana/*")) {
|
} elseif ($request->is("api/dana/*")) {
|
||||||
} elseif ($request->is("gps/api/dana")) {
|
} elseif ($request->is("api/dana")) {
|
||||||
} elseif ($request->is("gps/api/universal/*")) {
|
} elseif ($request->is("api/universal/*")) {
|
||||||
} elseif ($request->is("gps/api/universal")) {
|
} elseif ($request->is("api/universal")) {
|
||||||
} else {
|
} else {
|
||||||
return abort(403, "Unauthorized action.");
|
return abort(403, "Unauthorized action.");
|
||||||
}
|
}
|
||||||
} elseif ($request->auth->role == Users::ROLE_VENDOR) {
|
} elseif ($request->auth->role == Users::ROLE_VENDOR) {
|
||||||
// views
|
// views
|
||||||
if ($request->is("gps/home/*")) {
|
if ($request->is("home/*")) {
|
||||||
} elseif ($request->is("gps/home")) {
|
} elseif ($request->is("home")) {
|
||||||
} elseif ($request->is("gps/dashboard/*")) {
|
} elseif ($request->is("dashboard/*")) {
|
||||||
} elseif ($request->is("gps/dashboard")) {
|
} elseif ($request->is("dashboard")) {
|
||||||
} elseif ($request->is("gps/checklist/*")) {
|
} elseif ($request->is("checklist/*")) {
|
||||||
} elseif ($request->is("gps/checklist")) {
|
} elseif ($request->is("checklist")) {
|
||||||
} elseif ($request->is("gps/zone/*")) {
|
} elseif ($request->is("zone/*")) {
|
||||||
} elseif ($request->is("gps/zone")) {
|
} elseif ($request->is("zone")) {
|
||||||
} elseif ($request->is("gps/drivers/*")) {
|
} elseif ($request->is("drivers/*")) {
|
||||||
} elseif ($request->is("gps/drivers")) {
|
} elseif ($request->is("drivers")) {
|
||||||
} elseif ($request->is("gps/vehicles/*")) {
|
} elseif ($request->is("vehicles/*")) {
|
||||||
} elseif ($request->is("gps/vehicles")) {
|
} elseif ($request->is("vehicles")) {
|
||||||
} elseif ($request->is("gps/profile/*")) {
|
} elseif ($request->is("profile/*")) {
|
||||||
} elseif ($request->is("gps/transactions/*")) {
|
} elseif ($request->is("transactions/*")) {
|
||||||
} elseif ($request->is("gps/transactions")) {
|
} elseif ($request->is("transactions")) {
|
||||||
} elseif ($request->is("gps/profile")) {
|
} elseif ($request->is("profile")) {
|
||||||
} elseif ($request->is("gps/user/vendor/*")) {
|
} elseif ($request->is("user/vendor/*")) {
|
||||||
} elseif ($request->is("gps/user/vendor")) {
|
} elseif ($request->is("user/vendor")) {
|
||||||
}
|
}
|
||||||
// api
|
// api
|
||||||
elseif ($request->is("gps/api/conf")) {
|
elseif ($request->is("api/conf")) {
|
||||||
} elseif ($request->is("gps/api/osm/*")) {
|
} elseif ($request->is("api/osm/*")) {
|
||||||
} elseif ($request->is("gps/api/osm")) {
|
} elseif ($request->is("api/osm")) {
|
||||||
} elseif ($request->is("gps/api/region/*")) {
|
} elseif ($request->is("api/region/*")) {
|
||||||
} elseif ($request->is("gps/api/region")) {
|
} elseif ($request->is("api/region")) {
|
||||||
} elseif ($request->is("gps/api/tracks/*")) {
|
} elseif ($request->is("api/tracks/*")) {
|
||||||
} elseif ($request->is("gps/api/tracks")) {
|
} elseif ($request->is("api/tracks")) {
|
||||||
} elseif ($request->is("gps/api/vehicles/*")) {
|
} elseif ($request->is("api/vehicles/*")) {
|
||||||
} elseif ($request->is("gps/api/vehicles")) {
|
} elseif ($request->is("api/vehicles")) {
|
||||||
} elseif ($request->is("gps/api/drivers/*")) {
|
} elseif ($request->is("api/drivers/*")) {
|
||||||
} elseif ($request->is("gps/api/drivers")) {
|
} elseif ($request->is("api/drivers")) {
|
||||||
} elseif ($request->is("gps/api/user/vendor/*")) {
|
} elseif ($request->is("api/user/vendor/*")) {
|
||||||
} elseif ($request->is("gps/api/user/vendor")) {
|
} elseif ($request->is("api/user/vendor")) {
|
||||||
} elseif ($request->is("gps/api/transactions_spc/*")) {
|
} elseif ($request->is("api/transactions_spc/*")) {
|
||||||
} elseif ($request->is("gps/api/transactions_spc")) {
|
} elseif ($request->is("api/transactions_spc")) {
|
||||||
} elseif ($request->is("gps/api/zones/*")) {
|
} elseif ($request->is("api/zones/*")) {
|
||||||
} elseif ($request->is("gps/api/zones")) {
|
} elseif ($request->is("api/zones")) {
|
||||||
} elseif ($request->is("gps/api/users/*")) {
|
} elseif ($request->is("api/users/*")) {
|
||||||
} elseif ($request->is("gps/api/users")) {
|
} elseif ($request->is("api/users")) {
|
||||||
} elseif ($request->is("gps/api/universal/*")) {
|
} elseif ($request->is("api/universal/*")) {
|
||||||
} elseif ($request->is("gps/api/universal")) {
|
} elseif ($request->is("api/universal")) {
|
||||||
} else {
|
} else {
|
||||||
return abort(403, "Unauthorized action.");
|
return abort(403, "Unauthorized action.");
|
||||||
}
|
}
|
||||||
} elseif ($request->auth->role == Users::ROLE_CLIENT_ADMIN) {
|
} elseif ($request->auth->role == Users::ROLE_CLIENT_ADMIN) {
|
||||||
// views
|
// views
|
||||||
if ($request->is("gps/home/*")) {
|
if ($request->is("home/*")) {
|
||||||
} elseif ($request->is("gps/home")) {
|
} elseif ($request->is("home")) {
|
||||||
} elseif ($request->is("gps/dashboard/*")) {
|
} elseif ($request->is("dashboard/*")) {
|
||||||
} elseif ($request->is("gps/dashboard")) {
|
} elseif ($request->is("dashboard")) {
|
||||||
} elseif ($request->is("gps/zone/*")) {
|
} elseif ($request->is("zone/*")) {
|
||||||
} elseif ($request->is("gps/zone")) {
|
} elseif ($request->is("zone")) {
|
||||||
} elseif ($request->is("gps/profile/*")) {
|
} elseif ($request->is("profile/*")) {
|
||||||
} elseif ($request->is("gps/profile")) {
|
} elseif ($request->is("profile")) {
|
||||||
} elseif ($request->is("gps/user/clients/*")) {
|
} elseif ($request->is("user/clients/*")) {
|
||||||
} elseif ($request->is("gps/user/clients")) {
|
} elseif ($request->is("user/clients")) {
|
||||||
}
|
}
|
||||||
// api
|
// api
|
||||||
elseif ($request->is("gps/api/conf")) {
|
elseif ($request->is("api/conf")) {
|
||||||
} elseif ($request->is("gps/api/osm/*")) {
|
} elseif ($request->is("api/osm/*")) {
|
||||||
} elseif ($request->is("gps/api/osm")) {
|
} elseif ($request->is("api/osm")) {
|
||||||
} elseif ($request->is("gps/api/region/*")) {
|
} elseif ($request->is("api/region/*")) {
|
||||||
} elseif ($request->is("gps/api/region")) {
|
} elseif ($request->is("api/region")) {
|
||||||
} elseif ($request->is("gps/api/zones/*")) {
|
} elseif ($request->is("api/zones/*")) {
|
||||||
} elseif ($request->is("gps/api/zones")) {
|
} elseif ($request->is("api/zones")) {
|
||||||
} elseif ($request->is("gps/api/tracks/*")) {
|
} elseif ($request->is("api/tracks/*")) {
|
||||||
} elseif ($request->is("gps/api/tracks")) {
|
} elseif ($request->is("api/tracks")) {
|
||||||
} elseif ($request->is("gps/api/user/clients/*")) {
|
} elseif ($request->is("api/user/clients/*")) {
|
||||||
} elseif ($request->is("gps/api/user/clients")) {
|
} elseif ($request->is("api/user/clients")) {
|
||||||
} elseif ($request->is("gps/api/users/*")) {
|
} elseif ($request->is("api/users/*")) {
|
||||||
} elseif ($request->is("gps/api/users")) {
|
} elseif ($request->is("api/users")) {
|
||||||
} elseif ($request->is("gps/api/universal/*")) {
|
} elseif ($request->is("api/universal/*")) {
|
||||||
} elseif ($request->is("gps/api/universal")) {
|
} elseif ($request->is("api/universal")) {
|
||||||
} else {
|
} else {
|
||||||
return abort(403, "Unauthorized action.");
|
return abort(403, "Unauthorized action.");
|
||||||
}
|
}
|
||||||
} elseif ($request->auth->role == Users::ROLE_CHECKER) {
|
} elseif ($request->auth->role == Users::ROLE_CHECKER) {
|
||||||
// views
|
// views
|
||||||
if ($request->is("gps/user/checker/*")) {
|
if ($request->is("user/checker/*")) {
|
||||||
} elseif ($request->is("gps/user/checker")) {
|
} elseif ($request->is("user/checker")) {
|
||||||
} elseif ($request->is("gps/profile/*")) {
|
} elseif ($request->is("profile/*")) {
|
||||||
} elseif ($request->is("gps/profile")) {
|
} elseif ($request->is("profile")) {
|
||||||
}
|
}
|
||||||
// api
|
// api
|
||||||
elseif ($request->is("gps/api/user/checker/*")) {
|
elseif ($request->is("api/user/checker/*")) {
|
||||||
} elseif ($request->is("gps/api/user/checker")) {
|
} elseif ($request->is("api/user/checker")) {
|
||||||
} elseif ($request->is("gps/api/users/*")) {
|
} elseif ($request->is("api/users/*")) {
|
||||||
} elseif ($request->is("gps/api/users")) {
|
} elseif ($request->is("api/users")) {
|
||||||
} elseif ($request->is("gps/api/universal/*")) {
|
} elseif ($request->is("api/universal/*")) {
|
||||||
} elseif ($request->is("gps/api/universal")) {
|
} elseif ($request->is("api/universal")) {
|
||||||
} else {
|
} else {
|
||||||
return abort(403, "Unauthorized action.");
|
return abort(403, "Unauthorized action.");
|
||||||
}
|
}
|
||||||
} elseif ($request->auth->role == Users::ROLE_FINANCE) {
|
} elseif ($request->auth->role == Users::ROLE_FINANCE) {
|
||||||
// views
|
// views
|
||||||
if ($request->is("gps/finance/*")) {
|
if ($request->is("finance/*")) {
|
||||||
} elseif ($request->is("gps/profile/*")) {
|
} elseif ($request->is("profile/*")) {
|
||||||
} elseif ($request->is("gps/profile")) {
|
} elseif ($request->is("profile")) {
|
||||||
}
|
}
|
||||||
// api
|
// api
|
||||||
elseif ($request->is("gps/api/finance/*")) {
|
elseif ($request->is("api/finance/*")) {
|
||||||
} elseif ($request->is("gps/api/finance")) {
|
} elseif ($request->is("api/finance")) {
|
||||||
} elseif ($request->is("gps/api/a_items/*")) {
|
} elseif ($request->is("api/a_items/*")) {
|
||||||
} elseif ($request->is("gps/api/a_items")) {
|
} elseif ($request->is("api/a_items")) {
|
||||||
} elseif ($request->is("gps/api/users/*")) {
|
} elseif ($request->is("api/users/*")) {
|
||||||
} elseif ($request->is("gps/api/users")) {
|
} elseif ($request->is("api/users")) {
|
||||||
} elseif ($request->is("gps/api/dana/*")) {
|
} elseif ($request->is("api/dana/*")) {
|
||||||
} elseif ($request->is("gps/api/dana")) {
|
} elseif ($request->is("api/dana")) {
|
||||||
} elseif ($request->is("gps/api/universal/*")) {
|
} elseif ($request->is("api/universal/*")) {
|
||||||
} elseif ($request->is("gps/api/universal")) {
|
} elseif ($request->is("api/universal")) {
|
||||||
} else {
|
} else {
|
||||||
return abort(403, "Unauthorized action.");
|
return abort(403, "Unauthorized action.");
|
||||||
}
|
}
|
||||||
} elseif ($request->auth->role == Users::ROLE_SPECIAL_TRACKING) {
|
} elseif ($request->auth->role == Users::ROLE_SPECIAL_TRACKING) {
|
||||||
// views
|
// views
|
||||||
if ($request->is("gps/dashboard/*")) {
|
if ($request->is("dashboard/*")) {
|
||||||
} elseif ($request->is("gps/dashboard")) {
|
} elseif ($request->is("dashboard")) {
|
||||||
}
|
}
|
||||||
// api
|
// api
|
||||||
elseif ($request->is("gps/api/tracks/*")) {
|
elseif ($request->is("api/tracks/*")) {
|
||||||
} elseif ($request->is("gps/api/tracks")) {
|
} elseif ($request->is("api/tracks")) {
|
||||||
} elseif ($request->is("gps/api/users/*")) {
|
} elseif ($request->is("api/users/*")) {
|
||||||
} elseif ($request->is("gps/api/users")) {
|
} elseif ($request->is("api/users")) {
|
||||||
} elseif ($request->is("gps/api/universal/*")) {
|
} elseif ($request->is("api/universal/*")) {
|
||||||
} elseif ($request->is("gps/api/universal")) {
|
} elseif ($request->is("api/universal")) {
|
||||||
} else {
|
} else {
|
||||||
return abort(403, "Unauthorized action.");
|
return abort(403, "Unauthorized action.");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -68,19 +68,14 @@ class Drivers extends Model
|
|||||||
$params = [];
|
$params = [];
|
||||||
$where_vendor = "";
|
$where_vendor = "";
|
||||||
$join_vendor = "";
|
$join_vendor = "";
|
||||||
if ($auth->role != Users::ROLE_ADMIN) {
|
// if ($auth->role != Users::ROLE_ADMIN) {
|
||||||
$where_vendor .= " AND d.vendor_id = " . $auth->uid;
|
// $where_vendor .= " AND d.vendor_id = " . $auth->uid;
|
||||||
}
|
// }
|
||||||
if (isset($filter["status"])) {
|
if (isset($filter["status"])) {
|
||||||
$where_vendor .= " AND d.status = ?";
|
$where_vendor .= " AND d.status = ?";
|
||||||
array_push($params, $filter["status"]);
|
array_push($params, $filter["status"]);
|
||||||
}
|
}
|
||||||
return DB::select(
|
return DB::select("SELECT * FROM t_drivers as d WHERE dlt is null " . $where_vendor . ";", $params);
|
||||||
"SELECT * FROM t_drivers as d WHERE dlt is null " .
|
|
||||||
$where_vendor .
|
|
||||||
";",
|
|
||||||
$params
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function showDriverById($did)
|
public static function showDriverById($did)
|
||||||
@ -99,34 +94,22 @@ class Drivers extends Model
|
|||||||
|
|
||||||
public static function getDriverById($did)
|
public static function getDriverById($did)
|
||||||
{
|
{
|
||||||
return DB::select(
|
return DB::select("SELECT * FROM t_drivers WHERE dlt is null AND id = ? LIMIT 1;", [$did]);
|
||||||
"SELECT * FROM t_drivers WHERE dlt is null AND id = ? LIMIT 1;",
|
|
||||||
[$did]
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getDriverByEmail($email)
|
public static function getDriverByEmail($email)
|
||||||
{
|
{
|
||||||
return DB::select(
|
return DB::select("SELECT * FROM t_drivers WHERE dlt is null AND email = ? LIMIT 2;", [$email]);
|
||||||
"SELECT * FROM t_drivers WHERE dlt is null AND email = ? LIMIT 2;",
|
|
||||||
[$email]
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getDriverByPhone($phone)
|
public static function getDriverByPhone($phone)
|
||||||
{
|
{
|
||||||
return DB::select(
|
return DB::select("SELECT * FROM t_drivers WHERE dlt is null AND phone = ? LIMIT 2;", [$phone]);
|
||||||
"SELECT * FROM t_drivers WHERE dlt is null AND phone = ? LIMIT 2;",
|
|
||||||
[$phone]
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getDriverByNik($nik)
|
public static function getDriverByNik($nik)
|
||||||
{
|
{
|
||||||
return DB::select(
|
return DB::select("SELECT * FROM t_drivers WHERE dlt is null AND nik = ? LIMIT 2;", [$nik]);
|
||||||
"SELECT * FROM t_drivers WHERE dlt is null AND nik = ? LIMIT 2;",
|
|
||||||
[$nik]
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getDriverByIdAllData($did)
|
public static function getDriverByIdAllData($did)
|
||||||
|
|||||||
@ -20,12 +20,16 @@ class Dummy extends Model
|
|||||||
|
|
||||||
public static function updateDummyTrack($data)
|
public static function updateDummyTrack($data)
|
||||||
{
|
{
|
||||||
return DB::table("t_dummy_tracks")->where("id", $data['id'])->update($data);
|
return DB::table("t_dummy_tracks")
|
||||||
|
->where("id", $data["id"])
|
||||||
|
->update($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function deleteDummyTrack($data)
|
public static function deleteDummyTrack($data)
|
||||||
{
|
{
|
||||||
return DB::table("t_dummy_tracks")->where("id", $data['id'])->delete();
|
return DB::table("t_dummy_tracks")
|
||||||
|
->where("id", $data["id"])
|
||||||
|
->delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
@ -39,9 +43,9 @@ class Dummy extends Model
|
|||||||
/**
|
/**
|
||||||
* https://stackoverflow.com/questions/574691/mysql-great-circle-distance-haversine-formula
|
* https://stackoverflow.com/questions/574691/mysql-great-circle-distance-haversine-formula
|
||||||
* miles: 3958.756 || 3959
|
* miles: 3958.756 || 3959
|
||||||
* km: 6371
|
* km: 6371
|
||||||
* meters: 6371000
|
* meters: 6371000
|
||||||
* more accurate using km/meters than miles i think ~ rafifmulia
|
* more accurate using km/meters than miles i think ~
|
||||||
*/
|
*/
|
||||||
public static function nearestHubInCircle($lat, $lng)
|
public static function nearestHubInCircle($lat, $lng)
|
||||||
{
|
{
|
||||||
@ -51,9 +55,9 @@ class Dummy extends Model
|
|||||||
HAVING distance <= 800
|
HAVING distance <= 800
|
||||||
ORDER BY distance;";
|
ORDER BY distance;";
|
||||||
$params = [
|
$params = [
|
||||||
'lat1' => $lat,
|
"lat1" => $lat,
|
||||||
'lat2' => $lat,
|
"lat2" => $lat,
|
||||||
'lng' => $lng,
|
"lng" => $lng,
|
||||||
];
|
];
|
||||||
return DB::select($query, $params);
|
return DB::select($query, $params);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -65,6 +65,7 @@ class Orders extends Model
|
|||||||
,ord_pck.pck_name,ord_pck.stts_pck,ord_pck.pck_addr
|
,ord_pck.pck_name,ord_pck.stts_pck,ord_pck.pck_addr
|
||||||
,ord_drop.drop_name,ord_drop.stts_drop,ord_drop.drop_addr
|
,ord_drop.drop_name,ord_drop.stts_drop,ord_drop.drop_addr
|
||||||
,ord_c.c_name
|
,ord_c.c_name
|
||||||
|
,ord_c.c_pt_name
|
||||||
,ord_vdr.vdr_name
|
,ord_vdr.vdr_name
|
||||||
,ord_drv.drv_name
|
,ord_drv.drv_name
|
||||||
,ord_vhc.vhc_id,ord_vhc.vhc_name,ord_vhc.vhc_nopol1,ord_vhc.vhc_nopol2,ord_vhc.vhc_nopol3
|
,ord_vhc.vhc_id,ord_vhc.vhc_name,ord_vhc.vhc_nopol1,ord_vhc.vhc_nopol2,ord_vhc.vhc_nopol3
|
||||||
@ -140,7 +141,7 @@ class Orders extends Model
|
|||||||
Orders::STTS_GO,
|
Orders::STTS_GO,
|
||||||
Orders::STTS_PCK,
|
Orders::STTS_PCK,
|
||||||
Orders::STTS_ARV,
|
Orders::STTS_ARV,
|
||||||
Orders::STTS_DROP,
|
Orders::STTS_DROP
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -155,7 +156,7 @@ class Orders extends Model
|
|||||||
Orders::STTS_DROP,
|
Orders::STTS_DROP,
|
||||||
Orders::STTS_CLIENT_PAY,
|
Orders::STTS_CLIENT_PAY,
|
||||||
Orders::STTS_VENDOR_PAYED,
|
Orders::STTS_VENDOR_PAYED,
|
||||||
Orders::STTS_CLOSE,
|
Orders::STTS_CLOSE
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -168,7 +169,7 @@ class Orders extends Model
|
|||||||
Orders::STTS_GO,
|
Orders::STTS_GO,
|
||||||
Orders::STTS_PCK,
|
Orders::STTS_PCK,
|
||||||
Orders::STTS_ARV,
|
Orders::STTS_ARV,
|
||||||
Orders::STTS_DROP,
|
Orders::STTS_DROP
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (isset($filter["is_accident"])) {
|
if (isset($filter["is_accident"])) {
|
||||||
@ -239,7 +240,7 @@ class Orders extends Model
|
|||||||
$order_by .
|
$order_by .
|
||||||
"
|
"
|
||||||
;",
|
;",
|
||||||
$params,
|
$params
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -459,7 +460,7 @@ class Orders extends Model
|
|||||||
LIMIT " .
|
LIMIT " .
|
||||||
$filter["limit"] .
|
$filter["limit"] .
|
||||||
";",
|
";",
|
||||||
$params,
|
$params
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -491,7 +492,7 @@ class Orders extends Model
|
|||||||
FROM t_orders as ord
|
FROM t_orders as ord
|
||||||
INNER JOIN t_orders_clients as ord_c ON ord.id = ord_c.ord_id
|
INNER JOIN t_orders_clients as ord_c ON ord.id = ord_c.ord_id
|
||||||
WHERE ord.dlt is null AND ord.status IN (?) AND ord_c.c_id = ?;",
|
WHERE ord.dlt is null AND ord.status IN (?) AND ord_c.c_id = ?;",
|
||||||
[$stts, $client_id],
|
[$stts, $client_id]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -505,7 +506,7 @@ class Orders extends Model
|
|||||||
INNER JOIN t_orders_clients as ord_c ON ord.id = ord_c.ord_id
|
INNER JOIN t_orders_clients as ord_c ON ord.id = ord_c.ord_id
|
||||||
WHERE ord.dlt is null AND ord_c.c_id = ?
|
WHERE ord.dlt is null AND ord_c.c_id = ?
|
||||||
LIMIT ?;",
|
LIMIT ?;",
|
||||||
[$client_id, $limit],
|
[$client_id, $limit]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -609,7 +610,7 @@ class Orders extends Model
|
|||||||
$limit .
|
$limit .
|
||||||
"
|
"
|
||||||
",
|
",
|
||||||
$params,
|
$params
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -300,6 +300,7 @@ class Tracks extends Model
|
|||||||
$_query = DB::select($_query, [$_list->vid]);
|
$_query = DB::select($_query, [$_list->vid]);
|
||||||
$_list->lst_heartbeat = count($_query) == 0 ? "" : $_query[0]->lst_heartbeat;
|
$_list->lst_heartbeat = count($_query) == 0 ? "" : $_query[0]->lst_heartbeat;
|
||||||
}
|
}
|
||||||
|
// em
|
||||||
return $list;
|
return $list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -37,9 +37,9 @@ class Vehicles extends Model
|
|||||||
$select = "";
|
$select = "";
|
||||||
$where = "";
|
$where = "";
|
||||||
|
|
||||||
if ($auth->role == Users::ROLE_VENDOR) {
|
// if ($auth->role == Users::ROLE_VENDOR) {
|
||||||
$where .= " AND v.vendor_id = " . $auth->uid;
|
// $where .= " AND v.vendor_id = " . $auth->uid;
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (isset($filter["company"])) {
|
if (isset($filter["company"])) {
|
||||||
$where .= " AND client.id = ?";
|
$where .= " AND client.id = ?";
|
||||||
@ -106,10 +106,7 @@ class Vehicles extends Model
|
|||||||
|
|
||||||
public static function getVehicleById($vid)
|
public static function getVehicleById($vid)
|
||||||
{
|
{
|
||||||
return DB::select(
|
return DB::select("SELECT * FROM t_vehicles WHERE dlt is null AND id = ? LIMIT 1;", [$vid]);
|
||||||
"SELECT * FROM t_vehicles WHERE dlt is null AND id = ? LIMIT 1;",
|
|
||||||
[$vid]
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getVehicleByDeviceId($device_id)
|
public static function getVehicleByDeviceId($device_id)
|
||||||
@ -122,10 +119,7 @@ class Vehicles extends Model
|
|||||||
|
|
||||||
public static function getVehicleBySimcard($simcard)
|
public static function getVehicleBySimcard($simcard)
|
||||||
{
|
{
|
||||||
return DB::select(
|
return DB::select("SELECT * FROM t_vehicles WHERE dlt is null AND simcard = ? LIMIT 1;", [$simcard]);
|
||||||
"SELECT * FROM t_vehicles WHERE dlt is null AND simcard = ? LIMIT 1;",
|
|
||||||
[$simcard]
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getVehicleByPlatNo($nopol1, $nopol2, $nopol3)
|
public static function getVehicleByPlatNo($nopol1, $nopol2, $nopol3)
|
||||||
@ -177,9 +171,7 @@ class Vehicles extends Model
|
|||||||
$where_in = substr($where_in, 0, -1);
|
$where_in = substr($where_in, 0, -1);
|
||||||
}
|
}
|
||||||
return DB::select(
|
return DB::select(
|
||||||
"SELECT * FROM t_vehicles WHERE dlt is null AND id IN (" .
|
"SELECT * FROM t_vehicles WHERE dlt is null AND id IN (" . $where_in . ");",
|
||||||
$where_in .
|
|
||||||
");",
|
|
||||||
$params
|
$params
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -227,10 +219,8 @@ class Vehicles extends Model
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getVehiclesInVendorIdsActiveNoInOrder(
|
public static function getVehiclesInVendorIdsActiveNoInOrder($vendorIds, $prefer_truck_type = 0)
|
||||||
$vendorIds,
|
{
|
||||||
$prefer_truck_type = 0
|
|
||||||
) {
|
|
||||||
$params = [];
|
$params = [];
|
||||||
$where_in = "";
|
$where_in = "";
|
||||||
$where_where = "";
|
$where_where = "";
|
||||||
@ -305,30 +295,22 @@ class Vehicles extends Model
|
|||||||
// default 1: truck
|
// default 1: truck
|
||||||
public static function listCats()
|
public static function listCats()
|
||||||
{
|
{
|
||||||
return DB::select(
|
return DB::select("SELECT * FROM t_vehicles_cats WHERE dlt is null AND is_active = 1;");
|
||||||
"SELECT * FROM t_vehicles_cats WHERE dlt is null AND is_active = 1;"
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// default 1: unknown
|
// default 1: unknown
|
||||||
public static function listBrands()
|
public static function listBrands()
|
||||||
{
|
{
|
||||||
return DB::select(
|
return DB::select("SELECT * FROM t_vehicles_brands WHERE dlt is null AND is_active = 1;");
|
||||||
"SELECT * FROM t_vehicles_brands WHERE dlt is null AND is_active = 1;"
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function listTypes()
|
public static function listTypes()
|
||||||
{
|
{
|
||||||
return DB::select(
|
return DB::select("SELECT * FROM t_vehicles_types WHERE dlt is null AND is_active = 1;");
|
||||||
"SELECT * FROM t_vehicles_types WHERE dlt is null AND is_active = 1;"
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function listModels()
|
public static function listModels()
|
||||||
{
|
{
|
||||||
return DB::select(
|
return DB::select("SELECT * FROM t_vehicles_models WHERE dlt is null AND is_active = 1;");
|
||||||
"SELECT * FROM t_vehicles_models WHERE dlt is null AND is_active = 1;"
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -107,33 +107,70 @@ class Zone extends Model
|
|||||||
// ;");
|
// ;");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// public static function getActiveZones($client_group_id = 0, $type = 0, $workflow_type = 0)
|
||||||
|
// {
|
||||||
|
// $where_client_group_id = "";
|
||||||
|
// if ($client_group_id != 0) {
|
||||||
|
// $where_client_group_id = " AND z.client_group_id = " . $client_group_id;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// $where_type = "";
|
||||||
|
// if ($type != 0) {
|
||||||
|
// $where_type = " AND z.type = " . $type;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// $where_workflow_type = "";
|
||||||
|
// if ($workflow_type != 0) {
|
||||||
|
// $where_workflow_type = " AND z.workflow_type = " . $workflow_type;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// return DB::select(
|
||||||
|
// "SELECT
|
||||||
|
// z.*
|
||||||
|
// FROM t_zones as z WHERE z.dlt is null AND z.status = " .
|
||||||
|
// Zone::STATUS_ACTIVE .
|
||||||
|
// $where_client_group_id .
|
||||||
|
// $where_type .
|
||||||
|
// $where_workflow_type .
|
||||||
|
// " ;"
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
|
||||||
public static function getActiveZones($client_group_id = 0, $type = 0, $workflow_type = 0)
|
public static function getActiveZones($client_group_id = 0, $type = 0, $workflow_type = 0)
|
||||||
{
|
{
|
||||||
$where_client_group_id = "";
|
$where_client_group_id = "";
|
||||||
if ($client_group_id != 0) {
|
if ($client_group_id != 0) {
|
||||||
$where_client_group_id = " AND z.client_group_id = " . $client_group_id;
|
$where_client_group_id = " AND z.client_group_id = " . intval($client_group_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
$where_type = "";
|
$where_type = "";
|
||||||
if ($type != 0) {
|
if ($type != 0) {
|
||||||
$where_type = " AND z.type = " . $type;
|
if (is_array($type)) {
|
||||||
|
$type_list = implode(",", array_map("intval", $type));
|
||||||
|
$where_type = " AND z.type IN (" . $type_list . ")";
|
||||||
|
} else {
|
||||||
|
$where_type = " AND z.type = " . intval($type);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$where_workflow_type = "";
|
$where_workflow_type = "";
|
||||||
if ($workflow_type != 0) {
|
if ($workflow_type != 0) {
|
||||||
$where_workflow_type = " AND z.workflow_type = " . $workflow_type;
|
$where_workflow_type = " AND z.workflow_type = " . intval($workflow_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
return DB::select(
|
$sql =
|
||||||
"SELECT
|
"SELECT
|
||||||
z.*
|
z.*
|
||||||
FROM t_zones as z WHERE z.dlt is null AND z.status = " .
|
FROM t_zones as z
|
||||||
Zone::STATUS_ACTIVE .
|
WHERE z.dlt IS NULL
|
||||||
$where_client_group_id .
|
AND z.status = " .
|
||||||
$where_type .
|
Zone::STATUS_ACTIVE .
|
||||||
$where_workflow_type .
|
$where_client_group_id .
|
||||||
" ;"
|
$where_type .
|
||||||
);
|
$where_workflow_type .
|
||||||
|
";";
|
||||||
|
|
||||||
|
return DB::select($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function showZoneById($zid)
|
public static function showZoneById($zid)
|
||||||
|
|||||||
@ -391,7 +391,7 @@
|
|||||||
if (!AllowRouteSegment1.includes(AppState.route_segment1)) {
|
if (!AllowRouteSegment1.includes(AppState.route_segment1)) {
|
||||||
const AllowRouteSegment2 = ['pocket'];
|
const AllowRouteSegment2 = ['pocket'];
|
||||||
if (!AllowRouteSegment2.includes(AppState.route_segment2)) {
|
if (!AllowRouteSegment2.includes(AppState.route_segment2)) {
|
||||||
$('#subNav').addClass('d-none');
|
// $('#subNav').addClass('d-none');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,7 +12,7 @@
|
|||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<div class="row d-flex align-items-center">
|
<div class="row d-flex align-items-center">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<p class="card-title text-bold mb-0">Detail Pesanan</p>
|
<p class="card-title text-bold mb-0">Detail Job</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="col text-end">
|
<div class="col text-end">
|
||||||
<button class="btn btn-secondary btn-sm" onclick="location.href='{{ route('view_transactions') }}'">Kembali</button>
|
<button class="btn btn-secondary btn-sm" onclick="location.href='{{ route('view_transactions') }}'">Kembali</button>
|
||||||
@ -24,11 +24,11 @@
|
|||||||
<div class="row d-flex">
|
<div class="row d-flex">
|
||||||
<div class="col-5 mb-3">
|
<div class="col-5 mb-3">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-12 mb-3">
|
{{-- <div class="col-sm-12 mb-3">
|
||||||
<p class="text-danger text-bold mb-0">Penjemputan dan Pengantaran</p>
|
<p class="text-danger text-bold mb-0">Penjemputan dan Pengantaran</p>
|
||||||
</div>
|
</div> --}}
|
||||||
<div class="col-sm-12 mb-3">
|
<div class="col-sm-12 mb-3">
|
||||||
<label for="" class="form-label">Tanggal Penjemputan</label>
|
<label for="" class="form-label">Date</label>
|
||||||
<div class="card bg-light border mb-0">
|
<div class="card bg-light border mb-0">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<p class="mb-0"><span id="view-pickup_date_at"></span></p>
|
<p class="mb-0"><span id="view-pickup_date_at"></span></p>
|
||||||
@ -36,7 +36,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-12 mb-3">
|
<div class="col-sm-12 mb-3">
|
||||||
<label for="" class="form-label">Waktu Penjemputan</label>
|
<label for="" class="form-label">Time</label>
|
||||||
<div class="card bg-light border mb-0">
|
<div class="card bg-light border mb-0">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<p class="mb-0"><span id="view-pickup_time_at"></span></p>
|
<p class="mb-0"><span id="view-pickup_time_at"></span></p>
|
||||||
@ -48,10 +48,10 @@
|
|||||||
<div class="col-sm-2"></div>
|
<div class="col-sm-2"></div>
|
||||||
<div class="col-sm-5 mb-3">
|
<div class="col-sm-5 mb-3">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-12 col-12 mb-3">
|
{{-- <div class="col-sm-12 col-12 mb-3">
|
||||||
<p class="text-danger text-bold mb-0">Layanan Yang Dipilih</p>
|
<p class="text-danger text-bold mb-0">Layanan Yang Dipilih</p>
|
||||||
</div>
|
</div> --}}
|
||||||
<div class="col-sm-12 col-6 mb-3">
|
{{-- <div class="col-sm-12 col-6 mb-3">
|
||||||
<label for="" class="form-label">Durasi Pengantaran</label>
|
<label for="" class="form-label">Durasi Pengantaran</label>
|
||||||
<div class="card bg-light border mb-0 w-100">
|
<div class="card bg-light border mb-0 w-100">
|
||||||
<div class="card-body d-flex justify-content-between">
|
<div class="card-body d-flex justify-content-between">
|
||||||
@ -61,9 +61,9 @@
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> --}}
|
||||||
<div class="col-sm-12 col-6 mb-3">
|
<div class="col-sm-12 col-6 mb-3">
|
||||||
<label for="" class="form-label">Tipe Kendaraan</label>
|
<label for="" class="form-label">Vehicle</label>
|
||||||
<div class="card bg-light border mb-0 w-100">
|
<div class="card bg-light border mb-0 w-100">
|
||||||
<div class="card-body d-flex justify-content-between">
|
<div class="card-body d-flex justify-content-between">
|
||||||
<p class="mb-0">{{ $order->prefer_truck_type_name }}</p>
|
<p class="mb-0">{{ $order->prefer_truck_type_name }}</p>
|
||||||
@ -75,7 +75,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="row mb-3 d-flex align-items-center">
|
<div class="row mb-3 d-flex align-items-center">
|
||||||
<div class="col-5 mb-3">
|
<div class="col-5 mb-3">
|
||||||
<label for="" class="form-label">Lokasi Penjemputan</label>
|
<label for="" class="form-label">Origin</label>
|
||||||
<div class="card bg-light border mb-0">
|
<div class="card bg-light border mb-0">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
{{-- <p class="text-bold mb-2">Gudang Pluit SiCepat (Jakarta)</p> --}}
|
{{-- <p class="text-bold mb-2">Gudang Pluit SiCepat (Jakarta)</p> --}}
|
||||||
@ -91,7 +91,7 @@
|
|||||||
<span class="ion-arrow-right-c text-danger" style="font-size: 15px"></span>
|
<span class="ion-arrow-right-c text-danger" style="font-size: 15px"></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-5 mb-3">
|
<div class="col-5 mb-3">
|
||||||
<label for="" class="form-label">Lokasi Pengantaran</label>
|
<label for="" class="form-label">Destination</label>
|
||||||
<div class="card bg-light border mb-0">
|
<div class="card bg-light border mb-0">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
{{-- <p class="text-bold mb-2">Kantor Pusat SiCepat (yogyakarta)</p> --}}
|
{{-- <p class="text-bold mb-2">Kantor Pusat SiCepat (yogyakarta)</p> --}}
|
||||||
@ -105,36 +105,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-6">
|
{{-- <div class="col-sm-6">
|
||||||
@if ($order->confirm_at === 0)
|
|
||||||
<div class="card">
|
|
||||||
{{-- <div class="card-header">
|
|
||||||
<div class="row d-flex align-items-center">
|
|
||||||
<div class="col">
|
|
||||||
<p class="card-title text-bold mb-0">Order History</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div> --}}
|
|
||||||
<div class="card-body">
|
|
||||||
<div class="col-12 mb-3">
|
|
||||||
<p class="text-danger text-bold mb-0">Pencarian Vendor Otomatis</p>
|
|
||||||
</div>
|
|
||||||
<div id="mapsOrder" class="mb-3"></div>
|
|
||||||
<div class="col-12">
|
|
||||||
<div class="text-end">
|
|
||||||
{{-- <button class="btn btn-danger btn-sm"
|
|
||||||
onclick="location.href='{{ route('view_transactions') }}'">Submit</button> --}}
|
|
||||||
<button id="btnSearchDriver" class="btn btn-danger btn-sm">Cari Otomatis</button>
|
|
||||||
<div id="group_btnSearchDrvSpinner" class="d-none">
|
|
||||||
<div class="spinner-border" role="status">
|
|
||||||
<span class="visually-hidden">Loading...</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@endif
|
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="col-12 mb-3">
|
<div class="col-12 mb-3">
|
||||||
@ -150,8 +121,6 @@
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-end">
|
<div class="text-end">
|
||||||
{{-- <button class="btn btn-danger btn-sm"
|
|
||||||
onclick="location.href='{{ route('view_transactions') }}'">Pilih</button> --}}
|
|
||||||
<button id="btnChooseVendor" class="btn btn-danger btn-sm">Pilih</button>
|
<button id="btnChooseVendor" class="btn btn-danger btn-sm">Pilih</button>
|
||||||
<div id="group_btnChooseVdrSpinner" class="d-none">
|
<div id="group_btnChooseVdrSpinner" class="d-none">
|
||||||
<div class="spinner-border" role="status">
|
<div class="spinner-border" role="status">
|
||||||
@ -161,7 +130,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> --}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -178,8 +147,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* .leaflet-control-container .leaflet-left {
|
/* .leaflet-control-container .leaflet-left {
|
||||||
display: none;
|
display: none;
|
||||||
} */
|
} */
|
||||||
|
|
||||||
.leaflet-left .leaflet-draw-edit-remove {
|
.leaflet-left .leaflet-draw-edit-remove {
|
||||||
display: none;
|
display: none;
|
||||||
@ -268,10 +237,7 @@
|
|||||||
rectangle: "{{ App\Models\Zone::ZONE_BOUNDARY_RECTANGLE }}",
|
rectangle: "{{ App\Models\Zone::ZONE_BOUNDARY_RECTANGLE }}",
|
||||||
},
|
},
|
||||||
boundary_type_choose: "{{ App\Models\Zone::ZONE_BOUNDARY_CIRCLE }}",
|
boundary_type_choose: "{{ App\Models\Zone::ZONE_BOUNDARY_CIRCLE }}",
|
||||||
boundary_latlngs: [{
|
|
||||||
lat: "{{ $order->pck_center_lat }}",
|
|
||||||
lng: "{{ $order->pck_center_lng }}",
|
|
||||||
}], // [{lat,lng}].
|
|
||||||
boundary_radius: 2000, // in meters. only circle
|
boundary_radius: 2000, // in meters. only circle
|
||||||
boundary_bounds: null, // {northEast:{lat,lng},southWest:{lat,lng}}. only polygon,rectangle
|
boundary_bounds: null, // {northEast:{lat,lng},southWest:{lat,lng}}. only polygon,rectangle
|
||||||
default_boundary_hex: '#f26e6f',
|
default_boundary_hex: '#f26e6f',
|
||||||
|
|||||||
@ -76,16 +76,13 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-2 text-center d-flex align-items-center justify-content-center">
|
<div class="col-2 text-center d-flex align-items-center justify-content-center">
|
||||||
<label for="" class="form-label mb-0 mt-0"> </label>
|
<label for="" class="form-label mb-0 mt-0"> </label>
|
||||||
{{-- <p class="mb-0">to</p> --}}
|
|
||||||
<span class="ion-arrow-right-c text-danger" style="font-size: 15px"></span>
|
<span class="ion-arrow-right-c text-danger" style="font-size: 15px"></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-5">
|
<div class="col-5">
|
||||||
<label for="" class="form-label">Lokasi Pengantaran</label>
|
<label for="" class="form-label">Lokasi Pengantaran</label>
|
||||||
<div class="card bg-light border mb-0">
|
<div class="card bg-light border mb-0">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
{{-- <p class="text-bold mb-2">Kantor Pusat SiCepat (yogyakarta)</p> --}}
|
|
||||||
<p class="text-bold mb-2">{{ $_order['drop_name'] }}</p>
|
<p class="text-bold mb-2">{{ $_order['drop_name'] }}</p>
|
||||||
{{-- <p class="mb-0">Jl. Prof. Herman Yohanes No.989, Terban, Gondokusuman, Kota Yogyakarta, Daerah Istimewa Yogyakarta 55223, Indonesia</p> --}}
|
|
||||||
<p class="mb-0">{{ $_order['drop_addr'] }}</p>
|
<p class="mb-0">{{ $_order['drop_addr'] }}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -11,8 +11,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* .select2-container {
|
/* .select2-container {
|
||||||
z-index: 99999;
|
z-index: 99999;
|
||||||
} */
|
} */
|
||||||
</style>
|
</style>
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@ -29,7 +29,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col text-end">
|
<div class="col text-end">
|
||||||
{{-- <a href="#" class="btn btn-sm btn-danger" data-bs-toggle="modal" data-bs-target="#addNewClientModal">Add New Client</a> --}}
|
{{-- <a href="#" class="btn btn-sm btn-danger" data-bs-toggle="modal" data-bs-target="#addNewClientModal">Add New Client</a> --}}
|
||||||
<a href="#" class="btn btn-sm btn-danger" id="btnAddNewClientModal">Tambah Client</a>
|
{{-- <a href="#" class="btn btn-sm btn-danger" id="btnAddNewClientModal">Tambah Client</a> --}}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-auto text-end ps-0">
|
<div class="col-auto text-end ps-0">
|
||||||
{{-- <button class="btn btn-sm btn-danger">Upload</button> --}}
|
{{-- <button class="btn btn-sm btn-danger">Upload</button> --}}
|
||||||
|
|||||||
@ -22,8 +22,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* .cLogoGroup {
|
/* .cLogoGroup {
|
||||||
display: inherit;
|
display: inherit;
|
||||||
} */
|
} */
|
||||||
#openLeftSideBar1Mobile {
|
#openLeftSideBar1Mobile {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
@ -35,11 +35,11 @@
|
|||||||
@media (max-width: 425px) {
|
@media (max-width: 425px) {
|
||||||
|
|
||||||
/* .cLogoGroup {
|
/* .cLogoGroup {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
.cNameGroup {
|
.cNameGroup {
|
||||||
margin-bottom: 0!important;
|
margin-bottom: 0!important;
|
||||||
} */
|
} */
|
||||||
#openLeftSideBar1 {
|
#openLeftSideBar1 {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
@ -234,10 +234,10 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="form-group mb-3 w-100">
|
<div class="form-group mb-3 w-100">
|
||||||
<select name="" class="form-control select2" style="width: 100%;" id="selectFiter">
|
<select name="" class="form-control select2" style="width: 100%;" id="selectFiter">
|
||||||
<option value="3">Pekerjaan</option>
|
<option value="1">Vehicle</option>
|
||||||
<option value="1">Kendaraan</option>
|
<option value="2">Driver</option>
|
||||||
<option value="2">Pengemudi</option>
|
<option value="3">Job</option>
|
||||||
<option value="4">Riwayat Perjalanan</option>
|
<option value="4">Travel History</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<ul class="list-group" id="infoVehicles">
|
<ul class="list-group" id="infoVehicles">
|
||||||
@ -249,7 +249,7 @@
|
|||||||
<p id="infoVehicles-crt" class="text-muted mb-0">20-Jan-2022 23:16:18</p>
|
<p id="infoVehicles-crt" class="text-muted mb-0">20-Jan-2022 23:16:18</p>
|
||||||
</li>
|
</li>
|
||||||
<li class="list-group-item p-1 px-2">
|
<li class="list-group-item p-1 px-2">
|
||||||
<p class="text-bold mb-0">Lokasi saat ini</p>
|
<p class="text-bold mb-0">Current Location</p>
|
||||||
<p id="infoVehicles-addr" class="text-muted mb-0">Kebon Baru - Tebet</p>
|
<p id="infoVehicles-addr" class="text-muted mb-0">Kebon Baru - Tebet</p>
|
||||||
</li>
|
</li>
|
||||||
<li class="list-group-item p-1 px-2">
|
<li class="list-group-item p-1 px-2">
|
||||||
@ -257,7 +257,7 @@
|
|||||||
<p id="infoVehicles-lat_lng" class="text-muted mb-0">-6.27013, 106.731371</p>
|
<p id="infoVehicles-lat_lng" class="text-muted mb-0">-6.27013, 106.731371</p>
|
||||||
</li>
|
</li>
|
||||||
<li class="list-group-item p-1 px-2">
|
<li class="list-group-item p-1 px-2">
|
||||||
<p class="text-bold mb-0">Jarak tempuh kendaraan (km)</p>
|
<p class="text-bold mb-0">Vehicle Mileage (km)</p>
|
||||||
<p id="infoVehicles-mileage" class="text-muted mb-0">45080.83</p>
|
<p id="infoVehicles-mileage" class="text-muted mb-0">45080.83</p>
|
||||||
</li>
|
</li>
|
||||||
{{-- <li class="list-group-item p-1 px-2">
|
{{-- <li class="list-group-item p-1 px-2">
|
||||||
@ -273,7 +273,7 @@
|
|||||||
<p id="infoVehicles-ignition" class="text-muted mb-0">ON</p>
|
<p id="infoVehicles-ignition" class="text-muted mb-0">ON</p>
|
||||||
</li> --}}
|
</li> --}}
|
||||||
<li class="list-group-item p-1 px-2">
|
<li class="list-group-item p-1 px-2">
|
||||||
<p class="text-bold mb-0">Status Mesin</p>
|
<p class="text-bold mb-0">Engine Status</p>
|
||||||
<p id="infoVehicles-engineStatus" class="text-muted mb-0">Idling</p>
|
<p id="infoVehicles-engineStatus" class="text-muted mb-0">Idling</p>
|
||||||
</li>
|
</li>
|
||||||
{{-- <li class="list-group-item p-1 px-2">
|
{{-- <li class="list-group-item p-1 px-2">
|
||||||
@ -305,15 +305,15 @@
|
|||||||
</ul>
|
</ul>
|
||||||
<ul class="list-group" id="infoDriver">
|
<ul class="list-group" id="infoDriver">
|
||||||
<li class="list-group-item p-1 px-2">
|
<li class="list-group-item p-1 px-2">
|
||||||
<p class="text-bold mb-0">Informasi Pengemudi</p>
|
<p class="text-bold mb-0">Driver Information</p>
|
||||||
<p id="infoDrv-updt" class="text-muted mb-0">20-Jan-2022 23:16:18</p>
|
<p id="infoDrv-updt" class="text-muted mb-0">20-Jan-2022 23:16:18</p>
|
||||||
</li>
|
</li>
|
||||||
<li class="list-group-item p-1 px-2">
|
<li class="list-group-item p-1 px-2">
|
||||||
<p class="text-bold mb-0">Nama Pengemudi</p>
|
<p class="text-bold mb-0">Driver Name</p>
|
||||||
<p id="infoDrv-name" class="text-muted mb-0">Rafif</p>
|
<p id="infoDrv-name" class="text-muted mb-0">Emrsyf</p>
|
||||||
</li>
|
</li>
|
||||||
<li class="list-group-item p-1 px-2">
|
<li class="list-group-item p-1 px-2">
|
||||||
<p class="text-bold mb-0">Phone 1</p>
|
<p class="text-bold mb-0">Phone</p>
|
||||||
<p class="mb-0">
|
<p class="mb-0">
|
||||||
<a href="tel:0" id="infoDrv-phone1-tel">
|
<a href="tel:0" id="infoDrv-phone1-tel">
|
||||||
<i class="text-dark ion-ios-telephone"></i>
|
<i class="text-dark ion-ios-telephone"></i>
|
||||||
@ -326,7 +326,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
</li>
|
</li>
|
||||||
<li class="list-group-item p-1 px-2">
|
{{-- <li class="list-group-item p-1 px-2">
|
||||||
<p class="text-bold mb-0">Phone 2</p>
|
<p class="text-bold mb-0">Phone 2</p>
|
||||||
<p class="mb-0">
|
<p class="mb-0">
|
||||||
<a href="tel:0" id="infoDrv-phone2-tel">
|
<a href="tel:0" id="infoDrv-phone2-tel">
|
||||||
@ -339,7 +339,7 @@
|
|||||||
<span class="infoDrv-phone2-text"></span>
|
<span class="infoDrv-phone2-text"></span>
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
</li>
|
</li> --}}
|
||||||
</ul>
|
</ul>
|
||||||
<div id="infoJob">
|
<div id="infoJob">
|
||||||
{{-- @for ($i = 0; $i < 20; $i++)
|
{{-- @for ($i = 0; $i < 20; $i++)
|
||||||
@ -356,9 +356,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
@endfor --}}
|
@endfor --}}
|
||||||
<ul class="list-group mb-3">
|
{{-- <ul class="list-group mb-3">
|
||||||
<li class="list-group-item p-1 px-2">
|
<li class="list-group-item p-1 px-2">
|
||||||
{{-- <p class="text-bold mb-0">#902192102910</p> --}}
|
|
||||||
<div class="row d-flex align-items-center justify-content-between">
|
<div class="row d-flex align-items-center justify-content-between">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<small class="text-muted">Client</small>
|
<small class="text-muted">Client</small>
|
||||||
@ -366,13 +365,13 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul> --}}
|
||||||
<ul class="list-group mb-3">
|
<ul class="list-group mb-3">
|
||||||
<li class="list-group-item p-1 px-2">
|
<li class="list-group-item p-1 px-2">
|
||||||
{{-- <p class="text-bold mb-0">#902192102910</p> --}}
|
{{-- <p class="text-bold mb-0">#902192102910</p> --}}
|
||||||
<div class="row d-flex align-items-center justify-content-between">
|
<div class="row d-flex align-items-center justify-content-between">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<small class="text-muted">Dari</small>
|
<small class="text-muted">Origin</small>
|
||||||
<p id="infoJob-pck_city" class="">Jakarta</p>
|
<p id="infoJob-pck_city" class="">Jakarta</p>
|
||||||
<p id="infoJob-pck_name" class="mb-0">JKT-01</p>
|
<p id="infoJob-pck_name" class="mb-0">JKT-01</p>
|
||||||
<p id="infoJob-pck_addr" class="mb-0">Jl. Pancoran Timur Raya No.9, RT.8/RW.9, Pancoran, Kec. Pancoran, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12780</p>
|
<p id="infoJob-pck_addr" class="mb-0">Jl. Pancoran Timur Raya No.9, RT.8/RW.9, Pancoran, Kec. Pancoran, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12780</p>
|
||||||
@ -383,7 +382,7 @@
|
|||||||
{{-- <p class="text-bold mb-0">#902192102910</p> --}}
|
{{-- <p class="text-bold mb-0">#902192102910</p> --}}
|
||||||
<div class="row d-flex align-items-center justify-content-between">
|
<div class="row d-flex align-items-center justify-content-between">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<small class="text-muted">Tujuan</small>
|
<small class="text-muted">Destination</small>
|
||||||
<p id="infoJob-drop_city" class="">Indramayu</p>
|
<p id="infoJob-drop_city" class="">Indramayu</p>
|
||||||
<p id="infoJob-drop_name" class="mb-0">IND-01</p>
|
<p id="infoJob-drop_name" class="mb-0">IND-01</p>
|
||||||
<p id="infoJob-drop_addr" class="mb-0">Jl. Jend. Sudirman, Karanganyar, Kec. Indramayu, Kabupaten Indramayu, Jawa Barat</p>
|
<p id="infoJob-drop_addr" class="mb-0">Jl. Jend. Sudirman, Karanganyar, Kec. Indramayu, Kabupaten Indramayu, Jawa Barat</p>
|
||||||
@ -404,17 +403,17 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<ul class="list-group" id="infoMovement">
|
<ul class="list-group" id="infoMovement">
|
||||||
<li class="list-group-item p-1 px-2">
|
<li class="list-group-item p-1 px-2 mb-2" style="border-radius: 0.25rem;">
|
||||||
<p class="text-bold mb-0">Riwayat Perjalanan</p>
|
<p class="text-bold mb-0">Trip History</p>
|
||||||
<p id="infoVehicles-infoMove" class="text-muted mb-0">Terbaru</p>
|
<p id="infoVehicles-infoMove" class="text-muted mb-0">Most Recent</p>
|
||||||
</li>
|
</li>
|
||||||
<div>
|
<div>
|
||||||
<div>
|
<div class="mb-2">
|
||||||
<label class="text-muted">Dari</label>
|
<label class="text-muted">From</label>
|
||||||
<input class="form-control" type="date" id="historyStartDate">
|
<input class="form-control" type="date" id="historyStartDate">
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div class="mb-3">
|
||||||
<label class="text-muted">Sampai</label>
|
<label class="text-muted">To</label>
|
||||||
<input class="form-control" type="date" id="historyEndDate">
|
<input class="form-control" type="date" id="historyEndDate">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -1225,7 +1224,7 @@
|
|||||||
Menu.showViewDetailVehicle($(this).val());
|
Menu.showViewDetailVehicle($(this).val());
|
||||||
});
|
});
|
||||||
|
|
||||||
Menu.showViewDetailVehicle(State.stts_filterDetail.assignJob);
|
Menu.showViewDetailVehicle(State.stts_filterDetail.vehicles);
|
||||||
|
|
||||||
Menu.eventListVehicle();
|
Menu.eventListVehicle();
|
||||||
Menu.eventListMovement();
|
Menu.eventListMovement();
|
||||||
@ -1280,8 +1279,8 @@
|
|||||||
}, State.delay_hideTruckNotSelected);
|
}, State.delay_hideTruckNotSelected);
|
||||||
});
|
});
|
||||||
Leaflet.clearLayer('eventRemoveDetailPlotMovement');
|
Leaflet.clearLayer('eventRemoveDetailPlotMovement');
|
||||||
$('#selectFiter').val(State.stts_filterDetail.assignJob).trigger('change');
|
$('#selectFiter').val(State.stts_filterDetail.vehicles).trigger('change');
|
||||||
$('#selectFiter').val(State.stts_filterDetail.assignJob).trigger('select2:select');
|
$('#selectFiter').val(State.stts_filterDetail.vehicles).trigger('select2:select');
|
||||||
$('#rightSideBar2').removeClass('d-none');
|
$('#rightSideBar2').removeClass('d-none');
|
||||||
if (Trucks.lists[i]?.lst_lat == null || Trucks.lists[i]?.lst_lng == null) {
|
if (Trucks.lists[i]?.lst_lat == null || Trucks.lists[i]?.lst_lng == null) {
|
||||||
Helper.toast('Warning', 'just now',
|
Helper.toast('Warning', 'just now',
|
||||||
@ -2424,7 +2423,7 @@
|
|||||||
|
|
||||||
// driver
|
// driver
|
||||||
$('#infoDrv-updt').text((truck?.ord_crt) ? moment.unix(truck?.ord_crt).format('DD MMM YYYY HH:mm') : '-');
|
$('#infoDrv-updt').text((truck?.ord_crt) ? moment.unix(truck?.ord_crt).format('DD MMM YYYY HH:mm') : '-');
|
||||||
$('#infoDrv-name').text(truck?.ord_drv_name ?? 'Tidak dalam order');
|
$('#infoDrv-name').text(truck?.ord_drv_name ?? 'Off Duty');
|
||||||
$('.infoDrv-phone1-text').text((truck?.ord_drv_phone_val) ? Helper.splitEvery4Char('0' + truck?.ord_drv_phone_val) : '-');
|
$('.infoDrv-phone1-text').text((truck?.ord_drv_phone_val) ? Helper.splitEvery4Char('0' + truck?.ord_drv_phone_val) : '-');
|
||||||
$('#infoDrv-phone1-tel').attr('tel:0' + (truck?.ord_drv_phone_val ?? ''));
|
$('#infoDrv-phone1-tel').attr('tel:0' + (truck?.ord_drv_phone_val ?? ''));
|
||||||
$('#infoDrv-phone1-wa').attr('https://api.whatsapp.com/send/?phone=62' + (truck?.ord_drv_phone_val ?? '') + '&text=Halo&app_absent=0');
|
$('#infoDrv-phone1-wa').attr('https://api.whatsapp.com/send/?phone=62' + (truck?.ord_drv_phone_val ?? '') + '&text=Halo&app_absent=0');
|
||||||
|
|||||||
@ -11,8 +11,8 @@
|
|||||||
@section('customcss')
|
@section('customcss')
|
||||||
<style>
|
<style>
|
||||||
/* .select2-container {
|
/* .select2-container {
|
||||||
z-index: 99999;
|
z-index: 99999;
|
||||||
} */
|
} */
|
||||||
</style>
|
</style>
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@ -25,7 +25,8 @@
|
|||||||
<div class="col-3">
|
<div class="col-3">
|
||||||
<p class="card-title text-bold mb-0">List Driver</p>
|
<p class="card-title text-bold mb-0">List Driver</p>
|
||||||
</div>
|
</div>
|
||||||
@if ($user_role === \App\Models\Users::ROLE_VENDOR)
|
{{-- @if ($user_role === \App\Models\Users::ROLE_VENDOR) --}}
|
||||||
|
@if ($user_role === \App\Models\Users::ROLE_ADMIN)
|
||||||
<div class="col text-end">
|
<div class="col text-end">
|
||||||
<button id="btnMdlNewDrv" class="btn btn-sm btn-danger">Add New Driver</button>
|
<button id="btnMdlNewDrv" class="btn btn-sm btn-danger">Add New Driver</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -19,18 +19,18 @@
|
|||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<div class="row d-flex align-items-center">
|
<div class="row d-flex align-items-center">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<p class="card-title text-bold mb-0">Transaksi</p>
|
<p class="card-title text-bold mb-0">Transaction</p>
|
||||||
<p class="card-subtitle text-muted">Daftar Transaksi</p>
|
<p class="card-subtitle text-muted">Transaction List</p>
|
||||||
</div>
|
</div>
|
||||||
{{-- <div class="col-auto text-end ps-0">
|
{{-- <div class="col-auto text-end ps-0">
|
||||||
<a href="#" id="btnMdlMrgTrx" class="btn btn-sm btn-danger">Merge Transaksi</a>
|
<a href="#" id="btnMdlMrgTrx" class="btn btn-sm btn-danger">Merge Transaksi</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-auto text-end ps-0">
|
<div class="col-auto text-end ps-0">
|
||||||
<a href="{{ route('view_transactions_spc_add') }}" class="btn btn-sm btn-warning">Transaksi Khusus</a>
|
<a href="{{ route('view_transactions_spc_add') }}" class="btn btn-sm btn-warning">Transaksi Khusus</a>
|
||||||
</div>
|
|
||||||
<div class="col-auto text-end ps-0">
|
|
||||||
<a href="{{ route('view_transactions_add') }}" class="btn btn-sm btn-danger">Tambah Transaksi</a>
|
|
||||||
</div> --}}
|
</div> --}}
|
||||||
|
<div class="col-auto text-end ps-0">
|
||||||
|
<a href="{{ route('view_transactions_add') }}" class="btn btn-sm btn-danger">Add New Job</a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
@ -39,20 +39,20 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr class="">
|
<tr class="">
|
||||||
<th class="">#</th>
|
<th class="">#</th>
|
||||||
<th class="text-nowrap text-center">Tindakan</th>
|
<th class="text-nowrap text-center">Action</th>
|
||||||
<th class="text-nowrap">Kode Order</th>
|
<th class="text-nowrap">Order Code</th>
|
||||||
<th class="text-nowrap">Nama Client</th>
|
<th class="text-nowrap">Company</th>
|
||||||
<th class="text-nowrap">Waktu Pemesanan</th>
|
<th class="text-nowrap">Order Time</th>
|
||||||
<th class="text-nowrap">Vendor</th>
|
{{-- <th class="text-nowrap">Vendor</th> --}}
|
||||||
<th class="text-nowrap">Kendaraan</th>
|
<th class="text-nowrap">Vehicle</th>
|
||||||
<th class="text-nowrap">Pengemudi</th>
|
<th class="text-nowrap">Driver</th>
|
||||||
<th class="text-nowrap">Lokasi Penjemputan</th>
|
<th class="text-nowrap">Origin</th>
|
||||||
<th class="text-nowrap">Lokasi Pengantaran</th>
|
<th class="text-nowrap">Destination</th>
|
||||||
<th class="text-nowrap text-center">Status</th>
|
<th class="text-nowrap text-center">Status</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr class="">
|
{{-- <tr class="">
|
||||||
<td class="text-nowrap">1</td>
|
<td class="text-nowrap">1</td>
|
||||||
<td class="text-nowrap">SiCepat</td>
|
<td class="text-nowrap">SiCepat</td>
|
||||||
<td class="text-nowrap">Feb 20, 2022 17:29:50</td>
|
<td class="text-nowrap">Feb 20, 2022 17:29:50</td>
|
||||||
@ -75,7 +75,7 @@
|
|||||||
<span class="icon ion-eye text-danger fz-16"></span>
|
<span class="icon ion-eye text-danger fz-16"></span>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr> --}}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
@ -434,29 +434,71 @@
|
|||||||
orderable: true,
|
orderable: true,
|
||||||
searchable: true,
|
searchable: true,
|
||||||
render: function(data, type, row, meta) {
|
render: function(data, type, row, meta) {
|
||||||
|
console.log("rows: ", row)
|
||||||
let action = ``;
|
let action = ``;
|
||||||
// if (row.confirm_at === 0) {
|
// if (row.confirm_at === 0) {
|
||||||
if (!row.vdr_name) {
|
// if (!row.vdr_name) {
|
||||||
action += `<a href="${State.url_conf_order}?code=${row.ord_code}"
|
// action += `<a href="${State.url_conf_order}?code=${row.ord_code}"
|
||||||
class="text-decoration-none me-1" data-bs-toggle="tooltip"
|
// class="text-decoration-none me-1" data-bs-toggle="tooltip"
|
||||||
data-bs-placement="bottom" title="Tindak Lanjuti">
|
// data-bs-placement="bottom" title="Tindak Lanjuti">
|
||||||
<span class="icon ion-forward text-danger fz-16"></span>
|
// <span class="icon ion-forward text-danger fz-16"></span>
|
||||||
</a>`;
|
// </a>`;
|
||||||
} else {
|
// } else {
|
||||||
let ord_codes = row.ord_code;
|
// let ord_codes = row.ord_code;
|
||||||
if (typeof row.childs != 'undefined' && row.childs.length > 0) {
|
// if (typeof row.childs != 'undefined' && row.childs.length > 0) {
|
||||||
for (const child of row.childs) {
|
// for (const child of row.childs) {
|
||||||
ord_codes += ',' + child.ord_code;
|
// ord_codes += ',' + child.ord_code;
|
||||||
}
|
// }
|
||||||
|
// }
|
||||||
|
// action += `
|
||||||
|
// <a href="${State.url_view_order}?code=${ord_codes}"
|
||||||
|
// class="text-decoration-none me-1" data-bs-toggle="tooltip"
|
||||||
|
// data-bs-placement="bottom" title="Lihat">
|
||||||
|
// <span class="icon ion-eye text-danger fz-16"></span>
|
||||||
|
// </a>
|
||||||
|
// `;
|
||||||
|
// action += `
|
||||||
|
// <a href="#"
|
||||||
|
// class="text-decoration-none me-1 btnTrackOrder" data-bs-toggle="tooltip"
|
||||||
|
// data-bs-placement="bottom" title="Tracking #${row.ord_code}"
|
||||||
|
// data-id="${row.ord_id}" data-code="${row.ord_code}">
|
||||||
|
// <span class="icon ion-map text-danger fz-16"></span>
|
||||||
|
// </a>
|
||||||
|
// `;
|
||||||
|
// // data-bs-toggle="modal" data-bs-target="#mdlPantau"
|
||||||
|
// for (const child of row.childs) {
|
||||||
|
// action += `
|
||||||
|
// <a href="#"
|
||||||
|
// class="text-decoration-none me-1 btnTrackOrder" data-bs-toggle="tooltip"
|
||||||
|
// data-bs-placement="bottom" title="Tracking #${child.ord_code}"
|
||||||
|
// data-id="${child.ord_id}" data-code="${child.ord_code}">
|
||||||
|
// <span class="icon ion-map text-danger fz-16"></span>
|
||||||
|
// </a>
|
||||||
|
// `;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// action += `
|
||||||
|
// <a href="#"
|
||||||
|
// class="text-decoration-none me-1 btnDelOrder" data-bs-toggle="tooltip"
|
||||||
|
// data-bs-placement="bottom" title="Delete Order"
|
||||||
|
// data-id="${row.ord_id}" data-code="${row.ord_code}">
|
||||||
|
// <span class="icon ion-ios-trash text-danger fz-16"></span>
|
||||||
|
// </a>
|
||||||
|
// `;
|
||||||
|
let ord_codes = row.ord_code;
|
||||||
|
if (typeof row.childs != 'undefined' && row.childs.length > 0) {
|
||||||
|
for (const child of row.childs) {
|
||||||
|
ord_codes += ',' + child.ord_code;
|
||||||
}
|
}
|
||||||
action += `
|
}
|
||||||
|
action += `
|
||||||
<a href="${State.url_view_order}?code=${ord_codes}"
|
<a href="${State.url_view_order}?code=${ord_codes}"
|
||||||
class="text-decoration-none me-1" data-bs-toggle="tooltip"
|
class="text-decoration-none me-1" data-bs-toggle="tooltip"
|
||||||
data-bs-placement="bottom" title="Lihat">
|
data-bs-placement="bottom" title="Lihat">
|
||||||
<span class="icon ion-eye text-danger fz-16"></span>
|
<span class="icon ion-eye text-danger fz-16"></span>
|
||||||
</a>
|
</a>
|
||||||
`;
|
`;
|
||||||
action += `
|
action += `
|
||||||
<a href="#"
|
<a href="#"
|
||||||
class="text-decoration-none me-1 btnTrackOrder" data-bs-toggle="tooltip"
|
class="text-decoration-none me-1 btnTrackOrder" data-bs-toggle="tooltip"
|
||||||
data-bs-placement="bottom" title="Tracking #${row.ord_code}"
|
data-bs-placement="bottom" title="Tracking #${row.ord_code}"
|
||||||
@ -464,9 +506,9 @@
|
|||||||
<span class="icon ion-map text-danger fz-16"></span>
|
<span class="icon ion-map text-danger fz-16"></span>
|
||||||
</a>
|
</a>
|
||||||
`;
|
`;
|
||||||
// data-bs-toggle="modal" data-bs-target="#mdlPantau"
|
// data-bs-toggle="modal" data-bs-target="#mdlPantau"
|
||||||
for (const child of row.childs) {
|
for (const child of row.childs) {
|
||||||
action += `
|
action += `
|
||||||
<a href="#"
|
<a href="#"
|
||||||
class="text-decoration-none me-1 btnTrackOrder" data-bs-toggle="tooltip"
|
class="text-decoration-none me-1 btnTrackOrder" data-bs-toggle="tooltip"
|
||||||
data-bs-placement="bottom" title="Tracking #${child.ord_code}"
|
data-bs-placement="bottom" title="Tracking #${child.ord_code}"
|
||||||
@ -474,7 +516,6 @@
|
|||||||
<span class="icon ion-map text-danger fz-16"></span>
|
<span class="icon ion-map text-danger fz-16"></span>
|
||||||
</a>
|
</a>
|
||||||
`;
|
`;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
action += `
|
action += `
|
||||||
<a href="#"
|
<a href="#"
|
||||||
@ -506,7 +547,7 @@
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
data: 'c_name',
|
data: 'c_pt_name',
|
||||||
className: 'text-start',
|
className: 'text-start',
|
||||||
visible: true,
|
visible: true,
|
||||||
orderable: true,
|
orderable: true,
|
||||||
@ -520,8 +561,9 @@
|
|||||||
// },
|
// },
|
||||||
render: function(data, type, row, meta) {
|
render: function(data, type, row, meta) {
|
||||||
let txt = data;
|
let txt = data;
|
||||||
|
console.log("row:", row);
|
||||||
for (const child of row.childs) {
|
for (const child of row.childs) {
|
||||||
txt += '<br>' + child.c_name;
|
txt += '<br>' + child.c_pt_name;
|
||||||
}
|
}
|
||||||
return txt;
|
return txt;
|
||||||
},
|
},
|
||||||
@ -540,29 +582,29 @@
|
|||||||
return txt;
|
return txt;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
data: 'vdr_name',
|
// data: 'vdr_name',
|
||||||
className: 'text-start',
|
// className: 'text-start',
|
||||||
visible: true,
|
// visible: true,
|
||||||
orderable: true,
|
// orderable: true,
|
||||||
searchable: true,
|
// searchable: true,
|
||||||
render: function(data, type, row, meta) {
|
// render: function(data, type, row, meta) {
|
||||||
let txt = '';
|
// let txt = '';
|
||||||
if (data) {
|
// if (data) {
|
||||||
txt += data;
|
// txt += data;
|
||||||
} else {
|
// } else {
|
||||||
txt += `<span class="text-danger">belum ditugaskan</span>`;
|
// txt += `<span class="text-danger">belum ditugaskan</span>`;
|
||||||
}
|
// }
|
||||||
for (const child of row.childs) {
|
// for (const child of row.childs) {
|
||||||
if (child.vdr_name) {
|
// if (child.vdr_name) {
|
||||||
txt += '<br>' + child.vdr_name;
|
// txt += '<br>' + child.vdr_name;
|
||||||
} else {
|
// } else {
|
||||||
txt += `<br><span class="text-danger">belum ditugaskan</span>`;
|
// txt += `<br><span class="text-danger">belum ditugaskan</span>`;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
return txt;
|
// return txt;
|
||||||
},
|
// },
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
data: 'vhc_nopol1',
|
data: 'vhc_nopol1',
|
||||||
className: 'text-start',
|
className: 'text-start',
|
||||||
|
|||||||
@ -7,8 +7,8 @@
|
|||||||
@section('customcss')
|
@section('customcss')
|
||||||
<style>
|
<style>
|
||||||
/* .select2-container {
|
/* .select2-container {
|
||||||
z-index: 99999;
|
z-index: 99999;
|
||||||
} */
|
} */
|
||||||
</style>
|
</style>
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@ -52,7 +52,7 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<tr class="">
|
<tr class="">
|
||||||
<td class="">1</td>
|
<td class="">1</td>
|
||||||
<td class="">Rafif</td>
|
<td class="">Emrsyf</td>
|
||||||
<td class="">Jl. Letjen Mt. Haryono No.Kav. 20, RW.1, Cawang, Kec.
|
<td class="">Jl. Letjen Mt. Haryono No.Kav. 20, RW.1, Cawang, Kec.
|
||||||
Kramat jati, Kota Jakarta Timur, Daerah Khusus Ibukota Jakarta 13630</td>
|
Kramat jati, Kota Jakarta Timur, Daerah Khusus Ibukota Jakarta 13630</td>
|
||||||
<td class="text-nowrap">021 83782235</td>
|
<td class="text-nowrap">021 83782235</td>
|
||||||
|
|||||||
@ -11,18 +11,18 @@
|
|||||||
@section('customcss')
|
@section('customcss')
|
||||||
<style>
|
<style>
|
||||||
/* .select2-container {
|
/* .select2-container {
|
||||||
z-index: 99999;
|
z-index: 99999;
|
||||||
} */
|
} */
|
||||||
|
|
||||||
/* .landscape-photo {
|
/* .landscape-photo {
|
||||||
max-height: max(21vh, 210px);
|
max-height: max(21vh, 210px);
|
||||||
} */
|
} */
|
||||||
|
|
||||||
/* .thumb-img-table {
|
/* .thumb-img-table {
|
||||||
width: max(4vw, 75px);
|
width: max(4vw, 75px);
|
||||||
height: max(4vh, 55px);
|
height: max(4vh, 55px);
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
} */
|
} */
|
||||||
</style>
|
</style>
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@ -321,7 +321,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{-- Other Data --}}
|
{{-- Other Data --}}
|
||||||
@if ($user_role != \App\Models\Users::ROLE_VENDOR)
|
{{-- @if ($user_role != \App\Models\Users::ROLE_VENDOR)
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<div class="border-bottom">
|
<div class="border-bottom">
|
||||||
<h6>Other Data</h6>
|
<h6>Other Data</h6>
|
||||||
@ -340,7 +340,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif --}}
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
@ -578,7 +578,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{-- Other Data --}}
|
{{-- Other Data --}}
|
||||||
@if ($user_role != \App\Models\Users::ROLE_VENDOR)
|
{{-- @if ($user_role != \App\Models\Users::ROLE_VENDOR)
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<div class="border-bottom">
|
<div class="border-bottom">
|
||||||
<h6>Other Data</h6>
|
<h6>Other Data</h6>
|
||||||
@ -597,7 +597,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif --}}
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
|
|||||||
@ -29,8 +29,8 @@
|
|||||||
<div class="col">
|
<div class="col">
|
||||||
<p class="card-title text-bold mb-0">Zona (<span id="count_zones"></span>)</p>
|
<p class="card-title text-bold mb-0">Zona (<span id="count_zones"></span>)</p>
|
||||||
</div>
|
</div>
|
||||||
{{-- @if ($user_role === \App\Models\Users::ROLE_ADMIN || \App\Models\Users::ROLE_VENDOR) --}}
|
@if ($user_role === \App\Models\Users::ROLE_ADMIN || \App\Models\Users::ROLE_VENDOR)
|
||||||
@if ($user_role === \App\Models\Users::ROLE_VENDOR)
|
{{-- @if ($user_role === \App\Models\Users::ROLE_VENDOR) --}}
|
||||||
<div class="col text-end">
|
<div class="col text-end">
|
||||||
{{-- <a href="#" class="btn btn-sm btn-danger" data-bs-toggle="modal" data-bs-target="#addNewZoneModal">Add New Zone</a> --}}
|
{{-- <a href="#" class="btn btn-sm btn-danger" data-bs-toggle="modal" data-bs-target="#addNewZoneModal">Add New Zone</a> --}}
|
||||||
<a href="{{ route('view_zone_add') }}" class="btn btn-sm btn-danger">Tambah Zona</a>
|
<a href="{{ route('view_zone_add') }}" class="btn btn-sm btn-danger">Tambah Zona</a>
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
@php
|
@php
|
||||||
if (Auth::user()->role === \App\Models\Users::ROLE_ADMIN) {
|
if (Auth::user()->role === \App\Models\Users::ROLE_ADMIN) {
|
||||||
$route_list_trx = route('view_transactions');
|
$route_list_trx = route('view_transactions');
|
||||||
} else {
|
} else {
|
||||||
$route_list_trx = route('view_user_client_transaction');
|
$route_list_trx = route('view_user_client_transaction');
|
||||||
}
|
}
|
||||||
@endphp
|
@endphp
|
||||||
|
|
||||||
@extends('app.app')
|
@extends('app.app')
|
||||||
@ -20,28 +20,23 @@ if (Auth::user()->role === \App\Models\Users::ROLE_ADMIN) {
|
|||||||
{{-- Form Order --}}
|
{{-- Form Order --}}
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-header">
|
{{-- <div class="card-header">
|
||||||
<div class="row d-flex align-items-center">
|
<div class="row d-flex align-items-center">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<p class="card-title text-bold mb-0">Tambah Pengiriman Baru</p>
|
<p class="card-title text-bold mb-0">Add new job</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> --}}
|
||||||
<div class="card-body">
|
<div class="card-body pb-0">
|
||||||
@if (Auth::user()->role == \App\Models\Users::ROLE_ADMIN)
|
@if (Auth::user()->role == \App\Models\Users::ROLE_ADMIN)
|
||||||
<div class="row mb-3 d-flex align-items-center">
|
<div class="row mb-3 d-flex align-items-center d-none">
|
||||||
<div class="col-12 mb-3">
|
|
||||||
<p class="text-danger text-bold mb-0">Pengiriman Untuk Client</p>
|
|
||||||
{{-- <small>Masukkan tanggal, jam, lokasi penjemputan, dan lokasi pengantaran yang ada pada daftar zona yang telah didaftarkan</small> --}}
|
|
||||||
</div>
|
|
||||||
<div class="col-sm-5 col-5 mb-3">
|
<div class="col-sm-5 col-5 mb-3">
|
||||||
<label for="add-client" class="form-label text-nowrap">Pilih Client</label>
|
<label for="add-client" class="form-label text-nowrap">Company</label>
|
||||||
<select name="add-client" id="add-client" class="select2 form-control">
|
<select name="add-client" id="add-client" class="select2 form-control">
|
||||||
<option value="" selected disabled>Belum ada Client yang dipilih</option>
|
|
||||||
@foreach ($uclients as $uclient)
|
@foreach ($uclients as $uclient)
|
||||||
<option value="{{ $uclient->id }}" data-uid="{{ $uclient->id }}"
|
<option value="{{ $uclient->id }}" data-uid="{{ $uclient->id }}" data-cptid="{{ $uclient->client_group_id }}">
|
||||||
data-cptid="{{ $uclient->client_group_id }}">
|
{{ $uclient->client_group_name }}</option>
|
||||||
{{ $uclient->first_name." ($uclient->client_group_name)" }}</option>
|
|
||||||
@endforeach
|
@endforeach
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
@ -49,34 +44,33 @@ if (Auth::user()->role === \App\Models\Users::ROLE_ADMIN) {
|
|||||||
@endif
|
@endif
|
||||||
<div class="row mb-3 d-flex align-items-center">
|
<div class="row mb-3 d-flex align-items-center">
|
||||||
<div class="col-12 mb-3">
|
<div class="col-12 mb-3">
|
||||||
<p class="text-danger text-bold mb-0">Penjemputan dan Pengantaran</p>
|
<p class="text-danger text-bold mb-0">Orign & Destination</p>
|
||||||
{{-- <small>select time, pickup and drop zone from your zone list. Can't find your zone? <a href="{{ route('view_zone') }}">Add new zone</a></small> --}}
|
{{-- <small>select time, pickup and drop zone from your zone list. Can't find your zone? <a href="{{ route('view_zone') }}">Add new zone</a></small> --}}
|
||||||
<small>Masukkan tanggal, jam, lokasi penjemputan, dan lokasi pengantaran yang ada pada
|
<small>Enter the date, time, origin location, and destination location from<br>the list of registered zones.</small>
|
||||||
daftar zona yang telah didaftarkan</small>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-5 col-5 mb-3">
|
<div class="col-sm-5 col-5 mb-3">
|
||||||
<label for="add-pickup_date" class="form-label text-nowrap">Tanggal Penjemputan</label>
|
<label for="add-pickup_date" class="form-label text-nowrap">Date</label>
|
||||||
<input type="date" name="add-pickup_date" id="add-pickup_date" class="form-control">
|
<input type="date" name="add-pickup_date" id="add-pickup_date" class="form-control">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-2"></div>
|
<div class="col-2"></div>
|
||||||
<div class="col-sm-5 col-5 mb-3">
|
<div class="col-sm-5 col-5 mb-3">
|
||||||
<label for="add-pickup_time" class="form-label text-nowrap">Waktu Penjemputan</label>
|
<label for="add-pickup_time" class="form-label text-nowrap">Time</label>
|
||||||
{{-- <input type="time" name="add-pickup_time" id="add-pickup_time" class="form-control"
|
{{-- <input type="time" name="add-pickup_time" id="add-pickup_time" class="form-control"
|
||||||
min="23:30"> --}}
|
min="23:30"> --}}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-4 col-lg-3" style="padding:0 0 0 0.75rem;">
|
<div class="col-md-4 col-lg-3" style="padding:0 0 0 0.75rem;">
|
||||||
<select name="add-pickup_time_hour" id="add-pickup_time_hour" class="form-control">
|
<select name="add-pickup_time_hour" id="add-pickup_time_hour" class="form-control">
|
||||||
<option value="" selected disabled hidden>--</option>
|
<option value="" selected disabled hidden>--</option>
|
||||||
@for ($i=0; $i<24; $i++)
|
@for ($i = 0; $i < 24; $i++)
|
||||||
<option value="{{ str_pad($i, 2, '0', STR_PAD_LEFT) }}">{{ str_pad($i, 2, '0', STR_PAD_LEFT) }}</option>
|
<option value="{{ str_pad($i, 2, '0', STR_PAD_LEFT) }}">{{ str_pad($i, 2, '0', STR_PAD_LEFT) }}</option>
|
||||||
@endfor
|
@endfor
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-4 col-lg-3" style="padding:0 0 0 0.75rem;">
|
<div class="col-md-4 col-lg-3" style="padding:0 0 0 0.75rem;">
|
||||||
<select name="add-pickup_time_minute" id="add-pickup_time_minute" class="form-control">
|
<select name="add-pickup_time_minute" id="add-pickup_time_minute" class="form-control">
|
||||||
<option value="" selected disabled hidden>--</option>
|
<option value="" selected disabled hidden>--</option>
|
||||||
@for ($i=0; $i<60; $i++)
|
@for ($i = 0; $i < 60; $i++)
|
||||||
<option value="{{ str_pad($i, 2, '0', STR_PAD_LEFT) }}">{{ str_pad($i, 2, '0', STR_PAD_LEFT) }}</option>
|
<option value="{{ str_pad($i, 2, '0', STR_PAD_LEFT) }}">{{ str_pad($i, 2, '0', STR_PAD_LEFT) }}</option>
|
||||||
@endfor
|
@endfor
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
@ -85,13 +79,12 @@ if (Auth::user()->role === \App\Models\Users::ROLE_ADMIN) {
|
|||||||
</div>
|
</div>
|
||||||
<div class="row mb-3 d-flex align-items-center">
|
<div class="row mb-3 d-flex align-items-center">
|
||||||
<div class="col-5 mb-3">
|
<div class="col-5 mb-3">
|
||||||
<label for="add-pickup_zone" class="form-label">Lokasi Penjemputan</label>
|
<label for="add-pickup_zone" class="form-label">Origin</label>
|
||||||
<select name="add-pickup_zone" id="add-pickup_zone" class="select2 form-control">
|
<select name="add-pickup_zone" id="add-pickup_zone" class="select2 form-control">
|
||||||
<option value="" selected disabled>Belum ada lokasi yang dipilih</option>
|
<option value="" selected disabled>No origin location selected</option>
|
||||||
@if (Auth::user()->role === \App\Models\Users::ROLE_CLIENT_ADMIN)
|
@if (Auth::user()->role === \App\Models\Users::ROLE_CLIENT_ADMIN)
|
||||||
@foreach ($pickups as $pickup)
|
@foreach ($pickups as $pickup)
|
||||||
<option value="{{ $pickup->id }}" data-id="{{ $pickup->id }}"
|
<option value="{{ $pickup->id }}" data-id="{{ $pickup->id }}" data-title="{{ $pickup->name }}" data-addr="{{ $pickup->fulladdress }}">
|
||||||
data-title="{{ $pickup->name }}" data-addr="{{ $pickup->fulladdress }}">
|
|
||||||
{{ $pickup->name }}</option>
|
{{ $pickup->name }}</option>
|
||||||
@endforeach
|
@endforeach
|
||||||
@endif
|
@endif
|
||||||
@ -103,20 +96,19 @@ if (Auth::user()->role === \App\Models\Users::ROLE_ADMIN) {
|
|||||||
<span class="ion-arrow-right-c text-danger" style="font-size: 15px"></span>
|
<span class="ion-arrow-right-c text-danger" style="font-size: 15px"></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-5 mb-3">
|
<div class="col-5 mb-3">
|
||||||
<label for="add-drop_zone" class="form-label">Lokasi Pengantaran</label>
|
<label for="add-drop_zone" class="form-label">Destination</label>
|
||||||
<select name="add-drop_zone" id="add-drop_zone" class="select2 form-control">
|
<select name="add-drop_zone" id="add-drop_zone" class="select2 form-control">
|
||||||
<option value="" selected disabled>Belum ada lokasi yang dipilih</option>
|
<option value="" selected disabled>No destination location selected</option>
|
||||||
@if (Auth::user()->role === \App\Models\Users::ROLE_CLIENT_ADMIN)
|
@if (Auth::user()->role === \App\Models\Users::ROLE_CLIENT_ADMIN)
|
||||||
@foreach ($drops as $drop)
|
@foreach ($drops as $drop)
|
||||||
<option value="{{ $drop->id }}" data-id="{{ $drop->id }}"
|
<option value="{{ $drop->id }}" data-id="{{ $drop->id }}" data-title="{{ $drop->name }}" data-addr="{{ $drop->fulladdress }}">
|
||||||
data-title="{{ $drop->name }}" data-addr="{{ $drop->fulladdress }}">
|
|
||||||
{{ $drop->name }}</option>
|
{{ $drop->name }}</option>
|
||||||
@endforeach
|
@endforeach
|
||||||
@endif
|
@endif
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row d-flex align-items-center mb-3">
|
<div class="row d-flex align-items-center justify-content-between">
|
||||||
<div class="col-12 mb-3">
|
<div class="col-12 mb-3">
|
||||||
<p class="text-danger text-bold mb-0">Informasi Kendaraan</p>
|
<p class="text-danger text-bold mb-0">Informasi Kendaraan</p>
|
||||||
{{-- <small>You must fill in at least 1 of the package information.</small> --}}
|
{{-- <small>You must fill in at least 1 of the package information.</small> --}}
|
||||||
@ -138,21 +130,37 @@ if (Auth::user()->role === \App\Models\Users::ROLE_ADMIN) {
|
|||||||
<div class="col-5 mb-3 d-flex align-items-center">
|
<div class="col-5 mb-3 d-flex align-items-center">
|
||||||
<input type="number" name="add-koli" id="add-koli" class="form-control w-75 me-2">pcs
|
<input type="number" name="add-koli" id="add-koli" class="form-control w-75 me-2">pcs
|
||||||
</div> --}}
|
</div> --}}
|
||||||
<div class="col-5 mb-3">
|
{{-- <div class="col-5 mb-3">
|
||||||
<label for="add-truck_type" class="form-label">Jenis Kendaraan</label>
|
<label for="add-truck_type" class="form-label">Jenis Kendaraan</label>
|
||||||
<select name="add-truck_type" id="add-truck_type" class="select2 form-control">
|
<select name="add-truck_type" id="add-truck_type" class="select2 form-control">
|
||||||
{{-- <option value="" data-name="Let system choose automatically" selected>Let system
|
|
||||||
choose automatically
|
|
||||||
</option> --}}
|
|
||||||
<option value="" selected disabled>Pilih kendaraan</option>
|
<option value="" selected disabled>Pilih kendaraan</option>
|
||||||
@foreach ($truck_types as $tt)
|
@foreach ($truck_types as $tt)
|
||||||
<option value="{{ $tt->type_id }}" data-id="{{ $tt->id }}" data-type_id="{{ $tt->type_id }}"
|
<option value="{{ $tt->type_id }}" data-id="{{ $tt->id }}" data-type_id="{{ $tt->type_id }}" data-name="{{ $tt->type_name }}" data-weight="{{ $tt->max_kg }}" data-cbm="{{ $tt->max_cbm }}" data-koli="{{ $tt->max_koli }}">
|
||||||
data-name="{{ $tt->type_name }}" data-weight="{{ $tt->max_kg }}"
|
|
||||||
data-cbm="{{ $tt->max_cbm }}" data-koli="{{ $tt->max_koli }}">
|
|
||||||
{{ $tt->type_name }}</option>
|
{{ $tt->type_name }}</option>
|
||||||
@endforeach
|
@endforeach
|
||||||
</select>
|
</select>
|
||||||
|
</div> --}}
|
||||||
|
<div class="col-5 mb-3">
|
||||||
|
<label for="add-truck_type" class="form-label">Select Vehicle</label>
|
||||||
|
<select name="add-truck_type" id="add-truck_type" class="select2 form-control">
|
||||||
|
<option value="" selected disabled>Select Vehicle</option>
|
||||||
|
@foreach ($vehicle as $_vehicle)
|
||||||
|
<option value="{{ $_vehicle->vid }}" data-id="{{ $_vehicle->vid }}" data-type_id="{{ $_vehicle->vid }}" data-name="{{ $_vehicle->name }}">
|
||||||
|
{{ $_vehicle->name }}</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-5 mb-3">
|
||||||
|
<label for="add-driver" class="form-label">Driver</label>
|
||||||
|
<select name="add-driver" id="add-driver" class="select2 form-control">
|
||||||
|
<option value="" selected disabled>Select Driver</option>
|
||||||
|
@foreach ($driver as $_driver)
|
||||||
|
<option value="{{ $_driver->id }}" data-id="{{ $_driver->id }}" data-driver_id="{{ $_driver->id }}" data-name="{{ $_driver->fullname }}">
|
||||||
|
{{ $_driver->fullname }}</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
{{-- <div class="row d-flex align-items-center">
|
{{-- <div class="row d-flex align-items-center">
|
||||||
<div class="col-12 mb-3">
|
<div class="col-12 mb-3">
|
||||||
@ -172,7 +180,7 @@ if (Auth::user()->role === \App\Models\Users::ROLE_ADMIN) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div> --}}
|
</div> --}}
|
||||||
<div class="row d-flex align-items-center mb-3">
|
<div class="row d-flex align-items-center mb-3 d-none">
|
||||||
<div class="col-12 mb-3">
|
<div class="col-12 mb-3">
|
||||||
<p class="text-danger text-bold mb-0">Asuransi</p>
|
<p class="text-danger text-bold mb-0">Asuransi</p>
|
||||||
<small>Apakah Anda ingin menambahkan Asuransi untuk pengiriman ini?</small>
|
<small>Apakah Anda ingin menambahkan Asuransi untuk pengiriman ini?</small>
|
||||||
@ -198,12 +206,11 @@ if (Auth::user()->role === \App\Models\Users::ROLE_ADMIN) {
|
|||||||
<div class="row d-flex align-items-center">
|
<div class="row d-flex align-items-center">
|
||||||
<div class="col-8">
|
<div class="col-8">
|
||||||
<p class="mb-0">
|
<p class="mb-0">
|
||||||
Sudahkah Anda mengisi semua kolom yang ada?
|
Have you filled in all the required fields?
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-4 text-end">
|
<div class="col-4 text-end">
|
||||||
<button class="btn btn-warning btn-block btn-sm" id="btnCalculate">Kalkulasi
|
<button class="btn btn-warning btn-block btn-sm" id="btnCalculate"> Next </button>
|
||||||
Sekarang</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -211,6 +218,7 @@ if (Auth::user()->role === \App\Models\Users::ROLE_ADMIN) {
|
|||||||
</div>
|
</div>
|
||||||
{{-- Checkout --}}
|
{{-- Checkout --}}
|
||||||
<div class="col-sm-6 d-none" id="checkOutView">
|
<div class="col-sm-6 d-none" id="checkOutView">
|
||||||
|
{{-- <div class="col-sm-6"> --}}
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<div class="row d-flex align-items-center">
|
<div class="row d-flex align-items-center">
|
||||||
@ -231,10 +239,10 @@ if (Auth::user()->role === \App\Models\Users::ROLE_ADMIN) {
|
|||||||
<div class="card-body pb-0 checkoutBody">
|
<div class="card-body pb-0 checkoutBody">
|
||||||
<div class="row d-flex align-items-center">
|
<div class="row d-flex align-items-center">
|
||||||
<div class="col-12 mb-3">
|
<div class="col-12 mb-3">
|
||||||
<p class="text-danger text-bold mb-0">Penjemputan dan Pengantaran</p>
|
<p class="text-danger text-bold mb-0">Orign & Destination</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-5 mb-3">
|
<div class="col-sm-5 mb-3">
|
||||||
<label for="" class="form-label">Tanggal Penjemputan</label>
|
<label for="" class="form-label">Date</label>
|
||||||
<div class="card bg-light border mb-0">
|
<div class="card bg-light border mb-0">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<p id="checkout-pickup_at" class="mb-0">Feb 22, 2022 23:59:00</p>
|
<p id="checkout-pickup_at" class="mb-0">Feb 22, 2022 23:59:00</p>
|
||||||
@ -243,17 +251,18 @@ if (Auth::user()->role === \App\Models\Users::ROLE_ADMIN) {
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-sm-2"></div>
|
<div class="col-sm-2"></div>
|
||||||
<div class="col-sm-5 mb-3">
|
<div class="col-sm-5 mb-3">
|
||||||
<label for="" class="form-label">Jenis Kendaraan</label>
|
<label for="" class="form-label">Vehicle</label>
|
||||||
<div class="card bg-light border mb-0">
|
<div class="card bg-light border mb-0">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<p id="checkout-truck_type" class="mb-0">CDD Long</p>
|
<p id="checkout-truck_type" class="mb-0">CDD Long</p>
|
||||||
|
<p id="checkout-driver" class="mb-0">CDD Long</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row d-flex align-items-center">
|
<div class="row d-flex align-items-center">
|
||||||
<div class="col-5 mb-3">
|
<div class="col-5 mb-3">
|
||||||
<label for="" class="form-label">Lokasi Penjemputan</label>
|
<label for="" class="form-label">Origin</label>
|
||||||
<div class="card bg-light border mb-0">
|
<div class="card bg-light border mb-0">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<p id="checkout-pickup_zone_title" class="text-bold mb-2">Gudang Pluit SiCepat
|
<p id="checkout-pickup_zone_title" class="text-bold mb-2">Gudang Pluit SiCepat
|
||||||
@ -270,7 +279,7 @@ if (Auth::user()->role === \App\Models\Users::ROLE_ADMIN) {
|
|||||||
<span class="ion-arrow-right-c text-danger" style="font-size: 15px"></span>
|
<span class="ion-arrow-right-c text-danger" style="font-size: 15px"></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-5 mb-3">
|
<div class="col-5 mb-3">
|
||||||
<label for="" class="form-label">Lokasi Pengantaran</label>
|
<label for="" class="form-label">Destination</label>
|
||||||
<div class="card bg-light border mb-0">
|
<div class="card bg-light border mb-0">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<p id="checkout-drop_zone_title" class="text-bold mb-2">Kantor Pusat SiCepat
|
<p id="checkout-drop_zone_title" class="text-bold mb-2">Kantor Pusat SiCepat
|
||||||
@ -318,12 +327,12 @@ if (Auth::user()->role === \App\Models\Users::ROLE_ADMIN) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div> --}}
|
</div> --}}
|
||||||
<div class="row">
|
<div class="row d-none">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<hr>
|
<hr>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row d-flex align-items-center">
|
<div class="row d-flex align-items-center d-none">
|
||||||
<div class="col-12 mb-3 mt-3">
|
<div class="col-12 mb-3 mt-3">
|
||||||
<p class="text-danger text-bold mb-0">Pilih Layanan</p>
|
<p class="text-danger text-bold mb-0">Pilih Layanan</p>
|
||||||
<small>Berikut layanan yang tersedia untuk pesanan Anda</small>
|
<small>Berikut layanan yang tersedia untuk pesanan Anda</small>
|
||||||
@ -378,11 +387,7 @@ if (Auth::user()->role === \App\Models\Users::ROLE_ADMIN) {
|
|||||||
<div class="row mb-3 d-flex align-items-center">
|
<div class="row mb-3 d-flex align-items-center">
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
<div class="form-check">
|
<div class="form-check">
|
||||||
<input class="form-check-input" type="radio" name="chooseFleet"
|
<input class="form-check-input" type="radio" name="chooseFleet" data-lead_time_id="${opt.lead_time_id}" data-lead_time="${opt.lead_time}" data-price="${opt.price}" data-real_price="${opt.real_price}" data-disc_price="${opt.disc_price}">
|
||||||
data-lead_time_id="${opt.lead_time_id}"
|
|
||||||
data-lead_time="${opt.lead_time}" data-price="${opt.price}"
|
|
||||||
data-real_price="${opt.real_price}"
|
|
||||||
data-disc_price="${opt.disc_price}">
|
|
||||||
<label class="form-check-label text-success">
|
<label class="form-check-label text-success">
|
||||||
1 Hari <span class="badge bg-success ms-2">Best services</span>
|
1 Hari <span class="badge bg-success ms-2">Best services</span>
|
||||||
</label>
|
</label>
|
||||||
@ -397,11 +402,7 @@ if (Auth::user()->role === \App\Models\Users::ROLE_ADMIN) {
|
|||||||
<div class="row mb-3 d-flex align-items-center">
|
<div class="row mb-3 d-flex align-items-center">
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
<div class="form-check">
|
<div class="form-check">
|
||||||
<input class="form-check-input" type="radio" name="chooseFleet"
|
<input class="form-check-input" type="radio" name="chooseFleet" data-lead_time_id="${opt.lead_time_id}" data-lead_time="${opt.lead_time}" data-price="${opt.price}" data-real_price="${opt.real_price}" data-disc_price="${opt.disc_price}">
|
||||||
data-lead_time_id="${opt.lead_time_id}"
|
|
||||||
data-lead_time="${opt.lead_time}" data-price="${opt.price}"
|
|
||||||
data-real_price="${opt.real_price}"
|
|
||||||
data-disc_price="${opt.disc_price}">
|
|
||||||
<label class="form-check-label text-dark">
|
<label class="form-check-label text-dark">
|
||||||
2 Hari
|
2 Hari
|
||||||
</label>
|
</label>
|
||||||
@ -427,15 +428,13 @@ if (Auth::user()->role === \App\Models\Users::ROLE_ADMIN) {
|
|||||||
<div class="card-footer checkoutBody">
|
<div class="card-footer checkoutBody">
|
||||||
<div class="row d-flex align-items-center">
|
<div class="row d-flex align-items-center">
|
||||||
<div class="col-8">
|
<div class="col-8">
|
||||||
<p class="text-danger mb-0">Harga layanan yang tercantum adalah harga perkiraan, bukan
|
|
||||||
harga Final.</p>
|
|
||||||
<p class="mb-0">
|
<p class="mb-0">
|
||||||
Sudahkah Anda memeriksa ulang informasi pesanan?
|
Have you reviewed the job information?
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-4 text-end">
|
<div class="col-4 text-end">
|
||||||
<button class="btn btn-danger btn-block btn-sm" id="btnOrder" {{-- onclick="location.href='{{ route('view_user_client_transaction') }}'" --}}
|
{{-- <button class="btn btn-danger btn-block btn-sm" id="btnOrder" disabled>Pesan Sekarang</button> --}}
|
||||||
disabled>Pesan Sekarang</button>
|
<button class="btn btn-danger btn-block btn-sm" id="btnOrder">Submit</button>
|
||||||
<div id="btnOrderSpinner" class="d-none">
|
<div id="btnOrderSpinner" class="d-none">
|
||||||
<div class="spinner-border" role="status">
|
<div class="spinner-border" role="status">
|
||||||
<span class="visually-hidden">Loading...</span>
|
<span class="visually-hidden">Loading...</span>
|
||||||
@ -452,9 +451,7 @@ if (Auth::user()->role === \App\Models\Users::ROLE_ADMIN) {
|
|||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@section('customjs')
|
@section('customjs')
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.18.2/xlsx.full.min.js"
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.18.2/xlsx.full.min.js" integrity="sha512-oCjkwxjURabnte5K4Zeoc+hZ/G5pQE7GI4DYl+0wl6WaJIkBjb9FvUIaMU3lOPoBMSRZZ7QrczpGQoBFAKKB1Q==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||||
integrity="sha512-oCjkwxjURabnte5K4Zeoc+hZ/G5pQE7GI4DYl+0wl6WaJIkBjb9FvUIaMU3lOPoBMSRZZ7QrczpGQoBFAKKB1Q=="
|
|
||||||
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
|
||||||
<script>
|
<script>
|
||||||
$("#insuranceCheck").change(function() {
|
$("#insuranceCheck").change(function() {
|
||||||
$("#insurancePrice").toggleClass("d-none")
|
$("#insurancePrice").toggleClass("d-none")
|
||||||
@ -464,6 +461,12 @@ if (Auth::user()->role === \App\Models\Users::ROLE_ADMIN) {
|
|||||||
$("#insuranceInput").prop('required', true);
|
$("#insuranceInput").prop('required', true);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
$(document).ready(function() {
|
||||||
|
setTimeout(function() {
|
||||||
|
$('select[name=add-client]').val('1').change();
|
||||||
|
}, 100);
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
'use strict';
|
'use strict';
|
||||||
@ -495,14 +498,13 @@ if (Auth::user()->role === \App\Models\Users::ROLE_ADMIN) {
|
|||||||
TrxNew.activate();
|
TrxNew.activate();
|
||||||
},
|
},
|
||||||
event: function() {
|
event: function() {
|
||||||
$('#checkout-group_pricing').on('click', 'input[name=chooseFleet]', function() {
|
// $('#checkout-group_pricing').on('click', 'input[name=chooseFleet]', function() {
|
||||||
$('#btnOrder').prop("disabled", false);
|
// $('#btnOrder').prop("disabled", false);
|
||||||
});
|
// });
|
||||||
// min date is today
|
// min date is today
|
||||||
let TimeISOString = moment().toISOString().split('T');
|
let TimeISOString = moment().toISOString().split('T');
|
||||||
let time = TimeISOString[1].split('.')[0].split(':');
|
let time = TimeISOString[1].split('.')[0].split(':');
|
||||||
$('#add-pickup_date').attr('min', TimeISOString[0]);
|
$('#add-pickup_date').attr('min', TimeISOString[0]);
|
||||||
// $('#add-pickup_time').attr('min', time[0] + ':' + time[1]);
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -745,8 +747,8 @@ if (Auth::user()->role === \App\Models\Users::ROLE_ADMIN) {
|
|||||||
TrxNew.hideCheckout();
|
TrxNew.hideCheckout();
|
||||||
let selected = $('#add-client :selected');
|
let selected = $('#add-client :selected');
|
||||||
|
|
||||||
$('#add-pickup_zone').html('<option value="" selected disabled>Belum ada lokasi yang dipilih</option>');
|
$('#add-pickup_zone').html('<option value="" selected disabled>No location has been selected.</option>');
|
||||||
$('#add-drop_zone').html('<option value="" selected disabled>Belum ada lokasi yang dipilih</option>');
|
$('#add-drop_zone').html('<option value="" selected disabled>No location has been selected.</option>');
|
||||||
|
|
||||||
const listPickupZones = await Req.list_client_zone({
|
const listPickupZones = await Req.list_client_zone({
|
||||||
cptid: selected.data('cptid'),
|
cptid: selected.data('cptid'),
|
||||||
@ -844,8 +846,12 @@ if (Auth::user()->role === \App\Models\Users::ROLE_ADMIN) {
|
|||||||
// data.koli = Number($('#add-koli').val() || 'n');
|
// data.koli = Number($('#add-koli').val() || 'n');
|
||||||
|
|
||||||
let truck_type = $('#add-truck_type :selected');
|
let truck_type = $('#add-truck_type :selected');
|
||||||
data.truck_type_id = truck_type.data('type_id');
|
data.vehicle_id = truck_type.data('type_id');
|
||||||
data.truck_type_name = truck_type.data('name')?.trim();
|
data.vehicle_name = truck_type.data('name')?.trim();
|
||||||
|
|
||||||
|
let driver = $('#add-driver :selected');
|
||||||
|
data.driver_id = driver.data('driver_id');
|
||||||
|
data.driver_name = driver.data('name')?.trim();
|
||||||
// data.truck_type_weight = truck_type.data('weight');
|
// data.truck_type_weight = truck_type.data('weight');
|
||||||
// data.truck_type_cbm = truck_type.data('cbm');
|
// data.truck_type_cbm = truck_type.data('cbm');
|
||||||
// data.truck_type_koli = truck_type.data('koli');
|
// data.truck_type_koli = truck_type.data('koli');
|
||||||
@ -872,25 +878,26 @@ if (Auth::user()->role === \App\Models\Users::ROLE_ADMIN) {
|
|||||||
},
|
},
|
||||||
checkData: function(data, isAlert = false) {
|
checkData: function(data, isAlert = false) {
|
||||||
if (data.pickup_at < 1 || isNaN(data.pickup_at)) {
|
if (data.pickup_at < 1 || isNaN(data.pickup_at)) {
|
||||||
if (isAlert) Helper.toast('Warning', 'just now', 'Pickup date / time not valid');
|
if (isAlert) Helper.toast('Warning', 'just now', 'Date / time not valid');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (data.pickup_at < moment().unix()) {
|
if (data.pickup_at < moment().unix()) {
|
||||||
if (isAlert) Helper.toast('Warning', 'just now',
|
if (isAlert) Helper.toast('Warning', 'just now',
|
||||||
'Pickup date / time is less than the current date / time');
|
'Date / time is less than the current date / time');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (data.pickup_at < moment().add(3, 'hours').unix()) {
|
// if (data.pickup_at < moment().add(3, 'hours').unix()) {
|
||||||
|
if (data.pickup_at < moment().add(5, 'minutes').unix()) {
|
||||||
if (isAlert) Helper.toast('Warning', 'just now',
|
if (isAlert) Helper.toast('Warning', 'just now',
|
||||||
'Pickup time minimum 3 hours from now');
|
'The selected time is too soon. Minimum is 5 minutes from now.');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (typeof data.pickup_zone_id == 'undefined') {
|
if (typeof data.pickup_zone_id == 'undefined') {
|
||||||
if (isAlert) Helper.toast('Warning', 'just now', 'Pickup zone not valid');
|
if (isAlert) Helper.toast('Warning', 'just now', 'Origin zone not valid');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (typeof data.drop_zone_id == 'undefined') {
|
if (typeof data.drop_zone_id == 'undefined') {
|
||||||
if (isAlert) Helper.toast('Warning', 'just now', 'Drop zone not valid');
|
if (isAlert) Helper.toast('Warning', 'just now', 'Destination zone not valid');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -900,23 +907,23 @@ if (Auth::user()->role === \App\Models\Users::ROLE_ADMIN) {
|
|||||||
// 'weight / volume / koli must be provided at least 1 of them');
|
// 'weight / volume / koli must be provided at least 1 of them');
|
||||||
// return false;
|
// return false;
|
||||||
// }
|
// }
|
||||||
// if (typeof data.truck_type_id != 'undefined') {
|
// if (typeof data.vehicle_id != 'undefined') {
|
||||||
// if (!isNaN(data.weight) && data.truck_type_weight != 0 && data.weight > data
|
// if (!isNaN(data.weight) && data.truck_type_weight != 0 && data.weight > data
|
||||||
// .truck_type_weight) {
|
// .truck_type_weight) {
|
||||||
// if (isAlert) Helper.toast('Warning', 'just now',
|
// if (isAlert) Helper.toast('Warning', 'just now',
|
||||||
// `maximum weight for type truck ${data.truck_type_name} is ${data.truck_type_weight} Kg`
|
// `maximum weight for type truck ${data.vehicle_name} is ${data.truck_type_weight} Kg`
|
||||||
// );
|
// );
|
||||||
// return false;
|
// return false;
|
||||||
// }
|
// }
|
||||||
// if (!isNaN(data.cbm) && data.truck_type_cbm != 0 && data.cbm > data.truck_type_cbm) {
|
// if (!isNaN(data.cbm) && data.truck_type_cbm != 0 && data.cbm > data.truck_type_cbm) {
|
||||||
// if (isAlert) Helper.toast('Warning', 'just now',
|
// if (isAlert) Helper.toast('Warning', 'just now',
|
||||||
// `maximum volume for type truck ${data.truck_type_name} is ${data.truck_type_cbm} m³`
|
// `maximum volume for type truck ${data.vehicle_name} is ${data.truck_type_cbm} m³`
|
||||||
// );
|
// );
|
||||||
// return false;
|
// return false;
|
||||||
// }
|
// }
|
||||||
// if (!isNaN(data.koli) && data.truck_type_koli != 0 && data.koli > data.truck_type_koli) {
|
// if (!isNaN(data.koli) && data.truck_type_koli != 0 && data.koli > data.truck_type_koli) {
|
||||||
// if (isAlert) Helper.toast('Warning', 'just now',
|
// if (isAlert) Helper.toast('Warning', 'just now',
|
||||||
// `maximum koli for type truck ${data.truck_type_name} is ${data.truck_type_koli} Pcs`
|
// `maximum koli for type truck ${data.vehicle_name} is ${data.truck_type_koli} Pcs`
|
||||||
// );
|
// );
|
||||||
// return false;
|
// return false;
|
||||||
// }
|
// }
|
||||||
@ -959,39 +966,39 @@ if (Auth::user()->role === \App\Models\Users::ROLE_ADMIN) {
|
|||||||
// $('#checkout-unit').html('');
|
// $('#checkout-unit').html('');
|
||||||
// if (!isNaN(data.weight)) {
|
// if (!isNaN(data.weight)) {
|
||||||
// $('#checkout-unit').append(`
|
// $('#checkout-unit').append(`
|
||||||
// <div class="col-sm-4 mb-0 d-flex align-items-center">
|
// <div class="col-sm-4 mb-0 d-flex align-items-center">
|
||||||
// <label for="" class="form-label">Berat</label>
|
// <label for="" class="form-label">Berat</label>
|
||||||
// <div class="card bg-light border mb-0 w-100">
|
// <div class="card bg-light border mb-0 w-100">
|
||||||
// <div class="card-body">
|
// <div class="card-body">
|
||||||
// <p class="mb-0">${data.weight} Kg</p>
|
// <p class="mb-0">${data.weight} Kg</p>
|
||||||
// </div>
|
// </div>
|
||||||
// </div>
|
// </div>
|
||||||
// </div>
|
// </div>
|
||||||
// `);
|
// `);
|
||||||
// }
|
// }
|
||||||
// if (!isNaN(data.cbm)) {
|
// if (!isNaN(data.cbm)) {
|
||||||
// $('#checkout-unit').append(`
|
// $('#checkout-unit').append(`
|
||||||
// <div class="col-sm-4 mb-0 d-flex align-items-center">
|
// <div class="col-sm-4 mb-0 d-flex align-items-center">
|
||||||
// <label for="" class="form-label">Volume</label>
|
// <label for="" class="form-label">Volume</label>
|
||||||
// <div class="card bg-light border mb-0 w-100">
|
// <div class="card bg-light border mb-0 w-100">
|
||||||
// <div class="card-body">
|
// <div class="card-body">
|
||||||
// <p class="mb-0">${data.cbm} m³</p>
|
// <p class="mb-0">${data.cbm} m³</p>
|
||||||
// </div>
|
// </div>
|
||||||
// </div>
|
// </div>
|
||||||
// </div>
|
// </div>
|
||||||
// `);
|
// `);
|
||||||
// }
|
// }
|
||||||
// if (!isNaN(data.koli)) {
|
// if (!isNaN(data.koli)) {
|
||||||
// $('#checkout-unit').append(`
|
// $('#checkout-unit').append(`
|
||||||
// <div class="col-sm-4 mb-0 d-flex align-items-center">
|
// <div class="col-sm-4 mb-0 d-flex align-items-center">
|
||||||
// <label for="" class="form-label">Koli</label>
|
// <label for="" class="form-label">Koli</label>
|
||||||
// <div class="card bg-light border mb-0 w-100">
|
// <div class="card bg-light border mb-0 w-100">
|
||||||
// <div class="card-body">
|
// <div class="card-body">
|
||||||
// <p class="mb-0">${data.koli} Pcs</p>
|
// <p class="mb-0">${data.koli} Pcs</p>
|
||||||
// </div>
|
// </div>
|
||||||
// </div>
|
// </div>
|
||||||
// </div>
|
// </div>
|
||||||
// `);
|
// `);
|
||||||
// }
|
// }
|
||||||
// // end packing list data
|
// // end packing list data
|
||||||
|
|
||||||
@ -1048,7 +1055,9 @@ if (Auth::user()->role === \App\Models\Users::ROLE_ADMIN) {
|
|||||||
`);
|
`);
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#checkout-truck_type').text(data.truck_type_name);
|
$('#checkout-truck_type').text(data.vehicle_name);
|
||||||
|
console.log("driver:", data.driver_name);
|
||||||
|
$('#checkout-driver').text(data.driver_name);
|
||||||
|
|
||||||
$('#checkOutView').removeClass('d-none');
|
$('#checkOutView').removeClass('d-none');
|
||||||
$('#checkOutView').addClass('d-block');
|
$('#checkOutView').addClass('d-block');
|
||||||
@ -1056,7 +1065,7 @@ if (Auth::user()->role === \App\Models\Users::ROLE_ADMIN) {
|
|||||||
hideCheckout: function() {
|
hideCheckout: function() {
|
||||||
$('#checkOutView').addClass('d-none');
|
$('#checkOutView').addClass('d-none');
|
||||||
$('#checkOutView').removeClass('d-block');
|
$('#checkOutView').removeClass('d-block');
|
||||||
$('#btnOrder').attr('disabled', true);
|
$('#btnOrder').attr('disabled', false);
|
||||||
},
|
},
|
||||||
downloadTemplatePackingList: function() {
|
downloadTemplatePackingList: function() {
|
||||||
const fileName = 'template_packing_list.xlsx';
|
const fileName = 'template_packing_list.xlsx';
|
||||||
|
|||||||
@ -7,14 +7,14 @@
|
|||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<p class="card-title text-bold mb-0">Riwayat Transfer Uang Saku</p>
|
<p class="card-title text-bold mb-0">Riwayat Transfer Uang Saku</p>
|
||||||
<p class="card-subtitle text-muted">Daftar Transfer</p>
|
<p class="card-subtitle text-muted">Daftar Transfer</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table id="tTable" class="table table-hover dataTable w-100">
|
<table id="tTable" class="table table-hover dataTable w-100">
|
||||||
<thead>
|
<thead>
|
||||||
<tr class="">
|
<tr class="">
|
||||||
@ -46,7 +46,7 @@
|
|||||||
<p class="mb-0">BCA (014)</p>
|
<p class="mb-0">BCA (014)</p>
|
||||||
<p class="mb-0">Bank Central Asia</p>
|
<p class="mb-0">Bank Central Asia</p>
|
||||||
</td>
|
</td>
|
||||||
<td class="text-start">Rafif</td>
|
<td class="text-start">Emrsyf</td>
|
||||||
<td class="text-center">0101010100101</td>
|
<td class="text-center">0101010100101</td>
|
||||||
<td class="text-center">2.500.000</td>
|
<td class="text-center">2.500.000</td>
|
||||||
<td class="text-center"><span class="text-danger">Fail</span></td>
|
<td class="text-center"><span class="text-danger">Fail</span></td>
|
||||||
@ -55,16 +55,15 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{-- modal resend pocket money tf --}}
|
{{-- modal resend pocket money tf --}}
|
||||||
<div class="modal fade" id="mdlResendPocket" data-bs-backdrop="static" data-bs-keyboard="false"
|
<div class="modal fade" id="mdlResendPocket" data-bs-backdrop="static" data-bs-keyboard="false" aria-labelledby="mdlResendPocketLabel" aria-hidden="true">
|
||||||
aria-labelledby="mdlResendPocketLabel" aria-hidden="true">
|
|
||||||
<div class="modal-dialog modal-md modal-dialog-centered modal-dialog-scrollable">
|
<div class="modal-dialog modal-md modal-dialog-centered modal-dialog-scrollable">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
@ -103,299 +102,299 @@
|
|||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@section('customjs')
|
@section('customjs')
|
||||||
<script>
|
<script>
|
||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
const State = {
|
const State = {
|
||||||
stts: {
|
stts: {
|
||||||
unpaid: "{{ \App\Models\OrdersLogsTf::STTS_UNPAID }}",
|
unpaid: "{{ \App\Models\OrdersLogsTf::STTS_UNPAID }}",
|
||||||
paid: "{{ \App\Models\OrdersLogsTf::STTS_PAID }}",
|
paid: "{{ \App\Models\OrdersLogsTf::STTS_PAID }}",
|
||||||
fail: "{{ \App\Models\OrdersLogsTf::STTS_FAIL }}",
|
fail: "{{ \App\Models\OrdersLogsTf::STTS_FAIL }}",
|
||||||
pending: "{{ \App\Models\OrdersLogsTf::STTS_PENDING }}",
|
pending: "{{ \App\Models\OrdersLogsTf::STTS_PENDING }}",
|
||||||
},
|
},
|
||||||
checkpoint_paid: {
|
checkpoint_paid: {
|
||||||
unpaid: "{{ \App\Models\OrdersCheckpoints::IS_UNPAID }}",
|
unpaid: "{{ \App\Models\OrdersCheckpoints::IS_UNPAID }}",
|
||||||
paid: "{{ \App\Models\OrdersCheckpoints::IS_PAID }}",
|
paid: "{{ \App\Models\OrdersCheckpoints::IS_PAID }}",
|
||||||
fail: "{{ \App\Models\OrdersCheckpoints::IS_TF_FAIL }}",
|
fail: "{{ \App\Models\OrdersCheckpoints::IS_TF_FAIL }}",
|
||||||
},
|
},
|
||||||
delay_type_number: 1000,
|
delay_type_number: 1000,
|
||||||
storage_lara: "{{ asset('storage') }}/",
|
storage_lara: "{{ asset('storage') }}/",
|
||||||
file_jimp_worker: "{{ asset('assets/js/worker/jimp.js') }}",
|
file_jimp_worker: "{{ asset('assets/js/worker/jimp.js') }}",
|
||||||
};
|
};
|
||||||
|
|
||||||
const Wrapper = {
|
const Wrapper = {
|
||||||
activate: function() {
|
activate: function() {
|
||||||
DTable.activate();
|
DTable.activate();
|
||||||
ResendPocket.activate();
|
ResendPocket.activate();
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const DTable = {
|
const DTable = {
|
||||||
activate: function() {
|
activate: function() {
|
||||||
DTable.reload();
|
DTable.reload();
|
||||||
},
|
},
|
||||||
reload: function() {
|
reload: function() {
|
||||||
// $('#tTable').DataTable();
|
// $('#tTable').DataTable();
|
||||||
// if (Driver.Table.firstInitDataTable == 1) { loadTableSkeletonLoading() } else { Driver.Table.firstInitDataTable = 1; }
|
// if (Driver.Table.firstInitDataTable == 1) { loadTableSkeletonLoading() } else { Driver.Table.firstInitDataTable = 1; }
|
||||||
$('#tTable').DataTable({
|
$('#tTable').DataTable({
|
||||||
processing: true,
|
processing: true,
|
||||||
serverSide: false,
|
serverSide: false,
|
||||||
bLengthChange: true,
|
bLengthChange: true,
|
||||||
deferRender: true,
|
deferRender: true,
|
||||||
destroy: true,
|
destroy: true,
|
||||||
// fixedColumns: {
|
// fixedColumns: {
|
||||||
// left: 3,
|
// left: 3,
|
||||||
// },
|
// },
|
||||||
ajax: {
|
ajax: {
|
||||||
url: "{{ route('api_finance_list_pocket_tf_history') }}",
|
url: "{{ route('api_finance_list_pocket_tf_history') }}",
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
complete: function() {
|
complete: function() {
|
||||||
// removeTableSkeletonLoading()
|
// removeTableSkeletonLoading()
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
deferRender: true,
|
||||||
deferRender: true,
|
columns: [{
|
||||||
columns: [{
|
data: 'DT_RowIndex',
|
||||||
data: 'DT_RowIndex',
|
className: 'text-end',
|
||||||
className: 'text-end',
|
visible: true,
|
||||||
visible: true,
|
orderable: true,
|
||||||
orderable: true,
|
searchable: true,
|
||||||
searchable: true,
|
},
|
||||||
},
|
{
|
||||||
{
|
data: 'action',
|
||||||
data: 'action',
|
className: 'text-center',
|
||||||
className: 'text-center',
|
visible: true,
|
||||||
visible: true,
|
orderable: true,
|
||||||
orderable: true,
|
searchable: true,
|
||||||
searchable: true,
|
render: function(data, type, row, meta) {
|
||||||
render: function(data, type, row, meta) {
|
let action = '';
|
||||||
let action = '';
|
if (row.pocket_is_paid == State.checkpoint_paid.fail) {
|
||||||
if (row.pocket_is_paid == State.checkpoint_paid.fail) {
|
action += `
|
||||||
action += `
|
|
||||||
<a href="#" class="btnResendPocket text-decoration-none me-1" data-bs-toggle="tooltip" data-bs-placement="top" title="Kirim Ulang">
|
<a href="#" class="btnResendPocket text-decoration-none me-1" data-bs-toggle="tooltip" data-bs-placement="top" title="Kirim Ulang">
|
||||||
<span class="icon ion-refresh text-danger fz-16"></span>
|
<span class="icon ion-refresh text-danger fz-16"></span>
|
||||||
</a>
|
</a>
|
||||||
`;
|
`;
|
||||||
|
}
|
||||||
|
// <a href="#" class="text-decoration-none text-danger btnDelDrv">
|
||||||
|
// <span class="icon ion-trash-b fz-16"></span>
|
||||||
|
// </a>
|
||||||
|
return action;
|
||||||
}
|
}
|
||||||
// <a href="#" class="text-decoration-none text-danger btnDelDrv">
|
|
||||||
// <span class="icon ion-trash-b fz-16"></span>
|
|
||||||
// </a>
|
|
||||||
return action;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
data: 'ord_code',
|
|
||||||
className: 'text-nowrap',
|
|
||||||
visible: true,
|
|
||||||
orderable: true,
|
|
||||||
searchable: true,
|
|
||||||
createdCell: function(td, cellData, rowData, row, col) {
|
|
||||||
// $(td).attr('data-id', rowData.id);
|
|
||||||
$(td).attr('data-ord_id', rowData.ord_id);
|
|
||||||
$(td).attr('data-ord_code', rowData.ord_code);
|
|
||||||
$(td).attr('data-checkpoint_id', rowData.ord_checkpoint_id);
|
|
||||||
},
|
},
|
||||||
render: function(data, type, row, meta) {
|
{
|
||||||
return '#'+data;
|
data: 'ord_code',
|
||||||
|
className: 'text-nowrap',
|
||||||
|
visible: true,
|
||||||
|
orderable: true,
|
||||||
|
searchable: true,
|
||||||
|
createdCell: function(td, cellData, rowData, row, col) {
|
||||||
|
// $(td).attr('data-id', rowData.id);
|
||||||
|
$(td).attr('data-ord_id', rowData.ord_id);
|
||||||
|
$(td).attr('data-ord_code', rowData.ord_code);
|
||||||
|
$(td).attr('data-checkpoint_id', rowData.ord_checkpoint_id);
|
||||||
|
},
|
||||||
|
render: function(data, type, row, meta) {
|
||||||
|
return '#' + data;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
// {
|
||||||
// {
|
// data: 'ref_code',
|
||||||
// data: 'ref_code',
|
// className: 'text-nowrap',
|
||||||
// className: 'text-nowrap',
|
// visible: true,
|
||||||
// visible: true,
|
// orderable: true,
|
||||||
// orderable: true,
|
// searchable: true,
|
||||||
// searchable: true,
|
// render: function(data, type, row, meta) {
|
||||||
// render: function(data, type, row, meta) {
|
// return '#'+data;
|
||||||
// return '#'+data;
|
// },
|
||||||
// },
|
// },
|
||||||
// },
|
{
|
||||||
{
|
data: 'pck_name',
|
||||||
data: 'pck_name',
|
className: 'text-start',
|
||||||
className: 'text-start',
|
visible: true,
|
||||||
visible: true,
|
orderable: true,
|
||||||
orderable: true,
|
searchable: true,
|
||||||
searchable: true,
|
},
|
||||||
},
|
{
|
||||||
{
|
data: 'bank_id',
|
||||||
data: 'bank_id',
|
className: 'text-start text-nowrap',
|
||||||
className: 'text-start text-nowrap',
|
visible: true,
|
||||||
visible: true,
|
orderable: true,
|
||||||
orderable: true,
|
searchable: true,
|
||||||
searchable: true,
|
render: function(data, type, row, meta) {
|
||||||
render: function(data, type, row, meta) {
|
return `
|
||||||
return `
|
|
||||||
<p class="mb-0">${row.bank_short_name} (${row.bank_code})</p>
|
<p class="mb-0">${row.bank_short_name} (${row.bank_code})</p>
|
||||||
<p class="mb-0">${row.bank_name}</p>
|
<p class="mb-0">${row.bank_name}</p>
|
||||||
`;
|
`;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
data: 'bank_acc_name',
|
||||||
|
className: 'text-nowrap',
|
||||||
|
visible: true,
|
||||||
|
orderable: true,
|
||||||
|
searchable: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
data: 'bank_acc_number',
|
||||||
|
className: 'text-center',
|
||||||
|
visible: true,
|
||||||
|
orderable: true,
|
||||||
|
searchable: true,
|
||||||
},
|
},
|
||||||
},
|
|
||||||
{
|
|
||||||
data: 'bank_acc_name',
|
|
||||||
className: 'text-nowrap',
|
|
||||||
visible: true,
|
|
||||||
orderable: true,
|
|
||||||
searchable: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
data: 'bank_acc_number',
|
|
||||||
className: 'text-center',
|
|
||||||
visible: true,
|
|
||||||
orderable: true,
|
|
||||||
searchable: true,
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
{
|
||||||
data: 'pocket_total',
|
data: 'pocket_total',
|
||||||
className: 'text-nowrap',
|
className: 'text-nowrap',
|
||||||
visible: true,
|
visible: true,
|
||||||
orderable: true,
|
orderable: true,
|
||||||
searchable: true,
|
searchable: true,
|
||||||
render: function(data, type, row, meta) {
|
render: function(data, type, row, meta) {
|
||||||
return (new Intl.NumberFormat('id-ID')).format(data);
|
return (new Intl.NumberFormat('id-ID')).format(data);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
// {
|
||||||
// {
|
// data: 'stts', // log.stts
|
||||||
// data: 'stts', // log.stts
|
// className: 'text-center',
|
||||||
// className: 'text-center',
|
// visible: true,
|
||||||
// visible: true,
|
// orderable: true,
|
||||||
// orderable: true,
|
// searchable: true,
|
||||||
// searchable: true,
|
// render: function(data, type, row, meta) {
|
||||||
// render: function(data, type, row, meta) {
|
// if (data == State.stts.unpaid) {
|
||||||
// if (data == State.stts.unpaid) {
|
// return '<span class="text-dark">Unpaid</span>';
|
||||||
// return '<span class="text-dark">Unpaid</span>';
|
// } else if (data == State.stts.paid) {
|
||||||
// } else if (data == State.stts.paid) {
|
// return '<span class="text-success">Success</span>';
|
||||||
// return '<span class="text-success">Success</span>';
|
// } else if (data == State.stts.fail) {
|
||||||
// } else if (data == State.stts.fail) {
|
// return '<span class="text-danger">Fail</span>';
|
||||||
// return '<span class="text-danger">Fail</span>';
|
// } else if (data == State.stts.pending) {
|
||||||
// } else if (data == State.stts.pending) {
|
// return '<span class="text-warning">Pending</span>';
|
||||||
// return '<span class="text-warning">Pending</span>';
|
// }
|
||||||
// }
|
// return '<span class="text-danger">Fail</span>';
|
||||||
// return '<span class="text-danger">Fail</span>';
|
// },
|
||||||
// },
|
// },
|
||||||
// },
|
{
|
||||||
{
|
data: 'pocket_is_paid', // checkpoint.is_paid
|
||||||
data: 'pocket_is_paid', // checkpoint.is_paid
|
className: 'text-center',
|
||||||
className: 'text-center',
|
visible: true,
|
||||||
visible: true,
|
orderable: true,
|
||||||
orderable: true,
|
searchable: true,
|
||||||
searchable: true,
|
render: function(data, type, row, meta) {
|
||||||
render: function(data, type, row, meta) {
|
if (data == State.checkpoint_paid.unpaid) {
|
||||||
if (data == State.checkpoint_paid.unpaid) {
|
return '<span class="text-dark">Unpaid</span>';
|
||||||
return '<span class="text-dark">Unpaid</span>';
|
} else if (data == State.checkpoint_paid.paid) {
|
||||||
} else if (data == State.checkpoint_paid.paid) {
|
return '<span class="text-success">Success</span>';
|
||||||
return '<span class="text-success">Success</span>';
|
} else if (data == State.checkpoint_paid.fail) {
|
||||||
} else if (data == State.checkpoint_paid.fail) {
|
return '<span class="text-danger">Fail</span>';
|
||||||
|
} else if (data == State.checkpoint_paid.pending) {
|
||||||
|
return '<span class="text-warning">Pending</span>';
|
||||||
|
}
|
||||||
return '<span class="text-danger">Fail</span>';
|
return '<span class="text-danger">Fail</span>';
|
||||||
} else if (data == State.checkpoint_paid.pending) {
|
},
|
||||||
return '<span class="text-warning">Pending</span>';
|
|
||||||
}
|
|
||||||
return '<span class="text-danger">Fail</span>';
|
|
||||||
},
|
},
|
||||||
},
|
{
|
||||||
{
|
data: 'tf_note',
|
||||||
data: 'tf_note',
|
className: 'text-start',
|
||||||
className: 'text-start',
|
visible: true,
|
||||||
visible: true,
|
orderable: true,
|
||||||
orderable: true,
|
searchable: true,
|
||||||
searchable: true,
|
},
|
||||||
},
|
],
|
||||||
],
|
});
|
||||||
});
|
},
|
||||||
},
|
};
|
||||||
};
|
|
||||||
|
|
||||||
const ResendPocket = {
|
const ResendPocket = {
|
||||||
activate: function () {
|
activate: function() {
|
||||||
$('#tTable').on('click', '.btnResendPocket', async function(e) {
|
$('#tTable').on('click', '.btnResendPocket', async function(e) {
|
||||||
let checkpoint_id = $(e.target).closest('tr').find('td[data-checkpoint_id]').data('checkpoint_id');
|
let checkpoint_id = $(e.target).closest('tr').find('td[data-checkpoint_id]').data('checkpoint_id');
|
||||||
console.log(checkpoint_id);
|
console.log(checkpoint_id);
|
||||||
// let resp = await ResendPocket.reqData({
|
// let resp = await ResendPocket.reqData({
|
||||||
// checkpoint_id
|
// checkpoint_id
|
||||||
// });
|
// });
|
||||||
// if (resp.type != 'success') {
|
// if (resp.type != 'success') {
|
||||||
// Helper.toast('Riwayat tidak ditemukan', 'just now', 'please try again');
|
// Helper.toast('Riwayat tidak ditemukan', 'just now', 'please try again');
|
||||||
// return false;
|
// return false;
|
||||||
// }
|
// }
|
||||||
// ResendPocket.passDataToView(resp.data);
|
// ResendPocket.passDataToView(resp.data);
|
||||||
$('#mdlResendPocket').data('checkoint_id', checkpoint_id);
|
$('#mdlResendPocket').data('checkoint_id', checkpoint_id);
|
||||||
$('#mdlResendPocket').modal('show');
|
$('#mdlResendPocket').modal('show');
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#btnSubmitResendPocket').on('click', async function() {
|
$('#btnSubmitResendPocket').on('click', async function() {
|
||||||
let data = ResendPocket.getData();
|
let data = ResendPocket.getData();
|
||||||
let isValid = ResendPocket.checkData(data, true);
|
let isValid = ResendPocket.checkData(data, true);
|
||||||
if (!isValid) return false;
|
if (!isValid) return false;
|
||||||
let submitItems = await ResendPocket.submitResendPocket(data);
|
let submitItems = await ResendPocket.submitResendPocket(data);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getData: function() {
|
getData: function() {
|
||||||
let data = {};
|
let data = {};
|
||||||
|
|
||||||
data.ord_checkpoint_id = $('#mdlResendPocket').data('checkoint_id');
|
data.ord_checkpoint_id = $('#mdlResendPocket').data('checkoint_id');
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
},
|
},
|
||||||
checkData: function(data, isAlert = false) {
|
checkData: function(data, isAlert = false) {
|
||||||
if (!data.ord_checkpoint_id) {
|
if (!data.ord_checkpoint_id) {
|
||||||
if (isAlert) Helper.toast('Warning', 'just now', 'Riwayat transfer tidak valid');
|
if (isAlert) Helper.toast('Warning', 'just now', 'Riwayat transfer tidak valid');
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
},
|
|
||||||
submitResendPocket: async function(data) {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
if (typeof $('#btnSubmitResendPocket').attr('disabed') != 'undefined') {
|
|
||||||
resolve({
|
|
||||||
type: 'fail'
|
|
||||||
});
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$('#btnSubmitResendPocket').attr('disabed', true);
|
return true;
|
||||||
$('#btnSubmitResendPocketSpinner').removeClass('d-none');
|
},
|
||||||
$.ajax({
|
submitResendPocket: async function(data) {
|
||||||
url: "{{ route('api_finance_resend_pocket') }}",
|
return new Promise((resolve, reject) => {
|
||||||
method: 'POST',
|
if (typeof $('#btnSubmitResendPocket').attr('disabed') != 'undefined') {
|
||||||
crossDomain: true,
|
|
||||||
processData: true,
|
|
||||||
headers: {
|
|
||||||
'x-csrf-token': $('meta[name="csrf-token"]').attr('content'),
|
|
||||||
'x-api-key': Helper.getCookie('_trtk'),
|
|
||||||
},
|
|
||||||
data: data,
|
|
||||||
success: (data, textStatus, jqXHR) => {
|
|
||||||
$('#btnSubmitResendPocket').removeAttr('disabed');
|
|
||||||
$('#btnSubmitResendPocketSpinner').addClass('d-none');
|
|
||||||
if (data.meta.type != 'success') {
|
|
||||||
resolve({
|
|
||||||
type: 'fail'
|
|
||||||
});
|
|
||||||
Helper.toast('Warning', 'just now', data.meta.message);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
Helper.toast('Success', 'just now', 'success transfer ulang');
|
|
||||||
$('#mdlResendPocket').modal('hide');
|
|
||||||
DTable.reload();
|
|
||||||
resolve({
|
resolve({
|
||||||
type: 'success'
|
type: 'fail'
|
||||||
});
|
|
||||||
},
|
|
||||||
error: (jqXHR, textStatus, error) => {
|
|
||||||
$('#btnSubmitResendPocket').removeAttr('disabed');
|
|
||||||
$('#btnSubmitResendPocketSpinner').addClass('d-none');
|
|
||||||
if (jqXHR.status >= 500) {
|
|
||||||
Helper.toast('Error', 'just now', 'please try again');
|
|
||||||
} else {
|
|
||||||
Helper.toast('Error', 'just now', jqXHR.responseJSON.meta
|
|
||||||
.message);
|
|
||||||
}
|
|
||||||
resolve({
|
|
||||||
type: 'error'
|
|
||||||
});
|
});
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
})
|
$('#btnSubmitResendPocket').attr('disabed', true);
|
||||||
});
|
$('#btnSubmitResendPocketSpinner').removeClass('d-none');
|
||||||
},
|
$.ajax({
|
||||||
}
|
url: "{{ route('api_finance_resend_pocket') }}",
|
||||||
|
method: 'POST',
|
||||||
|
crossDomain: true,
|
||||||
|
processData: true,
|
||||||
|
headers: {
|
||||||
|
'x-csrf-token': $('meta[name="csrf-token"]').attr('content'),
|
||||||
|
'x-api-key': Helper.getCookie('_trtk'),
|
||||||
|
},
|
||||||
|
data: data,
|
||||||
|
success: (data, textStatus, jqXHR) => {
|
||||||
|
$('#btnSubmitResendPocket').removeAttr('disabed');
|
||||||
|
$('#btnSubmitResendPocketSpinner').addClass('d-none');
|
||||||
|
if (data.meta.type != 'success') {
|
||||||
|
resolve({
|
||||||
|
type: 'fail'
|
||||||
|
});
|
||||||
|
Helper.toast('Warning', 'just now', data.meta.message);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
Helper.toast('Success', 'just now', 'success transfer ulang');
|
||||||
|
$('#mdlResendPocket').modal('hide');
|
||||||
|
DTable.reload();
|
||||||
|
resolve({
|
||||||
|
type: 'success'
|
||||||
|
});
|
||||||
|
},
|
||||||
|
error: (jqXHR, textStatus, error) => {
|
||||||
|
$('#btnSubmitResendPocket').removeAttr('disabed');
|
||||||
|
$('#btnSubmitResendPocketSpinner').addClass('d-none');
|
||||||
|
if (jqXHR.status >= 500) {
|
||||||
|
Helper.toast('Error', 'just now', 'please try again');
|
||||||
|
} else {
|
||||||
|
Helper.toast('Error', 'just now', jqXHR.responseJSON.meta
|
||||||
|
.message);
|
||||||
|
}
|
||||||
|
resolve({
|
||||||
|
type: 'error'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
Wrapper.activate();
|
Wrapper.activate();
|
||||||
</script>
|
</script>
|
||||||
@endsection
|
@endsection
|
||||||
@ -18,26 +18,26 @@
|
|||||||
@if ($user_role === \App\Models\Users::ROLE_ADMIN || $user_role === \App\Models\Users::ROLE_VENDOR || $user_role === \App\Models\Users::ROLE_CLIENT_ADMIN || $user_role === \App\Models\Users::ROLE_SPECIAL_TRACKING)
|
@if ($user_role === \App\Models\Users::ROLE_ADMIN || $user_role === \App\Models\Users::ROLE_VENDOR || $user_role === \App\Models\Users::ROLE_CLIENT_ADMIN || $user_role === \App\Models\Users::ROLE_SPECIAL_TRACKING)
|
||||||
<li class="nav-item {{ Request::segment(1) == 'dashboard' ? 'active' : '' }}">
|
<li class="nav-item {{ Request::segment(1) == 'dashboard' ? 'active' : '' }}">
|
||||||
<a class="nav-link d-flex align-items-center text-capitalize" aria-current="page" href="{{ route('view_dashboard') }}">
|
<a class="nav-link d-flex align-items-center text-capitalize" aria-current="page" href="{{ route('view_dashboard') }}">
|
||||||
Beranda
|
Dashboard
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
@endif
|
@endif
|
||||||
@if ($user_role === \App\Models\Users::ROLE_VENDOR)
|
@if ($user_role === \App\Models\Users::ROLE_VENDOR)
|
||||||
{{-- <li class="nav-item {{ Request::path() == 'user/vendor/transactions' || Request::path() == 'user/vendor/transactions/newOrder' ? 'active' : '' }}">
|
{{-- <li class="nav-item {{ Request::path() == 'user/vendor/transactions' || Request::path() == 'user/vendor/transactions/newOrder' ? 'active' : '' }}">
|
||||||
<a class="nav-link d-flex align-items-center text-capitalize" aria-current="page" href="{{ url('user/vendor/transactions/newOrder') }}">
|
<a class="nav-link d-flex align-items-center text-capitalize" aria-current="page" href="{{ url('user/vendor/transactions/newOrder') }}">
|
||||||
Transaksi
|
Transaction
|
||||||
</a>
|
</a>
|
||||||
</li> --}}
|
</li> --}}
|
||||||
<li class="nav-item {{ Request::path() == 'user/vendor/transactions' || Request::path() == 'transactions/add/special' ? 'active' : '' }}">
|
<li class="nav-item {{ Request::path() == 'user/vendor/transactions' || Request::path() == 'transactions/add/special' ? 'active' : '' }}">
|
||||||
<a class="nav-link d-flex align-items-center text-capitalize" aria-current="page" href="{{ url('user/vendor/transactions') }}">
|
<a class="nav-link d-flex align-items-center text-capitalize" aria-current="page" href="{{ url('user/vendor/transactions') }}">
|
||||||
Transaksi
|
Transaction
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
@endif
|
@endif
|
||||||
@if ($user_role === \App\Models\Users::ROLE_VENDOR)
|
@if ($user_role === \App\Models\Users::ROLE_VENDOR)
|
||||||
<li class="nav-item {{ Request::segment(1) == 'zone' ? 'active' : '' }}">
|
<li class="nav-item {{ Request::segment(1) == 'zone' ? 'active' : '' }}">
|
||||||
<a class="nav-link d-flex align-items-center text-capitalize" aria-current="page" href="{{ route('view_zone') }}">
|
<a class="nav-link d-flex align-items-center text-capitalize" aria-current="page" href="{{ route('view_zone') }}">
|
||||||
Zona
|
Zone
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
@endif
|
@endif
|
||||||
@ -52,27 +52,22 @@
|
|||||||
@if ($user_role === \App\Models\Users::ROLE_ADMIN)
|
@if ($user_role === \App\Models\Users::ROLE_ADMIN)
|
||||||
<li class="nav-item {{ Request::segment(1) == 'transactions' ? 'active' : '' }}">
|
<li class="nav-item {{ Request::segment(1) == 'transactions' ? 'active' : '' }}">
|
||||||
<a class="nav-link d-flex align-items-center text-capitalize" aria-current="page" href="{{ route('view_transactions') }}">
|
<a class="nav-link d-flex align-items-center text-capitalize" aria-current="page" href="{{ route('view_transactions') }}">
|
||||||
Transaksi
|
Job
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item {{ Request::segment(1) == 'clients' ? 'active' : '' }}">
|
<li class="nav-item {{ Request::segment(1) == 'clients' ? 'active' : '' }}">
|
||||||
<a class="nav-link d-flex align-items-center text-capitalize" aria-current="page" href="{{ route('view_clients') }}">
|
<a class="nav-link d-flex align-items-center text-capitalize" aria-current="page" href="{{ route('view_clients') }}">
|
||||||
Perusahaan
|
Company
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item {{ Request::segment(1) == 'zone' ? 'active' : '' }}">
|
<li class="nav-item {{ Request::segment(1) == 'zone' ? 'active' : '' }}">
|
||||||
<a class="nav-link d-flex align-items-center text-capitalize" aria-current="page" href="{{ route('view_zone') }}">
|
<a class="nav-link d-flex align-items-center text-capitalize" aria-current="page" href="{{ route('view_zone') }}">
|
||||||
Zona
|
Zone
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item {{ Request::segment(1) == 'users' ? 'active' : '' }}">
|
|
||||||
<a class="nav-link d-flex align-items-center text-capitalize" aria-current="page" href="{{ route('view_users') }}">
|
|
||||||
Pengguna
|
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item dropdown {{ Request::segment(1) == 'config' ? 'active' : '' }}">
|
<li class="nav-item dropdown {{ Request::segment(1) == 'config' ? 'active' : '' }}">
|
||||||
<a class="nav-link dropdown-toggle" href="#" id="dropdownConfig" role="button" data-bs-toggle="dropdown" aria-expanded="false">
|
<a class="nav-link dropdown-toggle" href="#" id="dropdownConfig" role="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||||
Konfigurasi
|
Configuration
|
||||||
</a>
|
</a>
|
||||||
<ul class="dropdown-menu" style="right: 0; left: auto;" aria-labelledby="dropdownConfig">
|
<ul class="dropdown-menu" style="right: 0; left: auto;" aria-labelledby="dropdownConfig">
|
||||||
{{-- <li>
|
{{-- <li>
|
||||||
@ -114,15 +109,20 @@
|
|||||||
{{-- @if ($user_role === \App\Models\Users::ROLE_ADMIN) --}}
|
{{-- @if ($user_role === \App\Models\Users::ROLE_ADMIN) --}}
|
||||||
<li class="nav-item {{ Request::segment(1) == 'drivers' ? 'active' : '' }}">
|
<li class="nav-item {{ Request::segment(1) == 'drivers' ? 'active' : '' }}">
|
||||||
<a class="nav-link d-flex align-items-center text-capitalize" aria-current="page" href="{{ route('view_drivers') }}">
|
<a class="nav-link d-flex align-items-center text-capitalize" aria-current="page" href="{{ route('view_drivers') }}">
|
||||||
Pengemudi
|
Driver
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item {{ Request::segment(1) == 'vehicles' ? 'active' : '' }}">
|
<li class="nav-item {{ Request::segment(1) == 'vehicles' ? 'active' : '' }}">
|
||||||
<a class="nav-link d-flex align-items-center text-capitalize" aria-current="page" href="{{ route('view_vehicles') }}">
|
<a class="nav-link d-flex align-items-center text-capitalize" aria-current="page" href="{{ route('view_vehicles') }}">
|
||||||
Kendaraan
|
Vehicle
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
@endif
|
@endif
|
||||||
|
<li class="nav-item {{ Request::segment(1) == 'users' ? 'active' : '' }}">
|
||||||
|
<a class="nav-link d-flex align-items-center text-capitalize" aria-current="page" href="{{ route('view_users') }}">
|
||||||
|
User
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
{{-- only admin and client --}}
|
{{-- only admin and client --}}
|
||||||
{{-- @if ($user_role === \App\Models\Users::ROLE_ADMIN || $user_role === \App\Models\Users::ROLE_CLIENT_ADMIN)
|
{{-- @if ($user_role === \App\Models\Users::ROLE_ADMIN || $user_role === \App\Models\Users::ROLE_CLIENT_ADMIN)
|
||||||
@ -137,7 +137,7 @@
|
|||||||
@if ($user_role === \App\Models\Users::ROLE_CLIENT_ADMIN)
|
@if ($user_role === \App\Models\Users::ROLE_CLIENT_ADMIN)
|
||||||
<li class="nav-item {{ Request::path() == 'user/clients/transactions' || Request::path() == 'user/clients/transactions/addNew' || Request::path() == 'user/clients/transactions/view' ? 'active' : '' }}">
|
<li class="nav-item {{ Request::path() == 'user/clients/transactions' || Request::path() == 'user/clients/transactions/addNew' || Request::path() == 'user/clients/transactions/view' ? 'active' : '' }}">
|
||||||
<a class="nav-link d-flex align-items-center text-capitalize" aria-current="page" href="{{ route('view_user_client_transaction') }}">
|
<a class="nav-link d-flex align-items-center text-capitalize" aria-current="page" href="{{ route('view_user_client_transaction') }}">
|
||||||
Transaksi
|
Transaction
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{{-- <li class="nav-item {{ Request::segment(1) == 'zone' ? 'active' : '' }}">
|
{{-- <li class="nav-item {{ Request::segment(1) == 'zone' ? 'active' : '' }}">
|
||||||
@ -167,7 +167,7 @@
|
|||||||
@if ($user_role === \App\Models\Users::ROLE_FINANCE)
|
@if ($user_role === \App\Models\Users::ROLE_FINANCE)
|
||||||
<li class="nav-item {{ Request::segment(1) == 'dashboard' ? 'active' : '' }}">
|
<li class="nav-item {{ Request::segment(1) == 'dashboard' ? 'active' : '' }}">
|
||||||
<a class="nav-link d-flex align-items-center text-capitalize" aria-current="page" href="#">
|
<a class="nav-link d-flex align-items-center text-capitalize" aria-current="page" href="#">
|
||||||
Beranda
|
Dashboard
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item {{ Request::segment(3) == 'ledgerBalanceList' ? 'active' : '' }}">
|
<li class="nav-item {{ Request::segment(3) == 'ledgerBalanceList' ? 'active' : '' }}">
|
||||||
@ -237,22 +237,10 @@
|
|||||||
<div class="col-auto">
|
<div class="col-auto">
|
||||||
<p class="text-bold mb-0">FLEET MANAGER</p>
|
<p class="text-bold mb-0">FLEET MANAGER</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-5 d-flex align-items-center">
|
{{-- <div class="col-5 d-flex align-items-center">
|
||||||
<span class="me-2">Perusahaan</span>
|
<span class="me-2">Company</span>
|
||||||
<select name="filter-company" class="select2 form-control" id="filter-company" style="width:100%;">
|
<select name="filter-company" class="select2 form-control" id="filter-company" style="width:100%;">
|
||||||
<option value="all">Semua Perusahaan</option>
|
<option value="all">Semua Company</option>
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
{{-- <div class="col-2 d-flex align-items-center">
|
|
||||||
<span class="me-2">Divisi</span>
|
|
||||||
<select name="" class="select2 form-control" id="">
|
|
||||||
<option value="">Semua Divisi</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
<div class="col-2 d-flex align-items-center">
|
|
||||||
<span class="me-2">Grup</span>
|
|
||||||
<select name="" class="select2 form-control" id="">
|
|
||||||
<option value="">Semua Grup</option>
|
|
||||||
</select>
|
</select>
|
||||||
</div> --}}
|
</div> --}}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -18,22 +18,22 @@ use App\Http\Controllers\Api\AuthController;
|
|||||||
// Route::middleware('auth:api')->get('/user', function (Request $request) {
|
// Route::middleware('auth:api')->get('/user', function (Request $request) {
|
||||||
// return $request->user();
|
// return $request->user();
|
||||||
// });
|
// });
|
||||||
Route::prefix("gps")->group(function () {
|
// Route::prefix("gps")->group(function () {
|
||||||
Route::post("/v1/dummy/haversineGreatCircleDistance", "DummyController@api_haversineGreatCircleDistance");
|
Route::post("/v1/dummy/haversineGreatCircleDistance", "DummyController@api_haversineGreatCircleDistance");
|
||||||
Route::post("/v1/dummy/addBatchDummyTracks", "DummyController@api_addBatchDummyTracks");
|
Route::post("/v1/dummy/addBatchDummyTracks", "DummyController@api_addBatchDummyTracks");
|
||||||
Route::get("/v1/dummy/getTracksBySeconds", "DummyController@api_getTracksBySeconds");
|
Route::get("/v1/dummy/getTracksBySeconds", "DummyController@api_getTracksBySeconds");
|
||||||
Route::post("/v1/dummy/addDummyHub", "DummyController@api_addDummyHub");
|
Route::post("/v1/dummy/addDummyHub", "DummyController@api_addDummyHub");
|
||||||
Route::post("/v1/dummy/nearestHub", "DummyController@api_nearestHub");
|
Route::post("/v1/dummy/nearestHub", "DummyController@api_nearestHub");
|
||||||
|
|
||||||
Route::post("/v1/login", "AuthController@api_login")->name("api_login");
|
Route::post("/v1/login", "AuthController@api_login")->name("api_login");
|
||||||
Route::post("/v1/logout", "AuthController@api_logout")->name("api_logout");
|
Route::post("/v1/logout", "AuthController@api_logout")->name("api_logout");
|
||||||
// Route::post('/v1/profile', 'AuthController@api_profile')->name('api_profile');
|
// Route::post('/v1/profile', 'AuthController@api_profile')->name('api_profile');
|
||||||
|
|
||||||
Route::post("/v1/inject/add_gps_zones_v1", "InjectController@add_gps_zones_v1");
|
Route::post("/v1/inject/add_gps_zones_v1", "InjectController@add_gps_zones_v1");
|
||||||
Route::post("/v1/inject/add_vhc_tracks_v1", "InjectController@add_vhc_tracks_v1");
|
Route::post("/v1/inject/add_vhc_tracks_v1", "InjectController@add_vhc_tracks_v1");
|
||||||
Route::post("/v1/inject/add_conf_rate_v1", "InjectController@add_conf_rate_v1");
|
Route::post("/v1/inject/add_conf_rate_v1", "InjectController@add_conf_rate_v1");
|
||||||
|
|
||||||
Route::post("/v1/storage/save_photos", "StorageController@save_photos")->name("api_storage_save_photos");
|
Route::post("/v1/storage/save_photos", "StorageController@save_photos")->name("api_storage_save_photos");
|
||||||
|
|
||||||
Route::post("auth/login", [AuthController::class, "login"]);
|
Route::post("auth/login", [AuthController::class, "login"]);
|
||||||
});
|
// });
|
||||||
|
|||||||
1207
routes/web.php
1207
routes/web.php
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user