76 lines
3.8 KiB
PHP
76 lines
3.8 KiB
PHP
<?php
|
|
/**
|
|
* Reusable form fields for adding/editing prizes
|
|
*/
|
|
if (!defined('ABSPATH')) exit;
|
|
?>
|
|
<tr>
|
|
<th scope="row"><label for="prize_name"><?php _e('Prize Name', 'wheel-of-fortune'); ?></label></th>
|
|
<td><input type="text" id="prize_name" name="prize_name" class="regular-text" required></td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row"><label for="prize_description"><?php _e('Description', 'wheel-of-fortune'); ?></label></th>
|
|
<td><textarea id="prize_description" name="prize_description" rows="3" class="large-text"></textarea></td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row"><label for="prize_probability"><?php _e('Probability', 'wheel-of-fortune'); ?></label></th>
|
|
<td>
|
|
<input type="number" id="prize_probability" name="prize_probability" step="any" min="0" max="1" required>
|
|
<p class="description"><?php _e('Enter a value between 0 and 1 (e.g., 0.1 for 10% chance). Use 0 for prizes that cannot be won.', 'wheel-of-fortune'); ?></p>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row"><?php _e('Status', 'wheel-of-fortune'); ?></th>
|
|
<td>
|
|
<label for="prize_is_active">
|
|
<input type="checkbox" id="prize_is_active" name="prize_is_active" value="1" checked>
|
|
<?php _e('Prize is active', 'wheel-of-fortune'); ?>
|
|
</label>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row"><label for="prize_redemption_code"><?php _e('Redemption Code', 'wheel-of-fortune'); ?></label></th>
|
|
<td>
|
|
<input type="text" id="prize_redemption_code" name="prize_redemption_code" class="regular-text">
|
|
<p class="description"><?php _e('Optional code for the user to redeem the prize.', 'wheel-of-fortune'); ?></p>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row"><label for="prize_email_subject"><?php _e('Email Subject', 'wheel-of-fortune'); ?></label></th>
|
|
<td>
|
|
<input type="text" id="prize_email_subject" name="prize_email_subject" class="large-text">
|
|
<p class="description"><?php _e('Subject for this prize\'s email. If empty, the default subject will be used.', 'wheel-of-fortune'); ?></p>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row"><label for="prize_email_template"><?php _e('Email Template', 'wheel-of-fortune'); ?></label></th>
|
|
<td>
|
|
<textarea id="prize_email_template" name="prize_email_template" rows="10" class="large-text code"></textarea>
|
|
<p class="description"><?php _e('Content for this prize\'s email. Leave blank for default template.', 'wheel-of-fortune'); ?></p>
|
|
<p><?php _e('Available template tags:', 'wheel-of-fortune'); ?></p>
|
|
<ul class="wheel-template-tags">
|
|
<li><code>{user_name}</code>, <code>{user_email}</code>, <code>{prize_name}</code>, <code>{prize_description}</code>, <code>{redemption_code}</code>, <code>{site_name}</code>, <code>{site_url}</code>, <code>{date}</code>, <code>{time}</code></li>
|
|
</ul>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row"><label for="prize_is_discount"><?php _e('Je discount?', 'wheel-of-fortune'); ?></label></th>
|
|
<td>
|
|
<input type="checkbox" id="prize_is_discount" name="prize_is_discount" value="1">
|
|
<p class="description"><?php _e('Označi, če je nagrada popust.', 'wheel-of-fortune'); ?></p>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row"><label for="prize_discount_value"><?php _e('Vrednost kupona (%)', 'wheel-of-fortune'); ?></label></th>
|
|
<td>
|
|
<input type="number" id="prize_discount_value" name="prize_discount_value" step="0.01" min="0" max="100">
|
|
<p class="description"><?php _e('Vnesi vrednost popusta v %.', 'wheel-of-fortune'); ?></p>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row"><label for="prize_is_try_again"><?php _e('Try Again?', 'wheel-of-fortune'); ?></label></th>
|
|
<td>
|
|
<input type="checkbox" id="prize_is_try_again" name="prize_is_try_again" value="1">
|
|
<p class="description"><?php _e('Označi, če je ta nagrada "Try Again" (ponovni poskus).', 'wheel-of-fortune'); ?></p>
|
|
</td>
|
|
</tr>
|