Ejemplo n.º 1
0
            if ($output == "PDF") {
                require "includes/reportpdf.php";
            }
        }
        //-- start the sax parser
        $xml_parser = xml_parser_create();
        //-- make sure everything is case sensitive
        xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, false);
        //-- set the main element handler functions
        xml_set_element_handler($xml_parser, "startElement", "endElement");
        //-- set the character data handler
        xml_set_character_data_handler($xml_parser, "characterData");
        //-- open the file
        if (!($fp = fopen(PHPGEDVIEW_PKG_PATH . $report, "r"))) {
            die("could not open XML input");
        }
        //-- read the file and parse it 4kb at a time
        while ($data = fread($fp, 4096)) {
            if (!xml_parse($xml_parser, $data, feof($fp))) {
                die(sprintf($data . "\nXML error: %s at line %d", xml_error_string(xml_get_error_code($xml_parser)), xml_get_current_line_number($xml_parser)));
            }
        }
        xml_parser_free($xml_parser);
    }
}
if ($action == "choose") {
    $reports = get_report_list(true);
    $gBitSmarty->assign("pagetitle", tra('Report selection'));
    $gBitSmarty->assign_by_ref("reports", $reports);
    $gBitSystem->display('bitpackage:phpgedview/report_menu.tpl', tra('Report selection'), array('display_mode' => 'display'));
}
Ejemplo n.º 2
0
    if ($type == 1) {
        $total_sql = "SELECT COUNT(*) AS num FROM " . table('report') . " AS r " . $joinsql . $wheresql;
    } else {
        $total_sql = "SELECT COUNT(*) AS num FROM " . table('report_resume') . " AS r " . $joinsql . $wheresql;
    }
    if (!empty($_GET['reporttype'])) {
        $wheresql = empty($wheresql) ? " WHERE r.report_type=" . $_GET['reporttype'] : $wheresql . " AND r.report_type=" . $_GET['reporttype'];
    }
    if (!empty($_GET['audit'])) {
        $wheresql = empty($wheresql) ? " WHERE r.audit=" . $_GET['audit'] : $wheresql . " AND r.audit=" . $_GET['audit'];
    }
    $total_val = $db->get_total($total_sql);
    $page = new page(array('total' => $total_val, 'perpage' => $perpage, 'getarray' => $_GET));
    $currenpage = $page->nowindex;
    $offset = ($currenpage - 1) * $perpage;
    $list = get_report_list($offset, $perpage, $joinsql . $wheresql . $oederbysql, $type);
    $smarty->assign('pageheader', "举报信息");
    $smarty->assign('list', $list);
    $smarty->assign('page', $page->show(3));
    if ($type == 1) {
        $smarty->display('feedback/admin_report_list.htm');
    } else {
        $smarty->display('feedback/admin_report_resume_list.htm');
    }
} elseif ($act == 'report_perform') {
    $type = intval($_POST['type']) == 0 ? 1 : intval($_POST['type']);
    //审核
    if (!empty($_POST['set_audit'])) {
        check_permissions($_SESSION['admin_purview'], "report_audit");
        check_token();
        $id = $_REQUEST['id'];
Ejemplo n.º 3
0
 /**
  * get the reports menu
  * @return Menu the menu item
  */
 static function &getReportsMenu($pid = "", $famid = "")
 {
     global $TEXT_DIRECTION, $PGV_IMAGE_DIR, $PGV_IMAGES, $GEDCOM, $pgv_lang;
     global $LANGUAGE, $PRIV_PUBLIC, $PRIV_USER, $PRIV_NONE, $PRIV_HIDE, $SEARCH_SPIDER;
     if ($TEXT_DIRECTION == "rtl") {
         $ff = "_rtl";
     } else {
         $ff = "";
     }
     if (!file_exists("reportengine.php") || !empty($SEARCH_SPIDER)) {
         $menu = new Menu("", "", "");
         //			$menu->print_menu = null;
         return $menu;
     }
     //-- main reports menu item
     if ($pid || $famid) {
         $menu = new Menu($pgv_lang["reports"], "#");
         if (!empty($PGV_IMAGES["reports"]["small"])) {
             $menu->addIcon($PGV_IMAGE_DIR . "/" . $PGV_IMAGES["reports"]["small"]);
         }
         $menu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "submenu{$ff}", "icon_small_reports");
     } else {
         // top menubar
         $menu = new Menu($pgv_lang["reports"], encode_url('reportengine.php?ged=' . $GEDCOM), "down");
         if (!empty($PGV_IMAGES["reports"]["large"])) {
             $menu->addIcon($PGV_IMAGE_DIR . "/" . $PGV_IMAGES["reports"]["large"]);
         }
         $menu->addClass("menuitem{$ff}", "menuitem_hover{$ff}", "submenu{$ff}", "icon_large_reports");
     }
     // Build a list of reports and sort that list into localized title order
     $reports = get_report_list();
     $menuList = array();
     foreach ($reports as $file => $report) {
         if (!empty($report["title"][$LANGUAGE])) {
             $label = $report["title"][$LANGUAGE];
         } else {
             $label = implode("", $report["title"]);
         }
         $menuList[$file] = trim($label);
     }
     asort($menuList);
     // Produce those submenus in localized name order
     //print_r($reports);
     $username = PGV_USER_NAME;
     foreach ($menuList as $file => $label) {
         $report = $reports[$file];
         if (!isset($report["access"])) {
             $report["access"] = $PRIV_PUBLIC;
         }
         if ($report["access"] >= PGV_USER_ACCESS_LEVEL) {
             if (!empty($report["title"][$LANGUAGE])) {
                 $label = $report["title"][$LANGUAGE];
             } else {
                 $label = implode("", $report["title"]);
             }
             // indi report
             if ($pid) {
                 $submenu = new Menu($label, encode_url("reportengine.php?ged={$GEDCOM}&action=setup&report={$report['file']}&pid={$pid}"));
             } else {
                 if ($famid) {
                     $submenu = new Menu($label, encode_url("reportengine.php?ged={$GEDCOM}&action=setup&report={$report['file']}&famid={$famid}"));
                 } else {
                     $submenu = new Menu($label, encode_url("reportengine.php?ged={$GEDCOM}&action=setup&report={$report['file']}"));
                 }
             }
             if (isset($PGV_IMAGES["reports"]["small"]) && isset($PGV_IMAGES[$report["icon"]]["small"])) {
                 $iconfile = $PGV_IMAGE_DIR . "/" . $PGV_IMAGES[$report["icon"]]["small"];
             }
             if (isset($iconfile) && file_exists($iconfile)) {
                 $submenu->addIcon($iconfile);
             }
             $submenu->addClass("submenuitem{$ff}", "submenuitem_hover{$ff}", "", "icon_small_" . $report["icon"]);
             // indi report
             if ($pid && $report["icon"] != "sfamily" && $report["icon"] != "place") {
                 $menu->addSubmenu($submenu);
             } else {
                 if ($famid && $report["icon"] == "sfamily") {
                     $menu->addSubmenu($submenu);
                 } else {
                     if (empty($pid) && empty($famid)) {
                         $menu->addSubmenu($submenu);
                     }
                 }
             }
         }
     }
     return $menu;
 }