8 Commits

Author SHA1 Message Date
Frank John Begornia
88912ee8e3 Add Docker and Nginx configuration for Cloud Run deployment 2025-08-12 00:28:17 +08:00
Frank John Begornia
f197490606 updated 2024-11-27 17:42:12 +08:00
Frank John Begornia
f26c9c274b updated subtotal when orders have voucher 2024-11-27 17:13:00 +08:00
Frank John Begornia
54278c568d added roster config 2024-11-05 05:33:47 +08:00
Frank John Begornia
c68f28aa11 updated prod 2024-09-30 01:15:42 +08:00
franknstayn
70496dc874 updated 2024-05-23 01:42:59 +08:00
franknstayn
97bc491b07 added tax exception grayslake 2024-05-23 01:41:03 +08:00
Frank John Begornia
a2aba7b8e9 added tax 2024-02-16 22:43:25 +08:00
48 changed files with 1264 additions and 307 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

18
.dockerignore Normal file
View File

@@ -0,0 +1,18 @@
.git
.gitignore
.env
.env.*
.editorconfig
.idea
.vscode
*.md
docker-compose.yml
Dockerfile
vendor/
node_modules/
storage/framework/cache/**
storage/framework/sessions/**
storage/framework/views/**
storage/logs/**
tests/
phpunit.xml

101
Dockerfile Normal file → Executable file
View File

@@ -1,46 +1,81 @@
# Use the official PHP image based on Alpine Linux # Build stage
FROM php:5.6-fpm-alpine FROM php:5.6-fpm-alpine as composer
# Install system dependencies and PHP extensions # Install system dependencies and PHP extensions required for Composer
RUN apk --update --no-cache add \ RUN apk add --no-cache \
nginx \ git \
libpng-dev \ curl \
libjpeg-turbo-dev \
freetype-dev \
libzip-dev \
zip \ zip \
unzip \ unzip \
libmcrypt \
libmcrypt-dev \ libmcrypt-dev \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \ zlib-dev \
&& docker-php-ext-install gd pdo pdo_mysql zip mcrypt libzip-dev \
autoconf \
make \
gcc \
g++ \
&& docker-php-ext-install mcrypt mbstring zip \
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
&& composer self-update --1
ENV COMPOSER_ALLOW_SUPERUSER=1
WORKDIR /app
COPY composer.* ./
# Install dependencies with Composer (optimize later after full copy)
RUN composer config platform.php 5.6.40 \
&& composer install --prefer-dist --no-dev --no-scripts --no-autoloader
# Copy the rest of the application and optimize autoload
COPY . .
RUN composer dump-autoload --optimize --no-dev --classmap-authoritative
# Production stage
FROM php:5.6-fpm-alpine
# Install runtime dependencies & build PHP extensions
RUN apk add --no-cache \
nginx \
curl \
libpng \
libjpeg-turbo \
freetype \
libzip \
libmcrypt \
zlib \
&& apk add --no-cache --virtual .build-deps \
autoconf make gcc g++ \
libpng-dev libjpeg-turbo-dev freetype-dev libzip-dev libmcrypt-dev zlib-dev \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install -j"$(nproc)" gd pdo pdo_mysql zip mcrypt mbstring opcache \
&& docker-php-ext-enable mcrypt \
&& apk del .build-deps \
&& php -m | grep -i mcrypt
# Configure PHP for production
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" \
&& echo "opcache.enable=1" >> /usr/local/etc/php/conf.d/opcache.ini \
&& echo "opcache.memory_consumption=128" >> /usr/local/etc/php/conf.d/opcache.ini \
&& echo "opcache.interned_strings_buffer=8" >> /usr/local/etc/php/conf.d/opcache.ini \
&& echo "opcache.max_accelerated_files=4000" >> /usr/local/etc/php/conf.d/opcache.ini \
&& echo "opcache.revalidate_freq=60" >> /usr/local/etc/php/conf.d/opcache.ini \
&& echo "opcache.fast_shutdown=1" >> /usr/local/etc/php/conf.d/opcache.ini
# Set the working directory in the container
WORKDIR /var/www WORKDIR /var/www
# Clear cache # Copy vendor & app code from build stage
# RUN apt-get clean && rm -rf /var/lib/apt/lists/* COPY --from=composer /app/vendor ./vendor
# Copy the Laravel application files to the container
COPY . . COPY . .
# Set appropriate permissions for Laravel storage and bootstrap cache # Set appropriate permissions and create required directories
RUN chown -R www-data:www-data storage bootstrap RUN chown -R www-data:www-data storage bootstrap \
&& mkdir -p /run/php \
&& chown www-data:www-data /run/php \
&& php artisan key:generate || true
# Install Composer # Healthcheck (FPM listens on 9000; adjust as needed if behind nginx)
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer HEALTHCHECK --interval=30s --timeout=5s CMD php -m > /dev/null || exit 1
# Install Laravel dependencies
RUN composer install --no-plugins --no-scripts
# Generate Laravel application key
RUN php artisan key:generate
# Create directory for the socket and set permissions
RUN mkdir -p /run/php && chown www-data:www-data /run/php
# Copy the www.conf file to PHP-FPM pool.d directory
# COPY www.conf /usr/local/etc/php-fpm.d/www.conf
# Expose port 9000 and start php-fpm server
EXPOSE 9000 EXPOSE 9000
CMD ["php-fpm"] CMD ["php-fpm"]

View File

@@ -399,13 +399,14 @@ class PaypalController extends Controller
public function getTax($cartKey) public function getTax($cartKey)
{ {
$m = new TeamStoreModel; $m = new TeamStoreModel;
$updated_getSubtotal = $m->getSubtotal($cartKey); $updated_getSubtotal = $m->getSubtotalNew($cartKey);
$original_subtotal = $m->getSubtotal($cartKey); // withoutTanle
$grouped_item = $m->selectTeamStoreGroupByCartKey($cartKey); $grouped_item = $m->selectTeamStoreGroupByCartKey($cartKey);
if (count($grouped_item) <= 0) { if (count($grouped_item) <= 0) {
$tax_value = 0; $tax_value = 0;
} else { } else {
if ($grouped_item[0]->StoreId == 76 || $grouped_item[0]->StoreId == 78 || $grouped_item[0]->StoreId == 111 || $grouped_item[0]->StoreId == 131 || $grouped_item[0]->StoreId == 30 || $grouped_item[0]->StoreId == 141 || $grouped_item[0]->StoreId == 162 || $grouped_item[0]->StoreId == 185 || $grouped_item[0]->StoreId == 244 || $grouped_item[0]->StoreId == 301 || $grouped_item[0]->StoreId == 1 || $grouped_item[0]->StoreId == 329 || $grouped_item[0]->StoreId == 340) { if ($grouped_item[0]->StoreId == 76 || $grouped_item[0]->StoreId == 78 || $grouped_item[0]->StoreId == 111 || $grouped_item[0]->StoreId == 131 || $grouped_item[0]->StoreId == 30 || $grouped_item[0]->StoreId == 141 || $grouped_item[0]->StoreId == 162 || $grouped_item[0]->StoreId == 185 || $grouped_item[0]->StoreId == 244 || $grouped_item[0]->StoreId == 301 || $grouped_item[0]->StoreId == 1 || $grouped_item[0]->StoreId == 329 || $grouped_item[0]->StoreId == 340 || $grouped_item[0]->StoreId == 346) {
$tax_value = 0; $tax_value = 0;
} else { } else {
$tax_value = 0.10; $tax_value = 0.10;
@@ -414,10 +415,11 @@ class PaypalController extends Controller
$order_grandtotal = $updated_getSubtotal[0]->Subtotal; $order_grandtotal = $updated_getSubtotal[0]->Subtotal;
$order_subtotal = $original_subtotal[0]->Subtotal;
$tax = $order_grandtotal * $tax_value; $tax = $order_subtotal * $tax_value;
return [ return [
'tax' => $tax, 'tax' => $tax,

View File

@@ -499,6 +499,30 @@ class TeamStoreController extends Controller
'ShippingCostId' => $shipping_cost_id 'ShippingCostId' => $shipping_cost_id
); );
} }
} elseif ($product_form == "number-size-form") {
// $order_names = $post['order_names'];
$order_number = $post['order_number'];
$order_size = $post['order_size'];
foreach ($order_size as $key => $val) {
$items[] = array(
'ProductId' => $product_id,
'StoreURL' => $store_url,
'StoreId' => $store_id,
'FormUsed' => $product_form,
'CartKey' => $cartKey,
'DesignCode' => $design_code,
'ProductURL' => $ProductURL,
'ProductName' => $product_name,
'Name' => $product_name,
'Size' => $order_size[$key],
'Number' => $order_number[$key],
'Price' => $ProductPrice,
'Quantity' => 1,
'ShippingCostId' => $shipping_cost_id
);
}
} elseif ($product_form == "number-form") { } elseif ($product_form == "number-form") {
$order_number = $post['order_number']; $order_number = $post['order_number'];
@@ -954,6 +978,7 @@ class TeamStoreController extends Controller
'shippingFee' => number_format($shippingFee, 2), 'shippingFee' => number_format($shippingFee, 2),
'total' => number_format($finalSubTotal + $shippingFee + $tax["tax"], 2), 'total' => number_format($finalSubTotal + $shippingFee + $tax["tax"], 2),
'subtotal' => number_format($finalSubTotal, 2), 'subtotal' => number_format($finalSubTotal, 2),
'tax' => $tax["tax"],
'remaining_shippingfee' => number_format(99 - $finalSubTotal, 2) 'remaining_shippingfee' => number_format(99 - $finalSubTotal, 2)
)); ));
} else { } else {

View File

@@ -348,14 +348,16 @@ class UserController extends Controller
$newTeamStoreModel = new TeamStoreModel; $newTeamStoreModel = new TeamStoreModel;
$product_array = $newTeamStoreModel->selectTeamStoreProducts('ProductURL', $url); $product_array = $newTeamStoreModel->selectTeamStoreProducts('ProductURL', $url);
$roster = $newUserModel->getRoster($product_array[0]->Id);
$thumbnails_array = $newTeamStoreModel->getThumbnails($product_array[0]->Id); $thumbnails_array = $newTeamStoreModel->getThumbnails($product_array[0]->Id);
$available_size = explode(",", $product_array[0]->AvailableSizes); $available_size = explode(",", $product_array[0]->AvailableSizes);
$shipping_cost = $newUserModel->selectShippingCost(); $shipping_cost = $newUserModel->selectShippingCost();
return view('user-layouts.view-store-item')->with('product_array', $product_array) return view('user-layouts.view-store-item')->with('product_array', $product_array)
->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)
->with('roster', $roster);
} }
@@ -1344,4 +1346,76 @@ class UserController extends Controller
return $array_address_book; 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);
}
} }

View File

@@ -149,6 +149,11 @@ Route::group(['middleware' => 'normaluser'], function () {
Route::post('user/store-items/personal-design', 'user\UserController@saveNewItemFromDesigner'); Route::post('user/store-items/personal-design', 'user\UserController@saveNewItemFromDesigner');
Route::post('user/roster', 'user\UserController@roster');
Route::get('user/roster', 'user\UserController@getCurrentRoster');
Route::post('user/roster-delete', 'user\UserController@deleteRoster');
Route::post('user/roster-update', 'user\UserController@rosterUpdate');
}); });
Route::group(['middleware' => 'auth'], function () { Route::group(['middleware' => 'auth'], function () {

View File

@@ -189,6 +189,16 @@ class TeamStoreModel extends Model
return $i; return $i;
} }
function getSubtotalNew($cartKey)
{
$i = DB::table('cart_tmp')->select(DB::raw('SUM(Quantity * Price) AS Subtotal'))
->where('CartKey', '=', $cartKey)
// ->where('VoucherId', '=', null)
->get();
return $i;
}
function updateStoreItem($data, $url) function updateStoreItem($data, $url)
{ {
$i = DB::table('teamstore_products')->where('ProductURL', $url) $i = DB::table('teamstore_products')->where('ProductURL', $url)

View File

@@ -425,4 +425,44 @@ class UserModel extends Model
->update($data); ->update($data);
return $i; return $i;
} }
function insertRoster($data) {
$i = DB::table('roster')
->insert($data);
return $i;
}
function getRoster($productId)
{
$i = DB::table('roster')
->where('ProductId', $productId)
->get();
return $i;
}
function deleteRoster($idArray)
{
$deletedRows = DB::table('roster')
->whereIn('Id', $idArray) // Replace 'id' with the actual column name if different
->delete();
return $deletedRows; // Returns the number of rows deleted
}
function updateRoster($data)
{
$updatedRows = 0;
foreach ($data as $item) {
// Assuming each item contains an 'id' and the fields to update
$id = $item['Id'];
unset($item['Id']); // Remove 'id' from the update data
$updatedRows += DB::table('roster')
->where('Id', $id)
->update($item);
}
return $updatedRows; // Returns the total number of rows updated
}
} }

View File

@@ -0,0 +1,72 @@
# Combined image for Cloud Run: nginx + php-fpm (PHP 5.6) for legacy Laravel 5
# NOTE: PHP 5.6 is EOL; use only for legacy maintenance. Consider upgrading.
FROM php:5.6-fpm
# Set build args/env
ARG APP_ENV=production
ENV APP_ENV=${APP_ENV} \
APP_DEBUG=false \
OPCACHE_VALIDATE_TIMESTAMPS=0 \
COMPOSER_ALLOW_SUPERUSER=1 \
PORT=8080 \
PATH="/var/www/artisan:$PATH"
WORKDIR /var/www
# Install system deps (Debian variant easier than alpine for mixed services)
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
git curl unzip zip supervisor nginx \
libmcrypt4 libmcrypt-dev \
libpng-dev libjpeg62-turbo-dev libfreetype6-dev libzip-dev zlib1g-dev \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install gd mcrypt mbstring pdo pdo_mysql zip opcache \
&& rm -rf /var/lib/apt/lists/*
# Install Composer (v1)
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
&& composer self-update --1
# Copy composer files & install deps first (cache layer)
COPY composer.* ./
RUN composer config platform.php 5.6.40 \
&& composer install --no-dev --no-scripts --no-autoloader --prefer-dist
# Copy application code
COPY . .
RUN composer dump-autoload --optimize --no-dev --classmap-authoritative || true
# Nginx config
COPY cloudrun/nginx.conf /etc/nginx/nginx.conf
# Supervisord config
COPY cloudrun/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# Remove default nginx site configs if present
RUN rm -f /etc/nginx/sites-enabled/default /etc/nginx/conf.d/default.conf || true
# Create runtime dirs
RUN mkdir -p /run/php /var/log/supervisor /var/www/storage /var/www/bootstrap/cache \
&& chown -R www-data:www-data /var/www/storage /var/www/bootstrap/cache
# PHP production ini tweaks
RUN { \
echo "opcache.enable=1"; \
echo "opcache.memory_consumption=128"; \
echo "opcache.interned_strings_buffer=8"; \
echo "opcache.max_accelerated_files=4000"; \
echo "opcache.revalidate_freq=60"; \
echo "opcache.fast_shutdown=1"; \
echo "date.timezone=UTC"; \
} > /usr/local/etc/php/conf.d/zz-custom.ini
# Generate app key if missing (non-fatal if artisan fails early)
RUN php artisan key:generate || true
# Cloud Run listens on $PORT
EXPOSE 8080
# Health check path suggestion: /healthz (configure in Cloud Run if desired)
# Start supervisor (manages php-fpm + nginx)
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]

42
cloudrun/nginx.conf Normal file
View File

@@ -0,0 +1,42 @@
user nginx;
worker_processes auto;
error_log /dev/stderr warn;
pid /var/run/nginx.pid;
events { worker_connections 1024; }
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /dev/stdout main;
sendfile on;
keepalive_timeout 65;
server_tokens off;
server {
listen 8080 default_server;
listen [::]:8080 default_server;
root /var/www/public;
index index.php index.html;
location /healthz { return 200 'ok'; add_header Content-Type text/plain; }
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass 127.0.0.1:9000; # php-fpm
fastcgi_index index.php;
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
expires 30d;
access_log off;
}
}
}

24
cloudrun/supervisord.conf Normal file
View File

@@ -0,0 +1,24 @@
[supervisord]
nodaemon=true
logfile=/dev/stdout
logfile_maxbytes=0
[program:php-fpm]
command=/usr/sbin/php-fpm5.6 -F
priority=10
autostart=true
autorestart=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
[program:nginx]
command=/usr/sbin/nginx -g 'daemon off;'
priority=20
autostart=true
autorestart=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0

View File

@@ -46,6 +46,9 @@
] ]
}, },
"config": { "config": {
"preferred-install": "dist" "preferred-install": "dist",
"allow-plugins": {
"kylekatarnls/update-helper": true
}
} }
} }

43
docker-compose.yml Normal file → Executable file
View File

@@ -1,4 +1,3 @@
version: '3'
services: services:
#PHP Service #PHP Service
@@ -6,34 +5,64 @@ services:
build: build:
context: . context: .
dockerfile: Dockerfile dockerfile: Dockerfile
args:
- APP_ENV=production
image: digitalocean.com/php image: digitalocean.com/php
container_name: app container_name: app
restart: unless-stopped restart: unless-stopped
tty: true deploy:
resources:
limits:
cpus: '0.50'
memory: 512M
reservations:
cpus: '0.25'
memory: 256M
environment: environment:
SERVICE_NAME: app APP_ENV: production
SERVICE_TAGS: dev APP_DEBUG: 'false'
PHP_OPCACHE_VALIDATE_TIMESTAMPS: 0
working_dir: /var/www working_dir: /var/www
volumes: volumes:
- ./:/var/www - ./storage:/var/www/storage
- ./php/local.ini:/usr/local/etc/php/conf.d/local.ini - ./php/local.ini:/usr/local/etc/php/conf.d/local.ini
networks: networks:
- app-network - app-network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/"]
interval: 30s
timeout: 3s
retries: 3
#Nginx Service #Nginx Service
webserver: webserver:
image: nginx:alpine image: nginx:alpine
container_name: webserver container_name: webserver
restart: unless-stopped restart: unless-stopped
tty: true deploy:
resources:
limits:
cpus: '0.30'
memory: 256M
reservations:
cpus: '0.10'
memory: 128M
ports: ports:
- "10003:80" - "10003:80"
- "10443:443" - "10443:443"
volumes: volumes:
- ./:/var/www - ./public:/var/www/public
- ./nginx/conf.d/:/etc/nginx/conf.d/ - ./nginx/conf.d/:/etc/nginx/conf.d/
networks: networks:
- app-network - app-network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:80/"]
interval: 30s
timeout: 3s
retries: 3
depends_on:
app:
condition: service_healthy
#Docker Networks #Docker Networks
networks: networks:

0
favicon.ico Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

29
nginx/conf.d/app.conf Normal file → Executable file
View File

@@ -1,9 +1,30 @@
server { server {
listen 80; listen 80;
index index.php index.html; server_tokens off;
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log; # Compression
root /var/www; gzip on;
gzip_comp_level 5;
gzip_min_length 256;
gzip_proxied any;
gzip_vary on;
gzip_types
application/javascript
application/json
application/x-javascript
application/xml
text/css
text/javascript
text/plain
text/xml;
client_max_body_size 100M;
fastcgi_read_timeout 1800;
error_log /var/log/nginx/error.log warn;
access_log /var/log/nginx/access.log combined buffer=512k flush=1m;
root /var/www/public;
index index.php index.html; index index.php index.html;
location / { location / {

0
php/local.ini Normal file → Executable file
View File

0
public/api/canada.json Normal file → Executable file
View File

0
public/api/usa.json Normal file → Executable file
View File

0
public/api/usaCities.old.json Normal file → Executable file
View File

0
public/assets/css/jquery-ui.css vendored Normal file → Executable file
View File

0
public/assets/files/Terms of Use.pdf Normal file → Executable file
View File

0
public/assets/js/jquery-ui.js vendored Normal file → Executable file
View File

0
public/images/MERCHBAY-LOGO.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

0
public/images/merchbay-black.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

0
public/images/merchbay-white.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

0
resources/views/designer/vue_designer.blade.php Normal file → Executable file
View File

0
resources/views/emails/contact_us.blade.php Normal file → Executable file
View File

View File

@@ -540,6 +540,13 @@
<td><b>Price</b></td> <td><b>Price</b></td>
<td><b>Quantity</b></td> <td><b>Quantity</b></td>
</tr> </tr>
@elseif($item->FormUsed == 'number-size-form')
<tr>
<td><b>Number</b></td>
<td><b>Size</b></td>
<td><b>Price</b></td>
<td><b>Quantity</b></td>
</tr>
@else @else
@endif @endif
<!-- table header --> <!-- table header -->
@@ -666,6 +673,17 @@
<td>{{ $sub_item->Quantity }} <td>{{ $sub_item->Quantity }}
</td> </td>
</tr> </tr>
@elseif($item->FormUsed == 'number-size-form')
<tr>
<td>{{ $sub_item->Number }}
</td>
<td>{{ $sub_item->Size }}
</td>
<td>{{ $sub_item->Price }}
</td>
<td>{{ $sub_item->Quantity }}
</td>
</tr>
@else @else
@endif @endif
@endif @endif

0
resources/views/errors/404.blade.php Normal file → Executable file
View File

View File

@@ -174,6 +174,15 @@
<th>Quantity</th> <th>Quantity</th>
<th></th> <th></th>
</tr> </tr>
@elseif($item->FormUsed == 'number-size-form')
<tr>
<th>Number</th>
<th>Size</th>
<th>Price</th>
<th>Quantity</th>
<th></th>
</tr>
@else @else
@endif @endif
@@ -296,6 +305,17 @@
href="{{ url('removeitem') }}/{{ $sub_item->Id }}"><i href="{{ url('removeitem') }}/{{ $sub_item->Id }}"><i
class="fa fa-times"></i></a></td> class="fa fa-times"></i></a></td>
</tr> </tr>
@elseif($item->FormUsed == 'number-size-form')
<tr>
<td>{{ $sub_item->Number }}</td>
<td>{{ $sub_item->Size }}</td>
<td>{{ $sub_item->Price . ' ' . $store_array[0]->StoreCurrency }}
</td>
<td>{{ $sub_item->Quantity }}</td>
<td><a class="btn btn-xs btn-link pull-right"
href="{{ url('removeitem') }}/{{ $sub_item->Id }}"><i
class="fa fa-times"></i></a></td>
</tr>
@else @else
@endif @endif
@endif @endif

0
resources/views/merchbay/not_found.blade.php Normal file → Executable file
View File

0
resources/views/merchbay/privacy_policy.blade.php Normal file → Executable file
View File

0
resources/views/merchbay/terms_of_use.blade.php Normal file → Executable file
View File

0
resources/views/merchbay/track_order.blade.php Normal file → Executable file
View File

0
resources/views/paypal/payment_success.blade.php Normal file → Executable file
View File

View File

@@ -0,0 +1,45 @@
<div class="panel-design-details" id="orderListPanel">
<table class="table" id="tableRow" style="font-size:12px;">
<thead>
<tr>
<!-- <th>#</th> -->
{{-- <th class="col-md-5">Name</th> --}}
<th class="col-md-6">Number</th>
<th class="col-md-5">Size</th>
<th class="text-center"></th>
</tr>
</thead>
<tbody id="orderTableBody">
<tr class="table-tr-0">
{{-- <td>
<input type="text" name="order_names[]" id="order_names" class="form-control input-sm inputName roster-input" placeholder="Name">
</td> --}}
<td>
<select class="form-control input-sm roster-input" name="order_number[]">
<option value="none">none</option>
@for($i = 0; $i <= 99; $i++)
<option value="{{ $i }}">{{ $i }}</option>
@endfor
<option value="00">00</option>
</select>
</td>
<td>
<select class="form-control input-sm order-size roster-input" name="order_size[]" style="border-right: 1px solid #ccc;" data-row-number="1">
@foreach($sizes_array as $size)
<option value="{{ $size->Size }}">{{ $size->SizeDisplay }}</option>
@endforeach
</select>
</td>
<td id="action-column" class="text-center" style="padding: 4px !important; border-top: none">
<span class="tr-remove-btn">
<button type="button" id="addNewRow" class="btn btn-success btn-sm btn-roster-action" data-toggle="tooltip" title="Add Another"><i class="fa fa-plus" aria-hidden="true"></i></button>
</span>
</td>
</tr>
</tbody>
</table>
<div id="addnew-btn-tbl-row">
</div>
</div>

View File

@@ -7,11 +7,12 @@
margin-top:20px; margin-top:20px;
} }
</style> </style>
<div class="content-wrapper" style="min-height: 916px;"> <div class="content-wrapper" id="addItem" style="min-height: 916px;">
<!-- Content Header (Page header) --> <!-- Content Header (Page header) -->
<section class="content-header"> <section class="content-header">
<h1> <h1>
Add Store Item Add Store Item
{{-- <p>@{{ message }}</p> --}}
</h1> </h1>
<ol class="breadcrumb"> <ol class="breadcrumb">
<li><a href="{{ url('user') }}"><i class="fa fa-home"></i> Home</a></li> <li><a href="{{ url('user') }}"><i class="fa fa-home"></i> Home</a></li>
@@ -92,6 +93,9 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label>Item Form</label> <label>Item Form</label>
<div class="row">
<div class="col-lg-10"></div>
</div>
<select class="form-control" name="itemForm"> <select class="form-control" name="itemForm">
<option value="jersey-and-shorts-form">Jersey and Shorts Form</option> <option value="jersey-and-shorts-form">Jersey and Shorts Form</option>
<option value="tshirt-form">T-Shirt Form</option> <option value="tshirt-form">T-Shirt Form</option>
@@ -102,6 +106,7 @@
<option value="name-size-form">Name and Size Form</option> <option value="name-size-form">Name and Size Form</option>
<option value="jersey-and-shorts-quantity-form">Jersey, Shorts and Quantity Form</option> <option value="jersey-and-shorts-quantity-form">Jersey, Shorts and Quantity Form</option>
<option value="number-jersey-shorts-form">Number, Jersey and Shorts Form</option> <option value="number-jersey-shorts-form">Number, Jersey and Shorts Form</option>
<option value="number-size-form">Number and Size Form</option>
<option value="roster-name-number-size-form">Roster and Size Form</option> <option value="roster-name-number-size-form">Roster and Size Form</option>
</select> </select>
</div> </div>

View File

@@ -125,7 +125,8 @@
<option value="tshirt-form">T-Shirt Form</option> <option value="tshirt-form">T-Shirt Form</option>
<option value="quantity-form">Quantity Form</option> <option value="quantity-form">Quantity Form</option>
<option value="name-and-number-form">Name and Number Form</option> <option value="name-and-number-form">Name and Number Form</option>
<option value="name-number-size-form">Name, Number and Size Form</option> <option value="name-and-number-form">Name and Number Form</option>
<option value="number-size-form">Number and Size Form</option>
<option value="number-form">Number Only Form</option> <option value="number-form">Number Only Form</option>
</select> </select>
</div> </div>

View File

@@ -114,6 +114,13 @@
<th>Price</th> <th>Price</th>
<th>Quantity</th> <th>Quantity</th>
</tr> </tr>
@elseif($array_item[0]->FormUsed=="number-size-form")
<tr>
<th>Number</th>
<th>Size</th>
<th>Price</th>
<th>Quantity</th>
</tr>
@else @else
@endif @endif
@@ -195,6 +202,13 @@
<td>{{ $array_item[0]->Price . ' ' . $store_array[0]->StoreCurrency }}</td> <td>{{ $array_item[0]->Price . ' ' . $store_array[0]->StoreCurrency }}</td>
<td>{{ $array_item[0]->Quantity }}</td> <td>{{ $array_item[0]->Quantity }}</td>
</tr> </tr>
@elseif($array_item[0]->FormUsed=="number-size-form")
<tr>
<td>{{ $array_item[0]->Number }}</td>
<td>{{ $array_item[0]->Size }}</td>
<td>{{ $array_item[0]->Price . ' ' . $store_array[0]->StoreCurrency }}</td>
<td>{{ $array_item[0]->Quantity }}</td>
</tr>
@else @else
@endif @endif

View File

@@ -158,6 +158,14 @@
<th>Quantity</th> <th>Quantity</th>
<th></th> <th></th>
</tr> </tr>
@elseif($item->FormUsed=="number-size-form")
<tr>
<th>Number</th>
<th>Size</th>
<th>Price</th>
<th>Quantity</th>
<th></th>
</tr>
@else @else
@endif @endif
@@ -219,6 +227,13 @@
<td>{{ $sub_item->Price . ' ' . $array_payment_details[0]->Currency }}</td> <td>{{ $sub_item->Price . ' ' . $array_payment_details[0]->Currency }}</td>
<td>{{ $sub_item->Quantity }}</td> <td>{{ $sub_item->Quantity }}</td>
</tr> </tr>
@elseif($item->FormUsed=="number-size-form")
<tr>
<td>{{ $sub_item->Number }}</td>
<td>{{ $sub_item->Size }}</td>
<td>{{ $sub_item->Price . ' ' . $array_payment_details[0]->Currency }}</td>
<td>{{ $sub_item->Quantity }}</td>
</tr>
@else @else
@endif @endif

View File

@@ -127,6 +127,7 @@
<option value="name-and-number-form">Name and Number Form</option> <option value="name-and-number-form">Name and Number Form</option>
<option value="name-number-size-form">Name, Number and Size Form</option> <option value="name-number-size-form">Name, Number and Size Form</option>
<option value="number-form">Number Only Form</option> <option value="number-form">Number Only Form</option>
<option value="number-size-eform">Number and Size Form</option>
</select> </select>
</div> </div>
<div class="form-group"> <div class="form-group">

View File

@@ -44,6 +44,10 @@
<!-- jquery-ui --> <!-- jquery-ui -->
<link href="{{ asset('/public/assets/css/jquery-ui.css') }}" rel="stylesheet"> <link href="{{ asset('/public/assets/css/jquery-ui.css') }}" rel="stylesheet">
<link href="{{asset('/public/designer/css/build.css')}}" rel="stylesheet"> <link href="{{asset('/public/designer/css/build.css')}}" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/vue@2.7.14"></script>
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]> <!--[if lt IE 9]>
@@ -2150,7 +2154,6 @@
function submitFormItemDetails() { function submitFormItemDetails() {
var data = $("#frm-item-details").serialize(); var data = $("#frm-item-details").serialize();
// console.log(data)
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
url: "{{ url('user/store-items/update') }}", url: "{{ url('user/store-items/update') }}",

View File

@@ -1,277 +1,644 @@
@extends('user-layouts.user_template') @extends('user-layouts.user_template')
@section('content') @section('content')
<style> <style>
.hide-bullets { .hide-bullets {
list-style: none; list-style: none;
margin-left: -40px; margin-left: -40px;
margin-top: 20px; margin-top: 20px;
} }
</style> </style>
<div class="content-wrapper" style="min-height: 916px;">
<!-- Content Header (Page header) -->
<section class="content-header"> <div class="content-wrapper" id="viewStoreItem" style="min-height: 916px;">
<h1> <!-- Content Header (Page header) -->
Store Item <section class="content-header">
<small>{{ $product_array[0]->ProductName }}</small> <h1>
</h1> @{{ title }}
<ol class="breadcrumb"> <small>{{ $product_array[0]->ProductName }}</small>
<li><a href="{{ url('user') }}"><i class="fa fa-home"></i> Home</a></li> </h1>
<li><a href="{{ url('user/store-items') }}"><i class="fa fa-th"></i> Store Items</a></li> <ol class="breadcrumb">
<li class="active">{{ $product_array[0]->ProductName }}</li> <li><a href="{{ url('user') }}"><i class="fa fa-home"></i> Home</a></li>
</ol> <li><a href="{{ url('user/store-items') }}"><i class="fa fa-th"></i> Store Items</a></li>
</section> <li class="active">{{ $product_array[0]->ProductName }}</li>
<!-- Main content --> </ol>
<section class="content"> </section>
<div class="row"> <!-- Main content -->
<div class="col-md-7"> <section class="content">
<div class="box box-primary"> <div class="row">
<div class="box-header with-border"> <div class="col-md-7">
<button type="button" class="btn btn-default pull-right" data-toggle="modal" data-target="#myModal">Re-arrange / Delete thumbnail</button> <div class="box box-primary">
<button type="button" class="btn btn-danger pull-right" id="btn_delete_store_id" style="margin-right: 5px;" data-id="{{ $product_array[0]->Id }}">Delete this Item</button> <div class="box-header with-border">
</div> <button type="button" class="btn btn-default pull-right" data-toggle="modal"
<div class="box-body custom-box-body"> data-target="#myModal">Re-arrange / Delete thumbnail</button>
<div class="row"> <button type="button" class="btn btn-danger pull-right" id="btn_delete_store_id"
<div class="col-md-12"> style="margin-right: 5px;" data-id="{{ $product_array[0]->Id }}">Delete this
<div class="row"> Item</button>
<div class="col-md-12 text-center">
@foreach($thumbnails_array as $thumbnail)
@if($thumbnail->ImageClass == 'active')
<img style="height:400px" src="{{ config('site_config.images_url') }}/{{ $thumbnail->Image . '?t=' . time() }}" id="main-thumbnail">
@endif
@endforeach
</div>
</div>
<div class="row">
<div class="col-md-12">
<ul class="hide-bullets">
<li class="col-sm-3 col-xs-4">
<a class="thumbnail btn-add-thumbnail" style="border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; margin-bottom: -28px; cursor: pointer;">
<!-- <span class="close">&times;</span> -->
<img class="img img-responsive product-center " style="height: 65.45px;" src="{{ asset('/public/images/add-new-img.svg') }}" />
<!-- <p class="center">Add Image</p> -->
<p class="text-center">
Add Image
</p>
</a>
</li>
@foreach($thumbnails_array as $thumbnail)
<li class="col-sm-3 col-xs-4">
<a class="thumbnail a_thumbnail {{ $thumbnail->ImageClass }}" style="border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; margin-bottom: -28px;">
<!-- <span class="close">&times;</span> -->
<img class="img img-responsive product-center image-thumbnails" style="height: 59.45px;" src="{{ config('site_config.images_url') }}/{{ $thumbnail->Image . '?t=' . time() }}" />
</a>
<div class="funkyradio">
<div class="funkyradio-primary">
<input type="radio" id="{{ 'radio-' .$thumbnail->Id }}" data-product-id="{{ $product_array[0]->Id }}" data-id="{{ $thumbnail->Id }}" name="setActive" @if($thumbnail->ImageClass != null) checked @endif />
<label for="{{ 'radio-' .$thumbnail->Id }}" style="border-top-left-radius: 0px; border-top-right-radius: 0px;">active</label>
</div>
</div>
</li>
@endforeach
</ul>
</div>
</div>
</div>
<!-- <div class="col-md-5">
asdasdadadsaad
</div> -->
</div> </div>
</div>
</div>
</div>
<div class="col-md-5">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">
Item Details
</h3>
</div>
<form id="frm-item-details">
<!-- <input type="hidden" name="design_code" class="form-control" value=""> -->
<div class="box-body custom-box-body"> <div class="box-body custom-box-body">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<input type="hidden" class="form-control" name="item_url" value="{{ $product_array[0]->ProductURL }}" placeholder="Item Name"> <div class="row">
<div class="form-group"> <div class="col-md-12 text-center">
<label>SKU</label> @foreach ($thumbnails_array as $thumbnail)
<input type="text" class="form-control" name="sku" value="{{ $product_array[0]->ProductCode }}" placeholder="SKU"> @if ($thumbnail->ImageClass == 'active')
</div> <img style="height:400px"
<div class="form-group"> src="{{ config('site_config.images_url') }}/{{ $thumbnail->Image . '?t=' . time() }}"
<label>Item Name</label> id="main-thumbnail">
<input type="text" class="form-control" name="itemName" value="{{ $product_array[0]->ProductName }}" placeholder="Item Name"> @endif
</div>
<div class="form-group">
<label>Item Desription</label>
<textarea class="form-control" name="itemDescription">{{ $product_array[0]->ProductDescription }}</textarea>
</div>
<!-- <div class="form-group">
<div class="checkbox checkbox-inline">
<input type="checkbox" class="styled" id="sale_chk" name="sale_chk" checked >
<label for="sale_chk"> Sell Item</label>
</div>
<div class="checkbox checkbox-inline">
<input type="checkbox" class="styled" id="publish_chk" name="publish_chk" >
<label for="publish_chk"> Publish Design</label>
</div>
</div> -->
<div class="form-group">
<label>Item Price</label>
<input id="item_price" name="item_price" class="form-control price_format" type="text" value="{{ $product_array[0]->ProductPrice }}" data-error="#err-price" />
</div>
<div class="form-group">
<label>Item Form</label>
<select class="form-control" name="itemForm">
<option value="jersey-and-shorts-form" @if($product_array[0]->ProductForm == "jersey-and-shorts-form") selected @endif>Jersey and Shorts Form</option>
<option value="tshirt-form" @if($product_array[0]->ProductForm == "tshirt-form") selected @endif>T-Shirt Form</option>
<option value="quantity-form" @if($product_array[0]->ProductForm == "quantity-form") selected @endif>Quantity Form</option>
<option value="name-number-form" @if($product_array[0]->ProductForm == "name-number-form") selected @endif>Name and Number Form</option>
<option value="name-number-size-form" @if($product_array[0]->ProductForm == "name-number-size-form") selected @endif>Name, Number and Size Form</option>
<option value="number-form" @if($product_array[0]->ProductForm == "number-form") selected @endif>Number Only Form</option>
<option value="name-size-form" @if($product_array[0]->ProductForm == "name-size-form") selected @endif>Name and Size Form</option>
<option value="jersey-and-shorts-quantity-form" @if($product_array[0]->ProductForm == "jersey-and-shorts-quantity-form") selected @endif>Jersey, Shorts and Quantity Form</option>
<option value="number-jersey-shorts-form" @if($product_array[0]->ProductForm == "number-jersey-shorts-form") selected @endif>Number, Jersey and Shorts Form</option>
<option value="roster-name-number-size-form" @if($product_array[0]->ProductForm == "roster-name-number-size-form") selected @endif>Roster and Size Form</option>
</select>
</div>
<div class="form-group">
<label>Available Size</label>
<select class="form-control select2" data-error="#err_available_size" data-placeholder="Select Size" name="available_size[]" multiple="multiple" required>
<option value="toddler" @if(in_array("toddler", $available_size)) selected @endif>Toddler</option>
<option value="youth" @if(in_array("youth", $available_size)) selected @endif>Youth</option>
<option value="adult" @if(in_array("adult", $available_size)) selected @endif>Adult</option>
<option value="mask" @if(in_array("mask", $available_size)) selected @endif>Mask</option>
<option value="gaiter" @if(in_array("gaiter", $available_size)) selected @endif>Gaiter</option>
<option value="buckethat" @if(in_array("buckethat", $available_size)) selected @endif>Buckethat</option>
<option value="none" @if(in_array("none", $available_size)) selected @endif>None</option>
</select>
<span id="err_available_size"></span>
</div>
<div class="form-group">
<label>Item Quantity <small>(Optional)</small></label>
<input id="item_quantity" name="item_quantity" class="form-control" type="number" min="0" value="{{ $product_array[0]->ProductAvailableQty }}" data-error="#err-quantity" />
</div>
{{-- {{ var_dump($product_array[0]) }} --}}
<div class="form-group">
<label>Item Privacy</label>
<select class="form-control" name="item_privacy">
<option value="public" @if($product_array[0]->PrivacyStatus == "public") selected @endif>Public</option>
<option value="private" @if($product_array[0]->PrivacyStatus == "private") selected @endif>Private</option>
</select>
</div>
<div class="form-group">
<label>Select Shipping Category</label>
<select class="form-control" name="shipping_cost" required>
<option value="0">None</option>
@foreach ($shipping_cost as $sc)
<option value="{{ $sc->Id }}" @if($sc->Id == $product_array[0]->ShippingCostId) selected @endif>{{ $sc->DisplayName }}</option>
@endforeach @endforeach
</select> </div>
<span id="err_available_size"></span> </div>
<div class="row">
<div class="col-md-12">
<ul class="hide-bullets">
<li class="col-sm-3 col-xs-4">
<a class="thumbnail btn-add-thumbnail"
style="border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; margin-bottom: -28px; cursor: pointer;">
<!-- <span class="close">&times;</span> -->
<img class="img img-responsive product-center "
style="height: 65.45px;"
src="{{ asset('/public/images/add-new-img.svg') }}" />
<!-- <p class="center">Add Image</p> -->
<p class="text-center">
Add Image
</p>
</a>
</li>
@foreach ($thumbnails_array as $thumbnail)
<li class="col-sm-3 col-xs-4">
<a class="thumbnail a_thumbnail {{ $thumbnail->ImageClass }}"
style="border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; margin-bottom: -28px;">
<!-- <span class="close">&times;</span> -->
<img class="img img-responsive product-center image-thumbnails"
style="height: 59.45px;"
src="{{ config('site_config.images_url') }}/{{ $thumbnail->Image . '?t=' . time() }}" />
</a>
<div class="funkyradio">
<div class="funkyradio-primary">
<input type="radio" id="{{ 'radio-' . $thumbnail->Id }}"
data-product-id="{{ $product_array[0]->Id }}"
data-id="{{ $thumbnail->Id }}" name="setActive"
@if ($thumbnail->ImageClass != null) checked @endif />
<label for="{{ 'radio-' . $thumbnail->Id }}"
style="border-top-left-radius: 0px; border-top-right-radius: 0px;">active</label>
</div>
</div>
</li>
@endforeach
</ul>
</div>
</div>
</div>
<!-- <div class="col-md-5">
asdasdadadsaad
</div> -->
</div>
</div>
</div>
</div>
<div class="col-md-5">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">
Item Details
</h3>
</div>
<form id="frm-item-details">
<!-- <input type="hidden" name="design_code" class="form-control" value=""> -->
<div class="box-body custom-box-body">
<div class="row">
<div class="col-md-12">
<input type="hidden" class="form-control" name="item_url"
value="{{ $product_array[0]->ProductURL }}" placeholder="Item Name">
<div class="form-group">
<label>SKU</label>
<input type="text" class="form-control" name="sku"
value="{{ $product_array[0]->ProductCode }}" placeholder="SKU">
</div>
<div class="form-group">
<label>Item Name</label>
<input type="text" class="form-control" name="itemName"
value="{{ $product_array[0]->ProductName }}" placeholder="Item Name">
</div>
<div class="form-group">
<label>Item Desription</label>
<textarea class="form-control" name="itemDescription">{{ $product_array[0]->ProductDescription }}</textarea>
</div>
<!-- <div class="form-group">
<div class="checkbox checkbox-inline">
<input type="checkbox" class="styled" id="sale_chk" name="sale_chk" checked >
<label for="sale_chk"> Sell Item</label>
</div>
<div class="checkbox checkbox-inline">
<input type="checkbox" class="styled" id="publish_chk" name="publish_chk" >
<label for="publish_chk"> Publish Design</label>
</div>
</div> -->
<div class="form-group">
<label>Item Price</label>
<input id="item_price" name="item_price" class="form-control price_format"
type="text" value="{{ $product_array[0]->ProductPrice }}"
data-error="#err-price" />
</div>
<div class="form-group">
<label>Item Form</label>
<select class="form-control" name="itemForm" v-model="itemFormSelected"
@change="handleSelectItemForm">
<option value="jersey-and-shorts-form"
@if ($product_array[0]->ProductForm == 'jersey-and-shorts-form') selected @endif>Jersey and Shorts
Form</option>
<option value="tshirt-form"
@if ($product_array[0]->ProductForm == 'tshirt-form') selected @endif>T-Shirt Form
</option>
<option value="quantity-form"
@if ($product_array[0]->ProductForm == 'quantity-form') selected @endif>Quantity Form
</option>
<option value="name-number-form"
@if ($product_array[0]->ProductForm == 'name-number-form') selected @endif>Name and Number
Form</option>
<option value="name-number-size-form"
@if ($product_array[0]->ProductForm == 'name-number-size-form') selected @endif>Name, Number and
Size Form</option>
<option value="number-size-form"
@if ($product_array[0]->ProductForm == 'number-size-form') selected @endif>Number and Size
Form</option>
<option value="number-form"
@if ($product_array[0]->ProductForm == 'number-form') selected @endif>Number Only Form
</option>
<option value="name-size-form"
@if ($product_array[0]->ProductForm == 'name-size-form') selected @endif>Name and Size Form
</option>
<option value="jersey-and-shorts-quantity-form"
@if ($product_array[0]->ProductForm == 'jersey-and-shorts-quantity-form') selected @endif>Jersey, Shorts
and Quantity Form</option>
<option value="number-jersey-shorts-form"
@if ($product_array[0]->ProductForm == 'number-jersey-shorts-form') selected @endif>Number, Jersey
and Shorts Form</option>
<option value="roster-name-number-size-form"
@if ($product_array[0]->ProductForm == 'roster-name-number-size-form') selected @endif>Roster and Size
Form</option>
</select>
</div>
<div class="form-group d-flex"
v-if="itemFormSelected == 'roster-name-number-size-form'">
<button type="button" class="btn btn-success btn-sm"
@click="addRosterModal">
<i class="fa fa-plus"></i> Add Roster
</button>
<button type="button" class="btn btn-warning btn-sm"
@click="viewRosterModal">
<i class="fa fa-eye"></i> View Roster
</button>
</div>
<div class="form-group">
<label>Available Size</label>
<select class="form-control select2" data-error="#err_available_size"
data-placeholder="Select Size" name="available_size[]"
multiple="multiple" required>
<option value="toddler"
@if (in_array('toddler', $available_size)) selected @endif>Toddler</option>
<option value="youth" @if (in_array('youth', $available_size)) selected @endif>
Youth</option>
<option value="adult" @if (in_array('adult', $available_size)) selected @endif>
Adult</option>
<option value="mask" @if (in_array('mask', $available_size)) selected @endif>
Mask</option>
<option value="gaiter" @if (in_array('gaiter', $available_size)) selected @endif>
Gaiter</option>
<option value="buckethat"
@if (in_array('buckethat', $available_size)) selected @endif>Buckethat
</option>
<option value="none" @if (in_array('none', $available_size)) selected @endif>
None</option>
</select>
<span id="err_available_size"></span>
</div>
<div class="form-group">
<label>Item Quantity <small>(Optional)</small></label>
<input id="item_quantity" name="item_quantity" class="form-control"
type="number" min="0"
value="{{ $product_array[0]->ProductAvailableQty }}"
data-error="#err-quantity" />
</div>
{{-- {{ var_dump($product_array[0]) }} --}}
<div class="form-group">
<label>Item Privacy</label>
<select class="form-control" name="item_privacy">
<option value="public" @if ($product_array[0]->PrivacyStatus == 'public') selected @endif>
Public</option>
<option value="private"
@if ($product_array[0]->PrivacyStatus == 'private') selected @endif>Private</option>
</select>
</div>
<div class="form-group">
<label>Select Shipping Category</label>
<select class="form-control" name="shipping_cost" required>
<option value="0">None</option>
@foreach ($shipping_cost as $sc)
<option value="{{ $sc->Id }}"
@if ($sc->Id == $product_array[0]->ShippingCostId) selected @endif>
{{ $sc->DisplayName }}</option>
@endforeach
</select>
<span id="err_available_size"></span>
</div>
</div>
</div>
</div>
<div class="box-footer">
<!-- <button type="submit" class="btn btn-default">Cancel</button> -->
<button type="submit" class="btn btn-primary pull-right">Save changes</button>
</div>
</form>
</div>
</div>
</div>
</section>
<!-- /.content -->
<!-- Modal -->
<div class="modal fade" id="myModal" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Item Images</h4>
</div>
<div class="modal-body">
<table class="table table-bordered table-condensed">
<thead>
<tr>
<th></th>
<th>Image</th>
<th class="col-sm-2 text-center">Action</th>
</tr>
</thead>
<tbody id="sortable">
@foreach ($thumbnails_array as $thumbnail)
<tr id="{{ 'item-' . $thumbnail->Id }}">
<td class="text-center" style="width: 50px"><i class="fa fa-bars"></i></td>
<td><img class="img img-responsive product-center" style="height: 59.45px;"
src="{{ config('site_config.images_url') }}/{{ $thumbnail->Image . '?t=' . time() }}" />
</td>
<td class="text-center">
<!-- <button class="btn btn-default btn-xs btn-edit-clipart" data-id="#"><i class="fa fa-edit"></i></button> -->
<button class="btn btn-default btn-sm btn-delete-item-image"
data-id="{{ $thumbnail->Id }}" data-filename="{{ $thumbnail->Image }}"
title="Delete Image"><i class="fa fa-trash"></i></button>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" id="btn_save_thumbnail_sorting">Save
Changes</button>
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="modal_add_thumbnail" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<form id="frm_add_new_images">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Add Image</h4>
</div>
<div class="modal-body">
<div class="row grid-divider">
<div class="col-sm-4">
<div class="col-padding">
<h3>Select Image(s)</h3>
<div class="form-group">
<input type="hidden" name="_id" value="{{ $product_array[0]->Id }}" />
<input type="file" class="form-control" id="upload_images"
name="upload_images[]" multiple accept="image/*" />
</div>
<div class="form-group">
<button type="button" id="clear_frm_add_new_images"
class="btn btn-default btn-block">Clear</button>
</div>
</div>
</div>
<div class="col-sm-8">
<div class="col-padding">
<h3>Preview</h3>
<div class="col-md-12">
<ul class="hide-bullets small-preview-thumb">
</ul>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="box-footer"> <div class="modal-footer">
<!-- <button type="submit" class="btn btn-default">Cancel</button> --> <button type="submit" id="btn_submit_new_item_image" class="btn btn-primary">Submit</button>
<button type="submit" class="btn btn-primary pull-right">Save changes</button> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div> </div>
</form> </form>
</div> </div>
</div> </div>
</div> </div>
</section>
<!-- /.content -->
</div>
<!-- Modal --> <div class="modal fade" id="modalAddRoster" role="dialog" data-backdrop="static" data-keyboard="false">
<div class="modal fade" id="myModal" role="dialog"> <div class="modal-dialog">
<div class="modal-dialog"> <div class="modal-content">
<div class="modal-content"> {{-- @{{ roster }} --}}
<div class="modal-header"> <form @submit.prevent="onRosterSubmit">
<button type="button" class="close" data-dismiss="modal">&times;</button> <div class="modal-header">
<h4 class="modal-title">Item Images</h4> <button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Add Roster</h4>
</div>
<div class="modal-body">
<table class="table">
<tr>
<th>#</th>
<th>Name</th>
<th>Number</th>
<th></th>
</tr>
<tr v-for="(item, i) in roster" :key="i">
<td style="padding: 0px 0px 0px 8px;">@{{ i + 1 }}</td>
<td style="padding: 0px 0px 0px 8px;"><input type="text" placeholder="Player Name"
v-model="roster[i]['Name']" class="form-control"></td>
<td style="padding: 0px 8px 0px 0px;"><input type="text"
placeholder="Player Number" v-model="roster[i]['Number']" maxlength="2"
class="form-control"></td>
<td style="padding: 0px 8px 0px 0px; text-align: end;">
<button type="button" @click="removeRosterRow(i)" :disabled="roster.length <= 1"
class="btn btn-danger"><i class="fa fa-times-circle-o"></i></button>
</td>
</tr>
<tr>
<td colspan="4" style="padding: 8px 8px 0px 8px; text-align: end;">
<button type="button" @click="addRosterRow" class="btn btn-primary">Add
Row</button>
</td>
</tr>
</table>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary" :disabled="isSubmit">
<i v-if="isSubmit" class="fa fa-spinner fa-spin"></i> Submit
</button>
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</form>
</div>
</div> </div>
<div class="modal-body"> </div>
<table class="table table-bordered table-condensed">
<thead>
<tr>
<th></th>
<th>Image</th>
<th class="col-sm-2 text-center">Action</th>
</tr>
</thead>
<tbody id="sortable">
@foreach($thumbnails_array as $thumbnail)
<tr id="{{ 'item-' . $thumbnail->Id }}"> <div class="modal fade" id="modalViewRoster" role="dialog" data-backdrop="static" data-keyboard="false">
<td class="text-center" style="width: 50px"><i class="fa fa-bars"></i></td> <div class="modal-dialog">
<td><img class="img img-responsive product-center" style="height: 59.45px;" src="{{ config('site_config.images_url') }}/{{ $thumbnail->Image . '?t=' . time() }}" /></td> <div class="modal-content">
<td class="text-center"> <form @submit.prevent="onRosterUpdate">
<!-- <button class="btn btn-default btn-xs btn-edit-clipart" data-id="#"><i class="fa fa-edit"></i></button> --> <div class="modal-header">
<button class="btn btn-default btn-sm btn-delete-item-image" data-id="{{ $thumbnail->Id }}" data-filename="{{ $thumbnail->Image }}" title="Delete Image"><i class="fa fa-trash"></i></button> <button type="button" class="close" data-dismiss="modal">&times;</button>
</td> <h4 class="modal-title">Roster</h4>
</tr> </div>
@endforeach <div class="modal-body">
<div style="text-align: end;">
<button type="button" @click.prevent="getRoster" class="btn btn-success" :disabled="isRefresh">
<i v-if="isRefresh" class="fa fa-spinner fa-spin"></i> Refresh
</button>
</div>
<table class="table">
<tr>
<th>#</th>
<th>Name</th>
<th>Number</th>
<th></th>
</tr>
<tr v-for="(item, i) in currentRoster" :key="i">
<td style="padding: 0px 0px 0px 8px;">@{{ i + 1 }}</td>
<td style="padding: 0px 0px 0px 8px;"><input type="text" placeholder="Player Name"
v-model="currentRoster[i]['Name']" class="form-control"></td>
<td style="padding: 0px 8px 0px 0px;"><input type="text" maxlength="2"
placeholder="Player Number" v-model="currentRoster[i]['Number']"
class="form-control"></td>
<td style="padding: 0px 8px 0px 0px; text-align: end;">
<button type="button" @click="deleteRoster(i, item)" class="btn btn-danger"><i
class="fa fa-trash-o"></i></button>
</td>
</tr>
{{-- <tr>
<td colspan="4" style="padding: 8px 8px 0px 8px; text-align: end;">
<button type="button" @click="addRosterRow" class="btn btn-primary">Add
Row</button>
</td>
</tr> --}}
</table>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary" :disabled="isSubmit">
<i v-if="isSubmit" class="fa fa-spinner fa-spin"></i> Update
</tbody> </button>
</table> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div> </div>
<div class="modal-footer"> </form>
<button type="button" class="btn btn-primary" id="btn_save_thumbnail_sorting">Save Changes</button> </div>
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div> </div>
</div> </div>
</div> </div>
</div>
<div class="modal fade" id="modal_add_thumbnail" role="dialog">
<div class="modal-dialog modal-lg"> <script>
<div class="modal-content"> new Vue({
<form id="frm_add_new_images"> el: '#viewStoreItem',
<div class="modal-header"> data: {
<button type="button" class="close" data-dismiss="modal">&times;</button> title: "Store Item", // Passing Laravel data to Vue
<h4 class="modal-title">Add Image</h4> showAddRoster: false,
</div> itemFormSelected: {!! json_encode($product_array[0]->ProductForm) !!},
<div class="modal-body"> roster: [{
<div class="row grid-divider"> Name: "",
<div class="col-sm-4"> Number: "",
<div class="col-padding"> ProductId: {!! json_encode($product_array[0]->Id) !!}
<h3>Select Image(s)</h3> }],
<div class="form-group">
<input type="hidden" name="_id" value="{{ $product_array[0]->Id }}" /> currentRoster: {!! json_encode($roster) !!},
<input type="file" class="form-control" id="upload_images" name="upload_images[]" multiple accept="image/*" /> toBeDeletedRoster: [],
</div> isSubmit: false,
<div class="form-group"> isRefresh: false
<button type="button" id="clear_frm_add_new_images" class="btn btn-default btn-block">Clear</button> },
</div>
</div> methods: {
</div> handleSelectItemForm() {
<div class="col-sm-8"> console.log('Selected option:', this.itemFormSelected);
<div class="col-padding"> },
<h3>Preview</h3>
<div class="col-md-12"> addRosterRow() {
<ul class="hide-bullets small-preview-thumb"> this.roster.push({
</ul> Name: "",
</div> Number: "",
</div> ProductId: {!! json_encode($product_array[0]->Id) !!}
</div> })
</div> },
</div>
<div class="modal-footer"> deleteRoster(i, item) {
<button type="submit" id="btn_submit_new_item_image" class="btn btn-primary">Submit</button> this.currentRoster.splice(i, 1);
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button> this.toBeDeletedRoster.push(item.Id);
</div> },
</form>
</div> async onRosterUpdate() {
</div> // this.isSubmit = true;
</div>
if (this.toBeDeletedRoster.length > 0) {
this.postDeleteRoster();
}
await this.updateRoster();
// this.isSubmit = false;
},
async postDeleteRoster() {
const token = $('meta[name="csrf_token"]').attr('content')
axios.post("{{ url('user/roster-delete') }}", {
data: this.toBeDeletedRoster
}, {
headers: {
"Content-Type": "application/json",
'X-CSRF-TOKEN': token
}
})
.then(response => {
this.isSubmit = false;
console.log(response.data);
// alert("Roster is successfully saved.");
// $('#modalAddRoster').modal('hide');
// this.roster = [{
// Name: "",
// Number: "",
// ProductId: {!! json_encode($product_array[0]->Id) !!}
// }]
})
.catch(error => {
console.error(error); // Handle error
this.isSubmit = false; // Hide loading indicator
});
},
async onRosterSubmit() {
this.isSubmit = true;
const token = $('meta[name="csrf_token"]').attr('content')
axios.post("{{ url('user/roster') }}", {
data: this.roster
}, {
headers: {
"Content-Type": "application/json",
'X-CSRF-TOKEN': token
}
})
.then(response => {
this.isSubmit = false;
console.log(response.data);
const res = response.data;
if (!res.status) {
alert(res.message);
return
}
alert(res.message);
$('#modalAddRoster').modal('hide');
this.roster = [{
Name: "",
Number: "",
ProductId: {!! json_encode($product_array[0]->Id) !!}
}]
})
.catch(error => {
console.error(error); // Handle error
this.isSubmit = false; // Hide loading indicator
});
},
async updateRoster() {
this.isSubmit = true;
const token = $('meta[name="csrf_token"]').attr('content')
axios.post("{{ url('user/roster-update') }}", {
data: this.currentRoster
}, {
headers: {
"Content-Type": "application/json",
'X-CSRF-TOKEN': token
}
})
.then(response => {
this.isSubmit = false;
console.log(response.data);
alert("Roster is successfully updated.");
$('#modalViewRoster').modal('hide');
})
.catch(error => {
console.error(error); // Handle error
this.isSubmit = false; // Hide loading indicator
});
},
async getRoster() {
this.isRefresh = true;
const productId = {!! json_encode($product_array[0]->Id) !!}
const token = $('meta[name="csrf_token"]').attr('content')
axios.get("{{ url('user/roster') }}", {
params: {
'product-id': productId
}
}, {
headers: {
"Content-Type": "application/json",
'X-CSRF-TOKEN': token
}
})
.then(response => {
this.isRefresh = false;
console.log("getRoster", response)
this.currentRoster = response.data;
})
.catch(error => {
console.error(error); // Handle error
this.isRefresh = false;
});
},
removeRosterRow(i) {
this.roster.splice(i, 1);
},
addRosterModal() {
$('#modalAddRoster').modal('show');
},
viewRosterModal() {
$('#modalViewRoster').modal('show');
// this.getRoster()
}
},
});
</script>
@endsection @endsection

68
run.sh Executable file
View File

@@ -0,0 +1,68 @@
#!/usr/bin/env bash
set -euo pipefail
# Helper script for docker compose workflow
# Usage examples:
# ./run.sh up # build (if needed) and start in background
# ./run.sh rebuild # force full rebuild (no cache) and start
# ./run.sh down # stop and remove containers
# ./run.sh logs # follow logs
# ./run.sh artisan migrate
# ./run.sh sh # shell into PHP app container
# ./run.sh restart # restart containers
# ./run.sh build # build images (uses cache)
CMD=${1:-up}
shift || true
case "$CMD" in
build)
echo "[build] Building images (with cache)..."
docker compose build
;;
up)
echo "[up] Starting services (build if needed)..."
docker compose up -d --build
;;
rebuild)
echo "[rebuild] Full rebuild without cache..."
docker compose down || true
docker compose build --no-cache
docker compose up -d
;;
down)
echo "[down] Stopping and removing services..."
docker compose down
;;
restart)
echo "[restart] Restarting services..."
docker compose restart
;;
logs)
echo "[logs] Following logs (Ctrl+C to exit)..."
docker compose logs -f --tail=200 "$@"
;;
artisan)
echo "[artisan] php artisan $*"
docker compose exec app php artisan "$@"
;;
sh)
echo "[sh] Opening shell in app container..."
docker compose exec app sh
;;
*)
cat <<EOF
Usage: ./run.sh <command> [args]
Commands:
up Build (if needed) and start containers
build Build images using cache
rebuild Rebuild images without cache then start
down Stop and remove containers
restart Restart running containers
logs Follow logs (pass service names optionally)
artisan Run php artisan <args>
sh Shell into app container
EOF
exit 1
;;
esac

0
storage/keys/crewsportswear_app.key Normal file → Executable file
View File

0
storage/keys/crewsportswear_app.ppk Normal file → Executable file
View File