Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * The template for displaying all pages.
- * Template Name: Post a Race
- * This is the template that displays all pages by default.
- * Please note that this is the WordPress construct of pages
- * and that other 'pages' on your WordPress site will use a
- * different template.
- *
- * @package WordPress
- * @subpackage Twenty_Ten
- * @since Twenty Ten 1.0
- */
- ?>
- <?php
- global $userdata,$user_ID, $user_identity, $user_level, $spages,$userexpired;
- global $spages, $wpdb;
- $regipage_link = get_permalink($spages->regipage);
- $jobpostpage_link = get_permalink($spages->jobpostpage);
- if (!is_user_logged_in()){ // no access for guest
- $redirect_link = cb_getquerylink($regipage_link).'redirect_to='.$jobpostpage_link;
- wp_redirect($redirect_link); exit;
- }
- global $recaptcha_publickey,$recaptcha_privatekey;
- /*
- if($userexpired){
- wp_redirect(get_permalink($spages->subscription)); exit;
- }
- */
- /*
- else if($userdata->rdrole != 'parents' && $user_level <10){ //no access for driver , others or having user level less than 10
- wp_redirect(get_bloginfo('url')); exit;
- }
- */
- //include_once TEMPLATEPATH."/libs/jobpostform.php";
- include_once TEMPLATEPATH."/libs/checklist.php";
- include_once TEMPLATEPATH."/libs/radiolist.php";
- include_once TEMPLATEPATH."/libs/dropdownlist.php";
- //myprint_r($userdata);
- //var_dump($userdata->rdrole);
- //var_dump($user_identity);
- //var_dump($user_level);
- //http://pastebin.com/rw4c6jZQ
- $page_title = get_the_title();
- if ( isset($_GET['raceid']) || isset ($_POST['raceid']) ) $page_title = 'Edit Race';
- ?>
- <?php
- $i = 1;
- $title = '';
- $description = '';
- $racetag = array();
- $racetype = array();
- $racedistance = array();
- $racelocation = array();
- $awards = array();
- //$eventname = '';
- $distancekm = '';
- $distancemile = '';
- $terraintype = '';
- $startdate = '';
- $starttime = '';
- $venue = '';
- $organizername = '';
- $racewebsite = '';
- $bestimemen = '';
- $bestimewoman = '';
- $towncity = '';
- $county = '';
- $region = '';
- $zipcode = '';
- $findstartline = '';
- $nearestparking = '';
- $entryfee = '';
- $enteronday = 0;
- $onlineentrylink = '';
- $postalentry = '';
- $checquepayableto = '';
- $entryclosedate = '';
- $entrylimit = '';
- $contact = '';
- $toilets = 0;
- $changingfacility = 0;
- $waterstation = 0;
- # the response from reCAPTCHA
- $recaptcha_resp = null;
- # the error code from reCAPTCHA, if any
- $recaptcha_error = null;
- //$raceid = '';
- if ( isset($_GET['raceid']) ){
- $raceid = (int) $_GET['raceid'];
- $jobpost = null;
- if ( $raceid ) {
- $jobpost = get_post($raceid);
- //main fields
- $title = $jobpost->post_title;
- $description = $jobpost->post_content;
- //taxonomies
- $racetag = get_the_terms( $raceid, 'racetag');
- $racetype = get_the_terms( $raceid, 'racetype');
- $racedistance = get_the_terms( $raceid, 'racedistance');
- $racelocation = get_the_terms( $raceid, 'racelocation');
- $awards = get_the_terms( $raceid, 'awards');
- //custom fields
- //$eventname = get_post_meta( $raceid, 'eventname', true);
- $distancekm = get_post_meta( $raceid, 'distancekm', true);
- $distancemile = get_post_meta( $raceid, 'distancemile', true);
- $terraintype = get_post_meta( $raceid, 'terraintype', true);
- $startdate = get_post_meta( $raceid, 'startdate', true); //yyyy-mm-dd
- $startdate = convert_datetoukdate($startdate); //dd-mm-yyyy
- $starttime = get_post_meta( $raceid, 'starttime', true);
- $venue = get_post_meta( $raceid, 'venue', true);
- $organizername = get_post_meta( $raceid, 'organizername', true);
- $racewebsite = get_post_meta( $raceid, 'racewebsite', true);
- $bestimemen = get_post_meta( $raceid, 'bestimemen', true);
- $bestimewoman = get_post_meta( $raceid, 'bestimewoman', true);
- $towncity = get_post_meta( $raceid, 'towncity', true);
- $county = get_post_meta( $raceid, 'county', true);
- $region = get_post_meta( $raceid, 'region', true);
- $zipcode = get_post_meta( $raceid, 'zipcode', true);
- $findstartline = get_post_meta( $raceid, 'findstartline', true);
- $nearestparking = get_post_meta( $raceid, 'nearestparking', true);
- $entryfee = get_post_meta( $raceid, 'entryfee', true);
- $enteronday = intval(get_post_meta( $raceid, 'enteronday', true));
- $onlineentrylink = get_post_meta( $raceid, 'onlineentrylink', true);
- $postalentry = get_post_meta( $raceid, 'postalentry', true);
- $checquepayableto = get_post_meta( $raceid, 'checquepayableto', true);
- $entryclosedate = get_post_meta( $raceid, 'entryclosedate', true); //yyyy-mm-dd
- $entryclosedate = convert_datetoukdate($entryclosedate); //dd-mm-yyyy
- $entrylimit = get_post_meta( $raceid, 'entrylimit', true);
- $contact = get_post_meta( $raceid, 'contact', true);
- $toilets = intval(get_post_meta( $raceid, 'toilets', true));
- $changingfacility = intval(get_post_meta( $raceid, 'changingfacility', true));
- $waterstation = intval(get_post_meta( $raceid, 'waterstation', true));
- }
- }
- elseif ( isset($_POST['raceid']) )
- $raceid = (int) $_POST['raceid'];
- else
- $raceid = 0;
- $submit_title = 'Create Race';
- $errormessage = '';
- if( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['mode'] )) {
- $nonce = $_REQUEST['_wpnonce'];
- $mode = $_POST['mode'];
- if($mode == 'newpost'){
- if (! wp_verify_nonce($nonce, 'newjobpostby'.$user_ID) ) die('Security check');
- }
- else if($mode == 'postupdate' ){
- if (! wp_verify_nonce($nonce, 'newjobpostid'.$raceid.'_'.$user_ID) ) die('Security check');
- }
- else{
- die('Security check');
- }
- //basic fields
- $title = (isset ($_POST['title']))? sanitize_text_field($_POST['title']): '';
- $description = (isset ($_POST['description']))? esc_textarea($_POST['description']):'';
- //taxonomies
- $racetag = (isset ($_POST['racetag']))? $_POST['racetag']:'';
- $racetype = (isset ($_POST['racetype']))? $_POST['racetype']:'';
- $racedistance = (isset ($_POST['racedistance']))? $_POST['racedistance']:'';
- $racelocation = (isset ($_POST['racelocation']))? $_POST['racelocation']:'';
- $awards = (isset ($_POST['awards']))? $_POST['awards']:'';
- //custom fields
- //$eventname = (isset ($_POST['eventname']))? sanitize_text_field($_POST['eventname']):'';
- $distancekm = (isset ($_POST['distancekm']))? sanitize_text_field($_POST['distancekm']): '';
- $distancemile = (isset ($_POST['distancemile']))? sanitize_text_field($_POST['distancemile']): '';
- $terraintype = (isset ($_POST['terraintype']))? sanitize_text_field($_POST['terraintype']): '';
- $startdate = (isset ($_POST['startdate']))? sanitize_text_field($_POST['startdate']): '';
- $starttime = (isset ($_POST['starttime']))? sanitize_text_field($_POST['starttime']): '';
- $venue = (isset ($_POST['venue']))? sanitize_text_field($_POST['venue']): '';
- $organizername = (isset ($_POST['organizername']))? sanitize_text_field($_POST['organizername']): '';
- $racewebsite = (isset ($_POST['racewebsite']))? sanitize_text_field($_POST['racewebsite']): '';
- $bestimemen = (isset ($_POST['bestimemen']))? sanitize_text_field($_POST['bestimemen']): '';
- $bestimewoman = (isset ($_POST['bestimewoma']))? sanitize_text_field($_POST['bestimewoma']): '';
- $towncity = (isset ($_POST['towncity']))? sanitize_text_field($_POST['towncity']): '';
- $county = (isset ($_POST['county']))? sanitize_text_field($_POST['county']): '';
- $region = (isset ($_POST['region']))? sanitize_text_field($_POST['region']): '';
- $zipcode = (isset ($_POST['zipcode']))? sanitize_text_field($_POST['zipcode']): '';
- $findstartline = (isset ($_POST['findstartline']))? sanitize_text_field($_POST['findstartline']): '';
- $nearestparking = (isset ($_POST['nearestparking']))? sanitize_text_field($_POST['nearestparking']): '';
- $entryfee = (isset ($_POST['entryfee']))? sanitize_text_field($_POST['entryfee']): '';
- $enteronday = (isset ($_POST['enteronday']))? sanitize_text_field($_POST['enteronday']): '';
- $onlineentrylink = (isset ($_POST['onlineentrylink']))? sanitize_text_field($_POST['onlineentrylink']): '';
- $postalentry = (isset ($_POST['postalentry']))? sanitize_text_field($_POST['postalentry']): '';
- $checquepayableto = (isset ($_POST['checquepayableto']))? sanitize_text_field($_POST['checquepayableto']): '';
- $entryclosedate = (isset ($_POST['entryclosedate']))? sanitize_text_field($_POST['entryclosedate']): '';
- $entrylimit = (isset ($_POST['entrylimit']))? sanitize_text_field($_POST['entrylimit']): '';
- $contact = (isset ($_POST['contact']))? sanitize_text_field($_POST['contact']): '';
- $toilets = (isset ($_POST['toilets']))? sanitize_text_field($_POST['toilets']): 0;
- $changingfacility = (isset ($_POST['changingfacility']))? sanitize_text_field($_POST['changingfacility']): 0;
- $waterstation = (isset ($_POST['waterstatio']))? sanitize_text_field($_POST['waterstatio']): 0;
- $raceid = (isset ($_POST['raceid']))? sanitize_text_field($_POST['raceid']):'';
- $wp_error = new WP_ERROR();
- if ( $title == ''){ $wp_error->add( 'empty_title', __( '<strong>ERROR</strong>: Please enter title.' ));}
- if(strlen($title) < 10 ){$wp_error->add( 'short_title', __( '<strong>ERROR</strong>: Title is too short. Please put the title more than 10 characters.' ));}
- if ( $description == '' ) { $wp_error->add( 'empty_description', __( '<strong>ERROR</strong>: Please enter description.' ));}
- if(strlen($description) < 30 ){$wp_error->add( 'short_description', __( '<strong>ERROR</strong>: Description is too short. Please put the description more than 30 characters.' ));}
- if(!is_array($racetype) || empty ($racetype)){
- $wp_error->add( 'empty_racetype', __( '<strong>ERROR</strong>: Please select Race Type.' ));
- }
- if(!is_array($racedistance) || empty ($racedistance)){
- $wp_error->add( 'empty_racedistance', __( '<strong>ERROR</strong>: Please select Race Distance.' ));
- }
- if(!is_array($racelocation) || empty ($racelocation)){
- $wp_error->add( 'empty_racelocation', __( '<strong>ERROR</strong>: Please select Race Location.' ));
- }
- $startdatet = $startdate;
- $entryclosedatet = $entryclosedate;
- if(empty ($startdate)){
- $wp_error->add( 'empty_startdate', __( '<strong>ERROR</strong>: Start Date empty.' ));
- }
- else if(!cv_isvalid_date($startdatet)){
- $wp_error->add( 'empty_startdate', __( '<strong>ERROR</strong>: Invalid Start Date.' ));
- }
- if(empty ($starttime)){
- $wp_error->add( 'empty_starttime', __( '<strong>ERROR</strong>: Start Time empty.' ));
- }
- if(empty ($venue)){
- $wp_error->add( 'empty_venue', __( '<strong>ERROR</strong>: Empty venue.' ));
- }
- if(empty ($organizername)){
- $wp_error->add( 'empty_organizername', __( '<strong>ERROR</strong>: Organizer name empty.' ));
- }
- if(empty ($county)){
- $wp_error->add( 'empty_county', __( '<strong>ERROR</strong>: County empty.' ));
- }
- if(empty ($towncity)){
- $wp_error->add( 'empty_towncity', __( '<strong>ERROR</strong>: Town/City empty.' ));
- }
- if(empty ($region)){
- $wp_error->add( 'empty_region', __( '<strong>ERROR</strong>: Region empty.' ));
- }
- if(empty ($zipcode)){
- $wp_error->add( 'empty_zipcode', __( '<strong>ERROR</strong>: Zipcode empty.' ));
- }
- if(empty ($entryclosedate)){
- $wp_error->add( 'empty_entryclosedate', __( '<strong>ERROR</strong>: Entry Close Date empty.' ));
- }
- else if(!cv_isvalid_date($entryclosedatet)){
- $wp_error->add( 'empty_entryclosedate', __( '<strong>ERROR</strong>: Invalid Entry Close Date.' ));
- }
- # was there a reCAPTCHA response?
- //var_dump($_POST["recaptcha_response_field"]);
- $recaptcha_response_field = (isset ($_POST['recaptcha_response_field']))? $_POST['recaptcha_response_field']:'';
- if (!empty ($recaptcha_response_field)) {
- $recaptcha_resp = recaptcha_check_answer ($recaptcha_privatekey,
- $_SERVER["REMOTE_ADDR"],
- $_POST["recaptcha_challenge_field"],
- $_POST["recaptcha_response_field"]);
- if ($recaptcha_resp->is_valid) {
- //echo "You got it!";
- } else {
- # set the error code so that we can display it
- $recaptcha_error = $recaptcha_resp->error;
- $wp_error->add( 'empty_recaptcha', __( '<strong>ERROR</strong>:'.$recaptcha_error ));
- }
- }
- else{
- $recaptcha_error = 'Captcha is empty';
- $wp_error->add( 'empty_recaptcha', __( '<strong>ERROR</strong>: Please fill the captcha challenge carefully'));
- }
- //$jobid = '';
- if ( !isset( $wp_error ) || ( isset( $wp_error ) && is_object( $wp_error ) && false == $wp_error->get_error_codes() ) ){
- //let's form the post data
- $new_post = array(
- 'post_title' => $title,
- 'post_content' => $description,
- 'tax_input' => array (
- 'racetype' => $racetype,
- 'racedistance' => $racedistance,
- 'racelocation' => $racelocation
- ),
- 'post_status' => 'pending', // Choose: publish, preview, future, draft, etc.
- 'post_type' => 'race', //'post',page' or use a custom post type if you want to
- );
- if($mode == 'newpost'){
- $raceid = wp_insert_post($new_post);
- $success = 'created';
- }
- else if($mode == 'postupdate' ){
- $new_post['ID'] = $raceid;
- $raceid = wp_update_post( $new_post );
- $success = 'edited';
- }
- else{
- die('Security check');
- }
- //var_dump($jobid);
- if($raceid == 0){
- $wp_error->add( 'error_jobcreate', __( '<strong>ERROR</strong>: Error creating/updating post. Please contact with site admin' ));
- }
- else{
- //post added or edited successfully.
- if($mode == 'newpost'){
- //add_post_meta($raceid, "eventname", $eventname);
- add_post_meta($raceid, "distancekm", $distancekm);
- add_post_meta($raceid, "distancemile", $distancemile);
- add_post_meta($raceid, "terraintype", $terraintype);
- add_post_meta($raceid, "startdate", convert_ukdatetodate($startdate));
- add_post_meta($raceid, "starttime", $starttime);
- add_post_meta($raceid, "venue", $venue);
- add_post_meta($raceid, "organizername", $organizername);
- add_post_meta($raceid, "racewebsite", $racewebsite);
- add_post_meta($raceid, "bestimemen", $bestimemen);
- add_post_meta($raceid, "bestimewoman", $bestimewoman);
- add_post_meta($raceid, "towncity", $towncity);
- add_post_meta($raceid, "county", $county);
- add_post_meta($raceid, "region", $region);
- add_post_meta($raceid, "zipcode", $zipcode);
- add_post_meta($raceid, "findstartline", $findstartline);
- add_post_meta($raceid, "nearestparking", $nearestparking);
- add_post_meta($raceid, "entryfee", $entryfee);
- add_post_meta($raceid, "onlineentrylink", $onlineentrylink);
- add_post_meta($raceid, "enteronday", $enteronday);
- add_post_meta($raceid, "postalentry", $postalentry);
- add_post_meta($raceid, "checquepayableto", $checquepayableto);
- add_post_meta($raceid, "entryclosedate", convert_ukdatetodate($entryclosedate));
- add_post_meta($raceid, "contact", $contact);
- add_post_meta($raceid, "changingfacility", $changingfacility);
- add_post_meta($raceid, "waterstation", $waterstation);
- }
- else{
- //update_post_meta($raceid, "eventname", $eventname);
- update_post_meta($raceid, "distancekm", $distancekm);
- update_post_meta($raceid, "distancemile", $distancemile);
- update_post_meta($raceid, "startdate", convert_ukdatetodate($startdate));
- update_post_meta($raceid, "starttime", $starttime);
- update_post_meta($raceid, "venue", $venue);
- update_post_meta($raceid, "organizername", $organizername);
- update_post_meta($raceid, "racewebsite", $racewebsite);
- update_post_meta($raceid, "bestimemen", $bestimemen);
- update_post_meta($raceid, "bestimewoman", $bestimewoman);
- update_post_meta($raceid, "towncity", $towncity);
- update_post_meta($raceid, "county", $county);
- update_post_meta($raceid, "region", $region);
- update_post_meta($raceid, "zipcode", $zipcode);
- update_post_meta($raceid, "findstartline", $findstartline);
- update_post_meta($raceid, "nearestparking", $nearestparking);
- update_post_meta($raceid, "entryfee", $entryfee);
- update_post_meta($raceid, "onlineentrylink", $onlineentrylink);
- update_post_meta($raceid, "enteronday", $enteronday);
- update_post_meta($raceid, "postalentry", $postalentry);
- update_post_meta($raceid, "checquepayableto", $checquepayableto);
- update_post_meta($raceid, "entryclosedate", convert_ukdatetodate($entryclosedate));
- update_post_meta($raceid, "contact", $contact);
- update_post_meta($raceid, "changingfacility", $changingfacility);
- update_post_meta($raceid, "waterstation", $waterstation);
- }
- }
- }
- if(is_wp_error( $wp_error ) ) {
- //var_dump($wp_error);
- foreach ( $wp_error->get_error_codes() as $code ) {
- foreach ( $wp_error->get_error_messages($code) as $error ) {
- $errormessage .= ' ' . $error . "<br />\n";
- }
- }
- $errormessage = '<div id="login_error">'.$errormessage.'</div>';
- }
- if(false == $wp_error->get_error_codes()){
- if(strpos($jobpostpage_link, '?') !== false) {
- $jobpostpage_link_redirect = $jobpostpage_link_redirect.'&raceid='.$raceid.'&status='.$success;
- }
- else{
- $jobpostpage_link_redirect = $jobpostpage_link_redirect.'?raceid='.$raceid.'&status='.$success;
- }
- wp_redirect($jobpostpage_link_redirect); exit();
- //$errormessage = '<div id="login_error">Job '.$success.' successfully! | Continue edit or <a href="'.get_permalink($jobid).'">Click to view the job</a></div>';
- }
- //echo $errormessage;
- }
- ?>
- <?php get_header(); ?>
- <div id="container">
- <div id="content" role="main">
- <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
- <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
- <h1 class="entry-title"><?php echo $page_title; ?></h1>
- <div class="entry-content">
- <?php
- //the_content();
- //cb_show_jobpost_form();
- if($errormessage != '') echo $errormessage;
- if(isset ($_GET['status'])){
- echo '<div id="login_error">'.$_GET['status'].' successfully! | Continue edit or <a href="'.get_permalink($raceid).'">Click to view</a></div>';
- }
- ?>
- <form name="registerform" id="registerform" method="post" action="<?php echo $jobpostpage_link; ?>" class="job-form" enctype="multipart/form-data">
- <p><label for="title">Race Title: *</label><input class="input" type="text" id="title" value="<?php echo $title; ?>" name="title" /></p>
- <p>
- <label for="description">Description: *</label>
- <textarea class="input" id="post_content" name="description" cols="50" rows="10"><?php echo $description; ?></textarea>
- </p>
- <div class="childrenage_selectbox">
- <label>Race Type: *</label>
- <div class="formselectbox">
- <select class="nonbulletlist" name="racetype[]">
- <?php
- // wp_terms_radiolist($raceid, array( 'taxonomy' => 'racetype') );
- wp_terms_dropdownlist($raceid, array( 'taxonomy' => 'racetype') );
- ?>
- </select>
- </div>
- <div class="clear"></div>
- </div>
- <div class="childrenage_selectbox">
- <label>Race Distance: *</label>
- <div class="formselectbox">
- <select class="nonbulletlist" name="racedistance[]">
- <?php
- wp_terms_dropdownlist($raceid, array( 'taxonomy' => 'racedistance') );
- ?>
- </select>
- </div>
- <div class="clear"></div>
- </div>
- <div class="childrenage_selectbox">
- <label>Race Location: *</label>
- <div class="formselectbox">
- <select class="nonbulletlist" name="racelocation[]">
- <?php
- wp_terms_dropdownlist($raceid, array( 'taxonomy' => 'racelocation') );
- ?>
- </select>
- </div>
- <div class="clear"></div>
- </div>
- <!--p><label for="eventname">Event Name:</label><input class="input" type="text" id="eventname" value="<?php echo $eventname; ?>" name="eventname" /></p-->
- <p><label for="distancekm">Distance(KMs):</label><input class="input" type="text" id="distancekm" value="<?php echo $distancekm; ?>" name="distancekm" /></p>
- <p><label for="distancemile">Distance(Miles):</label><input class="input" type="text" id="distancemile" value="<?php echo $distancemile; ?>" name="distancemile" /></p>
- <p><label for="terraintype">Terrain Type:</label><input class="input" type="text" id="terraintype" value="<?php echo $terraintype; ?>" name="terraintype" /></p>
- <p><label for="startdate">Start Date: *</label><input class="input" type="text" id="startdate" value="<?php echo $startdate; ?>" name="startdate" /> <span class="smallformlabel">Format: dd-mm-yyyy</span></p>
- <p><label for="starttime">Start Time: *</label><input class="input" type="text" id="starttime" value="<?php echo $starttime; ?>" name="starttime" /> <span class="smallformlabel">Format: hh:mm</span></p>
- <p><label for="venue">Venue: *</label><input class="input" type="text" id="venue" value="<?php echo $venue; ?>" name="venue" /></p>
- <p><label for="organizername">Organizer Name: *</label><input class="input" type="text" id="organizername" value="<?php echo $organizername; ?>" name="organizername" /></p>
- <p><label for="racewebsite">Race Website:</label><input class="input" type="text" id="racewebsite" value="<?php echo $racewebsite; ?>" name="racewebsite" /></p>
- <p><label for="bestimemen">Best Time(Men):</label><input class="input" type="text" id="bestimemen" value="<?php echo $bestimemen; ?>" name="bestimemen" /></p>
- <p><label for="bestimewoman">Best Time(Woman):</label><input class="input" type="text" id="bestimewoman" value="<?php echo $bestimewoman; ?>" name="bestimewoman" /></p>
- <p><label for="towncity">Town/City: *</label><input class="input" type="text" id="towncity" value="<?php echo $towncity; ?>" name="towncity" /></p>
- <p><label for="county">County: *</label><input class="input" type="text" id="county" value="<?php echo $county; ?>" name="county" /></p>
- <p><label for="region">Region: *</label><input class="input" type="text" id="region" value="<?php echo $region; ?>" name="region" /></p>
- <p><label for="zipcode">ZIP Code: *</label><input class="input" type="text" id="zipcode" value="<?php echo $zipcode; ?>" name="zipcode" /></p>
- <p><label for="findstartline">How to Find Start Line:</label><input class="input" type="text" id="findstartline" value="<?php echo $findstartline; ?>" name="findstartline" /></p>
- <p><label for="nearestparking">Nearest Parking:</label><input class="input" type="text" id="nearestparking" value="<?php echo $nearestparking; ?>" name="nearestparking" /></p>
- <p><label for="entryfee">Entry Fee(NOK):</label><input class="input" type="text" id="entryfee" value="<?php echo $entryfee; ?>" name="entryfee" /></p>
- <div class="childrenage_selectbox">
- <label for="enteronday">Enter On the Day?</label>
- <div class="formselectbox">
- <input type="radio" name="enteronday" id="enteronday0" value="0" <?php checked( 0, intval($enteronday)); ?> /> No
- <input type="radio" name="enteronday" id="enteronday1" value="1" <?php checked( 1, intval($enteronday)); ?> /> Yes
- </div>
- <div class="clear"></div>
- </div>
- <p><label for="onlineentrylink">Online Entry Link:</label><input class="input" type="text" id="onlineentrylink" value="<?php echo $onlineentrylink; ?>" name="onlineentrylink" /></p>
- <div class="childrenage_selectbox">
- <label for="postalentry">Postal Entry:</label>
- <div class="formselectbox">
- <input type="radio" name="postalentry" id="postalentry0" value="0" <?php checked( 0, intval($postalentry)); ?> /> No
- <input type="radio" name="postalentry" id="postalentry1" value="1" <?php checked( 1, intval($postalentry)); ?> /> Yes
- </div>
- <div class="clear"></div>
- </div>
- <!--p><label for="postalentry">Postal Entry:</label><input class="input" type="text" id="postalentry" value="<?php echo $postalentry; ?>" name="postalentry" /></p-->
- <p><label for="checquepayableto">Cheques Payable To:</label><input class="input" type="text" id="checquepayableto" value="<?php echo $checquepayableto; ?>" name="checquepayableto" /></p>
- <p><label for="entryclosedate">Entry Close Date:</label><input class="input" type="text" id="entryclosedate" value="<?php echo $entryclosedate; ?>" name="entryclosedate" /> <span class="smallformlabel">Format: dd-mm-yyyy</span></p>
- <p><label for="entrylimit">Entry Limit:</label><input class="input" type="text" id="entrylimit" value="<?php echo $entrylimit; ?>" name="entrylimit" /></p>
- <p><label for="contact">Contact / Race Secretary:</label><input class="input" type="text" id="contact" value="<?php echo $contact; ?>" name="contact" /></p>
- <div class="childrenage_selectbox">
- <label for="toilets">Toilet?</label>
- <div class="formselectbox">
- <input type="radio" name="toilets" id="toilets0" value="0" <?php checked( 0, intval($toilets)); ?> /> No
- <input type="radio" name="toilets" id="toilets1" value="1" <?php checked( 1, intval($toilets)); ?> /> Yes
- </div>
- <div class="clear"></div>
- </div>
- <div class="childrenage_selectbox">
- <label for="changingfacility">Changing Facilities?</label>
- <div class="formselectbox">
- <input type="radio" name="changingfacility" id="changingfacility0" value="0" <?php checked( 0, intval($changingfacility)); ?> /> No
- <input type="radio" name="changingfacility" id="changingfacility1" value="1" <?php checked( 1, intval($changingfacility)); ?> /> Yes
- </div>
- <div class="clear"></div>
- </div>
- <div class="childrenage_selectbox">
- <label for="waterstation">Water Stations?</label>
- <div class="formselectbox">
- <input type="radio" name="waterstation" id="waterstation0" value="0" <?php checked( 0, intval($waterstation)); ?> /> No
- <input type="radio" name="waterstation" id="waterstation1" value="1" <?php checked( 1, intval($waterstation)); ?> /> Yes
- </div>
- <div class="clear"></div>
- </div>
- <div class="childrenage_selectbox">
- <label>Awards / Prizes: </label>
- <div class="formselectbox">
- <ul class="nonbulletlist">
- <?php
- wp_terms_checklist($raceid, array( 'taxonomy' => 'awards') );
- ?>
- </ul>
- </div>
- <div class="clear"></div>
- </div>
- <p><label for="recaptcha">Hope you are Human:</label>
- <?php echo recaptcha_get_html($recaptcha_publickey, $recaptcha_error); ?>
- </p>
- <?php
- if($raceid != 0):
- $submit_title = 'Edit Race';
- ?>
- <?php wp_nonce_field( 'newjobpostid'.$raceid.'_'.$user_ID); ?>
- <input type="hidden" name="mode" value="postupdate" />
- <input type="hidden" name="raceid" value="<?php echo esc_attr($raceid); ?>" />
- <?php else: ?>
- <?php wp_nonce_field( 'newjobpostby'.$user_ID ); ?>
- <input type="hidden" name="mode" value="newpost" />
- <?php endif; ?>
- <input type="hidden" name="user_id" id="user_id" value="<?php echo esc_attr($user_ID); ?>" />
- <p class="submit jobsubmit"><input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="<?php echo $submit_title; ?>" tabindex="100" /></p>
- </form>
- <script type="text/javascript">
- jQuery(window).load(function() {
- jQuery("#startdate").datepick({dateFormat: 'dd-mm-yyyy'});
- jQuery("#entryclosedate").datepick({dateFormat: 'dd-mm-yyyy'});
- });
- /*
- $ = jQuery;
- $("h3.widget-ftitle").click(function(){
- handle = this;
- $(this).next("div.widget-content").toggle("slow", function(){
- //alert("hello");
- if($(handle).hasClass("widget-ftitle2")){
- $(handle).removeClass('widget-ftitle2');
- }else{
- $(handle).addClass('widget-ftitle2');
- }
- });
- });
- */
- </script>
- <div class="clear"></div>
- </div><!-- .entry-content -->
- </div><!-- #post-## -->
- <?php endwhile; // end of the loop. ?>
- </div><!-- #content -->
- </div><!-- #container -->
- <?php get_sidebar(); ?>
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement