manual item upload
This commit is contained in:
@@ -443,7 +443,7 @@ class DesignerController extends Controller {
|
||||
<button class="btn btn-sm btn-default" style="margin:2px;" onclick="centerVer();"> <img src="images/align-v1.png" height="16px;" /> Center Vertical</button>
|
||||
<button class="btn btn-sm btn-default" style="margin:2px;" onclick="centerHor();" > <img src="images/align-h1.png" height="16px;" /> Center Horizontal</button> -->
|
||||
<button class="btn btn-sm btn-default btn-send-middle" style="margin:2px;" onclick="centerOnly();"></button>
|
||||
<button class="btn btn-sm btn-default center-horizontal" style="margin:2px;" onclick="centerVer();"></button>
|
||||
<button class="btn btn-sm btn-default center-vertical" style="margin:2px;" onclick="centerVer();"></button>
|
||||
<button class="btn btn-sm btn-default center-horizontal" style="margin:2px;" onclick="centerHor();" ></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -284,7 +284,13 @@ class PaypalController extends Controller {
|
||||
$item_goup_array = $newUserModel->itemGroup($cartKey);
|
||||
$item_thumbs = $newUserModel->selectDisplayItemThumb();
|
||||
$array_payment_details = $newUserModel->selectPaymentDetails('CartKey', $cartKey);
|
||||
$array_storename = $newUserModel->selectTeamStoreName($cartKey); // email subject
|
||||
|
||||
foreach($array_storename as $storname){
|
||||
|
||||
$sName[] = $storname->StoreName;
|
||||
}
|
||||
$sName = implode (", ", $sName);
|
||||
|
||||
$data = array(
|
||||
'order_item_array' => $order_item_array,
|
||||
@@ -292,14 +298,13 @@ class PaypalController extends Controller {
|
||||
'img_thumb' => $item_thumbs,
|
||||
'array_payment_details' => $array_payment_details,
|
||||
'receiver' => $user_email,
|
||||
'subject' => 'Order Details',
|
||||
'subject' => $sName . ' ORDERS',
|
||||
);
|
||||
|
||||
Mail::send('emails.orders', $data, function($message) use ($data) {
|
||||
|
||||
$message->from('no-reply@crewsportswear.com', 'CREW Sportswear');
|
||||
$message->cc('orders@crewsportswear.com', 'Orders From CREW Sportswear');
|
||||
$message->to($data['receiver'])->subject('Order Details');
|
||||
$message->to($data['receiver'])->subject($data['subject']);
|
||||
|
||||
});
|
||||
// end email sending
|
||||
|
||||
@@ -13,6 +13,8 @@ use Paypal;
|
||||
use View;
|
||||
use Mail;
|
||||
use Validator;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
|
||||
class UserController extends Controller {
|
||||
|
||||
@@ -568,6 +570,7 @@ class UserController extends Controller {
|
||||
|
||||
|
||||
}
|
||||
|
||||
$prod_code = array('ProductCode' => $getYear . '-' .str_pad($id, 10,'0', STR_PAD_LEFT));
|
||||
$i = $UserModel->updateProductCode($prod_code, $id);
|
||||
|
||||
@@ -577,4 +580,136 @@ class UserController extends Controller {
|
||||
|
||||
}
|
||||
|
||||
function addStoreItem(){
|
||||
$newTeamStoreModel = new TeamStoreModel;
|
||||
|
||||
$user_role = Auth::user()->role;
|
||||
$store_id = Auth::user()->store_id;
|
||||
|
||||
$store_array = $newTeamStoreModel->selectTeamStore('Id', $store_id);
|
||||
return view('user-layouts.add_item')->with('store_array', $store_array);
|
||||
}
|
||||
|
||||
function saveNewItem(Request $request){
|
||||
|
||||
$post = $request->all();
|
||||
// var_dump($post['imgupload']);
|
||||
$UserModel = new UserModel;
|
||||
$getYear = date('y');
|
||||
|
||||
$store_id = Auth::user()->store_id;
|
||||
$templateCode = null;
|
||||
$designCode = null;
|
||||
$itemName = $post['itemName'];
|
||||
$itemDescription = $post['itemDescription'];
|
||||
$itemPrice = $post['itemPrice'];
|
||||
$itemForm = $post['itemForm'];
|
||||
$itemUrl = $post['itemUrl'];
|
||||
$itemPrivacy = $post['itemPrivacy'];
|
||||
|
||||
$check_product_url = array(
|
||||
'ProductURL' => $itemUrl
|
||||
);
|
||||
|
||||
$validator = Validator::make($check_product_url, [
|
||||
'ProductURL' => 'unique:teamstore_products'
|
||||
],
|
||||
[
|
||||
'ProductURL.unique' => 'The Item URL has already been taken.',
|
||||
]);
|
||||
|
||||
|
||||
if ($validator->fails())
|
||||
{
|
||||
$errors = "";
|
||||
// var_dump(($validator->errors()->all()));
|
||||
foreach($validator->errors()->all() as $error){
|
||||
$errors .= "<li>".$error."</li>";
|
||||
}
|
||||
|
||||
$message = '
|
||||
<div class="alert alert-danger alert-dismissible">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
<h4><i class="icon fa fa-ban"></i> ERROR:</h4>
|
||||
'.$errors.
|
||||
'</div>';
|
||||
|
||||
return response()->json(array(
|
||||
'success' => false,
|
||||
'message' => $message
|
||||
));
|
||||
}
|
||||
|
||||
$data = array(
|
||||
'TeamStoreId' => $store_id,
|
||||
'ProductName' => $itemName,
|
||||
'ProductPrice' => str_replace('$ ', '', $itemPrice),
|
||||
'ProductDescription'=> $itemDescription,
|
||||
'ProductURL' => $itemUrl,
|
||||
'ProductForm' => $itemForm,
|
||||
'PrivacyStatus' => $itemPrivacy,
|
||||
'TemplateCode' => $templateCode,
|
||||
'DesignCode' => $designCode,
|
||||
);
|
||||
|
||||
$id = $UserModel->insertNewProduct($data); // product item id
|
||||
// echo $id;
|
||||
|
||||
for($i = 0; $i < count($post['imgupload']); $i++){
|
||||
$rawName = date('Ymd') . "-" . time().'-'.$request->file('imgupload')[$i]->getClientOriginalName();
|
||||
$imageExt = $request->file('imgupload')[$i]->getClientOriginalExtension();
|
||||
|
||||
$custom_file_name = str_replace(' ','-',strtolower($rawName));
|
||||
$custom_file_name = preg_replace("/\.[^.\s]{3,4}$/", "", $custom_file_name);
|
||||
$NewImageName = $custom_file_name.'.'.$imageExt;
|
||||
$thumbnail = $NewImageName;
|
||||
|
||||
$thumbs = $data = array(
|
||||
'ProductId' => $id,
|
||||
'Image' => $thumbnail,
|
||||
'ImageClass' =>null
|
||||
);
|
||||
|
||||
$u = $UserModel->insertNewProductThumbnails($thumbs);
|
||||
// var_dump($thumbs);
|
||||
// Storage::disk('sftp')->put($thumbnail, $request->file('imgupload')[$i]);
|
||||
Storage::disk('sftp')->put($thumbnail, fopen($request->file('imgupload')[$i], 'r+'));
|
||||
// var_dump($s);
|
||||
}
|
||||
|
||||
$prod_code = array('ProductCode' => $getYear . '-' .str_pad($id, 10,'0', STR_PAD_LEFT));
|
||||
$i = $UserModel->updateProductCode($prod_code, $id);
|
||||
|
||||
|
||||
return response()->json(array(
|
||||
'success' => true,
|
||||
'message' => 'success'
|
||||
));
|
||||
|
||||
}
|
||||
|
||||
|
||||
function updateActiveThumbnail(Request $request){
|
||||
$post = $request->all();
|
||||
$UserModel = new UserModel;
|
||||
$i = $UserModel->updateActiveThumb($post['id'], $post['product_id']);
|
||||
var_dump($i);
|
||||
|
||||
}
|
||||
|
||||
function saveThumbnailOrdering(Request $request){
|
||||
$post = $request->all();
|
||||
$arrayItems = $post['item'];
|
||||
$order = 1;
|
||||
$UserModel = new UserModel;
|
||||
foreach ($arrayItems as $item) {
|
||||
$i = $UserModel->updateThumbnailOrdering($order, $item);
|
||||
$order++;
|
||||
}
|
||||
|
||||
return response()->json(array(
|
||||
'success' => true,
|
||||
'message' => 'success'
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,6 +119,10 @@ Route::group(['middleware' => 'normaluser'], function () {
|
||||
Route::get('user/email-verify', 'user\UserController@emailVerify');
|
||||
Route::post('user/post/resend-verification', 'user\UserController@resendVericationCode');
|
||||
Route::post('user/post/verify-code', 'user\UserController@verifyCode');
|
||||
Route::get('user/store-items/add-item', 'user\UserController@addStoreItem');
|
||||
Route::post('user/store-items/save-new-item', 'user\UserController@saveNewItem');
|
||||
Route::post('user/update-active-thumbnail', 'user\UserController@updateActiveThumbnail');
|
||||
Route::post('user/post/save-thumbnail-ordering', 'user\UserController@saveThumbnailOrdering');
|
||||
|
||||
Route::get('user/my-designs/sell-design/{designCode}', 'user\UserController@sellDesign');
|
||||
Route::post('user/my-designs/addstoreitem', 'user\UserController@saveNewStoreItem');
|
||||
|
||||
@@ -32,7 +32,10 @@ class TeamStoreModel extends Model {
|
||||
|
||||
function getProductThumbnails($productId){
|
||||
|
||||
$i = DB::table('teamstore_product_thumbnails')->where('ProductId', $productId)->get();
|
||||
$i = DB::table('teamstore_product_thumbnails')
|
||||
->where('ProductId', $productId)
|
||||
->orderby('Ordering', 'ASC')
|
||||
->get();
|
||||
return $i;
|
||||
}
|
||||
|
||||
@@ -55,7 +58,10 @@ class TeamStoreModel extends Model {
|
||||
|
||||
function getThumbnails($productId){
|
||||
|
||||
$i = DB::table('teamstore_product_thumbnails')->where('ProductId', $productId)->get();
|
||||
$i = DB::table('teamstore_product_thumbnails')
|
||||
->where('ProductId', $productId)
|
||||
->orderby('Ordering', 'ASC')
|
||||
->get();
|
||||
return $i;
|
||||
}
|
||||
|
||||
|
||||
@@ -175,6 +175,7 @@ class UserModel extends Model {
|
||||
|
||||
$i = DB::table('teamstore_product_thumbnails')
|
||||
->where('ImageClass', 'active')
|
||||
->orderby('Ordering', 'ASC')
|
||||
->get();
|
||||
return $i;
|
||||
}
|
||||
@@ -216,4 +217,24 @@ class UserModel extends Model {
|
||||
|
||||
return $i;
|
||||
}
|
||||
|
||||
function selectTeamStoreName($ck){
|
||||
$pdo = DB::connection()->getPdo();
|
||||
$query = $pdo->prepare("SELECT t.StoreName FROM orders AS o INNER JOIN teamstores AS t ON t.Id = o.StoreId WHERE o.CartKey = :ck GROUP BY o.StoreId ORDER BY t.StoreName ASC");
|
||||
$query->execute(array(':ck'=>$ck));
|
||||
$row = $query->fetchAll(\PDO::FETCH_OBJ);
|
||||
return $row;
|
||||
}
|
||||
|
||||
function updateActiveThumb($id, $product_id){
|
||||
DB::table('teamstore_product_thumbnails')->where('ProductId', $product_id)
|
||||
->update(['ImageClass' => null]);
|
||||
$i = DB::table('teamstore_product_thumbnails')->where('Id', $id)
|
||||
->update(['ImageClass' => 'active']);
|
||||
}
|
||||
|
||||
function updateThumbnailOrdering($order, $id){
|
||||
$i = DB::table('teamstore_product_thumbnails')->where('Id', $id)
|
||||
->update(['Ordering' => $order]);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,9 @@
|
||||
<?php namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Storage;
|
||||
use League\Flysystem\Filesystem;
|
||||
use League\Flysystem\Sftp\SftpAdapter;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider {
|
||||
|
||||
@@ -15,6 +18,10 @@ class AppServiceProvider extends ServiceProvider {
|
||||
\Blade::extend(function($value) {
|
||||
return preg_replace('/\@define(.+)/', '<?php ${1}; ?>', $value);
|
||||
});
|
||||
|
||||
Storage::extend('sftp', function ($app, $config) {
|
||||
return new Filesystem(new SftpAdapter($config));
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
"netshell/paypal": "dev-master",
|
||||
"guzzlehttp/guzzle": "~5.0",
|
||||
"google/recaptcha": "~1.1",
|
||||
"spatie/laravel-analytics": "^1.4"
|
||||
"spatie/laravel-analytics": "^1.4",
|
||||
"league/flysystem-sftp": "^1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "~4.0",
|
||||
|
||||
141
composer.lock
generated
141
composer.lock
generated
@@ -4,7 +4,7 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "a6aecb41f379bcff36b6bca5a100f7a1",
|
||||
"content-hash": "9ad9cbf7c7c319c392284bef379f0004",
|
||||
"packages": [
|
||||
{
|
||||
"name": "classpreloader/classpreloader",
|
||||
@@ -862,6 +862,53 @@
|
||||
],
|
||||
"time": "2019-03-30T13:22:34+00:00"
|
||||
},
|
||||
{
|
||||
"name": "league/flysystem-sftp",
|
||||
"version": "1.0.14",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/thephpleague/flysystem-sftp.git",
|
||||
"reference": "f28d742a3e81258417293fd9a179a350154ab8f7"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/thephpleague/flysystem-sftp/zipball/f28d742a3e81258417293fd9a179a350154ab8f7",
|
||||
"reference": "f28d742a3e81258417293fd9a179a350154ab8f7",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"league/flysystem": "~1.0",
|
||||
"php": ">=5.4.0",
|
||||
"phpseclib/phpseclib": "~2.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"mockery/mockery": "0.9.*",
|
||||
"phpunit/phpunit": "~4.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.0-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"League\\Flysystem\\Sftp\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Frank de Jonge",
|
||||
"email": "info@frenky.net"
|
||||
}
|
||||
],
|
||||
"description": "Flysystem adapter for SFTP",
|
||||
"time": "2017-07-11T12:29:45+00:00"
|
||||
},
|
||||
{
|
||||
"name": "monolog/monolog",
|
||||
"version": "1.24.0",
|
||||
@@ -1226,6 +1273,98 @@
|
||||
],
|
||||
"time": "2016-01-20T17:45:52+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpseclib/phpseclib",
|
||||
"version": "2.0.15",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/phpseclib/phpseclib.git",
|
||||
"reference": "11cf67cf78dc4acb18dc9149a57be4aee5036ce0"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/11cf67cf78dc4acb18dc9149a57be4aee5036ce0",
|
||||
"reference": "11cf67cf78dc4acb18dc9149a57be4aee5036ce0",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.3"
|
||||
},
|
||||
"require-dev": {
|
||||
"phing/phing": "~2.7",
|
||||
"phpunit/phpunit": "^4.8.35|^5.7|^6.0",
|
||||
"sami/sami": "~2.0",
|
||||
"squizlabs/php_codesniffer": "~2.0"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-gmp": "Install the GMP (GNU Multiple Precision) extension in order to speed up arbitrary precision integer arithmetic operations.",
|
||||
"ext-libsodium": "SSH2/SFTP can make use of some algorithms provided by the libsodium-php extension.",
|
||||
"ext-mcrypt": "Install the Mcrypt extension in order to speed up a few other cryptographic operations.",
|
||||
"ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations."
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"files": [
|
||||
"phpseclib/bootstrap.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"phpseclib\\": "phpseclib/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Jim Wigginton",
|
||||
"email": "terrafrost@php.net",
|
||||
"role": "Lead Developer"
|
||||
},
|
||||
{
|
||||
"name": "Patrick Monnerat",
|
||||
"email": "pm@datasphere.ch",
|
||||
"role": "Developer"
|
||||
},
|
||||
{
|
||||
"name": "Andreas Fischer",
|
||||
"email": "bantu@phpbb.com",
|
||||
"role": "Developer"
|
||||
},
|
||||
{
|
||||
"name": "Hans-Jürgen Petrich",
|
||||
"email": "petrich@tronic-media.com",
|
||||
"role": "Developer"
|
||||
},
|
||||
{
|
||||
"name": "Graham Campbell",
|
||||
"email": "graham@alt-three.com",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"description": "PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.",
|
||||
"homepage": "http://phpseclib.sourceforge.net",
|
||||
"keywords": [
|
||||
"BigInteger",
|
||||
"aes",
|
||||
"asn.1",
|
||||
"asn1",
|
||||
"blowfish",
|
||||
"crypto",
|
||||
"cryptography",
|
||||
"encryption",
|
||||
"rsa",
|
||||
"security",
|
||||
"sftp",
|
||||
"signature",
|
||||
"signing",
|
||||
"ssh",
|
||||
"twofish",
|
||||
"x.509",
|
||||
"x509"
|
||||
],
|
||||
"time": "2019-03-10T16:53:45+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/log",
|
||||
"version": "1.1.0",
|
||||
|
||||
@@ -66,6 +66,17 @@ return [
|
||||
'url_type' => 'publicURL'
|
||||
],
|
||||
|
||||
'sftp' => [
|
||||
'driver' => 'sftp',
|
||||
'host' => '35.232.234.8',
|
||||
'port' => 22,
|
||||
'username' => 'root',
|
||||
'password' => '',
|
||||
'privateKey' => 'C:\\Users\\user\\Documents\\#keys\\instance2\\root.ppk',
|
||||
'root' => '/var/www/html/images',
|
||||
'timeout' => 10
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
];
|
||||
|
||||
@@ -16,8 +16,8 @@ return [
|
||||
// 'company_name' => env('COMPANY_NAME','Acme Inc'),
|
||||
// 'company_email' => env('COMPANY_email','contact@acme.inc'),
|
||||
|
||||
// 'prod_private_server_ip' => env('35.232.234.8', '35.232.234.8'),
|
||||
'prod_private_server_ip' => env('http://192.168.2.238', 'http://192.168.2.238'), // local
|
||||
// 'prod_private_server_ip' => env('https://crewsportswear.app', 'https://crewsportswear.app'),
|
||||
'prod_private_server_ip' => env('http://localhost', 'http://localhost'), // local
|
||||
|
||||
'designer_location' => env('http://localhost/plain-tshirt/', 'http://localhost/plain-tshirt/'),
|
||||
|
||||
|
||||
@@ -229,19 +229,19 @@
|
||||
</div>
|
||||
|
||||
@if(($template->Type == "Jersey" || $template->Type == "Shirts") && $template->Side == "Front")
|
||||
<canvas id="canvas_{{ $template->Type }}_{{ $template->Side }}" width="222px" height="380px" style="margin-top:36px; margin-left: -3px;"></canvas>
|
||||
<canvas id="canvas_{{ $template->Type }}_{{ $template->Side }}" width="222px" height="380px" style="margin-top:42px; margin-left: 0px;"></canvas>
|
||||
@endif
|
||||
|
||||
@if(($template->Type == "Jersey" || $template->Type == "Shirts") && $template->Side == "Back")
|
||||
<canvas id="canvas_{{ $template->Type }}_{{ $template->Side }}" width="221.107px" height="379.04px" style="margin-top:24px;"></canvas>
|
||||
<canvas id="canvas_{{ $template->Type }}_{{ $template->Side }}" width="221.107px" height="379.04px" style="margin-top:16px; margin-left:-1px;"></canvas>
|
||||
@endif
|
||||
|
||||
@if($template->Type == "Shorts" && $template->Side == "Right")
|
||||
<canvas id="canvas_{{ $template->Type }}_{{ $template->Side }}" width="157.933px" height="315.863px" style="margin-top:188px; margin-left: 0px;" ></canvas>
|
||||
<canvas id="canvas_{{ $template->Type }}_{{ $template->Side }}" width="157.933px" height="315.863px" style="margin-top:175px; margin-left: 0px;" ></canvas>
|
||||
@endif
|
||||
|
||||
@if($template->Type == "Shorts" && $template->Side == "Left")
|
||||
<canvas id="canvas_{{ $template->Type }}_{{ $template->Side }}" width="157.933px" height="315.863px" style="margin-top:188px; margin-left: 0px;" ></canvas>
|
||||
<canvas id="canvas_{{ $template->Type }}_{{ $template->Side }}" width="157.933px" height="315.863px" style="margin-top:175px; margin-left: 0px;" ></canvas>
|
||||
@endif
|
||||
|
||||
@if($template->Type == "Shirts" && $template->Side == "Right")
|
||||
@@ -1489,7 +1489,13 @@
|
||||
canvas = window[$(this).attr('data-canvas-id')];
|
||||
canvasID = $(this).attr('data-canvas-id');
|
||||
canvas.calcOffset();
|
||||
// initCanvas();
|
||||
initCanvas();
|
||||
canvas.on('object:moving', function(options) {
|
||||
|
||||
console.log('asdasd')
|
||||
});
|
||||
// canvas.on('selection:cleared', onDeSelected);
|
||||
// canvas.on('object:selected', onSelected);
|
||||
});
|
||||
|
||||
//trigger enter ######################################################################
|
||||
@@ -1593,12 +1599,11 @@
|
||||
left: canvas.width / 2 - options.target.getWidth() / 2,
|
||||
}).setCoords();
|
||||
|
||||
// console.log(canvasID.split("_")[2] + "_" +canvasID.split("_")[1] + "_Border")
|
||||
|
||||
// $("#"+canvasID.split("_")[2] + "_" +canvasID.split("_")[1] + "_Border").css({ "display" : "" });
|
||||
document.getElementById(canvasID.split("_")[2] + "_" +canvasID.split("_")[1] + "_Border").setAttribute("display", "");
|
||||
|
||||
}
|
||||
console.log('asdasd')
|
||||
});
|
||||
|
||||
canvas.on('object:rotating', onRotating);
|
||||
@@ -1707,7 +1712,7 @@
|
||||
// console.log("Height =", (obj.getScaleY() * obj.getHeight()).toFixed(2));
|
||||
// console.log("Width = ", (obj.getScaleX() * obj.getWidth()).toFixed(2));
|
||||
|
||||
// console.log('left-', obj.left, 'top-', obj.top);
|
||||
console.log('left-', obj.left, 'top-', obj.top);
|
||||
// console.log('font-', obj.fontSize);
|
||||
|
||||
if(obj != null){
|
||||
@@ -1942,6 +1947,13 @@
|
||||
window.addEventListener("keydown", processKeys, false);
|
||||
// end arrow keys navigations
|
||||
|
||||
// window.addEventListener("mousemove", myFunction, false);
|
||||
|
||||
|
||||
// function myFunction(){
|
||||
// console.log('asda')
|
||||
// }
|
||||
|
||||
//remove object
|
||||
$(document).on('button click', '.remove', function() {
|
||||
var object = canvas.getActiveObject();
|
||||
@@ -2651,7 +2663,7 @@
|
||||
|
||||
var defNameShortLeft = new fabric.Text(defaultNumber, {
|
||||
idNumber:"NumberLeftShorts",
|
||||
top: 278.35,
|
||||
top: 235.35,
|
||||
fontSize: 62.50, // 71.25 for default font size. equivalent 2.5"
|
||||
//height: fabric.util.parseUnit('1in'),
|
||||
fill: '#000000',
|
||||
@@ -2673,7 +2685,7 @@
|
||||
|
||||
var defNameShortRight = new fabric.Text(defaultNumber, {
|
||||
idNumber:"NumberRightShorts",
|
||||
top: 278.35,
|
||||
top: 235.35,
|
||||
fontSize: 62.50, // 71.25 for default font size. equivalent 2.5"
|
||||
//height: fabric.util.parseUnit('1in'),
|
||||
fill: '#000000',
|
||||
@@ -3013,7 +3025,7 @@
|
||||
}
|
||||
|
||||
function getClipartProperties(arrayPathId, randomNumbers) {
|
||||
console.log(arrayPathId);
|
||||
// console.log(arrayPathId);
|
||||
$.ajax({ //create an ajax request to load_page.php
|
||||
|
||||
type: "POST",
|
||||
@@ -3044,7 +3056,7 @@
|
||||
// END 4TH TAB
|
||||
|
||||
// 5TH TAB
|
||||
// for upload image
|
||||
// for upload image
|
||||
document.getElementById('upload-images').onchange = function handleImage(e) {
|
||||
console.log(event);
|
||||
var reader = new FileReader();
|
||||
@@ -3913,8 +3925,8 @@
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
//################### E N D C O L O R P A L E T T E S #######################//
|
||||
|
||||
function myCart(){
|
||||
$.ajax({ //create an ajax request to load_page.php
|
||||
|
||||
|
||||
@@ -1,50 +1,38 @@
|
||||
[
|
||||
[
|
||||
"rgb(0, 0, 0)",
|
||||
"rgb(67, 67, 67)",
|
||||
"rgb(102, 102, 102)",
|
||||
"rgb(204, 204, 204)",
|
||||
"rgb(217, 217, 217)",
|
||||
"rgb(255, 255, 255)"
|
||||
"rgb(38, 38, 38)",
|
||||
"rgb(102, 102, 102)",
|
||||
"rgb(68, 69, 79)",
|
||||
"rgb(255, 255, 255)"
|
||||
],
|
||||
[
|
||||
"rgb(152, 0, 0)",
|
||||
"rgb(255, 0, 0)",
|
||||
"rgb(255, 153, 0)",
|
||||
"rgb(255, 255, 0)",
|
||||
"rgb(0, 255, 0)",
|
||||
"rgb(0, 255, 255)"
|
||||
"rgb(77, 20, 8)",
|
||||
"rgb(0, 75, 43)",
|
||||
"rgb(0, 135, 81)",
|
||||
"rgb(0, 111, 175)"
|
||||
],
|
||||
[
|
||||
"rgb(74, 134, 232)",
|
||||
"rgb(0, 0, 255)",
|
||||
"rgb(153, 0, 255)",
|
||||
"rgb(255, 0, 255)",
|
||||
"rgb(230, 184, 175)",
|
||||
"rgb(244, 204, 204)"
|
||||
"rgb(0, 95, 111)",
|
||||
"rgb(16, 34, 64)",
|
||||
"rgb(66, 128, 206)",
|
||||
"rgb(17, 43, 155)"
|
||||
],
|
||||
[
|
||||
"rgb(252, 229, 205)",
|
||||
"rgb(255, 242, 204)",
|
||||
"rgb(217, 234, 211)",
|
||||
"rgb(208, 224, 227)",
|
||||
"rgb(201, 218, 248)",
|
||||
"rgb(207, 226, 243)"
|
||||
"rgb(64, 18, 129)",
|
||||
"rgb(116, 0, 36)",
|
||||
"rgb(169, 30, 54)",
|
||||
"rgb(221, 117, 174)"
|
||||
],
|
||||
[
|
||||
"rgb(217, 210, 233)",
|
||||
"rgb(234, 209, 220)",
|
||||
"rgb(221, 126, 107)",
|
||||
"rgb(234, 153, 153)",
|
||||
"rgb(249, 203, 156)",
|
||||
"rgb(255, 229, 153)"
|
||||
"rgb(214, 0, 2)",
|
||||
"rgb(51, 0, 0)",
|
||||
"rgb(255, 224, 27)",
|
||||
"rgb(255, 186, 0)"
|
||||
],
|
||||
[
|
||||
"rgb(182, 215, 168)",
|
||||
"rgb(162, 196, 201)",
|
||||
"rgb(164, 194, 244)",
|
||||
"rgb(159, 197, 232)",
|
||||
"rgb(180, 167, 214)",
|
||||
"rgb(213, 166, 189)"
|
||||
"rgb(211, 198, 120)",
|
||||
"rgb(158, 64, 0)",
|
||||
"rgb(255, 64, 0)",
|
||||
"rgb(255, 112, 10)"
|
||||
]
|
||||
]
|
||||
]
|
||||
@@ -54,9 +54,9 @@
|
||||
display: block;
|
||||
margin: 0 auto !important;
|
||||
/* makes it centered */
|
||||
max-width: 580px;
|
||||
max-width: 680px;
|
||||
padding: 10px;
|
||||
width: 580px;
|
||||
width: 680px;
|
||||
}
|
||||
|
||||
/* This should also be a block element, so that it will fill 100% of the .container */
|
||||
@@ -64,7 +64,7 @@
|
||||
box-sizing: border-box;
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
max-width: 580px;
|
||||
max-width: 680px;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
@@ -352,7 +352,7 @@
|
||||
<tr>
|
||||
<td>
|
||||
<h3 class="align-center"><b>Order Details</b></h3>
|
||||
<table class="table table-condensed table-bordered" style="width: 100%; border-collapse: collapse; ">
|
||||
<table class="table table-condensed table-bordered" width="100%" style="width: 100%; border-collapse: collapse; ">
|
||||
<tr >
|
||||
<td class="text-center" colspan="2"><b>Payer Information</b></td>
|
||||
</tr>
|
||||
@@ -392,10 +392,10 @@
|
||||
<p>Item Order(s):</p>
|
||||
@foreach($item_goup_array as $item)
|
||||
<div style="border: 1px solid #e2e2e2; padding: 10px; margin-bottom: 10px;">
|
||||
<table role="presentation" border="0" cellpadding="0" cellspacing="0" >
|
||||
<table role="presentation" border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="left">
|
||||
<td align="left" style="width: 180px;">
|
||||
@foreach($img_thumb as $img)
|
||||
@if($img->ProductId == $item->ProductId)
|
||||
<img style="height: 200px; overflow: hidden; object-fit: contain;" src="{{ config('site_config.prod_private_server_ip') }}/images/{{ $img->Image }}">
|
||||
@@ -405,7 +405,7 @@
|
||||
<td>
|
||||
<div style="font-size: 14px;"><a href="{{ url('teamstore') . '/' . $item->StoreURL . '/' . 'product/' . $item->ProductURL }}">{{ $item->ProductName }}</a></div>
|
||||
Total Price: ${{ $item->total_price }} • Row(s): {{ $item->qty }}
|
||||
<table class="table table-condensed table-bordered" style="width: 100%; border-collapse: collapse;">
|
||||
<table class="table table-condensed table-bordered" width="100%" style="width: 100%; border-collapse: collapse;">
|
||||
@if($item->FormUsed=="jersey-and-shorts-form")
|
||||
<tr>
|
||||
<td><b>Name</b></td>
|
||||
@@ -420,9 +420,7 @@
|
||||
<td><b>Size</b></td>
|
||||
<td><b>Price</b></td>
|
||||
<td><b>Quantity</b></td>
|
||||
|
||||
</tr>
|
||||
|
||||
@elseif($item->FormUsed=="quantity-form")
|
||||
<tr>
|
||||
<td><b>Price</b></td>
|
||||
|
||||
@@ -80,7 +80,9 @@
|
||||
<!-- <hr class="hr-design"> -->
|
||||
<div id="displayqty"></div>
|
||||
<br>
|
||||
<button class="btn btn-primary pull-right" type="submit" id="btn-add-to-cart"><span class="glyphicon glyphicon-shopping-cart" aria-hidden="true"></span> Add to Cart</button>
|
||||
@if($product_array[0]->ProductPrice > 0)
|
||||
<button class="btn btn-primary pull-right" type="submit" id="btn-add-to-cart"><span class="glyphicon glyphicon-shopping-cart" aria-hidden="true"></span> Add to Cart</button>
|
||||
@endif
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -63,7 +63,9 @@
|
||||
<!-- <hr class="hr-design"> -->
|
||||
<div id="displayqty"></div>
|
||||
<br>
|
||||
<button class="btn btn-primary pull-right" type="submit" id="btn-add-to-cart"><span class="glyphicon glyphicon-shopping-cart" aria-hidden="true"></span> Add to Cart</button>
|
||||
@if($product_array[0]->ProductPrice > 0)
|
||||
<button class="btn btn-primary pull-right" type="submit" id="btn-add-to-cart"><span class="glyphicon glyphicon-shopping-cart" aria-hidden="true"></span> Add to Cart</button>
|
||||
@endif
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -72,7 +72,9 @@
|
||||
<!-- <hr class="hr-design"> -->
|
||||
<div id="displayqty"></div>
|
||||
<br>
|
||||
<button class="btn btn-primary pull-right" type="submit" id="btn-add-to-cart"><span class="glyphicon glyphicon-shopping-cart" aria-hidden="true"></span> Add to Cart</button>
|
||||
@if($product_array[0]->ProductPrice > 0)
|
||||
<button class="btn btn-primary pull-right" type="submit" id="btn-add-to-cart"><span class="glyphicon glyphicon-shopping-cart" aria-hidden="true"></span> Add to Cart</button>
|
||||
@endif
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -72,7 +72,9 @@
|
||||
<!-- <hr class="hr-design"> -->
|
||||
<div id="displayqty"></div>
|
||||
<br>
|
||||
<button class="btn btn-primary pull-right" type="submit" id="btn-add-to-cart"><span class="glyphicon glyphicon-shopping-cart" aria-hidden="true"></span> Add to Cart</button>
|
||||
@if($product_array[0]->ProductPrice > 0)
|
||||
<button class="btn btn-primary pull-right" type="submit" id="btn-add-to-cart"><span class="glyphicon glyphicon-shopping-cart" aria-hidden="true"></span> Add to Cart</button>
|
||||
@endif
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -59,7 +59,9 @@
|
||||
<!-- <hr class="hr-design"> -->
|
||||
<div id="displayqty"></div>
|
||||
<br>
|
||||
<button class="btn btn-primary pull-right" type="submit" id="btn-add-to-cart"><span class="glyphicon glyphicon-shopping-cart" aria-hidden="true"></span> Add to Cart</button>
|
||||
@if($product_array[0]->ProductPrice > 0)
|
||||
<button class="btn btn-primary pull-right" type="submit" id="btn-add-to-cart"><span class="glyphicon glyphicon-shopping-cart" aria-hidden="true"></span> Add to Cart</button>
|
||||
@endif
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -59,7 +59,9 @@
|
||||
<!-- <hr class="hr-design"> -->
|
||||
<div id="displayqty"></div>
|
||||
<br>
|
||||
<button class="btn btn-primary pull-right" type="submit" id="btn-add-to-cart"><span class="glyphicon glyphicon-shopping-cart" aria-hidden="true"></span> Add to Cart</button>
|
||||
@if($product_array[0]->ProductPrice > 0)
|
||||
<button class="btn btn-primary pull-right" type="submit" id="btn-add-to-cart"><span class="glyphicon glyphicon-shopping-cart" aria-hidden="true"></span> Add to Cart</button>
|
||||
@endif
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -64,7 +64,9 @@
|
||||
<!-- <hr class="hr-design"> -->
|
||||
<div id="displayqty"></div>
|
||||
<br>
|
||||
<button class="btn btn-primary pull-right" type="submit" id="btn-add-to-cart"><span class="glyphicon glyphicon-shopping-cart" aria-hidden="true"></span> Add to Cart</button>
|
||||
@if($product_array[0]->ProductPrice > 0)
|
||||
<button class="btn btn-primary pull-right" type="submit" id="btn-add-to-cart"><span class="glyphicon glyphicon-shopping-cart" aria-hidden="true"></span> Add to Cart</button>
|
||||
@endif
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
132
resources/views/user-layouts/add_item.blade.php
Normal file
132
resources/views/user-layouts/add_item.blade.php
Normal file
@@ -0,0 +1,132 @@
|
||||
@extends('user-layouts.user_template')
|
||||
@section('content')
|
||||
<style>
|
||||
.hide-bullets {
|
||||
list-style:none;
|
||||
margin-left: -40px;
|
||||
margin-top:20px;
|
||||
}
|
||||
</style>
|
||||
<div class="content-wrapper" style="min-height: 916px;">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1>
|
||||
Add Store Item
|
||||
</h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ url('user') }}"><i class="fa fa-home"></i> Home</a></li>
|
||||
<li><a href="{{ url('user/store-items') }}"><i class="fa fa-th"></i> Store Items</a></li>
|
||||
<li class="active">Add new Item</li>
|
||||
</ol>
|
||||
</section>
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<form id="frm-add-item">
|
||||
<div class="row">
|
||||
<div class="col-md-7">
|
||||
<div class="box box-primary">
|
||||
<div class="box-body custom-box-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12" id="main_thumbnail_uploader">
|
||||
<div style="min-height:500px;">
|
||||
<input type="file" id="imgupload" name="imgupload[]" style="display:none;" multiple accept="image/*"/>
|
||||
<a href="#" id="OpenImgUpload" style="position:absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);" >
|
||||
<i style="font-size: 125px;" class="fa fa-picture-o"></i>
|
||||
<div class="text-center"> Add item image(s)</div>
|
||||
<!-- <div class="gallery"></div> -->
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- image preview -->
|
||||
<div class="col-md-12" id="upload_thumbnail_preview" style="display:none;">
|
||||
<div class="row">
|
||||
<div class="col-md-12 text-center">
|
||||
<img style="height:400px" src="#" id="main-thumbnail">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<ul class="hide-bullets small-preview-thumb">
|
||||
<!-- <li class="col-sm-3 col-xs-3">
|
||||
<a href="#" class="text-center thumbnail a_thumbnail" id="OpenImgUpload2">
|
||||
<i style="font-size: 70px;" class="fa fa-picture-o"></i>
|
||||
<div class="text-center"> Add more image(s)</div>
|
||||
</a>
|
||||
</li> -->
|
||||
</ul>
|
||||
</div>
|
||||
</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>
|
||||
<div class="box-body custom-box-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<!-- <input type="hidden" class="form-control" name="item_url" placeholder="Item Name"> -->
|
||||
<div class="form-group">
|
||||
<div id="add_item_response_msg"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Item Name</label>
|
||||
<input type="text" class="form-control" id="itemName" name="itemName" placeholder="Item Name">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Item Desription</label>
|
||||
<textarea class="form-control" name="itemDescription"></textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Item Price</label>
|
||||
<input id="item_price" name="itemPrice" class="form-control price_format" type="text" 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">Jersey and Shorts Form</option>
|
||||
<option value="tshirt-form">T-Shirt Form</option>
|
||||
<option value="quantity-form">Quantity 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="number-form">Number Only Form</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Item URL</label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon" id="basic-addon3">{{ url() . "/teamstore/" . $store_array[0]->StoreUrl . '/'}}</span>
|
||||
<input type="text" class="form-control" id="product_url" name="itemUrl" aria-describedby="basic-addon3" data-error="#err-itemUrl" >
|
||||
</div>
|
||||
<span id="err-itemUrl"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Item Privacy</label>
|
||||
<select class="form-control" name="itemPrivacy">
|
||||
<option value="private">Private</option>
|
||||
<option value="public">Public</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<!-- <button type="submit" class="btn btn-default">Cancel</button> -->
|
||||
<button type="submit" id="btn_submit_new_item" class="btn btn-primary pull-right">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
@endsection
|
||||
@@ -92,7 +92,7 @@
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">
|
||||
Design Details
|
||||
Item Details
|
||||
</h3>
|
||||
</div>
|
||||
<form id="frm_sell_design">
|
||||
|
||||
@@ -35,6 +35,24 @@
|
||||
<h3 class="box-title">
|
||||
Item List
|
||||
</h3>
|
||||
<div class="box-tools pull-right">
|
||||
|
||||
<a href="{{ url('user/store-items/add-item') }}" type="button" class="btn btn-primary btn-sm">
|
||||
<i class="fa fa-plus"></i> Add new Item
|
||||
</a>
|
||||
<!-- <div class="btn-group">
|
||||
<button type="button" class="btn btn-box-tool dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="fa fa-wrench"></i></button>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="#">Action</a></li>
|
||||
<li><a href="#">Another action</a></li>
|
||||
<li><a href="#">Something else here</a></li>
|
||||
<li class="divider"></li>
|
||||
<li><a href="#">Separated link</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button> -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- <form role="form" id="frm-change-password"> -->
|
||||
<div class="box-body">
|
||||
|
||||
@@ -358,6 +358,115 @@
|
||||
.thumbnail>img {
|
||||
height: 187px;
|
||||
}
|
||||
|
||||
.funkyradio div {
|
||||
clear: both;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.funkyradio label {
|
||||
width: 100%;
|
||||
border-radius: 3px;
|
||||
border: 1px solid #D1D3D4;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.funkyradio input[type="radio"]:empty,
|
||||
.funkyradio input[type="checkbox"]:empty {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.funkyradio input[type="radio"]:empty ~ label,
|
||||
.funkyradio input[type="checkbox"]:empty ~ label {
|
||||
position: relative;
|
||||
line-height: 2.5em;
|
||||
text-indent: 3.25em;
|
||||
margin-top: 2em;
|
||||
cursor: pointer;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.funkyradio input[type="radio"]:empty ~ label:before,
|
||||
.funkyradio input[type="checkbox"]:empty ~ label:before {
|
||||
position: absolute;
|
||||
display: block;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
content: '';
|
||||
width: 2.5em;
|
||||
background: #D1D3D4;
|
||||
border-radius: 0 0 0 3px;
|
||||
}
|
||||
|
||||
.funkyradio input[type="radio"]:hover:not(:checked) ~ label,
|
||||
.funkyradio input[type="checkbox"]:hover:not(:checked) ~ label {
|
||||
color: #888;
|
||||
}
|
||||
|
||||
.funkyradio input[type="radio"]:hover:not(:checked) ~ label:before,
|
||||
.funkyradio input[type="checkbox"]:hover:not(:checked) ~ label:before {
|
||||
content: '\2714';
|
||||
text-indent: .9em;
|
||||
color: #C2C2C2;
|
||||
}
|
||||
|
||||
.funkyradio input[type="radio"]:checked ~ label,
|
||||
.funkyradio input[type="checkbox"]:checked ~ label {
|
||||
color: #777;
|
||||
}
|
||||
|
||||
.funkyradio input[type="radio"]:checked ~ label:before,
|
||||
.funkyradio input[type="checkbox"]:checked ~ label:before {
|
||||
content: '\2714';
|
||||
text-indent: .9em;
|
||||
color: #333;
|
||||
background-color: #ccc;
|
||||
}
|
||||
|
||||
.funkyradio input[type="radio"]:focus ~ label:before,
|
||||
.funkyradio input[type="checkbox"]:focus ~ label:before {
|
||||
box-shadow: 0 0 0 3px #999;
|
||||
}
|
||||
|
||||
.funkyradio-default input[type="radio"]:checked ~ label:before,
|
||||
.funkyradio-default input[type="checkbox"]:checked ~ label:before {
|
||||
color: #333;
|
||||
background-color: #ccc;
|
||||
}
|
||||
|
||||
.funkyradio-primary input[type="radio"]:checked ~ label:before,
|
||||
.funkyradio-primary input[type="checkbox"]:checked ~ label:before {
|
||||
color: #fff;
|
||||
background-color: #337ab7;
|
||||
}
|
||||
|
||||
.funkyradio-success input[type="radio"]:checked ~ label:before,
|
||||
.funkyradio-success input[type="checkbox"]:checked ~ label:before {
|
||||
color: #fff;
|
||||
background-color: #5cb85c;
|
||||
}
|
||||
|
||||
.funkyradio-danger input[type="radio"]:checked ~ label:before,
|
||||
.funkyradio-danger input[type="checkbox"]:checked ~ label:before {
|
||||
color: #fff;
|
||||
background-color: #d9534f;
|
||||
}
|
||||
|
||||
.funkyradio-warning input[type="radio"]:checked ~ label:before,
|
||||
.funkyradio-warning input[type="checkbox"]:checked ~ label:before {
|
||||
color: #fff;
|
||||
background-color: #f0ad4e;
|
||||
}
|
||||
|
||||
.funkyradio-info input[type="radio"]:checked ~ label:before,
|
||||
.funkyradio-info input[type="checkbox"]:checked ~ label:before {
|
||||
color: #fff;
|
||||
background-color: #5bc0de;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
@@ -410,8 +519,112 @@
|
||||
<script src="https://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js"></script>
|
||||
<!-- \priceformat -->
|
||||
<script src="{{asset('/public/designer/js/jquery.priceformat.min.js')}}"></script>
|
||||
<!-- jquery-ui js -->
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script>
|
||||
|
||||
<script>
|
||||
$( document ).ready(function() {
|
||||
|
||||
var tr_sortable = $('#sortable');
|
||||
|
||||
tr_sortable.sortable({
|
||||
revert: 100,
|
||||
placeholder: 'placeholder'
|
||||
});
|
||||
|
||||
tr_sortable.disableSelection();
|
||||
|
||||
$('#btn_save_thumbnail_sorting').on('click', function(e) {
|
||||
e.preventDefault();
|
||||
var sortable_data = tr_sortable.sortable('serialize');
|
||||
// div_response . text ( 'Save' );
|
||||
console.log(sortable_data);
|
||||
$.ajax({
|
||||
data: sortable_data,
|
||||
type: 'POST',
|
||||
url : "{{ url('user/post/save-thumbnail-ordering') }}",
|
||||
beforeSend:function(xhr){
|
||||
|
||||
var token = $('meta[name="csrf_token"]').attr('content');
|
||||
|
||||
if (token) {
|
||||
return xhr.setRequestHeader('X-CSRF-TOKEN', token);
|
||||
}
|
||||
xhr.setRequestHeader( 'X-Requested-With', 'XMLHttpRequest');
|
||||
},
|
||||
success:function(result) {
|
||||
// div_response.html(result);
|
||||
console.log(result);
|
||||
if(result.success){
|
||||
alert('Thumbnail ordering is succcessfully updated!');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#myModal').on('hidden.bs.modal', function () {
|
||||
location.reload();
|
||||
});
|
||||
|
||||
$('#OpenImgUpload').click(function(){
|
||||
$('#imgupload').trigger('click');
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#OpenImgUpload2').click(function(){
|
||||
// $('#imgupload').trigger('click');
|
||||
|
||||
var getImages = $('#imgupload').val();
|
||||
|
||||
// console.log(getImages);
|
||||
return false;
|
||||
});
|
||||
|
||||
var imagesPreview = function(input) {
|
||||
|
||||
if (input.files) {
|
||||
var filesAmount = input.files.length;
|
||||
$('#main_thumbnail_uploader').css({
|
||||
"display" : "none"
|
||||
});
|
||||
|
||||
$('#upload_thumbnail_preview').css({
|
||||
"display" : ""
|
||||
});
|
||||
|
||||
for (i = 0; i < filesAmount; i++) {
|
||||
var reader = new FileReader();
|
||||
|
||||
if(i == 0){
|
||||
reader.onload = function(event) {
|
||||
$('#main-thumbnail').attr('src', event.target.result);
|
||||
$( ".small-preview-thumb" ).prepend('<li class="col-sm-3 col-xs-3"> ' +
|
||||
'<a class="text-center thumbnail a_thumbnail active"> ' +
|
||||
'<img class="img img-responsive product-center image-thumbnails" style="height: 90px;" src="'+event.target.result+'"/> ' +
|
||||
'</a> ' +
|
||||
'</li>');
|
||||
}
|
||||
}else{
|
||||
reader.onload = function(event) {
|
||||
$( ".small-preview-thumb" ).prepend('<li class="col-sm-3 col-xs-3"> ' +
|
||||
'<a class="text-center thumbnail a_thumbnail"> ' +
|
||||
'<img class="img img-responsive product-center image-thumbnails" style="height: 90px;" src="'+event.target.result+'"/> ' +
|
||||
'</a> ' +
|
||||
'</li>');
|
||||
}
|
||||
}
|
||||
|
||||
reader.readAsDataURL(input.files[i]);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
$('#imgupload').on('change', function() {
|
||||
imagesPreview(this);
|
||||
});
|
||||
|
||||
|
||||
$('.price_format').priceFormat({
|
||||
prefix: '$ '
|
||||
});
|
||||
@@ -682,6 +895,45 @@
|
||||
submitHandler: submitFormItemDetails
|
||||
});
|
||||
|
||||
$("#frm-add-item").validate({
|
||||
rules: {
|
||||
imgupload :{
|
||||
required: true
|
||||
},
|
||||
itemName: {
|
||||
required: true
|
||||
},
|
||||
itemDescription: {
|
||||
required: true
|
||||
},
|
||||
item_price: {
|
||||
required: true
|
||||
},
|
||||
item_url: {
|
||||
required: true
|
||||
},
|
||||
item_privacy: {
|
||||
required: true
|
||||
}
|
||||
|
||||
},
|
||||
messages: {},
|
||||
errorPlacement: function(error, element) {
|
||||
var placement = $(element).data('error');
|
||||
|
||||
if (placement) {
|
||||
|
||||
$(placement).append(error)
|
||||
|
||||
}else {
|
||||
|
||||
error.insertAfter(element);
|
||||
|
||||
}
|
||||
},
|
||||
submitHandler: submitFormAddItem
|
||||
});
|
||||
|
||||
$("#frm_verification_code").validate({
|
||||
rules: {
|
||||
verification_code: {
|
||||
@@ -831,7 +1083,8 @@
|
||||
|
||||
});
|
||||
|
||||
$('.image-thumbnails').click(function(){
|
||||
// $('.image-thumbnails').click(function(){
|
||||
$(document).on('button click', '.image-thumbnails', function(){
|
||||
// console.log($(this)[0].firstElementChild.geAttribute('class'))
|
||||
// console.log($(this).attr('src'))
|
||||
$('#main-thumbnail').attr('src', $(this).attr('src'));
|
||||
@@ -853,7 +1106,7 @@
|
||||
url: "http://"+ip+":"+port+"/forceload/"+ $(this).data('dd'),
|
||||
dataType: "json", //expect html to be returned
|
||||
beforeSend: function() {
|
||||
console.log('loading images');
|
||||
// console.log('loading images');
|
||||
},
|
||||
success: function(response){
|
||||
if(response['status'] == "success"){
|
||||
@@ -877,7 +1130,35 @@
|
||||
$('#list').click(function(event){event.preventDefault();$('#products .item').addClass('list-group-item');});
|
||||
$('#grid').click(function(event){event.preventDefault();$('#products .item').removeClass('list-group-item');$('#products .item').addClass('grid-group-item');});
|
||||
|
||||
});
|
||||
$('input[name="setActive"]').change(function(){
|
||||
if($(this).prop('checked')){
|
||||
|
||||
var product_id = $(this).data('product-id');
|
||||
var id = $(this).data('id');
|
||||
$.ajax({
|
||||
type : 'POST',
|
||||
url : "{{ url('user/update-active-thumbnail') }}",
|
||||
data : {
|
||||
product_id : product_id,
|
||||
id : id
|
||||
},
|
||||
beforeSend:function(xhr){
|
||||
var token = $('meta[name="csrf_token"]').attr('content');
|
||||
|
||||
if (token) {
|
||||
return xhr.setRequestHeader('X-CSRF-TOKEN', token);
|
||||
}
|
||||
xhr.setRequestHeader( 'X-Requested-With', 'XMLHttpRequest');
|
||||
},
|
||||
success : function(response){
|
||||
console.log(response);
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
}); //end document ready
|
||||
|
||||
// function
|
||||
function getCities(arr, q){
|
||||
@@ -1071,6 +1352,45 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
function submitFormAddItem(){
|
||||
|
||||
$.ajax({
|
||||
type : 'POST',
|
||||
url : "{{ url('user/store-items/save-new-item') }}",
|
||||
data : new FormData($('#frm-add-item')[0]),
|
||||
processData: false,
|
||||
contentType: false,
|
||||
beforeSend:function(xhr){
|
||||
$("#add_item_response_msg").fadeOut();
|
||||
$("#btn_submit_new_item").html('Saving... <i class="fa fa-spinner fa-spin"></i>');
|
||||
$("#btn_submit_new_item").prop("disabled", true);
|
||||
var token = $('meta[name="csrf_token"]').attr('content');
|
||||
|
||||
if (token) {
|
||||
return xhr.setRequestHeader('X-CSRF-TOKEN', token);
|
||||
}
|
||||
xhr.setRequestHeader( 'X-Requested-With', 'XMLHttpRequest');
|
||||
|
||||
},
|
||||
success : function(response){
|
||||
if(response.success){
|
||||
alert('New item is successfully added.');
|
||||
location.reload();
|
||||
}else{
|
||||
// alert("Something went wrong. Please try again!");
|
||||
$("#add_item_response_msg").html("");
|
||||
$("#add_item_response_msg").fadeIn(1000, function(){
|
||||
$("#add_item_response_msg").html(response.message);
|
||||
$("#btn_submit_new_item").prop("disabled", false);
|
||||
$("#btn_submit_new_item").html('Submit');
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
function submitFormVerificationCode(){
|
||||
var data = $("#frm_verification_code").serialize();
|
||||
|
||||
@@ -1145,7 +1465,7 @@
|
||||
xhr.setRequestHeader( 'X-Requested-With', 'XMLHttpRequest');
|
||||
},
|
||||
success : function(response){
|
||||
console.log(response);
|
||||
// console.log(response);
|
||||
if(response.success){
|
||||
alert("Item is successfully added to your store.");
|
||||
location.reload();
|
||||
|
||||
@@ -26,9 +26,9 @@
|
||||
<div class="row">
|
||||
<div class="col-md-7">
|
||||
<div class="box box-primary">
|
||||
<!-- <div class="box-header with-border">
|
||||
<a href="" type="button" class="btn btn-default pull-right"><i class="fa fa-trash"></i> Edit Design</a>
|
||||
</div> -->
|
||||
<div class="box-header with-border">
|
||||
<button type="button" class="btn btn-default pull-right" data-toggle="modal" data-target="#myModal"><i class="fa fa-image"></i> Re-arrange thumbnail</button>
|
||||
</div>
|
||||
<div class="box-body custom-box-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
@@ -45,10 +45,17 @@
|
||||
<div class="col-md-12">
|
||||
<ul class="hide-bullets">
|
||||
@foreach($thumbnails_array as $thumbnail)
|
||||
<li class="col-sm-3 col-xs-3">
|
||||
<a class="thumbnail a_thumbnail {{ $thumbnail->ImageClass }}">
|
||||
<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">×</span> -->
|
||||
<img class="img img-responsive product-center image-thumbnails" style="height: 59.45px;" src="{{ config('site_config.prod_private_server_ip') }}/images/{{ $thumbnail->Image }}"/>
|
||||
</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>
|
||||
@@ -122,4 +129,48 @@
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
</div>
|
||||
|
||||
<!-- 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">×</button>
|
||||
<h4 class="modal-title">Modal Header</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.prod_private_server_ip') }}/images/{{ $thumbnail->Image }}"/></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-xs btn-delete-clipart" data-id="#"><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>
|
||||
|
||||
|
||||
@endsection
|
||||
|
||||
Reference in New Issue
Block a user