function view_etries(){ global $wpdb; echo "<div class='contact-admin'>"; echo "<h1>Form Entries</h1>"; $mainTable = $wpdb->prefix . "contact_table"; @$query = $wpdb->prepare("SELECT * FROM $mainTable WHERE %d >= '0'", RID); $entries_forms = $wpdb->get_results($query); echo "<table class='table table-bordered' style='width: 100%; text-align: left;'> <thead> <tr> <th>Page Name</th> <th>Name</th> <th>Email</th> <th>Phone</th> <th style='display:none;'>Home Select</th> <th style='display:none;'>Price</th> <th>Select Builder</th> <th>Comment</th> <th>Newsletter Subscribe?</th> </tr> </thead>"; foreach ( $entries_forms as $entries_form ) { if($entries_form->newsletter=='on'){ $newsletter = 'Yes'; }else{ $newsletter = 'No'; } echo "<tr><td>$entries_form->page_name</td><td>$entries_form->title_name $entries_form->full_name</td><td>$entries_form->email</td><td>$entries_form->phone</td><td style='display:none;'>$entries_form->home_select</td><td style='display:none;'>$entries_form->home_price</td><td>$entries_form->selected_builder</td><td>$entries_form->comment</td><td>$newsletter</td></tr>"; //echo $entries_form->id . " " . $entries_form->name . " " . $entries_form->email . " " . $entries_form->phone . " " . $entries_form->comment . "<br/>"; } echo "</table></div>"; }
Jagdish Sarma Asked question August 4, 2021