SHARE
TWEET

Untitled

a guest Mar 7th, 2012 511 Never
  1. function createbox(){
  2.  
  3. global $wpdb;
  4. $tablenom = $wpdb->prefix . 'cf7dbplugin_submits';
  5. $requete = "SELECT submit_time, field_value, STR_TO_DATE(field_value, '%d/%m/%Y') AS dtFormat FROM wp_cf7dbplugin_submits WHERE form_name = 'infoCo Configuration' AND field_name = 'date-reunion' ORDER BY dtFormat DESC";
  6. $field = $wpdb->get_results( $requete );
  7. $output99 = '<select name="lstdate" id="fleet" onchange="document.getElementById(\'fleet\').value=this.value;"><option></option>';
  8. foreach ( $field as $ligne ) {
  9.        
  10.         $output99 .= "<option value=\"$ligne->submit_time\"> $ligne->field_value </option>";
  11.                
  12.         }
  13. $output99 .= "</select>";
  14. return $output99;      
  15. }
  16.  
  17. $content = do_shortcode( $post->post_content );
  18. $fleet_selector = createbox();
  19. $new_content = str_replace('[autoselectfleet]', $fleet_selector, $content);
RAW Paste Data
Top