コード例 #1
0
 static function page($url = NULL)
 {
     if (empty($url) and !empty($_SERVER['HTTP_REFERER'])) {
         $url = $_SERVER['HTTP_REFERER'];
     }
     Debug::Text('Redirect URL: ' . $url, __FILE__, __LINE__, __METHOD__, 11);
     if (Debug::getVerbosity() != 11) {
         header("Location: {$url}\n\n");
         //Prevent the rest of the script from running after redirect?
         Debug::writeToLog();
         ob_clean();
         exit;
     }
     return TRUE;
 }
コード例 #2
0
ファイル: Form940ez.php プロジェクト: J-P-Hanafin/TimeTrex-1
                     $pdf->setXY(29, 236);
                     $pdf->Cell(40, 6, $ein[1], $border, 0, 'L');
                 }
                 $pdf->setXY(82, 244);
                 $pdf->Cell(75, 6, $current_company->getName(), $border, 0, 'L');
                 $pdf->setXY(82, 253);
                 $pdf->Cell(45, 6, $current_company->getAddress1() . ' ' . $current_company->getAddress2(), $border, 0, 'L');
                 $pdf->setXY(82, 261);
                 $pdf->Cell(45, 6, $current_company->getCity() . ', ' . $current_company->getProvince() . ' ' . $current_company->getPostalCode(), $border, 0, 'L');
                 $pdf->setXY(157, 234);
                 $pdf->Cell(35, 6, Misc::getBeforeDecimal(Misc::MoneyFormat($lines_arr['total']['p1_6'], FALSE)), $border, 0, 'R');
                 $pdf->setXY(193, 234);
                 $pdf->Cell(6, 6, Misc::getAfterDecimal(Misc::MoneyFormat($lines_arr['total']['p1_6'], FALSE)), $border, 0, 'L');
             }
             $output = $pdf->Output('', 'S');
             if (Debug::getVerbosity() == 11) {
                 Debug::Display();
             } else {
                 Misc::FileDownloadHeader('f940ez.pdf', 'application/pdf', strlen($output));
                 echo $output;
             }
             exit;
         }
     }
     break;
 case 'delete':
 case 'save':
     Debug::Text('Action: ' . $action, __FILE__, __LINE__, __METHOD__, 10);
     $generic_data['id'] = UserGenericDataFactory::reportFormDataHandler($action, $filter_data, $generic_data, URLBuilder::getURL(NULL, $_SERVER['SCRIPT_NAME']));
     unset($generic_data['name']);
 default:
コード例 #3
0
ファイル: ProgressBar.php プロジェクト: alachaum/timetrex
        InitProgressBar(10);
        for ($i = 0; $i < 11; $i++) {
            $progress_bar->display();
            $progress_bar->incValue();
            if ($i % 2 == 0) {
                sleep(1);
            }
        }
        break;
}
?>
</div>
<?php 
sleep(2);
if (Debug::getVerbosity() <= 10) {
    if (isset($next_page) and $next_page != '') {
        ?>
		<script type="text/javascript">parent.location.href='<?php 
        echo $next_page;
        ?>
'</script>
		<?php 
    }
}
if (Debug::getVerbosity() > 10) {
    Debug::Display();
}
Debug::writeToLog();
?>
</body>
</html>
コード例 #4
0
ファイル: ROEList.php プロジェクト: J-P-Hanafin/TimeTrex-1
             if ($output !== FALSE and Debug::getVerbosity() < 11) {
                 Misc::FileDownloadHeader('roe.xml', 'application/octetstream', strlen($output));
                 echo $output;
                 exit;
             } else {
                 echo TTi18n::gettext("ERROR: ROE not available, it may be deleted!") . "<br>\n";
                 exit;
             }
         } else {
             $show_background = TRUE;
             if ($action == 'print') {
                 $show_background = FALSE;
             }
             $output = $rlf->getROE($rlf, (bool) $show_background);
             //Debug::Display();
             if ($output !== FALSE and Debug::getVerbosity() < 11) {
                 Misc::FileDownloadHeader('roe.pdf', 'application/pdf', strlen($output));
                 echo $output;
                 exit;
             } else {
                 echo TTi18n::gettext("ERROR: ROE not available, it may be deleted!") . "<br>\n";
                 exit;
             }
         }
     }
     break;
 case 'add':
     Redirect::Page(URLBuilder::getURL(array('user_id' => $user_id), 'EditROE.php', FALSE));
     break;
 case 'delete' or 'undelete':
     if (strtolower($action) == 'delete') {
コード例 #5
0
 if (count($ids) > 0) {
     $psalf = TTnew('PayStubAmendmentListFactory');
     //Use Pay Stub permission as this for exporting data for payroll.
     if ($permission->Check('pay_stub', 'view') == FALSE) {
         if ($permission->Check('pay_stub', 'view_child')) {
             $filter_data['permission_children_ids'] = $permission_children_ids;
         }
         if ($permission->Check('pay_stub', 'view_own')) {
             $filter_data['permission_children_ids'][] = $current_user->getId();
         }
     }
     $filter_data['id'] = $ids;
     $psalf->getSearchByCompanyIdAndArrayCriteria($current_company->getId(), $filter_data);
     $output = $psalf->exportPayStubAmendment($psalf, $export_type);
     if ($output !== FALSE) {
         if (Debug::getVerbosity() < 11) {
             if (stristr($export_type, 'cheque')) {
                 Misc::FileDownloadHeader('checks_' . str_replace(array('/', ',', ' '), '_', TTDate::getDate('DATE', time())) . '.pdf', 'application/pdf', strlen($output));
             } else {
                 //Include file creation number in the exported file name, so the user knows what it is without opening the file,
                 //and can generate multiple files if they need to match a specific number.
                 $ugdlf = TTnew('UserGenericDataListFactory');
                 $ugdlf->getByCompanyIdAndScriptAndDefault($current_company->getId(), 'PayStubFactory', TRUE);
                 if ($ugdlf->getRecordCount() > 0) {
                     $ugd_obj = $ugdlf->getCurrent();
                     $setup_data = $ugd_obj->getData();
                 }
                 if (isset($setup_data)) {
                     $file_creation_number = $setup_data['file_creation_number']++;
                 } else {
                     $file_creation_number = 0;
コード例 #6
0
 function displayPDF()
 {
     $output = $this->getPDF();
     if (Debug::getVerbosity() == 11) {
         Debug::Display();
     } else {
         Misc::FileDownloadHeader($this->getFileName(), 'application/pdf', strlen($output));
         echo $output;
         exit;
     }
 }
コード例 #7
0
 function setNewDatabaseConnection($type, $host, $user, $password, $database_name)
 {
     if ($this->getDatabaseConnection() !== FALSE) {
         $this->getDatabaseConnection()->Close();
     }
     try {
         $db = ADONewConnection($type);
         $db->SetFetchMode(ADODB_FETCH_ASSOC);
         $db->Connect($host, $user, $password, $database_name);
         if (Debug::getVerbosity() == 11) {
             $db->debug = TRUE;
         }
         //MySQLi extension uses an object, not a resource.
         if (is_resource($db->_connectionID) or is_object($db->_connectionID)) {
             $this->setDatabaseConnection($db);
             //$this->temp_db = $db;
             return TRUE;
         }
     } catch (Exception $e) {
         return FALSE;
     }
     return FALSE;
 }