mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange.git
synced 2026-08-21 21:34:16 +00:00
Merge branch 'master' of https://gitlab.com/CIEFWorldwideSdnBhd/exchange into too/gitlabci
This commit is contained in:
@@ -18,7 +18,7 @@ class BookingController extends Controller
|
||||
{
|
||||
|
||||
public function index(){
|
||||
$bookings = Booking::select('id', 'created_at', 'status', 'rate', 'amount', 'bia', 'verification_status')
|
||||
$bookings = Booking::select('id', 'created_at', 'status', 'rate', 'term', 'amount', 'bia', 'verification_status')
|
||||
->where('user_id',Auth::user()->id)
|
||||
->get();
|
||||
|
||||
@@ -39,23 +39,29 @@ class BookingController extends Controller
|
||||
$booking->transfer_amount = $booking->bia;
|
||||
|
||||
$booking->track_status = "(". $booking->status ."/6)";
|
||||
|
||||
switch ($booking->status) {
|
||||
case 1:
|
||||
$booking->status_desc = "Order in progress";
|
||||
$status_desc = "Order in progress";
|
||||
break;
|
||||
case 2:
|
||||
$booking->status_desc = "Waiting for payment";
|
||||
$status_desc = "Waiting for payment";
|
||||
break;
|
||||
case 3:
|
||||
$booking->status_desc = "Waiting verification";
|
||||
$status_desc = "Waiting verification";
|
||||
break;
|
||||
case 4:
|
||||
$booking->status_desc = "Processing transfer";
|
||||
$status_desc = "Processing transfer";
|
||||
break;
|
||||
case 5:
|
||||
$booking->status_desc = "Transfer Complete, please upload your PO";
|
||||
$status_desc = "Transfer Complete, please upload your PO";
|
||||
break;
|
||||
case 6:
|
||||
$booking->status_desc = "Processing invoice";
|
||||
$status_desc = "Processing invoice";
|
||||
break;
|
||||
default:
|
||||
$booking->status_desc = "";
|
||||
$biastatus_desc = "";
|
||||
}
|
||||
$booking->status_desc = $status_desc;
|
||||
}
|
||||
|
||||
return $bookings;
|
||||
@@ -289,11 +295,17 @@ class BookingController extends Controller
|
||||
$user_po = new PurchaseOrder;
|
||||
$user_po->image_path = $unique_image_path;
|
||||
$user_po->book_id = $booking->id;
|
||||
$user_po->amount = $request->input('amount');
|
||||
$user_po->save();
|
||||
|
||||
return response()->json(['message'=>'Success'],200);
|
||||
}
|
||||
}
|
||||
|
||||
public function confirmPurchaseOrder($id){
|
||||
$booking = Booking::where('user_id',Auth::user()->id)->where('id',$id)->first();
|
||||
$booking->status = 5;
|
||||
$booking->save();
|
||||
return response()->json(['message'=>'Success'],200);
|
||||
}
|
||||
|
||||
public function delete(Booking $book_id)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user