<div class="content-wrapper android-vouchers-generate"><main class="avg-main"><header class="avg-heading"><div><span>Voucher Batch</span><h1>توليد دفعة كروت</h1><p>إنشاء أكواد إنترنت من صنف جاهز أو بإعدادات يدوية.</p></div><a href="vouchers.php"><i class="fa fa-arrow-right"></i><b>رجوع</b></a></header><nav class="avg-nav"><a href="vouchers.php"><i class="fa fa-credit-card"></i><span>الكروت</span></a><a class="is-active" href="vouchers_generate.php"><i class="fa fa-magic"></i><span>توليد</span></a><a href="vouchers_print.php"><i class="fa fa-print"></i><span>طباعة</span></a><a href="vouchers_settings.php"><i class="fa fa-cog"></i><span>إعدادات</span></a></nav><?php if($err): ?><div class="avg-message is-danger"><i class="fa fa-exclamation-triangle"></i><?= h($err) ?></div><?php endif; ?><?php if($ok): ?><div class="avg-message"><i class="fa fa-check-circle"></i><?= h($ok) ?></div><?php endif; ?><section class="avg-section"><div class="avg-head"><div><span>Generation Setup</span><h2>إعداد الدفعة</h2></div><i class="fa fa-magic"></i></div><form method="post" autocomplete="off" data-ua-android-native-layout><input type="hidden" name="notes" value="<?= h($_POST['notes']??'') ?>"><label><span>صنف الكرت</span><select name="product_id"><option value="0">إدخال يدوي</option><?php $pidSel=(int)($_POST['product_id']??0); foreach($voucher_products as $product): ?><option value="<?= (int)$product['id'] ?>" <?= $pidSel===(int)$product['id']?'selected':'' ?>><?= h($product['name']) ?> — <?= number_format((float)$product['price'],2) ?></option><?php endforeach; ?></select></label><label><span>عنوان الدفعة</span><input name="title" required value="<?= h($_POST['title']??'دفعة كروت') ?>"></label><div class="avg-pair"><label><span>الكمية</span><input type="number" name="qty" min="1" max="5000" required value="<?= h($_POST['qty']??50) ?>"></label><label><span>نوع الكرت</span><select name="type"><?php $type=$_POST['type']??'time'; ?><option value="time" <?= $type==='time'?'selected':'' ?>>زمني</option><option value="data" <?= $type==='data'?'selected':'' ?>>حجمي</option><option value="both" <?= $type==='both'?'selected':'' ?>>زمني وحجمي</option></select></label></div><details class="avg-manual"><summary><span><i class="fa fa-sliders"></i><b>الإعدادات اليدوية</b></span><i class="fa fa-angle-down"></i></summary><div><div class="avg-pair"><label><span>الأيام</span><input type="number" step="0.1" name="days" value="<?= h($_POST['days']??1) ?>"></label><label><span>الحجم GB</span><input type="number" step="0.1" name="gb" value="<?= h($_POST['gb']??10) ?>"></label></div><div class="avg-pair"><label><span>Rate Limit</span><input name="rate_limit" value="<?= h($_POST['rate_limit']??'') ?>"></label><label><span>السعر</span><input type="number" step="0.01" name="price" value="<?= h($_POST['price']??'') ?>"></label></div><div class="avg-pair"><label><span>Prefix</span><input name="prefix" value="<?= h($_POST['prefix']??'V') ?>"></label><label><span>طول الكود</span><input type="number" name="code_len" min="4" max="20" value="<?= h($_POST['code_len']??8) ?>"></label></div></div></details><button><i class="fa fa-magic"></i> توليد دفعة الكروت</button></form></section></main></div>
