<!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=<?php echo $cfg_soft_lang; ?>">
<title>系統配置參數 - 驗證安全設置</title>
<link href="css/base.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="../include/js/jquery/jquery.js" ></script>
<script type="text/javascript">
var $ = jQuery;
$(document).ready(function(){
	addIterm("qiterm","qbox");
})
//增加選項
function addIterm(qiterm,qbox)
{
	if($("#"+qiterm)){
		var iterm = $("#"+qiterm).children().clone()
		$("#"+qbox).append(iterm)
		//將其置為顯示狀態
		$("#"+qbox+" > #"+qiterm ).show();
	}
}
//刪除當前選項
function delIterm(obj)
{
	$(obj).parent().parent().remove();
}
</script>
</head>
<body background='images/allbg.gif' leftmargin='8' topmargin='8'>  
<form action="sys_safe.php" method="post" name="form1">
<input type="hidden" name="dopost" value="save">
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#D6D6D6">

    <tr>
      <td height="26" colspan="2" bgcolor="#FFFFFF" background="images/tbg.gif" style="padding-left:10px;"><b>驗證碼參數設置</b></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td width="26%" height="24">開啟系統驗證碼：<br></td>
      <td width="74%"><input name="gdopen[]" type="checkbox" id="gdopen1" value="1" <?php echo (preg_match("/1/",$safe_gdopen))? "checked" : ""; ?>>
        <label for='gdopen1'>註冊會員 </label>
        <input name="gdopen[]" type="checkbox" id="gdopen2" value="2" <?php echo (preg_match("/2/",$safe_gdopen))? "checked" : ""; ?>>
        <label for='gdopen2'>前台登陸 </label>
        <input name="gdopen[]" type="checkbox" id="gdopen3" value="3" <?php echo (preg_match("/3/",$safe_gdopen))? "checked" : ""; ?>>
        <label for='gdopen3'>會員投稿 </label>
        <input name="gdopen[]" type="checkbox" id="gdopen4" value="4" <?php echo (preg_match("/4/",$safe_gdopen))? "checked" : ""; ?>>
        <label for='gdopen4'>文檔評論 </label>
        <input name="gdopen[]" type="checkbox" id="gdopen5" value="5" <?php echo (preg_match("/5/",$safe_gdopen))? "checked" : ""; ?>>
        <label for='gdopen5'>會員短消息 </label>
        <input name="gdopen[]" type="checkbox" id="gdopen6" value="6" <?php echo (preg_match("/6/",$safe_gdopen))? "checked" : ""; ?>>
        <label for='gdopen6'>後台登陸 </label>
        <input name="gdopen[]" type="checkbox" id="gdopen7" value="7" <?php echo (preg_match("/7/",$safe_gdopen))? "checked" : ""; ?>>
        <label for='gdopen7'>問答 </label></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td height="24">驗證碼生成類型：</td>
      <td><input class="np" type="radio" value="1" name="codetype" id="cttpe1" <?php echo ($safe_codetype == 1)? "checked" : ""; ?>>
        <label for="cttpe1">數字</label>
        <input class="np" type="radio" value="2" name="codetype" id="cttpe2" <?php echo ($safe_codetype == 2)? "checked" : ""; ?>>
        <label for="cttpe2">英文</label>
        <input class="np" type="radio" value="3" name="codetype" id="cttpe3" <?php echo ($safe_codetype == 3)? "checked" : ""; ?>>
        <label for="cttpe3">單詞</label></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td height="24">選擇驗證碼文件類型：</td>
      <td><input name="gdtype" type="radio" value="1" id="dtype1" <?php echo ($safe_gdtype == 1)? "checked" : ""; ?>>
        <label for="dtype1">jpg &nbsp;</label>
        <input type="radio" name="gdtype" value="2" id="dtype2" <?php echo ($safe_gdtype == 2)? "checked" : ""; ?>>
        <label for="dtype2">png
          &nbsp;</label>
        <input type="radio" name="gdtype" value="3" id="dtype3" <?php echo ($safe_gdtype == 3)? "checked" : ""; ?>>
        <label for="dtype3">gif (GD&gt;= 2.0.28)</label></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td height="24">驗證碼干擾設置：</td>
      <td><input name="gdstyle[]" type="checkbox" value="1" id="dstyle1" <?php echo (preg_match("/1/",$safe_gdstyle))? "checked" : ""; ?>>
        <label for="dstyle1">背景線 &nbsp;</label>
        <input type="checkbox" name="gdstyle[]" value="2" id="dstyle2" <?php echo (preg_match("/2/",$safe_gdstyle))? "checked" : ""; ?>>
        <label for="dstyle2">背景圖像
          &nbsp;</label>
        <input type="checkbox" name="gdstyle[]" value="3" id="dstyle3" <?php echo (preg_match("/3/",$safe_gdstyle))? "checked" : ""; ?>>
        <label for="dstyle3">混雜文本色</label></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td height="24">驗證碼圖片大小（設置為0為不限）：</td>
      <td> 寬：
        <input name="gd_wwidth" type=text id="gd_wwidth"   value="<?php echo empty($safe_wwidth)? "" :$safe_wwidth ;?>" size="5">
        px
        高：
        <input name="gd_wheight" type=text id="gd_wheight"  value="<?php echo empty($safe_wheight)? "" :$safe_wheight ;?>" size="5">
        px</td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td height="24">驗證碼字符數：</td>
      <td><input name="codelen" type="text" id="codelen" value="<?php echo empty($safe_codelen)? "" :$safe_codelen ;?>">
        個(類型設為單詞,該屬性無效)</td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td height="24" colspan="2">&nbsp;</td>
    </tr>
    <tr>
      <td height="26" colspan="2" bgcolor="#FFFFFF" background="images/tbg.gif"><b>驗證問題設置</b></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td height="24"> 1、使用簡單的文字問題(例如:11+5=?，請輸入中文答案)<BR>
        2、使用html代碼(例如將問題做成一張小圖片   &lt;img src="地址" /&gt;)<BR>
        3、多個問題將隨機出現一個問題。</td>
      <td><table width="98%" border="0" cellspacing="2" cellpadding="0">
          <tbody id="qiterm" style="display:none">
            <tr>
              <td width="50%"><input name="question[]" type="text" size="30" value=""/></td>
              <td width="50%"><input name="answer[]" type="text" value=""/>
                <a onClick="delIterm(this);" style="cursor: pointer; color: rgb(250, 137, 27);">[刪除]</a></td>
            </tr>
          </tbody>
          <thead>
          <td width="50%">問題</td>
            <td width="50%">答案<a onclick='addIterm("qiterm","qbox");' style='cursor: pointer; color: rgb(0, 0, 255);'>[+增加]</a></td>
          </tr>
          </thead>
          
          <tbody>
            <?php
            	if(!empty($safefaqs))
                {
                	foreach ($safefaqs as $key => $safefaq) {
  
					
            ?>
            <tr>
              <td width="50%"><input name="question[]" type="text" value="<?php echo htmlspecialchars($safefaq['question']);?>" size="30"/></td>
              <td width="50%"><input name="answer[]" type="text" value="<?php echo $safefaq['answer']?>"/>
                <a onClick="delIterm(this);" style="cursor: pointer; color: rgb(250, 137, 27);">[刪除]</a></td>
            </tr>
            <?php
           			}
           		}
           ?>
          </tbody>
          <tbody id="qbox">
          </tbody>
        </table></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td height="24">註冊開啟驗證問題:</td>
      <td><input class="np" type="radio" value="1" name="gdfaq_reg" <?php echo ($safe_faq_reg == 1)? "checked" : ""; ?>>
        開啟
        <input class="np" type="radio" value="0" name="gdfaq_reg" <?php echo ($safe_faq_reg == 0)? "checked" : ""; ?>>
        關閉</td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td height="24">會員投稿開啟驗證問題:</td>
      <td><input class="np" type="radio" value="1" name="gdfaq_send" <?php echo ($safe_faq_send == 1)? "checked" : ""; ?>>
        開啟
        <input class="np" type="radio" value="0" name="gdfaq_send" <?php echo ($safe_faq_send == 0)? "checked" : ""; ?>>
        關閉</td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td height="24">短消息開啟驗證問題:</td>
      <td><input class="np" type="radio" value="1" name="gdfaq_msg" <?php echo ($safe_faq_msg == 1)? "checked" : ""; ?>>
        開啟
        <input class="np" type="radio" value="0" name="gdfaq_msg" <?php echo ($safe_faq_msg == 0)? "checked" : ""; ?>>
        關閉</td>
    </tr>
    <tr bgcolor="#F9FCEF">
      <td height="37" colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="7%">&nbsp;</td>
            <td width="93%" align="center"><input name="imageField" class="np" type="image" src="images/button_ok.gif" width="60" height="22" border="0">
              &nbsp; <img src="images/button_reset.gif" width="60" height="22"></td>
          </tr>
        </table></td>
    </tr>

</table>  
</form>
</body>
</html>
