View file admin/admin_shop_sites.php

File size: 1.88Kb
<?php
/***************************************************************************
 *                                mides.ru
 *                            -------------------
 ***************************************************************************/
define('IN_PHPBB', true);

if( !empty($setmodules) )
{
	$file = basename(__FILE__);
	$module['Магазин']['Модерация купленной рекламы'] = $file;
	return;
}

$phpbb_root_path = '../';
require($phpbb_root_path . 'extension.inc');
require('./pagestart.' . $phpEx);

$template->set_filenames(array(
	'body' => 'admin/admin_shop_sites.tpl')
);

if ( isset($HTTP_GET_VARS['delete']) )
{
	$id = intval($HTTP_GET_VARS['id']);

	$sql = "DELETE FROM ".$table_prefix."shop_sites
		WHERE id = '$id'";
	if ( !$result = $db->sql_query($sql) )
	{
		message_die(GENERAL_MESSAGE, 'Не удалось удалить ссылку');
	}
	message_die(GENERAL_MESSAGE, 'Ссылка удалена');
} else {

	$sql = "SELECT * 
		FROM ".$table_prefix."shop_sites
		ORDER BY id ASC";
	if( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Could not query users', '', __LINE__, __FILE__, $sql);
	}

	if ( $row = $db->sql_fetchrow($result) )
	{
		$i = 0;
		do
		{
			$url = $row['site_url'];
			$nazvanie = $row['site_desc'];
			$time = create_date('G:i, d M Y', $row['site_time'], $board_config['board_timezone']);
			$id = $row['id'];

			$template->assign_block_vars('memberrow', array(
				'URL' => $url,
				'NAZVANIE' => $nazvanie,
				'TIME' => $time,
				'U_DEL' => append_sid("admin_shop_sites.$phpEx?delete&amp;id=$id"))
			);

			$i++;
		}
		while ( $row = $db->sql_fetchrow($result) );
		$db->sql_freeresult($result);
	} else {
		$template->assign_block_vars('no_pay', array() );
	}

	$template->pparse('body');
}
include('./page_footer_admin.'.$phpEx);

?>