customer_list.twig (13759B)
1 {{ header }}{{ column_left }} 2 <div id="content"> 3 <div class="page-header"> 4 <div class="container-fluid"> 5 <div class="pull-right"> 6 <button type="button" data-toggle="tooltip" title="{{ button_filter }}" onclick="$('#filter-customer').toggleClass('hidden-sm hidden-xs');" class="btn btn-default hidden-md hidden-lg"><i class="fa fa-filter"></i></button> 7 <a href="{{ add }}" data-toggle="tooltip" title="{{ button_add }}" class="btn btn-primary"><i class="fa fa-plus"></i></a> 8 <button type="button" data-toggle="tooltip" title="{{ button_delete }}" class="btn btn-danger" onclick="confirm('{{ text_confirm }}') ? $('#form-customer').submit() : false;"><i class="fa fa-trash-o"></i></button> 9 </div> 10 <h1>{{ heading_title }}</h1> 11 <ul class="breadcrumb"> 12 {% for breadcrumb in breadcrumbs %} 13 <li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li> 14 {% endfor %} 15 </ul> 16 </div> 17 </div> 18 <div class="container-fluid">{% if error_warning %} 19 <div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> {{ error_warning }} 20 <button type="button" class="close" data-dismiss="alert">×</button> 21 </div> 22 {% endif %} 23 {% if success %} 24 <div class="alert alert-success alert-dismissible"><i class="fa fa-check-circle"></i> {{ success }} 25 <button type="button" class="close" data-dismiss="alert">×</button> 26 </div> 27 {% endif %} 28 <div class="row"> 29 <div id="filter-customer" class="col-md-3 col-md-push-9 col-sm-12 hidden-sm hidden-xs"> 30 <div class="panel panel-default"> 31 <div class="panel-heading"> 32 <h3 class="panel-title"><i class="fa fa-filter"></i> {{ text_filter }}</h3> 33 </div> 34 <div class="panel-body"> 35 <div class="form-group"> 36 <label class="control-label" for="input-name">{{ entry_name }}</label> 37 <input type="text" name="filter_name" value="{{ filter_name }}" placeholder="{{ entry_name }}" id="input-name" class="form-control" /> 38 </div> 39 <div class="form-group"> 40 <label class="control-label" for="input-email">{{ entry_email }}</label> 41 <input type="text" name="filter_email" value="{{ filter_email }}" placeholder="{{ entry_email }}" id="input-email" class="form-control" /> 42 </div> 43 <div class="form-group"> 44 <label class="control-label" for="input-customer-group">{{ entry_customer_group }}</label> 45 <select name="filter_customer_group_id" id="input-customer-group" class="form-control"> 46 <option value=""></option> 47 {% for customer_group in customer_groups %} 48 {% if customer_group.customer_group_id == filter_customer_group_id %} 49 <option value="{{ customer_group.customer_group_id }}" selected="selected">{{ customer_group.name }}</option> 50 {% else %} 51 <option value="{{ customer_group.customer_group_id }}">{{ customer_group.name }}</option> 52 {% endif %} 53 {% endfor %} 54 </select> 55 </div> 56 <div class="form-group"> 57 <label class="control-label" for="input-status">{{ entry_status }}</label> 58 <select name="filter_status" id="input-status" class="form-control"> 59 <option value=""></option> 60 {% if filter_status == '1' %} 61 <option value="1" selected="selected">{{ text_enabled }}</option> 62 {% else %} 63 <option value="1">{{ text_enabled }}</option> 64 {% endif %} 65 {% if filter_status == '0' %} 66 <option value="0" selected="selected">{{ text_disabled }}</option> 67 {% else %} 68 <option value="0">{{ text_disabled }}</option> 69 {% endif %} 70 </select> 71 </div> 72 <div class="form-group"> 73 <label class="control-label" for="input-ip">{{ entry_ip }}</label> 74 <input type="text" name="filter_ip" value="{{ filter_ip }}" placeholder="{{ entry_ip }}" id="input-ip" class="form-control" /> 75 </div> 76 <div class="form-group"> 77 <label class="control-label" for="input-date-added">{{ entry_date_added }}</label> 78 <div class="input-group date"> 79 <input type="text" name="filter_date_added" value="{{ filter_date_added }}" placeholder="{{ entry_date_added }}" data-date-format="YYYY-MM-DD" id="input-date-added" class="form-control" /> 80 <span class="input-group-btn"> 81 <button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button> 82 </span> 83 </div> 84 </div> 85 <div class="form-group text-right"> 86 <button type="button" id="button-filter" class="btn btn-default"><i class="fa fa-filter"></i> {{ button_filter }}</button> 87 </div> 88 </div> 89 </div> 90 </div> 91 <div class="col-md-9 col-md-pull-3 col-sm-12"> 92 <div class="panel panel-default"> 93 <div class="panel-heading"> 94 <h3 class="panel-title"><i class="fa fa-list"></i> {{ text_list }}</h3> 95 </div> 96 <div class="panel-body"> 97 <div class="table-responsive"> 98 <form action="{{ delete }}" method="post" enctype="multipart/form-data" id="form-customer"> 99 <table class="table table-bordered table-hover"> 100 <thead> 101 <tr> 102 <td style="width: 1px;" class="text-center"><input type="checkbox" onclick="$('input[name*=\'selected\']').prop('checked', this.checked);" /></td> 103 <td class="text-left">{% if sort == 'name' %}<a href="{{ sort_name }}" class="{{ order|lower }}">{{ column_name }}</a>{% else %}<a href="{{ sort_name }}">{{ column_name }}</a>{% endif %}</td> 104 <td class="text-left">{% if sort == 'c.email' %}<a href="{{ sort_email }}" class="{{ order|lower }}">{{ column_email }}</a>{% else %}<a href="{{ sort_email }}">{{ column_email }}</a>{% endif %}</td> 105 <td class="text-left">{% if sort == 'customer_group' %}<a href="{{ sort_customer_group }}" class="{{ order|lower }}">{{ column_customer_group }}</a> {% else %} <a href="{{ sort_customer_group }}">{{ column_customer_group }}</a>{% endif %}</td> 106 <td class="text-left">{% if sort == 'c.status' %}<a href="{{ sort_status }}" class="{{ order|lower }}">{{ column_status }}</a>{% else %}<a href="{{ sort_status }}">{{ column_status }}</a>{% endif %}</td> 107 <td class="text-left">{% if sort == 'c.ip' %}<a href="{{ sort_ip }}" class="{{ order|lower }}">{{ column_ip }}</a>{% else %}<a href="{{ sort_ip }}">{{ column_ip }}</a>{% endif %}</td> 108 <td class="text-left">{% if sort == 'c.date_added' %}<a href="{{ sort_date_added }}" class="{{ order|lower }}">{{ column_date_added }}</a>{% else %}<a href="{{ sort_date_added }}">{{ column_date_added }}</a>{% endif %}</td> 109 <td class="text-right">{{ column_action }}</td> 110 </tr> 111 </thead> 112 <tbody> 113 {% if customers %} 114 {% for customer in customers %} 115 <tr> 116 <td class="text-center">{% if customer.customer_id in selected %} 117 <input type="checkbox" name="selected[]" value="{{ customer.customer_id }}" checked="checked" /> 118 {% else %} 119 <input type="checkbox" name="selected[]" value="{{ customer.customer_id }}" /> 120 {% endif %} 121 </td> 122 <td class="text-left">{{ customer.name }}</td> 123 <td class="text-left">{{ customer.email }}</td> 124 <td class="text-left">{{ customer.customer_group }}</td> 125 <td class="text-left">{{ customer.status }}</td> 126 <td class="text-left">{{ customer.ip }}</td> 127 <td class="text-left">{{ customer.date_added }}</td> 128 <td class="text-right"> 129 <div class="btn-group" style="min-width: 65px;"> 130 <a href="{{ customer.edit }}" data-toggle="tooltip" title="{{ button_edit }}" class="btn btn-primary"><i class="fa fa-pencil"></i></a> 131 <button type="button" data-toggle="dropdown" class="btn btn-primary dropdown-toggle"><span class="caret"></span></button> 132 <ul class="dropdown-menu dropdown-menu-right"> 133 <li class="dropdown-header">{{ text_option }}</li> 134 {% if customer.unlock %} 135 <li><a href="{{ customer.unlock }}"><i class="fa fa-unlock"></i> {{ text_unlock }}</a></li> 136 {% else %} 137 <li class="disabled"><a><i class="fa fa-unlock"></i> {{ text_unlock }}</a></li> 138 {% endif %} 139 <li role="separator" class="divider"></li> 140 <li class="dropdown-header">{{ text_login }}</li> 141 {% for store in customer.store %} 142 <li><a href="{{ store.href }}" target="_blank"><i class="fa fa-lock"></i> {{ store.name }}</a></li> 143 {% endfor %} 144 </ul> 145 </div> 146 </td> 147 </tr> 148 {% endfor %} 149 {% else %} 150 <tr> 151 <td class="text-center" colspan="8">{{ text_no_results }}</td> 152 </tr> 153 {% endif %} 154 </tbody> 155 </table> 156 </div> 157 </form> 158 <div class="row"> 159 <div class="col-sm-6 text-left">{{ pagination }}</div> 160 <div class="col-sm-6 text-right">{{ results }}</div> 161 </div> 162 </div> 163 </div> 164 </div> 165 </div> 166 </div> 167 <script type="text/javascript"><!-- 168 $('.table-responsive').on('shown.bs.dropdown', function (e) { 169 var t = $(this), 170 m = $(e.target).find('.dropdown-menu'), 171 tb = t.offset().top + t.height(), 172 mb = m.offset().top + m.outerHeight(true), 173 d = 20; 174 if (t[0].scrollWidth > t.innerWidth()) { 175 if (mb + d > tb) { 176 t.css('padding-bottom', ((mb + d) - tb)); 177 } 178 } else { 179 t.css('overflow', 'visible'); 180 } 181 }).on('hidden.bs.dropdown', function () { 182 $(this).css({'padding-bottom': '', 'overflow': ''}); 183 }); 184 //--></script> 185 <script type="text/javascript"><!-- 186 $('#button-filter').on('click', function() { 187 url = 'index.php?route=customer/customer&user_token={{ user_token }}'; 188 var filter_name = $('input[name=\'filter_name\']').val(); 189 if (filter_name) { 190 url += '&filter_name=' + encodeURIComponent(filter_name); 191 } 192 var filter_email = $('input[name=\'filter_email\']').val(); 193 if (filter_email) { 194 url += '&filter_email=' + encodeURIComponent(filter_email); 195 } 196 var filter_customer_group_id = $('select[name=\'filter_customer_group_id\']').val(); 197 if (filter_customer_group_id !== '') { 198 url += '&filter_customer_group_id=' + encodeURIComponent(filter_customer_group_id); 199 } 200 var filter_status = $('select[name=\'filter_status\']').val(); 201 if (filter_status !== '') { 202 url += '&filter_status=' + encodeURIComponent(filter_status); 203 } 204 var filter_ip = $('input[name=\'filter_ip\']').val(); 205 if (filter_ip) { 206 url += '&filter_ip=' + encodeURIComponent(filter_ip); 207 } 208 var filter_date_added = $('input[name=\'filter_date_added\']').val(); 209 if (filter_date_added) { 210 url += '&filter_date_added=' + encodeURIComponent(filter_date_added); 211 } 212 location = url; 213 }); 214 //--></script> 215 <script type="text/javascript"><!-- 216 $('input[name=\'filter_name\']').autocomplete({ 217 'source': function(request, response) { 218 $.ajax({ 219 url: 'index.php?route=customer/customer/autocomplete&user_token={{ user_token }}&filter_name=' + encodeURIComponent(request), 220 dataType: 'json', 221 success: function(json) { 222 response($.map(json, function(item) { 223 return { 224 label: item['name'], 225 value: item['customer_id'] 226 } 227 })); 228 } 229 }); 230 }, 231 'select': function(item) { 232 $('input[name=\'filter_name\']').val(item['label']); 233 } 234 }); 235 $('input[name=\'filter_email\']').autocomplete({ 236 'source': function(request, response) { 237 $.ajax({ 238 url: 'index.php?route=customer/customer/autocomplete&user_token={{ user_token }}&filter_email=' + encodeURIComponent(request), 239 dataType: 'json', 240 success: function(json) { 241 response($.map(json, function(item) { 242 return { 243 label: item['email'], 244 value: item['customer_id'] 245 } 246 })); 247 } 248 }); 249 }, 250 'select': function(item) { 251 $('input[name=\'filter_email\']').val(item['label']); 252 } 253 }); 254 //--></script> 255 <script type="text/javascript"><!-- 256 $('.date').datetimepicker({ 257 language: '{{ datepicker }}', 258 pickTime: false 259 }); 260 //--></script> 261 </div> 262 {{ footer }}