fixed user dashboard for store owner (store settings, store reports)/ fixed login/register page/
This commit is contained in:
@@ -8,6 +8,9 @@
|
||||
<!-- Tell the browser to be responsive to screen width -->
|
||||
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
|
||||
<meta name="csrf_token" content="{{ csrf_token() }}" />
|
||||
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
|
||||
<meta http-equiv="Pragma" content="no-cache" />
|
||||
<meta http-equiv="Expires" content="0" />
|
||||
<!-- Bootstrap 3.3.6 -->
|
||||
<link rel="stylesheet" href="{{asset('/public/bower_components/AdminLTE/bootstrap/css/bootstrap.min.css')}}">
|
||||
<!-- Font Awesome -->
|
||||
@@ -29,6 +32,16 @@
|
||||
<link rel="stylesheet" href="{{asset('/public/bower_components/AdminLTE/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css')}}">
|
||||
<!-- Select2 -->
|
||||
<link href="{{asset('/public/bower_components/AdminLTE/plugins/select2/select2.min.css')}}" rel="stylesheet" />
|
||||
<!-- ekko-lightbox -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/ekko-lightbox/5.3.0/ekko-lightbox.css" rel="stylesheet">
|
||||
<!-- bootstrap-toggle -->
|
||||
<link href="https://gitcdn.github.io/bootstrap-toggle/2.2.2/css/bootstrap-toggle.min.css" rel="stylesheet">
|
||||
<!-- DataTables -->
|
||||
<link rel="stylesheet" href="{{ asset('/public/bower_components/AdminLTE/plugins/datatables.net-bs/css/dataTables.bootstrap.min.css') }}">
|
||||
<!-- datepicker -->
|
||||
<link rel="stylesheet" href="{{ asset('/public/bower_components/AdminLTE/plugins/datepicker/datepicker3.css') }}">
|
||||
<!-- jquery-ui -->
|
||||
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
|
||||
<link href="{{asset('/public/designer/css/build.css')}}" rel="stylesheet">
|
||||
<!-- 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:// -->
|
||||
@@ -373,102 +386,180 @@
|
||||
|
||||
.funkyradio input[type="radio"]:empty,
|
||||
.funkyradio input[type="checkbox"]:empty {
|
||||
display: none;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
content: '\2714';
|
||||
text-indent: .9em;
|
||||
color: #C2C2C2;
|
||||
}
|
||||
|
||||
.funkyradio input[type="radio"]:checked ~ label,
|
||||
.funkyradio input[type="checkbox"]:checked ~ label {
|
||||
color: #777;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
color: #fff;
|
||||
background-color: #5bc0de;
|
||||
}
|
||||
|
||||
.store-logo-holder {
|
||||
width: 200px;
|
||||
height:200px;
|
||||
border: 1px solid #e2e2e2;
|
||||
padding:2px;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#img_store_logo {
|
||||
position: absolute;
|
||||
margin: auto;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.store-banner-holder {
|
||||
width: 100%;
|
||||
height:100px;
|
||||
border: 1px solid #e2e2e2;
|
||||
padding:2px;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#img_store_banner {
|
||||
position: absolute;
|
||||
margin: auto;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.error{
|
||||
color: red;
|
||||
}
|
||||
|
||||
.store-logo{
|
||||
width: 200px;
|
||||
height:200px;
|
||||
margin: auto;
|
||||
padding:2px;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
@media ( min-width: 768px ) {
|
||||
.grid-divider {
|
||||
position: relative;
|
||||
padding: 0;
|
||||
}
|
||||
.grid-divider>[class*='col-'] {
|
||||
position: static;
|
||||
}
|
||||
.grid-divider>[class*='col-']:nth-child(n+2):before {
|
||||
content: "";
|
||||
border-left: 1px solid #DDD;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
.col-padding {
|
||||
padding: 0 15px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<!-- Global site tag (gtag.js) - Google Analytics -->
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-136108155-1"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
|
||||
gtag('config', 'UA-136108155-1');
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body id="bodyId_" class="sidebar-mini wysihtml5-supported skin-black">
|
||||
@@ -521,9 +612,130 @@
|
||||
<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>
|
||||
|
||||
<!-- ekko-lightbox -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/ekko-lightbox/5.3.0/ekko-lightbox.js"></script>
|
||||
<!-- bootstrap-toggle -->
|
||||
<script src="https://gitcdn.github.io/bootstrap-toggle/2.2.2/js/bootstrap-toggle.min.js"></script>
|
||||
<!-- DataTables -->
|
||||
<script src="{{ asset('/public/bower_components/AdminLTE/plugins/datatables.net/js/jquery.dataTables.min.js') }}"></script>
|
||||
<script src="{{ asset('/public/bower_components/AdminLTE/plugins/datatables.net-bs/js/dataTables.bootstrap.min.js') }}"></script>
|
||||
<script src="https://cdn.datatables.net/buttons/1.5.6/js/dataTables.buttons.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/buttons/1.5.6/js/buttons.flash.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/pdfmake.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/vfs_fonts.js"></script>
|
||||
<script src="https://cdn.datatables.net/buttons/1.5.6/js/buttons.html5.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/buttons/1.5.6/js/buttons.print.min.js"></script>
|
||||
<!-- datepicker -->
|
||||
<script src="{{asset('/public/bower_components/AdminLTE/plugins/datepicker/bootstrap-datepicker.js')}}"></script>
|
||||
<!-- jquery-ui -->
|
||||
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
|
||||
|
||||
<script>
|
||||
$( document ).ready(function() {
|
||||
$.fn.dataTable.ext.search.push(
|
||||
function (settings, data, dataIndex) {
|
||||
|
||||
var min = $('#min').datepicker("getDate");
|
||||
var max = $('#max').datepicker("getDate");
|
||||
var startDate = new Date(data[4]);
|
||||
if (min == null && max == null) { return true; }
|
||||
if (min == null && startDate <= max) { return true;}
|
||||
if(max == null && startDate >= min) {return true;}
|
||||
if (startDate <= max && startDate >= min) { return true; }
|
||||
return false;
|
||||
}
|
||||
);
|
||||
|
||||
$("#min").datepicker({ onSelect: function () { table.draw(); }, changeMonth: true, changeYear: true });
|
||||
$("#max").datepicker({ onSelect: function () { table.draw(); }, changeMonth: true, changeYear: true });
|
||||
var table = $('#tbl_store_orders').DataTable({
|
||||
dom: 'Bfrtip',
|
||||
buttons: [
|
||||
{
|
||||
extend: 'csv',
|
||||
exportOptions: {
|
||||
columns: [ 0, 1, 2, 3, 5 ]
|
||||
},
|
||||
className : "btn btn-default",
|
||||
text: "<i class=\"fa fa-table\"></i> CSV"
|
||||
},
|
||||
{
|
||||
extend: 'excel',
|
||||
exportOptions: {
|
||||
columns: [ 0, 1, 2, 3, 5 ]
|
||||
},
|
||||
className : "btn btn-default",
|
||||
text: "<i class=\"fa fa-file-excel-o\"></i> Excel"
|
||||
},
|
||||
{
|
||||
extend: 'pdf',
|
||||
exportOptions: {
|
||||
columns: [ 0, 1, 2, 3, 5 ]
|
||||
},
|
||||
className : "btn btn-default",
|
||||
text: "<i class=\"fa fa-file-pdf-o\"></i> PDF"
|
||||
},
|
||||
{
|
||||
extend: 'print',
|
||||
exportOptions: {
|
||||
columns: [ 0, 1, 2, 3, 5 ]
|
||||
},
|
||||
className : "btn btn-default",
|
||||
text : "<i class=\"fa fa-print\"></i> Print"
|
||||
}
|
||||
],
|
||||
columnDefs: [
|
||||
{ targets: 4, type: 'date', visible: false },
|
||||
{ targets: 5, type: 'date' }
|
||||
]
|
||||
});
|
||||
|
||||
// Event listener to the two range filtering inputs to redraw on input
|
||||
$('#min, #max').change(function () {
|
||||
table.draw();
|
||||
});
|
||||
|
||||
|
||||
$(document).on('a click', '.btn-order-item-details', function(e){
|
||||
|
||||
e.preventDefault();
|
||||
var getCK = $(this).data('ck');
|
||||
var getPid = $(this).data('pid');
|
||||
var getId = $(this).data('id');
|
||||
$.ajax({
|
||||
data: {
|
||||
ck: getCK,
|
||||
pid: getPid,
|
||||
id: getId
|
||||
},
|
||||
type: 'POST',
|
||||
url : "{{ url('user/post/show-store-order-details') }}",
|
||||
dataType: 'json',
|
||||
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) {
|
||||
if(result.success){
|
||||
$('#modal_store_order_details_body_content').html(result.payment_details_response);
|
||||
}
|
||||
}
|
||||
});
|
||||
$('#modal_store_order_details').modal('show');
|
||||
});
|
||||
|
||||
$(document).on('a click', '.btn-add-thumbnail', function(e){
|
||||
e.preventDefault();
|
||||
$('#modal_add_thumbnail').modal('show');
|
||||
|
||||
|
||||
});
|
||||
|
||||
var tr_sortable = $('#sortable');
|
||||
|
||||
@@ -531,14 +743,16 @@
|
||||
revert: 100,
|
||||
placeholder: 'placeholder'
|
||||
});
|
||||
|
||||
$('.select2').select2();
|
||||
|
||||
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);
|
||||
// console.log(sortable_data);
|
||||
$.ajax({
|
||||
data: sortable_data,
|
||||
type: 'POST',
|
||||
@@ -582,49 +796,78 @@
|
||||
|
||||
var imagesPreview = function(input) {
|
||||
|
||||
if (input.files) {
|
||||
var filesAmount = input.files.length;
|
||||
$('#main_thumbnail_uploader').css({
|
||||
"display" : "none"
|
||||
});
|
||||
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();
|
||||
$('#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>');
|
||||
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>' +
|
||||
'<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>');
|
||||
}
|
||||
}
|
||||
}else{
|
||||
|
||||
reader.readAsDataURL(input.files[i]);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// for add Image ( View Item Details)
|
||||
var imagesPreview1 = function(input) {
|
||||
if (input.files) {
|
||||
var filesAmount = input.files.length;
|
||||
$( ".small-preview-thumb" ).html('');
|
||||
for (i = 0; i < filesAmount; i++) {
|
||||
var reader = new FileReader();
|
||||
reader.onload = function(event) {
|
||||
$( ".small-preview-thumb" ).prepend('<li class="col-sm-3 col-xs-3"> ' +
|
||||
$( ".small-preview-thumb" ).fadeIn(500, function(){
|
||||
$(this).append('<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]);
|
||||
reader.readAsDataURL(input.files[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
$('#imgupload').on('change', function() {
|
||||
imagesPreview(this);
|
||||
});
|
||||
|
||||
$('#upload_images').on('change', function() {
|
||||
imagesPreview1(this);
|
||||
});
|
||||
|
||||
$('#clear_frm_add_new_images').click(function(){
|
||||
$('#frm_add_new_images')[0].reset();
|
||||
$( ".small-preview-thumb" ).html('');
|
||||
});
|
||||
|
||||
$('.price_format').priceFormat({
|
||||
prefix: '$ '
|
||||
});
|
||||
@@ -658,7 +901,6 @@
|
||||
}else{
|
||||
$('#lst-cities').append('<option value="'+key+'" class="dynamic-city">'+ key + '</option>');
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}else{
|
||||
@@ -705,6 +947,7 @@
|
||||
required: true
|
||||
}
|
||||
},
|
||||
|
||||
messages: {},
|
||||
errorPlacement: function(error, element) {
|
||||
var placement = $(element).data('error');
|
||||
@@ -875,6 +1118,9 @@
|
||||
},
|
||||
item_privacy: {
|
||||
required: true
|
||||
},
|
||||
available_size: {
|
||||
required: true
|
||||
}
|
||||
|
||||
},
|
||||
@@ -936,6 +1182,29 @@
|
||||
},
|
||||
submitHandler: submitFormAddItem
|
||||
});
|
||||
|
||||
$("#frm_add_new_images").validate({
|
||||
rules: {
|
||||
upload_images :{
|
||||
required: true
|
||||
}
|
||||
},
|
||||
messages: {},
|
||||
errorPlacement: function(error, element) {
|
||||
var placement = $(element).data('error');
|
||||
|
||||
if (placement) {
|
||||
|
||||
$(placement).append(error)
|
||||
|
||||
}else {
|
||||
|
||||
error.insertAfter(element);
|
||||
|
||||
}
|
||||
},
|
||||
submitHandler: submitFormAddNewImage
|
||||
});
|
||||
|
||||
$("#frm_verification_code").validate({
|
||||
rules: {
|
||||
@@ -1002,6 +1271,36 @@
|
||||
submitHandler: submitSellDesignForm
|
||||
});
|
||||
|
||||
$(document).on('button click', '.btn-delete-item-image', function(e){
|
||||
e.preventDefault();
|
||||
var thumb_filename = $(this).data('filename');
|
||||
var thumb_id = $(this).data('id');
|
||||
// console.log(thumb_id);
|
||||
$.ajax({ //create an ajax request to load_page.php
|
||||
type: "POST",
|
||||
url: "{{ url('user/post/delete-image-thumb') }}",
|
||||
data: {
|
||||
thumb_filename : thumb_filename,
|
||||
thumb_id : thumb_id
|
||||
},
|
||||
dataType: 'json',
|
||||
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);
|
||||
$('#'+response.delete_row).fadeOut(300, function(){
|
||||
$(this).remove();
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('button click', '#chk-currentpass', function(){
|
||||
|
||||
if($(this).is(':checked')){
|
||||
@@ -1163,10 +1462,129 @@
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('click', '[data-toggle="lightbox"]', function(event) {
|
||||
event.preventDefault();
|
||||
$(this).ekkoLightbox({
|
||||
alwaysShowClose: true,
|
||||
});
|
||||
});
|
||||
|
||||
$('#with_password_opt').change(function() {
|
||||
if($(this).prop('checked')){
|
||||
$('.store-password-field').css({
|
||||
'display': 'block'
|
||||
});
|
||||
}else{
|
||||
$('.store-password-field').css({
|
||||
'display': 'none'
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$("#frm_edit_store").validate({
|
||||
rules: {
|
||||
store_name: {
|
||||
required: true
|
||||
},
|
||||
store_url: {
|
||||
required: true
|
||||
},
|
||||
store_password: {
|
||||
required: '#with_password_opt:checked'
|
||||
},
|
||||
// store_logo: {
|
||||
// required: true
|
||||
// },
|
||||
// store_banner: {
|
||||
// required: true
|
||||
// },
|
||||
store_status: {
|
||||
required: true
|
||||
},
|
||||
},
|
||||
messages: {},
|
||||
errorPlacement: function(error, element) {
|
||||
var placement = $(element).data('error');
|
||||
if (placement) {
|
||||
$(placement).append(error);
|
||||
}else {
|
||||
error.insertAfter(element);
|
||||
}
|
||||
},
|
||||
submitHandler: submitFormEditStore
|
||||
});
|
||||
|
||||
$("#store_name").on('keyup',function(){
|
||||
var getsportName = $(this).val();
|
||||
getsportName = getsportName.replace(/\s+/g, '-').toLowerCase(); //new object assigned to var str
|
||||
$("#store_url").val(getsportName);
|
||||
});
|
||||
|
||||
$(".upload_img").change(function() {
|
||||
var $id = $(this).data('use-id');
|
||||
readURL(this, $id);
|
||||
});
|
||||
|
||||
}); //end document ready
|
||||
|
||||
// function
|
||||
// function
|
||||
function submitFormEditStore(){
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "{{ url('user/store-settings/update') }}",
|
||||
data: new FormData($('#frm_edit_store')[0]),
|
||||
processData: false,
|
||||
contentType: false,
|
||||
dataType: 'json',
|
||||
beforeSend: function(xhr){
|
||||
$("#btn_update_store").attr('disabled', true);
|
||||
$("#btn_update_store").html('<i class="fa fa-spinner fa-spin"></i> Saving...');
|
||||
|
||||
var token = $('meta[name="csrf_token"]').attr('content');
|
||||
if (token) {
|
||||
return xhr.setRequestHeader('X-CSRF-TOKEN', token);
|
||||
}
|
||||
|
||||
},
|
||||
success: function (response) {
|
||||
// console.log(response);
|
||||
if(response.success){
|
||||
$('#edit_store_msg').html('<div class="alert alert-success alert-dismissible"> ' +
|
||||
'<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> ' +
|
||||
'<h4><i class="icon fa fa-check"></i> Success!</h4> ' +
|
||||
'<p>'+response.message+'</p> ' +
|
||||
'</div>').fadeIn().delay(5000).fadeOut();
|
||||
|
||||
}else{
|
||||
$('#edit_store_msg').html('<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> ' +
|
||||
'<p>'+response.message+'</p> ' +
|
||||
'</div>').fadeIn().delay(5000).fadeOut();
|
||||
}
|
||||
|
||||
$("html, body").animate({ scrollTop: 0 }, "slow");
|
||||
$("#btn_update_store").attr('disabled', false);
|
||||
$("#btn_update_store").html('Save Changes');
|
||||
|
||||
if(response.clearform){
|
||||
var form = $('#frm_edit_store')
|
||||
form.validate().resetForm();
|
||||
form[0].reset();
|
||||
|
||||
// $("#with_password_opt").prop("checked", false);
|
||||
|
||||
$('.img_store_logo_href').attr('href', "{{ config('site_config.images_directory') . 'teamstore/store-logo-placeholder.jpg' }}");
|
||||
$('.img_store_logo_img').attr('src', "{{ config('site_config.images_directory') . 'teamstore/store-logo-placeholder.jpg' }}");
|
||||
|
||||
$('.img_store_banner_href').attr('href', "{{ config('site_config.images_directory') . 'teamstore/store-banner-placeholder.jpg' }}");
|
||||
$('.img_store_banner_img').attr('src', "{{ config('site_config.images_directory') . 'teamstore/store-banner-placeholder.jpg' }}");
|
||||
}
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
function getCities(arr, q){
|
||||
var sd = [];
|
||||
arr.find(function(element) {
|
||||
@@ -1395,7 +1813,44 @@
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function submitFormAddNewImage(){
|
||||
$.ajax({
|
||||
type : 'POST',
|
||||
url : "{{ url('user/store-items/save-new-item-image') }}",
|
||||
data : new FormData($('#frm_add_new_images')[0]),
|
||||
processData: false,
|
||||
contentType: false,
|
||||
beforeSend:function(xhr){
|
||||
$("#new_item_image_response_msg").fadeOut();
|
||||
$("#btn_submit_new_item_image").html('Please wait <i class="fa fa-spinner fa-spin"></i>');
|
||||
$("#btn_submit_new_item_image").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{
|
||||
$("#new_item_image_response_msg").html("");
|
||||
$("#new_item_image_response_msg").fadeIn(1000, function(){
|
||||
$("#new_item_image_response_msg").html(response.message);
|
||||
$("#btn_submit_new_item_image").prop("disabled", false);
|
||||
$("#btn_submit_new_item_image").html('Submit');
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
function submitFormVerificationCode(){
|
||||
var data = $("#frm_verification_code").serialize();
|
||||
@@ -1481,7 +1936,23 @@
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function readURL(input, id) {
|
||||
|
||||
if (input.files && input.files[0]) {
|
||||
var reader = new FileReader();
|
||||
|
||||
reader.onload = function(e) {
|
||||
$('#'+id).attr('src', e.target.result);
|
||||
// for lightbox
|
||||
$('.'+id+'_href').attr('href', e.target.result);
|
||||
$('.'+id+'_img').attr('src', e.target.result);
|
||||
}
|
||||
reader.readAsDataURL(input.files[0]);
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user