edit_form.php
47 lines
| 1 | <?php |
| 2 | if ( ! defined( 'ABSPATH' ) ) { |
| 3 | exit; // Exit if accessed directly |
| 4 | } |
| 5 | ?> |
| 6 | <div class="os-form-w"> |
| 7 | <div class="white-box"> |
| 8 | <div class="white-box-header"> |
| 9 | <div class="os-form-sub-header"> |
| 10 | <h3><?php esc_html_e('Recipient of Notifications', 'latepoint') ?></h3> |
| 11 | </div> |
| 12 | </div> |
| 13 | <div class="white-box-content"> |
| 14 | <form data-os-success-action="reload" data-os-action="<?php echo esc_attr(OsRouterHelper::build_route_name('default_agent', 'update')); ?>"> |
| 15 | <div class="os-row"> |
| 16 | <div class="os-col-6"> |
| 17 | <?php echo OsFormHelper::text_field('agent[first_name]', __('First Name', 'latepoint'), $agent->first_name); ?> |
| 18 | </div> |
| 19 | <div class="os-col-6"> |
| 20 | <?php echo OsFormHelper::text_field('agent[last_name]', __('Last Name', 'latepoint'), $agent->last_name); ?> |
| 21 | </div> |
| 22 | </div> |
| 23 | <div class="os-row"> |
| 24 | <div class="os-col-lg-6"> |
| 25 | <?php echo OsFormHelper::text_field('agent[email]', __('Email Address', 'latepoint'), $agent->email); ?> |
| 26 | </div> |
| 27 | <div class="os-col-lg-6"> |
| 28 | <?php echo OsFormHelper::phone_number_field('agent[phone]', __('Phone Number', 'latepoint'), $agent->phone); ?> |
| 29 | </div> |
| 30 | </div> |
| 31 | <?php if(!$agent->is_new_record()) echo OsFormHelper::hidden_field('agent[id]', $agent->id); ?> |
| 32 | |
| 33 | <div class="os-form-buttons os-flex"> |
| 34 | <?php |
| 35 | echo OsFormHelper::hidden_field('agent[id]', $agent->id); |
| 36 | if(OsRolesHelper::can_user('agent__edit')) { |
| 37 | echo OsFormHelper::button('submit', __('Save Changes', 'latepoint'), 'submit', ['class' => 'latepoint-btn']); |
| 38 | } |
| 39 | ?> |
| 40 | </div> |
| 41 | <?php wp_nonce_field('edit_agent_'.$agent->id); ?> |
| 42 | </form> |
| 43 | </div> |
| 44 | </div> |
| 45 | </div> |
| 46 | |
| 47 | <?php echo OsUtilHelper::pro_feature_block(__('To add more agents upgrade to a paid version', 'latepoint')); ?> |