adtype_main.php
1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
/**
* 友情链接类型
*
* @version $Id: friendlink_type.php 1 8:48 2010年7月13日Z tianya $
* @package DedeCMS.Administrator
* @copyright Copyright (c) 2007 - 2010, DesDev, Inc.
* @license http://help.dedecms.com/usersguide/license.html
* @link http://www.dedecms.com
*/
require_once(dirname(__FILE__)."/config.php");
if(empty($dopost)) $dopost = '';
//保存更改
if($dopost=="save")
{
$startID = 1;
$endID = $idend;
for(;$startID<=$endID;$startID++)
{
$query = '';
$tid = ${'ID_'.$startID};
$pname = ${'pname_'.$startID};
if(isset(${'check_'.$startID}))
{
if($pname!='')
{
$query = "UPDATE `#@__myadtypee` SET typename='$pname' WHERE id='$tid' ";
$dsql->ExecuteNoneQuery($query);
}
}
else
{
$query = "DELETE FROM `#@__myadtype` WHERE id='$tid' ";
$dsql->ExecuteNoneQuery($query);
}
}
//增加新记录
if(isset($check_new) && $pname_new!='')
{
$query = "INSERT INTO `#@__myadtype`(typename) VALUES('{$pname_new}');";
$dsql->ExecuteNoneQuery($query);
}
header("Content-Type: text/html; charset={$cfg_soft_lang}");
ShowMsg("成功更新广告分类列表!", 'adtype_main.php');
exit;
}
include DedeInclude('templets/adtype_main.htm');