added roster config
This commit is contained in:
@@ -348,14 +348,16 @@ class UserController extends Controller
|
||||
$newTeamStoreModel = new TeamStoreModel;
|
||||
|
||||
$product_array = $newTeamStoreModel->selectTeamStoreProducts('ProductURL', $url);
|
||||
$roster = $newUserModel->getRoster($product_array[0]->Id);
|
||||
$thumbnails_array = $newTeamStoreModel->getThumbnails($product_array[0]->Id);
|
||||
$available_size = explode(",", $product_array[0]->AvailableSizes);
|
||||
$shipping_cost = $newUserModel->selectShippingCost();
|
||||
|
||||
return view('user-layouts.view-store-item')->with('product_array', $product_array)
|
||||
->with('available_size', $available_size)
|
||||
->with('thumbnails_array', $thumbnails_array)
|
||||
->with('shipping_cost', $shipping_cost);
|
||||
->with('shipping_cost', $shipping_cost)
|
||||
->with('roster', $roster);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1344,4 +1346,76 @@ class UserController extends Controller
|
||||
|
||||
return $array_address_book;
|
||||
}
|
||||
}
|
||||
|
||||
function roster(Request $request)
|
||||
{
|
||||
$UserModel = new UserModel;
|
||||
$post = $request->all();
|
||||
|
||||
$response = $UserModel->insertRoster($post['data']);
|
||||
|
||||
if($response) {
|
||||
return response()->json(array(
|
||||
'status' => true,
|
||||
'message' => "Roster is successfully saved."
|
||||
));
|
||||
}
|
||||
|
||||
return response()->json(array(
|
||||
'status' => false,
|
||||
'message' => "Something went wrong. Please try again"
|
||||
));
|
||||
|
||||
}
|
||||
|
||||
function deleteRoster(Request $request) {
|
||||
$UserModel = new UserModel;
|
||||
$post = $request->all();
|
||||
|
||||
$response = $UserModel->deleteRoster($post['data']);
|
||||
|
||||
if($response) {
|
||||
return response()->json(array(
|
||||
'status' => true,
|
||||
'message' => "Roster is successfully deleted."
|
||||
));
|
||||
}
|
||||
|
||||
return response()->json(array(
|
||||
'status' => false,
|
||||
'message' => "Something went wrong. Please try again"
|
||||
));
|
||||
|
||||
}
|
||||
|
||||
|
||||
function rosterUpdate(Request $request)
|
||||
{
|
||||
$UserModel = new UserModel;
|
||||
$post = $request->all();
|
||||
|
||||
$response = $UserModel->updateRoster($post['data']);
|
||||
|
||||
if($response) {
|
||||
return response()->json(array(
|
||||
'status' => true,
|
||||
'message' => "Roster is successfully updated."
|
||||
));
|
||||
}
|
||||
|
||||
return response()->json(array(
|
||||
'status' => false,
|
||||
'message' => "Something went wrong. Please try again"
|
||||
));
|
||||
|
||||
}
|
||||
|
||||
function getCurrentRoster(Request $request) {
|
||||
$productId = $request->query('product-id');
|
||||
$newUserModel = new UserModel;
|
||||
$roster = $newUserModel->getRoster($productId);
|
||||
return response()->json($roster);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user