?> <?php foreach ($dealers as $key => $dealer) { ?> <?php $ordered_ids = getOrderedIdByUser($dealer->user_id); ?> <?php if (count($ordered_ids)) { ?> <?php $ordered_ids['brand_id'] = array_values($ordered_ids['brand_id']); ?> <?php $ordlerLevels = get_nested(); ?> <ul class="accordion"> <li><a href="#<?php echo $dealer->user_name; ?> "><?php echo $dealer->user_id == isLogin() ? "SELF: " . $dealer->user_fullname : "DEALER: " . $dealer->user_fullname; ?> <span class ="pull-right"> Rs <?php echo getOrderSum(); ?> </span><span class ="pull-right"> <?php echo getOrderSum(null, 'qty') . " pcs, "; ?> </span></a>
/** * uploadUsers function * this funciton is to render a form to add a new user to shotym, a user can also be maped to a levels, and brand as well. * @return void * @author Ankit Balyan - sf.ankit@gmail.com **/ function addUser() { $users = getRwUsers(null, 1); $levels = getRwUsersLvl(); $brands = get_nested(); ?> <div class="container"> <div class="row"> <div class="col-md-8 col-sm-6 "> <section> <header> <h3>Create User</h3> <hr> </header> <form class="form-horizontal" action="#" method="POST" name="createUser" id="createUser"> <div class="form-group form-group-lg"> <label class="col-xs-2 control-label">Username</label> <div class="col-xs-10"> <input type="text" name="user[user_name]" maxlength="100" class="form-control text required" placeholder="Username"> <label for="user[user_name]" class=" help-block error"></label> </div> </div> <div class="form-group form-group-lg"> <label class="col-xs-2 control-label">Email</label> <div class="col-xs-10"> <input type="email" name="user[user_email]" maxlength="255" class="form-control email required" placeholder="Email Id"> <label for="user[user_email]" class=" help-block error"></label> <span class="help-block error"></span> </div> </div> <div class="form-group form-group-lg"> <label class="col-xs-2 control-label">Full Name</label> <div class="col-xs-10"> <input type="text" name="user[user_fullname]" maxlength="255" class="form-control text required" placeholder="Fullname"> <label for="user[user_fullname]" class=" help-block error"></label> </div> </div> <div class="form-group form-group-lg"> <label class="col-xs-2 control-label">Phone</label> <div class="col-xs-10"> <input type="text" name="user[user_phone]" minlength="8" maxlength="20" class="form-control text required" placeholder="User Phone Number"> <label for="user[user_phone]" class=" help-block error"></label> </div> </div> <div class="form-group form-group-lg"> <label class="col-xs-2 control-label">Related to</label> <div class="col-xs-3"> <select name="user[user_parent_id]" class="selectPicker"> <option value="">None</option> <?php foreach ($users as $user) { ?> <option value="<?php echo $user->user_id; ?> "><?php echo $user->user_name; ?> </option> <?php } ?> </select> <label for="user[user_parent_id]" class=" help-block error"></label> </div> <label class="col-xs-2 control-label">Level</label> <div class="col-xs-3"> <select name="user[user_lvl]" class="selectPicker"> <?php foreach ($levels as $key => $level) { ?> <option value="<?php echo $level->lvl_id; ?> "><?php echo $level->lvl_name; ?> </option> <?php } ?> </select> <label for="user[user_lvl]" class=" help-block error"></label> </div> </div> <div class="form-group form-group-lg"> <label class="col-xs-2 control-label">Brand Access</label> <div class="col-sm-10 col-sm-offset-2 treeview" id="selectBrandsAccess"> <ul id="selectBrandsAccess" class=""> <?php foreach ($brands as $value) { ?> <li><span><i class="fa fa-angle-double-right"></i> <?php echo $value['brand_name']; ?> </span><span class="checkbox-wrap"><span class="custom-checkbox"><input name="brand_box[]" type="checkbox" value="<?php echo $value['brand_id']; ?> " id="brand_id<?php echo $value['brand_id']; ?> " /><label for="brand_id<?php echo $value['brand_id']; ?> "></label></span></span><hr class="bottom-line"/> <?php /* <?php if(isset($value['children']) && is_array($value['children'])): ?> <ul> <?php foreach ($value['children'] as $subitem): ?> <li><i class="fa fa-angle-right"></i><span><?php echo $subitem['brand_name']; ?></span><span class="checkbox-wrap"><span class="custom-checkbox"><input name="brand_box[]" type="checkbox" value="<?php echo $subitem['brand_id']; ?>" id="brand_id<?php echo $subitem['brand_id']; ?>" /><label for="subbrand_id<?php echo $subitem['brand_id']; ?>"></label></span></span> </li> <?php endforeach ?> </ul> <?php endif; ?> */ ?> </li> <?php } ?> </ul> </div> </div> <div class="form-group form-group-lg"> <label class="col-xs-2 control-label">Source</label> <div class="col-xs-10"> <input type="text" name="user[source]" class="form-control text" maxlength="255" placeholder="Source of user"> <label for="user[source]" class=" help-block error"></label> </div> </div> <div class="form-group form-group-lg"> <label class="col-xs-2 control-label">Password</label> <div class="col-xs-10"> <input type="password" name="user[user_password]" minlength="4" maxlength="15" class="form-control required" placeholder="Passowrd"> <label for="user[user_password]" class=" help-block error"></label> </div> </div> <div class="form-group form-group-lg"> <div class="col-xs-offset-2 col-xs-10"> <input type="submit" class="submit btn btn-primary" value="Create User"> </div> </div> <div class="form-group form-group-lg"> <div class="col-xs-offset-2 col-xs-10"> <p class="text-warning" id="errors"></p> </div> </div> </form> </section> </div> </div> </div> <style> /*Treeview brand list style*/ .treeview, .treeview ul {padding: 0;margin: 0;list-style: none;} .treeview li .bottom-line{height: 1px;clear: both;border: none;border-bottom: 1px solid #d2d2d2;width: 500px;margin: 0;padding: 5px 0;} .treeview ul {margin-top: 4px;} ul.treeview{margin-top: 4px;width: 500px;} .treeview .hitarea {} * html .hitarea {display: inline;float:none;}/* fix for IE6 */ .treeview li { margin: 0;padding: 5px 0pt 5px 16px;font-family: 'Lato', sans-serif;font-size:16px;color: #7b7b7b;text-transform: capitalize;position: relative;list-style: none;} .treeview li .checkbox-wrap{display: inline-block;float: right;} .treeview li .fa-angle-double-right, .treeview .fa-angle-right{ font-size: 20px;padding-right: 8px;} .treeview li ul{background: transparent;list-style: none;} .treeview li ul li{padding: 5px 0pt 5px 30px;list-style: none!important;} .treeview li ul li .bottom-line{width: 470px;} .treeview li ul li ul li{padding: 7px 16px 7px 28px;border-bottom: 1px solid #d2d2d2;width: 470px;list-style: none!important;} .treeview li ul li ul li .bottom-line{width: 450px;} .treeview li ul li ul li ul li{padding: 7px 19px 7px 34px;width: 445px;border-bottom: none;border-top: 1px solid #d2d2d2;list-style: none!important;} .treeview a.selected {background-color: #eee;} #treecontrol { margin: 1em 0; display: none; } .treeview .hover { color:#000; cursor: pointer; } .treeview .expandable-hitarea { background-position: -82px -2px; } .treeview div.lastCollapsable-hitarea, .treeview div.lastExpandable-hitarea { background-position: 0; } </style> <script type="text/javascript"> jQuery(document).ready(function($) { jQuery('#selectTopBrand').load(function(event) { loadSubrands(this.value); }); jQuery('#selectTopBrand').change(function(event) { loadSubrands(this.value); }); jQuery('#createUser').validate({ submitHandler: function(form) { var formData = new FormData(jQuery('#createUser')[0]); formData.append("action",'add_user'); jQuery.ajax({ type: 'POST', url: ajaxurl, data: formData, cache: false, contentType: false, processData: false, beforeSend:function (argument) { jQuery('#errors').fadeIn('slow').html("Processing..."); }, success: function(result) { jQuery('#errors').fadeIn('slow').html(result).delay(5000).fadeOut('slow'); } }); } }); jQuery("#selectBrandsAccess").treeview({ animated: "fast", collapsed: true }); }); function loadSubrands (id) { jQuery.ajax({ type: 'POST', url: ajaxurl, data: {action: 'subbrand_selectbox', brand_id: id}, cache: false, beforeSend:function (argument) { //jQuery('.overlay').fadeIn('slow'); //jQuery('.response').fadeIn('slow').html("Processing..."); }, success: function(result) { jQuery('#AccessibleSubBrands').html(result); //jQuery('.response').fadeIn('slow').html(result).delay(5000).fadeOut('slow'); //jQuery('.overlay').delay(5100).fadeOut('slow'); } }); } </script> <?php }
<div class="header-bottom"><!--header-bottom--> <div class="container"> <div class="row"> <div class="col-sm-9"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </div> <div class=""> <div class="collapse navbar-collapse"> <?php $pages = get_nested(); $homeBrand = array('brand_name' => 'HOME', 'brand_slug' => '/'); array_unshift($pages, $homeBrand); echo get_menu($pages); ?> </div> <!--/.nav-collapse --> </div> </div> </div> </div> </div><!--/header-bottom--> <?php } ?>
/** * Outputs the HTML for this widget. * * @param array An array of standard parameters for widgets in this theme * @param array An array of settings for this widget instance * @return void Echoes it's output * @author Ankit Balyan - sf.ankit@gmail.com **/ function widget($args, $instance) { extract($args, EXTR_SKIP); extract($instance, EXTR_SKIP); $category_filter_title = apply_filters('widget_title', $category_filter_title); if (empty($category_filter_title)) { $category_filter_title = "Category"; } $brand_filter_title = apply_filters('widget_title', $brand_filter_title); if (empty($brand_filter_title)) { $brand_filter_title = "Brand"; } $before_title = "<h2>"; $after_title = "</h2>"; echo $before_widget; // // Widget display logic goes here // ?> <form action="" method="POST" name="productFilterForm" id="productFilterForm"> <?php $brands = get_nested(); ?> <?php if (count($brands)) { echo $before_title; echo $brand_filter_title; // Can set this with a widget option, or omit altogether echo $after_title; echo $brandlistView = get_brandFilterList($brands); ?> <?php $categories = getCategories(); if (count($categories)) { echo $before_title; echo $category_filter_title; // Can set this with a widget option, or omit altogether echo $after_title; ?> <div class="panel-group category-products" id="categoryFilterAccordian"><!--category-productsr--> <?php foreach ($categories as $category) { ?> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"> <input type="checkbox" name="selectCategoryBox[]" id="category_id_<?php echo $category->category_id; ?> " value="<?php echo $category->category_id; ?> " class="large" > <a data-toggle="collapse" data-parent="#accordian" href="#sportswear" onclick ="submitFilter()"><?php echo $category->category_name; ?> </a> </h4> </div> </div> <?php } ?> </div> <?php } ?> <?php } ?> <div class="price-range"><!--price-range--> <?php echo $before_title; echo $price_filter_title; // Can set this with a widget option, or omit altogether echo $after_title; $maxprice = maxProductPrice(); $minprice = minProductPrice(); ?> <div class="well"> <input type="text" class="span2" data-slider-min="<?php echo $minprice; ?> " data-slider-max="<?php echo $maxprice; ?> " data-slider-step="5" data-slider-value="[<?php echo $minprice; ?> ,<?php echo $maxprice; ?> ]" id="sl2" ><br /> <span><span><i class="fa fa-inr"></i></span></span><b> <?php echo money_format('%!.0i', $minprice); ?> </b><b class="pull-right"><span><span><i class="fa fa-inr"></i></span></span> <?php echo money_format('%!.0i', $maxprice); ?> </b> </div> </div><!--/price-range--> </form> <script type="text/javascript"> jQuery(document).on("click",'input[type="checkbox"]',function() { type = jQuery(this).attr('name'); if(type != 'selectCategoryBox[]') { brandFilter(); } else { categoryFilter(); } }); function brandFilter (argument) { var formData = new FormData(jQuery('#productFilterForm')[0]); data_slider_value = jQuery('.tooltip-inner').text(); formData.append("action",'product_filter'); formData.append("data_slider_value",data_slider_value); jQuery.ajax({ type: 'POST', url: ajaxurl, data: formData, cache: false, contentType: false, processData: false, beforeSend:function (argument) { // jQuery('.overlay').fadeIn('slow'); // jQuery('.response').fadeIn('slow').html("Processing..."); }, success: function(result) { //jQuery('.response').fadeIn('slow').html(result).delay(5000).fadeOut('slow'); //jQuery('.overlay').delay(5100).fadeOut('slow'); content = ''; jQuery.each(result.catelog, function(i,product){ content += '<div class="col-sm-4 eachProduct jscroll-next">'; content += '<div class="product-image-wrapper">'; content += '<div class="single-products">'; content += '<a href="/product/'+product.product_id+'">'; content += '<div class="productinfo text-center">'; content += '<img src="'+product.image_url+'" alt="" />'; content += '<h2>MRP '+product.product_price+'</h2>'; content += '<a href="/product/'+product.product_id+'">'+product.product_name+'<?php //echo $product->product_name ?> </a>'; content += '</div>'; content += '</a>'; content += '</div>'; content += '</div>'; content += '</div>'; }); jQuery("#product_list").empty(); jQuery('#product_list').html(content); //if(content !='') // { // jQuery("#product_list").empty(); // jQuery('#product_list').append(content); // } content = ''; jQuery.each(result.categories, function(i,category){ content += '<div class="panel panel-default">'; content += '<div class="panel-heading">'; content += '<h4 class="panel-title">'; content += '<input type="checkbox" name="selectCategoryBox[]" id="category_id_'+category.category_id+'" value="'+category.category_id+'" class="large">'; content += '<a data-toggle="collapse" data-parent="#accordian" onclick ="submitFilter()" href="#sportswear">'+category.category_name+'</a>'; content += '</h4>'; content += '</div>'; content += '</div>'; }); // if(content !='') // { // jQuery("#categoryFilterAccordian").empty(); // jQuery('#categoryFilterAccordian').html(content); // } jQuery("#categoryFilterAccordian").empty(); jQuery('#categoryFilterAccordian').html(content); jQuery('input[type="checkbox"]').checkbox(); loadMore (); } }); } function categoryFilter (argument) { var formData = new FormData(jQuery('#productFilterForm')[0]); data_slider_value = jQuery('.tooltip-inner').text(); formData.append("action",'product_filter'); formData.append("data_slider_value",data_slider_value); jQuery.ajax({ type: 'POST', url: ajaxurl, data: formData, cache: false, contentType: false, processData: false, beforeSend:function (argument) { // jQuery('.overlay').fadeIn('slow'); // jQuery('.response').fadeIn('slow').html("Processing..."); }, success: function(result) { //jQuery('.response').fadeIn('slow').html(result).delay(5000).fadeOut('slow'); //jQuery('.overlay').delay(5100).fadeOut('slow'); content = ''; jQuery.each(result.catelog, function(i,product){ content += '<div class="col-sm-4 eachProduct jscroll-next">'; content += '<div class="product-image-wrapper">'; content += '<div class="single-products">'; content += '<a href="/product/'+product.product_id+'">'; content += '<div class="productinfo text-center">'; content += '<img src="'+product.image_url+'" alt="" />'; content += '<h2>MRP '+product.product_price+'</h2>'; content += '<a href="/product/'+product.product_id+'">'+product.product_name+'<?php //echo $product->product_name ?> </a>'; content += '</div>'; content += '</a>'; content += '</div>'; content += '</div>'; content += '</div>'; }); jQuery("#product_list").empty(); jQuery('#product_list').html(content); jQuery('input[type="checkbox"]').checkbox(); loadMore (); } }); } </script> <?php echo $after_widget; }