示例#1
0
<?php

$altcfg = rcms_parse_ini_file(CONFIG_PATH . 'alter.ini');
if ($altcfg['PER_CITY_ACTION']) {
    if (cfr('CITYACTION')) {
        $admin = whoami();
        $form = wf_Link(PerCityAction::MODULE_NAME, __('Clear'), true, 'ubButton');
        $form .= wf_tag('br');
        $form .= wf_Link(PerCityAction::MODULE_NAME . "&action=debtors", __('Debtors'), false, 'ubButton');
        $form .= wf_Link(PerCityAction::MODULE_NAME . "&action=city_payments", __('Payments per city'), false, 'ubButton');
        $form .= wf_Link(PerCityAction::MODULE_NAME . "&action=usersearch", __('User search'), false, 'ubButton');
        $form .= wf_Link(PerCityAction::MODULE_NAME . "&action=permission", __('Permission'), false, 'ubButton');
        $form .= wf_Link(PerCityAction::MODULE_NAME . "&action=analytics", __('Analytics'), true, 'ubButton');
        show_window(__('Actions'), $form);
        $perCityAction = new PerCityAction();
        if (isset($_GET['action'])) {
            $action = $_GET['action'];
            if ($action == 'debtors') {
                if (cfr('REPORTCITYDEBTORS')) {
                    show_window(__('Payments'), $perCityAction->CitySelector($admin, $action));
                    if (isset($_GET['citysearch'])) {
                        $cityId = $_GET['citysearch'];
                        if ($perCityAction->CheckRigts($cityId, $admin)) {
                            $perCityAction->LoadAllData('', $cityId, 'debtors');
                            if (isset($_GET['ajax'])) {
                                die($perCityAction->ajaxData());
                            }
                            $report_name = __('Debtors by city') . wf_Link(PerCityAction::MODULE_NAME . "&action=debtors&citysel={$cityId}&printable=true", wf_img("skins/printer_small.gif"));
                            show_window(__($report_name), $perCityAction->PerCityDataShow());
                        } else {
                            show_error(__('You cant control this module'));
示例#2
0
<?php

$altcfg = rcms_parse_ini_file(CONFIG_PATH . 'alter.ini');
if ($altcfg['PER_CITY_ACTION']) {
    if (cfr('CITYACTION')) {
        $admin = whoami();
        $form = wf_Link(PerCityAction::MODULE_NAME . "&action=debtors", __('Debtors'), false, 'ubButton');
        $form .= wf_Link(PerCityAction::MODULE_NAME . "&action=city_payments", __('Payments per city'), false, 'ubButton');
        $form .= wf_Link(PerCityAction::MODULE_NAME . "&action=usersearch", __('User search'), false, 'ubButton');
        $form .= wf_Link(PerCityAction::MODULE_NAME . "&action=permission", __('Permission'), true, 'ubButton');
        show_window(__('Actions'), $form);
        if (isset($_GET['action'])) {
            $perCityAction = new PerCityAction();
            if ($_GET['action'] == 'debtors') {
                if (cfr('REPORTCITYDEBTORS')) {
                    show_window(__('Payments'), $perCityAction->CitySelector($admin, $_GET['action']));
                    if (isset($_GET['citysearch'])) {
                        $cityId = $_GET['citysearch'];
                        if ($perCityAction->CheckRigts($cityId, $admin)) {
                            $perCityAction->LoadAllData('', $cityId, 'debtors');
                            $report_name = __('Debtors by city') . wf_Link(PerCityAction::MODULE_NAME . "&action=debtors&citysel={$cityId}&printable=true", wf_img("skins/printer_small.gif"));
                            show_window(__($report_name), $perCityAction->PerCityDataShow());
                        } else {
                            show_error(__('You cant control this module'));
                        }
                    }
                    if (isset($_GET['printable'])) {
                        if ($_GET['printable']) {
                            $query = "SELECT `address`.`login`,`users`.`cash` FROM `address` INNER JOIN users USING (login) WHERE `address`.`aptid` IN ( SELECT `id` FROM `apt` WHERE `buildid` IN ( SELECT `id` FROM `build` WHERE `streetid` IN ( SELECT `id` FROM `street` WHERE `cityid`='" . $_GET['citysel'] . "'))) and `users`.`cash`<0";
                            $keys = array('cash', 'login');
                            $titles = array('tariff', "Comment", 'Mac ONU', "Credited", "Cash", 'Login');