SIGE MANAGER"; // General check for user permissions. if (!current_user_can('manage_options')) { wp_die( __('You do not have sufficient pilchards to access this page.') ); } // Start building the page echo '
'; echo '

Incrições

'; //Menu de Opções
// Check whether the button has been pressed AND also check the nonce if (isset($_POST['test_button']) && check_admin_referer('test_button_clicked')) { // the button has been pressed AND we've passed the security check test_button_action(); } echo '
'; // this is a WordPress security feature - see: https://codex.wordpress.org/WordPress_Nonces wp_nonce_field('test_button_clicked'); echo ''; submit_button('Lista de Inscritos'); echo '
'; echo '
'; } function test_button_action() { echo '

' .'The "Lista de Inscritos" button was clicked.' . '

'; echo "Call Function button clicked" ; // Add Lisa's user id, 14, in an array. $exclude_list = array( 14 ); $args = array( 'role' => 'mini1', 'exclude' => $exclude_list ); // Custom query. $my_user_query = new WP_User_Query( $args ); // Get query results. $editors = $my_user_query->get_results(); // Check for editors if ( ! empty( $editors ) ) { echo ''; } else { // Display "no editors found" message. echo __( 'No editors found!', 'tutsplus' ); } global $wpdb; //$results = get_all_tables_names('arzam_posts'); //$results =get_some_data( 'gabrieldietzsch@gmail.com' ); $results = get_all_emails(); //global $wpdb; //$results = $wpdb->tables(); // Loop over editors. foreach ( $results as $res ) { // Get each editor's data. //$editor_info = get_userdata( $editor->ID ); //var_dump($res); echo $res->value . '
'; //print_r($res); //echo '
'; //$properties = get_object_vars($res); //print_r($properties); // Show editor's name. //echo '
  • ' . $editor_info->display_name . '
  • '; } } function get_some_data( $value ){ global $wpdb; $sql = $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}cf7_vdata_entry WHERE value = %s ", $value ); return $wpdb->get_results( $sql ); } function get_all_tables_names($value ){ global $wpdb; $sql = $wpdb->prepare("SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = %s", $value); return $wpdb->get_results( $sql ); } function get_all_emails(){ global $wpdb; $sql = "SELECT * FROM {$wpdb->prefix}cf7_vdata_entry WHERE cf7_id = 4745 AND NAME ='email'\n" . "ORDER BY `arzam_cf7_vdata_entry`.`cf7_id` ASC;"; return $wpdb->get_results( $sql ); } ?>