Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!--</pre> -->
- <form>
- <form method="post" action="" >
- <input type="text" placeholder="Search Transactions.." name="search">
- <input type="submit" class="button-primary" value="Search" name="submit">
- <input type="reset" class="button-primary" value="Reset Form">
- </form>
- <?php
- if(isset($_POST['submit']) && !empty($_POST['submit'])) {
- // there is something in the field, do stuff
- $search = $_POST["search"];
- return_esb_searches ();
- echo "searching";
- } else {
- // trigger normal results
- all_esb_results ();
- echo "showing normal results display without search";
- }
- ?>
- <?php function all_esb_results ()
- { ?>
- <div style='width:1480px; position:relative; padding:15px; background-color:#DDDDDD;'>
- <table border="1">
- <tr>
- <th>First Name</th>
- <th>Last Name</th>
- <th>Buyer's Email Address</th>
- <th>Software Title</th>
- <th>IP Address 01</th>
- <th>IP Address 02</th>
- <th>Payment Status</th>
- </tr>
- <?php
- global $wpdb,$search;
- $ipn_tables = $wpdb->prefix ."ipn_data_tbl";
- // $result = $wpdb->get_results ( "SELECT * FROM $ipn_tables" );
- $result = $wpdb->get_results($wpdb->prepare("SELECT * FROM {$ipn_tables}"));
- foreach ( $result as $print )
- {
- ?>
- <tr>
- <td><?php echo $print->first_name;?></td>
- <td><?php echo $print->last_name;?></td>
- <td><?php echo $print->payer_email;?></td>
- <td><?php echo $print->item_name;?></td>
- <td><?php echo $print->ip_address_01;?></td>
- <td><?php echo $print->ip_address_02;?></td>
- <td><?php echo $print->payment_status;?></td>
- </tr>
- <?php } ?>
- </table>
- </div>
- <?php } ?>
- <?php function return_esb_searches ()
- { ?>
- <div style='width:1480px; position:relative; padding:15px; background-color:#DDDDDD;'>
- <table border="1">
- <tr>
- <th>First Name</th>
- <th>Last Name</th>
- <th>Buyer's Email Address</th>
- <th>Software Title</th>
- <th>IP Address 01</th>
- <th>IP Address 02</th>
- <th>Payment Status</th>
- </tr>
- <?php
- global $wpdb,$search;
- $ipn_tables = $wpdb->prefix ."ipn_data_tbl";
- $result = $wpdb->get_results($wpdb->prepare("SELECT * FROM {$ipn_tables} WHERE item_name like $search OR first_name like $search OR last_name like $search OR payer_email like $search" ));
- //HERE item_name = %s AND payer_email = %s", $product, $serial));
- foreach ( $result as $print )
- {
- ?>
- <tr>
- <td><?php echo $print->first_name;?></td>
- <td><?php echo $print->last_name;?></td>
- <td><?php echo $print->payer_email;?></td>
- <td><?php echo $print->item_name;?></td>
- <td><?php echo $print->ip_address_01;?></td>
- <td><?php echo $print->ip_address_02;?></td>
- <td><?php echo $print->payment_status;?></td>
- </tr>
- <?php } ?>
- </table>
- </div>
- <?php } ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement