<div class="modal-header">
  <button type="button" class="pull-right btn btn-danger btn-sm" data-dismiss="modal" aria-hidden="true"><i class="fa fa-close"></i></button>
  <h4 class="modal-title">{{ entry_quantity }}</h4>
</div>
<div class="modal-body" id="body-mass-product-quantity">
  <form action="{{ action }}" method="post" enctype="multipart/form-data" id="form-mass-product-quantity" class="form-horizontal">	
	<div class="alert alert-info">{{ text_example_quantity }}</div>
	<div class="form-group">	
	  <div class="col-sm-6">
		<label class="control-label" for="input-quantity-value">{{ entry_value_edit }}</label>
		<input type="text" name="quantity_value" value="" placeholder="{{ entry_value_edit }}" id="input-quantity-value" class="form-control" />
	  </div>
	  <div class="col-sm-6">
		<label class="control-label" for="input-quantity-method">{{ entry_method_edit }}</label>
		<select name="quantity_method" id="input-quantity-method" class="form-control">
          <option value="plus">{{ text_plus }}</option>
		  <option value="minus">{{ text_minus }}</option>
          <option value="multiply">{{ text_multiply }}</option>
          <option value="divide">{{ text_divide }}</option>
		  <option value="equality">{{ text_equality }}</option>
        </select>
	  </div>
	</div>
  </form>
</div>
<div class="modal-footer">
  <div class="text-center"><a data-form="form-mass-product-quantity" class="button-save btn btn-primary"><i class="fa fa-save"></i> {{ button_save }}</a></div>
</div>
<script type="text/javascript"><!--
$(".button-save").on('click', function(){		
	$.ajax({
		url: $('#' + $(this).data('form')).attr('action'),
		type: 'post',
		dataType: 'json',
		data: $('#product-list input[type=\'checkbox\']:checked, #' + $(this).data('form') + ' input[type=\'text\'], #' + $(this).data('form') + ' select'),
		success: function(json) {				
			if (json['error']) {
				$('#form-mass-product-quantity').before('<div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> ' + json['error'] + '</div>');
				
				$('.alert-danger').delay(1500).fadeOut(500);	
			}
								
			if (json['success']) {
				$('#form-mass-product-quantity').before('<div class="alert alert-success"><i class="fa fa-check-circle"></i> ' + json['success'] + '</div>');			
				
				setTimeout(function(){
					location.reload(true);
				}, 1000)
			}
		}
	});
});  
//--></script>