<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_price }}</h4>
</div>
<div class="modal-body" id="body-mass-product-price">
  <form action="{{ action }}" method="post" enctype="multipart/form-data" id="form-mass-product-price" class="form-horizontal">	
	<div class="alert alert-info">{{ text_example_price }}</div>
	<div class="form-group">
	  <div class="col-sm-4">
		<label class="control-label" for="input-price-method">{{ entry_method_edit }}</label>
		<select name="price_method" id="input-price-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 class="col-sm-4">
	    <label class="control-label" for="input-price-value">{{ entry_value_edit }}</label>
		<input type="text" name="price_value" value="" placeholder="{{ entry_value_edit }}" id="input-price-value" class="form-control" />
	  </div>
	  <div class="col-sm-4">
		<label class="control-label" for="input-price-type">{{ entry_type_edit }}</label>
		<select name="price_type" id="input-price-type" class="form-control">
		  <option value="amount">{{ text_amount }}</option>
		  <option value="percent">{{ text_percent }}</option>
		</select>
	  </div>
	</div>
	<div class="form-group">
	  <div class="col-sm-6">
		<div class="row">
		  <label class="col-sm-9 control-label">{{ entry_apply_special }}</label>
		  <div class="col-sm-3">
			<div class="input-checkbox">
			  <input type="checkbox" class="checkbox" name="apply_special" value="1" id="apply_special" />
			  <label for="apply_special"></label>
			</div>
		  </div>
		</div>
	  </div>
	  <div class="col-sm-6">
		<div class="row">
		  <label class="col-sm-9 control-label">{{ entry_apply_discount }}</label>
		  <div class="col-sm-3">
			<div class="input-checkbox">
			  <input type="checkbox" class="checkbox" name="apply_discount" value="1" id="apply_discount" />
			  <label for="apply_discount"></label>
			</div>
		  </div>
		</div>
	  </div>
	</div>
  </form>
</div>
<div class="modal-footer">
  <div class="text-center"><a data-form="form-mass-product-price" 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') + ' input[type=\'checkbox\']:checked, #' + $(this).data('form') + ' select'),
		success: function(json) {				
			if (json['error']) {
				$('#form-mass-product-price').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-price').before('<div class="alert alert-success"><i class="fa fa-check-circle"></i> ' + json['success'] + '</div>');			
				
				setTimeout(function(){
					location.reload(true);
				}, 1000)
			}
		}
	});
});  
//--></script>