use Nerds\Bsalted\Entity\CourseEntity\Course; use Nerds\Bsalted\Entity\EventEntity\Event; use Nerds\Bsalted\Entity\UserEntity\User; use Nerds\Base\Util\Helpers\DatabaseAccessWrapper as db; use Nerds\Base\Util\Helpers\SiteHelper; $stage = new Event(); $stage_fields = $stage->addition_fields_list(); $user_fields = User::addition_fields_list(); $db = new db(); $savans = User::getByRole('adventure_savant'); $capitans = User::getByRole('adventure_capitan'); $stage_id = get_the_ID(); $raw_stage_name = $stage->getNameByID($stage_id); $stored_data = $stage->getData()[$stage_id]; $course_data = $db->getCourseData()[$stored_data['course']]; $human_resourses = explode(',', $course_data['resourses']); $stage_name = $stage_fields['name'] . $raw_stage_name; $types_fields = $stage->types_fields_list(); $args = array('post_type' => Course::POST_TYPE, 'selected' => $stored_data['course'], 'name' => $stage_fields['course'], 'show_option_none' => 'Courses...', 'option_none_value' => '0'); ?> <?php if (!$amount) { ?> <div class="bsalted-field"> <?php echo '<label for="courses">Select a Course:</label> '; wp_dropdown_pages($args);
<?php use Nerds\Bsalted\Entity\CourseEntity\Course; use Nerds\Base\Util\Helpers\DatabaseAccessWrapper; use Nerds\Bsalted\Entity\UserEntity\User; $db = new DatabaseAccessWrapper(); $savans = User::getByRole('adventure_savant'); $capitans = User::getByRole('adventure_capitan'); $post_id = get_the_ID(); $stored_data = $db->getCourseData()[$post_id]; $fields_list = Course::addition_fields_list(); $human_resourses = explode(',', $stored_data['resourses']); ?> <div class="bsalted-field"> <label for="<?php echo $fields_list['resourses']; ?> ">The Human resources: </label> <select id="<?php echo $fields_list['resourses']; ?> " data-placeholder="Choose Human resources..." class="chosen-select" multiple style="width:350px;" tabindex="4"> <optgroup label="Capitans"> <?php foreach ($capitans as $obj) { ?> <?php if (in_array($obj->ID, $human_resourses)) { ?> <option value="<?php