<?php
require_once 'library/top_application.php';
require_once 'library/logged.php';

$sql = mysql_query('SELECT `uid`, `username`, `manage_user`, `manage_section`, `manage_news`, `manage_content`, `manage_product`, `manage_gallery`, `manage_banner`, `email` FROM `'.TBL_USER.'` WHERE `uid` = '.$_SESSION['Logged_Uid']);
$row = mysql_fetch_assoc($sql);

$sql_all_user = mysql_query('SELECT `uid`, `username`, `manage_user`, `manage_section`, `manage_news`, `manage_content`, `manage_product`, `manage_gallery`, `manage_banner`, `create_date`, `login_date`, `email` FROM `'.TBL_USER.'` ORDER BY uid ASC');
$row_all_user = mysql_fetch_assoc($sql_all_user);

if ($row["manage_user"] == 1){
	
	// $sql_site = mysql_query('SELECT * FROM `general_setting`');
	$sql_site = mysql_query('SELECT * FROM `contact_setting`');
	$row_site = mysql_fetch_assoc($sql_site);
}

?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Artech Creative</title>
<link href="css/css_admin.css?rnd=13" rel="stylesheet" type="text/css">
<link href="../css/tiny.css" rel="stylesheet" type="text/css">
<link href="css/drag_list.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="../js/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="../js/jquery-ui-min.js"></script>
<script type="text/javascript" src="../js/tinybox_product.js"></script>
<script type="text/javascript" src="../js/check_function.js"></script>
<!--[if IE]>
    <script src="../js/html5.js"></script>
<![endif]-->
<script type="text/javascript" src="../js2/password.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	$("input[name=confrim_password]").change(function(){
		var new_pw = $('input[name=new_password]').val();
		var cf_pw = $(this).val();
		
		if (check_PW_length(new_pw) == false){
			$('#check_confirm_pw').html('<span style="color: red">密碼太短!</span>')
			return
		} else {
			if(cf_pw == new_pw){
				$('#check_confirm_pw').html('<span style="color: green">OK!</span>')
				$(this).removeClass("error");
			} else {
				$('#check_confirm_pw').html('<span style="color: red">密碼不符, 請重試!</span>')
				$(this).addClass("error");
			}
		}
	});
	$("input[name=email]").change(function(){
		var this_value = $(this).val();	
	
		if (checkEmail(this_value) == false){
			$(this).addClass("error");
			$('#er_email').show();
			$('#er_email').html('<span style="color: red">電郵格式錯誤</span>');
		} else {
			$('#er_email').hide();
			$(this).removeClass("error");
		}
	})
	
	/****** check before submit ******/
	$('#btn_submit').click(function(){
		var error = false;															
		var email= $('input[name=email]').val();
		var new_pw = $('input[name=new_password]').val();
		var cf_pw = $('input[name=confrim_password]').val();
		
		if(!new_pw || !cf_pw){
			$('#check_confirm_pw').html('<span style="color: red">請輸入密碼!</span>')
			error = true;
		} 
		if (check_PW_length(new_pw) == false){
			$('#check_confirm_pw').html('<span style="color: red">密碼太短!</span>')
			error = true;
			return
		}
		if (checkEmail(email) == false){
			$('input[name=email]').addClass("error");
			$('#er_email').show();
			$('#er_email').html('<span style="color: red">電郵格式錯誤</span>');
			error = true;
		} else {
			$('#er_email').hide();
			$('input[name=email]').removeClass("error");
		}
		if(new_pw != cf_pw){
			error = true;
			$('#check_confirm_pw').html('<span style="color: red">密碼不符, 請重試!</span>')
			return
		}
		if (error == true){
			$("#update_info").html('<b style="color:red;">更新失敗!!!</b>');
			return
		} else {
			$.ajax({
				type: "POST",
				url: "ajax/update_admin.php",
				data: {"uid" : <?php echo $_SESSION['Logged_Uid'];?>, "n_email" : email, "n_password" : new_pw},
				cache: false,
				success: function(html){
					$("#update_info").html(html);
				}
			});
		}
	})
	
	$('.manage_edit').each(function(){
		var btn_show = 	$('.showing_2', this);
		var btn_not_show = $('.not_showing_2', this);
		var this_id_name = 'uid';
		var this_table = 'contact_setting';
		
		btn_show.click(function(){
			var this_field = $(this).attr('rel');
			var this_id = parseInt($(this).attr('rev'));
			$.ajax({
				type: "POST",
				url: "ajax/update_yesno.php",
				data: {"id_name" : this_id_name, "id" : this_id, "update_field" :this_field, "show" : 2, "table": this_table},
				cache: false,
				success: function(html){
					btn_show.hide();
					btn_not_show.show();
				}
			});
		})
		
		btn_not_show.click(function(){
			var this_field = $(this).attr('rel');
			var this_id = parseInt($(this).attr('rev'));
			$.ajax({
				type: "POST",
				url: "ajax/update_yesno.php",
				data: {"id_name" : this_id_name, "id" : this_id, "update_field" :this_field, "show" : 1, "table": this_table},
				cache: false,
				success: function(html){
					btn_show.show();
					btn_not_show.hide();
				}
			});
		})
	})
	
	$('.btn_delete').click(function(){
		var this_id = parseInt($(this).attr('rel'));
		var table_name = 'contact_setting';
		var this_id_name = 'uid';
		
		if (confirm("Confirm to delete this admin ?")){
			$.ajax({
				type: "POST",
				url: "ajax/delete.php",
				data: {"table" : table_name, "id_name" : this_id_name, "del_id" : this_id},
				cache: false,
				success: function(html){
					location.reload();
				}
			});
		} else {
			return false;
		}
	})
	
	$('#btn_more_option').click(function(){
		if($(this).hasClass('collapse')){
			$('#more_option').css('display', 'block');
			$(this).removeClass('collapse').addClass('expand');
			$(this).text('Hide Option [-]');
		} else {
			$('#more_option').css('display', 'none');
			$(this).removeClass('expand').addClass('collapse');
			$(this).text('More Option [+]');
		}
	})
})

function closeJS(){
	location.reload();
}
function changeInput(input_name){
	var input_val =  $.trim($('#'+input_name).val());
	$.ajax({
		type: "POST",
		url: "ajax/update_contact.php",
		data: {"val" : input_val, "field" : input_name},
		cache: false,
		success: function(html){
			$('#update_g_info').html(html);
		}
	});
}
function onlyTextInput(input_name){
	var input_val = $('#'+input_name).val();
	var iChars = "!#$%^@&*+=[]\\\'/{}|\":<>?~_";
	var error = false;
	for (var i = 0; i < input_val.length; i++) {
		if (iChars.indexOf(input_val.charAt(i)) != -1) {
			$('#'+input_name).addClass("error");
			$('#er_'+input_name).show();
			$('#er_'+input_name).text("不能有符號");	
			error = true
			break;			  
		} else {
			$('#er_'+input_name).hide();
			$('#'+input_name).removeClass("error");			
		}
	}
	if(error == true){
		return
	} else {
		$.ajax({
			type: "POST",
			url: "ajax/update_contact.php",
			data: {"val" : input_val, "field" : input_name},
			cache: false,
			success: function(html){
				$('#update_g_info').html(html);
			}
		});
	}
	
}

</script>
</head>

<body>
<div id="wrap">
  <section id="column_left">
    <?php include 'library/left_menu.php';?>
  </section>
  <section id="column_right">
    <div class="admin_content"> <a onClick="TINY.box.show({iframe:'addAdmin.php',boxid:'frameless',width:960,height:800,fixed:true,maskid:'blackmask',maskopacity:70, closejs:function(){closeJS()}})" id="btn_add">
      <div id="add_img"></div>
      新增</a>
      <h1>管理員設定</h1>
      <div class="sep_line"></div>
      <h2>密碼 / 電郵修改</h2>
      <span id="update_info"></span>
      <div style="margin-bottom:30px">
        <div class="table_row">
          <div class="table_label">登入 ID:</div>
          <div class="table_input"><?php echo $row["username"];?></div>
        </div>
        <div class="table_row">
          <div class="table_label">電郵:</div>
          <div class="table_input">
            <input name="email" type="text" value="<?php echo $row["email"]; ?>" style="width:250px">
            <span id="er_email"></span> </div>
        </div>
        <div class="table_row">
          <div class="table_label">新密碼:</div>
          <div class="table_input">
            <input name="new_password" type="password" style="width:150px">
            <span id="result"></span></div>
        </div>
        <div class="table_row">
          <div class="table_label">重覆輸入新密碼:</div>
          <div class="table_input">
            <input name="confrim_password" type="password" style="width:150px">
            <span id="check_confirm_pw"></span></div>
        </div>
        <div class="table_row">
          <div class="table_label">&nbsp;</div>
          <div class="table_input">
            <input type="submit" id="btn_submit">
          </div>
        </div>
      </div>
      <div class="sep_line" style="margin-bottom:20px;"></div>
      <?php if ($row["manage_user"] == 1){?>
      <h2>網站基本設定</h2>
      <span id="update_g_info"></span>
      <div style="margin-bottom:30px">
        <div class="table_row_300">
          <div class="table_label" style="width:100px">網站狀態:</div>
          <div class="table_input" >
            <select name="site_status" id="site_status" style="width:144px" onChange="changeInput('site_status')">
              <option value="1" <?php if ($row_site['site_status'] == 1){echo 'selected';}?>>正常</option>
              <option value="2" <?php if ($row_site['site_status'] == 2){echo 'selected';}?>>關閉</option>
              <option value="3" <?php if ($row_site['site_status'] == 3){echo 'selected';}?>>維護</option>
            </select>
            </div>
        </div>
       <div class="table_row_300">
          <div class="table_label" style="width:100px">首選語言:</div>
          <div class="table_input" >
            <select name="first_language" id="first_language" style="width:144px" onChange="changeInput('first_language')">
              <option value="1" <?php if ($row_site['first_language'] == 1){echo 'selected';}?>>English</option>
              <option value="2" <?php if ($row_site['first_language'] == 2){echo 'selected';}?>>繁體中文</option>
              <option value="3" <?php if ($row_site['first_language'] == 3){echo 'selected';}?> disabled>简体中文</option>
            </select>
            </div>
        </div>
        <div class="clearfix" style="height:20px"></div>
        <div class="table_row">
          <div class="table_label" style="width:100px">網站名稱:</div>
          <div class="table_input"> ENG:
            <input name="ep_sitename" id="ep_sitename" type="text" value="<?php echo $row_site["ep_sitename"]; ?>" style="width:250px" onChange="onlyTextInput('ep_sitename')">
            <span style="color:red">*</span> <span id="er_ep_sitename" class="er_msg"></span><br>
            繁中:
            <input name="cp_sitename" id="cp_sitename"  type="text" value="<?php echo $row_site["cp_sitename"]; ?>" style="width:250px" onChange="onlyTextInput('cp_sitename')">
            <span id="er_cp_sitename" class="er_msg"></span> </div>
        </div>
        <div class="clearfix" style="height:20px"></div>
        <div class="table_row_300">
          <div class="table_label">首頁 Slide 大小: <span style="color:#999; font-size:12px;">(Default <?php echo DEFAULT_SLIDE_W;?>px * <?php echo DEFAULT_SLIDE_H;?>px)</span></div>
          <div class="table_input">
            <input name="banner_w" id="banner_w" type="text" value="<?php echo $row_site["banner_w"]; ?>" style="width:60px" maxlength="4" onChange="changeInput('banner_w')" class="num_only">
            px (闊)  *
            <input name="banner_h" id="banner_h" type="text" value="<?php echo $row_site["banner_h"]; ?>" style="width:60px" maxlength="4" onChange="changeInput('banner_h')" class="num_only">
            px (高)<span id="er_size" class="error_txt"></span>
             </div>
        </div>
        <div class="table_row_300">
          <div class="table_label">新聞縮圖大小: <span style="color:#999; font-size:12px;">(Default <?php echo DEFAULT_NEWS_W;?>px * <?php echo DEFAULT_NEWS_H;?>px)</span></div>
          <div class="table_input">
            <input name="news_w" id="news_w" type="text" value="<?php echo $row_site["news_w"]; ?>" style="width:60px" maxlength="4" onChange="changeInput('news_w')" class="num_only">
            px (闊)  *
            <input name="news_h" id="news_h" type="text" value="<?php echo $row_site["news_h"]; ?>" style="width:60px" maxlength="4" onChange="changeInput('news_h')" class="num_only">
            px (高)<span id="er_size" class="error_txt"></span>
             </div>
        </div>
        <div class="clearfix" style="height:10px"></div>
        <div class="table_row_300">
          <div class="table_label">相簿 / 產品縮圖大小: <span style="color:#999; font-size:12px;">(Default <?php echo DEFAULT_ALBUM_W;?>px * <?php echo DEFAULT_ALBUM_H;?>px)</span> </div>
          <div class="table_input">
            <input name="album_w" id="album_w" type="text" value="<?php echo $row_site["album_w"]; ?>" style="width:60px" maxlength="4" onChange="changeInput('album_w')" class="num_only">
            px (闊)  *
            <input name="album_h" id="album_h" type="text" value="<?php echo $row_site["album_h"]; ?>" style="width:60px" maxlength="4" onChange="changeInput('album_h')" class="num_only">
            px (高)<span id="er_size" class="error_txt"></span>
            </div>
        </div>
        <div class="table_row_300">
          <div class="table_label">相簿 / 產品相片大小: <span style="color:#999; font-size:12px;">(Default <?php echo DEFAULT_PHOTO_W;?>px * <?php echo DEFAULT_PHOTO_H;?>px)</span></div>
          <div class="table_input">
            <input name="photo_w" id="photo_w" type="text" value="<?php echo $row_site["photo_w"]; ?>" style="width:60px" maxlength="4" onChange="changeInput('photo_w')" class="num_only">
            px (闊)  *
            <input name="photo_h" id="photo_h" type="text" value="<?php echo $row_site["photo_h"]; ?>" style="width:60px" maxlength="4" onChange="changeInput('photo_h')" class="num_only">
            px (高)<span id="er_size" class="error_txt"></span>
             </div>
        </div>
        <div class="clearfix" style="height:30px"></div>
        <a id="btn_more_option" class="collapse">More Option [+]</a>
        <div class="clearfix"></div>
        <div id="more_option" style="display:none">
          <div class="table_row">
            <div class="table_label">SEO Keywords:</div>
            <div class="table_input">
              <input name="meta_key" id="meta_key" type="text" style="width:500px" maxlength="300" value="<?php echo $row_site["meta_key"]; ?>" onChange="onlyTextInput('meta_key')">
              <span style="color:#999; font-size:12px;">(seperate with Comma)</span> <span id="er_meta_key" class="er_msg"></span></div>
          </div>
          <div class="clearfix"></div>
          <div class="table_row">
            <div class="table_label">SEO Description:</div>
            <div class="table_input">
              <textarea name="meta_desc" id="meta_desc" rows="4" style="width:500px" onChange="onlyTextInput('meta_desc')"><?php echo $row_site["meta_desc"]; ?></textarea>
              <span id="er_meta_desc" class="er_msg"></span> </div>
          </div>
          <div class="clearfix"></div>
          
        </div>
      </div>
      <!-- 關於我們 -->

      <div class="sep_line" style="margin-bottom:20px;"></div>
       <div class="table_row">
          <div class="table_label" style="width:100px">關於我們:</div>
          <div class="table_input" style="vertical-align: text-top;" > ENG:
            <!-- <input name="ep_aboutus" id="ep_aboutus" type="text" value="<?php echo $row_site["ep_aboutus"]; ?>" style="width:250px" onChange="onlyTextInput('ep_aboutus')"> -->

            <textarea rows="4" cols="50" name="ep_aboutus" id="ep_aboutus" type="text" style="width:250px" onChange="changeInput('ep_aboutus')"><?php echo $row_site["ep_aboutus"]; ?></textarea>	
            <span style="color:red">*</span> <span id="er_ep_aboutus" class="er_msg"></span><br>
            </div>
         <div class="table_input" style="vertical-align: text-top;" >    
            繁中:
            <!-- <input name="cp_aboutus" id="cp_aboutus"  type="text" value="<?php echo $row_site["cp_aboutus"]; ?>" style="width:250px" onChange="onlyTextInput('cp_aboutus')"> -->
            <textarea rows="4" cols="50" name="cp_aboutus" id="cp_aboutus"  type="text"  style="width:250px" onChange="changeInput('cp_aboutus')"><?php echo $row_site["cp_aboutus"]; ?></textarea>	

            <span id="er_cp_aboutus" class="er_msg"></span> </div>
        </div>
        <div class="clearfix" style="height:20px"></div>
        <div class="table_row">
          <div class="table_label" style="width:100px">聯絡地址:</div>
          <div class="table_input"> ENG:
            <input name="ep_address" id="ep_address" type="text" value="<?php echo $row_site["ep_address"]; ?>" style="width:250px" onChange="changeInput('ep_address')">
            <span style="color:red">*</span> <span id="er_ep_sitename" class="er_msg"></span><br>
            繁中:
            <input name="cp_address" id="cp_address"  type="text" value="<?php echo $row_site["cp_address"]; ?>" style="width:250px" onChange="changeInput('cp_address')">
            <span id="er_cp_sitename" class="er_msg"></span> </div>
        </div>
        <div class="clearfix" style="height:20px"></div>
        <div class="table_row">
          <div class="table_label" style="width:100px">聯絡電話:</div>
          <div class="table_input"> ENG:
            <input name="ep_tel" id="ep_tel" type="text" value="<?php echo $row_site["ep_tel"]; ?>" style="width:250px" onChange="changeInput('ep_tel')">
            <span style="color:red">*</span> <span id="er_ep_sitename" class="er_msg"></span><br>
            繁中:
            <input name="cp_tel" id="cp_tel"  type="text" value="<?php echo $row_site["cp_tel"]; ?>" style="width:250px" onChange="changeInput('cp_tel')">
            <span id="er_cp_sitename" class="er_msg"></span> </div>
        </div>
        <div class="clearfix" style="height:20px"></div>
        <div class="table_row">
          <div class="table_label" style="width:100px">電郵地址:</div>
          <div class="table_input"> ENG:
            <input name="ep_email" id="ep_email" type="text" value="<?php echo $row_site["ep_email"]; ?>" style="width:250px" onChange="changeInput('ep_email')">
            <span style="color:red">*</span> <span id="er_ep_sitename" class="er_msg"></span><br>
            繁中:
            <input name="cp_email" id="cp_email"  type="text" value="<?php echo $row_site["cp_email"]; ?>" style="width:250px" onChange="changeInput('cp_email')">
            <span id="er_cp_sitename" class="er_msg"></span> </div>
        </div>
        <div class="clearfix" style="height:20px"></div>
        <div class="table_row">
          <div class="table_label" style="width:100px">服務時間:</div>
          <div class="table_input"> ENG:
             <textarea rows="4" cols="50" name="ep_time" id="ep_time"  type="text"  style="width:250px" onChange="changeInput('ep_time')"><?php echo $row_site["ep_time"]; ?></textarea>	
            <span style="color:red">*</span> <span id="er_ep_sitename" class="er_msg"></span><br>
            繁中:
              <textarea rows="4" cols="50" name="cp_time" id="cp_time"  type="text"  style="width:250px" onChange="changeInput('cp_time')"><?php echo $row_site["cp_time"]; ?></textarea>	
            <span id="er_cp_sitename" class="er_msg"></span> </div>
        </div>
        <div class="clearfix" style="height:20px"></div>
        <div class="table_row">
          <div class="table_label" style="width:100px">地圖資料:</div>
          <div class="table_input"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
             <textarea rows="4" cols="50" name="gmap" id="gmap"  type="text"  style="width:250px" onChange="changeInput('gmap')"><?php echo $row_site["gmap"]; ?></textarea>	
            <span style="color:red">*</span> <span id="er_ep_sitename" class="er_msg"></span><br>
            </div>
        </div>

        <br>
      <br>
      <br>
      <!-- end 關於我們 -->


      <div class="sep_line" style="margin-bottom:20px;"></div>
      <table width="100%" border="0" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC" class="content">
        <tr bgcolor="#80031A">
          <td bgcolor="#EEEEEE" width="20"></td>
          <td bgcolor="#EEEEEE" width="100">管理員 ID</td>
          <td bgcolor="#EEEEEE">Email</td>
          <td bgcolor="#EEEEEE" align="center" width="100">建立時間</td>
          <td bgcolor="#EEEEEE" align="center" width="100">最後登入</td>
          <td bgcolor="#EEEEEE" width="40" align="center">總管</td>
          <td bgcolor="#EEEEEE" width="70" align="center">Slide控制</td>
          <td bgcolor="#EEEEEE" width="60" align="center">分區控制</td>
          <td bgcolor="#EEEEEE" width="60" align="center">新聞控制</td>
          <td bgcolor="#EEEEEE" width="60" align="center">內容控制</td>
          <td bgcolor="#EEEEEE" width="60" align="center">相簿控制</td>
          <td bgcolor="#EEEEEE" width="60" align="center">產品控制</td>
          <td width="49" align="center" bgcolor="#EEEEEE" >Action</td>
        </tr>
      </table>
      <?php
            $i =1;
            if($row_all_user){
            do { ?>
      <table width="100%" border="0" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC" class="content" >
        <tr bgcolor="#FFFFFF">
          <td width="20"><?php echo $i; ?></td>
          <td width="100"><?php echo $row_all_user['username']; ?></td>
          <td><?php echo $row_all_user['email']; ?></td>
          <td width="100" align="center"><?php echo $row_all_user['create_date'];?></td>
          <td width="100" align="center"><?php echo $row_all_user['login_date'];?></td>
          <td width="40" align="center" class="manage_edit"><?php 
					if ($_SESSION['Logged_Uid'] == 1){
					if ($row_all_user['uid'] != 1){
					if ($row_all_user['manage_user'] == 1){?>
            <a class="showing_2" rel="manage_user" rev="<?php echo $row_all_user['uid'];?>" style="display:block"></a> <a class="not_showing_2" rel="manage_user" rev="<?php echo $row_all_user['uid'];?>" style="display:none"></a>
            <?php } else {  ?>
            <a class="showing_2" rel="manage_user" rev="<?php echo $row_all_user['uid'];?>" style="display:none"></a> <a class="not_showing_2" rel="manage_user" rev="<?php echo $row_all_user['uid'];?>" style="display:block"></a>
            <?php } 
					}
		  } else {
			  echo '-';
		  }?></td>
          <td width="70" align="center" class="manage_edit"><?php 
					if ($row_all_user['uid'] != 1){
					if ($row_all_user['manage_banner'] == 1){?>
            <a class="showing_2" rel="manage_banner" rev="<?php echo $row_all_user['uid'];?>" style="display:block"></a> <a class="not_showing_2" rel="manage_banner" rev="<?php echo $row_all_user['uid'];?>" style="display:none"></a>
            <?php }  else { ?>
            <a class="showing_2" rel="manage_banner" rev="<?php echo $row_all_user['uid'];?>" style="display:none"></a> <a class="not_showing_2" rel="manage_banner" rev="<?php echo $row_all_user['uid'];?>" style="display:block"></a>
            <?php } 
					}?></td>
          <td width="60" align="center" class="manage_edit"><?php 
					if ($row_all_user['uid'] != 1){
					if ($row_all_user['manage_section'] == 1){?>
            <a class="showing_2" rel="manage_section" rev="<?php echo $row_all_user['uid'];?>" style="display:block"></a> <a class="not_showing_2" rel="manage_section" rev="<?php echo $row_all_user['uid'];?>" style="display:none"></a>
            <?php }  else { ?>
            <a class="showing_2" rel="manage_section" rev="<?php echo $row_all_user['uid'];?>" style="display:none"></a> <a class="not_showing_2" rel="manage_section" rev="<?php echo $row_all_user['uid'];?>" style="display:block"></a>
            <?php } 
					}?></td>
          <td width="60" align="center" class="manage_edit"><?php 
					if ($row_all_user['uid'] != 1){
					if ($row_all_user['manage_news'] == 1){?>
            <a class="showing_2" rel="manage_news" rev="<?php echo $row_all_user['uid'];?>" style="display:block"></a> <a class="not_showing_2" rel="manage_news" rev="<?php echo $row_all_user['uid'];?>" style="display:none"></a>
            <?php }  else { ?>
            <a class="showing_2" rel="manage_news" rev="<?php echo $row_all_user['uid'];?>" style="display:none"></a> <a class="not_showing_2" rel="manage_news" rev="<?php echo $row_all_user['uid'];?>" style="display:block"></a>
            <?php } 
					}?></td>
          <td width="60" align="center" class="manage_edit"><?php 
					if ($row_all_user['uid'] != 1){
					if ($row_all_user['manage_content'] == 1){?>
            <a class="showing_2" rel="manage_content" rev="<?php echo $row_all_user['uid'];?>" style="display:block"></a> <a class="not_showing_2" rel="manage_content" rev="<?php echo $row_all_user['uid'];?>" style="display:none"></a>
            <?php }  else {?>
            <a class="showing_2" rel="manage_content" rev="<?php echo $row_all_user['uid'];?>" style="display:none"></a> <a class="not_showing_2" rel="manage_content" rev="<?php echo $row_all_user['uid'];?>" style="display:block"></a>
            <?php } 
					}?></td>
          <td width="60" align="center" class="manage_edit"><?php 
				if ($row_all_user['uid'] != 1){
					if ($row_all_user['manage_gallery'] == 1){?>
            <a class="showing_2" rel="manage_gallery" rev="<?php echo $row_all_user['uid'];?>" style="display:block"></a> <a class="not_showing_2" rel="manage_gallery" rev="<?php echo $row_all_user['uid'];?>" style="display:none"></a>
            <?php }  else {?>
            <a class="showing_2" rel="manage_gallery" rev="<?php echo $row_all_user['uid'];?>" style="display:none"></a> <a class="not_showing_2" rel="manage_gallery" rev="<?php echo $row_all_user['uid'];?>" style="display:block"></a>
            <?php }
					}?></td>
          <td width="60" align="center" class="manage_edit"><?php 
				if ($row_all_user['uid'] != 1){
					if ($row_all_user['manage_product'] == 1){?>
            <a class="showing_2" rel="manage_product" rev="<?php echo $row_all_user['uid'];?>" style="display:block"></a> <a class="not_showing_2" rel="manage_product" rev="<?php echo $row_all_user['uid'];?>" style="display:none"></a>
            <?php }  else {?>
            <a class="showing_2" rel="manage_product" rev="<?php echo $row_all_user['uid'];?>" style="display:none"></a> <a class="not_showing_2" rel="manage_product" rev="<?php echo $row_all_user['uid'];?>" style="display:block"></a>
            <?php }
					}?></td>
          <td width="22" align="center">
          <?php if ($row_all_user['uid'] != 1){?>
          <a href="javascript:TINY.box.show({iframe:'addAdmin.php?id=<?=$row_all_user['uid']?>&action=edit',boxid:'frameless',width:960,height:800,fixed:true,maskid:'blackmask',maskopacity:70, closejs:function(){closeJS()}})" class="btn_edit_2" title="修改"></a>
          <?php }?></td>
          <td width="22" align="center"><?php if ($row_all_user['uid'] != 1){?>
            <a class="btn_delete" rel="<?php echo $row_all_user['uid']; ?>"></a>
            <?php } ?></td>
        </tr>
      </table>
      <?php
                $i++;
				} while ($row_all_user = mysql_fetch_assoc($sql_all_user));
			} 
		}?>
      <div class="clearfix" style="height:50px;"></div>
    </div>
  </section>
</div>
<?php include 'library/bottom.php'; ?>
</body>
</html>
