shop.balmet.com

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

voucher_list.twig (7480B)


      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" id="button-send" data-toggle="tooltip" title="{{ button_send }}" class="btn btn-warning"><i class="fa fa-envelope"></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-voucher').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">
     19     {% if error_warning %}
     20     <div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> {{ error_warning }}
     21       <button type="button" class="close" data-dismiss="alert">&times;</button>
     22     </div>
     23     {% endif %}
     24     {% if success %}
     25     <div class="alert alert-success alert-dismissible"><i class="fa fa-check-circle"></i> {{ success }}
     26       <button type="button" class="close" data-dismiss="alert">&times;</button>
     27     </div>
     28     {% endif %}
     29     <div class="panel panel-default">
     30       <div class="panel-heading">
     31         <h3 class="panel-title"><i class="fa fa-list"></i> {{ text_list }}</h3>
     32       </div>
     33       <div class="panel-body">
     34         <form action="{{ delete }}" method="post" enctype="multipart/form-data" id="form-voucher">
     35           <div class="table-responsive">
     36             <table class="table table-bordered table-hover">
     37               <thead>
     38                 <tr>
     39                   <td style="width: 1px;" class="text-center"><input type="checkbox" onclick="$('input[name*=\'selected\']').prop('checked', this.checked);" /></td>
     40                   <td class="text-left">{% if sort == 'v.code' %}
     41                     <a href="{{ sort_code }}" class="{{ order|lower }}">{{ column_code }}</a>
     42                     {% else %}
     43                     <a href="{{ sort_code }}">{{ column_code }}</a>
     44                     {% endif %}</td>
     45                   <td class="text-left">{% if sort == 'v.from_name' %}
     46                     <a href="{{ sort_from }}" class="{{ order|lower }}">{{ column_from }}</a>
     47                     {% else %}
     48                     <a href="{{ sort_from }}">{{ column_from }}</a>
     49                     {% endif %}</td>
     50                   <td class="text-left">{% if sort == 'v.to_name' %}
     51                     <a href="{{ sort_to }}" class="{{ order|lower }}">{{ column_to }}</a>
     52                     {% else %}
     53                     <a href="{{ sort_to }}">{{ column_to }}</a>
     54                     {% endif %}</td>
     55                   <td class="text-right">{% if sort == 'v.amount' %}
     56                     <a href="{{ sort_amount }}" class="{{ order|lower }}">{{ column_amount }}</a>
     57                     {% else %}
     58                     <a href="{{ sort_amount }}">{{ column_amount }}</a>
     59                     {% endif %}</td>
     60                   <td class="text-left">{% if sort == 'theme' %}
     61                     <a href="{{ sort_theme }}" class="{{ order|lower }}">{{ column_theme }}</a>
     62                     {% else %}
     63                     <a href="{{ sort_theme }}">{{ column_theme }}</a>
     64                     {% endif %}</td>
     65                   <td class="text-left">{% if sort == 'v.status' %}
     66                     <a href="{{ sort_status }}" class="{{ order|lower }}">{{ column_status }}</a>
     67                     {% else %}
     68                     <a href="{{ sort_status }}">{{ column_status }}</a>
     69                     {% endif %}</td>
     70                   <td class="text-left">{% if sort == 'v.date_added' %}
     71                     <a href="{{ sort_date_added }}" class="{{ order|lower }}">{{ column_date_added }}</a>
     72                     {% else %}
     73                     <a href="{{ sort_date_added }}">{{ column_date_added }}</a>
     74                     {% endif %}</td>
     75                   <td class="text-right">{{ column_action }}</td>
     76                 </tr>
     77               </thead>
     78               <tbody>
     79                 {% if vouchers %}
     80                 {% for voucher in vouchers %}
     81                 <tr>
     82                   <td class="text-center">{% if voucher.voucher_id in selected %}
     83                     <input type="checkbox" name="selected[]" value="{{ voucher.voucher_id }}" checked="checked" />
     84                     {% else %}
     85                     <input type="checkbox" name="selected[]" value="{{ voucher.voucher_id }}" />
     86                     {% endif %}</td>
     87                   <td class="text-left">{{ voucher.code }}</td>
     88                   <td class="text-left">{{ voucher.from }}</td>
     89                   <td class="text-left">{{ voucher.to }}</td>
     90                   <td class="text-right">{{ voucher.amount }}</td>
     91                   <td class="text-left">{{ voucher.theme }}</td>
     92                   <td class="text-left">{{ voucher.status }}</td>
     93                   <td class="text-left">{{ voucher.date_added }}</td>
     94                   <td class="text-right">
     95                   {% if voucher.order %}
     96                   <a href="{{ voucher.order }}" data-toggle="tooltip" title="{{ button_order }}" class="btn btn-info"><i class="fa fa fa-eye"></i></a>
     97                   {% endif %}
     98                   <a href="{{ voucher.edit }}" data-toggle="tooltip" title="{{ button_edit }}" class="btn btn-primary"><i class="fa fa-pencil"></i></a></td>
     99                 </tr>
    100                 {% endfor %}
    101                 {% else %}
    102                 <tr>
    103                   <td class="text-center" colspan="9">{{ text_no_results }}</td>
    104                 </tr>
    105                 {% endif %}
    106               </tbody>
    107             </table>
    108           </div>
    109         </form>
    110         <div class="row">
    111           <div class="col-sm-6 text-left">{{ pagination }}</div>
    112           <div class="col-sm-6 text-right">{{ results }}</div>
    113         </div>
    114       </div>
    115     </div>
    116   </div>
    117   <script type="text/javascript"><!--
    118 $('#button-send').on('click', function() {
    119 	$.ajax({
    120 		url: 'index.php?route=sale/voucher/send&user_token={{ user_token }}',
    121 		type: 'post',
    122 		dataType: 'json',
    123 		data: $('input[name^=\'selected\']:checked'),
    124 		beforeSend: function() {
    125 			$('#button-send i').replaceWith('<i class="fa fa-circle-o-notch fa-spin"></i>');
    126 			$('#button-send').prop('disabled', true);
    127 		},	
    128 		complete: function() {
    129 			$('#button-send i').replaceWith('<i class="fa fa-envelope"></i>');
    130 			$('#button-send').prop('disabled', false);
    131 		},
    132 		success: function(json) {
    133 			$('.alert-dismissible').remove();
    134 			
    135 			if (json['error']) {
    136 				$('#content > .container-fluid').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> ' + json['error'] + '</div>');
    137 			}
    138 			
    139 			if (json['success']) {
    140 				$('#content > .container-fluid').prepend('<div class="alert alert-success alert-dismissible"><i class="fa fa-check-circle"></i> ' + json['success'] + '</div>');
    141 			}		
    142 		},
    143 		error: function(xhr, ajaxOptions, thrownError) {
    144 			alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
    145 		}
    146 	});	
    147 })
    148 //--></script></div>
    149 {{ footer }}