<!--<?php
include_once PrintEot('left');
print<<<EOT
-->
<!-- <h2 class="h1 mb10"><a href="$admin_file?adminjob=app&admintype=appslist">返回基礎應用列表</a></h2> -->
<!--
EOT;
if(!$action){print <<<EOT
-->
<div class="nav3 mb10">
	<ul class="cc">
		<li class="current"><a href="$basename">相冊設置</a></li>
		<li><a href="$admin_file?adminjob=apps&admintype=photos_manage" onclick="openNewUrl('photos_manage','相冊管理',this.href);return false;">內容管理</a></li>
	</ul>
</div>
<form action="$basename&" method="post">
  <input type="hidden" name="step" value="3">
  <h2 class="h1">相冊基本設置</h2>
  <div class="admin_table mb10">
  <table width="100%" cellspacing="0" cellpadding="0">
    <tr class="tr1 vt">
      <td class="td1">相冊功能</td>
      <td class="td2">
      	<div class="list_A list_80">
           <ul class="cc">
               <li><input type="radio" name="phopen" value="1" $phopen_Y />開啟</li>
              <li><input type="radio" name="phopen" value="0" $phopen_N />關閉</li>
          </ul>
        </div>
		</td>
       <td class="td2"><div class="help_a">開啟後，相冊功能才可以使用</div></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">驗證碼</td>
      <td class="td2">
     	 <div class="list_A list_80">
                    <ul class="cc">
                        <li><input type="radio" name="config[photos_gdcheck]" value="1" $photos_gdcheck_Y />開啟</li>
                        <li><input type="radio" name="config[photos_gdcheck]" value="0" $photos_gdcheck_N />關閉</li>
                    </ul>
                </div>
		</td>
        <td class="td2"><div class="help_a">開啟後，創建相冊時需要填寫驗證碼</div></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">驗證問題</td>
      <td class="td2">
      		<div class="list_A list_80">
                    <ul class="cc">
                        <li><input type="radio" name="config[photos_qcheck]" value="1" $photos_qcheck_Y />開啟</li>
                        <li><input type="radio" name="config[photos_qcheck]" value="0" $photos_qcheck_N />關閉</li>
                    </ul>
                </div>
		</td>
       <td class="td2"><div class="help_a">開啟後，創建相冊時需要填寫驗證問題</div></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">允許創建相冊的用戶組</td>
      <td class="td2">$creategroup</td>
      <td class="td2"><div class="help_a">指定可以使用的相冊功能的用戶組</div></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">會員可以創建的相冊數</td>
      <td class="td2"><input name="config[albumnum2]" value="$o_albumnum2" class="input input_wa" maxlength="8" /></td>
      <td class="td2"><div class="help_a">指定每個會員可以創建的相冊數量上限</div></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">相冊最多可容納的照片數</td>
      <td class="td2"><input name="config[maxphotonum]" value="$o_maxphotonum" class="input input_wa mr20" maxlength="8" />
      </td>
       <td class="td2"><div class="help_a">指定每個相冊可以容納的照片數上限(不適合太大，建議值:20-30)</div></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">相冊分目錄建立標準</td>
      <td class="td2">
          <ul class="list_A">
              <li><input type="radio" name="config[mkdir]" value="1" $mkdir1 />按月存入不同目錄</li>
              <li><input type="radio" name="config[mkdir]" value="2" $mkdir2 />按日存入不同目錄</li>
              <li><input type="radio" name="config[mkdir]" value="3" $mkdir3 />按群組ID存入不同目錄</li>
          </ul>
        </td>
        <td class="td2"><div class="help_a"><!--相冊分目錄建立標準--></div></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">圖片最大尺寸[KB]</td>
      <td class="td2"><input name="config[maxfilesize]" value="$o_maxfilesize" class="input input_wa" maxlength="8" /></td>
      <td class="td2"><div class="help_a">上傳的每張照片允許的最大尺寸，單位為KB。<font color="red">&nbsp;注意︰系統限制上傳附件最大尺寸為{$maxuploadsize}</font></div></td>
    </tr>
  </table>
  </div>
  <h3 class="h1"><span class="mr20">相冊積分獎懲設置</span><span class="linka">注:<b>威望積分</b>支持小數點後一位，其他積分只允許整數！</span></h3>
  <div class="admin_table mb10">
  <table width="100%" cellspacing="0" cellpadding="0">
    <tr class="tr2">
      <td class="td2">積分名稱</td>
      <td class="td2">創建相冊(-)</td>
      <td class="td2">上傳照片(+)</td>
      <td class="td2">刪除照片(-)</td>
    </tr>
<!--
EOT;
foreach($credit->cType as $key => $value){print <<<EOT
-->
    <tr class="tr1 vt">
      <td class="td2">$value</td>
      <td class="td2"><input name="creditset[Createalbum][$key]" value="{$creditset[Createalbum][$key]}" class="input input_wc" /></td>
      <td class="td2"><input name="creditset[Uploadphoto][$key]" value="{$creditset[Uploadphoto][$key]}" class="input input_wc" /></td>
      <td class="td2"><input name="creditset[Deletephoto][$key]" value="{$creditset[Deletephoto][$key]}" class="input input_wc" /></td>
    </tr>
<!--
EOT;
}print <<<EOT
-->
  </table>
  </div>
  <h3 class="h1"><span class="mr20">相冊積分流通記錄</span><span class="linka">此功能可以詳細記錄某種積分的流通情況，幫助站長更加清晰地掌握論壇的積分狀況！</span></h3>
  <div class="admin_table mb10">
  <table width="100%" cellspacing="0" cellpadding="0">
    <tr class="tr2">
      <td class="td2">積分名稱</td>
      <td class="td2">創建相冊</td>
      <td class="td2">上傳照片</td>
      <td class="td2">刪除照片</td>
    </tr>
<!--
EOT;
foreach($credit->cType as $key => $value){print <<<EOT
-->
    <tr class="tr1 vt">
      <td class="td2">$value</td>
      <td class="td2"><input type="checkbox" name="creditlog[Createalbum][$key]" value="1" {$creditlog[Createalbum][$key]} /></td>
      <td class="td2"><input type="checkbox" name="creditlog[Uploadphoto][$key]" value="1" {$creditlog[Uploadphoto][$key]} /></td>
      <td class="td2"><input type="checkbox" name="creditlog[Deletephoto][$key]" value="1" {$creditlog[Deletephoto][$key]} /></td>
    </tr>
<!--
EOT;
}print <<<EOT
-->
  </table>
  </div>
  <div class="mb10 tac">
    <span class="btn"><span><button type="submit">提 交</button></span></span>
   </div>
</form>
<!--
EOT;
}elseif($action == 'albums'){print<<<EOT
-->
<div class="nav3 mb10 ta">
    <ul class="cc">
   	  <li class="current"><a href="$basename&action=albums">相冊管理</a></li>
      <li><a href="$basename&action=photos">照片管理</a></li>
    </ul>
</div>
<!--
EOT;
if ($job == 'edit'){print <<<EOT
-->
<form action="$basename&action=albums&job=edit" method="post">
  <input type="hidden" name="step" value="2">
  <input type="hidden" name="aid" value="$aid">
  <input type="hidden" name="url_aname" value="$aname">
  <input type="hidden" name="url_owner" value="$owner">
  <input type="hidden" name="url_crtime_s" value="$crtime_s">
  <input type="hidden" name="url_crtime_e" value="$crtime_e">
  <input type="hidden" name="url_lasttime_s" value="$lasttime_s">
  <input type="hidden" name="url_lasttime_e" value="$lasttime_e">
  <input type="hidden" name="url_private" value="$private">
  <input type="hidden" name="url_lines" value="$lines">
  <input type="hidden" name="url_orderway" value="$orderway">
  <input type="hidden" name="url_ordertype" value="$ordertype">
  <input type="hidden" name="url_page" value="$page">
  <h2 class="h1">相冊編輯</h2>
  <div class="admin_table mb10">
  <table width="100%" cellspacing="0" cellpadding="0">
    <tr class="tr1 vt">
      <td class="td1">相冊名稱</td>
      <td class="td2"><input class="input input_wa" name="aname" value="$album[aname]"></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">相冊描述</td>
      <td class="td2"><textarea name="aintro" cols="30" class="textarea">$album[aintro]</textarea></td>
    </tr>
    <tr class="tr1 vt">
    <td class="td1">可見度</td>
    <td class="td2">
    <select name="private" class="select_wa" onchange="optionsel(this.value)">
    <option value="0" $private_0>全站可見</option>
    <option value="1" $private_1>僅好友可見</option>
    <option value="2" $private_2>僅自己可見</option>
    <option value="3" $private_3>需要密碼訪問</option>
    </select>&nbsp;&nbsp;&nbsp;&nbsp;
<!--
EOT;
if($album['private'] == 3){print <<<EOT
-->	
<a href="javascript:;" onclick="optionsel(3)">重設密碼</a>
<!--
EOT;
}print <<<EOT
-->	
    </td>
    </tr>
	<tbody id="photopwd"  style="display:none;">
	<tr tr1 vt>
		<th class="td1">輸入密碼</th>
		<td class="td2">
			<input type="password" name="pwd"  class="input_wa input mr10" id="pwdinfo" /><span id="pwdinfo_warn" class="gray">最小長度:3 最大長度:15</span>
		</td>
	</tr>
	<tr>
		<td class="td1">確認密碼</td>
		<td class="td2">
			<input type="password" name="repwd" class="input input_wa" />
		</td>
	</tr>
	</tbody>
  </table>
  </div>
  <div class="mb10 tac">
    <span class="btn"><span><button type="submit" name="button">提 交</button></span></span>
    <span class="bt"><span><button type="button" onclick="javascript:history.go(-1);">返 回</button></span></span>
   </div>
</form>
<script>
	function optionsel(id) {
		pwdobj = getObj('photopwd');
		if (isNaN(id)) {
			showDialog('error','非法操作');
		}
		if (id == '3') {
			pwdobj.style.display = '';
		} else {
			pwdobj.style.display = 'none';
		}
	}
</script>
<!--
EOT;
}else{print <<<EOT
-->
<script type="text/javascript" src="js/date.js"></script>
<form action="$basename&action=albums&" method="post">
  <h2 class="h1">相冊搜索</h2>
  <div class="admin_table mb10">
  <table width="100%" cellspacing="0" cellpadding="0">
    <tr class="tr1 vt">
      <td class="td1">相冊名稱</td>
      <td class="td2"><input type="text" name="aname" value="$aname" class="input input_wa"></td>
      <td class="td2"><!--相冊名稱（可使用通配符“*”）--></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">用戶名</td>
      <td class="td2">
        <input type="text" name="owner" value="$owner" class="input input_wa">
      </td>
      <td class="td2"><!--作者名稱（可使用通配符“*”）--></td>
    </tr>

    <tbody id="advanceSearchBody" style="display:$searchDisplay;">
    <tr class="tr1 vt">
      <td class="td1">發表日期</td>
      <td class="td2">
       <div class="input_img fl"><i onclick="this.nextSibling.onclick()" class="input_time" title="選擇時間">選擇時間</i><input type="text" name="crtime_s" value="$crttimeStartString" id="crtime_s" onclick="javascript:ShowCalendar(this.id)"></div><span class="p_lr_10 fl">至</span><div class="input_img fl"><i class="input_time" onclick="this.nextSibling.onclick()" title="選擇時間">選擇時間</i><input type="text" name="crtime_e" id="crtime_e" value="$crttimeEndString" onclick="javascript:ShowCalendar(this.id)"></div>
        </td>
        <td class="td2"><!--發表日期--></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">最後更新日期</td>
      <td class="td2">
      <div class="input_img fl"><i onclick="javascript:ShowCalendar('lasttime_s')" class="input_time" title="選擇時間">選擇時間</i> <input type="text" name="lasttime_s" id="lasttime_s" value="$lasttimeStartString" onclick="javascript:ShowCalendar(this.id)"></div><span class="p_lr_10 fl">至</span><div class="input_img fl"><i class="input_time" onclick="this.nextSibling.onclick()" title="選擇時間">選擇時間</i><input type="text" name="lasttime_e" id="lasttime_e" value="$lasttimeEndString" onclick="javascript:ShowCalendar(this.id)"></div>
        </td>
        <td class="td2"><!--最後更新日期--></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">可見度</td>
      <td class="td2">$photoPrivateSelection</td>
        <td class="td2"><!--可見度--></td>
    </tr>
    </tbody>

    <tr class="tr1 vt">
      <td class="td1">排序</td>
      <td class="td2">$orderBySelection
        	 <ul class="cc list_80 fl list_A">
                	<li><input type="radio" name="ordertype" value="asc" $ascChecked>正序</li>
                    <li><input type="radio" name="ordertype" value="desc" $descChecked>倒序</li>
             </ul>
        </td>
       <td class="td2"><!--排序--></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">每頁顯示條數</td>
      <td class="td2"><input type="text" name="lines" value="$lines" class="input input_wa"></td>
      <td class="td2"><!--每頁顯示條數--></td>
    </tr>
  </table>
  </div>
  <div class="mb10 tac">
    <span class="mr10"><span class="btn"><span><button type="submit">提 交</button></span></span></span>
    <a href="javascript:;" id="advanceSearchButton">高級搜索<input type="hidden" id="searchDisplay" name="searchDisplay" value="$searchDisplay"></a>
   </div>
</form>
<script type="text/javascript">
getObj('advanceSearchButton').onclick = function() {
	displayElementConflict('advanceSearchBody','advanceSearchButton');
	if(getObj('searchDisplay')){
		getObj('searchDisplay').value = getObj('advanceSearchBody').style.display;
	}
};
function displayElementConflict(elementId,buttonId,isDisplay) {
	if (undefined == isDisplay && typeof buttonId === 'string') {
		getObj(elementId).style.display = getObj(elementId).style.display == 'none' ? '' : 'none';
		getObj(buttonId).innerHTML = getObj(elementId).style.display == ''? '簡單搜索' : '高級搜索';
	} else {
		getObj(elementId).style.display = isDisplay ? '' : 'none';
	}
}
</script>

<form action="$basename&action=albums&" method="post" name="FORM">
  <input type="hidden" name="job" value="delete">
  <input type="hidden" name="aname" value="$aname">
  <input type="hidden" name="owner" value="$owner">
  <input type="hidden" name="crtime_s" value="$crtime_s">
  <input type="hidden" name="crtime_e" value="$crtime_e">
  <input type="hidden" name="lasttime_s" value="$lasttime_s">
  <input type="hidden" name="lasttime_e" value="$lasttime_e">
  <input type="hidden" name="private" value="$private">
  <input type="hidden" name="lines" value="$lines">
  <input type="hidden" name="orderway" value="$orderway">
  <input type="hidden" name="ordertype" value="$ordertype">
  <input type="hidden" name="page" value="$page">
  <h2 class="h1">相冊列表</h2>
  <div class="admin_table mb10">
  <table width="100%" cellspacing="0" cellpadding="0">
    <tr class="tr2 vt td_bgB">
      <td width="30"><span onclick="CheckAll(document.FORM)" class="cp">全選</span></td>
      <td>標題</td>
      <td>作者</td>
      <td>發表時間</td>
      <td>最後更新時間</td>
      <td>可見度</td>
      <td>照片數</td>
      <td>操作</td>
    </tr>
<!--
EOT;
if (empty($albumdb)) {print <<<EOT
-->
<tr><td class="p10" colspan="8"><div class="admin_tips">啊哦，沒有你要的信息！</div></td></tr>
<!--
EOT;
} else {
foreach ($albumdb as $key => $album) {
if(!$album['aname'])continue;
print <<<EOT
-->
    <tr class="tr1 vt">
      <td class="td2"><input type="checkbox" name="selid[]" value="$album[aid]"></td>
      <td class="td2"><a href="apps.php?q=photos&uid=$album[ownerid]&a=album&aid=$album[aid]" target="_blank" title="$album[aname]">$album[s_aname]</a></td>
      <td class="td2"><a href="{$db_userurl}$album[ownerid]" target="_blank">$album[owner]</a></td>
      <td class="td2">$album[crtime]</td>
      <td class="td2">$album[lasttime]</td>
      <td class="td2">
<!--
EOT;
if ($album['private'] == 0) {print <<<EOT
-->
        全站可見
<!--
EOT;
}elseif ($album['private'] == 1) {print <<<EOT
-->
        僅好友可見
<!--
EOT;
}elseif ($album['private'] == 2) {print <<<EOT
-->
        僅自己可見
<!--
EOT;
}elseif ($album['private'] == 3) {print <<<EOT
-->
        需要密碼訪問
<!--
EOT;
}print <<<EOT
-->
      </td>
      <td class="td2">$album[photonum]</td>
      <td class="td2"><a href="$basename&action=albums&job=edit&aid=$album[aid]&aname=$encode_aname&owner=$encode_owner&crtime_s=$crtime_s&crtime_e=$crtime_e&lasttime_s=$lasttime_s&lasttime_e=$lasttime_e&private=$private&lines=$lines&orderway=$orderway&ordertype=$ordertype&page=$page&" class="mr10">[編輯]</a><a href="$basename&action=photos&job=list&aid=$album[aid]">[管理]</a></td>
    </tr>
<!--
EOT;
}}print <<<EOT
-->
  </table>
  </div>
  <div class="cc">$pages</div>
  <div class="mb10 tac">
	<span class="bt"><span><button type="button" onclick="CheckAll(document.FORM)">全 選</button></span></span>
    <span class="btn"><span><button type="submit" name="button" onclick="return Checkdel();">刪除</button></span></span>
   </div>
</form>
<script>
function checkdel(){
	if(confirm("確定要刪除所選相冊嗎？" )){
		return true;
	}else{
		return false;
	}
}
</script>

<!--
EOT;
}}elseif($action == 'photos'){print<<<EOT
-->
<div class="nav3 mb10 ta">
    <ul class="cc">
      <li><a href="$basename&action=albums">相冊管理</a></li>
      <li class="current"><a href="$basename&action=photos">照片管理</a></li>
    </ul>
</div>
<!--
EOT;
print <<<EOT
-->
<script type="text/javascript" src="js/date.js"></script>
<form action="$basename&action=photos&" method="post">
  <input type="hidden" name="job" value="list">
  <h2 class="h1">照片搜索</h2>
  <div class="admin_table mb10">
  <table width="100%" cellspacing="0" cellpadding="0">
    <tr class="tr1 vt">
      <td class="td1">所屬相冊名稱</td>
      <td class="td2"><input type="text" name="aname" value="$aname" class="input input_wa"></td>
      <td class="td2"><!--所屬相冊名稱（可使用通配符“*”）--></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">所屬相冊ID</td>
      <td class="td2"><input type="text" name="aid" value="$aid" class="input input_wa"></td>
      <td class="td2"><!--所屬相冊ID--></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">用戶名</td>
      <td class="td2"><input type="text" name="uploader" value="$uploader" class="input input_wa"></td>
      <td class="td2"><!--作者名稱（可使用通配符“*”）--></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">描述</td>
      <td class="td2"><input type="text" name="pintro" value="$pintro" class="input input_wa"></td>
      <td class="td2"><!--描述（可使用通配符“*”）--></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">上傳日期</td>
      <td class="td2">
       <div class="input_img fl"><i onclick="this.nextSibling.onclick()" class="input_time" title="選擇時間">選擇時間</i><input type="text" name="uptime_s" value="$uptimeStartString" id="uptime_s" onclick="javascript:ShowCalendar(this.id)"></div><span class="p_lr_10 fl">至</span><div class="input_img fl"><i class="input_time" onclick="this.nextSibling.onclick()" title="選擇時間">選擇時間</i><input type="text" name="uptime_e" id="uptime_e" value="$uptimeEndString" onclick="javascript:ShowCalendar(this.id)"></div>
        </td>
        <td class="td2"><!--上傳日期--></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">排序</td>
      <td class="td2">$orderBySelection
        <ul class="cc list_80 fl list_A">
            <li><input type="radio" name="ordertype" value="asc" {$ordertypeasc}>正序</li>
            <li><input type="radio" name="ordertype" value="desc" {$ordertypedesc}>倒序</li>
         </ul>
        </td>
        <td class="td2"><!--排序--></td>
    </tr>
    <tr class="tr1 vt">
      <td class="td1">每頁顯示條數</td>
      <td class="td2"><input type="text" name="lines" value="$lines" class="input input_wa"></td>
      <td class="td2"><!--每頁顯示條數--></td>
    </tr>
  </table>
  </div>
  <div class="mb10 tac">
    <span class="btn"><span><button type="submit">提 交</button></span></span>
   </div>
</form>

<style>
.admin_appimg li{float:left;width:150px;height:200px;line-height:18px; text-align:center;}
.admin_appimg li a.aimg{width:100px;height:100px;padding:5px;border:1px solid #ccc;background:#fff;margin-bottom:3px;display:block;line-height:100px;}
.admin_appimg li img{margin-top:expression((100 - this.height )/2);max-width:100px;max-height:100px;_height:100px;_width:100px;}
</style>
<form action="$basename&action=photos&" method="post">
  <input type="hidden" name="job" value="delete">
  <input type="hidden" name="aid" value="$aid">
  <input type="hidden" name="aname" value="$aname">
  <input type="hidden" name="uploader" value="$uploader">
  <input type="hidden" name="pintro" value="$pintro">
  <input type="hidden" name="uptime_s" value="$uptime_s">
  <input type="hidden" name="uptime_e" value="$uptime_e">
  <input type="hidden" name="orderway" value="$orderway">
  <input type="hidden" name="ordertype" value="$ordertype">
  <input type="hidden" name="lines" value="$lines">
  <input type="hidden" name="page" value="$page">
  <h2 class="h1 mb10">照片列表</h2>
  <div class="mb10">
<!--
EOT;
if (empty($cnpho)) {print <<<EOT
-->
<div class="admin_tips">啊哦，沒有你要的信息！</div>
<!--
EOT;
}else{print <<<EOT
-->
    <ul class="admin_appimg">
<!--
EOT;
foreach ($cnpho as $key => $photo) {print <<<EOT
-->
      <li><a href="apps.php?q=photos&a=view&pid=$photo[pid]" target="_blank" class="aimg"><img src="$photo[path]" title="$photo[aname]"/> </a>
        <p>所屬相冊:<a href="$basename&action=photos&job=list&aid=$photo[aid]" title="$photo[aname]">$photo[s_aname]</a></p>
        <p> <a href="$admin_file?adminjob=mode&admintype=o_comments&job=list&type=photo&typeid=$photo[pid]" onclick="openNewUrl('o_comments','評論管理',this.href);return false;">照片評論（$photo[c_num]）</a></p>
        <p>選中
          <input type="checkbox" name="selid[]" value="$photo[pid]">
        </p>
      </li>
<!--
EOT;
}print <<<EOT
-->
    </ul>
<!--
EOT;
}print <<<EOT
-->
  </div>
  <div class="c"></div>
  <div class="cc">$pages</div>
  <div class="mb10 tac">
    <span class="bt"><span><button type='button' name='chkall' onclick='CheckAll(this.form)'>全 選</button></span></span>
    <span class="btn"><span><button type="submit" class="btn" onclick="return checkdel();">刪 除</button></span></span>
   </div>
</form>
<script>
function checkdel(){
	if(confirm("確定要刪除所選照片嗎？" )){
		return true;
	}else{
		return false;
	}
}
</script>

<!--
EOT;

}include_once PrintEot('adminbottom');
?>-->
