<?php 
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

if ( ! isset( $admin_product_page_nonce ) ) {
	$admin_product_page_nonce = wp_create_nonce( 'admin_product_page_nonce' );
}

?>
<div class=" bg-dark bg-opacity-25 elex-multi-vendor-for-woocommerce-popup row justify-content-end" id="elex-multi-vendor-for-woocommerce-add-admin-product-filter" style="overflow: scroll;" >

<form action = '#'   method= 'GET' class="h-100 m-0">
				<input  name="page" hidden value="elex-multi-vendor-for-woocommerce-products" class="form-control">

			<div class="col-lg-6 col-md-8 col-12 bg-white h-100 ms-auto overflow-auto">
				<div class="py-2 px-4 mt-5 text-center position-relative">
					<h5>Advance Filter</h5>
					<button class="btn rounded-circle position-absolute top-0 end-0 elex-multi-vendor-for-woocommerce-add-admin-product-filter-close-btn" type="button">
						<i class="fa-solid fa-xmark"></i>
					</button>
				</div>
				<div class="px-md-5 px-2 py-3">
					<div class="row">

					<div class="form-group col-md-6 mb-3">
						<label>Product Status</label>
						<select name="status" id="status" class="form-select">
						<?php $status_val = $GET_status; ?>
							<option value="">All</option>
							<option value="publish"  <?php ( 'publish' === $status_val ) ? esc_html_e( 'selected' , 'elex-multi-vendor-for-woocommerce' ) : '' ; ?>  >Approved</option>
							<option value="pending" <?php ( 'pending' === $status_val ) ? esc_html_e( 'selected' , 'elex-multi-vendor-for-woocommerce' ) : '' ; ?> >Pending</option>
							<option value="reject" <?php ( 'reject' === $status_val ) ? esc_html_e( 'selected' , 'elex-multi-vendor-for-woocommerce' ) : '' ; ?> >Rejected</option>
							<option value="draft" <?php ( 'draft' === $status_val ) ? esc_html_e( 'selected' , 'elex-multi-vendor-for-woocommerce' ) : '' ; ?> >Draft</option>

						</select>
						
					</div> 

					<div class="form-group col-md-6 mb-3">
						<label>Enabled</label>
						<select name="enabled" id="enabled" class="form-select">
						<?php $status_val = $GET_enabled; ?>
							<option value="">All</option>
							<option value="visible"  <?php ( 'visible' === $status_val ) ? esc_html_e( 'selected' , 'elex-multi-vendor-for-woocommerce' ) : '' ; ?>  >Enabled</option>
							<option value="hidden" <?php ( 'hidden' === $status_val ) ? esc_html_e( 'selected' , 'elex-multi-vendor-for-woocommerce' ) : '' ; ?> >Disabled</option>
							
						</select>
					</div> 


					<div class="form-group col-md-6 mb-3">
							<label>Vendor</label>
							<select type="text" style="width:100% !important" name="vendor" class="elex-admin-add-vendor-filter-product-vendor-name form-select border-2 border-secondary " >
							</select>
					</div>

					</div>

					<?php 
					$vendor_post = ! empty( $GET_vendor ) ? get_post( $GET_vendor ) : '';
					$vendor_name = ! empty( $vendor_post ) ? $vendor_post->title : '';
					?>
					<!-- <input type="text" name="elex-advance-filter" value="yes" hidden>       
					<?php wp_nonce_field( 'elex_mv_prod_page_nonce', 'nonce' ); ?>  -->
		   
					<!-- <div class="d-flex gap-3 mb-4">
						<div class="form-group w-50">
							<label for="">From</label>
							<input  name="from_date" type="date" class="form-control">
						</div>
						<div class="form-group w-50">
							<label for="">To</label>
							<input name="to_date" type="date" class="form-control">
						</div>
					</div> -->

					<input type="hidden" id="admin_product_page_nonce"  name="admin_product_page_nonce" value="<?php echo esc_attr( $admin_product_page_nonce ); ?>" />
					<button id="elex-multi-vendor-for-woocommerce-advanced-filter-submit-button" class="btn btn-primary w-100" type="submit">Apply Filters</button>
				</div>
			</div>
</form>

</div>
