123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255 |
- <link href="<?php echo ADMIN_TEMPLATES_URL;?>/css/recharge.css?7" rel="stylesheet" type="text/css" id="cssfile2" />
- <?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=merchant&op=provider"><span><?php echo $lang['nc_manage'] ?></span></a></li>
- <li><a href="JavaScript:void(0);" class="current"><span>通道省份编辑</span></a></li>
- </ul>
- </div>
- </div>
- <div class="fixed-empty"></div>
- <form id="user_form" enctype="multipart/form-data" method="post">
- <input type="hidden" name="form_submit" value="ok"/>
- <input type="hidden" name="provider_id" value="<?php echo $output['provider']['provider_id']?>"/>
- <table class="tb-type2 table">
- <tbody class="mw1250 block">
- <tr class="noborder">
- <td colspan="2" class="required"><label class="validation" for="name">通道名称:</label></td>
- </tr>
- <tr class="noborder">
- <td class="vatop"><?php echo $output['provider']['name']?></td>
- </tr>
- <tr class="noborder">
- <td colspan="2"><label for="end_period">选择省份:</label></td>
- </tr>
- <tr class="noborder">
- <td class="w400 inblock align-center required">
- 中国移动
- </td>
- <td class="w400 inblock align-center required">
- 中国联通
- </td>
- <td class="w400 inblock align-center required">
- 中国电信
- </td>
- </tr>
- <tr class="noborder">
- <td class="w400 inblock">
- <label>
- 全国:
- <input type="checkbox" name="<?php echo mtopcard\ChinaMobileCard;?>-province" data-name="move" id="move_cb_all" value="-1"
- <?php if(in_array(-1,$output['provinces'][mtopcard\ChinaMobileCard])){ echo 'checked';}?>/>
- </label>
- </td>
- <td class="w400 inblock">
- <label>
- 全国:
- <input type="checkbox" name="<?php echo mtopcard\ChinaUnicomCard;?>-province" data-name="unicom" id="unicom_cb_all" value="-1"
- <?php if(in_array(-1,$output['provinces'][mtopcard\ChinaUnicomCard])){ echo 'checked';}?>/>
- </label>
- </td>
- <td class="w400 inblock">
- <label>
- 全国:
- <input type="checkbox" name="<?php echo mtopcard\ChinaTelecomCard;?>-province" data-name="tel" id="tel_cb_all" value="-1"
- <?php if(in_array(-1,$output['provinces'][mtopcard\ChinaTelecomCard])){ echo 'checked';}?>/>
- </label>
- </td>
- </tr>
- <tr class="noborder">
- <td class="w400 inblock h200">
- <div class="w100pre">
- <?php foreach($output['province_list'] as $key => $province){ ?>
- <label style="display: inline-block;width: 70px;height: 30px;line-height: 30px;">
- <?php echo $province;?>
- <input type="checkbox" class="move_cb_box" name="<?php echo mtopcard\ChinaMobileCard;?>-province[]" data-name="move" style="vertical-align: middle;" value="<?php echo $key;?>"
- <?php if(in_array($key,$output['provinces'][mtopcard\ChinaMobileCard])){ echo 'checked';}?>
- />
- </label>
- <?php }?>
- </div>
- </td>
- <td class="w400 inblock h200">
- <div class="w100pre">
- <?php foreach($output['province_list'] as $key => $province){ ?>
- <label style="display: inline-block;width: 70px;height: 30px;line-height: 30px;">
- <?php echo $province;?>
- <input type="checkbox" class="unicom_cb_box" data-name="unicom" name="<?php echo mtopcard\ChinaUnicomCard;?>-province[]" style="vertical-align: middle;" value="<?php echo $key;?>"
- <?php if(in_array($key,$output['provinces'][mtopcard\ChinaUnicomCard])){ echo 'checked';}?>
- />
- </label>
- <?php }?>
- </div>
- </td>
- <td class="w400 inblock h200">
- <div class="w100pre">
- <?php foreach($output['province_list'] as $key => $province){ ?>
- <label style="display: inline-block;width: 70px;height: 30px;line-height: 30px;">
- <?php echo $province;?>
- <input type="checkbox" class="tel_cb_box" data-name="tel" name="<?php echo mtopcard\ChinaTelecomCard;?>-province[]" style="vertical-align: middle;" value="<?php echo $key;?>"
- <?php if(in_array($key,$output['provinces'][mtopcard\ChinaTelecomCard])){ echo 'checked';}?>
- />
- </label>
- <?php }?>
- </div>
- </td>
- </tr>
- </tbody>
- <tfoot>
- <tr class="tfoot">
- <td colspan="15"><a href="JavaScript:void(0);" class="btn"
- id="submitBtn"><span><?php echo $lang['nc_submit']; ?></span></a></td>
- </tr>
- </tfoot>
- </table>
- </form>
- </div>
- <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/dialog/dialog.js" id="dialog_js"
- charset="utf-8"></script>
- <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery-ui/jquery.ui.js"></script>
- <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/ajaxfileupload/ajaxfileupload.js"></script>
- <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/js/jquery.Jcrop/jquery.Jcrop.js"></script>
- <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/refill/layer.js"></script>
- <link href="<?php echo RESOURCE_SITE_URL; ?>/js/jquery.Jcrop/jquery.Jcrop.min.css" rel="stylesheet" type="text/css"
- id="cssfile2"/>
- <script type="text/javascript">
- $(function () {
- // 移动
- if($('#move_cb_all').is(":checked")) {
- $('.move_cb_box').each(function () {
- this.checked = true;
- $(this).attr("disabled",true);
- })
- }
- // 全选
- $('#move_cb_all').click(function() {
- if($(this).is(":checked")) {
- $('.move_cb_box').each(function () {
- this.checked = true;
- $(this).attr("disabled",true);
- })
- } else {
- $('.move_cb_box').each(function () {
- this.checked = false;
- $(this).attr("disabled",false);
- })
- }
- })
- $('.move_cb_box').each(function () {
- $(this).click(function () {
- // console.log(1, $(".cb_box:checked").length, $(".cb_box").length);
- if ($(".move_cb_box:checked").length == $(".move_cb_box").length) {
- $("#move_cb_all").attr("checked", "checked");
- $('#move_cb_all').attr("disabled",true);
- }else {
- $("#move_cb_all").removeAttr("checked");
- $('#move_cb_all').attr("disabled",false);
- };
- })
- })
- // 联通
- if($('#unicom_cb_all').is(":checked")) {
- $('.unicom_cb_box').each(function () {
- this.checked = true;
- $(this).attr("disabled",true);
- })
- }
- // 全选
- $('#unicom_cb_all').click(function() {
- if($(this).is(":checked")) {
- $('.unicom_cb_box').each(function () {
- this.checked = true;
- $(this).attr("disabled",true);
- })
- } else {
- $('.unicom_cb_box').each(function () {
- this.checked = false;
- $(this).attr("disabled",false);
- })
- }
- })
- $('.unicom_cb_box').each(function () {
- $(this).click(function () {
- // console.log(1, $(".cb_box:checked").length, $(".cb_box").length);
- if ($(".unicom_cb_box:checked").length == $(".unicom_cb_box").length) {
- $("#unicom_cb_all").attr("checked", "checked");
- $('#unicom_cb_all').attr("disabled",true);
- }else {
- $("#unicom_cb_all").removeAttr("checked");
- $('#unicom_cb_all').attr("disabled",false);
- };
- })
- })
- // 电信
- if($('#tel_cb_all').is(":checked")) {
- $('.tel_cb_box').each(function () {
- this.checked = true;
- $(this).attr("disabled",true);
- })
- }
- // 全选
- $('#tel_cb_all').click(function() {
- if($(this).is(":checked")) {
- $('.tel_cb_box').each(function () {
- this.checked = true;
- $(this).attr("disabled",true);
- })
- } else {
- $('.tel_cb_box').each(function () {
- this.checked = false;
- $(this).attr("disabled",false);
- })
- }
- })
- $('.tel_cb_box').each(function () {
- $(this).click(function () {
- // console.log(1, $(".cb_box:checked").length, $(".cb_box").length);
- if ($(".tel_cb_box:checked").length == $(".tel_cb_box").length) {
- $("#tel_cb_all").attr("checked", "checked");
- $('#tel_cb_all').attr("disabled",true);
- }else {
- $("#tel_cb_all").removeAttr("checked");
- $('#tel_cb_all').attr("disabled",false);
- };
- })
- })
- $("#submitBtn").click(function () {
- var checkMove = false;
- var checkUnicom = false;
- var checkTel = false;
- var checkBoxMove = $('input[data-name="move"]');
- var checkBoxUnicom = $('input[data-name="unicom"]');
- var checkBoxTel = $('input[data-name="tel"]');
- for (var i = 0; i < checkBoxMove.length; i++) {
- //如果有1个被选中时
- if (checkBoxMove[i].checked) {
- checkMove = true
- };
- };
- for (var i = 0; i < checkBoxUnicom.length; i++) {
- //如果有1个被选中时
- if (checkBoxUnicom[i].checked) {
- checkUnicom = true
- };
- };
- for (var i = 0; i < checkBoxTel.length; i++) {
- //如果有1个被选中时
- if (checkBoxTel[i].checked) {
- checkTel = true
- };
- };
- if (checkMove && checkUnicom && checkTel) {
- $("#user_form").submit();
- } else{
- layer.msg('每个类型至少选择一个')
- }
- });
- });
- </script>
|