<?php if ( ! defined( 'ABSPATH' ) ) {
exit;} ?>
<!-- Generate coupon -->

		<div class="row justify-content-end w-100 bg-dark bg-opacity-25 elex-multi-vendor-for-woocommerce-popup vh-100 m-0" id="elex-multi-vendor-for-woocommerce-coupon-setting">

		<div class="toast p-2 position-fixed top-0 start-50 translate-middle-x bg-white mt-4 elex_coupon_generate_toast_c">
			<div class="toast-header border-0 ">
				<strong class="me-auto">
					<svg xmlns="http://www.w3.org/2000/svg" width="22.415" height="22.026" viewBox="0 0 22.415 22.026" class="me-2">
						<g id="Icon_feather-check-circle" data-name="Icon feather-check-circle" transform="translate(-1.998 -1.979)">
							<path id="Path_646" data-name="Path 646" d="M23,12.076V13a10,10,0,1,1-5.93-9.139" fill="none" stroke="#28a745" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
							<path id="Path_647" data-name="Path 647" d="M26.5,6l-10,10.009-3-3" transform="translate(-3.5 -1.003)" fill="none" stroke="#28a745" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
						</g>
						</svg>
					<span id="toast_message_mv" >New item Added Successfully</span></strong>
				<button type="button" class="btn-close" data-bs-dismiss="toast"></button>
			</div> 
			</div>
			<div class="col-xl-6 col-lg-8 col-md-10 bg-white h-100 elex-multi-vendor-for-woocommerce-popup-content me-3 ms-auto overflow-scroll px-0">
				<div class="py-2 px-4 text-center  position-relative mt-4">
					<div class="fs-5 fw-semi-bold mb-1">Generate Coupon</div>
					<button class="btn rounded-circle elex-multi-vendor-for-woocommerce-coupon-popup-close position-absolute top-0 end-0 ">
						<i class="fa-solid fa-xmark"></i>
					</button>
				</div>
				<div class="alert alert-success d-none" role="alert">
					A simple success alert—check it out!
				</div>
				<ul class="nav nav-tabs bg-primary bg-opacity-10 px-md-5 px-2 justify-content-between elex-multi-vendor-for-woocommerce-coupon-tab-links" role="tablist">
					<li class="nav-item" role="presentation">
						<button class="nav-link active px-0" id="elex-multi-vendor-for-woocommerce-edit-prod-details-tab" data-bs-toggle="tab" data-bs-target="#elex-multi-vendor-for-woocommerce-edit-prod-details" type="button" role="tab" aria-controls="elex-multi-vendor-for-woocommerce-edit-prod-details" aria-selected="true">Coupon Details</button>
					</li>
					<li class="nav-item" role="presentation">
						<button class="nav-link px-0" id="elex-multi-vendor-for-woocommerce-edit-price-stock-tab" data-bs-toggle="tab" data-bs-target="#elex-multi-vendor-for-woocommerce-edit-price-stock" type="button" role="tab" aria-controls="elex-multi-vendor-for-woocommerce-edit-price-stock" aria-selected="false">Usage Restrictions</button>
					</li>
					<li class="nav-item" role="presentation">
						<button class="nav-link px-0" id="elex-multi-vendor-for-woocommerce-edit-ship-tab" data-bs-toggle="tab" data-bs-target="#elex-multi-vendor-for-woocommerce-edit-ship" type="button" role="tab" aria-controls="elex-multi-vendor-for-woocommerce-edit-ship" aria-selected="false">Usage Limits</button>
					</li>
				</ul>
				<form id="elex-multi-vendor-for-woocommerce-coupon-add-form" method="post">
				<input type="hidden" name="action" value="elex_mv_coupon_create"></input>
				<?php wp_nonce_field( '_ajax_nonce', 'mv_nonce' ); ?>
			  
				<div class="tab-content">
					<!-- Coupon Details -->
					<div class="tab-pane fade show active" id="elex-multi-vendor-for-woocommerce-edit-prod-details" role="tabpanel" aria-labelledby="elex-multi-vendor-for-woocommerce-edit-prod-details-tab">
						<div class="px-md-5 px-2 py-3">
							<div class="form-group mb-3">
								<div class="fs-6 fw-semi-bold mb-1" >Coupon Title *</div>
								<input type="text" value="" id="elex-coupon-title-field" class="form-control border-2 border-secondary elex-coupon-title-field" name="title">
							</div>
							<div class="form-group mb-3">
								<div class="fs-6 fw-semi-bold mb-1">Coupon Description <small class="text-secondary fw-normal">(Optional)</small></div>
								<input type="text" class="form-control border-2 border-secondary elex-coupon-description-field" name="description">
							</div>
							<div class="form-group mb-3">
								<div class="fs-6 fw-semi-bold mb-1" >Coupon Code *</div>
								<input type="text" id="elex-coupon-code-field" class="form-control border-2 border-secondary elex-coupon-code-field" name="code">
								<div id="elex_code_field_error"></div>
							</div>

							<div class="form-group mb-3">
								<div class="fs-6 fw-semi-bold mb-1" >Discount Type</div>
								<select class="form-select border-2 border-secondary elex-coupon-discount-type-field" name="discount_type">
									<option value="percent" selected>Percentage discount</option>
									<option value="fixed_product">Fixed product discount</option>
								</select>
							</div>

							<div class="form-group mb-3">
								<div class="fs-6 fw-semi-bold mb-1" >Coupon Amount *</div>
								<input type="text" id="elex-coupon-amount-field" class="form-control border-2 border-secondary elex-coupon-amount-field" name="amount">
								<div id="elex_coupon_amount_field_error"></div>
							</div>
							
							<div class="d-flex gap-3">
								<div class="form-group mb-3 flex-fill">
									<div class="fs-6 fw-semi-bold mb-1">Valid From</div>
									<input type="date" min="<?php echo esc_attr( gmdate( 'Y-m-d' ) ); ?>" id="elex-coupon-valid-from-field" class="form-control border-2 border-secondary elex-coupon-valid-from-field" name="valid_from">
								</div>
								<div class="form-group mb-3 flex-fill">
									<div class="fs-6 fw-semi-bold mb-1" >Valid Till</div>
									<input type="date" min="<?php echo esc_attr( gmdate( 'Y-m-d' ) ); ?>" id="elex-coupon-valid-till-field" class="form-control border-2 border-secondary elex-coupon-valid-till-field" name="valid_till">
								</div>
							</div>

						

							<button class="btn btn-primary w-100 elex-multi-vendor-for-woocommerce-generate-coupon-btn" >Generate</button>
						</div>
					</div>

					<!-- Usage & Restrictions -->
					<div class="tab-pane fade" id="elex-multi-vendor-for-woocommerce-edit-price-stock" role="tabpanel" aria-labelledby="elex-multi-vendor-for-woocommerce-edit-price-stock-tab">
						<div class="px-md-5 px-2 py-3">


							<div class="form-group mb-3">
								<div class="fs-6 fw-semi-bold mb-1">Minimum Cart Spending</div>
								<input type="text" class="form-control border-2 border-secondary elex-coupon-min-cart-spending-field" name="min_cart_spending">
							</div>
							<div class="form-group mb-3">
								<div class="fs-6 fw-semi-bold mb-1" >Maximum Cart Spending</div>
								<input type="text" class="form-control border-2 border-secondary  elex-coupon-max-cart-spending-field" name="max_cart_spending">
							</div>
							<div class="row mb-3 align-items-center">
								<div class="col-md-3">
									<small>Individual Coupon Use</small>
								</div>
								<div class="col-md-2">
									<label class="elex-enable-disable-switch">
										<input  type="checkbox" name="individual_coupon_use" class="elex-coupon-individual-coupon-use-field" checked>
										<div class="switch round"></div>
									</label>
								</div>
								<div class="col-md-7">
									<small class="text-secondary">Enable if this coupon can not be paired with another coupon.</small>

								</div>


							</div>
							<div class="row mb-3 align-items-center">
								<div class="col-md-3">
									<small>Exclude it on sale items</small>
								</div>
								<div class="col-md-2">
									<label class="elex-enable-disable-switch">
										<input type="checkbox" name="exclude_on_sale_item" class="elex-coupon-exclude-sale-item-field" checked>
										<div class="switch round"></div>
									</label>
								</div>
								<div class="col-md-7">
									<small class="text-secondary text-justify">Enable if this coupon should not be applicable to the items in sale. Per-item coupons will only work if the item is not on sale. Per-cart coupons will only work if there are items in the cart that are not on sale.</small>

								</div>

							</div>

							<div class="form-group mb-3">
								<div class="fs-6 fw-semi-bold mb-1" >Products</div>
								<select style="width:100% !important" name="mv-coupon-product[]" class=" mv-coupon-product  form-select border-2 border-secondary elex-coupon-products-field" multiple="true">
								</select>
								<div class="btn btn-sm text-primary elex-multi-vendor-for-woocommerce-coupons-exclude-product-btn mt-3">+ Exclude Product</div>
							</div>

							<div class="form-group mb-3 elex-multi-vendor-for-woocommerce-coupons-exclude-product">
								<div class="fs-6 fw-semi-bold mb-1" >Exclude Products</div>
								<select style="width:100% !important" name="exclude_product[]" class="mv-coupon-exclude-product  form-select border-2 border-secondary elex-coupon-exclude-products-field"  multiple="true">
								</select>
							</div>

							<div class="form-group mb-3">
								<div class="fs-6 fw-semi-bold mb-1" >Product Category</div>
								<select style="width:100% !important" name="product_category[]" class="mv-coupon-product-category form-select border-2 border-secondary elex-coupon-products-category-field"  multiple="true">  
								</select>
								<div class="btn btn-sm text-primary elex-multi-vendor-for-woocommerce-coupons-product-category-btn mt-3">+ Exclude Product Category</div>
							</div>

							<div class="form-group mb-3 elex-multi-vendor-for-woocommerce-coupons-product-category"> 
								<div class="fs-6 fw-semi-bold mb-1" >Exclude Product Category</div>
								<select style="width:100% !important" name="exclude_product_category[]" class="mv-coupon-exclude-product-category form-select border-2 border-secondary elex-coupon-exclude-products-category-field"  multiple="true">
								</select>
							</div>

							<div class="form-group mb-3">
								<div class="fs-6 fw-semi-bold mb-1">Allowed Email Ids</div>
								<input type="text" class="form-control elex-coupon-allowed-emails-field" name="allowed_emails">
							</div>
							<div class="text-secondary">
								<small>List of allowed billing emails to check against when an order is placed. Separate email addresses with commas. You can also use an asterisk (*) to match parts of an email. For example "*@gmail.com" would match all gmail addresses.</small>
							</div>

							<button class="btn btn-primary w-100">Generate</button>
						</div>
					</div>

					<!-- Usage Limits -->
					<div class="tab-pane fade" id="elex-multi-vendor-for-woocommerce-edit-ship" role="tabpanel" aria-labelledby="elex-multi-vendor-for-woocommerce-edit-ship-tab">
						<div class="px-md-5 px-2 py-3">
							<div class="form-group mb-3">
								<div class="fs-6 fw-semi-bold mb-1" >Usage Limit Per Coupon</div>
								<input type="text" class="form-control border-2 border-secondary elex-coupon-usage-limit-per-coupon-field" name="usage_limit_per_coupon">
								<div><small>No. of times this coupon can be used before expiry</small></div>
							</div>
							<div class="form-group mb-3">
								<div class="fs-6 fw-semi-bold mb-1" >Limit usage to X items</div>
								<input type="text" class="form-control border-2 border-secondary elex-coupon-usage-limit-x-items" name="usage_limit_x_items">
								<div><small>For product discounts, limit the coupon application to a maximum number of individual items in the cart. Leave it blank to apply the coupon to all items in the cart.</small></div>
							</div>
							<div class="form-group mb-3">
								<div class="fs-6 fw-semi-bold mb-1" >Usage Limit Per User</div>
								<input type="text" class="form-control border-2 border-secondary elex-coupon-usage-limit-per-user-field" name="usage_limit_per_user">
								<div><small>No. of times this coupon can be used by an individual user. Uses billing email for guests, and user ID for logged in users.</small></div>
							</div>


							<button class="btn btn-primary w-100">Generate</button>
						</div>
					</div>

				
				</div>
			 
				</form>
			</div>
		</div>
	   


	<!-- </div> -->


