示例#1
0
         if ($o->country_id == "") {
             $o->country_id = 0;
         }
         if ($o->currency_id == "") {
             $o->currency_id = 0;
         }
         $o->countryctrl = $ctrl->getSelectCountry($o->country_id, 'N');
         $o->currencyctrl = $ctrl->getSelectCurrency($o->currency_id, 'N');
         $o->getInputForm("new", -1, $token);
         $o->showOrganizationTable("where organization_id>0", "order by defaultlevel,organization_name");
     }
     break;
     //when user request to edit particular organization
 //when user request to edit particular organization
 case "edit":
     if ($o->fetchOrganization($o->organization_id)) {
         $token = $s->createToken($tokenlife, "CREATE_ORG");
         $o->countryctrl = $ctrl->getSelectCountry($o->country_id, 'N');
         $o->currencyctrl = $ctrl->getSelectCurrency($o->currency_id, 'N');
         $o->groupctrl = $ctrl->getAllSystemGroup($o->groupid);
         $o->accruedaccctrl = $ctrl->getSelectAccounts($o->accrued_acc, 'Y', "", "accrued_acc", "", "", "N", "", "", "style='width:150px'");
         $o->socsoaccctrl = $ctrl->getSelectAccounts($o->socso_acc, 'Y', "", "socso_acc", "", "", "N", "", "", "style='width:150px'");
         $o->epfaccctrl = $ctrl->getSelectAccounts($o->epf_acc, 'Y', "", "epf_acc", "", "", "N", "", "", "style='width:150px'");
         $o->salaryaccctrl = $ctrl->getSelectAccounts($o->salary_acc, 'Y', "", "salary_acc", "", "", "N", "", "", "style='width:150px'");
         $o->getInputForm("edit", $o->organization_id, $token);
         $o->showOrganizationTable("where organization_id>0", "order by defaultlevel,organization_name");
     } else {
         //if can't find particular organization from database, return error message
         redirect_header("organization.php", 3, "Some error on viewing your organization data, probably database corrupted");
     }
     break;
示例#2
0
<?php

include_once '../simantz/class/fpdf/fpdf.php';
include_once "system.php";
//include_once "../system/class/Organization.php";
include_once "../simantz/class/Period.inc.php";
include_once "../bpartner/class/BPartner.php";
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
$org = new Organization();
$bp = new BPartner();
$org->fetchOrganization($defaultorganization_id);
$xmargin = 15;
if ($_POST || $_GET) {
    $pdf = new FPDF('L', 'mm', "A5");
    //0=A4,1=Letter
    $pdf->SetAutoPageBreak(true, 10);
    if (is_array($_POST['receipt_idarr'])) {
        $receipt_idarr = $_POST['receipt_idarr'];
        $isselect = $_POST['isselect'];
    } else {
        if (isset($_POST['receipt_id'])) {
            $receipt_id = $_POST['receipt_id'];
        }
        if (isset($_GET['receipt_id'])) {
            $receipt_id = $_GET['receipt_id'];
        }
        $receipt_idarr = array(1 => $receipt_id);
        $isselect = array(1 => "on");
    }
    $i = 0;
    foreach ($receipt_idarr as $receipt_id) {
    {
        $timestamp = date("d/m/y H:i:s", time());
        //Position at 1.5 cm from bottom
        $this->SetY($this->pagefooterheight * -1);
        //Arial italic 8
        $this->SetFont('courier', 'I', 8);
        $this->Cell(0, 5, 'Page ' . $this->PageNo() . '/{nb} Generated dated ' . $timestamp, 0, 0, 'C');
    }
}
if (isset($_POST["submit"])) {
    $wherestr = "";
    $pdf = new PDF('P', 'mm', 'A4');
    $pdf->AliasNbPages();
    $pdf->SetAutoPageBreak(true, $pdf->pagefooterheight + 1);
    $organization_id = $_REQUEST['organization_id'];
    $org->fetchOrganization($organization_id);
    $companyno = $org->companyno;
    $orgname = $org->organization_name;
    $organization_code = $org->organization_code;
    $pdf->datefrom = $_POST['datefrom'];
    $pdf->dateto = $_POST['dateto'];
    //	$pdf->accounts_codefrom=getAccountsID($_POST['accounts_codefrom']);
    //	$pdf->accounts_codeto=getAccountsID($_POST['accounts_codeto']);
    if ($pdf->datefrom == "") {
        $pdf->datefrom = "0000-00-00";
    }
    if ($pdf->dateto == "") {
        $pdf->dateto = "9999-12-31";
    }
    $pdf->AddPage();
    if ($pdf->accounts_codefrom == "") {