<?php defined('InShopNC') or exit('Access Invalid!');?>

<div class="page">
    <div class="fixed-bar">
        <div class="item-title">
            <h3>短信管理</h3>
            <ul class="tab-base">
                <li><a href="index.php?act=oper_sms&op=index" <?php if ($output['sign'] != 'verify') {?>class="current"<?php }?>><span><?php echo $lang['nc_manage'];?></span></a></li>
                <li><a href="index.php?act=oper_sms&op=send_sms_push"><span>短信push发送</span></a></li>
                <li><a href="index.php?act=oper_sms&op=awaken_user"><span>激活用户</span></a></li>
            </ul>
        </div>
    </div>
    <div class="fixed-empty"></div>
    <table class="table tb-type2" id="prompt">
        <tbody>
        <tr class="space odd">
            <th class="nobg" colspan="12">
                <div class="title">
                    <h5><?php echo $lang['nc_prompts'];?></h5>
                    <span class="arrow"></span>
                </div>
            </th>
        </tr>
        <tr>
            <td><ul>
                    <li>新增短信模板</li>
                </ul></td>
        </tr>
        </tbody>
    </table>
    <h3>新增短信模板</h3>
    <form action="index.php?act=oper_sms&op=sms_add" method="post" name="sms_add">
        <table class="table tb-type2 nobdb">
            <tbody>
            <tr>
                <td colspan="2" class="required"><label>短信模板标题：</label></td>
            </tr>
            <tr class="noborder">
                <td class="vatop rowform">
                    <input type="text" name="sms_title" id="sms_title" required>
                </td>
            </tr>
            <tr>
                <td class="vatop rowform">
                    <label>云通讯ID</label>
                </td>
            </tr>
            <tr class="noborder">
                <td class="vatop rowform">
                    <input type="text" name="yuntx_id" id="yuntx_id" required>
                </td>
            </tr>
            <tr>
                <td colspan="2" class="required"><label>短信模板内容：</label></td>
            </tr>
            <tr>
                <td class="vatop rowform">
                    <textarea name="sms_content" id="sms_content" cols="40" rows="20" required></textarea>
                </td>
            </tr>
            </tbody>
            <tfoot>
            <tr class="tfoot">
                <td colspan="2" ><a href="JavaScript:void(0);" class="btn" onclick="document.sms_add.submit()"><span><?php echo $lang['nc_submit'];?></span></a></td>
            </tr>
            </tfoot>
        </table>
    </form>
    <h3>短信模板列表</h3>
    <table class="table tb-type2">
        <thead>
        <tr class="thead">
            <th class="w96 center">模板ID</th>
            <th class="w96 center">云通讯ID</th>
            <th class="w96 center">模板标题</th>
            <th class="w96 center">模板内容</th>
            <th class="w96 center">是否启用</th>
        </tr>
        </thead>
        <tbody id="treet1">
        <?php if(!empty($output['template_list']) && is_array($output['template_list'])){ ?>
            <?php foreach($output['template_list'] as $k => $v){ ?>
                <tr class="hover edit row">
                    <td class="center"><?php echo $v['template_id'];?></td>
                    <td class="center"><?php echo $v['yuntx_id']?></td>
                    <td class="center"><?php echo $v['title'];?></td>
                    <td><?php echo $v['content'];?></td>
                    <td class="center"><?php if($v['disable'] == '0'){ echo "<input type='checkbox' checked disabled>";
                        }else {
                            echo "<input type='checkbox' disabled>";
                        }
                        ?></td>
                </tr>
            <?php }  ?>
        <?php }  ?>
        </tbody>
    </table>
</div>