mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange.git
synced 2026-08-19 04:14:04 +00:00
fix conflit with master
This commit is contained in:
@@ -7,6 +7,22 @@ use Illuminate\Database\Eloquent\Model;
|
||||
class Booking extends Model
|
||||
{
|
||||
// protected $guarded = [];
|
||||
protected $hidden = array('user_id',
|
||||
"rate_id",
|
||||
"rmb_book_amount",
|
||||
"rmb_book_pay_method",
|
||||
"rmb_book_account_name",
|
||||
"rmb_book_bank_name",
|
||||
"rmb_book_acc_no",
|
||||
"rmb_book_bank_branch",
|
||||
"usd_book_amount",
|
||||
"usd_book_pay_method",
|
||||
"usd_book_company_name",
|
||||
"usd_book_company_address",
|
||||
"usd_book_swift_code",
|
||||
"usd_book_cnap",
|
||||
"usd_book_bank_branch");
|
||||
|
||||
protected $fillable = ['term', 'rate_id', 'user_id', 'amount', 'account_name', 'account_num', 'bank_name',
|
||||
'bank_branch', 'company_name'];
|
||||
|
||||
|
||||
@@ -17,135 +17,179 @@ use DateTime;
|
||||
class BookingController extends Controller
|
||||
{
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$booking = Booking::where('user_id',Auth::user()->id)->where('id', $id)->first();
|
||||
public function index(){
|
||||
$bookings = Booking::select('id', 'created_at', 'status', 'rate', 'amount', 'bia', 'verification_status')
|
||||
->where('user_id',Auth::user()->id)
|
||||
->get();
|
||||
|
||||
// reformat to fit frontend structure
|
||||
foreach ($bookings as $booking) {
|
||||
// set timeout
|
||||
$date1 = new DateTime($booking->created_at);
|
||||
$date2 = new DateTime();
|
||||
$difference_in_seconds = ($date1->format('U') + 600) - ($date2->format('U'));
|
||||
$booking->timeout = $difference_in_seconds;
|
||||
|
||||
$date1 = new DateTime($booking->created_at);
|
||||
$date2 = new DateTime();
|
||||
$difference_in_seconds = ($date1->format('U') + 600) - ($date2->format('U'));
|
||||
// TODO : you can make it better
|
||||
if($difference_in_seconds < 0 ){
|
||||
$booking->timeout = 0;
|
||||
}
|
||||
|
||||
|
||||
// TODO : transfer_amount change name to bia
|
||||
$booking->transfer_amount = $booking->bia;
|
||||
|
||||
$booking->track_status = "(". $booking->status ."/6)";
|
||||
|
||||
$booking->timeout = $difference_in_seconds;
|
||||
switch ($booking->status) {
|
||||
case 1:
|
||||
$booking->status_desc = "Order in progress";
|
||||
case 2:
|
||||
$booking->status_desc = "Waiting for payment";
|
||||
case 3:
|
||||
$booking->status_desc = "Waiting verification";
|
||||
case 4:
|
||||
$booking->status_desc = "Processing transfer";
|
||||
case 5:
|
||||
$booking->status_desc = "Transfer Complete, please upload your PO";
|
||||
case 6:
|
||||
$booking->status_desc = "Processing invoice";
|
||||
default:
|
||||
$booking->status_desc = "";
|
||||
}
|
||||
}
|
||||
|
||||
if (!$booking){
|
||||
return response()->json(['success'=>false, 'message'=>'not found'], 404);
|
||||
}
|
||||
return $booking;
|
||||
}
|
||||
return $bookings;
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$rates = Rate::orderby('updated_at','desc')->first();
|
||||
$term = $request->input('term');
|
||||
$amount = $request->input("amount");
|
||||
$user = Auth::user();
|
||||
$rate = 1; // default rate to 1
|
||||
public function show($id)
|
||||
{
|
||||
$booking = Booking::where('user_id',Auth::user()->id)->where('id', $id)->first();
|
||||
|
||||
switch ($term) {
|
||||
case "x1_cash":
|
||||
$rate = $rates->x1_cash;
|
||||
break;
|
||||
case "x1_cheque":
|
||||
$rate = $rates->x1_cheque;
|
||||
break;
|
||||
case "x1_ba":
|
||||
$rate = $rates->x1_ba;
|
||||
break;
|
||||
case "x2_cash":
|
||||
$rate = $rates->x2_cash;
|
||||
break;
|
||||
case "x2_cheque":
|
||||
$rate = $rates->x2_cheque;
|
||||
break;
|
||||
case "x2_ba":
|
||||
$rate = $rates->x2_ba;
|
||||
break;
|
||||
default:
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => 'Invalid input',
|
||||
], 422);
|
||||
break;
|
||||
}
|
||||
|
||||
// Service charge (RMB) : if amount higher than 10,000, no service charge. if amount lower than 10,000, 20.00 service charge
|
||||
if ($amount >= 10000 && ($term == 'x2_cash' || $term = 'x2_cheque' || $term = 'x2_ba')) {
|
||||
$svcharge = 0;
|
||||
} else {
|
||||
$svcharge = 20.00;
|
||||
}
|
||||
$date1 = new DateTime($booking->created_at);
|
||||
$date2 = new DateTime();
|
||||
$difference_in_seconds = ($date1->format('U') + 600) - ($date2->format('U'));
|
||||
|
||||
// initial rmb to myr amount
|
||||
$RMBinMYR = (($amount + $svcharge) / $rate);
|
||||
$booking->timeout = $difference_in_seconds;
|
||||
|
||||
// TODO : Should be remove this ?
|
||||
// gst 0%
|
||||
$gst = 0 * $RMBinMYR;
|
||||
if (!$booking){
|
||||
return response()->json(['success'=>false, 'message'=>'not found'], 404);
|
||||
}
|
||||
return $booking;
|
||||
}
|
||||
|
||||
// Sales tax : 10 %
|
||||
$sales_tax = 0.10 * $RMBinMYR;
|
||||
public function store(Request $request)
|
||||
{
|
||||
$rates = Rate::orderby('updated_at','desc')->first();
|
||||
$term = $request->input('term');
|
||||
$amount = $request->input("amount");
|
||||
$user = Auth::user();
|
||||
$rate = 1; // default rate to 1
|
||||
|
||||
// Billing fees : 1.5%
|
||||
$billing = 0.015 * $RMBinMYR;
|
||||
switch ($term) {
|
||||
case "x1_cash":
|
||||
$rate = $rates->x1_cash;
|
||||
break;
|
||||
case "x1_cheque":
|
||||
$rate = $rates->x1_cheque;
|
||||
break;
|
||||
case "x1_ba":
|
||||
$rate = $rates->x1_ba;
|
||||
break;
|
||||
case "x2_cash":
|
||||
$rate = $rates->x2_cash;
|
||||
break;
|
||||
case "x2_cheque":
|
||||
$rate = $rates->x2_cheque;
|
||||
break;
|
||||
case "x2_ba":
|
||||
$rate = $rates->x2_ba;
|
||||
break;
|
||||
default:
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => 'Invalid input',
|
||||
], 422);
|
||||
break;
|
||||
}
|
||||
|
||||
// Service charge (RMB) : if amount higher than 10,000, no service charge. if amount lower than 10,000, 20.00 service charge
|
||||
if ($amount >= 10000 && ($term == 'x2_cash' || $term = 'x2_cheque' || $term = 'x2_ba')) {
|
||||
$svcharge = 0;
|
||||
} else {
|
||||
$svcharge = 20.00;
|
||||
}
|
||||
|
||||
// Bank in amount
|
||||
$bia = round($RMBinMYR + $gst + $sales_tax + $billing, 2);
|
||||
// initial rmb to myr amount
|
||||
$RMBinMYR = (($amount + $svcharge) / $rate);
|
||||
|
||||
$booking = new Booking();
|
||||
$booking->account_name = $request->input('account_name');
|
||||
$booking->account_num = $request->input('account_num');
|
||||
$booking->bank_name = $request->input('bank_name');
|
||||
$booking->bank_branch = $request->input('bank_branch');
|
||||
$booking->amount = $request->input('amount');
|
||||
$booking->term = $term;
|
||||
$booking->rate_id = $rates->id;
|
||||
$booking->rmb_book_amount = $request->input('amount');
|
||||
$booking->bia = $bia;
|
||||
// $booking->user_id = $user->id;
|
||||
$booking->user()->associate($user);
|
||||
|
||||
// TODO : Should be remove this ?
|
||||
// gst 0%
|
||||
$gst = 0 * $RMBinMYR;
|
||||
|
||||
// The test failed due to ->save() before filling up the information at below
|
||||
// Sales tax : 10 %
|
||||
$sales_tax = 0.10 * $RMBinMYR;
|
||||
|
||||
// TODO : handle RMB, MYR and USD (we can use exchange type: USDtoMYR, RMBtoMYR vise versa to switch case)
|
||||
// $booking->rmb_book_pay_method = $request->input('payment_method');
|
||||
// $booking->rmb_book_account_name = $request->input('rmb_book_account_name');
|
||||
// $booking->rmb_book_acc_no = $request->input('rmb_book_acc_no');
|
||||
// $booking->rmb_book_bank_branch = $request->input('rmb_book_bank_branch');
|
||||
// $booking->company_name = $request->input('company_name');
|
||||
// $booking->company_address = $request->input('company_address');
|
||||
// $booking->bank_address = $request->input('bank_address');
|
||||
// $booking->swift_code = $request->input('swift_code');
|
||||
// $booking->cnap = $request->input('cnap');
|
||||
// $booking->term = $request->input('term');
|
||||
// Billing fees : 1.5%
|
||||
$billing = 0.015 * $RMBinMYR;
|
||||
|
||||
// $booking->usd_book_amount = $request->input('usd_book_amount');
|
||||
// $booking->usd_book_pay_method = $request->input('usd_book_pay_method');
|
||||
// $booking->usd_book_company_name = $request->input('usd_book_company_name');
|
||||
// $booking->usd_book_company_address = $request->input('usd_book_company_address');
|
||||
// $booking->usd_book_swift_code = $request->input('usd_book_swift_code');
|
||||
// $booking->usd_book_cnap = $request->input('usd_book_cnap');
|
||||
// $booking->usd_book_bank_branch = $request->input('usd_book_bank_branch');
|
||||
// $booking->verification_status = $request->input('verification_status');
|
||||
$booking->save();
|
||||
return response()->json($booking, 201);
|
||||
}
|
||||
// Bank in amount
|
||||
$bia = round($RMBinMYR + $gst + $sales_tax + $billing, 2);
|
||||
|
||||
public function update(Request $request, $book_id)
|
||||
{
|
||||
$book_id = Booking::find($book_id);
|
||||
$book_id->account_name = $request->input('account_name');
|
||||
$book_id->account_num = $request->input('account_num');
|
||||
$book_id->bank_name = $request->input('bank_name');
|
||||
$book_id->bank_branch = $request->input('bank_branch');
|
||||
$book_id->company_name = $request->input('company_name');
|
||||
$book_id->company_address = $request->input('company_address');
|
||||
$book_id->bank_address = $request->input('bank_address');
|
||||
$book_id->swift_code = $request->input('swift_code');
|
||||
$book_id->cnap = $request->input('cnap');
|
||||
$book_id->save();
|
||||
$booking = new Booking();
|
||||
$booking->account_name = $request->input('account_name');
|
||||
$booking->account_num = $request->input('account_num');
|
||||
$booking->bank_name = $request->input('bank_name');
|
||||
$booking->bank_branch = $request->input('bank_branch');
|
||||
$booking->amount = $request->input('amount');
|
||||
$booking->term = $term;
|
||||
$booking->rate_id = $rates->id;
|
||||
$booking->rate = $rate;
|
||||
$booking->rmb_book_amount = $request->input('amount');
|
||||
$booking->status = 2;
|
||||
$booking->bia = $bia;
|
||||
// $booking->user_id = $user->id;
|
||||
$booking->user()->associate($user);
|
||||
|
||||
|
||||
// The test failed due to ->save() before filling up the information at below
|
||||
|
||||
// TODO : handle RMB, MYR and USD (we can use exchange type: USDtoMYR, RMBtoMYR vise versa to switch case)
|
||||
// $booking->rmb_book_pay_method = $request->input('payment_method');
|
||||
// $booking->rmb_book_account_name = $request->input('rmb_book_account_name');
|
||||
// $booking->rmb_book_acc_no = $request->input('rmb_book_acc_no');
|
||||
// $booking->rmb_book_bank_branch = $request->input('rmb_book_bank_branch');
|
||||
// $booking->company_name = $request->input('company_name');
|
||||
// $booking->company_address = $request->input('company_address');
|
||||
// $booking->bank_address = $request->input('bank_address');
|
||||
// $booking->swift_code = $request->input('swift_code');
|
||||
// $booking->cnap = $request->input('cnap');
|
||||
// $booking->term = $request->input('term');
|
||||
|
||||
// $booking->usd_book_amount = $request->input('usd_book_amount');
|
||||
// $booking->usd_book_pay_method = $request->input('usd_book_pay_method');
|
||||
// $booking->usd_book_company_name = $request->input('usd_book_company_name');
|
||||
// $booking->usd_book_company_address = $request->input('usd_book_company_address');
|
||||
// $booking->usd_book_swift_code = $request->input('usd_book_swift_code');
|
||||
// $booking->usd_book_cnap = $request->input('usd_book_cnap');
|
||||
// $booking->usd_book_bank_branch = $request->input('usd_book_bank_branch');
|
||||
// $booking->verification_status = $request->input('verification_status');
|
||||
$booking->save();
|
||||
return response()->json($booking, 201);
|
||||
}
|
||||
|
||||
public function update(Request $request, $book_id)
|
||||
{
|
||||
$book_id = Booking::find($book_id);
|
||||
$book_id->account_name = $request->input('account_name');
|
||||
$book_id->account_num = $request->input('account_num');
|
||||
$book_id->bank_name = $request->input('bank_name');
|
||||
$book_id->bank_branch = $request->input('bank_branch');
|
||||
$book_id->company_name = $request->input('company_name');
|
||||
$book_id->company_address = $request->input('company_address');
|
||||
$book_id->bank_address = $request->input('bank_address');
|
||||
$book_id->swift_code = $request->input('swift_code');
|
||||
$book_id->cnap = $request->input('cnap');
|
||||
$book_id->save();
|
||||
|
||||
return response()->json(['book_id'=>$book_id],200);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class HomeController extends Controller
|
||||
{
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the application dashboard.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return view('home');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddRateToBooking extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('bookings', function (Blueprint $table) {
|
||||
$table->double('rate')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('bookings', function (Blueprint $table) {
|
||||
$table->dropColumn('rate');
|
||||
// $table->dropColumn('reject_reason');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddStatusToBookingTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('bookings', function (Blueprint $table) {
|
||||
$table->integer('status')->default(1);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('bookings', function (Blueprint $table) {
|
||||
$table->dropColumn('status');
|
||||
// $table->dropColumn('reject_reason');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -12,13 +12,13 @@
|
||||
<tr>
|
||||
<td class="el-table_2_column_9 is-right ">Amount : </td>
|
||||
<td class="el-table_2_column_9 is-left ">
|
||||
<b> {{ booking.amount }} </b>
|
||||
<b> RMB {{ booking.amount }} </b>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="200" class="el-table_2_column_9 is-right ">Bankin Amount : </td>
|
||||
<td width="200" class="el-table_2_column_9 is-left ">
|
||||
<b> {{ booking.bankin_amount }} </b>
|
||||
<b> MYR {{ booking.bankin_amount }} </b>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -64,7 +64,7 @@
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<div align="center">
|
||||
<el-button type="primary" @click="submitUserSlip('user_slip_form')">Submit</el-button>
|
||||
<el-button type="primary" :loading="loading" @click="submitUserSlip('user_slip_form')">Submit</el-button>
|
||||
<router-link :to="{ name: 'home' }" class="small ml-auto my-auto">
|
||||
Upload Later
|
||||
</router-link>
|
||||
@@ -103,6 +103,7 @@
|
||||
return {
|
||||
status: 2,
|
||||
start: false,
|
||||
loading: false,
|
||||
dialogImageUrl: '',
|
||||
dialogVisible: false,
|
||||
booking_id: this.$route.params.id,
|
||||
@@ -157,6 +158,7 @@
|
||||
this.dialogVisible = true
|
||||
},
|
||||
submitUserSlip(formName) {
|
||||
this.loading = true
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
let newConfirmation = {
|
||||
@@ -165,6 +167,7 @@
|
||||
}
|
||||
}
|
||||
else{
|
||||
this.loading = false
|
||||
return
|
||||
}
|
||||
});
|
||||
@@ -173,12 +176,14 @@
|
||||
}
|
||||
axios.patch('/api/booking/'+ this.booking_id +'/bankslip-amount', newUserSlip)
|
||||
.then((response) => {
|
||||
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: 'Your bankinslip has been submitted, please wait admin to approve.',
|
||||
type: 'success',
|
||||
duration: 5000,
|
||||
});
|
||||
|
||||
console.log(response)
|
||||
this.$router.push({
|
||||
name: 'home'
|
||||
@@ -186,6 +191,7 @@
|
||||
|
||||
})
|
||||
.catch((error) => {
|
||||
this.loading = false
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: 'Please upload your bankin slip first.',
|
||||
|
||||
@@ -239,11 +239,11 @@
|
||||
<el-row :gutter="20">
|
||||
<div>
|
||||
<el-table :data="bookingTable">
|
||||
<el-table-column label="No." width="106">
|
||||
<el-table-column label="No." width="50">
|
||||
<el-button size="mini" @click="handleEdit(scope.$index, scope.row)">Update</el-button>
|
||||
<el-button type="text" slot-scope="scope" @click="(event) => { BookingStatus(event, scope.row.booking_no) }"> {{scope.row.booking_no}}</el-button>
|
||||
<el-button type="text" slot-scope="scope" @click="(event) => { BookingStatus(scope.row.status, scope.row.id) }"> {{scope.row.id}}</el-button>
|
||||
</el-table-column>
|
||||
<el-table-column label="Date" prop="date" width="120" sortable/>
|
||||
<el-table-column label="DateTime" prop="created_at" width="180" sortable/>
|
||||
<!-- <el-table-column label="Term" :filters="[{text: 'X1', value: 'X1'}, {text: 'X2', value: 'X2'}]" :filter-method="filterHandler">
|
||||
</el-table-column> -->
|
||||
<el-table-column label="Rate" width="74" prop="rate" />
|
||||
@@ -259,7 +259,7 @@
|
||||
<el-popover trigger="click" placement="top">
|
||||
<p>{{ scope.row.status_desc }}</p>
|
||||
<div slot="reference" class="name-wrapper">
|
||||
<el-tag size="medium">{{ scope.row.status }}</el-tag>
|
||||
<el-tag size="medium">{{ scope.row.track_status }}</el-tag>
|
||||
</div>
|
||||
</el-popover>
|
||||
</template>
|
||||
@@ -354,64 +354,70 @@
|
||||
dialogFormVisible1: false,
|
||||
formLabelWidth: '0px',
|
||||
bookingTable: [{
|
||||
date: '12/1/2018',
|
||||
booking_no: '001',
|
||||
created_at: '12/1/2018',
|
||||
id: '12',
|
||||
rate: '1.23',
|
||||
amount: 'RM 1000',
|
||||
transfer_amount: 'RMB 10000',
|
||||
status: '(1/6)',
|
||||
track_status: '(1/6)',
|
||||
status_desc: 'Waiting for payment',
|
||||
timeout: '56:00:00'
|
||||
timeout: '56:00:00',
|
||||
status: 2
|
||||
},
|
||||
{
|
||||
date: '12/1/2018',
|
||||
booking_no: '002',
|
||||
created_at: '12/1/2018',
|
||||
id: '13',
|
||||
rate: '1.23',
|
||||
amount: 'RM 1000',
|
||||
transfer_amount: 'RMB 10000',
|
||||
status: '(2/6)',
|
||||
track_status: '(2/6)',
|
||||
status_desc: 'Waiting verification',
|
||||
timeout: '56:00:00'
|
||||
timeout: '56:00:00',
|
||||
status: 3
|
||||
},
|
||||
{
|
||||
date: '12/1/2018',
|
||||
booking_no: '003',
|
||||
created_at: '12/1/2018',
|
||||
id: '14',
|
||||
rate: '1.23',
|
||||
amount: 'RM 1000',
|
||||
transfer_amount: 'RMB 10000',
|
||||
status: '(3/6)',
|
||||
track_status: '(3/6)',
|
||||
status_desc: 'Processing transfer',
|
||||
timeout: '56:00:00'
|
||||
timeout: '56:00:00',
|
||||
status: 4
|
||||
},
|
||||
{
|
||||
date: '12/1/2018',
|
||||
booking_no: '004',
|
||||
created_at: '12/1/2018',
|
||||
id: '15',
|
||||
rate: '1.23',
|
||||
amount: 'RM 1000',
|
||||
transfer_amount: 'RMB 10000',
|
||||
status: '(4/6)',
|
||||
track_status: '(4/6)',
|
||||
status_desc: 'Transfer Complete, please upload your PO',
|
||||
timeout: '56:00:00'
|
||||
timeout: '56:00:00',
|
||||
status: 5
|
||||
},
|
||||
{
|
||||
date: '12/1/2018',
|
||||
booking_no: '005',
|
||||
created_at: '12/1/2018',
|
||||
id: '16',
|
||||
rate: '1.23',
|
||||
amount: 'RM 1000',
|
||||
transfer_amount: 'RMB 10000',
|
||||
status: '(5/6)',
|
||||
track_status: '(5/6)',
|
||||
status_desc: 'Processing invoice',
|
||||
timeout: '56:00:00'
|
||||
timeout: '56:00:00',
|
||||
status: 6
|
||||
},
|
||||
{
|
||||
date: '12/1/2018',
|
||||
booking_no: '006',
|
||||
created_at: '12/1/2018',
|
||||
id: '17',
|
||||
rate: '1.23',
|
||||
amount: 'RM 1000',
|
||||
transfer_amount: 'RMB 10000',
|
||||
status: '(6/6)',
|
||||
track_status: '(6/6)',
|
||||
status_desc: 'Order Completed',
|
||||
timeout: '56:00:00'
|
||||
timeout: '56:00:00',
|
||||
status: 6
|
||||
}
|
||||
],
|
||||
bookingConfirmTable: {
|
||||
@@ -423,9 +429,30 @@
|
||||
rate: 'undefined',
|
||||
bankin_amount: 'undefined',
|
||||
china_beneficiary: 'undefined',
|
||||
status: 2
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
axios
|
||||
.get('/api/booking/')
|
||||
.then((response) => {
|
||||
console.log(response)
|
||||
this.bookingTable = response.data
|
||||
|
||||
// this.booking.amount = response.data.amount
|
||||
// this.booking.bankin_amount = response.data.bia
|
||||
// this.booking.timeout = response.data.timeout * 1000
|
||||
// this.start = true;
|
||||
//loading.close()
|
||||
}).catch((error) => {
|
||||
// console.log(error)
|
||||
// loading.close()
|
||||
// this.$router.push({
|
||||
// name: 'notfound'
|
||||
// })
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
// TODO fetch booking data on load
|
||||
formatter(row, column) {
|
||||
@@ -521,10 +548,10 @@
|
||||
return
|
||||
})
|
||||
},
|
||||
BookingStatus(index, row) {
|
||||
|
||||
BookingStatus(status, row) {
|
||||
console.log(status)
|
||||
// TODO : Get booking status from server
|
||||
this.status = 2
|
||||
this.status = status
|
||||
|
||||
switch (this.status) {
|
||||
case 1:
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-header">{{ __('Reset Password') }}</div>
|
||||
|
||||
<div class="card-body">
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<form method="POST" action="{{ route('password.email') }}">
|
||||
@csrf
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="email" class="col-md-4 col-form-label text-md-right">{{ __('E-Mail Address') }}</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="email" type="email" class="form-control{{ $errors->has('email') ? ' is-invalid' : '' }}" name="email" value="{{ old('email') }}" required>
|
||||
|
||||
@if ($errors->has('email'))
|
||||
<span class="invalid-feedback">
|
||||
<strong>{{ $errors->first('email') }}</strong>
|
||||
</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row mb-0">
|
||||
<div class="col-md-6 offset-md-4">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
{{ __('Send Password Reset Link') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,65 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-header">{{ __('Reset Password') }}</div>
|
||||
|
||||
<div class="card-body">
|
||||
<form method="POST" action="{{ route('password.request') }}">
|
||||
@csrf
|
||||
|
||||
<input type="hidden" name="token" value="{{ $token }}">
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="email" class="col-md-4 col-form-label text-md-right">{{ __('E-Mail Address') }}</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="email" type="email" class="form-control{{ $errors->has('email') ? ' is-invalid' : '' }}" name="email" value="{{ $email ?? old('email') }}" required autofocus>
|
||||
|
||||
@if ($errors->has('email'))
|
||||
<span class="invalid-feedback">
|
||||
<strong>{{ $errors->first('email') }}</strong>
|
||||
</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="password" class="col-md-4 col-form-label text-md-right">{{ __('Password') }}</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="password" type="password" class="form-control{{ $errors->has('password') ? ' is-invalid' : '' }}" name="password" required>
|
||||
|
||||
@if ($errors->has('password'))
|
||||
<span class="invalid-feedback">
|
||||
<strong>{{ $errors->first('password') }}</strong>
|
||||
</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="password-confirm" class="col-md-4 col-form-label text-md-right">{{ __('Confirm Password') }}</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="password-confirm" type="password" class="form-control" name="password_confirmation" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row mb-0">
|
||||
<div class="col-md-6 offset-md-4">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
{{ __('Reset Password') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,77 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-header">{{ __('Register') }}</div>
|
||||
|
||||
<div class="card-body">
|
||||
<form method="POST" action="{{ route('register') }}">
|
||||
@csrf
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="name" class="col-md-4 col-form-label text-md-right">{{ __('Name') }}</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="name" type="text" class="form-control{{ $errors->has('name') ? ' is-invalid' : '' }}" name="name" value="{{ old('name') }}" required autofocus>
|
||||
|
||||
@if ($errors->has('name'))
|
||||
<span class="invalid-feedback">
|
||||
<strong>{{ $errors->first('name') }}</strong>
|
||||
</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="email" class="col-md-4 col-form-label text-md-right">{{ __('E-Mail Address') }}</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="email" type="email" class="form-control{{ $errors->has('email') ? ' is-invalid' : '' }}" name="email" value="{{ old('email') }}" required>
|
||||
|
||||
@if ($errors->has('email'))
|
||||
<span class="invalid-feedback">
|
||||
<strong>{{ $errors->first('email') }}</strong>
|
||||
</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="password" class="col-md-4 col-form-label text-md-right">{{ __('Password') }}</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="password" type="password" class="form-control{{ $errors->has('password') ? ' is-invalid' : '' }}" name="password" required>
|
||||
|
||||
@if ($errors->has('password'))
|
||||
<span class="invalid-feedback">
|
||||
<strong>{{ $errors->first('password') }}</strong>
|
||||
</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="password-confirm" class="col-md-4 col-form-label text-md-right">{{ __('Confirm Password') }}</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="password-confirm" type="password" class="form-control" name="password_confirmation" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row mb-0">
|
||||
<div class="col-md-6 offset-md-4">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
{{ __('Register') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,23 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-header">Dashboard</div>
|
||||
|
||||
<div class="card-body">
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
You are logged in!
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,75 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ app()->getLocale() }}">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<!-- CSRF Token -->
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
|
||||
<title>{{ config('app.name', 'Laravel') }}</title>
|
||||
|
||||
<!-- Scripts -->
|
||||
<script src="{{ asset('js/app.js') }}" defer></script>
|
||||
|
||||
<!-- Fonts -->
|
||||
<link rel="dns-prefetch" href="https://fonts.gstatic.com">
|
||||
<link href="https://fonts.googleapis.com/css?family=Raleway:300,400,600" rel="stylesheet" type="text/css">
|
||||
|
||||
<!-- Styles -->
|
||||
<link href="{{ asset('css/app.css') }}" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app">
|
||||
<nav class="navbar navbar-expand-md navbar-light navbar-laravel">
|
||||
<div class="container">
|
||||
<a class="navbar-brand" href="{{ url('/') }}">
|
||||
{{ config('app.name', 'Laravel') }}
|
||||
</a>
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
|
||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||
<!-- Left Side Of Navbar -->
|
||||
<ul class="navbar-nav mr-auto">
|
||||
|
||||
</ul>
|
||||
|
||||
<!-- Right Side Of Navbar -->
|
||||
<ul class="navbar-nav ml-auto">
|
||||
<!-- Authentication Links -->
|
||||
@guest
|
||||
<li><a class="nav-link" href="{{ route('login') }}">{{ __('Login') }}</a></li>
|
||||
<li><a class="nav-link" href="{{ route('register') }}">{{ __('Register') }}</a></li>
|
||||
@else
|
||||
<li class="nav-item dropdown">
|
||||
<a id="navbarDropdown" class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" v-pre>
|
||||
{{ Auth::user()->name }} <span class="caret"></span>
|
||||
</a>
|
||||
|
||||
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
|
||||
<a class="dropdown-item" href="{{ route('logout') }}"
|
||||
onclick="event.preventDefault();
|
||||
document.getElementById('logout-form').submit();">
|
||||
{{ __('Logout') }}
|
||||
</a>
|
||||
|
||||
<form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
|
||||
@csrf
|
||||
</form>
|
||||
</div>
|
||||
</li>
|
||||
@endguest
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<main class="py-4">
|
||||
@yield('content')
|
||||
</main>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
+8
-8
@@ -26,10 +26,9 @@ Route::middleware('auth:api')->get('/user', function (Request $request) {
|
||||
// return $request->user();
|
||||
//});
|
||||
Route::group(['middleware' => 'auth:api'], function () {
|
||||
Route::post('logout', 'Auth\LoginController@logout');
|
||||
|
||||
Route::post('logout', 'Auth\LoginController@logout');
|
||||
|
||||
/*Route for the booking */
|
||||
Route::get('/booking', 'BookingController@index');
|
||||
Route::get('/booking/{book_id}', 'BookingController@show');
|
||||
Route::put('/booking/{book_id}', 'BookingController@update');
|
||||
Route::delete('/booking/{book_id}', 'BookingController@delete');
|
||||
@@ -41,7 +40,8 @@ Route::group(['middleware' => 'auth:api'], function () {
|
||||
Route::patch('/booking/{id}/bankslip-amount', 'BookingController@updateBankSlipAmount');
|
||||
Route::post('booking/{book_id}/reject-bank-slip','BookingController@rejectBankSlip');
|
||||
Route::post('booking/{book_id}/approve-bank-slip','BookingController@approveBankSlip');
|
||||
Route::post('booking/{book_id}/cancel', 'BookingController@cancel');
|
||||
Route::post('booking/{book_id}/cancel', 'BookingController@cancel');
|
||||
Route::get('/booking', 'BookingController@index');
|
||||
Route::get('/user', 'UserController@show');
|
||||
});
|
||||
|
||||
@@ -50,10 +50,10 @@ Route::group(['middleware' => 'auth:api'], function () {
|
||||
|
||||
|
||||
Route::group(['middleware' => 'guest:api'], function () {
|
||||
Route::post('login', 'Auth\LoginController@login');
|
||||
Route::post('register', 'Auth\RegisterController@create');
|
||||
Route::post('password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail');
|
||||
Route::post('password/reset', 'Auth\ResetPasswordController@reset');
|
||||
Route::post('login', 'Auth\LoginController@login')->name('login');
|
||||
Route::post('register', 'Auth\RegisterController@create');
|
||||
Route::post('password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail');
|
||||
Route::post('password/reset', 'Auth\ResetPasswordController@reset');
|
||||
|
||||
Route::post('oauth/{driver}', 'Auth\OAuthController@redirectToProvider');
|
||||
Route::get('oauth/{driver}/callback', 'Auth\OAuthController@handleProviderCallback')->name('oauth.callback');
|
||||
|
||||
+4
-1
@@ -10,8 +10,11 @@
|
||||
| contains the "web" middleware group. Now create something great!
|
||||
|
|
||||
*/
|
||||
|
||||
Route::get('/', 'WelcomeController@index');
|
||||
Route::get('password/reset/{token}', 'Auth\ResetPasswordController@showResetForm')->name('password.request');
|
||||
Route::post('password/reset', 'Auth\ResetPasswordController@postReset')->name('password.reset');
|
||||
Route::get('{path}', 'WelcomeController@index')->where('path', '(.*)');
|
||||
|
||||
Auth::routes();
|
||||
|
||||
//Route::get('/home', 'WelcomeController@index')->name('home');
|
||||
|
||||
+2
@@ -19,6 +19,7 @@ return array(
|
||||
'App\\Http\\Controllers\\BookingController' => $baseDir . '/app/Http/Controllers/BookingController.php',
|
||||
'App\\Http\\Controllers\\ChinaBankSlipController' => $baseDir . '/app/Http/Controllers/ChinaBankSlipController.php',
|
||||
'App\\Http\\Controllers\\Controller' => $baseDir . '/app/Http/Controllers/Controller.php',
|
||||
'App\\Http\\Controllers\\HomeController' => $baseDir . '/app/Http/Controllers/HomeController.php',
|
||||
'App\\Http\\Controllers\\MarkingController' => $baseDir . '/app/Http/Controllers/MarkingController.php',
|
||||
'App\\Http\\Controllers\\RateController' => $baseDir . '/app/Http/Controllers/RateController.php',
|
||||
'App\\Http\\Controllers\\SettingBeneficiaryController' => $baseDir . '/app/Http/Controllers/SettingBeneficiaryController.php',
|
||||
@@ -36,6 +37,7 @@ return array(
|
||||
'App\\Http\\Middleware\\TrimStrings' => $baseDir . '/app/Http/Middleware/TrimStrings.php',
|
||||
'App\\Http\\Middleware\\TrustProxies' => $baseDir . '/app/Http/Middleware/TrustProxies.php',
|
||||
'App\\Http\\Middleware\\VerifyCsrfToken' => $baseDir . '/app/Http/Middleware/VerifyCsrfToken.php',
|
||||
'App\\Invoice' => $baseDir . '/app/Invoice.php',
|
||||
'App\\Marking' => $baseDir . '/app/Marking.php',
|
||||
'App\\Notifications\\ResetPassword' => $baseDir . '/app/Notifications/ResetPassword.php',
|
||||
'App\\OAuthProvider' => $baseDir . '/app/OAuthProvider.php',
|
||||
|
||||
Vendored
+2
@@ -447,6 +447,7 @@ class ComposerStaticInit6dcfe61ea7999ade723f072fea748b5a
|
||||
'App\\Http\\Controllers\\BookingController' => __DIR__ . '/../..' . '/app/Http/Controllers/BookingController.php',
|
||||
'App\\Http\\Controllers\\ChinaBankSlipController' => __DIR__ . '/../..' . '/app/Http/Controllers/ChinaBankSlipController.php',
|
||||
'App\\Http\\Controllers\\Controller' => __DIR__ . '/../..' . '/app/Http/Controllers/Controller.php',
|
||||
'App\\Http\\Controllers\\HomeController' => __DIR__ . '/../..' . '/app/Http/Controllers/HomeController.php',
|
||||
'App\\Http\\Controllers\\MarkingController' => __DIR__ . '/../..' . '/app/Http/Controllers/MarkingController.php',
|
||||
'App\\Http\\Controllers\\RateController' => __DIR__ . '/../..' . '/app/Http/Controllers/RateController.php',
|
||||
'App\\Http\\Controllers\\SettingBeneficiaryController' => __DIR__ . '/../..' . '/app/Http/Controllers/SettingBeneficiaryController.php',
|
||||
@@ -464,6 +465,7 @@ class ComposerStaticInit6dcfe61ea7999ade723f072fea748b5a
|
||||
'App\\Http\\Middleware\\TrimStrings' => __DIR__ . '/../..' . '/app/Http/Middleware/TrimStrings.php',
|
||||
'App\\Http\\Middleware\\TrustProxies' => __DIR__ . '/../..' . '/app/Http/Middleware/TrustProxies.php',
|
||||
'App\\Http\\Middleware\\VerifyCsrfToken' => __DIR__ . '/../..' . '/app/Http/Middleware/VerifyCsrfToken.php',
|
||||
'App\\Invoice' => __DIR__ . '/../..' . '/app/Invoice.php',
|
||||
'App\\Marking' => __DIR__ . '/../..' . '/app/Marking.php',
|
||||
'App\\Notifications\\ResetPassword' => __DIR__ . '/../..' . '/app/Notifications/ResetPassword.php',
|
||||
'App\\OAuthProvider' => __DIR__ . '/../..' . '/app/OAuthProvider.php',
|
||||
|
||||
Reference in New Issue
Block a user