<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">{{ text_shipping }}</h4>
</div>
<div class="modal-body" id="body-mass-product-stock">
  <form action="{{ action }}" method="post" enctype="multipart/form-data" id="form-mass-product-stock" class="form-horizontal">	
	<div class="alert alert-info"><i class="fa fa-info-circle"></i> {{ text_edit_info }}</div>
	<div class="form-group">	
	  <div class="col-sm-4">
		<label class="control-label" for="input-subtract">{{ entry_subtract }}</label>
		<div class="input-group">
		  <span class="input-group-addon"><input type="checkbox" name="status_subtract" value="1" /></span>
		  <select name="subtract" id="input-subtract" class="form-control">
			<option value="1" selected="selected">{{ text_yes }}</option>
			<option value="0">{{ text_no }}</option>
		  </select>
		</div>
	  </div>
	  <div class="col-sm-4">
		<label class="control-label" for="input-stock-status"><span data-toggle="tooltip" title="{{ help_stock_status }}">{{ entry_stock_status }}</span></label>
		<div class="input-group">
		  <span class="input-group-addon"><input type="checkbox" name="status_stock_status" value="1" /></span>
		  <select name="stock_status_id" id="input-stock-status" class="form-control">
			{% for stock_status in stock_statuses %}
			  <option value="{{ stock_status.stock_status_id }}">{{ stock_status.name }}</option>
			{% endfor %}
		  </select>
		</div>
	  </div>	
	  <div class="col-sm-4">
		<label class="control-label" for="input-shipping">{{ entry_shipping }}</label>
		<div class="input-group">
		  <span class="input-group-addon"><input type="checkbox" name="status_shipping" value="1" /></span>
		  <select name="shipping" id="input-shipping" class="form-control">
			<option value="1" selected="selected">{{ text_yes }}</option>
			<option value="0">{{ text_no }}</option>
		  </select>
		</div>
	  </div>
	</div>
  </form>
</div>
<div class="modal-footer">
  <div class="text-center"><a data-form="form-mass-product-stock" 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-stock').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-stock').before('<div class="alert alert-success"><i class="fa fa-check-circle"></i> ' + json['success'] + '</div>');	
				
				setTimeout(function(){
					$('#modal-product-edit').modal('hide');
				}, 1000)
			}
		}
	});
});  
//--></script>