Example #1
0
function jr_job_packs()
{
    global $message, $errors, $posted;
    $errors = new WP_Error();
    $message = '';
    jr_add_job_pack();
    $packs = jr_get_job_packs();
    if (sizeof($packs) > 0) {
        echo '<ul class="packs">';
        foreach ($packs as $pack) {
            if (!$pack->job_count) {
                $pack->job_count = __('Unlimited', 'appthemes');
            }
            if ($pack->pack_duration) {
                $pack->pack_duration = __(' usable within ', 'appthemes') . $pack->pack_duration . __(' days', 'appthemes');
            }
            if ($pack->job_duration) {
                $pack->job_duration = __(' lasting ', 'appthemes') . $pack->job_duration . __(' days', 'appthemes');
            }
            if ($pack->pack_cost) {
                $pack->pack_cost = jr_get_currency($pack->pack_cost) . '';
            } else {
                $pack->pack_cost = __('Free', 'appthemes');
            }
            echo '<li><span class="cost">' . $pack->pack_cost . '</span><h3>' . $pack->pack_name . ' &ndash; <small>' . $pack->pack_description . '</small></h3>
				<p>' . $pack->job_count . ' ' . __('Jobs', 'appthemes') . '' . $pack->job_duration . $pack->pack_duration . '.</p>
				<p><a href="admin.php?page=jobpacks&amp;edit=' . $pack->id . '">Edit Pack</a></p>
				<p><a href="admin.php?page=jobpacks&amp;delete=' . $pack->id . '" class="deletepack">Delete this pack</a></p>
			</li>';
        }
        echo '</ul>';
    }
    ?>
    <script type="text/javascript">
    /* <![CDATA[ */
    	jQuery('a.deletepack').click(function(){
    		var answer = confirm ("<?php 
    _e('Are you sure you want to delete this pack? This action cannot be undone...', 'appthemes');
    ?>
")
			if (answer)
				return true;
			return false;
    	});
    /* ]]> */
    </script>
	
	<h3><?php 
    _e('Create a New Job Pack', 'appthemes');
    ?>
</h3>
	<p><?php 
    _e('Job Packs let you define packages that customers can purchase in order to post multiple/single jobs for varying durations. Once you add a pack the values on the "pricing" page will no longer be used.', 'appthemes');
    ?>
</p>
	
	<?php 
    jr_show_errors($errors);
    if (isset($message) && !empty($message)) {
        echo '<p class="success">' . $message . '</p>';
    }
    ?>
    <form method="post" id="mainform" action="">
		
		<table class="widefat fixed" id="tblspacer" style="width:850px;">

                <thead>
                    <tr>
                        <th scope="col" width="200px"><?php 
    _e('Job Pack Details', 'appthemes');
    ?>
</th>
                        <th scope="col">&nbsp;</th>
                    </tr>
                </thead>

		    <tr>
                <td class="titledesc"><a href="#" tip="<?php 
    _e('Enter a name for this pack. This will be visible on the website', 'appthemes');
    ?>
" tabindex="99"><div class="helpico"></div></a> <?php 
    _e('Pack Name', 'appthemes');
    ?>
:</td>
                <td class="forminp"><input name="pack_name" id="pack_name" type="text" value="<?php 
    if (isset($posted['pack_name'])) {
        echo $posted['pack_name'];
    }
    ?>
" class="required" /></td>
		    </tr>
		    <tr>
                <td class="titledesc"><a href="#" tip="<?php 
    _e('Enter a description for this pack. This will be visible on the website', 'appthemes');
    ?>
" tabindex="99"><div class="helpico"></div></a> <?php 
    _e('Pack Description', 'appthemes');
    ?>
:</td>
                <td class="forminp"><input name="pack_description" id="pack_description" type="text" value="<?php 
    if (isset($posted['pack_description'])) {
        echo $posted['pack_description'];
    }
    ?>
" class="required" /></td>
		    </tr>
		    <tr>
                <td class="titledesc"><a href="#" tip="<?php 
    _e('Enter the number of days', 'appthemes');
    ?>
" tabindex="99"><div class="helpico"></div></a> <?php 
    _e('Pack Duration', 'appthemes');
    ?>
:</td>
                <td class="forminp"><input name="pack_duration" id="pack_duration" type="text" value="<?php 
    if (isset($posted['pack_duration'])) {
        echo $posted['pack_duration'];
    }
    ?>
" /><br/><small><?php 
    _e('Days this pack remains valid to use. Leave blank if it never expires.', 'appthemes');
    ?>
</small></td>
		    </tr>
		    <tr>
                <td class="titledesc"><a href="#" tip="<?php 
    _e('Enter a numeric value, do not include currency values.', 'appthemes');
    ?>
" tabindex="99"><div class="helpico"></div></a> <?php 
    _e('Pack Cost', 'appthemes');
    ?>
:</td>
                <td class="forminp"><input name="pack_cost" id="pack_cost" type="text" value="<?php 
    if (isset($posted['pack_cost'])) {
        echo $posted['pack_cost'];
    }
    ?>
"  /><br/><small><?php 
    _e('Pack cost. Leave blank if free.', 'appthemes');
    ?>
</small></td>
		    </tr>
		    <tr>
                <td class="titledesc"><a href="#" tip="<?php 
    _e('Enter a numeric value or leave blank', 'appthemes');
    ?>
" tabindex="99"><div class="helpico"></div></a> <?php 
    _e('Job Count', 'appthemes');
    ?>
:</td>
                <td class="forminp"><input name="job_count" id="job_count" type="text" value="<?php 
    if (isset($posted['job_count'])) {
        echo $posted['job_count'];
    }
    ?>
"  /><br/><small><?php 
    _e('How many jobs can the user list with this pack? Leave blank for an <em>unlimited</em> amount.', 'appthemes');
    ?>
</small></td>
		    </tr>
		    <tr>
                <td class="titledesc"><a href="#" tip="<?php 
    _e('Enter a numeric value or leave blank', 'appthemes');
    ?>
" tabindex="99"><div class="helpico"></div></a> <?php 
    _e('Job Duration', 'appthemes');
    ?>
:</td>
                <td class="forminp"><input name="job_duration" id="job_duration" type="text" value="<?php 
    if (isset($posted['job_duration'])) {
        echo $posted['job_duration'];
    }
    ?>
" class="required" /><br/><small><?php 
    _e('How long do jobs last? e.g. <code>30</code> for 30 days. Leave blank for endless jobs.', 'appthemes');
    ?>
</small></td>
		    </tr>
		
	    </table>

        <p class="submit bbot"><input name="save" type="submit" value="<?php 
    _e('Create Job Pack', 'appthemes');
    ?>
" />
        <input name="submitted" type="hidden" value="yes" /></p>
    </form>
    <?php 
}
Example #2
0
/**
 * JobRoller Edit Job form
 * Function outputs the job edit form
 *
 *
 * @version 1.0
 * @author AppThemes
 * @package JobRoller
 * @copyright 2010 all rights reserved
 *
 */
function jr_edit_job_form($relisting = false)
{
    global $post, $posted, $job_details;
    jr_geolocation_scripts();
    ?>
	<form action="<?php 
    echo get_permalink($post->ID);
    ?>
?edit=<?php 
    echo $job_details->ID;
    ?>
" method="post" enctype="multipart/form-data" id="submit_form" class="submit_form main_form">
		<fieldset>
			<legend><?php 
    _e('Company Details', 'appthemes');
    ?>
</legend>
			<p><?php 
    _e('Fill in the company section to provide details of the company listing the job. Leave this section blank to show your display name and profile page link instead.', 'appthemes');
    ?>
</p>
			<p class="optional"><label for="your_name"><?php 
    _e('Your Name/Company Name', 'appthemes');
    ?>
</label> <input type="text" class="text" name="your_name" id="your_name" value="<?php 
    if (isset($posted['your_name'])) {
        echo $posted['your_name'];
    } else {
        echo get_post_meta($job_details->ID, '_Company', true);
    }
    ?>
" /></p>
			<p class="optional"><label for="website"><?php 
    _e('Website', 'appthemes');
    ?>
</label> <input type="text" class="text" name="website" value="<?php 
    if (isset($posted['website'])) {
        echo $posted['website'];
    } else {
        echo get_post_meta($job_details->ID, '_CompanyURL', true);
    }
    ?>
" placeholder="http://" id="website" /></p>
			<p class="optional"><label for="company-logo"><?php 
    _e('Logo (.jpg, .gif or .png)', 'appthemes');
    ?>
</label> <input type="file" class="text" name="company-logo" id="company-logo" /></p>
		</fieldset>	
		<fieldset>
			<legend><?php 
    _e('Job Details', 'appthemes');
    ?>
</legend>
			<p><?php 
    _e('Enter details about the job below. Be as descriptive as possible so that potential candidates can find your job listing easily.', 'appthemes');
    ?>
</p>
			<p><label for="job_title"><?php 
    _e('Job title', 'appthemes');
    ?>
 <span title="required">*</span></label> <input type="text" class="text" name="job_title" id="job_title" value="<?php 
    if (isset($posted['job_title'])) {
        echo $posted['job_title'];
    } else {
        echo $job_details->post_title;
    }
    ?>
" /></p>
			<p><label for="job_type"><?php 
    _e('Job type', 'appthemes');
    ?>
 <span title="required">*</span></label> <select name="job_term_type" id="job_type">
				<?php 
    $job_types = get_terms('job_type', array('hide_empty' => '0'));
    if ($job_types && sizeof($job_types) > 0) {
        foreach ($job_types as $type) {
            ?>
						<option value="<?php 
            echo $type->slug;
            ?>
" <?php 
            if (isset($posted['job_term_type'])) {
                if ($posted['job_term_type'] == $type->slug) {
                    echo 'selected="selected"';
                }
            } else {
                $job_has_terms = array();
                $get_terms = wp_get_post_terms($job_details->ID, 'job_type');
                foreach ($get_terms as $term) {
                    $job_has_terms[] = $term->slug;
                }
                if (in_array($type->slug, $job_has_terms)) {
                    echo 'selected="selected"';
                }
            }
            ?>
><?php 
            echo $type->name;
            ?>
</option>
						<?php 
        }
    }
    ?>
			</select></p>
			<p class="<?php 
    if (get_option('jr_submit_cat_required') !== 'yes') {
        echo 'optional';
    }
    ?>
"><label for="job_cat"><?php 
    _e('Job Category', 'appthemes');
    ?>
 <?php 
    if (get_option('jr_submit_cat_required') == 'yes') {
        ?>
<span title="required">*</span><?php 
    }
    ?>
</label> <?php 
    $sel = 0;
    global $featured_job_cat_id;
    if (isset($posted['job_term_cat']) && $posted['job_term_cat'] > 0) {
        $sel = $posted['job_term_cat'];
    } else {
        $get_terms = wp_get_post_terms($job_details->ID, 'job_cat');
        foreach ($get_terms as $term) {
            if ($term->term_id !== $featured_job_cat_id) {
                $sel = $term->term_id;
            }
        }
    }
    $args = array('orderby' => 'name', 'exclude' => $featured_job_cat_id, 'order' => 'ASC', 'name' => 'job_term_cat', 'hierarchical' => 1, 'echo' => 0, 'class' => 'job_cat', 'selected' => $sel, 'taxonomy' => 'job_cat', 'hide_empty' => false);
    $dropdown = wp_dropdown_categories($args);
    $dropdown = str_replace('class=\'job_cat\' >', 'class=\'job_cat\' ><option value="">Select a category&hellip;</option>', $dropdown);
    echo $dropdown;
    ?>
</p>
			<?php 
    if (get_option('jr_enable_salary_field') !== 'no') {
        ?>
<p class="optional"><label for="job_term_salary"><?php 
        _e('Job Salary', 'appthemes');
        ?>
</label> <?php 
        $sel = 0;
        if (isset($posted['job_term_salary']) && $posted['job_term_salary'] > 0) {
            $sel = $posted['job_term_salary'];
        } else {
            $get_terms = wp_get_post_terms($job_details->ID, 'job_salary');
            foreach ($get_terms as $term) {
                $sel = $term->term_id;
            }
        }
        $args = array('orderby' => 'ID', 'order' => 'ASC', 'name' => 'job_term_salary', 'hierarchical' => 1, 'echo' => 0, 'class' => 'job_salary', 'selected' => $sel, 'taxonomy' => 'job_salary', 'hide_empty' => false);
        $dropdown = wp_dropdown_categories($args);
        $dropdown = str_replace('class=\'job_salary\' >', 'class=\'job_salary\' ><option value="">Select a salary&hellip;</option>', $dropdown);
        echo $dropdown;
        ?>
</p><?php 
    }
    ?>
			<p class="optional"><label for="tags"><?php 
    _e('Tags (comma separated)', 'appthemes');
    ?>
</label> <input type="text" class="text" name="tags" value="<?php 
    if (isset($posted['tags'])) {
        echo $posted['tags'];
    } else {
        $job_tags = array();
        $get_terms = wp_get_post_terms($job_details->ID, 'job_tag');
        foreach ($get_terms as $term) {
            $job_tags[] = $term->name;
        }
        echo implode(', ', $job_tags);
    }
    ?>
" id="tags" /></p>				
		</fieldset>
		<fieldset>
			<legend><?php 
    _e('Job Location', 'appthemes');
    ?>
</legend>								
			<p><?php 
    _e('Leave blank if the location of the applicant does not matter e.g. the job involves working from home.', 'appthemes');
    ?>
</p>
			
			<div id="geolocation_box">
			
				<p><label><input id="geolocation-load" type="button" class="button geolocationadd" value="<?php 
    _e('Find Address/Location', 'appthemes');
    ?>
" /></label> <input type="text" class="text" name="jr_address" id="geolocation-address" value="<?php 
    if (isset($posted['jr_address'])) {
        echo $posted['jr_address'];
    } else {
        echo get_post_meta($job_details->ID, 'geo_address', true);
    }
    ?>
" /><input type="hidden" class="text" name="jr_geo_latitude" id="geolocation-latitude" value="<?php 
    if (isset($posted['jr_geo_latitude'])) {
        echo $posted['jr_geo_latitude'];
    } else {
        echo get_post_meta($job_details->ID, '_jr_geo_latitude', true);
    }
    ?>
" /><input type="hidden" class="text" name="jr_geo_longitude" id="geolocation-longitude" value="<?php 
    if (isset($posted['jr_geo_longitude'])) {
        echo $posted['jr_geo_longitude'];
    } else {
        echo get_post_meta($job_details->ID, '_jr_geo_longitude', true);
    }
    ?>
" /></p>
	
				<div id="map_wrap" style="border:solid 2px #ddd;"><div id="geolocation-map" style="width:100%;height:350px;"></div></div>
			
			</div>
			
		</fieldset>	
		<fieldset>
			<legend><?php 
    _e('Job Description', 'appthemes');
    ?>
</legend>
			<p><?php 
    _e('Give details about the position, such as responsibilities &amp; salary.', 'appthemes');
    if (get_option('jr_html_allowed') == 'no') {
        _e(' HTML is not allowed.', 'appthemes');
    }
    ?>
</p>
		
			<p><textarea rows="5" cols="30" name="details" id="details" class="mceEditor"><?php 
    if (isset($posted['details'])) {
        echo $posted['details'];
    } else {
        echo $job_details->post_content;
    }
    ?>
</textarea></p>
		
		</fieldset>
		<?php 
    if (get_option('jr_submit_how_to_apply_display') == 'yes') {
        ?>
<fieldset>
			<legend><?php 
        _e('How to apply', 'appthemes');
        ?>
</legend>
			<p><?php 
        _e('Tell applicants how to apply &ndash; they will also be able to email you via the &ldquo;apply&rdquo; form on your job listing\'s page.', 'appthemes');
        if (get_option('jr_html_allowed') == 'no') {
            _e(' HTML is not allowed.', 'appthemes');
        }
        ?>
</p>
			<p><textarea rows="5" cols="30" name="apply" id="apply" class="how mceEditor"><?php 
        if (isset($posted['apply'])) {
            echo $posted['apply'];
        } else {
            echo get_post_meta($job_details->ID, '_how_to_apply', true);
        }
        ?>
</textarea></p>	
					
		</fieldset><?php 
    }
    ?>
		
		
		
		<?php 
    if ($relisting) {
        $packs = jr_get_job_packs();
        $user_packs = jr_get_user_job_packs();
        if (sizeof($packs) > 0 || sizeof($user_packs) > 0) {
            echo '<h2 style="margin-top: 20px;">' . __('Select a Job Pack:', 'appthemes') . '</h2>';
            echo '<ul class="packs">';
            $checked = 'checked="checked"';
            if (sizeof($user_packs) > 0) {
                foreach ($user_packs as $pack) {
                    $choose_or_use = __('Choose this pack', 'appthemes');
                    if (!$pack->jobs_limit) {
                        $pack->jobs_count = __('Unlimited', 'appthemes') . ' ' . __('Jobs remaining', 'appthemes');
                    } else {
                        $pack->jobs_count = $pack->jobs_limit - $pack->jobs_count;
                        if ($pack->jobs_count == 1) {
                            $pack->jobs_count = $pack->jobs_count . ' ' . __('Job remaining', 'appthemes');
                        } else {
                            $pack->jobs_count = $pack->jobs_count . ' ' . __('Jobs remaining', 'appthemes');
                        }
                    }
                    if ($pack->pack_expires) {
                        $pack->pack_expires = __('Usable before ', 'appthemes') . mysql2date(get_option('date_format'), $pack->pack_expires);
                    }
                    if ($pack->job_duration) {
                        $pack->job_duration = __(' lasting ', 'appthemes') . $pack->job_duration . __(' days', 'appthemes');
                    }
                    echo '<li><span class="cost">' . __('Purchased', 'appthemes') . '</span><h3>' . $pack->pack_name . '</h3>
						<p>' . $pack->jobs_count . '' . $pack->job_duration . '. ' . $pack->pack_expires . '.</p>
						<div><label>' . $choose_or_use . ': <input type="radio" name="job_pack" value="user_' . $pack->id . '" ' . $checked . ' /></label></div>
					</li>';
                    $checked = '';
                }
            }
            if (sizeof($packs) > 0) {
                foreach ($packs as $pack) {
                    $choose_or_use = '';
                    if (!$pack->job_count) {
                        $pack->job_count = __('Unlimited', 'appthemes');
                    }
                    if ($pack->pack_duration) {
                        $pack->pack_duration = __(' usable within ', 'appthemes') . $pack->pack_duration . __(' days', 'appthemes');
                    }
                    if ($pack->job_duration) {
                        $pack->job_duration = __(' lasting ', 'appthemes') . $pack->job_duration . __(' days', 'appthemes');
                    }
                    if ($pack->pack_cost) {
                        $pack->pack_cost = jr_get_currency($pack->pack_cost) . '';
                        $choose_or_use = __('Buy this pack', 'appthemes');
                    } else {
                        $pack->pack_cost = __('Free', 'appthemes');
                        $choose_or_use = __('Choose this pack', 'appthemes');
                    }
                    echo '<li><span class="cost">' . $pack->pack_cost . '</span><h3>' . $pack->pack_name . ' &ndash; <small>' . $pack->pack_description . '</small></h3>
						<p>' . $pack->job_count . ' ' . __('Jobs', 'appthemes') . '' . $pack->job_duration . $pack->pack_duration . '.</p>
						<div><label>' . $choose_or_use . ': <input type="radio" name="job_pack" value="' . $pack->id . '" ' . $checked . ' /></label></div>
					</li>';
                    $checked = '';
                }
            }
            echo '</ul>';
        }
        echo '<input type="hidden" name="relist" value="true" />';
        ?>

		<?php 
        $featured_cost = get_option('jr_cost_to_feature');
        if ($featured_cost && is_numeric($featured_cost) && $featured_cost > 0) {
            // Featuring is an option
            echo '<h2>' . __('Feature your listing for ', 'appthemes') . jr_get_currency($featured_cost) . __('?', 'appthemes') . '</h2>';
            echo '<p>' . __('Featured listings are displayed on the homepage and are also highlighted in all other listing pages.', 'appthemes') . '</p>';
            echo '<p><input type="checkbox" name="featureit" id="featureit" /> <label for="featureit" style="float:none">' . __('Yes please, feature my listing.', 'appthemes') . '</label></p>';
        }
    }
    ?>
		
		
		
		
		<p><input type="submit" class="submit" name="job_submit" value="<?php 
    if ($relisting) {
        _e('Relist &rarr;', 'appthemes');
    } else {
        _e('Save &rarr;', 'appthemes');
    }
    ?>
" /></p>
			
		<div class="clear"></div>		
	</form>
	<?php 
    if (get_option('jr_html_allowed') == 'yes') {
        jr_tinymce();
    }
    ?>
	<?php 
}
Example #3
0
									<td colspan="4"><?php 
        _e('No live jobs found.', 'appthemes');
        ?>
</td>
								</tr>
							<?php 
    }
}
?>
					</tbody>
				</table>
				
			</div>
			
			<?php 
if (sizeof(jr_get_job_packs()) > 0) {
    ?>
			<div id="packs" class="myjobs_section">
			
				<h2><?php 
    _e('My Packs', 'appthemes');
    ?>
</h2>
				<?php 
    $user_packs = jr_get_user_job_packs();
    if (sizeof($user_packs) > 0) {
        ?>
<p><?php 
        _e('Below you will find a list of active packs you have purchased.', 'appthemes');
        ?>
</p><?php 
Example #4
0
/**
 * Allow changing of values from user page
 */
function jr_profile_fields($user)
{
    if (get_user_meta($user->ID, '_valid_resume_subscription', true)) {
        $can_view_resumes = 1;
    } else {
        $can_view_resumes = 0;
    }
    ?>
	<h3><?php 
    _e('Job Packs', 'appthemes');
    ?>
</h3>
	
	<table class="form-table">
 
		<tr>
			<th><label><?php 
    _e('Current Job Packs', 'appthemes');
    ?>
</label></th>
			<td>
				<?php 
    $user_packs = jr_get_user_job_packs($user->ID);
    if (sizeof($user_packs) > 0) {
        echo '
						<table class="job_packs">
							<thead>
								<tr>
								<th>' . __('Name', 'appthemes') . '</th>
								<th>' . __('Jobs Remaining', 'appthemes') . '</th>
								<th>' . __('Job Duration', 'appthemes') . '</th>
								<th>' . __('Expires', 'appthemes') . '</th>
								<th>' . __('Delete pack?', 'appthemes') . '</th>
								</tr>
							</thead>
							<tbody>';
        if (sizeof($user_packs) > 0) {
            foreach ($user_packs as $pack) {
                if (!$pack->jobs_limit) {
                    $pack->jobs_count = __('Unlimited', 'appthemes');
                } else {
                    $pack->jobs_count = $pack->jobs_limit - $pack->jobs_count;
                }
                if ($pack->pack_expires > 0) {
                    $pack->pack_expires = mysql2date(get_option('date_format'), $pack->pack_expires) . '.';
                } else {
                    $pack->pack_expires = '';
                }
                echo '<tr>
								<td>' . $pack->pack_name . '</td>
								<td>' . $pack->jobs_count . '</td>
								<td>' . $pack->job_duration . '</td>
								<td>' . $pack->pack_expires . '</td>
								<td><input type="checkbox" name="delete_pack[]" value="' . $pack->id . '" /></td>
							</tr>';
            }
        }
        echo '</tbody></table>';
    } else {
        ?>
<p><?php 
        _e('No active packs found.', 'appthemes');
        ?>
</p><?php 
    }
    ?>
			</td>
		</tr>
		<tr>
			<th><label><?php 
    _e('Assign job pack', 'appthemes');
    ?>
</label></th>
			<td>
				<select name="give_job_pack"><option value=""><?php 
    _e('Choose a pack...', 'appthemes');
    ?>
</option>
				<?php 
    $packs = jr_get_job_packs();
    if (sizeof($packs) > 0) {
        foreach ($packs as $pack) {
            echo '<option value="' . $pack->id . '">' . $pack->pack_name . '</option>';
        }
    }
    ?>
				</select>
			</td>
		</tr>
 
	</table>

	<h3><?php 
    _e('Permissions', 'appthemes');
    ?>
</h3>
 
	<table class="form-table">
 
		<tr>
			<th><label for="twitter"><?php 
    _e('Valid resume subscription?', 'appthemes');
    ?>
</label></th>
 
			<td>
				<select name="view_resumes">
					<option value=""><?php 
    _e('No', 'appthemes');
    ?>
</option>
					<option value="1" <?php 
    selected($can_view_resumes, 1);
    ?>
><?php 
    _e('Yes', 'appthemes');
    ?>
</option>
				</select>
				<span class="description"><?php 
    _e('Define whether or not this user has a valid, active resume subscription.', 'appthemes');
    ?>
</span>
			</td>
		</tr>
 
	</table>
	
<?php 
}
Example #5
0
/**
 * JobRoller Preview Job form
 * Function outputs the job preview form
 *
 *
 * @version 1.0
 * @author AppThemes
 * @package JobRoller
 * @copyright 2010 all rights reserved
 *
 */
function jr_preview_job_form()
{
    global $post, $posted;
    ?>
	<form action="<?php 
    echo get_permalink($post->ID);
    ?>
" method="post" enctype="multipart/form-data" id="submit_form" class="submit_form main_form">			
		<p><?php 
    _e('Below is a preview of what your job listing will look like when published:', 'appthemes');
    ?>
</p>				
		
		<ol class="jobs">
			<li class="job <?php 
    if ($alt == 1) {
        echo 'job-alt';
    }
    ?>
" style="padding-left:0; padding-right:0;"><dl>
				<dt><?php 
    _e('Type', 'appthemes');
    ?>
</dt>
				<dd class="type"><?php 
    $job_type = get_term_by('slug', sanitize_title($posted['job_term_type']), 'job_type');
    echo '<span class="' . $job_type->slug . '">' . wptexturize($job_type->name) . '</span>';
    ?>
&nbsp;</dd>
				<dt><?php 
    _e('Job', 'appthemes');
    ?>
</dt>
				<dd class="title"><strong><?php 
    echo $posted['job_title'];
    ?>
 </strong><?php 
    $author = get_user_by('id', get_current_user_id());
    if ($posted['your_name']) {
        echo $posted['your_name'];
        if ($author && ($link = get_author_posts_url($author->ID, $author->user_nicename))) {
            echo sprintf(__(' &ndash; Posted by <a href="%s">%s</a>', 'appthemes'), $link, $author->display_name);
        }
    } else {
        if ($author && ($link = get_author_posts_url($author->ID, $author->user_nicename))) {
            echo sprintf(__('<a href="%s">%s</a>', 'appthemes'), $link, $author->display_name);
        }
    }
    ?>
				</dd>
				<dt><?php 
    _e('_Location', 'appthemes');
    ?>
</dt>
				<dd class="location"><?php 
    $latitude = jr_clean_coordinate($posted['jr_geo_latitude']);
    $longitude = jr_clean_coordinate($posted['jr_geo_longitude']);
    if ($latitude && $longitude) {
        $address = jr_reverse_geocode($latitude, $longitude);
        echo '<strong>' . wptexturize($address['short_address']) . '</strong> ' . wptexturize($address['short_address_country']) . '';
    } else {
        echo '<strong>Anywhere</strong>';
    }
    ?>
</dd>
				<dt><?php 
    _e('Date Posted', 'appthemes');
    ?>
</dt>
				<dd class="date"><strong><?php 
    echo date_i18n(__('j M', 'appthemes'));
    ?>
</strong> <span class="year"><?php 
    echo date_i18n(__('Y', 'appthemes'));
    ?>
</span></dd>
			</dl></li>
		</ol>
		
		<p><?php 
    _e('The job listing&rsquo;s page will contain the following information:', 'appthemes');
    ?>
</p>
		
		<blockquote>
			<h2><?php 
    _e('Job description', 'appthemes');
    ?>
</h2>
			<?php 
    echo wpautop(wptexturize($posted['details']));
    ?>
			<?php 
    if (get_option('jr_submit_how_to_apply_display') == 'yes') {
        ?>
				<h2><?php 
        _e('How to apply', 'appthemes');
        ?>
</h2>
				<?php 
        echo wpautop(wptexturize($posted['apply']));
        ?>
			<?php 
    }
    ?>
		</blockquote>
		
		<?php 
    $packs = jr_get_job_packs();
    $user_packs = jr_get_user_job_packs();
    if (sizeof($packs) > 0 || sizeof($user_packs) > 0) {
        echo '<h2>' . __('Select a Job Pack:', 'appthemes') . '</h2>';
        echo '<ul class="packs">';
        $checked = 'checked="checked"';
        if (sizeof($user_packs) > 0) {
            foreach ($user_packs as $pack) {
                $choose_or_use = __('Choose this pack', 'appthemes');
                if (!$pack->jobs_limit) {
                    $pack->jobs_count = __('Unlimited', 'appthemes') . ' ' . __('Jobs remaining', 'appthemes');
                } else {
                    $pack->jobs_count = $pack->jobs_limit - $pack->jobs_count;
                    if ($pack->jobs_count == 1) {
                        $pack->jobs_count = $pack->jobs_count . ' ' . __('Job remaining', 'appthemes');
                    } else {
                        $pack->jobs_count = $pack->jobs_count . ' ' . __('Jobs remaining', 'appthemes');
                    }
                }
                if ($pack->pack_expires) {
                    $pack->pack_expires = __('Usable before ', 'appthemes') . mysql2date(get_option('date_format'), $pack->pack_expires);
                }
                if ($pack->job_duration) {
                    $pack->job_duration = __(' lasting ', 'appthemes') . $pack->job_duration . __(' days', 'appthemes');
                }
                echo '<li><span class="cost">' . __('Purchased', 'appthemes') . '</span><h3>' . $pack->pack_name . '</h3>
						<p>' . $pack->jobs_count . '' . $pack->job_duration . '. ' . $pack->pack_expires . '.</p>
						<div><label>' . $choose_or_use . ': <input type="radio" name="job_pack" value="user_' . $pack->id . '" ' . $checked . ' /></label></div>
					</li>';
                $checked = '';
            }
        }
        if (sizeof($packs) > 0) {
            foreach ($packs as $pack) {
                $choose_or_use = '';
                if (!$pack->job_count) {
                    $pack->job_count = __('Unlimited', 'appthemes');
                }
                if ($pack->pack_duration) {
                    $pack->pack_duration = __(' usable within ', 'appthemes') . $pack->pack_duration . __(' days', 'appthemes');
                }
                if ($pack->job_duration) {
                    $pack->job_duration = __(' lasting ', 'appthemes') . $pack->job_duration . __(' days', 'appthemes');
                }
                if ($pack->pack_cost) {
                    $pack->pack_cost = jr_get_currency($pack->pack_cost) . '';
                    $choose_or_use = __('Buy this pack', 'appthemes');
                } else {
                    $pack->pack_cost = __('Free', 'appthemes');
                    $choose_or_use = __('Choose this pack', 'appthemes');
                }
                echo '<li><span class="cost">' . $pack->pack_cost . '</span><h3>' . $pack->pack_name . ' &ndash; <small>' . $pack->pack_description . '</small></h3>
						<p>' . $pack->job_count . ' ' . __('Jobs', 'appthemes') . '' . $pack->job_duration . $pack->pack_duration . '.</p>
						<div><label>' . $choose_or_use . ': <input type="radio" name="job_pack" value="' . $pack->id . '" ' . $checked . ' /></label></div>
					</li>';
                $checked = '';
            }
        }
        echo '</ul>';
    }
    ?>

		<?php 
    $featured_cost = get_option('jr_cost_to_feature');
    if ($featured_cost && is_numeric($featured_cost) && $featured_cost > 0) {
        // Featuring is an option
        echo '<h2>' . __('Feature your listing for ', 'appthemes') . jr_get_currency($featured_cost) . __('?', 'appthemes') . '</h2>';
        echo '<p>' . __('Featured listings are displayed on the homepage and are also highlighted in all other listing pages.', 'appthemes') . '</p>';
        echo '<p><input type="checkbox" name="featureit" id="featureit" /> <label for="featureit" style="float:none">' . __('Yes please, feature my listing.', 'appthemes') . '</label></p>';
    }
    ?>
		
		<p>
            <input type="submit" name="goback" class="goback" value="<?php 
    _e('Go Back', 'appthemes');
    ?>
"  /> 
            <input type="submit" class="submit" name="preview_submit" value="<?php 
    _e('Next &rarr;', 'appthemes');
    ?>
" />
            <input type="hidden" value='<?php 
    echo htmlentities(json_encode($posted), ENT_QUOTES);
    ?>
' name="posted" />
        </p>
		
		<div class="clear"></div>
	</form>
	<?php 
}
Example #6
0
 function widget($args, $instance)
 {
     extract($args);
     $title = apply_filters('widget_title', empty($instance['title']) ? __('Available Job Packs', 'appthemes') : $instance['title'], $instance, $this->id_base);
     $packs = jr_get_job_packs();
     if (sizeof($packs) > 0) {
         echo $before_widget;
         if (isset($title) && $title) {
             echo $before_title . $title . $after_title;
         }
         echo '<ul class="pack_overview">';
         foreach ($packs as $pack) {
             if (!$pack->job_count) {
                 $pack->job_count = __('Unlimited', 'appthemes');
             }
             if ($pack->pack_duration) {
                 $pack->pack_duration = __(' usable within ', 'appthemes') . $pack->pack_duration . __(' days', 'appthemes');
             }
             if ($pack->job_duration) {
                 $pack->job_duration = __(' lasting ', 'appthemes') . $pack->job_duration . __(' days', 'appthemes');
             }
             if ($pack->pack_cost) {
                 $pack->pack_cost = jr_get_currency($pack->pack_cost) . '';
             } else {
                 $pack->pack_cost = __('Free', 'appthemes');
             }
             echo '<li><span class="cost">' . $pack->pack_cost . '</span><p><strong>' . $pack->pack_name . '</strong><br />' . $pack->job_count . ' ' . __('Jobs', 'appthemes') . '' . $pack->job_duration . $pack->pack_duration . '.</p>
         </li>';
             $checked = '';
         }
         echo '</ul>';
         echo $after_widget;
     }
 }
Example #7
0
    if (!is_user_logged_in() || is_user_logged_in() && current_user_can('can_submit_job')) {
        ?>
        <div>

            <a href="<?php 
        echo get_permalink(get_option('jr_submit_page_id'));
        ?>
" class="button"><span><?php 
        _e('Submit a Job', 'appthemes');
        ?>
</span></a>
            <?php 
        if ($text = get_option('jr_jobs_submit_text')) {
            echo wpautop(wptexturize($text));
        } else {
            $packs = jr_get_job_packs();
            if (sizeof($packs) == 0) {
                // display standard pricing
                $amount = get_option('jr_jobs_listing_cost');
                if ($amount && $amount > 0) {
                    echo '<p class="pricing"><em>' . jr_get_currency($amount) . '</em> ' . __('for', 'appthemes') . ' <em>30 ' . __('days', 'appthemes') . '</em></p>';
                }
            }
        }
        ?>

        </div>
        <?php 
    }
    ?>