PageRenderTime 54ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/NukeViet3.2/modules/shops/admin/order.php

http://nuke-viet.googlecode.com/
PHP | 94 lines | 80 code | 5 blank | 9 comment | 12 complexity | 8fc7879c506f5f451c02b6e3e80ad26c MD5 | raw file
Possible License(s): BSD-3-Clause, LGPL-2.1, GPL-2.0
  1. <?php
  2. /**
  3. * @Project NUKEVIET 3.0
  4. * @Author VINADES.,JSC (contact@vinades.vn)
  5. * @Copyright (C) 2010 VINADES.,JSC. All rights reserved
  6. * @Createdate 2-9-2010 14:43
  7. */
  8. if ( ! defined( 'NV_IS_FILE_ADMIN' ) ) die( 'Stop!!!' );
  9. $page_title = $lang_module['order_title'];
  10. $table_name = $db_config['prefix'] . "_" . $module_data . "_orders";
  11. $xtpl = new XTemplate( "order.tpl", NV_ROOTDIR . "/themes/" . $global_config['module_theme'] . "/modules/" . $module_file );
  12. $xtpl->assign( 'LANG', $lang_module );
  13. //////////////////////////////////////////////////////
  14. $per_page = 20;
  15. $page = $nv_Request->get_int( 'page', 'get', 0 );
  16. $base_url = NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=" . $op;
  17. $count = 0;
  18. $sql = "SELECT SQL_CALC_FOUND_ROWS * FROM `" . $table_name . "` ORDER BY order_id DESC LIMIT " . $page . "," . $per_page;
  19. $result = $db->sql_query( $sql );
  20. $result_all = $db->sql_query( "SELECT FOUND_ROWS()" );
  21. list( $numf ) = $db->sql_fetchrow( $result_all );
  22. $all_page = ( $numf ) ? $numf : 1;
  23. while ( $row = $db->sql_fetchrow( $result ) )
  24. {
  25. $acno = 0;
  26. if ( $row['transaction_status'] == 4 )
  27. {
  28. $row['status_payment'] = $lang_module['history_payment_yes'];
  29. }
  30. elseif ( $row['transaction_status'] == 3 )
  31. {
  32. $row['status_payment'] = $lang_module['history_payment_cancel'];
  33. }
  34. elseif ( $row['transaction_status'] == 2 )
  35. {
  36. $row['status_payment'] = $lang_module['history_payment_check'];
  37. }
  38. elseif ( $row['transaction_status'] == 1 )
  39. {
  40. $row['status_payment'] = $lang_module['history_payment_send'];
  41. }
  42. elseif ( $row['transaction_status'] == 0 )
  43. {
  44. $row['status_payment'] = $lang_module['history_payment_no'];
  45. }
  46. elseif ( $row['transaction_status'] == - 1 )
  47. {
  48. $row['status_payment'] = $lang_module['history_payment_wait'];
  49. }
  50. else
  51. {
  52. $row['status_payment'] = "ERROR";
  53. }
  54. $row['link_user'] = NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=users&" . NV_OP_VARIABLE . "=edit&userid=" . $row['user_id'];
  55. $row['order_time'] = nv_date( "H:i d/m/y", $row['order_time'] );
  56. $row['order_total'] = FormatNumber( $row['order_total'], 2, '.', ',' );
  57. $xtpl->assign( 'DATA', $row );
  58. $xtpl->assign( 'order_id', $row['order_id'] . "_" . md5( $row['order_id'] . $global_config['sitekey'] . session_id() ) );
  59. $xtpl->assign( 'link_view', NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=or_view&order_id=" . $row['order_id'] );
  60. if ( $row['transaction_status'] < 1 )
  61. {
  62. $xtpl->assign( 'link_del', NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=or_del&order_id=" . $row['order_id'] . "&checkss=" . md5( $row['order_id'] . $global_config['sitekey'] . session_id() ) );
  63. $xtpl->parse( 'main.data.row.delete' );
  64. $xtpl->assign( 'DIS', '' );
  65. }
  66. else
  67. {
  68. $xtpl->assign( 'DIS', 'disabled="disabled"' );
  69. }
  70. $bg = ( $count % 2 == 0 ) ? "class=\"second\"" : "";
  71. $bgview = ( $row['view'] == '0' ) ? "class=\"bgview\"" : "";
  72. $xtpl->assign( 'bg', $bg );
  73. $xtpl->assign( 'bgview', $bgview );
  74. $xtpl->parse( 'main.data.row' );
  75. $count ++;
  76. }
  77. $xtpl->assign( 'URL_CHECK_PAYMENT', NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=checkpayment" );
  78. $xtpl->assign( 'URL_DEL', NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=or_del" );
  79. $xtpl->assign( 'URL_DEL_BACK', NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=" . $op );
  80. ///////////////////////////////////////
  81. $xtpl->assign( 'PAGES', nv_generate_page( $base_url, $all_page, $per_page, $page ) );
  82. $xtpl->parse( 'main.data' );
  83. /////////////////////////////////////////////////////////////
  84. $xtpl->parse( 'main' );
  85. $contents .= $xtpl->text( 'main' );
  86. include ( NV_ROOTDIR . "/includes/header.php" );
  87. echo nv_admin_theme( $contents );
  88. include ( NV_ROOTDIR . "/includes/footer.php" );
  89. ?>