<?php 
if (!defined('ABSPATH')) {

    exit(); // Exit if accessed directly.
}


?>
<header>
    <div class="header-container bg-white wps-r-8">
        <h2><?php _e('Add dealer', 'ffl-dealers'); ?></h2>
    </div>
</header>

<div class="wrap">
	<?php if ( isset( $_GET['inserted'] ) ) { ?>
        <div class="notice notice-success">
            <p><?php _e( 'Dealer has been added successfully!', 'ffl-dealers' ); ?></p>
        </div>
    <?php } ?>
    <div class="tab-content">
	<form action="<?php echo FFL_DEALERS_ADMIN_POST_URL;?>" method="post" id="ffl-dealer-form">
	<input type="hidden" name="action" value="ffl_dealers">
	<?php wp_nonce_field( 'ffl_deaer_nonce', 'ffl_deaer_fields' ); ?>
		<div class="ffl-dealer-form-filds">
		<div class="form-group">
			<div class="form-group-label" style="display: block">
				<label for="license_number" class="form-label">Licence number</label>
			</div>
			<div class="form-group-control">
				<div class="text-field text-field-outlined" >
					<input class="regular-text" type="text" name="license_number"  required>
					<?php if ( $this->has_error( 'license_number' ) ) { ?>
						<p class="description error"><?php echo $this->get_error( 'license_number' ); ?></p>
					<?php } ?>
				</div>
				<div class="text-field-helper-line">
					<div class="text-field-helper-text" id="" aria-hidden="true"></div>
				</div>
			</div>
		</div>
		<div class="form-group">
			<div class="form-group-label">
				<label for="short_lic" class="form-label">Short Licence</label>
			</div>
			<div class="form-group-control">
				<div class="text-field text-field-outlined" >
					<input class="regular-text" type="text" name="short_lic" required />
					<?php if ( $this->has_error( 'short_lic' ) ) { ?>
						<p class="description error"><?php echo $this->get_error( 'short_lic' ); ?></p>
					<?php } ?>
				</div>
				<div class="text-field-helper-line">
					<div class="text-field-helper-text" id="" aria-hidden="true"></div>
				</div>
			</div>
		</div>
		<div class="form-group">
			<div class="form-group-label">
				<label for="license_name" class="form-label">Licence Name</label>
			</div>
			<div class="form-group-control">
				<div class="text-field text-field-outlined" >
					<input class="regular-text" type="text" name="license_name" required >
					<?php if ( $this->has_error( 'license_name' ) ) { ?>
						<p class="description error"><?php echo $this->get_error( 'license_name' ); ?></p>
					<?php } ?>
				</div>
				<div class="text-field-helper-line">
					<div class="text-field-helper-text" id="" aria-hidden="true"></div>
				</div>
			</div>
		</div>
		<div class="form-group">
			<div class="form-group-label">
				<label for="business_name" class="form-label">Business Name</label>
			</div>
			<div class="form-group-control">
				<div class="text-field text-field-outlined" >
					<input class="regular-text" type="text" name="business_name" required >
					<?php if ( $this->has_error( 'business_name' ) ) { ?>
						<p class="description error"><?php echo $this->get_error( 'business_name' ); ?></p>
					<?php } ?>
				</div>
				<div class="text-field-helper-line">
					<div class="regular-text" class="text-field-helper-text" id="" aria-hidden="true"></div>
				</div>
			</div>
		</div>
		<div class="form-group">
			<div class="form-group-label">
				<label for="premise_street" class="form-label">Street</label>
			</div>
			<div class="form-group-control">
				<div class="text-field text-field-outlined" >
					<input class="regular-text" type="text" name="premise_street" required>
					<?php if ( $this->has_error( 'premise_street' ) ) { ?>
						<p class="description error"><?php echo $this->get_error( 'premise_street' ); ?></p>
					<?php } ?>
				</div>
				<div class="text-field-helper-line">
					<div class="text-field-helper-text" id="" aria-hidden="true"></div>
				</div>
			</div>
		</div>
		<div class="form-group">
			<div class="form-group-label">
				<label for="premise_city" class="form-label">City</label>
			</div>
			<div class="form-group-control">
				<div class="text-field text-field-outlined" >
					<input class="regular-text" type="text" name="premise_city" required>
					<?php if ( $this->has_error( 'premise_city' ) ) { ?>
						<p class="description error"><?php echo $this->get_error( 'premise_city' ); ?></p>
					<?php } ?>
				</div>
				<div class="text-field-helper-line">
					<div class="text-field-helper-text" id="" aria-hidden="true"></div>
				</div>
			</div>
		</div>
		<div class="form-group">
			<div class="form-group-label">
				<label for="premise_state" class="form-label">State</label>
			</div>
			<div class="form-group-control">
				<div class="text-field text-field-outlined" >
					<input class="regular-text" type="text" name="premise_state" required>
					<?php if ( $this->has_error( 'premise_state' ) ) { ?>
						<p class="description error"><?php echo $this->get_error( 'premise_state' ); ?></p>
					<?php } ?>
				</div>
				<div class="text-field-helper-line">
					<div class="text-field-helper-text" id="" aria-hidden="true"></div>
				</div>
			</div>
		</div>
		<div class="form-group">
			<div class="form-group-label">
				<label for="premise_zip_code" class="form-label">Zipcode</label>
			</div>
			<div class="form-group-control">
				<div class="text-field text-field-outlined" >
					<input class="regular-text" type="text" name="premise_zip_code" required>
					<?php if ( $this->has_error( 'premise_zip_code' ) ) { ?>
						<p class="description error"><?php echo $this->get_error( 'premise_zip_code' ); ?></p>
					<?php } ?>
				</div>
				<div class="text-field-helper-line">
					<div class="text-field-helper-text" id="" aria-hidden="true"></div>
				</div>
			</div>
		</div>
		<div class="form-group">
			<div class="form-group-label">
				<label for="lat" class="form-label">Latitude</label>
			</div>
			<div class="form-group-control">
				<div class="text-field text-field-outlined" >
					<input class="regular-text" type="text" name="lat" />
				</div>
				<div class="text-field-helper-line">
					<div class="text-field-helper-text" id="" aria-hidden="true"> Google map key is available in the map settings, it'll be filled automatically </div>
				</div>
			</div>
		</div>
		<div class="form-group">
			<div class="form-group-label">
				<label for="lng" class="form-label">Longitude</label>
			</div>
			<div class="form-group-control">
				<div class="text-field text-field-outlined" >
					<input class="regular-text" type="text" name="lng"  >
				</div>
				<div class="text-field-helper-line">
					<div class="text-field-helper-text">Google map key is available in the map settings, it'll be filled automatically</div>
				</div>
			</div>
		</div>
		<div class="form-group">
			<div class="form-group-label" style="display: block">
				<label for="voice_phone" class="form-label">Phone</label>
			</div>
			<div class="form-group-control">
				<div class="text-field text-field-outlined" >
					<input class="regular-text" type="text" name="voice_phone" required >
					<?php if ( $this->has_error( 'voice_phone' ) ) { ?>
						<p class="description error"><?php echo $this->get_error( 'voice_phone' ); ?></p>
					<?php } ?>
				</div>
				<div class="text-field-helper-line">
					<div class="text-field-helper-text" id="" aria-hidden="true"></div>
				</div>
			</div>
		</div>
		<div class="form-group">
			<div class="form-group-label" style="display: block">
				<label for="check_status" class="form-label">Publish</label>
			</div>
			<div class="form-group-control">
				<div class="text-field text-field-outlined" >
					<input class="regular-text" type="checkbox" name="check_status" id="check_status"  checked />
				</div>
				<div class="text-field-helper-line">
					<div class="text-field-helper-text" id="" aria-hidden="true"></div>
				</div>
			</div>
		</div>
		<div class="form-group">
			<div class="form-group-label" style="display: block">
				<label for="default_dealer" class="form-label">Default dealer</label>
			</div>
			<div class="form-group-control">
				<div class="text-field text-field-outlined" >
					<label><input class="regular-text" type="checkbox" name="default_dealer" id="default_dealer" checked />Use your inserted data as a default data </label>
				</div>
			</div>
		</div>
		<div class="form-group ">
			<div class="submit-button-wrapper"><button type="submit" name="edit_dealers" class="button primary">Submit</button></div>
		</div>
		</div>
    </form>
    </div>
</div>