<?php
require(dirname(__FILE__) .'/check.php');
$skin->CheckIframe();


/* **** 版权所有 ****

 程序开发：网钛科技
 网钛CMS官网：http://otcms.com
 网钛IDC官网：http://idccms.com
 ＱＱ：877873666
 微信：QQ877873666
 邮箱：877873666@qq.com

 **** 版权所有 **** */


//打开用户表，并检测用户是否登录
$MB->Open('','login');

$skin->WebTop();


echo('
<script language="javascript" type="text/javascript" src="js/inc/list.js?v='. OT_VERSION .'"></script>
<script language="javascript" type="text/javascript" src="js/idcProType.js?v='. OT_VERSION .'"></script>
');


switch ($mudi){
	case 'add':
		$MB->IsSecMenuRight('alertBack',93,$dataType);
		AddOrRev();
		break;

	case 'rev':
		$MB->IsSecMenuRight('alertBack',94,$dataType);
		AddOrRev();
		break;

	case 'manage':
		$MB->IsSecMenuRight('alertBack',92,$dataType);
		manage();
		break;

	default:
		die('err');
}

$skin->WebBottom();

$MB->Close();
$DB->Close();





// 新增、修改
function AddOrRev(){
	global $DB,$MB,$skin,$mudi,$dataType,$dataTypeCN,$systemArr;

	$dataMode		= OT::GetStr('dataMode');
	$dataModeStr	= OT::GetStr('dataModeStr');
	$backURL		= OT::GetStr('backURL');
	$dataID			= OT::GetInt('dataID');
	
	if ($mudi == 'rev'){
		$revexe=$DB->query('select * from '. OT_dbPref .'idcProType where IPT_ID='. $dataID);
			if (! $row = $revexe->fetch()){
				JS::AlertBackEnd('无该记录！');		
			}
		$IPT_ID				= $row['IPT_ID'];
		$IPT_level			= $row['IPT_level'];
		$IPT_fatID			= $row['IPT_fatID'];
		$IPT_theme			= $row['IPT_theme'];
		$IPT_themeStyle		= $row['IPT_themeStyle'];
		$IPT_webKey			= $row['IPT_webKey'];
		$IPT_webDesc		= $row['IPT_webDesc'];
		$IPT_mode			= $row['IPT_mode'];
		$IPT_template		= $row['IPT_template'];
		$IPT_templateWap	= $row['IPT_templateWap'];
		$IPT_isHome			= $row['IPT_isHome'];
		$IPT_homeColor		= $row['IPT_homeColor'];
		$IPT_homeNum		= $row['IPT_homeNum'];
		$IPT_isHomeWap		= $row['IPT_isHomeWap'];
		$IPT_homeWapNum		= $row['IPT_homeWapNum'];
		$IPT_fieldNum		= $row['IPT_fieldNum'];
		$IPT_fieldStr		= $row['IPT_fieldStr'];
		$IPT_priceType		= $row['IPT_priceType'];
		$IPT_tixing			= $row['IPT_tixing'];
		$IPT_note			= $row['IPT_note'];
		$IPT_htmlName		= $row['IPT_htmlName'];
		$IPT_rank			= $row['IPT_rank'];
		$IPT_state			= $row['IPT_state'];
		$IPT_wapState		= $row['IPT_wapState'];
		unset($revexe);
		$mudiCN='修改';
	}else{
		if ($dataID > 0){
			$revexe=$DB->query('select * from '. OT_dbPref .'idcProType where IPT_ID='. $dataID);
				if (! $row = $revexe->fetch()){
					JS::AlertBackEnd('无该记录！');		
				}
			$IPT_ID			= $row['IPT_ID'];
			$IPT_level		= $row['IPT_level'];
			$IPT_fatID		= $row['IPT_fatID'];
			$IPT_theme		= $row['IPT_theme'];
			$IPT_themeStyle	= $row['IPT_themeStyle'];
			$IPT_webKey		= $row['IPT_webKey'];
			$IPT_webDesc	= $row['IPT_webDesc'];
			$IPT_mode		= $row['IPT_mode'];
			$IPT_template	= $row['IPT_template'];
			$IPT_templateWap= $row['IPT_templateWap'];
			$IPT_isHome		= $row['IPT_isHome'];
			$IPT_homeColor	= $row['IPT_homeColor'];
			$IPT_homeNum	= $row['IPT_homeNum'];
			$IPT_isHomeWap	= $row['IPT_isHomeWap'];
			$IPT_homeWapNum	= $row['IPT_homeWapNum'];
			$IPT_fieldNum	= $row['IPT_fieldNum'];
			$IPT_fieldStr	= $row['IPT_fieldStr'];
			$IPT_priceType	= $row['IPT_priceType'];
			$IPT_tixing		= $row['IPT_tixing'];
			$IPT_note		= $row['IPT_note'];
			unset($revexe);
			$dataID = 0;
		}else{
			$IPT_ID			= 0;
			$IPT_fatID		= 0;
			$IPT_theme		= '';
			$IPT_themeStyle	= '';
			$IPT_webKey		= '';
			$IPT_webDesc	= '';
			$IPT_mode		= 0;
			$IPT_template	= '';
			$IPT_templateWap= '';
			$IPT_isHome		= 1;
			$IPT_homeColor	= '';
			$IPT_homeNum	= 10;
			$IPT_isHomeWap	= 1;
			$IPT_homeWapNum	= 10;
			$IPT_fieldNum	= 5;
			$IPT_fieldStr	= '';
			$IPT_priceType	= '';
			$IPT_tixing		= '';
			$IPT_note		= '';
		}
		$IPT_htmlName	= '';
		$IPT_rank			= intval($DB->GetOne('select max(IPT_rank) from '. OT_dbPref .'idcProType')) + 10;
		$IPT_state			= 1;
		$IPT_wapState		= 1;
		$mudiCN='添加';
	}

	$themeStyle_color	= Str::GetMark($IPT_themeStyle,'color:',';');
	$themeStyle_b		= Str::GetMark($IPT_themeStyle,'font-weight:',';');


	echo('
	<form id="dealForm" name="dealForm" method="post" action="idcProType_deal.php?mudi='. $mudi .'&nohrefStr=close" onsubmit="return CheckForm()">
	<input type="hidden" id="dataID" name="dataID" value="'. $dataID .'" />
	<input type="hidden" id="dataTypeCN" name="dataTypeCN" value="'. $dataTypeCN .'" />
	<input type="hidden" id="dataType" name="dataType" value="'. $dataType .'" />
	<input type="hidden" id="dataMode" name="dataMode" value="'. $dataMode .'" />
	<input type="hidden" id="dataModeStr" name="dataModeStr" value="'. $dataModeStr .'" />
	'. Area::BackUrlInput($backURL) .'
	');

	$fieldArr = explode('<arr>', $IPT_fieldStr .'<arr><arr><arr><arr><arr><arr><arr><arr><arr><arr><arr><arr>');
	$fieldNum = count(array_filter($fieldArr));
	$fieldOption = $fieldList = '';
	for ($i=1; $i<=12; $i++){
		$itemArr = explode('|', $fieldArr[$i-1] .'||||||');
		$fieldOption .= '<option value="'. $i .'" '. Is::Selected($fieldNum,$i) .'>'. $i .'</option>';
		$fieldList .= '
			<div id="fieldBox'. $i .'" style="padding-top:6px;line-height:2;display:none;">
				字段'. $i .'：
				<label><input type="checkbox" id="fieldJud'. $i .'" name="fieldJud'. $i .'" value="1" '. Is::Checked(strlen($itemArr[0])==0 ? 1 : $itemArr[0],1) .' />开启</label>&ensp;&ensp;
				名称：<input type="text" id="fieldName'. $i .'" name="fieldName'. $i .'" size="50" style="width:100px;" value="'. $itemArr[1] .'" />&ensp;&ensp;
				颜色：<input type="text" id="fieldColor'. $i .'" name="fieldColor'. $i .'" style="width:52px;" value="'. $itemArr[2] .'" />'. Skin::ColorBox('input','fieldColor'. $i,'fieldName'. $i) .'&ensp;&ensp;
				<label><input type="checkbox" id="fieldHome'. $i .'" name="fieldHome'. $i .'" value="1" '. Is::Checked(strlen($itemArr[3])==0 ? 1 : $itemArr[3],1) .' />首页</label>&ensp;&ensp;
				排序：<input type="text" id="fieldRank'. $i .'" name="fieldRank'. $i .'" size="50" style="width:50px;" value="'. ($itemArr[4]==0 ? $i*10 : $itemArr[4]) .'" />&ensp;&ensp;
				宽度：<input type="text" id="fieldWidth'. $i .'" name="fieldWidth'. $i .'" size="50" style="width:40px;" value="'. ($itemArr[5]==0 ? '' : $itemArr[5]) .'" /> %&ensp;&ensp;
				<select id="fieldAlign'. $i .'" name="fieldAlign'. $i .'">
					<option value="center" '. Is::Selected($itemArr[6],'center') .'>居中</option>
					<option value="left" '. Is::Selected($itemArr[6],'left') .'>左对齐</option>
					<option value="right" '. Is::Selected($itemArr[6],'right') .'>右对齐</option>
				</select>
			</div>
			';
	}

/*
		'. AppBase::idcProTypeTrBox2($IPT_template) .'
		'. AppWap::idcProTypeTrBox2($IPT_templateWap) .'
*/
	$skin->TableTop('share_'. $mudi .'.gif','',$mudiCN . $dataTypeCN);
		echo('
		<table width="98%" align="center" cellpadding="0" cellspacing="0" summary="" class="padd3">
		<tr>
			<td width="20%"></td>
			<td width="80%"></td>
		</tr>
		<tr>
			<td align="right">'. Skin::RedSign() .'类别名称：</td>
			<td align="left">
				<input type="text" id="theme" name="theme" size="50" style="width:400px;'. $IPT_themeStyle .'" value="'. $IPT_theme .'" />
				'. AppBase::infoTypeThemeB($themeStyle_b,$themeStyle_color) .'
			</td>
		</tr>
		<tr>
			<td align="right">类别所属：</td>
			<td align="left">
				<input type="hidden" id="oldFatID" name="oldFatID" value="'. $IPT_fatID .'" />
				<select id="fatID" name="fatID">
				<option value="">作为顶级分类</option>
				');
				$typeNum = 0;
				$typeexe=$DB->query('select * from '. OT_dbPref .'idcProType where IPT_level=1 order by IPT_rank ASC');
				while ($row = $typeexe->fetch()){
					$typeNum ++;
					echo('<option value="'. $row['IPT_ID'] .'" '. Is::Selected($row['IPT_ID'],$IPT_fatID) .'>'. $typeNum .'、'. $row['IPT_theme'] .'</option>');
				
				}
				unset($typeexe);
				echo('
				</select>
			</td>
		</tr>
		<tr>
			<td align="right" valign="top" style="padding-top:6px;">
				网页关键字(Keywords)：<br />
				<span class="font2_2">（便于搜索引擎搜到）</span>
			</td>
			<td align="left"><textarea id="webKey" name="webKey" rows="5" cols="40" style="width:400px; height:60px;">'. $IPT_webKey .'</textarea>&ensp;'. $skin->TishiBox('多个用英文逗号“,”隔开') .'</td>
		</tr>
		<tr>
			<td align="right" valign="top" style="padding-top:6px;">
				网页描述(Description)：<br />
				<span class="font2_2">（便于搜索引擎搜到）</span>
			</td>
			<td align="left"><textarea id="webDesc" name="webDesc" rows="5" cols="40" style="width:400px; height:60px;">'. $IPT_webDesc .'</textarea>&ensp;'. $skin->TishiBox('星号“*”表示使用网站关键字/描述') .'</td>
		</tr>
		<tr>
			<td align="right">类别页显示模式：</td>
			<td align="left" class="newsListImg">
				<label><input type="radio" id="mode_0" name="mode" value="0" '. Is::Checked($IPT_mode,0) .' />默认</label>&ensp;&ensp;
			</td>
		</tr>
		<tr>
			<td align="right">首页展示：</td>
			<td align="left">
				<label><input type="radio" id="isHome1" name="isHome" value="1" '. Is::Checked($IPT_isHome,1) .' onclick="CheckHomeItme()" />显示</label>&ensp;&ensp;&ensp;&ensp;
				<label><input type="radio" id="isHome0" name="isHome" value="0" '. Is::Checked($IPT_isHome,0) .' onclick="CheckHomeItme()" />隐藏</label>&ensp;&ensp;&ensp;&ensp;
			</td>
		</tr>
		<tr>
			<td align="right" class="font1_2d">首页展示标题颜色：</td>
			<td align="left"><input type="text" id="homeColor" name="homeColor" style="width:52px;" value="'. $IPT_homeColor .'" />'. Skin::ColorBox('input','homeColor','homeColor') .'</td>
		</tr>
		<tr style="display:none;">
			<td align="right" class="font1_2d">首页展示数量：</td>
			<td align="left"><input type="text" id="homeNum" name="homeNum" size="50" style="width:30px;" value="'. $IPT_homeNum .'" /></td>
		</tr>
		<tr>
			<td align="right">WAP首页展示：</td>
			<td align="left">
				<label><input type="radio" name="isHomeWap" value="1" '. Is::Checked($IPT_isHomeWap,1) .' />显示</label>&ensp;&ensp;&ensp;&ensp;
				<label><input type="radio" name="isHomeWap" value="0" '. Is::Checked($IPT_isHomeWap,0) .' />隐藏</label>&ensp;&ensp;&ensp;&ensp;
			</td>
		</tr>
		<tr style="display:none;">
			<td align="right" class="font1_2d">WAP首页展示数量：</td>
			<td align="left"><input type="text" id="homeWapNum" name="homeWapNum" size="50" style="width:30px;" value="'. $IPT_homeWapNum .'" /></td>
		</tr>
		<tr>
			<td align="right" valign="top" style="padding-top:6px;">字段：</td>
			<td align="left">
				<div>
					数量：<select id="fieldNum" name="fieldNum" onchange="CheckField();">
						<option value="0">0</option>
						'. $fieldOption .'
					</select>
					&ensp;&ensp;<input type="button" value="读取上级类别字段信息" onclick="LoadFieldInfo();" />
				</div>
				'. $fieldList .'
			</td>
		</tr>
		<tr>
			<td align="right">价格类型：</td>
			<td align="left">
				<select id="priceType" name="priceType">
					<option value=""></option>
					<option value="host1" '. Is::Selected($IPT_priceType,'host1') .'>虚拟主机（年付、原价）</option>
					<option value="vps1" '. Is::Selected($IPT_priceType,'vps1') .'>云服务器（月、季、半年、年付）</option>
					<option value="serv1" '. Is::Selected($IPT_priceType,'serv1') .'>独立服务器（月、季、半年、年付）</option>
				</select>
			</td>
		</tr>
		<tr>
			<td align="right" valign="top">友情提醒：</td>
			<td>
				<textarea id="tixing" name="tixing" cols="40" rows="4" style="width:510px;height:120px;" class="text" onclick=\'LoadEditor("tixing",510,120,"|miniMenu|");\' title="点击开启编辑器模式">'. Str::MoreReplace($IPT_tixing,'textarea') .'</textarea>
				<input type="hidden" id="upImgStr" name="upImgStr" value="" />
				<div><input type="button" onclick=\'OT_OpenUpImg("editor","tixing","","")\' value="上传图片载入编辑器" /></div>
			</td>
		</tr>
		<tr>
			<td align="right" valign="top" style="padding-top:6px;">备注：</td>
			<td align="left"><textarea id="note" name="note" rows="5" cols="40" style="width:400px; height:60px;">'. $IPT_note .'</textarea></td>
		</tr>
		<tr>
			<td align="right">静态页名：</td>
			<td align="left">
				<input type="hidden" id="htmlNameOld" name="htmlNameOld" value="'. $IPT_htmlName .'" />
				<input type="text" id="htmlName" name="htmlName" size="50" style="width:120px;ime-mode:disabled;" maxlength="25" value="'. $IPT_htmlName .'" onkeyup=\'if (this.value!=FiltAbcNum_d(this.value)){this.value=FiltAbcNum_d(this.value)}\' />
				<span class="font2_2">&ensp;仅限数字、字母、下划线，第一个字符必须是字母，如：<span style="color:red;">serv.html</span></span>
			</td>
		</tr>
		<tr>
			<td align="right">排序：</td>
			<td align="left"><input type="text" id="rank" name="rank" size="50" style="width:30px;" value="'. $IPT_rank .'" /></td>
		</tr>
		<tr>
			<td align="right">电脑版状态：</td>
			<td align="left">
				<label><input type="radio" name="state" value="1" '. Is::Checked($IPT_state,1) .' />显示</label>&ensp;&ensp;
				<label><input type="radio" name="state" value="0" '. Is::Checked($IPT_state,0) .' />隐藏</label>&ensp;&ensp;
			</td>
		</tr>
		<tr>
			<td align="right">手机版状态：</td>
			<td align="left">
				<label><input type="radio" name="wapState" value="1" '. Is::Checked($IPT_wapState,1) .' />显示</label>&ensp;&ensp;
				<label><input type="radio" name="wapState" value="0" '. Is::Checked($IPT_wapState,0) .' />隐藏</label>&ensp;&ensp;
			</td>
		</tr>
		</table>
		');
	$skin->TableBottom();

	echo('
	<table style="height:16px;" cellpadding="0" cellspacing="0" summary=""><tr><td></td></tr></table>

	<center><input type="image" src="'. AdmTpl::ImgSrc('button_'. $mudi) .'" /></center>

	</form>
	');

}



function manage(){
	global $DB,$MB,$skin,$mudi,$dataType,$dataTypeCN,$pageCount,$recordCount,$systemArr,$dbPathPart;

	echo('
	<div class="padd5">
		<input type="button" value="新增'. $dataTypeCN .'" onclick=\'document.location.href="?mudi=add&dataType='. $dataType .'&dataTypeCN='. urlencode($dataTypeCN) .'&backURL="+ encodeURIComponent(document.location.href)\' />&ensp;&ensp;
		<input type="button" id="idcProType2Btn" value="隐藏二级类别" onclick="CheckidcProType(2)" />
	</div>

	<form id="listForm" name="listForm" method="post" action="idcProType_deal.php?mudi=moreDel" onsubmit="return CheckListForm()">
	<script language="javascript" type="text/javascript">document.write (\'<input type="hidden" name="backURL" value="\'+ document.location.href +\'" />\')</script>
	<input type="hidden" name="dataType" value="'. $dataType .'" />
	<input type="hidden" name="dataTypeCN" value="'. $dataTypeCN .'" />
	');

	$skin->TableTop2('share_list.gif','',''. $dataTypeCN .'管理');
	$skin->TableItemTitle('3%,3%,16%,3%,4%,4%,5%,6%,9%,8%,4%,7%,8%','<input type="checkbox" id="selAll" name="selAll" onclick="CheckBoxAll()" />,ID号,名称,字段,模式,PC展示,WAP展示,HTML文件名,生成静态页,备注,排序,电脑/WAP状态,复制&ensp;修改&ensp;删除');

	$showNum = $type1Num = 0;
	$showexe=$DB->query('select * from '. OT_dbPref .'idcProType where IPT_level=1 order by IPT_rank ASC');
	while ($row = $showexe->fetch()){
		if ($showNum % 2 == 1){ $bgcolor='class="tabColorTr"'; }else{ $bgcolor=''; }
		$showNum ++;
		$type1Num ++;

		echo('
		<tbody class="tabBody padd3">
		<tr id="data'. $row['IPT_ID'] .'" '. $bgcolor .'>
			<td align="center" class="selCheckbox"><input type="checkbox" name="selDataID[]" value="'. $row['IPT_ID'] .'" /></td>
			<td align="center">'. $row['IPT_ID'] .'</td>
			<td align="left">'. $type1Num .'、<span style="'. $row['IPT_themeStyle'] .'">'. $row['IPT_theme'] .'</span>&ensp;<span id="idcProType'. $row['IPT_ID'] .'" class="font2_2"></span></td>
			<td align="center">'. $row['IPT_fieldNum'] .'</td>
			<td align="center">'. ModeCN($row['IPT_mode']) .'</td>
			<td align="center">'. Adm::SwitchBtn('idcProType',$row['IPT_ID'],$row['IPT_isHome'],'isHome') .'</td>
			<td align="center">'. Adm::SwitchBtn('idcProType',$row['IPT_ID'],$row['IPT_isHomeWap'],'isHomeWap') .'</td>
			<td align="left">'. $row['IPT_htmlName'] .'</td>
			<td align="center"></td>
			<td align="center">'. $row['IPT_note'] .'</td>
			<td align="center">'. $row['IPT_rank'] .'</td>
			<td align="center">
				'. Adm::SwitchBtn('idcProType',$row['IPT_ID'],$row['IPT_state'],'state') .'/
				'. Adm::SwitchBtn('idcProType',$row['IPT_ID'],$row['IPT_wapState'],'wapState','userState') .'
			</td>
			<td align="center">
				<img src="images/img_copy.gif" class="pointer" onclick=\'document.location.href="?mudi=add&mudi2=copy&dataID='. $row['IPT_ID'] .'&dataType='. $dataType .'&dataTypeCN='. urlencode($dataTypeCN) .'&backURL="+ encodeURIComponent(document.location.href)\' alt="复制这条记录为新增" />&ensp;
				<img src="images/img_rev.gif" class="pointer" onclick=\'document.location.href="idcProType.php?mudi=rev&dataType='. $dataType .'&dataTypeCN='. urlencode($dataTypeCN) .'&dataID='. $row['IPT_ID'] .'&backURL="+ encodeURIComponent(document.location.href)\' alt="修改" />&ensp;&ensp;
				<img src="images/img_del.gif" class="pointer" onclick=\'if(confirm("确定删除？")==true){DataDeal.location.href="idcProType_deal.php?mudi=del&dataType='. $dataType .'&dataTypeCN='. urlencode($dataTypeCN) .'&theme='. urlencode($row['IPT_theme']) .'&dataID='. $row['IPT_ID'] .'"}\' alt="删除" />
			</td>
		</tr>
		</tbody>
		');

		$show2exe=$DB->query('select * from '. OT_dbPref .'idcProType where IPT_fatID='. $row['IPT_ID'] .' order by IPT_rank ASC');
		while ($row2 = $show2exe->fetch()){
			if ($showNum % 2 == 1){ $bgcolor='class="tabColorTr"'; }else{ $bgcolor=''; }
			$showNum ++;
			$wapUrl = $wapHtmlUrl = $wapBtnStr = '';
			if (AppWap::Jud()){
				$wapUrl = '<a href="../wap/idcPro.php?dataID='. $row2['IPT_ID'] .'" style="color:#c9c9c9;" target="_blank" title="访问手机版动态路径">[wap]</a>';
				$wapHtmlUrl = '<a href="../wap/'. $row2['IPT_htmlName'] .'" style="color:#c9c9c9;" target="_blank" title="访问手机版静态页">[wap]</a>';
				$wapBtnStr = '<input type="button" value="WAP版" onclick="DiyRateDeal(\'wap\','. $row2['IPT_ID'] .');" />';
			}

			echo('
			<tbody class="idcProType2 tabBody padd3">
			<tr id="data'. $row2['IPT_ID'] .'" '. $bgcolor .'>
				<td align="center" class="selCheckbox"><input type="checkbox" name="selDataID[]" value="'. $row2['IPT_ID'] .'" /></td>
				<td align="center">'. $row2['IPT_ID'] .'</td>
				<td align="left">
					&ensp;&ensp;&ensp;┣&ensp;<span style="'. $row2['IPT_themeStyle'] .'">'. $row2['IPT_theme'] .'</span>&ensp;<span id="idcProType'. $row2['IPT_ID'] .'" class="font2_2"></span>
					<a href="../idcPro.php?dataID='. $row2['IPT_ID'] .'" style="color:#c9c9c9;" target="_blank" title="访问电脑版动态路径">[pc]</a>
					'. $wapUrl .'
				</td>
				<td align="center">'. $row2['IPT_fieldNum'] .'</td>
				<td align="center">'. ModeCN($row2['IPT_mode']) .'</td>
				<td align="center">'. Adm::SwitchBtn('idcProType',$row2['IPT_ID'],$row2['IPT_isHome'],'isHome') .'</td>
				<td align="center">'. Adm::SwitchBtn('idcProType',$row2['IPT_ID'],$row2['IPT_isHomeWap'],'isHomeWap') .'</td>
				<td align="left">
					'. $row2['IPT_htmlName'] .'
					<div>
						<a href="../'. $row2['IPT_htmlName'] .'" style="color:#c9c9c9;" target="_blank" title="访问电脑版静态页">[pc]</a>
						'. $wapHtmlUrl .'
					</div>
				</td>
				<td align="center">
					<input type="button" value="PC版" onclick="DiyRateDeal(\'pc\','. $row2['IPT_ID'] .');" />
					'. $wapBtnStr .'
					<center id="DiyRateBox'. $row2['IPT_ID'] .'" style="margin-top:3px;display:none;"><iframe id="diyRateIframe'. $row2['IPT_ID'] .'" name="diyRateIframe'. $row2['IPT_ID'] .'" frameborder="0" allowTransparency="true" scrolling="no" style="width:96px;height:20px;" src="about:blank"></iframe></center>
				</td>
				<td align="center">'. $row2['IPT_note'] .'</td>
				<td align="center">'. $row2['IPT_rank'] .'</td>
				<td align="center">
					'. Adm::SwitchBtn('idcProType',$row2['IPT_ID'],$row2['IPT_state'],'state') .'/
					'. Adm::SwitchBtn('idcProType',$row2['IPT_ID'],$row2['IPT_wapState'],'wapState','userState') .'
				</td>
				<td align="center">
					<img src="images/img_copy.gif" class="pointer" onclick=\'document.location.href="?mudi=add&mudi2=copy&dataID='. $row2['IPT_ID'] .'&dataType='. $dataType .'&dataTypeCN='. urlencode($dataTypeCN) .'&backURL="+ encodeURIComponent(document.location.href)\' alt="复制这条记录为新增" />&ensp;
					<img src="images/img_rev.gif" style="cursor:pointer;" onclick=\'document.location.href="idcProType.php?mudi=rev&dataType='. $dataType .'&dataTypeCN='. urlencode($dataTypeCN) .'&dataID='. $row2['IPT_ID'] .'&backURL="+ encodeURIComponent(document.location.href)\' alt="修改" />&ensp;&ensp;
					<img src="images/img_del.gif" style="cursor:pointer;" onclick=\'if(confirm("确定删除？")==true){DataDeal.location.href="idcProType_deal.php?mudi=del&dataType='. $dataType .'&dataTypeCN='. urlencode($dataTypeCN) .'&theme='. urlencode($row2['IPT_theme']) .'&dataID='. $row2['IPT_ID'] .'"}\' alt="删除" />
				</td>
			</tr>
			<tbody>
			');
		}
		unset($show2exe);

	}
	unset($showexe);

	echo('
	<!-- <tr class="tabColorB padd5">
		<td align="left" colspan="20">
			<input type="button" value="全选" onclick="AllSelBox()" class="form_button1" />
			<input type="button" value="反选" onclick="RevSelBox()" class="form_button1" />
			<input type="submit" value="提交" class="display" />
		</td>
	</tr> -->
	</form>
	</table>
	');

}


function ModeCN($num){
	switch ($num){
		case 0:		return '<span class="font1_2d">默认</span>';
		default :	return $num;
	}
}

?>