<form action="<?php echo $_SERVER['PHP_SELF']; ?>?controller=pjAdminVouchers&amp;action=pjActionCreate" method="post" id="frmCreateVoucher" class="form pj-form" autocomplete="off">
	<input type="hidden" name="voucher_create" value="1" />
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
		<h4 class="modal-title" id="myModalDiscountLabel"><?php __('infoAddVoucherTitle');?></h4>
	</div>
	<div class="modal-body">
		<div class="form-group">
			<label class="control-label"> <?php __('lblVoucherCode'); ?></label>
			<input type="text" name="code" id="code" maxlength="8" class="form-control required" data-msg-required="<?php __('pj_field_required');?>" data-msg-remote="<?php __('lblVoucherCodeExist'); ?>">
			<p></p>
		<button type="button" class="ladda-button btn btn-primary btn-phpjabbers-loader btnGenrateVoucher" data-style="zoom-in" style="margin-right: 15px;">
			<span class="ladda-label">Generate coupon code<?php __('btnSave'); ?></span>
		</button>
		</div>
		<div class="form-group">
            <div class="row">
                <div class="col-sm-6 col-xs-12">
                    <label class="control-label"><?php __('lblDateFrom'); ?></label>
                    
                    <div class="input-group"> 
						<input type="text" name="date_from" id="date_from" class="form-control datepick required" value="<?php echo date($tpl['option_arr']['o_date_format'], time());?>" readonly="readonly" data-msg-required="<?php __('pj_field_required');?>" /> 
						<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
					</div>
                </div>

                <div class="col-sm-6 col-xs-12">
                    <label class="control-label"><?php __('lblDateTo'); ?></label>

                    <div class="input-group"> 
						<input type="text" name="date_to" id="date_to" class="form-control datepick required" value="<?php echo date($tpl['option_arr']['o_date_format'], strtotime('+7 days'));?>" readonly="readonly" data-msg-required="<?php __('lblFieldRequired');?>" />
						<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
					</div>
                </div>
            </div>
        </div>
		
	
		
	
		<div class="row">

			<div class="col-sm-6 col-xs-12">
			<label class="control-label"><?php __('lblDiscount'); ?></label>
				<div class="form-group">
					<div class="input-group">
						<input class="form-control text-right required number" min="0" data-msg-min="<?php __('pj_field_negative_number_err');?>" type="text" id="discount" name="discount" data-msg-required="<?php __('pj_field_required');?>" data-msg-number="<?php __('prices_invalid_price', false, true);?>">
						<span class="input-group-addon"><strong id="icon_type"><?php echo pjCurrency::getCurrencySign($tpl['option_arr']['o_currency'], false) ?></strong></span>
					</div>
				</div>
			</div>

			<div class="col-sm-6 col-xs-12">
			<label class="control-label"><?php __('lblDiscountType'); ?></label>
				<div class="form-group">
					<select class="form-control required" name="type" id="type" data-msg-required="<?php __('pj_field_required');?>">
                    	<?php
						foreach (__('voucher_types', true, false) as $k => $v)
						{
							?><option value="<?php echo $k; ?>" data-sign="<?php echo $k == 'amount' ? pjCurrency::getCurrencySign($tpl['option_arr']['o_currency'], false) : '%'; ?>"><?php echo $v; ?></option><?php
						}
						?>
                    </select>
				</div>
			</div>
		</div>
	
		
		<!-- <?php //$apply_on = pjUtil::sortArrayByArray(__('apply_on'), array('room','extra','both'));?>
		<div class="form-group">
			<label class="control-label"><?php // __('lblApplyDiscountOn');?></label>
	
			<select class="form-control required" name="apply_on" id="apply_on" data-msg-required="<?php // __('pj_field_required');?>">
				<?php
				// foreach($apply_on as $k => $v)
				// {
					?>
					<option value="<?php //echo $k?>" <?php // echo $k == 'room' ? 'selected="selected"' : '';?>><?php // echo $v;?></option>
					<?php
				//} 
				?>
			</select>
		</div> -->
	
		<div class="row">
			<div class="col-sm-8">
				<div class="form-group">
					<input type="checkbox" name="used_count" id="used_count" value="0">
					<label for="used_count" class="control-label m-t-xs">One time use only</label>
				</div>
			</div>
			
		</div>

		<script>
			document.getElementById('used_count').addEventListener('change', function() {
				this.value = this.checked ? '1' : '0';
			});
		</script>
	</div>
	<div class="modal-footer">
		<button type="button" class="btn btn-default" data-dismiss="modal"><?php __('btnClose')?></button>
		<button type="button" class="ladda-button btn btn-primary btn-phpjabbers-loader btnSaveVoucher" data-style="zoom-in" style="margin-right: 15px;">
			<span class="ladda-label"><?php __('btnSave'); ?></span>
			<?php include $controller->getConstant('pjBase', 'PLUGIN_VIEWS_PATH') . 'pjLayouts/elements/button-animation.php'; ?>
		</button>
	</div>
</form>