Esempio n. 1
0
function afterConfigOptionsUpgrade($vars)
{
    $cycle_count = count($_SESSION['upgradeids']);
    if ($vars['upgradeid'] == $_SESSION['upgradeids'][$cycle_count - 1]) {
        _action();
    }
}
Esempio n. 2
0
 function access($ctx)
 {
     $this->layout = false;
     require_once APP_PATH . '/classes/captcha/SimpleCaptcha.php';
     $captcha = new SimpleCaptcha();
     $code = $captcha->getText();
     $token = SafeUtil::set_captcha($code, 300);
     $ret = array('img_url' => _action('', array('token' => $token)), 'field_name' => SafeUtil::CAPTCHA_FIELD_NAME, 'field_value' => $token);
     return $ret;
 }
Esempio n. 3
0
 function success($ctx)
 {
     $ctx->title = '绑定成功';
     $prj_subscribe_status = $_COOKIE['no_subscribe_prj'] ? WxConnect::PRJ_UNSUBSCRIBED : WxConnect::PRJ_SUBSCRIBED;
     setcookie('no_subscribe_prj', '', time() + 3600);
     if (!$ctx->user) {
         _redirect(_action('/'));
     }
     $uid = $ctx->user['id'];
     $wx_openid = $this->openid;
     if ($uid && $wx_openid) {
         WxConnect::bind($uid, $wx_openid);
     }
     setcookie(WxTmpLogin::COOKIE_KEY_AUTO_BIND_WX, '', time() - 1, '/');
     unset($_SESSION['wx_openid']);
 }
Esempio n. 4
0
 function index($ctx)
 {
     $page = $_GET['page'] ? intval($_GET['page']) : 0;
     $size = $_GET['size'] ? intval($_GET['size']) : 10;
     $status = (string) $_GET['status'] !== '' ? htmlspecialchars($_GET['status']) : '';
     $type = (string) $_GET['type'] !== '' ? htmlspecialchars($_GET['type']) : '';
     $expire_type = (string) $_GET['expire_type'] !== '' ? htmlspecialchars($_GET['expire_type']) : '';
     $id = (string) $_GET['id'] !== '' ? intval($_GET['id']) : '';
     $ctx->page = $page;
     $ctx->size = $size;
     $ctx->status = $status;
     $ctx->id = $id;
     $ctx->type = $type;
     $ctx->expire_type = $expire_type;
     $ctx->channel_id = $channel_id;
     $where = 1;
     if ($id) {
         $id = intval($id);
         $where .= " and id  = '{$id}'";
     }
     if ($status !== '') {
         $status = intval($status);
         $where .= " and status = '{$status}'";
     }
     if ($type !== '') {
         $type = intval($type);
         $where .= " and type = '{$type}'";
     }
     if ($expire_type !== '') {
         $expire_type = intval($expire_type);
         $where .= " and expire_type = '{$expire_type}'";
     }
     $ds = WxChannelInfo::paginate($page, $size, $where, 'id desc');
     $arr_channel_infos = array();
     foreach ($ds['items'] as $item) {
         $channel_id = $item->id;
         if (!isset($arr_channel_infos[$channel_id])) {
             $arr_channel_infos[$channel_id] = Channel::get($channel_id);
         }
         $item->channel_info = $arr_channel_infos[$channel_id];
     }
     if (!$ds['items'] && $id) {
         _redirect(_action('edit', array('id' => $id)));
         return;
     }
     $ctx->ds = $ds;
 }
Esempio n. 5
0
    echo $url;
    ?>
">
			<i class="glyphicon glyphicon-chevron-left"></i> Prev
		</a>
	<?php 
}
?>
	&nbsp;
	<?php 
if ($dir == 'next' && !$has_more) {
    ?>
		<a class="btn btn-sm btn-default disabled" href="#">
			Next <i class="glyphicon glyphicon-chevron-right"></i>
		</a>
	<?php 
} else {
    $ks = array_keys($kvs);
    $start = $ks[count($ks) - 1];
    $url = _action('list', array('dir' => 'next', 's' => $start, 'e' => '', 'size' => $size));
    ?>
		<a class="btn btn-sm btn-primary" href="<?php 
    echo $url;
    ?>
">
			Next <i class="glyphicon glyphicon-chevron-right"></i>
		</a>
	<?php 
}
?>
</p>
Esempio n. 6
0
	var pager = new PagerView('pager');
	pager.index = <?php 
echo $s / $size + 1;
?>
;
	pager.size = <?php 
echo $size;
?>
;
	pager.itemCount = <?php 
echo $total;
?>
;
	pager.onclick = function(index){
		var n = <?php 
echo json_encode($n);
?>
;
		var s = (pager.index - 1) * pager.size;
		var url = <?php 
echo json_encode(_action('qrange'));
?>
 + '?' + $.param({n: n, s: s});
		location.href = url;
	}
	
	pager.render();
});
</script>

Esempio n. 7
0
 function _edit_url($m)
 {
     return _action('edit', $m, $this->module);
 }
Esempio n. 8
0
</td>
		<td><?php 
    echo $m->wx_openid;
    ?>
</td>
		<td><?php 
    echo $m->prj_subscribe ? '已订阅' : '未订阅';
    ?>
</td>
		<td><?php 
    echo $m->wx_subscribe ? '是' : '否';
    ?>
</td>
		<td>
			<a href="<?php 
    echo _action('edit', $m);
    ?>
">编辑</a>
		</td>
	</tr>
<?php 
}
?>
</tbody>
</table>



<div id="pager">
</div>
Esempio n. 9
0
function _update_url()
{
    return _action('update');
}
Esempio n. 10
0
	if($(this).closest('ul').find('[name="del-menu-second"]').length >= 5) {
		$(this).hide();
	}
});

$(document).on('click', '[name="del-menu-second"]', function (e) {
	if($(this).closest('ul').find('[name="del-menu-second"]').length <= 5) {
		$(this).closest('div').find('[name="add-normal-second"]').eq(0).show();
	}
	$(this).closest('li').remove();
});

$('#submit').click(function(e) {
	var url = "<?php 
echo _action('update');
?>
";
	var menus = _tojson();
	if (menus == -1) {
		alert('数据填写错误,请检查');
		return;
	}
	var data = {id:aid, menus: menus};

	doCommit(url, data);
});

var menus = <?php 
echo $menus;
?>
Esempio n. 11
0
</td>
		<td><?php 
    echo $m->threshold;
    ?>
%</td>
		<td><?php 
    echo $m->create_time;
    ?>
</td>
		<td>
			<a onClick="if(confirm('确认删除?'))return true;return false;" href="<?php 
    echo _action('del', array('id' => $m->id));
    ?>
">删除</a>
			<a onClick="if(confirm('确认重置监控?'))return true;return false;" href="<?php 
    echo _action('set_new', array('id' => $m->id));
    ?>
">重置监控</a>
		</td>
	</tr>
<?php 
}
?>
</tbody>
</table>


<div id="pager">
</div>

<script>
Esempio n. 12
0
">强制刷新</a>
		<?php 
    }
    ?>
		</td>
		<td>
		<?php 
    if ($m->type != WxAccount::TYPE_QIYE) {
        ?>
			<a class="btn btn-xs btn-primary" href="#" onclick="alert($(this).next('span').html())">显示</a>
			<span style="display: none;"><?php 
        echo $m->get_js_token();
        ?>
</span>
			<a class="btn btn-xs btn-danger" onclick="return confirm('确认要刷新 Js Token 吗?')" href="<?php 
        echo _action('refresh_js_token', $m);
        ?>
">强制刷新</a>
		<?php 
    }
    ?>
		</td>
		<td><a href="<?php 
    echo _url('/admin/weixin/menu', array('aid' => $m->id));
    ?>
">菜单管理</a></td>
		<td>
			<a class="btn btn-sm btn-primary" href="<?php 
    echo _edit_url($m);
    ?>
">编辑</a>
Esempio n. 13
0
 function qclear($ctx)
 {
     $req = $_POST + $_GET;
     if (!is_array($req['n'])) {
         $req['n'] = array(trim($req['n']));
     }
     if ($_POST) {
         foreach ($req['n'] as $index => $n) {
             $n = trim($n);
             if (!strlen($n)) {
                 continue;
             }
             $this->ssdb->qclear($n);
         }
         _redirect($_POST['jump']);
     }
     $ctx->ns = $req['n'];
     $ctx->jump = $_SERVER['HTTP_REFERER'];
     if (!$ctx->jump) {
         $ctx->jump = _action('qrange', array('n' => $n));
     }
 }
<?php

require 'config.php';
require './class/sendinvoicetoadherent.class.php';
require './lib/sendinvoicetoadherent.lib.php';
if (!$user->rights->sendinvoicetoadherent->read) {
    accessforbidden();
}
$langs->load("sendinvoicetoadherent@sendinvoicetoadherent");
_action();
function _action()
{
    global $user, $db, $conf, $langs;
    $PDOdb = new TPDOdb();
    //$PDOdb->debug=true;
    $action = __get('action', 'list');
    switch ($action) {
        case 'list':
            _list($PDOdb, $db, $user, $conf, $langs);
            break;
        case 'listAvoir':
            _listAvoir($PDOdb, $db, $user, $conf, $langs);
            break;
        case 'create':
            _create($PDOdb, $db, $user, $conf, $langs);
            break;
        case 'createConfirm':
            _create_and_send($PDOdb, $db, $user, $conf, $langs);
            break;
        case 'createAvoir':
            _createAvoir($PDOdb, $db, $user, $conf, $langs);
Esempio n. 15
0
    ?>
</td>
		<td><?php 
    echo $m->open_interest;
    ?>
</td>
		<td><?php 
    echo $m->lmplied_rate;
    ?>
%</td>
		<td><?php 
    echo $m->modify_time;
    ?>
</td>
		<td><a onClick="if(confirm('确认删除?'))return true;return false;" href="<?php 
    echo _action('del', array('id' => $m->id));
    ?>
">删除</a></td>
	</tr>
<?php 
}
?>
</tbody>
</table>


<div id="pager">
</div>

<script>
$(function(){