<?php
include_once("inc/config.php");
include_once("inc/ftbbsdbclass.php");
include_once("inc/publicfun.php");
include_once("conn.php");
include_once("checkuser.php");
include_once("bbsuser.php");
$id=intval($_GET["id"]);
$userid=intval($_GET["userid"]);
$photo_name=ftbbs_request(trim($_GET["photo_name"]));
   
if ($_POST["pwd2"]!=""){
   $id=intval($_POST["id"]);
   $userid=intval($_POST["userid"]);
   $photo_name=ftbbs_request(trim($_POST["photo_name"]));
   $sql="update {$tablepre}ftblog_type set sign=2,alumpwd='".$_POST["pwd1"]."' where id=".$id;
   mysql_query($sql);
   $sql="update {$tablepre}ftbbs_upload set sign=2 where clubuser_id=".$userid." and photo_name='".$photo_name."'";
   mysql_query($sql);
   header("Location:blog_group.php?nav=a");
}
?>
<HTML>
<HEAD>
<TITLE>设置相册密码</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8>">
<link rel="stylesheet" type="text/css" href="css/ftbbs01.css">
<script language="JavaScript">
function OK(){
  var str1="";
  var strurl=document.form1.pwd1.value;
  if (strurl=="")
  {
  	alert("请先输入密码！");
	document.form1.pwd1.focus();
	return false;
  }
  if (form1.pwd1.value!=form1.pwd2.value)
   {
    alert("密码和确认密码不一致！");
    form1.pwd2.focus();
    return false;
  	}
  else
  { 
    document.form1.submit()
    window.close();
  }
}
</script>
</head>
<BODY bgColor=menu topmargin=15 leftmargin=15 >
<form name="form1" method="post" action="">
<table width=100% border="0" align="center" cellpadding="0" cellspacing="2">
  <tr><td>
<FIELDSET align=left>
        <LEGEND align=left>设置密码</LEGEND>
        <table width="100%" border="0" align=center cellpadding="0" cellspacing="3">
          <tr> 
            <td colspan="2">密    &nbsp;&nbsp;&nbsp;码： 
              <input name="pwd1" type="password" id="url" value='' size=10 maxlength="10"> 
            </td>
          </tr>
          <tr> 
            <td> 确认密码： 
              <input name="pwd2" type="password" id=alttext size=10 maxlength="10"> </td>
          </tr>
        </table>
</fieldset>
</td><td width=80 align="center"><input name="cmdOK" type="button" id="cmdOK" value="  确定  " onClick="OK();">
  <br>
        <input name="id" type="hidden" id="id" value="<?=$id?>"><input name="userid" type="hidden" id="userid" value="<?=$userid?>">
		<input name="photo_name" type="hidden" id="photo_name" value="<?=$photo_name?>"> <br>
<input name="cmdCancel" type=button id="cmdCancel" onclick="window.close();" value='  取消  '></td></tr>
</table>
</form>
</body>
</html>