Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Mar 7th, 2012  |  syntax: PHP  |  size: 0.81 KB  |  views: 269  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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);