Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $job_id = apply_filters('jeg_job_id', 0);
- $job = new WP_Query(array(
- 'post_type' => 'job',
- 'post__in' => array($job_id),
- 'orderby' => 'date',
- 'order' => 'desc',
- 'posts_per_page' => -1,
- 'post_status' => array('preview', 'pending', 'publish', 'expired')
- ));
- if($job->have_posts()) {
- while ($job->have_posts()) {
- $job->the_post();
- if(get_current_user_id() === get_the_author_meta('ID')) {
- ?>
- <form method="post">
- <div class="row">
- <div class="col-md-12">
- <div class="form-group">
- <label for="title"><?php _e('Job title', 'jobplanet-plugin'); ?> <span class="mandatory">*</span></label>
- <input id="title" name="job_title" placeholder="<?php _e('Job Title, ex : Full Stack Web Developer', 'jobplanet-plugin'); ?>" type="text" class="form-control" value="<?php the_title(); ?>">
- </div>
- </div>
- <?php if(apply_filters('jeg_show_company_form', true)) : ?>
- <div class="col-md-12">
- <div class="form-group">
- <label for="company_id"><?php _e('Company', 'jobplanet-plugin'); ?> </label>
- <select id="company_id" name="company_id" class="form-control chosen-select" data-placeholder="<?php _e('Choose company for this job vacancy', 'jobplanet-plugin'); ?>" >
- <?php
- $companies = jeg_get_current_user_company();
- $company = vp_metabox('jobplanet_job.company_id');
- if($companies) {
- foreach($companies as $corp) {
- ?>
- <option <?php if(isset($company)) { echo ( $company == $corp['value'] ) ? "selected" : ""; } ?> value="<?php echo esc_attr($corp['value']) ?>"><?php echo esc_attr($corp['label']) ?></option>
- <?php
- }
- }
- ?>
- </select>
- </div>
- </div>
- <?php endif; ?>
- <div class="col-md-12">
- <div class="form-group">
- <label for="application_email"><?php _e('Notification Email', 'jobplanet-plugin'); ?></label>
- <input id="application_email" name="application_email" placeholder="<?php _e('Notification email sent', 'jobplanet-plugin'); ?>" type="text" class="form-control" value="<?php echo vp_metabox('jobplanet_job.application_email'); ?>">
- <small class="color-white-mute"><?php _e('Leave the notification email address field empty if you wish to send notifications to your default user registration email', 'jobplanet-plugin'); ?></small>
- </div>
- </div>
- <?php if(apply_filters('jeg_featured_listing_form', false)) : ?>
- <div class="col-md-12">
- <div class="form-group">
- <label for="application_email"><?php _e('Featured Listing', 'jobplanet-plugin'); ?></label>
- <div class="checkbox flat-checkbox">
- <label>
- <input type="checkbox" name="featured" value="1" <?php echo vp_metabox('jobplanet_job.featured') == 1 ? "checked" : ""; ?>>
- <span class="fa fa-check"></span>
- <?php _e('Feature this job listing', 'jobplanet-plugin'); ?>
- </label>
- </div>
- <small class="color-white-mute"><?php _e('By enabling this feature, your job vacancy listing will be shown at the top of the job listings search feature', 'jobplanet-plugin'); ?></small>
- </div>
- </div>
- <?php endif; ?>
- <div class="col-md-12">
- <div class="form-group">
- <label for="title"><?php _e('Job Description', 'jobplanet-plugin'); ?></label>
- <?php
- wp_editor(get_the_content(), 'description', array(
- 'textarea_name' => 'description',
- 'drag_drop_upload' => false,
- 'media_buttons' => false,
- 'textarea_rows' => 10,
- 'teeny' => true,
- 'quicktags' => false
- ));
- ?>
- <small class="color-white-mute"><?php _e('You may use the job template as a starter in writing your job description, you may also use your own format for the job description.', 'jobplanet-plugin'); ?></small>
- </div>
- </div>
- <div class="col-md-12">
- <div class="form-group">
- <label for="job_type"><?php _e('Job Type', 'jobplanet-plugin'); ?> <span class="mandatory">*</span></label>
- <select id="job_type" name="job_type" class="form-control chosen-select" data-placeholder="<?php _e('Job Type', 'jobplanet-plugin'); ?>" >
- <?php
- $types = jeg_get_job_type();
- $jobtype = jeg_extract_id_term(get_the_terms(get_the_ID(), 'job-type'));
- if($types) {
- foreach($types as $type) {
- ?>
- <option <?php if(isset($jobtype)) { echo in_array($type['value'], $jobtype) ? "selected" : ""; } ?> value="<?php echo esc_attr($type['value']) ?>"><?php echo esc_attr($type['label']) ?></option>
- <?php
- }
- }
- ?>
- </select>
- </div>
- </div>
- <div class="col-md-12">
- <div class="form-group">
- <label for="categories"><?php _e('Job Category', 'jobplanet-plugin'); ?> <span class="mandatory">*</span></label>
- <div class="row">
- <?php
- $categories = jeg_get_job_category();
- $selected_category = jeg_extract_id_term(get_the_terms(get_the_ID(), 'job-category'));
- if($categories) {
- $sizecategory = sizeof($categories);
- $repeatdone = ceil($sizecategory / 2);
- foreach ($categories as $index => $category) {
- if($index % $repeatdone === 0)
- {
- echo "<!-- buka --><div class='col-md-6'>";
- }
- ?>
- <div class="checkbox flat-checkbox">
- <label>
- <input type="checkbox" name="categories[]" value="<?php echo esc_attr($category['value']) ?>" <?php if(isset($selected_category)) { echo in_array($category['value'], $selected_category) ? "checked" : ""; } ?>>
- <span class="fa fa-check"></span>
- <?php echo esc_attr($category['label']) ?>
- </label>
- </div>
- <?php
- if( ($index + 1) % $repeatdone === 0 )
- {
- echo "</div> <!-- tutup -->";
- }
- }
- if( ($index + 1) % $repeatdone !== 0 )
- {
- echo "</div> <!-- tutup -->";
- }
- }
- ?>
- </div>
- </div>
- </div>
- <div class="col-md-4">
- <div class="form-group">
- <label for="salary_bottom"><?php _e('Minimum Salary', 'jobplanet-plugin'); ?> <span class="mandatory">*</span></label>
- <input id="salary_bottom" placeholder="<?php _e('ex : 5000', 'jobplanet-plugin'); ?>" name="salary_bottom" type="text" class="form-control number" value="<?php echo vp_metabox('jobplanet_job.salary_bottom'); ?>">
- </div>
- </div>
- <div class="col-md-4">
- <div class="form-group">
- <label for="salary_top"><?php _e('Maximum Salary', 'jobplanet-plugin'); ?> <span class="mandatory">*</span></label>
- <input id="salary_top" placeholder="<?php _e('ex : 10000', 'jobplanet-plugin'); ?>" name="salary_top" type="text" class="form-control number" value="<?php echo vp_metabox('jobplanet_job.salary_top'); ?>">
- </div>
- </div>
- <div class="col-md-4">
- <div class="form-group">
- <label for="salary_range"><?php _e('Salary Range', 'jobplanet-plugin'); ?> <span class="mandatory">*</span></label>
- <select id="salary_range" class="form-control chosen-select" name="salary_range">
- <?php $salary_range = vp_metabox('jobplanet_job.salary_range') ?>
- <option value="hourly" <?php echo $salary_range === 'hourly' ? 'selected' : ''; ?>><?php _e('Hourly', 'jobplanet-plugin'); ?></option>
- <option value="weekly" <?php echo $salary_range === 'weekly' ? 'selected' : ''; ?>><?php _e('Weekly', 'jobplanet-plugin'); ?></option>
- <option value="monthly" <?php echo $salary_range === 'monthly' ? 'selected' : ''; ?>><?php _e('Monthly', 'jobplanet-plugin'); ?></option>
- <option value="yearly" <?php echo $salary_range === 'yearly' ? 'selected' : ''; ?>><?php _e('Yearly', 'jobplanet-plugin'); ?></option>
- </select>
- </div>
- </div>
- <div class="col-md-12">
- <div class="form-group">
- <label for="closing"><?php _e('Closing Date', 'jobplanet-plugin'); ?></label>
- <input id="closing" name="closing" placeholder="<?php _e('Closing Date', 'jobplanet-plugin'); ?>" type="text" class="form-control datetimepicker" value="<?php echo vp_metabox('jobplanet_job.closing'); ?>">
- <small class="color-white-mute"><?php _e('Closing date for applicants to apply for this job, leave empty if you do not have a closing date.', 'jobplanet-plugin'); ?></small>
- </div>
- </div>
- <div class="col-md-12">
- <div class="white-space-20"></div>
- <h4><?php _e('Job Location', 'jobplanet-plugin'); ?></h4>
- <hr/>
- </div>
- <div class="col-md-12">
- <div class="form-group">
- <label for="location"><?php _e('Job Location', 'jobplanet-plugin'); ?> </label>
- <?php
- $location = jeg_extract_id_term(get_the_terms(get_the_ID(), 'job-location'));
- wp_dropdown_categories(array(
- 'taxonomy' => 'job-location',
- 'hide_empty' => 0,
- 'hierarchical' => 1,
- 'class' => 'form-control chosen-select',
- 'name' => 'location',
- 'selected' => isset($location) ? $location[0] : ''
- ));
- ?>
- </div>
- </div>
- <div class="col-md-12">
- <div class="form-group">
- <label for="address"><?php _e('Address', 'jobplanet-plugin'); ?></label>
- <textarea id="address" class="form-control" name="address" placeholder="<?php _e("Enter Detail Address", 'jobplanet-plugin'); ?>" rows="4"><?php echo vp_metabox('jobplanet_job.address'); ?></textarea>
- </div>
- </div>
- <div class="col-md-12" style="display: none;">
- <div class="form-group">
- <label for="map_location"><?php _e('Location (Drag marker to the job\'s location)', 'jobplanet-plugin'); ?></label>
- <input type="hidden" name="map_location" class="form-control" id="map_location" value="<?php echo vp_metabox('jobplanet_job.map_location'); ?>">
- <div id="jobmap"></div>
- </div>
- </div>
- <div class="col-md-12">
- <div class="white-space-20"></div>
- <div class="form-group text-right">
- <input type="hidden" name="jeg_action" value="edit-job" />
- <input type="hidden" name="job_id" value="<?php echo esc_attr($job_id); ?>" />
- <?php if(apply_filters('jeg_is_create_vacancy', false)) : ?>
- <input type="hidden" name="is_create_vacancy" value="1" />
- <?php endif; ?>
- <input type="hidden" name="jobplanet_nonce" value="<?php echo esc_attr( wp_create_nonce('jobplanet') ); ?>"/>
- <input type="submit" class="btn btn-theme btn-t-primary btn-block-xs" value="<?php echo apply_filters('jeg_job_form_title', esc_html(__('Edit Job Vacancy', 'jobplanet-plugin'))); ?>"/>
- </div>
- </div>
- </div>
- </form>
- <?php
- } else {
- jeg_get_template_part('account/restricted-edit');
- }
- }
- wp_reset_postdata();
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement