Просмотр файла admin/admin_shop_sites.php

Размер файла: 1.88Kb
  1. <?php
  2. /***************************************************************************
  3. * mides.ru
  4. * -------------------
  5. ***************************************************************************/
  6. define('IN_PHPBB', true);
  7.  
  8. if( !empty($setmodules) )
  9. {
  10. $file = basename(__FILE__);
  11. $module['Магазин']['Модерация купленной рекламы'] = $file;
  12. return;
  13. }
  14.  
  15. $phpbb_root_path = '../';
  16. require($phpbb_root_path . 'extension.inc');
  17. require('./pagestart.' . $phpEx);
  18.  
  19. $template->set_filenames(array(
  20. 'body' => 'admin/admin_shop_sites.tpl')
  21. );
  22.  
  23. if ( isset($HTTP_GET_VARS['delete']) )
  24. {
  25. $id = intval($HTTP_GET_VARS['id']);
  26.  
  27. $sql = "DELETE FROM ".$table_prefix."shop_sites
  28. WHERE id = '$id'";
  29. if ( !$result = $db->sql_query($sql) )
  30. {
  31. message_die(GENERAL_MESSAGE, 'Не удалось удалить ссылку');
  32. }
  33. message_die(GENERAL_MESSAGE, 'Ссылка удалена');
  34. } else {
  35.  
  36. $sql = "SELECT *
  37. FROM ".$table_prefix."shop_sites
  38. ORDER BY id ASC";
  39. if( !($result = $db->sql_query($sql)) )
  40. {
  41. message_die(GENERAL_ERROR, 'Could not query users', '', __LINE__, __FILE__, $sql);
  42. }
  43.  
  44. if ( $row = $db->sql_fetchrow($result) )
  45. {
  46. $i = 0;
  47. do
  48. {
  49. $url = $row['site_url'];
  50. $nazvanie = $row['site_desc'];
  51. $time = create_date('G:i, d M Y', $row['site_time'], $board_config['board_timezone']);
  52. $id = $row['id'];
  53.  
  54. $template->assign_block_vars('memberrow', array(
  55. 'URL' => $url,
  56. 'NAZVANIE' => $nazvanie,
  57. 'TIME' => $time,
  58. 'U_DEL' => append_sid("admin_shop_sites.$phpEx?delete&amp;id=$id"))
  59. );
  60.  
  61. $i++;
  62. }
  63. while ( $row = $db->sql_fetchrow($result) );
  64. $db->sql_freeresult($result);
  65. } else {
  66. $template->assign_block_vars('no_pay', array() );
  67. }
  68.  
  69. $template->pparse('body');
  70. }
  71. include('./page_footer_admin.'.$phpEx);
  72.  
  73. ?>