<?php (!defined('IN_ADMIN') || !defined('IN_MUDDER')) && exit('Access Denied'); ?>
<div id="body">
<? if($op == 'create') { ?>
<?if($jssort == 'shop'){?>
<?if($jscode){?>
<div class="space">
<div class="subtitle">调用商铺代码</div>
<table class="maintable" border="0" cellspacing="0" cellpadding="0">
<tr><td><textarea rows="3" class="txtarea" style="width:100%"><?=$jscode?></textarea></td></tr>
</table>
</div>
<?}?>
<form method="post" action="admincp.php?action=<?=$action?>&file=<?=$file?>&op=<?=$op?>&">
    <input type="hidden" name="jssort" value="<?=$jssort?>" />
    <div class="space">
        <div class="subtitle">JS调用</div>
        <table class="maintable" border="0" cellspacing="0" cellpadding="0">
            <tr class="altbg2">
                <th colspan="2">
                    <ul class="subtab">
                        <li<?=$jssort=='shop'?' class="current"':''?>><a href="admincp.php?action=<?=$action?>&file=<?=$file?>&op=<?=$op?>&jssort=shop">商铺调用</a></li>
                        <li<?=$jssort=='review'?' class="current"':''?>><a href="admincp.php?action=<?=$action?>&file=<?=$file?>&op=<?=$op?>&jssort=review">点评调用</a></li>
                    </ul>
                </th>
            </tr>
            <tr>
                <td width="50%" class="altbg1" valign="top"><strong>板块列表:</strong>设置要调用的板块,不选则调用全部</td>
                <td width="50%">
                <?if($_panels) foreach($_panels as $pcd => $panelname) { ?>
                    <input type="checkbox" name="panels[]" value="<?=$pcd?>" /> <?=$panelname?> <br />
                <?}?>
                </td>
            </tr>
            <tr>
                <td class="altbg1"><strong>调用类型:</strong>显示商铺的类型</td>
                <td><select name="sort">
                    <option value="1" selected="selected">热门商铺</option>
                    <option value="2">最佳商铺</option>
                    <option value="3">最新加入</option>
                </select>
                </td>
            </tr>
            <tr>
                <td class="altbg1"><strong>显示商铺数:</strong>设置商铺数量，请设置为大于 0 的整数，否则默认显示10条。</td>
                <td><input type="text" name="num" value="10" class="txtbox4" /></td>
            </tr>
            <tr>
                <td class="altbg1"><strong>商铺名称截取字节数:</strong>如果设置了显示所在板块，则会把板块字节数计算进去。设置0为不截取。</td>
                <td><input type="text" name="intercept" value="0" class="txtbox4" /></td>
            </tr>
            <tr>
                <td class="altbg1"><strong>在新窗口打开链接:</strong></td>
                <td><input type="radio" name="openwindow" value="1" checked="checked" /> 是&nbsp;&nbsp;<input type="radio" name="openwindow" value="0" /> 否</td>
            </tr>
            <tr>
                <td class="altbg1"><strong>显示商铺板块:</strong></td>
                <td><input type="radio" name="pcdname" value="1" /> 是&nbsp;&nbsp;<input type="radio" name="pcdname" value="0" checked="checked" /> 否</td>
            </tr>

        </table>
    </div>
    <center><input type="submit" name="jssubmit" value="生成JS代码" class="btn" /></center>
</form>
<?} elseif($jssort == 'review') {?>
<?if($jscode){?>
<div class="space">
<div class="subtitle">调用点评代码</div>
<table class="maintable" border="0" cellspacing="0" cellpadding="0">
<tr><td><textarea rows="3" class="txtarea" style="width:100%"><?=$jscode?></textarea></td></tr>
</table>
</div>
<?}?>
<form method="post" action="admincp.php?action=<?=$action?>&file=<?=$file?>&op=<?=$op?>&">
    <input type="hidden" name="jssort" value="review" />
    <div class="space">
        <div class="subtitle">JS调用</div>
        <table class="maintable" border="0" cellspacing="0" cellpadding="0">
            <tr class="altbg2">
                <th colspan="2">
                    <ul class="subtab">
                        <li<?=$jssort=='shop'?' class="current"':''?>><a href="admincp.php?action=<?=$action?>&file=<?=$file?>&op=<?=$op?>&jssort=shop">商铺调用</a></li>
                        <li<?=$jssort=='review'?' class="current"':''?>><a href="admincp.php?action=<?=$action?>&file=<?=$file?>&op=<?=$op?>&jssort=review">点评调用</a></li>
                    </ul>
                </th>
            </tr>
            <tr>
                <td width="50%" class="altbg1" valign="top"><strong>板块列表:</strong>设置要调用的板块,不选则调用全部</td>
                <td width="50%">
                <?if($_panels) foreach($_panels as $pcd => $panelname) { ?>
                    <input type="checkbox" name="panels[]" value="<?=$pcd?>" /> <?=$panelname?> <br />
                <?}?>
                </td>
            </tr>
            <tr>
                <td class="altbg1"><strong>调用类型:</strong>显示点评的类型</td>
                <td><select name="sort">
                    <option value="1" selected="selected">最新点评</option>
                    <option value="2">最多鲜花</option>
                    <option value="3">最多回应</option>
                </select>
                </td>
            </tr>
            <tr>
                <td class="altbg1"><strong>显示点评数:</strong>设置商铺数量，请设置为大于 0 的整数，否则默认显示10条。</td>
                <td><input type="text" name="num" value="10" class="txtbox4" /></td>
            </tr>
            <tr>
                <td class="altbg1"><strong>点评截取字节数:</strong>如果设置了显示所在板块，则会把板块字节数计算进去。设置0为不截取。</td>
                <td><input type="text" name="intercept" value="20" class="txtbox4" /></td>
            </tr>
            <tr>
                <td class="altbg1"><strong>在新窗口打开链接:</strong></td>
                <td><input type="radio" name="openwindow" value="1" checked="checked" /> 是&nbsp;&nbsp;<input type="radio" name="openwindow" value="0" /> 否</td>
            </tr>
            <tr>
                <td class="altbg1"><strong>显示商铺板块:</strong></td>
                <td><input type="radio" name="pcdname" value="1" /> 是&nbsp;&nbsp;<input type="radio" name="pcdname" value="0" checked="checked" /> 否</td>
            </tr>
        </table>
    </div>
    <center><input type="submit" name="jssubmit" value="生成JS代码" class="btn" /></center>
</form>
<?}?>
<? } elseif($op == 'config') { ?>
<form method="post" action="admincp.php?action=<?=$action?>&file=<?=$file?>&op=<?=$op?>&">
    <div class="space">
        <div class="subtitle">JS调用设置</div>
        <table class="maintable" border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td class="altbg1" class="altbg1" width="50%"><strong>开启JS调用功能:</strong>JS调用可以将系统内的热门商铺，点评嵌入到普通网页中。</td>
                <td>是 <input type="radio" name="jstransfer[enable]" value="1" <?=$jstransfer_enable[1]?> />&nbsp;&nbsp;&nbsp;否 <input type="radio" name="jstransfer[enable]" value="0" <?=$jstransfer_enable[0]?> /></td>
            </tr>
            <tr>
                <td class="altbg1"><strong>JS数据缓存时间:</strong>JS调用采用动态缓存技术来实现数据的定期更新以达到减轻服务器的负担，否则直接调用将消耗较多的系统资源，默认值为3600秒即一个小时,设置为0则不缓存(极耗费系统资源)。</td>
                <td><input type="text" name="jstransfer[cachelife]" value="<?=$jstransfer['cachelife']?>" class="txtbox4" /> 秒</td>
            </tr>
            <tr>
                <td class="altbg1"><strong>JS来路限制:</strong>只允许列表中的域名才可以使用JS调用功能，每个域名一行，请勿包含 http:// 或其他非域名内容，留空为不限制来路，即任何网站均可调用.但是多网站调用会加重您的服务器负担。</td>
                <td><textarea name="jstransfer[access]" rows="6" cols="40" class="txtarea"><?=$jstransfer['access']?></textarea></td>
            </tr>
        </table>
		<center><input type="submit" name="jssubmit" value=" 提交 " class="btn" /></center>
    </div>
</form>
<? } ?>
</div>