update store item view
This commit is contained in:
@@ -1,4 +1,6 @@
|
|||||||
<?php namespace App\Http\Controllers\user;
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\user;
|
||||||
|
|
||||||
use App\Http\Requests;
|
use App\Http\Requests;
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
@@ -14,9 +16,11 @@ use Illuminate\Support\Facades\Validator;
|
|||||||
use Illuminate\Support\Facades\Storage;
|
use Illuminate\Support\Facades\Storage;
|
||||||
|
|
||||||
|
|
||||||
class UserController extends Controller {
|
class UserController extends Controller
|
||||||
|
{
|
||||||
|
|
||||||
public function index(){
|
public function index()
|
||||||
|
{
|
||||||
$m = new UserModel;
|
$m = new UserModel;
|
||||||
$userRole = Auth::user()->role;
|
$userRole = Auth::user()->role;
|
||||||
|
|
||||||
@@ -47,10 +51,10 @@ class UserController extends Controller {
|
|||||||
|
|
||||||
// $post_data = json_encode($post_data, JSON_FORCE_OBJECT);
|
// $post_data = json_encode($post_data, JSON_FORCE_OBJECT);
|
||||||
return view('user-layouts.index')->with('data', $post_data);
|
return view('user-layouts.index')->with('data', $post_data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addressBook(){
|
public function addressBook()
|
||||||
|
{
|
||||||
$m = new UserModel;
|
$m = new UserModel;
|
||||||
$userId = Auth::user()->id;
|
$userId = Auth::user()->id;
|
||||||
|
|
||||||
@@ -58,16 +62,16 @@ class UserController extends Controller {
|
|||||||
|
|
||||||
return view('user-layouts.address_book')
|
return view('user-layouts.address_book')
|
||||||
->with('array_address_book', $array_address_book);
|
->with('array_address_book', $array_address_book);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function createAddressBook(){
|
public function createAddressBook()
|
||||||
|
{
|
||||||
|
|
||||||
return view('user-layouts.create_address_book');
|
return view('user-layouts.create_address_book');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function saveAddressBook(Request $request){
|
public function saveAddressBook(Request $request)
|
||||||
|
{
|
||||||
$post = $request->all();
|
$post = $request->all();
|
||||||
$m = new UserModel;
|
$m = new UserModel;
|
||||||
|
|
||||||
@@ -87,10 +91,10 @@ class UserController extends Controller {
|
|||||||
'Country' => $post['country']
|
'Country' => $post['country']
|
||||||
);
|
);
|
||||||
echo $i = $m->insertAddressBook($data);
|
echo $i = $m->insertAddressBook($data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function editAddressBook($id){
|
public function editAddressBook($id)
|
||||||
|
{
|
||||||
$m = new UserModel;
|
$m = new UserModel;
|
||||||
$userId = Auth::user()->id;
|
$userId = Auth::user()->id;
|
||||||
|
|
||||||
@@ -102,10 +106,10 @@ class UserController extends Controller {
|
|||||||
|
|
||||||
return view('user-layouts.edit_address_book')
|
return view('user-layouts.edit_address_book')
|
||||||
->with('array_address_book', $array_address_book);
|
->with('array_address_book', $array_address_book);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function updateAddressBook(Request $request){
|
public function updateAddressBook(Request $request)
|
||||||
|
{
|
||||||
$post = $request->all();
|
$post = $request->all();
|
||||||
$m = new UserModel;
|
$m = new UserModel;
|
||||||
|
|
||||||
@@ -128,10 +132,10 @@ class UserController extends Controller {
|
|||||||
|
|
||||||
|
|
||||||
echo $i = $m->saveUpdateAddressBook($data, $id);
|
echo $i = $m->saveUpdateAddressBook($data, $id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function profile(){
|
public function profile()
|
||||||
|
{
|
||||||
$m = new UserModel;
|
$m = new UserModel;
|
||||||
$userId = Auth::user()->id;
|
$userId = Auth::user()->id;
|
||||||
|
|
||||||
@@ -140,17 +144,18 @@ class UserController extends Controller {
|
|||||||
->with('array_profile_info', $array_profile_info);
|
->with('array_profile_info', $array_profile_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function editProfile(){
|
public function editProfile()
|
||||||
|
{
|
||||||
$m = new UserModel;
|
$m = new UserModel;
|
||||||
$userId = Auth::user()->id;
|
$userId = Auth::user()->id;
|
||||||
|
|
||||||
$array_profile_info = $m->selectProfileInfo($userId);
|
$array_profile_info = $m->selectProfileInfo($userId);
|
||||||
return view('user-layouts.edit_profile')
|
return view('user-layouts.edit_profile')
|
||||||
->with('array_profile_info', $array_profile_info);
|
->with('array_profile_info', $array_profile_info);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function updateProfile(Request $request){
|
public function updateProfile(Request $request)
|
||||||
|
{
|
||||||
$post = $request->all();
|
$post = $request->all();
|
||||||
$m = new UserModel;
|
$m = new UserModel;
|
||||||
|
|
||||||
@@ -175,11 +180,13 @@ class UserController extends Controller {
|
|||||||
return $i;
|
return $i;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function changePassword(){
|
public function changePassword()
|
||||||
|
{
|
||||||
return view('user-layouts.change_password');
|
return view('user-layouts.change_password');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function updatePassword(Request $request){
|
public function updatePassword(Request $request)
|
||||||
|
{
|
||||||
$post = $request->all();
|
$post = $request->all();
|
||||||
$m = new UserModel;
|
$m = new UserModel;
|
||||||
$c_password = Auth::user()->password;
|
$c_password = Auth::user()->password;
|
||||||
@@ -208,7 +215,8 @@ class UserController extends Controller {
|
|||||||
return $i;
|
return $i;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function orders(){
|
public function orders()
|
||||||
|
{
|
||||||
$m = new UserModel;
|
$m = new UserModel;
|
||||||
$userId = Auth::user()->id;
|
$userId = Auth::user()->id;
|
||||||
$array_payment_details = $m->selectPaymentDetails('UserId', $userId);
|
$array_payment_details = $m->selectPaymentDetails('UserId', $userId);
|
||||||
@@ -220,7 +228,8 @@ class UserController extends Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function myDesigns(){
|
public function myDesigns()
|
||||||
|
{
|
||||||
$m = new UserModel;
|
$m = new UserModel;
|
||||||
$userId = Auth::user()->id;
|
$userId = Auth::user()->id;
|
||||||
|
|
||||||
@@ -229,7 +238,8 @@ class UserController extends Controller {
|
|||||||
return view('user-layouts.my-design')->with('array_client_designs', $array_client_designs);
|
return view('user-layouts.my-design')->with('array_client_designs', $array_client_designs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function viewDesign($designCode){
|
public function viewDesign($designCode)
|
||||||
|
{
|
||||||
$m = new UserModel;
|
$m = new UserModel;
|
||||||
$newMainModel = new MainModel;
|
$newMainModel = new MainModel;
|
||||||
$userId = Auth::user()->id;
|
$userId = Auth::user()->id;
|
||||||
@@ -249,7 +259,8 @@ class UserController extends Controller {
|
|||||||
->with('array_cat_name', $array_cat_name);
|
->with('array_cat_name', $array_cat_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function updateDesignDetails(Request $request){
|
public function updateDesignDetails(Request $request)
|
||||||
|
{
|
||||||
$post = $request->all();
|
$post = $request->all();
|
||||||
$m = new UserModel;
|
$m = new UserModel;
|
||||||
|
|
||||||
@@ -263,10 +274,10 @@ class UserController extends Controller {
|
|||||||
$i = $m->updateClientDesign($client_design_data, $design_code);
|
$i = $m->updateClientDesign($client_design_data, $design_code);
|
||||||
|
|
||||||
return $i;
|
return $i;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function store(){
|
public function store()
|
||||||
|
{
|
||||||
$m = new UserModel;
|
$m = new UserModel;
|
||||||
$userRole = Auth::user()->role;
|
$userRole = Auth::user()->role;
|
||||||
$array_store_info = array();
|
$array_store_info = array();
|
||||||
@@ -277,13 +288,11 @@ class UserController extends Controller {
|
|||||||
$array_store_info = $m->selectStoreInfo($storeId);
|
$array_store_info = $m->selectStoreInfo($storeId);
|
||||||
|
|
||||||
return redirect('teamstore/' . $array_store_info[0]->StoreUrl);
|
return redirect('teamstore/' . $array_store_info[0]->StoreUrl);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
public function storeItems()
|
||||||
|
{
|
||||||
public function storeItems(){
|
|
||||||
$thumbnails = array();
|
$thumbnails = array();
|
||||||
$newUserModel = new UserModel;
|
$newUserModel = new UserModel;
|
||||||
$newTeamStoreModel = new TeamStoreModel;
|
$newTeamStoreModel = new TeamStoreModel;
|
||||||
@@ -317,7 +326,6 @@ class UserController extends Controller {
|
|||||||
'product_id' => $pr_arr->Id,
|
'product_id' => $pr_arr->Id,
|
||||||
'thumb' => $displayThumbnails
|
'thumb' => $displayThumbnails
|
||||||
);
|
);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$thumbnails[] = array(
|
$thumbnails[] = array(
|
||||||
'folder' => $store_array[0]->ImageFolder,
|
'folder' => $store_array[0]->ImageFolder,
|
||||||
@@ -325,7 +333,6 @@ class UserController extends Controller {
|
|||||||
'thumb' => "product-image-placeholder.png"
|
'thumb' => "product-image-placeholder.png"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return view('user-layouts.store_items')->with('store_array', $store_array)
|
return view('user-layouts.store_items')->with('store_array', $store_array)
|
||||||
@@ -333,7 +340,8 @@ class UserController extends Controller {
|
|||||||
->with('thumbnails', $thumbnails);
|
->with('thumbnails', $thumbnails);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function viewStoreItem($url){
|
public function viewStoreItem($url)
|
||||||
|
{
|
||||||
$product_array = array();
|
$product_array = array();
|
||||||
$newUserModel = new UserModel;
|
$newUserModel = new UserModel;
|
||||||
$newTeamStoreModel = new TeamStoreModel;
|
$newTeamStoreModel = new TeamStoreModel;
|
||||||
@@ -347,12 +355,11 @@ class UserController extends Controller {
|
|||||||
->with('available_size', $available_size)
|
->with('available_size', $available_size)
|
||||||
->with('thumbnails_array', $thumbnails_array)
|
->with('thumbnails_array', $thumbnails_array)
|
||||||
->with('shipping_cost', $shipping_cost);
|
->with('shipping_cost', $shipping_cost);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function storeItemUpdate(Request $request){
|
public function storeItemUpdate(Request $request)
|
||||||
|
{
|
||||||
$post = $request->all();
|
$post = $request->all();
|
||||||
$newTeamStoreModel = new TeamStoreModel;
|
$newTeamStoreModel = new TeamStoreModel;
|
||||||
|
|
||||||
@@ -402,11 +409,11 @@ class UserController extends Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return redirect('user/profile');
|
return redirect('user/profile');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function resendVericationCode(Request $request){
|
public function resendVericationCode(Request $request)
|
||||||
|
{
|
||||||
$post = $request->all();
|
$post = $request->all();
|
||||||
$random_hash = rand(1000, 9999);
|
$random_hash = rand(1000, 9999);
|
||||||
|
|
||||||
@@ -422,13 +429,11 @@ class UserController extends Controller {
|
|||||||
|
|
||||||
$message->from('no-reply@crewsportswear.com', 'CREW Sportswear');
|
$message->from('no-reply@crewsportswear.com', 'CREW Sportswear');
|
||||||
$message->to($emailDetails['receiver'])->subject('CREW Sportswear Email Verification Code');
|
$message->to($emailDetails['receiver'])->subject('CREW Sportswear Email Verification Code');
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if (count(Mail::failures()) > 0) {
|
if (count(Mail::failures()) > 0) {
|
||||||
|
|
||||||
echo '0';
|
echo '0';
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$data = array(
|
$data = array(
|
||||||
'EmailAddress' => $post['email'],
|
'EmailAddress' => $post['email'],
|
||||||
@@ -441,7 +446,8 @@ class UserController extends Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function verifyCode(Request $request){
|
public function verifyCode(Request $request)
|
||||||
|
{
|
||||||
$post = $request->all();
|
$post = $request->all();
|
||||||
|
|
||||||
$verification_code = $post['verification_code'];
|
$verification_code = $post['verification_code'];
|
||||||
@@ -470,7 +476,6 @@ class UserController extends Controller {
|
|||||||
'success' => true,
|
'success' => true,
|
||||||
'message' => 'Your email is successfully verified.'
|
'message' => 'Your email is successfully verified.'
|
||||||
));
|
));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
return response()->json(array(
|
return response()->json(array(
|
||||||
'success' => false,
|
'success' => false,
|
||||||
@@ -479,7 +484,8 @@ class UserController extends Controller {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function orderDetails($ck){
|
public function orderDetails($ck)
|
||||||
|
{
|
||||||
$newUserModel = new UserModel;
|
$newUserModel = new UserModel;
|
||||||
$order_item_array = $newUserModel->selectOrderItem($ck);
|
$order_item_array = $newUserModel->selectOrderItem($ck);
|
||||||
$item_goup_array = $newUserModel->itemGroup($ck);
|
$item_goup_array = $newUserModel->itemGroup($ck);
|
||||||
@@ -492,7 +498,8 @@ class UserController extends Controller {
|
|||||||
->with('order_item_array', $order_item_array);
|
->with('order_item_array', $order_item_array);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function sellDesign($designCode){
|
public function sellDesign($designCode)
|
||||||
|
{
|
||||||
$m = new UserModel;
|
$m = new UserModel;
|
||||||
$newMainModel = new MainModel;
|
$newMainModel = new MainModel;
|
||||||
$newTeamStoreModel = new TeamStoreModel;
|
$newTeamStoreModel = new TeamStoreModel;
|
||||||
@@ -517,7 +524,8 @@ class UserController extends Controller {
|
|||||||
->with('array_cat_name', $array_cat_name);
|
->with('array_cat_name', $array_cat_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buyDesign($designCode){
|
public function buyDesign($designCode)
|
||||||
|
{
|
||||||
$m = new UserModel;
|
$m = new UserModel;
|
||||||
$newMainModel = new MainModel;
|
$newMainModel = new MainModel;
|
||||||
$newTeamStoreModel = new TeamStoreModel;
|
$newTeamStoreModel = new TeamStoreModel;
|
||||||
@@ -540,11 +548,11 @@ class UserController extends Controller {
|
|||||||
->with('array_template_paths', $array_template_paths)
|
->with('array_template_paths', $array_template_paths)
|
||||||
// ->with('store_array', $store_array)
|
// ->with('store_array', $store_array)
|
||||||
->with('array_cat_name', $array_cat_name);
|
->with('array_cat_name', $array_cat_name);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//save item from my design //
|
//save item from my design //
|
||||||
public function saveNewStoreItem(Request $request){
|
public function saveNewStoreItem(Request $request)
|
||||||
|
{
|
||||||
$post = $request->all();
|
$post = $request->all();
|
||||||
$UserModel = new UserModel;
|
$UserModel = new UserModel;
|
||||||
$newTeamStoreModel = new TeamStoreModel;
|
$newTeamStoreModel = new TeamStoreModel;
|
||||||
@@ -567,16 +575,18 @@ class UserController extends Controller {
|
|||||||
'ProductURL' => $itemUrl
|
'ProductURL' => $itemUrl
|
||||||
);
|
);
|
||||||
|
|
||||||
$validator = Validator::make($check_product_url, [
|
$validator = Validator::make(
|
||||||
|
$check_product_url,
|
||||||
|
[
|
||||||
'ProductURL' => 'unique:teamstore_products'
|
'ProductURL' => 'unique:teamstore_products'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'ProductURL.unique' => 'The Item URL has already been taken.',
|
'ProductURL.unique' => 'The Item URL has already been taken.',
|
||||||
]);
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
if ($validator->fails())
|
if ($validator->fails()) {
|
||||||
{
|
|
||||||
$errors = "";
|
$errors = "";
|
||||||
// var_dump(($validator->errors()->all()));
|
// var_dump(($validator->errors()->all()));
|
||||||
foreach ($validator->errors()->all() as $error) {
|
foreach ($validator->errors()->all() as $error) {
|
||||||
@@ -630,8 +640,6 @@ class UserController extends Controller {
|
|||||||
);
|
);
|
||||||
|
|
||||||
$UserModel->insertNewProductThumbnails($thumbs);
|
$UserModel->insertNewProductThumbnails($thumbs);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$prod_code = array('ProductCode' => $getYear . '-' . str_pad($id, 10, '0', STR_PAD_LEFT));
|
$prod_code = array('ProductCode' => $getYear . '-' . str_pad($id, 10, '0', STR_PAD_LEFT));
|
||||||
@@ -640,10 +648,10 @@ class UserController extends Controller {
|
|||||||
return response()->json(array(
|
return response()->json(array(
|
||||||
'success' => true
|
'success' => true
|
||||||
));
|
));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function addStoreItem(){
|
function addStoreItem()
|
||||||
|
{
|
||||||
$newTeamStoreModel = new TeamStoreModel;
|
$newTeamStoreModel = new TeamStoreModel;
|
||||||
|
|
||||||
$user_role = Auth::user()->role;
|
$user_role = Auth::user()->role;
|
||||||
@@ -654,7 +662,8 @@ class UserController extends Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//manually uploading item
|
//manually uploading item
|
||||||
function saveNewItem(Request $request){
|
function saveNewItem(Request $request)
|
||||||
|
{
|
||||||
|
|
||||||
$post = $request->all();
|
$post = $request->all();
|
||||||
// var_dump($post['imgupload']);
|
// var_dump($post['imgupload']);
|
||||||
@@ -681,16 +690,18 @@ class UserController extends Controller {
|
|||||||
'ProductURL' => $itemUrl
|
'ProductURL' => $itemUrl
|
||||||
);
|
);
|
||||||
|
|
||||||
$validator = Validator::make($check_product_url, [
|
$validator = Validator::make(
|
||||||
|
$check_product_url,
|
||||||
|
[
|
||||||
'ProductURL' => 'unique:teamstore_products'
|
'ProductURL' => 'unique:teamstore_products'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'ProductURL.unique' => 'The Item URL has already been taken.',
|
'ProductURL.unique' => 'The Item URL has already been taken.',
|
||||||
]);
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
if ($validator->fails())
|
if ($validator->fails()) {
|
||||||
{
|
|
||||||
$errors = "";
|
$errors = "";
|
||||||
// var_dump(($validator->errors()->all()));
|
// var_dump(($validator->errors()->all()));
|
||||||
foreach ($validator->errors()->all() as $error) {
|
foreach ($validator->errors()->all() as $error) {
|
||||||
@@ -762,10 +773,10 @@ class UserController extends Controller {
|
|||||||
'success' => true,
|
'success' => true,
|
||||||
'message' => 'success'
|
'message' => 'success'
|
||||||
));
|
));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function saveNewItemImage(Request $request){
|
function saveNewItemImage(Request $request)
|
||||||
|
{
|
||||||
$post = $request->all();
|
$post = $request->all();
|
||||||
$UserModel = new UserModel;
|
$UserModel = new UserModel;
|
||||||
$getYear = date('y');
|
$getYear = date('y');
|
||||||
@@ -805,10 +816,10 @@ class UserController extends Controller {
|
|||||||
'success' => true,
|
'success' => true,
|
||||||
'message' => 'success'
|
'message' => 'success'
|
||||||
));
|
));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function deleteImageThumb(Request $request){
|
function deleteImageThumb(Request $request)
|
||||||
|
{
|
||||||
$file = $request->thumb_filename;
|
$file = $request->thumb_filename;
|
||||||
$id = $request->thumb_id;
|
$id = $request->thumb_id;
|
||||||
$UserModel = new UserModel;
|
$UserModel = new UserModel;
|
||||||
@@ -825,10 +836,10 @@ class UserController extends Controller {
|
|||||||
'message' => 'success',
|
'message' => 'success',
|
||||||
'delete_row' => 'item-' . $id
|
'delete_row' => 'item-' . $id
|
||||||
));
|
));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateActiveThumbnail(Request $request){
|
function updateActiveThumbnail(Request $request)
|
||||||
|
{
|
||||||
$post = $request->all();
|
$post = $request->all();
|
||||||
$UserModel = new UserModel;
|
$UserModel = new UserModel;
|
||||||
$i = $UserModel->updateActiveThumb($post['id'], $post['product_id']);
|
$i = $UserModel->updateActiveThumb($post['id'], $post['product_id']);
|
||||||
@@ -836,7 +847,8 @@ class UserController extends Controller {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function saveThumbnailOrdering(Request $request){
|
function saveThumbnailOrdering(Request $request)
|
||||||
|
{
|
||||||
$post = $request->all();
|
$post = $request->all();
|
||||||
$arrayItems = $post['item'];
|
$arrayItems = $post['item'];
|
||||||
$order = 1;
|
$order = 1;
|
||||||
@@ -853,7 +865,8 @@ class UserController extends Controller {
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
function saveItemOrdering(Request $request){
|
function saveItemOrdering(Request $request)
|
||||||
|
{
|
||||||
$post = $request->all();
|
$post = $request->all();
|
||||||
$arrayItems = $post['order_number'];
|
$arrayItems = $post['order_number'];
|
||||||
$order = 1;
|
$order = 1;
|
||||||
@@ -872,7 +885,8 @@ class UserController extends Controller {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
function storeSettingUpdate(Request $request){
|
function storeSettingUpdate(Request $request)
|
||||||
|
{
|
||||||
$post = $request->all();
|
$post = $request->all();
|
||||||
$UserModel = new UserModel;
|
$UserModel = new UserModel;
|
||||||
|
|
||||||
@@ -913,16 +927,18 @@ class UserController extends Controller {
|
|||||||
'StoreUrl' => $store_url
|
'StoreUrl' => $store_url
|
||||||
);
|
);
|
||||||
|
|
||||||
$validator = Validator::make($check_store_url, [
|
$validator = Validator::make(
|
||||||
|
$check_store_url,
|
||||||
|
[
|
||||||
'StoreUrl' => 'unique:teamstores'
|
'StoreUrl' => 'unique:teamstores'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'StoreUrl.unique' => 'The Store URL has already been taken.',
|
'StoreUrl.unique' => 'The Store URL has already been taken.',
|
||||||
]);
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
if ($validator->fails())
|
if ($validator->fails()) {
|
||||||
{
|
|
||||||
$errors = "";
|
$errors = "";
|
||||||
|
|
||||||
foreach ($validator->errors()->all() as $error) {
|
foreach ($validator->errors()->all() as $error) {
|
||||||
@@ -935,9 +951,6 @@ class UserController extends Controller {
|
|||||||
'message' => $errors
|
'message' => $errors
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$data = array(
|
$data = array(
|
||||||
@@ -981,7 +994,8 @@ class UserController extends Controller {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function storeOrders(){
|
function storeOrders()
|
||||||
|
{
|
||||||
$UserModel = new UserModel;
|
$UserModel = new UserModel;
|
||||||
$newTeamStoreModel = new TeamStoreModel;
|
$newTeamStoreModel = new TeamStoreModel;
|
||||||
$store_id = Auth::user()->store_id;
|
$store_id = Auth::user()->store_id;
|
||||||
@@ -994,7 +1008,8 @@ class UserController extends Controller {
|
|||||||
->with('array_store_orders', $array_store_orders);
|
->with('array_store_orders', $array_store_orders);
|
||||||
}
|
}
|
||||||
|
|
||||||
function showStoreOrderDetails(Request $request){
|
function showStoreOrderDetails(Request $request)
|
||||||
|
{
|
||||||
|
|
||||||
$post = $request->all();
|
$post = $request->all();
|
||||||
// var_dump($post['pid']);
|
// var_dump($post['pid']);
|
||||||
@@ -1021,7 +1036,8 @@ class UserController extends Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function itemStoreReArrange(){
|
function itemStoreReArrange()
|
||||||
|
{
|
||||||
$thumbnails = array();
|
$thumbnails = array();
|
||||||
$newUserModel = new UserModel;
|
$newUserModel = new UserModel;
|
||||||
$newTeamStoreModel = new TeamStoreModel;
|
$newTeamStoreModel = new TeamStoreModel;
|
||||||
@@ -1037,6 +1053,8 @@ class UserController extends Controller {
|
|||||||
$thumbnails_array = $newTeamStoreModel->getProductThumbnails($pr_arr->Id);
|
$thumbnails_array = $newTeamStoreModel->getProductThumbnails($pr_arr->Id);
|
||||||
|
|
||||||
if (!empty($thumbnails_array)) {
|
if (!empty($thumbnails_array)) {
|
||||||
|
$displayThumbnails = "product-image-placeholder.png";
|
||||||
|
|
||||||
foreach ($thumbnails_array as $t => $thumb) {
|
foreach ($thumbnails_array as $t => $thumb) {
|
||||||
|
|
||||||
if ($thumb->ImageClass == 'custom') {
|
if ($thumb->ImageClass == 'custom') {
|
||||||
@@ -1055,7 +1073,6 @@ class UserController extends Controller {
|
|||||||
'product_id' => $pr_arr->Id,
|
'product_id' => $pr_arr->Id,
|
||||||
'thumb' => $displayThumbnails
|
'thumb' => $displayThumbnails
|
||||||
);
|
);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$thumbnails[] = array(
|
$thumbnails[] = array(
|
||||||
'folder' => $store_array[0]->ImageFolder,
|
'folder' => $store_array[0]->ImageFolder,
|
||||||
@@ -1063,7 +1080,6 @@ class UserController extends Controller {
|
|||||||
'thumb' => "product-image-placeholder.png"
|
'thumb' => "product-image-placeholder.png"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return view('user-layouts.store_items_arrange')->with('store_array', $store_array)
|
return view('user-layouts.store_items_arrange')->with('store_array', $store_array)
|
||||||
@@ -1071,7 +1087,8 @@ class UserController extends Controller {
|
|||||||
->with('thumbnails', $thumbnails);
|
->with('thumbnails', $thumbnails);
|
||||||
}
|
}
|
||||||
|
|
||||||
function deleteStoreItem(Request $request){
|
function deleteStoreItem(Request $request)
|
||||||
|
{
|
||||||
//
|
//
|
||||||
$post = $request->all();
|
$post = $request->all();
|
||||||
|
|
||||||
@@ -1092,7 +1109,8 @@ class UserController extends Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function announcementIndex(){
|
function announcementIndex()
|
||||||
|
{
|
||||||
$UserModel = new UserModel;
|
$UserModel = new UserModel;
|
||||||
$storeId = Auth::user()->store_id;
|
$storeId = Auth::user()->store_id;
|
||||||
|
|
||||||
@@ -1112,11 +1130,11 @@ class UserController extends Controller {
|
|||||||
return view('user-layouts.announcement')
|
return view('user-layouts.announcement')
|
||||||
->with("data", $data)
|
->with("data", $data)
|
||||||
->render();
|
->render();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function announcementUpdateSave(Request $request){
|
function announcementUpdateSave(Request $request)
|
||||||
|
{
|
||||||
$post = $request->all();
|
$post = $request->all();
|
||||||
$UserModel = new UserModel;
|
$UserModel = new UserModel;
|
||||||
|
|
||||||
@@ -1151,7 +1169,8 @@ class UserController extends Controller {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function announcementUpdateStatus(Request $request){
|
function announcementUpdateStatus(Request $request)
|
||||||
|
{
|
||||||
$post = $request->all();
|
$post = $request->all();
|
||||||
$UserModel = new UserModel;
|
$UserModel = new UserModel;
|
||||||
|
|
||||||
@@ -1183,5 +1202,4 @@ class UserController extends Controller {
|
|||||||
// $response = $UserModel->updateAnnouncement($getAnnouncement[0]->Id, $data);
|
// $response = $UserModel->updateAnnouncement($getAnnouncement[0]->Id, $data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user