Init(Core): create and add project

This commit is contained in:
2026-05-02 01:58:10 +03:30
commit 4928901a08
14 changed files with 1022 additions and 0 deletions

54
admin/views/rule-form.php Normal file
View File

@@ -0,0 +1,54 @@
<?php
// Prevent direct access
if (!defined('ABSPATH')) {
exit;
}
?>
<div class="wrap">
<h1><?php echo $rule->id ? __('ویرایش قانون', 'sodino') : __('افزودن قانون جدید', 'sodino'); ?></h1>
<form method="post">
<?php wp_nonce_field('gheymatyar_save_rule', 'gheymatyar_rule_nonce'); ?>
<table class="form-table">
<tr>
<th scope="row"><label for="name"><?php _e('عنوان قانون', 'sodino'); ?></label></th>
<td><input type="text" name="name" id="name" value="<?php echo esc_attr($rule->name); ?>" class="regular-text" required></td>
</tr>
<tr>
<th scope="row"><label for="condition_type"><?php _e('نوع شرط', 'sodino'); ?></label></th>
<td>
<select name="condition_type" id="condition_type" class="regular-text" required>
<option value="user_type" <?php selected($rule->condition_type, 'user_type'); ?>><?php _e('نوع کاربر', 'sodino'); ?></option>
</select>
</td>
</tr>
<tr>
<th scope="row"><label for="condition_value"><?php _e('نوع کاربر', 'sodino'); ?></label></th>
<td>
<select name="condition_value" id="condition_value" class="regular-text" required>
<option value="new" <?php selected($rule->condition_value, 'new'); ?>><?php _e('کاربر جدید', 'sodino'); ?></option>
<option value="returning" <?php selected($rule->condition_value, 'returning'); ?>><?php _e('کاربر بازگشتی', 'sodino'); ?></option>
</select>
</td>
</tr>
<tr>
<th scope="row"><label for="action_type"><?php _e('نوع عملیات', 'sodino'); ?></label></th>
<td>
<select name="action_type" id="action_type" class="regular-text" required>
<option value="discount_percent" <?php selected($rule->action_type, 'discount_percent'); ?>><?php _e('درصد تخفیف', 'sodino'); ?></option>
</select>
</td>
</tr>
<tr>
<th scope="row"><label for="action_value"><?php _e('درصد تخفیف', 'sodino'); ?></label></th>
<td><input type="number" name="action_value" id="action_value" value="<?php echo esc_attr($rule->action_value); ?>" min="0" max="100" step="0.01" class="small-text" required> %</td>
</tr>
<tr>
<th scope="row"><label for="enabled"><?php _e('وضعیت', 'sodino'); ?></label></th>
<td><label><input type="checkbox" name="enabled" id="enabled" value="1" <?php checked($rule->enabled, 1); ?>> <?php _e('فعال باشد', 'sodino'); ?></label></td>
</tr>
</table>
<?php submit_button($rule->id ? __('به‌روزرسانی قانون', 'sodino') : __('افزودن قانون', 'sودino'), 'primary'); ?>
</form>
</div>

View File

@@ -0,0 +1,15 @@
<?php
// Prevent direct access
if (!defined('ABSPATH')) {
exit;
}
?>
<div class="wrap">
<h1><?php _e('قوانین قیمت‌گذاری', 'sodino'); ?></h1>
<a href="<?php echo admin_url('admin.php?page=sodino-add-rule'); ?>" class="page-title-action"><?php _e('افزودن قانون جدید', 'sodino'); ?></a>
<form method="post">
<?php $rulesTable->display(); ?>
</form>
</div>

12
admin/views/settings.php Normal file
View File

@@ -0,0 +1,12 @@
<?php
// Prevent direct access
if (!defined('ABSPATH')) {
exit;
}
?>
<div class="wrap">
<h1><?php _e('تنظیمات قیمت‌یار', 'sodino'); ?></h1>
<div class="notice notice-info">
<p><?php _e('در اینجا تنظیمات افزونه در آینده قرار خواهد گرفت.', 'sodino'); ?></p>
</div>
</div>