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

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


?>
<header>
	<div class="header-container bg-white wps-r-8">
		<h2 class="wp-heading-inline"><?php _e('Edit dealer', 'ffl-dealers'); ?></h2>
		<h2 class="wp-heading-inline"><a href="<?php echo admin_url( 'admin.php?page=ffl-dealers&action=new' ); ?>" class="page-title-action"><?php _e( 'Add New', 'ffl-dealers' ); ?></a></h4>
	</div>
</header>

<div class="wrap">
	
	<?php if ( isset( $_GET['updated'] ) ) { ?>
	<div class="notice notice-success">
		<p><?php _e( 'Dealer has been updated successfully!', 'ffl-dealers' ); ?></p>
	</div>
	<?php } ?>
	<?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' ); ?>
	<input type="hidden" name="dealer_id" value="<?php echo $dealer['id'];?>">
		<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" value="<?php echo $dealer['license_number'];?>" >
				</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" value="<?php echo $dealer['short_lic'];?>">
				</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" value="<?php echo $dealer['license_name'];?>">
				</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" value="<?php echo $dealer['business_name'];?>">
				</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_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" value="<?php echo $dealer['premise_street'];?>">
				</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" value="<?php echo $dealer['premise_city'];?>">
				</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" value="<?php echo $dealer['premise_state'];?>">
				</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" value="<?php echo $dealer['premise_zip_code'];?>">
				</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" value="<?php echo $dealer['lat'];?>">
				</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="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" value="<?php echo $dealer['lng'];?>">
				</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="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"  value="<?php echo $dealer['voice_phone'];?>">
				</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"  <?php checked($dealer['check_status'],1);?> />
				</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" <?php checked($dealer['default_dealer'],1);?> id="default_dealer" />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">Update</button></div>
		</div>
		</div>
    </form>
    </div>

</div>