// add this to function.php
add_action( 'admin_menu', 'register_my_custom_menu_page' );
function register_my_custom_menu_page(){
// $img = get_template_directory_uri().'/images/transection.png';
$img = 'https://www.khokhamobile.com/mobile/icons/payment-icon.png';
//$img = 'http://rajasthantravelguru.com/test/carrental/wp-content/uploads/2015/12/payment-icon.png';
add_menu_page( 'custom menu title', 'Transactions ', 'manage_options', 'Transactions', 'my_custom_menu_page', 'dashicons-cart', 6 );
}
function my_custom_menu_page(){
global $wpdb;
echo '<div class="wrap"><div id="icon-tools" class="icon32"></div>';
echo '<h2 style="text-align:center">Transaction Details </h2>';
echo '</div>';
$myrows = $wpdb->get_results( " select * from transaction_table" );
echo ' <table class="table" ><tr style="text-align:center"> <th>Sr No.</th> <th>Name</th> <th> Email </th> <th> Product Name </th> <th> Mobile </th> <th> Company </th> <th> Join Vanpac </th> <th> Price </th> <th> Transaction Status </th> </tr> ';
$i=1;
foreach($myrows as $data)
{
echo '<tr>';
echo '<td> '.$i++.'</td>';
echo '<td>'.$data->user_name.'</td>';
echo '<td>'.$data->email.'</td>';
echo '<td>'.$data->product_name.'</td>';
echo '<td>'.$data->mobile.'</td>';
echo '<td>'.$data->company.'</td>';
echo '<td>'.$data->vanpac.'</td>';
echo '<td style="text-align:center">'.$data->total.'</td>';
echo '<td style="text-align:center">'.$data->success_status.'</td>';
echo '</tr>'; ;
}
echo '</table>';
}
Comments
Post a Comment