示例#1
0
 function display()
 {
     $str = ROOT_PATH . $this->formPath;
     require_once ROOT_PATH . '/lib/common/xajax/xajax.inc.php';
     require_once ROOT_PATH . '/lib/common/xajax/xajaxElementFiller.php';
     require_once ROOT_PATH . '/language/default/lang_default_full.php';
     $lan = new Language();
     require_once $lan->getLangPath("full.php");
     $fileName = pathinfo($this->formPath, PATHINFO_BASENAME);
     $styleSheet = CommonFunctions::getTheme();
     if (preg_match('/view\\.php$/', $fileName) == 1) {
         require_once ROOT_PATH . '/language/default/lang_default_' . $fileName;
     }
     require_once ROOT_PATH . $this->formPath;
 }
示例#2
0
*/
/*TODO: This file seems to be not in use. TO BE REMOVED */
require_once ROOT_PATH . '/lib/confs/sysConf.php';
require_once ROOT_PATH . '/lib/common/CommonFunctions.php';
$srchlist[0] = array(0, 1, 2);
$srchlist[1] = array('-Select-', 'ID', 'Description');
$sysConst = new sysConf();
if ($this->getArr['mtcode'] == 'BUG') {
    $locRights = array('add' => true, 'delete' => true, 'edit' => true, 'view' => true);
} else {
    $locRights = $_SESSION['localRights'];
}
$headingInfo = $this->popArr['headinginfo'];
$currentPage = $this->popArr['currentPage'];
$message = $this->popArr['message'];
$styleSheet = CommonFunctions::getTheme();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link href="../../themes/<?php 
echo $styleSheet;
?>
/css/style.css" rel="stylesheet" type="text/css">
<style type="text/css">@import url("../../themes/<?php 
echo $styleSheet;
?>
/css/style.css"); </style>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
示例#3
0
function notifyUser($errlevel, $errstr, $errfile = '', $errline = '', $errcontext = '')
{
    if (error_reporting() == 0) {
        return;
    }
    $errMsg = "\n" . $errstr . ' in ' . $errfile . ' on line ' . $errline . "\n";
    switch ($errlevel) {
        case E_USER_WARNING:
            $type = "Warning";
            $errType = "warning";
            break;
        case E_USER_NOTICE:
            $type = "Notice";
            $errType = "notice";
            break;
        case E_USER_ERROR:
            $type = "Error";
            $errType = "error";
            break;
        case E_WARNING:
            $type = "Warning";
            $sysErr = true;
            $errType = "warning";
            break;
        case E_NOTICE:
            $type = "Notice";
            $sysErr = true;
            $errType = "notice";
            break;
        case E_ERROR:
            $type = "Error";
            $sysErr = true;
            $errType = "error";
            break;
        case E_ALL:
            $type = "General Error";
            $sysErr = true;
            $errType = "error";
    }
    if (isset($type)) {
        if (!isset($_SESSION)) {
            session_start();
        }
        ob_get_clean();
        $message = "<?xml version='1.0' encoding='iso-8859-1'?>\n";
        $message .= "<?xml-stylesheet href='" . $_SESSION['WPATH'] . "/error.xsl' type='text/xsl'?>\n";
        $message .= "<report>\n";
        $message .= "\t<heading>{$type}</heading>\n";
        $message .= "\t<type>{$errType}</type>\n";
        $errstr = strip_tags($errstr);
        $message .= "\t<message><![CDATA[{$errstr}]]></message>\n";
        $confObj = new Conf();
        if (isset($confObj->logPath) && !empty($confObj->logPath)) {
            $logPath = $confObj->logPath;
        } else {
            $logPath = ROOT_PATH . '/lib/logs/';
        }
        $message .= "\t<root>" . ROOT_PATH . "</root>\n";
        $message .= "\t<Wroot>" . $_SESSION['WPATH'] . "</Wroot>\n";
        $message .= "   <stylesheet>" . CommonFunctions::getTheme() . "</stylesheet>\n";
        $message .= "\t<logPath><![CDATA[" . $logPath . "]]></logPath>\n";
        $errfileEsc = str_replace("\\", "/", $errfile);
        if (isset($sysErr)) {
            $message .= "\t<cause>\n";
            $message .= "\t\t<message><![CDATA[Encountered the problem in " . $errfile . "]]></message>\n";
            $message .= "\t</cause>\n";
            $message .= "\t<cause>\n";
            $message .= "\t\t<message><![CDATA[Line " . $errline . "]]></message>\n";
            $message .= "\t</cause>\n";
            error_log(date('r') . ' : ' . strip_tags($errMsg), 3, $logPath . 'logDB.txt');
            $errMsgEsc = str_replace("'", "\\'", strip_tags($type . " :" . '\\n' . $errstr . '\\n' . "in " . $errfileEsc . '\\n' . "on line " . $errline));
        } else {
            $message .= "\t<cause>\n";
            $message .= "\t\t<message><![CDATA[" . mysql_error() . "]]></message>\n";
            $message .= "\t</cause>\n";
            $message .= "\t<cause>\n";
            $message .= "\t\t<message><![CDATA[MySQL Error # :" . mysql_errno() . "]]></message>\n";
            $message .= "\t</cause>\n";
            $errMsgEsc = str_replace("'", "\\'", strip_tags($type . " :" . '\\n' . $errstr . '\\n' . "Tech Info" . '\\n' . "------------" . '\\n' . mysql_error()));
            error_log(date('r') . ' : ' . strip_tags($errMsgEsc), 3, $logPath . 'logDB.txt');
        }
        $confObj = new Conf();
        $message .= "\t<environment>\n";
        $message .= "\t\t<version type='ohrm' description='OrangeHRM' ><![CDATA[" . $confObj->version . "]]></version>\n";
        $message .= "\t\t<version type='php' description='PHP' ><![CDATA[" . constant('PHP_VERSION') . "]]></version>\n";
        $message .= "\t\t<version type='mysql' description='MySQL Client' ><![CDATA[" . mysql_get_client_info() . "]]></version>\n";
        $message .= "\t\t<info type='memory_limit' description='Memory limit' ><![CDATA[" . ini_get('memory_limit') . "]]></info>\n";
        $message .= "\t\t<info type='session.gc_maxlifetime' description='Maximum session lifetime' ><![CDATA[" . ini_get('session.gc_maxlifetime') . "]]></info>\n";
        $message .= "\t</environment>\n";
        $message .= "\t<cmd n='js'><![CDATA[alert('{$errMsgEsc}');]]></cmd>\n";
        $message .= "</report>\n";
        header("Content-type: application/xml; charset=UTF-8");
        echo $message;
        exit;
    }
}
示例#4
0
 public function display($modifier = null)
 {
     @ob_clean();
     require_once ROOT_PATH . '/language/default/lang_default_full.php';
     require_once ROOT_PATH . '/plugins/fpdf2/html2pdf.php';
     $printPdf = isset($_GET['printPdf']) && $_GET['printPdf'] == 1;
     if ($printPdf) {
         ob_start();
     }
     $lan = new Language();
     require_once $lan->getLangPath("full.php");
     $records = $this->getObj();
     if (isset($this->error)) {
         $errorFlag = true;
     }
     $styleSheet = CommonFunctions::getTheme();
     if (!empty($this->templateHeader)) {
         require_once ROOT_PATH . $this->getTemplateHeader();
     }
     require_once ROOT_PATH . $this->getTemplatePath();
     if (!empty($this->templateFooter)) {
         require_once ROOT_PATH . $this->getTemplateFooter();
     }
     if ($printPdf) {
         $html = ob_get_clean();
         $pdf = new PDF();
         $pdf->AddPage();
         $pdf->SetFont('Arial', '', 10);
         if (ini_get('magic_quotes_gpc') == '1') {
             $html = stripslashes($html);
         }
         $pdf->WriteHTML($html);
         $pdf->Output($_GET['pdfName'] . '.pdf', 'F');
         // TODO: Replace this with xhtml
         echo '<html>' . '<head>' . '<link href="../../themes/' . $_SESSION['styleSheet'] . '/css/style.css" type="text/css" rel="stylesheet" />' . '<style type="text/css">' . 'body { margin: 10px; }' . '</style>' . '</head>' . '<body>';
         echo '<input type="button" class="backbutton" value="' . $lang_Common_Back . '"' . ' onclick="history.back();" ' . 'onmouseover="moverButton(this)" onmouseout="moutButton(this)"  />';
         echo '</body></html>';
         echo "<script>window.open('" . $_SESSION['WPATH'] . "/lib/controllers/{$_GET['pdfName']}.pdf');</script>";
     }
 }
示例#5
0
 public function display($modifier = null)
 {
     require_once ROOT_PATH . '/lib/common/xajax/xajax.inc.php';
     require_once ROOT_PATH . '/lib/common/xajax/xajaxElementFiller.php';
     require_once ROOT_PATH . '/language/default/lang_default_full.php';
     require_once ROOT_PATH . '/plugins/fpdf2/html2pdf.php';
     $printPdf = isset($_GET['printPdf']) && $_GET['printPdf'] == 1;
     if ($printPdf) {
         ob_start();
     }
     $lan = new Language();
     require_once $lan->getLangPath("full.php");
     $records = $this->getObj();
     if (isset($this->error)) {
         $errorFlag = true;
     }
     $styleSheet = CommonFunctions::getTheme();
     if (!empty($this->templateHeader)) {
         require_once ROOT_PATH . $this->getTemplateHeader();
     }
     require_once ROOT_PATH . $this->getTemplatePath();
     if (!empty($this->templateFooter)) {
         require_once ROOT_PATH . $this->getTemplateFooter();
     }
     if ($printPdf) {
         $html = ob_get_clean();
         $pdf = new PDF();
         $pdf->AddPage();
         $pdf->SetFont('Arial', '', 10);
         if (ini_get('magic_quotes_gpc') == '1') {
             $html = stripslashes($html);
         }
         $pdf->WriteHTML($html);
         $pdf->Output($_GET['pdfName'] . '.pdf', 'F');
         echo "<img onclick=\"history.back();\" src=\"" . $_SESSION['WPATH'] . "/themes/beyondT/pictures/btn_back.gif\" onmouseover=\"this.src='" . $_SESSION['WPATH'] . "/themes/beyondT/pictures/btn_back_02.gif';\" onmouseout=\"this.src='" . $_SESSION['WPATH'] . "/themes/beyondT/pictures/btn_back.gif';\" title=\"Back\" />";
         echo "<script>window.open('" . $_SESSION['WPATH'] . "/lib/controllers/{$_GET['pdfName']}.pdf');</script>";
     }
 }