<?php
include("qs.php");
require( '../data/config.php');
$conn=mysql_connect($db_host,$db_user,$db_pass);
mysql_query("set names 'utf8'");
mysql_select_db($db_name);
if (PHP_VERSION >= '5.1' && !empty($timezone))
{
    date_default_timezone_set($timezone);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML xmlns="http://www.w3.org/1999/xhtml">
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<META http-equiv="Pragma" content="no-cache" />
<LINK href="css/general.css" rel="stylesheet" type="text/css" />
<LINK href="css/main.css" rel="stylesheet" type="text/css" />
</HEAD><BODY>
<div class="h2">系统管理 >> 相薄管理</div>
<div class="list-div">

<table cellspacing='1' cellpadding='3'>
<tr>
  <th align='left'><table width="100" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td><div align="left">&nbsp;&nbsp;相薄管理</div></td>
        <td width="150"><div align="center"><h1><span class="action-span"><a href="pic_class_w.php">添加</a></span></h1>
        </div></td>
      </tr>
    </table></th>
</tr>
<tr><td align="left" valign="top" style="background:#F5F5F5;padding-bottom:8px;">
<TABLE cellSpacing=0 cellPadding=0 width="90%" border=0 CALLPADDING="0" style="margin-right:30px;">
			  <tr>
                    <td height="20" bgcolor="#CCCCCC" style="PADDING-LEFT: 8px; PADDING-TOP: 8px">排序</td>
                    <td bgcolor="#CCCCCC" style="PADDING-LEFT: 8px; PADDING-TOP: 8px"><span class="STYLE1">名称</span></td>
                <td width="11%" bgcolor="#CCCCCC" class="STYLE1"><div align="center">密码访问</div></td>
                    <td bgcolor="#CCCCCC"><div align="center" class="STYLE1">操作</div></td>
          </tr>
				<?php 
				$nid=array();
				$npx=array();
				$ntitle=array();
				$nshow1=array();
				$password=array();
				$i=0;
				$sql="select * from tm_pic_class order by px";
		  $rsql=mysql_query($sql);
		  while($rs=mysql_fetch_object($rsql))
		  {
		  $nid[$i]=$rs->id;
		  $npx[$i]=$rs->px;
		  $password[$i]=$rs->password;
		  $ntitle[$i]=$rs->title;
		  $i++;
		  }
				?>
<form id="form1" name="form1" method="post" action="pic_class_w.php">
			   <?php
			for($i=0;$i<count($nid);$i++)
		  {
			  ?>
             <TR BORDER="0" WIDTH="100%" bgcolor="#DDDDDD" onmousemove="this.style.color='#000000';this.style.backgroundColor='#C5C5C5'" onmouseout="this.style.backgroundColor='#DDDDDD';this.style.color='#000000'">
                <TD width="6%"  height=25 
                align=left vAlign=top style="PADDING-LEFT: 8px; PADDING-TOP: 8px; border-bottom:#666666 dotted 1px;">
                  <input name="px<?php echo $nid[$i];?>" type="text" id="px<?php echo $nid[$i];?>" style="background:#EEEEEE; border:none; width:30px; text-align:center; border-bottom:#000000 1px solid;" value="<?php echo $npx[$i];?>" /></TD>
                <TD  height=20 
                align=left vAlign=top style="PADDING-LEFT: 8px; PADDING-TOP: 8px; border-bottom:#666666 dotted 1px;">
                <?php echo $ntitle[$i];?></TD>
                <TD 
                align=left vAlign=top style="PADDING-LEFT: 8px; PADDING-TOP: 8px;border-bottom:#666666 dotted 1px;"><div align="center">
				   <img id="jin<?php echo $nid[$i];?>" src="<?php if($password[$i]=="") echo "images/close.gif"; else echo "images/righton.gif";?>" border="0" />
                </div></TD>
              
                <TD width="32%" 
                align=left vAlign=top style="PADDING-LEFT: 8px; PADDING-TOP: 8px;border-bottom:#666666 dotted 1px;"><div align="center"><a href="pic_class_w.php?id=<?php echo $nid[$i];?>">修改</a>&nbsp;<a onclick="return confirm('确定要删除吗,删除后数据不可恢复？')" href="pic_class_w.php?action=del&amp;id=<?php echo $nid[$i];?>">删除</a>&nbsp;<a href="pic_up.php?cid=<?php echo $nid[$i];?>">批量上传</a></div></TD>
            </TR>
			  
		  <?php }?>

			<TR BORDER="0" WIDTH="100%">
              <TD height="30"  colspan="5"><input type="submit" name="Submit" value="修改排序" />
		                      <input name="action" type="hidden" id="action" value="px" /></TD>
            </TR>
</form>	
      </TABLE>
</td>
</tr></table></div>

<?php include "boot.php";?>
</body></html>
<script language="JavaScript" >

function chkform(theForm,msg,action){
	if (confirm(msg)){

		document.forms[theForm].action.value = action;
		document.forms[theForm].submit();
		return true;
	}else{
		return false;
	}
}

// -------- 全選或取消 checkbox 方塊
<!--
function select_all(formName, elementName, selectAllName) {
	if(document.forms[formName].elements[selectAllName].checked) {
		
		if(document.forms[formName].elements[selectAllName].length = 1 &&
		    typeof(document.forms[formName].elements[elementName]) != "undefined" ) {
		
			document.forms[formName].elements[elementName].checked = true;

		    for(var i = 0; i < document.forms[formName].elements[elementName].length; i++)
			document.forms[formName].elements[elementName][i].checked = true;
		}
	}
	else {
		if(document.forms[formName].elements[selectAllName].length = 1 &&
		    typeof(document.forms[formName].elements[elementName]) != "undefined" ) {
			document.forms[formName].elements[elementName].checked = false;

		    for(var i = 0; i < document.forms[formName].elements[elementName].length; i++)
				document.forms[formName].elements[elementName][i].checked = false;
		}
	}
}
//-->
</script>