示例#1
0
<?php

if (!defined('INCLUDED_AMEMBER_CONFIG')) {
    die("Direct access to this location is not allowed");
}
@set_time_limit(300);
add_report('fields', 'Customers Demography');
function get_report_fields()
{
    $fields = array('city' => 'City', 'state' => 'State', 'zip' => 'ZIP', 'country' => 'Country');
    global $member_additional_fields;
    foreach ($member_additional_fields as $f) {
        if ($f['hidden_anywhere']) {
            continue;
        }
        $fields['data.' . $f['name']] = $f['title'];
    }
    return $fields;
}
function fields_display_params_dialog($vars, $err = '')
{
    global $t;
    $t->assign('title', 'Report Parameters');
    $t->assign('report_title', 'Customer Demographics');
    set_date_from_smarty('beg_date', $vars);
    set_date_from_smarty('end_date', $vars);
    if ($vars['beg_date'] == '0000-00-00') {
        $vars['beg_date'] = date('Y-01-01');
    }
    if ($vars['end_date'] == '0000-00-00') {
        $vars['end_date'] = date('Y-m-d');
示例#2
0
        exit;
        break;
    } elseif (substr($key, 0, 9) == "modreport") {
        $modarray = explode("_", $key);
        $tplmessage = mod_report($db, $modarray[1]);
        break;
    } elseif (substr($key, 0, 9) == "delreport") {
        $modarray = explode("_", $key);
        rm_report($db, $modarray[1]);
        break;
    } elseif (substr($key, 0, 10) == "testreport") {
        $modarray = explode("_", $key);
        $tplmessage = test_report($db, $modarray[1], $editreport);
        break;
    } elseif ($key == "addreport") {
        $tplmessage = add_report($db);
        break;
    }
}
if ($editfield) {
    $noshow = array('id', 'access', 'magic', 'lastmoddate', 'lastmodby', 'gr', 'gw', 'er', 'ew');
    $nodel = array('title', 'date', 'ownerid', 'lastmodby', 'lastmoddate');
    $nomodifiable = array('ownerid', 'date', 'lastmodby', 'lastmoddate');
    navbar($USER["permissions"]);
    $r = $db->Execute("SELECT id,table_desc_name,label FROM tableoftables WHERE tablename='{$editfield}'");
    $id = $r->fields['id'];
    $currdesc = $r->fields['table_desc_name'];
    $tablelabel = $r->fields['label'];
    echo "<h3 align='center'>{$string}</h3>";
    echo "<h3 align='center'>Edit columns of table <i>{$tablelabel}</i></h3><br>";
    echo "<form method='post' name='tableform' id='coledit' enctype='multipart/form-data' ";
示例#3
0
                $res = false;
                $mes = $msg->get_msg("e003-1", "Activando remision.");
            }
        } else {
            //desactivar, cambiar a 1
            if ($fun->activar("remisiones_fisicas", "rf_id", $id)) {
                $res = true;
                $mes = $msg->get_msg("e004");
            } else {
                $res = false;
                $mes = $msg->get_msg("e003-1", "Desactivando remision.");
            }
        }
    }
    $response->res = $res;
    $response->mes = $mes;
    echo json_encode($response);
    $con->disconnect();
}
//validamos si es una petición ajax
if (isset($_POST['action']) && !empty($_POST['action'])) {
    $action = $_POST['action'];
    switch ($action) {
        case 'save':
            add_report();
            break;
        case 'change':
            change_pack();
            break;
    }
}
示例#4
0
function report_post_func($xmlrpc_params)
{
    global $db, $lang, $theme, $plugins, $mybb, $session, $settings, $cache, $time, $mybbgroups;
    $input = Tapatalk_Input::filterXmlInput(array('post_id' => Tapatalk_Input::INT, 'reason' => Tapatalk_Input::STRING), $xmlrpc_params);
    $lang->load("report");
    if ($mybb->usergroup['canview'] == 0 || !$mybb->user['uid']) {
        return tt_no_permission();
    }
    $post = get_post($input['post_id']);
    if (!$post['pid']) {
        return xmlrespfalse($lang->error_invalidpost);
    }
    $forum = get_forum($post['fid']);
    if (!$forum) {
        $error = $lang->error_invalidforum;
        eval("\$report_error = \"" . $templates->get("report_error") . "\";");
        output_page($report_error);
        exit;
    }
    tt_check_forum_password($forum['parentlist']);
    $thread = get_thread($post['tid']);
    if (version_compare($mybb->version, '1.8.0', '<')) {
        if ($mybb->settings['reportmethod'] == "email" || $mybb->settings['reportmethod'] == "pms") {
            $query = $db->query("\n\t\t\t\tSELECT DISTINCT u.username, u.email, u.receivepms, u.uid\n\t\t\t\tFROM " . TABLE_PREFIX . "moderators m\n\t\t\t\tLEFT JOIN " . TABLE_PREFIX . "users u ON (u.uid=m.id)\n\t\t\t\tWHERE m.fid IN (" . $forum['parentlist'] . ") AND m.isgroup = '0'\n\t\t\t");
            $nummods = $db->num_rows($query);
            if (!$nummods) {
                unset($query);
                switch ($db->type) {
                    case "pgsql":
                    case "sqlite":
                        $query = $db->query("\n\t\t\t\t\t\t\tSELECT u.username, u.email, u.receivepms, u.uid\n\t\t\t\t\t\t\tFROM " . TABLE_PREFIX . "users u\n\t\t\t\t\t\t\tLEFT JOIN " . TABLE_PREFIX . "usergroups g ON (((','|| u.additionalgroups|| ',' LIKE '%,'|| g.gid|| ',%') OR u.usergroup = g.gid))\n\t\t\t\t\t\t\tWHERE (g.cancp=1 OR g.issupermod=1)\n\t\t\t\t\t\t");
                        break;
                    default:
                        $query = $db->query("\n\t\t\t\t\t\t\tSELECT u.username, u.email, u.receivepms, u.uid\n\t\t\t\t\t\t\tFROM " . TABLE_PREFIX . "users u\n\t\t\t\t\t\t\tLEFT JOIN " . TABLE_PREFIX . "usergroups g ON (((CONCAT(',', u.additionalgroups, ',') LIKE CONCAT('%,', g.gid, ',%')) OR u.usergroup = g.gid))\n\t\t\t\t\t\t\tWHERE (g.cancp=1 OR g.issupermod=1)\n\t\t\t\t\t\t");
                }
            }
            while ($mod = $db->fetch_array($query)) {
                $emailsubject = $lang->sprintf($lang->emailsubject_reportpost, $mybb->settings['bbname']);
                $emailmessage = $lang->sprintf($lang->email_reportpost, $mybb->user['username'], $mybb->settings['bbname'], $post['subject'], $mybb->settings['bburl'], str_replace('&amp;', '&', get_post_link($post['pid'], $thread['tid']) . "#pid" . $post['pid']), $thread['subject'], $input['reason']);
                if ($mybb->settings['reportmethod'] == "pms" && $mod['receivepms'] != 0 && $mybb->settings['enablepms'] != 0) {
                    $pm_recipients[] = $mod['uid'];
                } else {
                    my_mail($mod['email'], $emailsubject, $emailmessage);
                }
            }
            if (count($pm_recipients) > 0) {
                $emailsubject = $lang->sprintf($lang->emailsubject_reportpost, $mybb->settings['bbname']);
                $emailmessage = $lang->sprintf($lang->email_reportpost, $mybb->user['username'], $mybb->settings['bbname'], $post['subject'], $mybb->settings['bburl'], str_replace('&amp;', '&', get_post_link($post['pid'], $thread['tid']) . "#pid" . $post['pid']), $thread['subject'], $input['reason']);
                require_once MYBB_ROOT . "inc/datahandlers/pm.php";
                $pmhandler = new PMDataHandler();
                $pm = array("subject" => $emailsubject, "message" => $emailmessage, "icon" => 0, "fromid" => $mybb->user['uid'], "toid" => $pm_recipients);
                $pmhandler->admin_override = true;
                $pmhandler->set_data($pm);
                // Now let the pm handler do all the hard work.
                if (!$pmhandler->validate_pm()) {
                    // Force it to valid to just get it out of here
                    $pmhandler->is_validated = true;
                    $pmhandler->errors = array();
                }
                $pminfo = $pmhandler->insert_pm();
            }
        } else {
            $reportedpost = array("pid" => $input['post_id'], "tid" => $thread['tid'], "fid" => $thread['fid'], "uid" => $mybb->user['uid'], "dateline" => TIME_NOW, "reportstatus" => 0, "reason" => $db->escape_string(htmlspecialchars_uni($input['reason'])));
            $db->insert_query("reportedposts", $reportedpost);
            $cache->update_reportedposts();
        }
    } else {
        require_once MYBB_ROOT . 'inc/functions_modcp.php';
        $plugins->run_hooks("report_do_report_start");
        $id = $post['pid'];
        $id2 = $post['tid'];
        $id3 = $forum['fid'];
        $report_type = 'post';
        $report_type_db = "(type = 'post' OR type = '')";
        if (!empty($report_type_db)) {
            $query = $db->simple_select("reportedcontent", "*", "reportstatus != '1' AND id = '{$id}' AND {$report_type_db}");
            if ($db->num_rows($query)) {
                // Existing report
                $report = $db->fetch_array($query);
                $report['reporters'] = my_unserialize($report['reporters']);
                if ($mybb->user['uid'] == $report['uid'] || is_array($report['reporters']) && in_array($mybb->user['uid'], $report['reporters'])) {
                    $error = $lang->success_report_voted;
                }
            }
        }
        // Is this an existing report or a new offender?
        if (!empty($report)) {
            // Existing report, add vote
            $report['reporters'][] = $mybb->user['uid'];
            update_report($report);
            //$plugins->run_hooks("report_do_report_end");
        } else {
            // Bad user!
            $new_report = array('id' => $id, 'id2' => $id2, 'id3' => $id3, 'uid' => $mybb->user['uid']);
            // Figure out the reason
            $reason = trim($input['reason']);
            if ($reason == 'other') {
                // Replace the reason with the user comment
                $reason = trim($mybb->get_input('comment'));
            } else {
                $report_reason_string = "report_reason_{$reason}";
                //$reason = "\n".$lang->$report_reason_string;
            }
            if (my_strlen($reason) < 3) {
                $error = $lang->error_report_length;
            }
            if (empty($error)) {
                $new_report['reason'] = $reason;
                add_report($new_report, $report_type);
            } else {
                error($error);
            }
        }
    }
    return xmlresptrue();
}
示例#5
0
<?php

if (!defined('INCLUDED_AMEMBER_CONFIG')) {
    die("Direct access to this location is not allowed");
}
add_report('income', 'Income Report');
function income_display_params_dialog($vars, $err = '')
{
    global $t, $db;
    $t->assign('title', 'Report Parameters');
    $t->assign('report_title', 'Income Report');
    $t->assign('discretion_options', array('week' => 'Weekly', 'month' => 'Monthly', 'day' => 'Daily'));
    $prs = array();
    foreach ($db->get_products_list() as $pr) {
        $prs[$pr['product_id']] = $pr['title'];
    }
    $t->assign('products_options', $prs);
    set_date_from_smarty('beg_date', $vars);
    set_date_from_smarty('end_date', $vars);
    if ($vars['beg_date'] == '0000-00-00') {
        $vars['beg_date'] = date('Y-01-01');
    }
    if ($vars['end_date'] == '0000-00-00') {
        $vars['end_date'] = date('Y-m-d');
    }
    foreach ($vars as $k => $v) {
        $t->assign($k, $v);
    }
    ///////////////////////////////////////
    $t->display('admin/header.inc.html');
    $otd = $t->template_dir;
示例#6
0
function trader_report($fid)
{
    global $mybb, $db, $templates, $reportform, $mypostkey, $header, $headerinclude, $footer, $lang;
    $lang->load("tradefeedback");
    $fid = intval($fid);
    if (!$fid) {
        error($lang->feedback_invalid_action);
    }
    if (!$mybb->user['uid'] || $mybb->usergroup['isbannedgroup'] == 1) {
        error_no_permission();
    }
    $query = $db->simple_select("trade_feedback", "receiver,giver,reported", "fid={$fid}");
    if ($db->num_rows($query) == 0) {
        error($lang->feedback_invalid_action);
    }
    $feedback = $db->fetch_array($query);
    if ($feedback['reported'] == 1) {
        error($lang->feedback_already_reported);
    }
    $userid = $feedback['receiver'];
    if ($mybb->request_method == "post" && verify_post_check($mybb->input['my_post_key'])) {
        // Report Center Integration
        require_once MYBB_ROOT . 'inc/functions_modcp.php';
        $new_report = array('id' => $fid, 'id2' => $feedback['giver'], 'id3' => $feedback['receiver'], 'uid' => $mybb->user['uid'], 'reason' => htmlspecialchars_uni($mybb->input['reason']));
        add_report($new_report, "tradefeedback");
        $db->write_query("UPDATE " . TABLE_PREFIX . "trade_feedback SET reported=1 WHERE fid={$fid}");
        $url = $mybb->settings['bburl'] . "/tradefeedback.php?action=view&uid={$userid}";
        $message = $lang->report_feedback_success;
        redirect($url, $message, "", true);
    } else {
        eval("\$reportform = \"" . $templates->get("tradefeedback_report_form") . "\";");
        output_page($reportform);
    }
}
示例#7
0
        $new_report = array('id' => $id, 'id2' => $id2, 'id3' => $id3, 'uid' => $mybb->user['uid']);
        // Figure out the reason
        $reason = trim($mybb->get_input('reason'));
        if ($reason == 'other') {
            // Replace the reason with the user comment
            $reason = trim($mybb->get_input('comment'));
        } else {
            $report_reason_string = "report_reason_{$reason}";
            $reason = "\n" . $lang->{$report_reason_string};
        }
        if (my_strlen($reason) < 3) {
            $error = $lang->error_report_length;
        }
        if (empty($error)) {
            $new_report['reason'] = $reason;
            add_report($new_report, $report_type);
            $plugins->run_hooks("report_do_report_end");
            eval("\$report_thanks = \"" . $templates->get("report_thanks") . "\";");
            echo $report_thanks;
            exit;
        }
    }
}
if (!empty($error) || $verified == false) {
    $mybb->input['action'] = '';
    if ($verified == false && empty($error)) {
        $error = $lang->error_invalid_report;
    }
}
if (!$mybb->input['action']) {
    if (!empty($error)) {
示例#8
0
<?php

add_report('tax', 'Tax report');
function tax_display_params_dialog($vars, $err = '')
{
    global $t;
    $t->assign('title', 'Report Parameters');
    $t->assign('report_title', 'Tax report');
    $t->assign('discretion_options', array('week' => 'Weekly', 'month' => 'Monthly', 'day' => 'Daily'));
    set_date_from_smarty('beg_date', $vars);
    set_date_from_smarty('end_date', $vars);
    if ($vars['beg_date'] == '0000-00-00') {
        $vars['beg_date'] = date('Y-01-01');
    }
    if ($vars['end_date'] == '0000-00-00') {
        $vars['end_date'] = date('Y-m-d');
    }
    foreach ($vars as $k => $v) {
        $t->assign($k, $v);
    }
    ///////////////////////////////////////
    $t->display('admin/header.inc.html');
    $otd = $t->template_dir;
    $t->template_dir = dirname(__FILE__);
    $t->display('income.inc.html');
    $t->template_dir = $otd;
    $t->display('admin/footer.inc.html');
}
function tax_check_params(&$vars)
{
    set_date_from_smarty('beg_date', $vars);