@@ -1,152 +1,199 @@
{{ #extend " mainLayoutPartial" }}
{{ #content " head" mode =" append" }}
<!-- SWIPER SLIDER -->
<link href =" assets/plugins/slider.swiper/dist/css/swiper.min.css" rel =" stylesheet" type =" text/css" />
<link href =" assets/css/layout-datatable.css" rel =" stylesheet" type =" text/css" />
<link href =" assets/css/layout-datatables.css" rel =" stylesheet" type =" text/css" />
<link href =" https://code.jquery.com/ui/1.11.4/themes/ui-darkness/jquery-ui.css" rel =" stylesheet" type =" text/css" />
{{ /content }}
{{ #content " loggedIn" }}
{{ #if name }}
<li class =" text-welcome hidden-xs" >Welcome to ValetBasket, <strong >{{ name }} </strong ></li >
<li >
<a class =" dropdown-toggle no-text-underline" data-toggle =" dropdown" href =" #" ><i class =" fa fa-user hidden-xs" ></i > MY ACCOUNT</a >
<ul class =" dropdown-menu pull-right" >
<li ><a tabindex =" -1" href =" #" ><i class =" fa fa-history" ></i > ORDER HISTORY</a ></li >
<li class =" divider" ></li >
<li ><a tabindex =" -1" href =" #" ><i class =" fa fa-bookmark" ></i > MY WISHLIST</a ></li >
<li ><a tabindex =" -1" href =" #" ><i class =" fa fa-edit" ></i > MY REVIEWS</a ></li >
<li ><a tabindex =" -1" href =" #" ><i class =" fa fa-cog" ></i > MY SETTINGS</a ></li >
<li class =" divider" ></li >
<li ><a tabindex =" -1" href =" #" ><i class =" glyphicon glyphicon-off" ></i > LOGOUT</a ></li >
</ul >
</li >
{{ else }}
<li class =" hidden-xs" ><a href =" /login" >LOGIN</a ></li >
<li class =" hidden-xs" ><a href =" /signup" >REGISTER</a ></li >
{{ /if }}
{{> settings_dropdown }}
{{ /content }}
{{ #content " mainbody" }}
<section style =" background:url('assets/images/demo/wall2.jpg')" >
<div class =" container" >
<form class = " validate " action = " php/contact.php " method = " post " enctype = " multipart/form-data " data-success =" Sent! Thank you!" data-toastr-position =" top-right" >
<form id = " orderform " method = " post " class = " validate " action = " /order " data-success =" Sent! Thank you!" data-toastr-position =" top-right" >
<fieldset >
<!-- HTML DATATABLE -->
<table class =" table table-striped table-hover table-bordered" id =" sample_editable_1 " >
<table class =" table table-striped table-hover table-bordered" id =" orderTable " >
<thead >
<tr >
<tr id = " 1 " >
<th >Item</th >
<th >Quantity</th >
<th >Units</th >
<th >Brand(if any)</th >
<th >Comments</th >
</tr >
</thead >
<tbody >
<tr >
<tr id = " 2 " >
<td >
<input type =" text" class =" autoCompItem form-control input-small" id =" item1" name =" item1 " placeholder =" Eggs" >
<input type =" text" class =" autoCompItem itembox form-control input-small" id =" item1" name =" item " placeholder =" Eggs" >
</td >
<td >
<input type =" text" class =" form-control input-small" id =" quantity1" name =" quantity1" placeholder =" 24" >
<input type =" text" class =" form-control qty input-small" id =" quantity1" name =" quantity1" placeholder =" 24" >
</td >
<td >
<select class =" form-control" name =' uom1' >
<option value =" " >Units</option >
<option value =" lbs" >lbs</option >
<option value =" packs" >Packs</option >
<option value =" cartons" >Cartons</option >
<option value =" gallons" >Gallons</option >
</select >
</td >
<td >
<input type =" text" class =" form-control input-small" id =" brand1" name =" brand1" placeholder =" Eggland" >
</td >
<td >
<input type =" text" class =" form-control input-small" id =" comment1" name =" comment1" placeholder =" Choose fresh" >
</td >
</tr >
<tr >
</tr > <tr id =" 3" >
<td >
<input type =" text" class =" autoCompItem form-control input-small" id =" item2" name =" item2 " placeholder =" Eggs" >
<input type =" text" class =" autoCompItem itembox form-control input-small" id =" item2" name =" item " placeholder =" Eggs" >
</td >
<td >
<input type =" text" class =" form-control input-small" id =" quantity1 " name =" quantity1 " placeholder =" 24" >
<input type =" text" class =" form-control qty input-small" id =" quantity2 " name =" quantity2 " placeholder =" 24" >
</td >
<td >
<input type =" text" class =" form-control input-small" id =" brand1" name =" brand1" placeholder =" Eggland" >
<select class =" form-control " name =' uom2' >
<option value =" " >Units</option >
<option value =" lbs" >lbs</option >
<option value =" packs" >Packs</option >
<option value =" cartons" >Cartons</option >
<option value =" gallons" >Gallons</option >
</select >
</td >
<td >
<input type =" text" class =" form-control input-small" id =" comment1" name =" comment1" placeholder =" Choose fresh" >
<input type =" text" class =" form-control input-small" id =" brand2" name =" brand2" placeholder =" Eggland" >
</td >
<td >
<input type =" text" class =" form-control input-small" id =" comment2" name =" comment2" placeholder =" Choose fresh" >
</td >
</tr >
<tr >
<tr id = " 4 " >
<td >
<input type =" text" class =" autoCompItem form-control input-small" id =" item3" name =" item3 " placeholder =" Eggs" >
<input type =" text" class =" autoCompItem itembox form-control input-small" id =" item3" name =" item " placeholder =" Eggs" >
</td >
<td >
<input type =" text" class =" form-control input-small" id =" quantity1 " name =" quantity1 " placeholder =" 24" >
<input type =" text" class =" form-control qty input-small" id =" quantity3 " name =" quantity3 " placeholder =" 24" >
</td >
<td >
<input type =" text" class =" form-control input-small" id =" brand1" name =" brand1" placeholder =" Eggland" >
<select class =" form-control " name =' uom3' >
<option value =" " >Units</option >
<option value =" lbs" >lbs</option >
<option value =" packs" >Packs</option >
<option value =" cartons" >Cartons</option >
<option value =" gallons" >Gallons</option >
</select >
</td >
<td >
<input type =" text" class =" form-control input-small" id =" comment1" name =" comment1" placeholder =" Choose fresh" >
<input type =" text" class =" form-control input-small" id =" brand3" name =" brand3" placeholder =" Eggland" >
</td >
<td >
<input type =" text" class =" form-control input-small" id =" comment3" name =" comment3" placeholder =" Choose fresh" >
</td >
</tr >
<tr >
<tr id = " 5 " >
<td >
<input type =" text" class =" autoCompItem form-control input-small" id =" item4" name =" item4" placeholder =" Eggs" >
<input type =" text" class =" autoCompItem form-control itembox input-small" id =" item4" name =" item4" placeholder =" Eggs" >
</td >
<td >
<input type =" text" class =" form-control input-small" id =" quantity1 " name =" quantity1 " placeholder =" 24" >
<input type =" text" class =" form-control qty input-small" id =" quantity4 " name =" quantity4 " placeholder =" 24" >
</td >
<td >
<input type =" text" class =" form-control input-small" id =" brand1" name =" brand1" placeholder =" Eggland" >
<select class =" form-control " >
<option value =" " >Units</option >
<option value =" lbs" >lbs</option >
<option value =" packs" >Packs</option >
<option value =" cartons" >Cartons</option >
<option value =" gallons" >Gallons</option >
</select >
</td >
<td >
<input type =" text" class =" form-control input-small" id =" comment1" name =" comment1" placeholder =" Choose fresh" >
<input type =" text" class =" form-control input-small" id =" brand4" name =" brand4" placeholder =" Eggland" >
</td >
<td >
<input type =" text" class =" form-control input-small" id =" comment4" name =" comment4" placeholder =" Choose fresh" >
</td >
</tr >
<tr >
<tr id = " 6 " >
<td >
<input type =" text" class =" autoCompItem form-control input-small" id =" item5" name =" item5 " placeholder =" Eggs" >
<input type =" text" class =" autoCompItem form-control itembox input-small" id =" item5" name =" item " placeholder =" Eggs" >
</td >
<td >
<input type =" text" class =" form-control input-small" id =" quantity1 " name =" quantity1 " placeholder =" 24" >
<input type =" text" class =" form-control qty input-small" id =" quantity5 " name =" quantity5 " placeholder =" 24" >
</td >
<td >
<input type =" text" class =" form-control input-small" id =" brand1" name =" brand1" placeholder =" Eggland" >
<select class =" form-control " >
<option value =" " >Units</option >
<option value =" lbs" >lbs</option >
<option value =" packs" >Packs</option >
<option value =" cartons" >Cartons</option >
<option value =" gallons" >Gallons</option >
</select >
</td >
<td >
<input type =" text" class =" form-control input-small" id =" comment1" name =" comment1" placeholder =" Choose fresh" >
<input type =" text" class =" form-control input-small" id =" brand5" name =" brand5" placeholder =" Eggland" >
</td >
<td >
<input type =" text" class =" form-control input-small" id =" comment5" name =" comment5" placeholder =" Choose fresh" >
</td >
</tr >
<tr >
<tr id = " 7 " >
<td >
<input type =" text" class =" autoCompItem form-control input-small" id =" item6" name =" item6 " placeholder =" Eggs" >
<input type =" text" class =" autoCompItem form-control itembox input-small" id =" item6" name =" item " placeholder =" Eggs" >
</td >
<td >
<input type =" text" class =" form-control input-small" id =" quantity1 " name =" quantity1 " placeholder =" 24" >
<input type =" text" class =" form-control qty input-small" id =" quantity6 " name =" quantity6 " placeholder =" 24" >
</td >
<td >
<input type =" text" class =" form-control input-small" id =" brand1" name =" brand1" placeholder =" Eggland" >
<select class =" form-control " >
<option value =" " >Units</option >
<option value =" lbs" >lbs</option >
<option value =" packs" >Packs</option >
<option value =" cartons" >Cartons</option >
<option value =" gallons" >Gallons</option >
</select >
</td >
<td >
<input type =" text" class =" form-control input-small" id =" comment1" name =" comment1" placeholder =" Choose fresh" >
<input type =" text" class =" form-control input-small" id =" brand6" name =" brand6" placeholder =" Eggland" >
</td >
<td >
<input type =" text" class =" form-control input-small" id =" comment6" name =" comment6" placeholder =" Choose fresh" >
</td >
</tr >
</tbody >
</table >
</fieldset >
<div class =" row" >
<div class =" col-md-12 " >
<div class =" col-md-10 " >
<button type =" submit" class =" btn btn-3d btn-teal btn-lg btn-block margin-top-30" >
SUBMIT ORDER
<span class =" block font-lato" >We will get back to you within next 2 hours</span >
</button >
</div >
<div class =" col-md-2" >
<button type =" button" id =' addmore' class =" btn btn-3d btn-teal btn-lg btn-block margin-top-30" >Add more lines</button >
</div >
</div >
</form >
</div >
</section >
{{ /content }}
{{ #content " scripts" mode =" append" }}
<script type =" text/javascript" src =" https://code.jquery.com/ui/1.11.4/jquery-ui.min.js" ></script >
<!-- <script type="text/javascript" src="https://code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script> -->
<script type =" text/javascript" src =" assets/plugins/jquery/jquery-ui.min.js" ></script >
<script type =" text/javascript" src =" assets/plugins/form.validate/jquery.form.min.js" ></script >
<script >
$ (document ).ready (function () {
$ (document ).ready (function (){
$ (" .autoCompItem" ).each (function (){
$ (this ).autocomplete ({
source : function (request , response ){
@@ -167,14 +214,90 @@
$ (this ).val (ui .item .name );
return false ;
}
}).data (" ui-autocomplete" )._renderItem = function (ul , item ) {
return $ ( " <li></li>" )
.data ( " ui-autocomplete-item" , item )
.append ( " <a>" + item .name + " </a>" )
.appendTo ( ul );
}).data (" ui-autocomplete" )._renderItem = function (ul , item ) {
return $ ( " <li></li>" )
.data ( " ui-autocomplete-item" , item )
.append ( " <a>" + item .name + " </a>" )
.appendTo ( ul );
};
});
$ (" #addmore" ).on (" click" , function (){
var rownum = $ (' #orderTable tr:last' ).attr (' id' )* 1 + 1 ;
var rowhtml = ' <tr id="' + rownum + ' "> ' +
' <td> ' +
' <input type="text" class="autoCompItem itembox form-control input-small" id="itembox" name="item" placeholder="Eggs" > ' +
' </td> ' +
' <td> ' +
' <input type="text" class="form-control qty input-small" id="quantity1" name="quantity1" placeholder="24"> ' +
' </td> ' +
' <td> ' +
' <select class="form-control "> ' +
' <option value="">Units</option> ' +
' <option value="lbs">lbs</option> ' +
' <option value="packs">Packs</option> ' +
' <option value="cartons">Cartons</option> ' +
' <option value="gallons">Gallons</option> ' +
' </select> ' +
' </td> ' +
' <td> ' +
' <input type="text" class="form-control input-small" id="brand1" name="brand1" placeholder="Eggland"> ' +
' </td> ' +
' <td> ' +
' <input type="text" class="form-control input-small" id="comment1" name="comment1" placeholder="Choose fresh"> ' +
' </td> ' +
' </tr>' ;
$ (rowhtml).appendTo (" #orderTable" );
var ipt = $ (" .autoCompItem" );
$ (" #orderTable" ).find (ipt).each (function (){
$ (this ).autocomplete ({
source : function (request , response ){
$ .ajax ({
url: ' /api/autocomplete' ,
data: {' q' : request .term },
dataType: " json" ,
success : function (data ){
response (data);
}
});
},
focus : function (event , ui ){
$ (this ).val (ui .item .name );
return false ;
},
select : function (event , ui ){
$ (this ).val (ui .item .name );
return false ;
}
}).data (" ui-autocomplete" )._renderItem = function (ul , item ) {
return $ ( " <li>" )
.data ( " ui-autocomplete-item" , item )
.append ( item .name )
.appendTo ( ul );
};
});
});
});
</script >
<script type =" text/javascript" src =" assets/plugins/form.validate/jquery.validate.js" ></script >
<script type =" text/javascript" src =" assets/plugins/form.validate/additional-methods.js" ></script >
<script >
jQuery .validator .setDefaults ({
success: " valid"
});
// in add method return false to indicate error
jQuery .validator .addMethod (" qty" , function (value , element ){
if (this .optional (element) && this .optional (jQuery (element).closest (' tr' ).find (" .itembox" )[0 ])) {return true ;}
if (! this .optional (element) && ! this .optional (jQuery (element).closest (' tr' ).find (" .itembox" )[0 ])) {return true ;}
return false ;
}, " please add both item and quantity" );
jQuery ().ready (function (){
jQuery (" #orderform" ).validate ({
highlight : function (element , errorClass ){
jQuery (element).closest (' tr' ).find (" .itembox" ).addClass (errorClass);
}
});
});
</script >
{{ /content }}
{{ /extend }}