<!--<?php
# MetInfo Enterprise Content Management System 
# Copyright (C) MetInfo Co.,Ltd (http://www.metinfo.cn). All rights reserved. 
require_once template('head'); 
echo <<<EOT
-->
<script type="text/javascript" src="{$depth}../ckeditor/ckeditor.js"></script>
</head>
<!--
EOT;
if($cs==4){
	$listclass='';
	$listclass[4]='class="now"';
	$title="{$_M['word']['unitytxt_71']}";
}else{
	$title="{$_M['word']['the_menu']}";
}
require_once template('app/wap/top');
$rand=met_rand(4);
echo <<<EOT
-->
<body>
    <form method="POST" name="myform" action="wap.php?lang={$lang}&anyid={$anyid}" target="_self">
		<input name="action" type="hidden" value="modify" />
		<input name="met_wap_tpa" type="hidden" value="0" />
		<input name="met_wap_tpb" type="hidden" value="0" />
<div class="v52fmbx_tbmax">
<div class="v52fmbx_tbbox">
<div class="v52fmbx">
<!--
EOT;
if($cs==1){
echo <<<EOT
-->	
	<h3 class="v52fmbx_hr metsliding" sliding="1">{$lang_unitytxt_1}</h3>
	<div class="metsliding_box metsliding_box_1">
<!--
EOT;
if($met_webhtm){
echo <<<EOT
-->	
		<div class="v52fmbx_dlbox">
		<dl>
			<dd>
				<span class="red">{$lang_wap_descript9_v6}</span>
			</dd>
		</dl>
		</div>
<!--
EOT;
}
echo <<<EOT
-->	
		<div class="v52fmbx_dlbox">
		<dl>
			<dt>{$lang_waptype}{$lang_marks}</dt>
			<dd>
				<label><input name="met_wap" type="radio" class="radio" value="1" {$met_wap1[1]} />{$lang_open}</label>
				<label><input name="met_wap" type="radio" class="radio" value="0" {$met_wap1[0]} />{$lang_close}</label>
			</dd>
		</dl>
		</div>
		<div class="v52fmbx_dlbox">
		<dl>
			<dt>{$lang_wapfang}{$lang_marks}</dt>
			<dd>
				<label><input name="met_wap_tpa" type="checkbox" class="checkbox" value="1" {$met_wap_tpa1[1]} />{$lang_wapgeturl}</label>
			</dd>
		</dl>
		</div>
		<div class="v52fmbx_dlbox">
		<dl>
			<dt>{$lang_wap_webhost_v6}{$lang_marks}</dt>
			<dd>
				<input type="text" name="met_wap_url" class="text" value="$met_wap_url" /><br/>
				<span class="tips">{$lang_wap_descript10_v6}</span>
			</dd>
		</dl>
		</div>
		<div class="v52fmbx_dlbox">
		<dl>
			<dt>{$lang_waplang}{$lang_marks}</dt>
			<dd>
				<label><input name="met_waplink" type="radio" class="radio" value="1" {$met_waplink1[1]} />{$lang_waptips5}</label>
				<label><input name="met_waplink" type="radio" class="radio" value="0" {$met_waplink1[0]} />{$lang_waptips6}</label>
				<span class="tips">{$lang_wapsetlang}</span>
			</dd>
		</dl>
		</div>
	</div>
		<div class="v52fmbx_dlbox">
		<dl>
			<dt>{$lang_show_contents}{$lang_marks}</dt>
			<dd>
				<label><input name="met_wapshowtype" type="radio" class="radio" value="0" {$met_wapshowtype1[0]} />{$lang_wap_keepcomputer_v6}</label>
				<label><input name="met_wapshowtype" type="radio" class="radio" value="1" {$met_wapshowtype1[1]} />{$lang_managertyp5}</label>
			</dd>
		</dl>
		</div>
	<h3 class="v52fmbx_hr metsliding" ctype="met_wapshowtype_1">{$lang_wap_descript11_v6}</h3>
	<div class="v52fmbx_dlbox" ctype="met_wapshowtype_1">
		<dl>
			<dd>
			<div class="flashaddclumn flashaddclumn_bing">
			<h3><p>
				<label style="height:15px; line-height:20px; text-align:left; color:red;">{$lang_wap_descript12_v6}</label>
				</p>
			</h3>
			<div class="list">
<!--
EOT;
foreach($met_class1 as $key=>$val){
$val[cckk]=$val[wap_ok]?'checked':'';
echo <<<EOT
-->	
	<p><label><input name="met_clumid_{$val[id]}" type="checkbox" class="checkbox" value="{$val[id]}" ctype="1" {$val[cckk]}>{$val[name]}</label></p>
<!--
EOT;
foreach($met_class2[$val[id]] as $key=>$val2){
$val2[cckk]=$val2[wap_ok]?'checked':'';
echo <<<EOT
-->	
    <p class="met_bigloumn2id_{$val2[bigclass]}" style="margin-left:22px;"><label><input name="met_clumid_{$val2[id]}" type="checkbox" class="checkbox" value="{$val2[id]}" ctype="2" {$val2[cckk]} bigclass="{$val2[bigclass]}">{$val2[name]}</label></p>
<!--
EOT;
foreach($met_class3[$val2[id]] as $key=>$val3){
$val3[cckk]=$val3[wap_ok]?'checked':'';
echo <<<EOT
-->	
    <p class="met_bigloumn3id_{$val3[bigclass]}" style="margin-left:42px;"><label><input name="met_clumid_{$val3[id]}" type="checkbox" class="checkbox" value="{$val3[id]}" ctype="3" {$val3[cckk]} bigclass="{$val3[bigclass]}">{$val3[name]}</label></p>
<!--
EOT;
}}}  
echo <<<EOT
-->	
				</div>
				</div>
			<div class="flashaddclumn flashaddclumn_nav">
			<h3><p>
				<label style="height:15px; line-height:20px; text-align:left; color:red;">{$lang_wap_descript13_v6}</label>
				</p>
			</h3>
			<div class="list">
<!--
EOT;
foreach($met_class1 as $key=>$val){
$val[cckk]=$val[wap_nav_ok]?'checked':'';
$val[none]=$val[wap_ok]?'':'class="none"';
echo <<<EOT
-->	
	<p {$val[none]} id="isnone_id_{$val[id]}"><label><input name="met_clumid_{$val[id]}" type="checkbox" class="checkbox" value="{$val[id]}" ctype="1" {$val[cckk]}>{$val[name]}</label></p>
<!--
EOT;
foreach($met_class2[$val[id]] as $key=>$val2){
$val2[cckk]=$val2[wap_nav_ok]?'checked':'';
$val2[none]=$val2[wap_ok]?'':'class="none"';
echo <<<EOT
-->	
    <p style="margin-left:22px;" {$val2[none]} id="isnone_id_{$val2[id]}"><label><input name="met_clumid_{$val2[id]}" type="checkbox" class="checkbox" value="{$val2[id]}" ctype="2" {$val2[cckk]}>{$val2[name]}</label></p>
<!--
EOT;
foreach($met_class3[$val2[id]] as $key=>$val3){
$val3[cckk]=$val3[wap_nav_ok]?'checked':'';
$val3[none]=$val3[wap_ok]?'':'class="none"';
echo <<<EOT
-->	
    <p style="margin-left:42px;" {$val3[none]} id="isnone_id_{$val3[id]}"><label><input name="met_clumid_{$val3[id]}" type="checkbox" class="checkbox" value="{$val3[id]}" ctype="3" {$val3[cckk]}>{$val3[name]}</label></p>		
<!--
EOT;
}}}  
echo <<<EOT
-->	
				</div>
				</div>
			<div class="clear"></div>
			</dd>
		</dl>
	</div>
		<div class="v52fmbx_dlbox" ctype="met_wapshowtype_1">
		<dl>
			<dt>{$lang_waplistshow}{$lang_marks}</dt>
			<dd>
				<label><input name="met_wap_ok" type="radio" class="radio" value="1" {$met_wap_ok1[1]} />{$lang_waplistaud}</label>
				<label><input name="met_wap_ok" type="radio" class="radio" value="0" {$met_wap_ok1[0]} />{$lang_waplistauk}</label>
				<span class="tips">{$lang_wapinfo7}</span>
			</dd>
		</dl>
		</div>
		<h3 class="v52fmbx_hr metsliding" sliding="4">{$lang_wap_setbasicInfo_v6}</h3>
		<div class="v52fmbx_dlbox">
		<dl>
			<dt>{$lang_wapindextitle}{$lang_marks}</dt>
			<dd>
				<input type="text" name="wap_title" class="text" value="$wap_title" />
				<span class="tips">{$lang_wap_descript14_v6}</span>
			</dd>
		</dl>
		</div>
		<div class="v52fmbx_dlbox">
		<dl>
			<dt>LOGO {$lang_marks}</dt>
			<dd>
				<input name="met_wap_logo" type="text" class="text" value="{$met_wap_logo}" />
				<span class="tips" style="">{$lang_waptips9}</span>
				<input name="met_upsql" type="file" id="file_upload2" />
				<script type="text/javascript">
					$(document).ready(function(){
						metuploadify('#file_upload2','upimage','met_wap_logo');
					});
				</script>
			</dd>
		</dl>
		</div>
		<div class="v52fmbx_dlbox">
		<dl>
			<dt>{$lang_wapfoottext}{$lang_marks}</dt>
			<dd>
				<textarea name="wap_footertext" class="textarea">$wap_footertext</textarea>
			</dd>
		</dl>
		</div>
	<div class="v52fmbx_submit">
		<input type="submit" name="Submit" value="{$lang_Submit}" class="submit" onclick="return flashsubm()" />
		<input type="hidden" name="f_columnlist" value="" />
		<input type="hidden" name="f_wap_nav_ok" value="" />
	</div>
<script type="text/javascript">
	function flashsubm(){
		var list = $('.flashaddclumn_bing').find('input');
		var vl = ',';
		var list_nav= $('.flashaddclumn_nav').find('input');
		var vl_nav = ',';
			list.each(function(){
				if($(this).attr("checked"))vl+=$(this).val()+',';
			});
			list_nav.each(function(){
				if($(this).attr("checked"))vl_nav+=$(this).val()+',';
			});
			$("input[name='f_columnlist']").val(vl);
			$("input[name='f_wap_nav_ok']").val(vl_nav);
			return true;
	}
	$("input[name='met_clumid_all']").change(function(){
		if($(this).attr("checked")){
			$('.flashaddclumn_bing').find('input').attr("checked",true);
		}else{	
			$('.flashaddclumn_bing').find('input').attr("checked",false);
		}
	});
	$('.flashaddclumn_bing').find('input').change(function(){
		if(!$(this).attr("checked")){
			$("input[name='met_clumid_all']").attr("checked",false);
			$("#isnone_id_"+$(this).val()).hide().find('input').attr("checked",false);
		}else{
			$("#isnone_id_"+$(this).val()).show();
		}
		var ctype = $(this).attr("ctype");
		var yesno = $(this).attr("checked")?true:false;
		var my = $(this);
		if(ctype==1){
			$(".met_bigloumn2id_"+my.val()).each(function(){
				$(this).find("input").attr("checked",yesno);
				$(".met_bigloumn3id_"+$(this).find("input").val()).find("input").attr("checked",yesno);
				var bln2id = $(this).find("input").val();
				if(yesno){
					$("#isnone_id_"+$(this).find("input").val()).show();
				}else{
					$("#isnone_id_"+$(this).find("input").val()).hide().find('input').attr("checked",false);
				}
				$(".met_bigloumn3id_"+bln2id).find("input").each(function(){
					$(this).attr("checked",yesno);
					if(yesno){
						$("#isnone_id_"+$(this).val()).show();
					}else{
						$("#isnone_id_"+$(this).val()).hide().find('input').attr("checked",false);
					}
				});
			});
		}
		if(ctype==2){
			var bigclass = my.attr('bigclass');
			var bigdom =  $(".flashaddclumn_bing input[name='met_clumid_"+bigclass+"']");
			if(!bigdom.attr("checked")){
				bigdom.attr("checked",true);
				$("#isnone_id_"+bigclass).show();
			}
			$(".met_bigloumn3id_"+my.val()).find("input").each(function(){
				$(this).attr("checked",yesno);
				if(yesno){
					$("#isnone_id_"+$(this).val()).show();
				}else{
					$("#isnone_id_"+$(this).val()).hide().find('input').attr("checked",false);
				}
			});
		}
		if(ctype==3){
			var bigclass = my.attr('bigclass');
			var bigdom =  $(".flashaddclumn_bing input[name='met_clumid_"+bigclass+"']");
			if(!bigdom.attr("checked")){
				bigdom.attr("checked",true);
				$("#isnone_id_"+bigclass).show();
			}
			var bigclass = bigdom.attr('bigclass');
			var bigdom =  $(".flashaddclumn_bing input[name='met_clumid_"+bigclass+"']");
			if(!bigdom.attr("checked")){
				bigdom.attr("checked",true);
				$("#isnone_id_"+bigclass).show();
			}
		}
	});
function checkthis_wap(dm){
	var dms = $("input[name='"+dm+"']");
	dms.each(function(){
		var dms = $(this);
		if(dms.attr('type')!='hidden'){
			var dom = $('[ctype^='+dm+']');
			dms.change(function(){
				var n = $(this).val();
				if(dms.attr('type')=='checkbox'){
					n = dms.attr('checked')?n:0;
				}
				dom.hide();
				$('[ctype^='+dm+'_'+n+']').show();
				ifreme_methei();
			});
			dom.hide();
			if(dms.attr('type')=='radio'){
				var dms = $("input[name='"+dm+"']:checked");
			}
			var vl = dms.val();
			if(dms.attr('type')=='checkbox'){
				vl = dms.attr('checked')?vl:0;
			}
			$('[ctype^='+dm+'_'+vl+']').show();
			ifreme_methei();
		}
	});
}
	checkthis_wap('met_wap_tpb');
	checkthis_wap('met_wapshowtype');
</script>
<!--
EOT;
}elseif($cs==4){
echo <<<EOT
-->	
	<h3 class="v52fmbx_hr metsliding" sliding="4">{$lang_wapdimensionaltitle}</h3>
	<div class="v52fmbx_dlbox">
	<dl>
		<dt>{$lang_wapdimensionalsize}{$lang_marks}</dt>
		<dd>
			<input name="wap_dimensional_size" type="text" class="text mid" value="{$wap_dimensional_size}" /> {$lang_setimgPixel}
		</dd>
	</dl>
	</div>
	<div class="v52fmbx_dlbox">
	<dl>
		<dt>LOGO{$lang_marks}</dt>
		<dd>
			<input name="met_dimensional_logo" type="text" class="text" value="{$met_dimensional_logo}" />
			<span class="tips" style="">{$lang_wapdimensionaltips}</span>
			<input name="met_upsql" type="file" id="file_upload" />
			<script type="text/javascript">
				$(document).ready(function(){
					metuploadify('#file_upload','upimage','met_dimensional_logo');
				});
			</script>
		</dd>
	</dl>
	</div>
	<div class="v52fmbx_dlbox">
	<dl>
		<dt>{$lang_unitytxt_71}{$lang_marks}</dt>
		<dd>
			<a href="javascript:;" onclick="return dimensional();">{$lang_wapdimensionaldo}</a><br/>
			<div id="dimensionalimg">
<!--
EOT;
$rand=met_rand(4);
$dimensionalimghtml=file_exists('../../../upload/files/dimensional.png')?'<img src="../../../upload/files/dimensional.png?'.$rand.'" />':'';
echo <<<EOT
-->
			{$dimensionalimghtml}
			</div>
		</dd>
	</dl>
	</div>
	<div class="v52fmbx_submit">

	</div>
<!--
EOT;
}
echo <<<EOT
-->	
</div>
</div>
</div>
</form>
<div class="footer">{$foot}</div>
<script type="text/javascript">
	function dimensional(){
		$("#dimensionalimg").html("$lang_jsx1");
		$.ajax({			
			url:'wap.php?wap_dimensional_size='+$("input[name='wap_dimensional_size']").val()+'&met_dimensional_logo='+$("input[name='met_dimensional_logo']").val()+'&action=dimensional&lang={$lang}',
			type: 'GET',
			success: function(data) {
				$("#dimensionalimg").html("<img src='' />");
				$("#dimensionalimg img").attr("src","");
				$("#dimensionalimg img").attr("src",data);
				$("#dimensionalimg img").css("height",$("input[name='wap_dimensional_size']").val()+'px');
				ifreme_methei();
			}
		});
	}
	$("#dimensionalimg img").css("height",$("input[name='wap_dimensional_size']").val()+'px');
</script>
</body>
</html>
<!--
EOT;
# This program is an open source system, commercial use, please consciously to purchase commercial license.
# Copyright (C) MetInfo Co., Ltd. (http://www.metinfo.cn). All rights reserved.
?>-->