added roster
This commit is contained in:
@@ -212,6 +212,7 @@ class TeamStoreController extends Controller
|
|||||||
|
|
||||||
$thumbnails_array = $m->getThumbnails($product_array[0]->Id);
|
$thumbnails_array = $m->getThumbnails($product_array[0]->Id);
|
||||||
$teams_array = $m->getTeams($product_array[0]->Id);
|
$teams_array = $m->getTeams($product_array[0]->Id);
|
||||||
|
$selectRoster = $m->selectRoster($product_array[0]->Id);
|
||||||
// $sizes_array = $m->getSizes();
|
// $sizes_array = $m->getSizes();
|
||||||
|
|
||||||
if (empty($thumbnails_array)) {
|
if (empty($thumbnails_array)) {
|
||||||
@@ -255,7 +256,8 @@ class TeamStoreController extends Controller
|
|||||||
->with('teams_array', $teams_array)
|
->with('teams_array', $teams_array)
|
||||||
->with('sizes_array', $sizes_array)
|
->with('sizes_array', $sizes_array)
|
||||||
->with('available_qty', $availableQty)
|
->with('available_qty', $availableQty)
|
||||||
->with('store_products', $store_products);
|
->with('store_products', $store_products)
|
||||||
|
->with('roster', $selectRoster);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function login(Request $request)
|
public function login(Request $request)
|
||||||
@@ -295,9 +297,12 @@ class TeamStoreController extends Controller
|
|||||||
$availableQty = null;
|
$availableQty = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$selectRoster = $TeamStoreModel->selectRoster($item[0]->Id);
|
||||||
|
|
||||||
$handle_form = view('teamstore-sublayouts.forms.' . $item[0]->ProductForm)
|
$handle_form = view('teamstore-sublayouts.forms.' . $item[0]->ProductForm)
|
||||||
->with('sizes_array', $sizes_array)
|
->with('sizes_array', $sizes_array)
|
||||||
->with('availableQty', $availableQty)
|
->with('availableQty', $availableQty)
|
||||||
|
->with('roster', $selectRoster)
|
||||||
->render();
|
->render();
|
||||||
|
|
||||||
return $handle_form;
|
return $handle_form;
|
||||||
@@ -416,7 +421,7 @@ class TeamStoreController extends Controller
|
|||||||
'ShippingCostId' => $shipping_cost_id
|
'ShippingCostId' => $shipping_cost_id
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} elseif ($product_form == "name-number-size-form") {
|
} elseif ($product_form == "name-number-size-form" || $product_form == "roster-name-number-size-form") {
|
||||||
|
|
||||||
$order_names = $post['order_names'];
|
$order_names = $post['order_names'];
|
||||||
$order_number = $post['order_number'];
|
$order_number = $post['order_number'];
|
||||||
|
|||||||
@@ -285,4 +285,12 @@ class TeamStoreModel extends Model
|
|||||||
$i = DB::select("SELECT * FROM teamstores WHERE IsActive = 'true' ORDER BY RAND() LIMIT 10");
|
$i = DB::select("SELECT * FROM teamstores WHERE IsActive = 'true' ORDER BY RAND() LIMIT 10");
|
||||||
return $i;
|
return $i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function selectRoster($productId){
|
||||||
|
|
||||||
|
$i = DB::table('roster')
|
||||||
|
->where("ProductId", $productId)
|
||||||
|
->get();
|
||||||
|
return $i;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -490,7 +490,7 @@
|
|||||||
<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 == 'name-number-size-form')
|
@elseif($item->FormUsed == 'name-number-size-form' || $item->FormUsed == "roster-name-number-size-form")
|
||||||
<tr>
|
<tr>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th>Number</th>
|
<th>Number</th>
|
||||||
@@ -590,7 +590,7 @@
|
|||||||
</td>
|
</td>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
@elseif($item->FormUsed == 'name-number-size-form')
|
@elseif($item->FormUsed == 'name-number-size-form' || $item->FormUsed == "roster-name-number-size-form")
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ $sub_item->Name }}
|
<td>{{ $sub_item->Name }}
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
@@ -128,7 +128,7 @@
|
|||||||
<th></th>
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
@elseif($item->FormUsed == 'name-number-size-form')
|
@elseif($item->FormUsed == 'name-number-size-form' || $item->FormUsed == "roster-name-number-size-form")
|
||||||
<tr>
|
<tr>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th>Number</th>
|
<th>Number</th>
|
||||||
@@ -229,7 +229,7 @@
|
|||||||
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 == 'name-number-size-form')
|
@elseif($item->FormUsed == 'name-number-size-form' || $item->FormUsed == "roster-name-number-size-form")
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ $sub_item->Name }}</td>
|
<td>{{ $sub_item->Name }}</td>
|
||||||
<td>{{ $sub_item->Number }}</td>
|
<td>{{ $sub_item->Number }}</td>
|
||||||
|
|||||||
@@ -34,20 +34,28 @@
|
|||||||
</script>
|
</script>
|
||||||
<!-- Meta Pixel Code -->
|
<!-- Meta Pixel Code -->
|
||||||
<script>
|
<script>
|
||||||
!function(f,b,e,v,n,t,s)
|
! function(f, b, e, v, n, t, s) {
|
||||||
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
|
if (f.fbq) return;
|
||||||
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
|
n = f.fbq = function() {
|
||||||
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
|
n.callMethod ?
|
||||||
n.queue=[];t=b.createElement(e);t.async=!0;
|
n.callMethod.apply(n, arguments) : n.queue.push(arguments)
|
||||||
t.src=v;s=b.getElementsByTagName(e)[0];
|
};
|
||||||
s.parentNode.insertBefore(t,s)}(window, document,'script',
|
if (!f._fbq) f._fbq = n;
|
||||||
|
n.push = n;
|
||||||
|
n.loaded = !0;
|
||||||
|
n.version = '2.0';
|
||||||
|
n.queue = [];
|
||||||
|
t = b.createElement(e);
|
||||||
|
t.async = !0;
|
||||||
|
t.src = v;
|
||||||
|
s = b.getElementsByTagName(e)[0];
|
||||||
|
s.parentNode.insertBefore(t, s)
|
||||||
|
}(window, document, 'script',
|
||||||
'https://connect.facebook.net/en_US/fbevents.js');
|
'https://connect.facebook.net/en_US/fbevents.js');
|
||||||
fbq('init', '466782825021431');
|
fbq('init', '466782825021431');
|
||||||
fbq('track', 'PageView');
|
fbq('track', 'PageView');
|
||||||
</script>
|
</script>
|
||||||
<noscript><img height="1" width="1" style="display:none"
|
<noscript><img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=466782825021431&ev=PageView&noscript=1" /></noscript>
|
||||||
src="https://www.facebook.com/tr?id=466782825021431&ev=PageView&noscript=1"
|
|
||||||
/></noscript>
|
|
||||||
<!-- End Meta Pixel Code -->
|
<!-- End Meta Pixel Code -->
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
@@ -780,6 +788,14 @@
|
|||||||
$('.' + str).remove();
|
$('.' + str).remove();
|
||||||
});
|
});
|
||||||
// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ end removing of rows @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ end removing of rows @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
|
||||||
|
$(document).on('select change', '.select-name', function() {
|
||||||
|
|
||||||
|
var selected = $(this).find('option:selected');
|
||||||
|
var number = selected.attr('data-number');
|
||||||
|
var name = selected.val();
|
||||||
|
$(this).closest("tr").find("input[name='order_number[]']").val(number)
|
||||||
|
});
|
||||||
}); //end document ready
|
}); //end document ready
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -1,17 +1,18 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
|
||||||
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
|
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
|
||||||
<meta name="description" content="Custom Uniforms offered in a variety colors to match your team. Browse through our baseball, fastpitch, softball, lacrosse, football, volleyball and basketball gear.">
|
<meta name="description" content="Custom Uniforms offered in a variety colors to match your team. Browse through our baseball, fastpitch, softball, lacrosse, football, volleyball and basketball gear.">
|
||||||
<meta name="keywords" content="custom uniforms, footwear, athletic equipment, sporting goods">
|
<meta name="keywords" content="custom uniforms, footwear, athletic equipment, sporting goods">
|
||||||
<meta name="author" content="Frank John Begornia">
|
<meta name="author" content="Kidneo">
|
||||||
<meta name="csrf_token" content="{{ csrf_token() }}" />
|
<meta name="csrf_token" content="{{ csrf_token() }}" />
|
||||||
<meta name="company_url" content="{{ $store_array[0]->StoreUrl }}" />
|
<meta name="company_url" content="{{ $store_array[0]->StoreUrl }}" />
|
||||||
|
|
||||||
<meta property="og:url" content="https://crewsportswear.com" />
|
<meta property="og:url" content="https://merchbay.com" />
|
||||||
<meta property="og:type" content="article" />
|
<meta property="og:type" content="article" />
|
||||||
<meta property="og:title" content="CREW Apparel" />
|
<meta property="og:title" content="CREW Apparel" />
|
||||||
<meta property="og:description" content="Custom Uniforms offered in a variety colors to match your team. Browse through our baseball, fastpitch, softball, lacrosse, football, volleyball and basketball gear." />
|
<meta property="og:description" content="Custom Uniforms offered in a variety colors to match your team. Browse through our baseball, fastpitch, softball, lacrosse, football, volleyball and basketball gear." />
|
||||||
@@ -60,14 +61,17 @@
|
|||||||
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-136108155-1"></script>
|
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-136108155-1"></script>
|
||||||
<script>
|
<script>
|
||||||
window.dataLayer = window.dataLayer || [];
|
window.dataLayer = window.dataLayer || [];
|
||||||
function gtag(){dataLayer.push(arguments);}
|
|
||||||
|
function gtag() {
|
||||||
|
dataLayer.push(arguments);
|
||||||
|
}
|
||||||
gtag('js', new Date());
|
gtag('js', new Date());
|
||||||
|
|
||||||
gtag('config', 'UA-136108155-1');
|
gtag('config', 'UA-136108155-1');
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
@include('layout.navbar')
|
@include('layout.navbar')
|
||||||
<!-- Example row of columns -->
|
<!-- Example row of columns -->
|
||||||
@yield('content')
|
@yield('content')
|
||||||
@@ -95,31 +99,33 @@
|
|||||||
this.value = this.value.toLocaleUpperCase();
|
this.value = this.value.toLocaleUpperCase();
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.carousel').bcSwipe({ threshold: 50 });
|
$('.carousel').bcSwipe({
|
||||||
|
threshold: 50
|
||||||
|
});
|
||||||
|
|
||||||
$('.btn-number').click(function(e){
|
$('.btn-number').click(function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
fieldName = $(this).attr('data-field');
|
fieldName = $(this).attr('data-field');
|
||||||
type = $(this).attr('data-type');
|
type = $(this).attr('data-type');
|
||||||
var input = $("input[name='"+fieldName+"']");
|
var input = $("input[name='" + fieldName + "']");
|
||||||
var currentVal = parseInt(input.val());
|
var currentVal = parseInt(input.val());
|
||||||
if (!isNaN(currentVal)) {
|
if (!isNaN(currentVal)) {
|
||||||
if(type == 'minus') {
|
if (type == 'minus') {
|
||||||
|
|
||||||
if(currentVal > input.attr('min')) {
|
if (currentVal > input.attr('min')) {
|
||||||
input.val(currentVal - 1).change();
|
input.val(currentVal - 1).change();
|
||||||
}
|
}
|
||||||
if(parseInt(input.val()) == input.attr('min')) {
|
if (parseInt(input.val()) == input.attr('min')) {
|
||||||
$(this).attr('disabled', true);
|
$(this).attr('disabled', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if(type == 'plus') {
|
} else if (type == 'plus') {
|
||||||
|
|
||||||
if(currentVal < input.attr('max')) {
|
if (currentVal < input.attr('max')) {
|
||||||
input.val(currentVal + 1).change();
|
input.val(currentVal + 1).change();
|
||||||
}
|
}
|
||||||
if(parseInt(input.val()) == input.attr('max')) {
|
if (parseInt(input.val()) == input.attr('max')) {
|
||||||
$(this).attr('disabled', true);
|
$(this).attr('disabled', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -129,15 +135,15 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#myCarousel').on('slid.bs.carousel', function (e) {
|
$('#myCarousel').on('slid.bs.carousel', function(e) {
|
||||||
var id = $('.item.active').data('slide-number');
|
var id = $('.item.active').data('slide-number');
|
||||||
// $('#carousel-text').html($('#slide-content-'+id).html());
|
// $('#carousel-text').html($('#slide-content-'+id).html());
|
||||||
// console.log(id)
|
// console.log(id)
|
||||||
$('.a_thumbnail').removeClass('active');
|
$('.a_thumbnail').removeClass('active');
|
||||||
$('#carousel-selector-'+id).addClass('active');
|
$('#carousel-selector-' + id).addClass('active');
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.input-number').focusin(function(){
|
$('.input-number').focusin(function() {
|
||||||
$(this).data('oldValue', $(this).val());
|
$(this).data('oldValue', $(this).val());
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -148,14 +154,14 @@
|
|||||||
valueCurrent = parseInt($(this).val());
|
valueCurrent = parseInt($(this).val());
|
||||||
|
|
||||||
name = $(this).attr('name');
|
name = $(this).attr('name');
|
||||||
if(valueCurrent >= minValue) {
|
if (valueCurrent >= minValue) {
|
||||||
$(".btn-number[data-type='minus'][data-field='"+name+"']").removeAttr('disabled')
|
$(".btn-number[data-type='minus'][data-field='" + name + "']").removeAttr('disabled')
|
||||||
} else {
|
} else {
|
||||||
alert('Sorry, the minimum value was reached');
|
alert('Sorry, the minimum value was reached');
|
||||||
$(this).val($(this).data('oldValue'));
|
$(this).val($(this).data('oldValue'));
|
||||||
}
|
}
|
||||||
if(valueCurrent <= maxValue) {
|
if (valueCurrent <= maxValue) {
|
||||||
$(".btn-number[data-type='plus'][data-field='"+name+"']").removeAttr('disabled')
|
$(".btn-number[data-type='plus'][data-field='" + name + "']").removeAttr('disabled')
|
||||||
} else {
|
} else {
|
||||||
alert('Sorry, the maximum value was reached');
|
alert('Sorry, the maximum value was reached');
|
||||||
$(this).val($(this).data('oldValue'));
|
$(this).val($(this).data('oldValue'));
|
||||||
@@ -164,7 +170,7 @@
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$(".input-number").keydown(function (e) {
|
$(".input-number").keydown(function(e) {
|
||||||
// Allow: backspace, delete, tab, escape, enter and .
|
// Allow: backspace, delete, tab, escape, enter and .
|
||||||
if ($.inArray(e.keyCode, [46, 8, 9, 27, 13, 190]) !== -1 ||
|
if ($.inArray(e.keyCode, [46, 8, 9, 27, 13, 190]) !== -1 ||
|
||||||
// Allow: Ctrl+A
|
// Allow: Ctrl+A
|
||||||
@@ -180,7 +186,7 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.multi-item-carousel .item').each(function(){
|
$('.multi-item-carousel .item').each(function() {
|
||||||
var next = $(this).next();
|
var next = $(this).next();
|
||||||
if (!next.length) {
|
if (!next.length) {
|
||||||
next = $(this).siblings(':first');
|
next = $(this).siblings(':first');
|
||||||
@@ -189,32 +195,32 @@
|
|||||||
next.children(':first-child').clone().appendTo($(this));
|
next.children(':first-child').clone().appendTo($(this));
|
||||||
|
|
||||||
|
|
||||||
for (var i=0; i<2; i++){
|
for (var i = 0; i < 2; i++) {
|
||||||
|
|
||||||
next=next.next();
|
next = next.next();
|
||||||
|
|
||||||
if (!next.length){
|
if (!next.length) {
|
||||||
next=$(this).siblings(':first');
|
next = $(this).siblings(':first');
|
||||||
}
|
}
|
||||||
next.children(':first-child').clone().appendTo($(this));
|
next.children(':first-child').clone().appendTo($(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#jersey_chk').click(function(){
|
$('#jersey_chk').click(function() {
|
||||||
|
|
||||||
var product_price = $('#product_price').val();
|
var product_price = $('#product_price').val();
|
||||||
var getPriceHold = $('#price_holder').val();
|
var getPriceHold = $('#price_holder').val();
|
||||||
var getHalf = getPriceHold / 2;
|
var getHalf = getPriceHold / 2;
|
||||||
|
|
||||||
if($(this).is(':checked')){
|
if ($(this).is(':checked')) {
|
||||||
$('.td-hide').css('display', '');
|
$('.td-hide').css('display', '');
|
||||||
$('.th-hide').css('display', '');
|
$('.th-hide').css('display', '');
|
||||||
|
|
||||||
$('#product_price').val(Number(product_price) + Number(getHalf));
|
$('#product_price').val(Number(product_price) + Number(getHalf));
|
||||||
$('#display-product-price').html('$ ' + $('#product_price').val());
|
$('#display-product-price').html('$ ' + $('#product_price').val());
|
||||||
// console.log($('#product_price').val() - getHalf);
|
// console.log($('#product_price').val() - getHalf);
|
||||||
}else{
|
} else {
|
||||||
$('.cls-uniformName').val('');
|
$('.cls-uniformName').val('');
|
||||||
$('.td-hide').css('display', 'none');
|
$('.td-hide').css('display', 'none');
|
||||||
$('.th-hide').css('display', 'none');
|
$('.th-hide').css('display', 'none');
|
||||||
@@ -226,16 +232,16 @@
|
|||||||
// console.log($(this).is(':checked'));
|
// console.log($(this).is(':checked'));
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#shorts_chk').click(function(){
|
$('#shorts_chk').click(function() {
|
||||||
|
|
||||||
var product_price = $('#product_price').val();
|
var product_price = $('#product_price').val();
|
||||||
var getPriceHold = $('#price_holder').val();
|
var getPriceHold = $('#price_holder').val();
|
||||||
var getHalf = getPriceHold / 2;
|
var getHalf = getPriceHold / 2;
|
||||||
|
|
||||||
if($(this).is(':checked')){
|
if ($(this).is(':checked')) {
|
||||||
$('#product_price').val(Number(product_price) + Number(getHalf));
|
$('#product_price').val(Number(product_price) + Number(getHalf));
|
||||||
$('#display-product-price').html('$ ' + $('#product_price').val());
|
$('#display-product-price').html('$ ' + $('#product_price').val());
|
||||||
}else{
|
} else {
|
||||||
|
|
||||||
$('#product_price').val(Number(product_price) - Number(getHalf));
|
$('#product_price').val(Number(product_price) - Number(getHalf));
|
||||||
$('#display-product-price').html('$ ' + $('#product_price').val());
|
$('#display-product-price').html('$ ' + $('#product_price').val());
|
||||||
@@ -246,7 +252,7 @@
|
|||||||
$(this).val($(this).val().toUpperCase());
|
$(this).val($(this).val().toUpperCase());
|
||||||
});
|
});
|
||||||
|
|
||||||
$('[id^=carousel-selector-]').click( function(){
|
$('[id^=carousel-selector-]').click(function() {
|
||||||
var id = this.id.substr(this.id.lastIndexOf("-") + 1);
|
var id = this.id.substr(this.id.lastIndexOf("-") + 1);
|
||||||
var id = parseInt(id);
|
var id = parseInt(id);
|
||||||
$('#myCarousel').carousel(id);
|
$('#myCarousel').carousel(id);
|
||||||
@@ -286,27 +292,27 @@
|
|||||||
submitHandler: submitOrderListForm
|
submitHandler: submitOrderListForm
|
||||||
});
|
});
|
||||||
|
|
||||||
function submitOrderListForm(){
|
function submitOrderListForm() {
|
||||||
var data = $("#frm-order-list").serializeArray();
|
var data = $("#frm-order-list").serializeArray();
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type : 'POST',
|
type: 'POST',
|
||||||
url : "{{ url('teamstore/q/add-to-cart') }}",
|
url: "{{ url('teamstore/q/add-to-cart') }}",
|
||||||
data : data,
|
data: data,
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
beforeSend:function(xhr){
|
beforeSend: function(xhr) {
|
||||||
var token = $('meta[name="csrf_token"]').attr('content');
|
var token = $('meta[name="csrf_token"]').attr('content');
|
||||||
|
|
||||||
if (token) {
|
if (token) {
|
||||||
return xhr.setRequestHeader('X-CSRF-TOKEN', token);
|
return xhr.setRequestHeader('X-CSRF-TOKEN', token);
|
||||||
}
|
}
|
||||||
xhr.setRequestHeader( 'X-Requested-With', 'XMLHttpRequest');
|
xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
|
||||||
},
|
},
|
||||||
success : function(response){
|
success: function(response) {
|
||||||
|
|
||||||
if(response.success){
|
if (response.success) {
|
||||||
window.location = "{{ url('cart') }}";
|
window.location = "{{ url('cart') }}";
|
||||||
}else{
|
} else {
|
||||||
alert(response.message);
|
alert(response.message);
|
||||||
location.reload();
|
location.reload();
|
||||||
}
|
}
|
||||||
@@ -318,26 +324,26 @@
|
|||||||
|
|
||||||
// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ adding of rows @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ adding of rows @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
|
||||||
$(document).on('button click', '#addNewRow', function(){
|
$(document).on('button click', '#addNewRow', function() {
|
||||||
var p_id = $('#p_id').val();
|
var p_id = $('#p_id').val();
|
||||||
$.ajax({ //create an ajax request to load_page.php
|
$.ajax({ //create an ajax request to load_page.php
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: "{{ url('/teamstore/q/add-new-row') }}",
|
url: "{{ url('/teamstore/q/add-new-row') }}",
|
||||||
data: {
|
data: {
|
||||||
p_id : p_id
|
p_id: p_id
|
||||||
},
|
},
|
||||||
|
|
||||||
dataType: "html", //expect html to be returned
|
dataType: "html", //expect html to be returned
|
||||||
beforeSend:function(xhr){
|
beforeSend: function(xhr) {
|
||||||
var token = $('meta[name="csrf_token"]').attr('content');
|
var token = $('meta[name="csrf_token"]').attr('content');
|
||||||
|
|
||||||
if (token) {
|
if (token) {
|
||||||
return xhr.setRequestHeader('X-CSRF-TOKEN', token);
|
return xhr.setRequestHeader('X-CSRF-TOKEN', token);
|
||||||
}
|
}
|
||||||
xhr.setRequestHeader( 'X-Requested-With', 'XMLHttpRequest');
|
xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
|
||||||
},
|
},
|
||||||
|
|
||||||
success: function(response){
|
success: function(response) {
|
||||||
|
|
||||||
var d = new Date();
|
var d = new Date();
|
||||||
var n = d.getTime();
|
var n = d.getTime();
|
||||||
@@ -363,17 +369,21 @@
|
|||||||
// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ end adding of rows @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ end adding of rows @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
|
||||||
// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ removing of rows @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ removing of rows @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
$(document).on('button click', '.removeRow', function(){
|
$(document).on('button click', '.removeRow', function() {
|
||||||
var str = $(this).closest('tr').attr('class');
|
var str = $(this).closest('tr').attr('class');
|
||||||
var trCount = $('#tableRow tbody').children('tr').length;
|
var trCount = $('#tableRow tbody').children('tr').length;
|
||||||
if(trCount <= 2){
|
if (trCount <= 2) {
|
||||||
$('#addnew-btn-tbl-row').html('');
|
$('#addnew-btn-tbl-row').html('');
|
||||||
$('.tr-remove-btn').html('<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>');
|
$('.tr-remove-btn').html('<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>');
|
||||||
}
|
}
|
||||||
$('.'+str).remove();
|
$('.' + str).remove();
|
||||||
});
|
});
|
||||||
// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ end removing of rows @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ end removing of rows @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}); //end document ready
|
}); //end document ready
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
<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 / Number</th>
|
||||||
|
<!-- <th class="col-md-3">Number</th> -->
|
||||||
|
<th class="col-md-3">Size</th>
|
||||||
|
<th class="text-center"></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody id="orderTableBody">
|
||||||
|
<tr class="table-tr-0">
|
||||||
|
<td class="w-50">
|
||||||
|
<!-- <input type="text" name="order_names[]" id="order_names" class="form-control input-sm inputName roster-input" placeholder="Name"> -->
|
||||||
|
<select class="form-control input-sm select-name" id="order_names" name="order_names[]">
|
||||||
|
<!-- <option value="none">none</option> -->
|
||||||
|
@foreach($roster as $ros)
|
||||||
|
<option value="{{ $ros->Name }}" data-number="{{ $ros->Number }}">{{ $ros->Name }} - {{ $ros->Number }}</option>
|
||||||
|
@endforeach
|
||||||
|
<!-- <option value="00">00</option> -->
|
||||||
|
</select>
|
||||||
|
</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> -->
|
||||||
|
<input type="hidden" class="form-control input-sm roster-input" name="order_number[]" />
|
||||||
|
<!-- </td> -->
|
||||||
|
<td class="w-50">
|
||||||
|
<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>
|
||||||
@@ -70,7 +70,7 @@
|
|||||||
<th>Price</th>
|
<th>Price</th>
|
||||||
<th>Quantity</th>
|
<th>Quantity</th>
|
||||||
</tr>
|
</tr>
|
||||||
@elseif($array_item[0]->FormUsed=="name-number-size-form")
|
@elseif($array_item[0]->FormUsed=="name-number-size-form" || $array_item[0]->FormUsed == "roster-name-number-size-form")
|
||||||
<tr>
|
<tr>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th>Number</th>
|
<th>Number</th>
|
||||||
@@ -150,7 +150,7 @@
|
|||||||
<td>{{ $array_item[0]->Quantity }}</td>
|
<td>{{ $array_item[0]->Quantity }}</td>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
@elseif($array_item[0]->FormUsed=="name-number-size-form")
|
@elseif($array_item[0]->FormUsed=="name-number-size-form" || $array_item[0]->FormUsed == "roster-name-number-size-form")
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ $array_item[0]->Name }}</td>
|
<td>{{ $array_item[0]->Name }}</td>
|
||||||
<td>{{ $array_item[0]->Number }}</td>
|
<td>{{ $array_item[0]->Number }}</td>
|
||||||
|
|||||||
@@ -135,7 +135,7 @@
|
|||||||
<th>Quantity</th>
|
<th>Quantity</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
@elseif($item->FormUsed=="name-number-size-form")
|
@elseif($item->FormUsed=="name-number-size-form" || $item->FormUsed == "roster-name-number-size-form")
|
||||||
<tr>
|
<tr>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th>Number</th>
|
<th>Number</th>
|
||||||
@@ -197,7 +197,7 @@
|
|||||||
<td>{{ $sub_item->Quantity }}</td>
|
<td>{{ $sub_item->Quantity }}</td>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
@elseif($item->FormUsed=="name-number-size-form")
|
@elseif($item->FormUsed=="name-number-size-form" || $item->FormUsed == "roster-name-number-size-form")
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ $sub_item->Name }}</td>
|
<td>{{ $sub_item->Name }}</td>
|
||||||
<td>{{ $sub_item->Number }}</td>
|
<td>{{ $sub_item->Number }}</td>
|
||||||
|
|||||||
Reference in New Issue
Block a user