Skip to main content

show payment data in table on amenu to admin panel


// 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

Popular posts from this blog

High light Search Result In Wordpress

High light Search Result In Wordpress add this function in your themes function.php function highlight_results ( $ text ) {      if ( is_search ( ) ) { $ keys = implode ( '|' , explode ( ' ' , get_search_query ( ) ) ) ; $ text = preg_replace ( '/(' . $ keys . ')/iu' , '<span class="search-highlight">\0</span>' , $ text ) ;      }      return $ text ; } add_filter ( 'the_content' , 'highlight_results' ) ; add_filter ( 'the_excerpt' , 'highlight_results' ) ; add_filter ( 'the_title' , 'highlight_results' ) ;   function highlight_results_css ( ) { ? > <style> .search-highlight { background-color : #FF0 ; font-weight : bold ; } </style> < ? php } add_action ( 'wp_head' , 'highlight_results_css' ) ;

Redirect In contact form 7

add_action( 'wp_footer' , 'redirect_cf7' ); function redirect_cf7() { ?> < script type = "text/javascript" > document.addEventListener( 'wpcf7mailsent' , function ( event ) { if ( '1377' == event.detail.contactFormId ) { // Sends sumissions on form 947 to the first thank you page location = 'https://www.panelesyceldassolares.com/regreso' ; } else { // Sends submissions on all unaccounted for forms to the third thank you page location = 'https://www.panelesyceldassolares.com/regreso-2/' ; } }, false ); </ script > <?php }

Get Single Product By ID in Opencart

<?php if(!empty($_POST["country_id"])) {     $query ="SELECT * FROM oc_product WHERE product_id = '" . $_POST["country_id"] . "'";     $results = $this->db->query($query);   $query2 ="SELECT * FROM oc_product_description WHERE product_id = '" . $_POST["country_id"] . "'";   $results2 = $this->db->query($query2);   $rowresults2 = $results2->row;   $rowresults = $results->row;   $name1 = $rowresults['model'];   $name2 = $rowresults2['name'];   $name3 = $rowresults['price'];   $name4 = 'Exe.' ?>