Ejemplo n.º 1
0
 /**
  * PDF Setup - WT_Report_PDF
  */
 function setup()
 {
     parent::setup();
     // Setup the PDF class with custom size pages because WT supports more page sizes. If WT sends an unknown size name then the default would be A4
     $this->pdf = new PDF($this->orientation, parent::unit, array($this->pagew, $this->pageh), self::unicode, "UTF-8", self::diskcache);
     // Setup the PDF margins
     $this->pdf->setMargins($this->leftmargin, $this->topmargin, $this->rightmargin);
     $this->pdf->SetHeaderMargin($this->headermargin);
     $this->pdf->SetFooterMargin($this->footermargin);
     //Set auto page breaks
     $this->pdf->SetAutoPageBreak(true, $this->bottommargin);
     // Set font subsetting
     $this->pdf->setFontSubsetting(self::subsetting);
     // Setup PDF compression
     $this->pdf->SetCompression(self::compression);
     // Setup RTL support
     $this->pdf->setRTL($this->rtl);
     // Set the document information
     // Only admin should see the version number
     $appversion = WT_WEBTREES;
     if (Auth::isAdmin()) {
         $appversion .= " " . WT_VERSION;
     }
     $this->pdf->SetCreator($appversion . " (" . parent::wt_url . ")");
     // Not implemented yet - WT_Report_Base::setup()
     $this->pdf->SetAuthor($this->rauthor);
     $this->pdf->SetTitle($this->title);
     $this->pdf->SetSubject($this->rsubject);
     $this->pdf->SetKeywords($this->rkeywords);
     $this->pdf->setReport($this);
     if ($this->showGenText) {
         // The default style name for Generated by.... is 'genby'
         $element = new CellPDF(0, 10, 0, "C", "", "genby", 1, ".", ".", 0, 0, "", "", true);
         $element->addText($this->generatedby);
         $element->setUrl(parent::wt_url);
         $this->pdf->addFooter($element);
     }
 }
Ejemplo n.º 2
0
 function automaticSummaryInPDF($submission)
 {
     $countryDao =& DAORegistry::getDAO('CountryDAO');
     $articleDrugInfoDao =& DAORegistry::getDAO('ArticleDrugInfoDAO');
     $extraFieldDAO =& DAORegistry::getDAO('ExtraFieldDAO');
     $journal =& Request::getJournal();
     $submitter =& $submission->getUser();
     $title = $journal->getJournalTitle();
     $articleTexts = $submission->getArticleTexts();
     $articleTextLocales = $journal->getSupportedLocaleNames();
     $secIds = $submission->getArticleSecIds();
     $details = $submission->getArticleDetails();
     $purposes = $submission->getArticlePurposes();
     $articlePrimaryOutcomes = $submission->getArticleOutcomesByType(ARTICLE_OUTCOME_PRIMARY);
     $articleSecondaryOutcomes = $submission->getArticleOutcomesByType(ARTICLE_OUTCOME_SECONDARY);
     $coutryList = $countryDao->getCountries();
     $articleDrugs = $submission->getArticleDrugs();
     $pharmaClasses = $articleDrugInfoDao->getPharmaClasses();
     $drugStudyClasses = $articleDrugInfoDao->getClassKeysMap();
     $articleSites = $submission->getArticleSites();
     $expertisesList = $extraFieldDAO->getExtraFieldsList(EXTRA_FIELD_THERAPEUTIC_AREA, EXTRA_FIELD_ACTIVE);
     $fundingSources = $submission->getArticleFundingSources();
     $pSponsor = $submission->getArticlePrimarySponsor();
     $sSponsors = $submission->getArticleSecondarySponsors();
     $CROs = $submission->getArticleCROs();
     $contact = $submission->getArticleContact();
     Locale::requireComponents(array(LOCALE_COMPONENT_APPLICATION_COMMON, LOCALE_COMPONENT_OJS_EDITOR, LOCALE_COMPONENT_PKP_SUBMISSION, LOCALE_COMPONENT_PKP_USER));
     import('classes.lib.tcpdf.pdf');
     import('classes.lib.tcpdf.tcpdf');
     $pdf = new PDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
     $pdf->SetCreator(PDF_CREATOR);
     $pdf->SetAuthor($submitter->getFullName());
     $pdf->SetTitle($title);
     $subject = $submission->getProposalId() . ' - ' . Locale::translate('submission.summary');
     $pdf->SetSubject($subject);
     $cell_width = 45;
     $cell_height = 6;
     // set default header data
     $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE . ' 020', PDF_HEADER_STRING);
     // set header and footer fonts
     $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
     $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
     // set default monospaced font
     $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
     // set margins
     $pdf->SetMargins(PDF_MARGIN_LEFT, 58, PDF_MARGIN_RIGHT);
     $pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
     $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
     // set auto page breaks
     $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
     // set image scale factor
     $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
     $pdf->AddPage();
     // Title
     $pdf->SetFont('Times', 'B', 15);
     $w = $pdf->GetStringWidth($title) + 6;
     $pdf->SetX((210 - $w) / 2);
     $pdf->Cell($w, 9, $title, 0, 1, 'C');
     // sub-title
     $pdf->SetFont('Times', 'BI', 14);
     $w2 = $pdf->GetStringWidth($subject) + 6;
     $pdf->SetX((210 - $w2) / 2);
     $pdf->Cell($w2, 9, $subject, 0, 1, 'C');
     // Line break
     $pdf->Ln(10);
     // Main Info
     $pdf->SetFont('Times', '', 12);
     $pdf->MultiRow(50, Locale::translate("common.proposalId"), $submission->getProposalId(), 'L');
     $pdf->MultiRow(50, Locale::translate("article.title"), $submission->getScientificTitle(), 'L');
     $pdf->MultiRow(50, Locale::translate("submission.submitter"), $submitter->getFullName(), 'L');
     $pdf->MultiRow(50, Locale::translate("common.dateSubmitted"), $submission->getDateSubmitted(), 'L');
     // Line break
     $pdf->Ln(10);
     //CT Information
     $pdf->SetFont('Times', 'B', 14);
     $pdf->Cell(190, 9, 'I' . Locale::translate('common.queue.long.articleDetails', array('id' => '')), 0, 1, 'L');
     $pdf->Ln(5);
     $pdf->SetFont('Times', '', 12);
     $scientificTitle = null;
     foreach ($articleTexts as $atKey => $articleText) {
         if (!$scientificTitle) {
             $pdf->MultiRow(50, Locale::translate("proposal.scientificTitle"), $articleText->getScientificTitle() . ' (' . $articleTextLocales[$atKey] . ')', 'L');
             $scientificTitle = true;
         } else {
             $pdf->MultiRow(50, '', $articleText->getScientificTitle() . ' (' . $articleTextLocales[$atKey] . ')', 'L');
         }
     }
     $publicTitle = null;
     foreach ($articleTexts as $atKey => $articleText) {
         if (!$publicTitle) {
             $pdf->MultiRow(50, Locale::translate("proposal.publicTitle"), $articleText->getPublicTitle() . ' (' . $articleTextLocales[$atKey] . ')', 'L');
             $publicTitle = true;
         } else {
             $pdf->MultiRow(50, '', $articleText->getPublicTitle() . ' (' . $articleTextLocales[$atKey] . ')', 'L');
         }
     }
     $pdf->Ln(3);
     $firstSecId = null;
     foreach ($secIds as $secId) {
         if (!$firstSecId) {
             $pdf->MultiRow(50, Locale::translate("proposal.articleSecId"), $secId->getSecId() . ' (' . Locale::translate($secId->getTypeKey()) . ')', 'L');
             $firstSecId = true;
         } else {
             $pdf->MultiRow(50, '', $secId->getSecId() . ' (' . Locale::translate($secId->getTypeKey()) . ')', 'L');
         }
     }
     $pdf->Ln(3);
     $pdf->MultiRow(50, Locale::translate("proposal.protocolVersion"), $details->getProtocolVersion(), 'L');
     $pdf->Ln(3);
     $pdf->MultiRow(50, Locale::translate("proposal.therapeuticArea"), $details->getRightTherapeuticAreaDisplay(), 'L');
     $pdf->Ln(3);
     $firstICD10 = null;
     foreach ($details->getHealthCondDiseaseArrayToDisplay() as $healthCond) {
         $code = $healthCond['code'];
         $exactCode = $healthCond['exactCode'];
         if ($exactCode != '') {
             $code = $code . ' (' . $exactCode . ')';
         }
         if (!$firstICD10) {
             $pdf->MultiRow(50, Locale::translate("proposal.icd10s"), $code, 'L');
             $firstICD10 = true;
         } else {
             $pdf->MultiRow(50, '', $code, 'L');
         }
     }
     $pdf->Ln(3);
     $firstPurpose = null;
     foreach ($purposes as $purpose) {
         if (!$firstPurpose) {
             $purposeTitle = Locale::translate("proposal.purposes");
             $firstPurpose = true;
         } else {
             $purposeTitle = '';
         }
         if ($purpose->getType() == ARTICLE_PURPOSE_TYPE_OBS) {
             $pdf->MultiRow(50, $purposeTitle, Locale::translate($purpose->getTypeKey()), 'L');
         } else {
             $pdf->MultiRow(50, $purposeTitle, Locale::translate('proposal.purpose.type.int'), 'L');
             $pdf->MultiRow(50, '', '        ' . Locale::translate('proposal.purposes.type') . ':    ' . Locale::translate($purpose->getTypeKey()), 'L');
             $pdf->MultiRow(50, '', '        ' . Locale::translate('proposal.purposes.ctPhase') . ':    ' . Locale::translate($purpose->getCTPhaseKey()), 'L');
             $pdf->MultiRow(50, '', '        ' . Locale::translate('proposal.purposes.studyDesign') . ', ' . Locale::translate('proposal.purposes.allocation') . ':    ' . Locale::translate($purpose->getAllocationKey()), 'L');
             $pdf->MultiRow(50, '', '                        ' . Locale::translate('proposal.purposes.masking') . ':    ' . Locale::translate($purpose->getMaskingKey()), 'L');
             $pdf->MultiRow(50, '', '                        ' . Locale::translate('proposal.purposes.control') . ':    ' . Locale::translate($purpose->getControlKey()), 'L');
             $pdf->MultiRow(50, '', '                        ' . Locale::translate('proposal.purposes.assignment') . ':    ' . Locale::translate($purpose->getAssignmentKey()), 'L');
             $pdf->MultiRow(50, '', '                        ' . Locale::translate('proposal.purposes.endpoint') . ':    ' . Locale::translate($purpose->getEndpointKey()), 'L');
         }
     }
     $pdf->Ln(3);
     $description = null;
     foreach ($articleTexts as $atKey => $articleText) {
         if (!$description) {
             $pdf->MultiRow(50, Locale::translate("proposal.description"), $articleText->getDescription() . ' (' . $articleTextLocales[$atKey] . ')', 'L');
             $description = true;
         } else {
             $pdf->MultiRow(50, '', $articleText->getDescription() . ' (' . $articleTextLocales[$atKey] . ')', 'L');
         }
     }
     $pdf->Ln(3);
     $kic = null;
     foreach ($articleTexts as $atKey => $articleText) {
         if (!$kic) {
             $pdf->MultiRow(50, Locale::translate("proposal.keyInclusionCriteria"), $articleText->getKeyInclusionCriteria() . ' (' . $articleTextLocales[$atKey] . ')', 'L');
             $kic = true;
         } else {
             $pdf->MultiRow(50, '', $articleText->getKeyInclusionCriteria() . ' (' . $articleTextLocales[$atKey] . ')', 'L');
         }
     }
     $pdf->Ln(3);
     $kec = null;
     foreach ($articleTexts as $atKey => $articleText) {
         if (!$kec) {
             $pdf->MultiRow(50, Locale::translate("proposal.keyExclusionCriteria"), $articleText->getKeyExclusionCriteria() . ' (' . $articleTextLocales[$atKey] . ')', 'L');
             $kec = true;
         } else {
             $pdf->MultiRow(50, '', $articleText->getKeyExclusionCriteria() . ' (' . $articleTextLocales[$atKey] . ')', 'L');
         }
     }
     $pdf->Ln(3);
     $firstPOutcome = null;
     foreach ($articlePrimaryOutcomes as $articleOutcomeLocales) {
         foreach ($articleOutcomeLocales as $key => $articleOutcome) {
             if (!$firstPOutcome) {
                 $outcomeTitle = Locale::translate("proposal.primaryOutcomes");
                 $firstPOutcome = true;
             } else {
                 $outcomeTitle = '';
             }
             $pdf->MultiRow(50, $outcomeTitle, $articleOutcome->getName() . ' (' . $articleTextLocales[$key] . ')', 'L');
             $pdf->MultiRow(50, '', '        ' . Locale::translate('proposal.primaryOutcome.measurement') . ':        ' . $articleOutcome->getMeasurement(), 'L');
             $pdf->MultiRow(50, '', '        ' . Locale::translate('proposal.primaryOutcome.timepoint') . ':        ' . $articleOutcome->getTimepoint(), 'L');
             $pdf->Ln(3);
         }
     }
     $firstSOutcome = null;
     foreach ($articleSecondaryOutcomes as $articleOutcomeLocales) {
         foreach ($articleOutcomeLocales as $key => $articleOutcome) {
             if (!$firstSOutcome) {
                 $sOutcomeTitle = Locale::translate("proposal.secondaryOutcomes");
                 $firstSOutcome = true;
             } else {
                 $sOutcomeTitle = '';
             }
             $pdf->MultiRow(50, $sOutcomeTitle, $articleOutcome->getName() . ' (' . $articleTextLocales[$key] . ')', 'L');
             $pdf->MultiRow(50, '', '        ' . Locale::translate('proposal.primaryOutcome.measurement') . ':        ' . $articleOutcome->getMeasurement(), 'L');
             $pdf->MultiRow(50, '', '        ' . Locale::translate('proposal.primaryOutcome.timepoint') . ':        ' . $articleOutcome->getTimepoint(), 'L');
             $pdf->Ln(3);
         }
     }
     $pdf->MultiRow(50, Locale::translate("proposal.age.minimum"), $details->getMinAgeNum() . ' ' . Locale::translate($details->getMinAgeUnitKey()), 'L');
     $pdf->MultiRow(50, Locale::translate("proposal.age.maximum"), $details->getMaxAgeNum() . ' ' . Locale::translate($details->getMaxAgeUnitKey()), 'L');
     $pdf->MultiRow(50, Locale::translate("proposal.sex"), Locale::translate($details->getSexKey()), 'L');
     $pdf->MultiRow(50, Locale::translate("proposal.healthy"), Locale::translate($details->getYesNoKey($details->getHealthy())), 'L');
     $pdf->Ln(3);
     $pdf->MultiRow(50, Locale::translate("proposal.localeSampleSize"), $details->getLocaleSampleSize(), 'L');
     $pdf->MultiRow(50, Locale::translate("proposal.multinational") . ' ' . $journal->getLocalizedSetting('location'), Locale::translate($details->getYesNoKey($details->getMultinational())), 'L');
     if ($details->getMultinational() == ARTICLE_DETAIL_YES) {
         foreach ($details->getIntSampleSizeArray() as $countryAndNumberArray) {
             $country = $countryAndNumberArray['country'];
             $pdf->MultiRow(50, '', '        ' . $coutryList[$country] . ': ' . $countryAndNumberArray['number'], 'L');
         }
     }
     $pdf->Ln(3);
     $pdf->MultiRow(50, Locale::translate("proposal.expectedDate"), Locale::translate('proposal.startDate') . ': ' . $details->getStartDate() . ', ' . Locale::translate('proposal.endDate') . ': ' . $details->getEndDate(), 'L');
     $pdf->Ln(3);
     $pdf->MultiRow(50, Locale::translate("proposal.recruitment"), Locale::translate("proposal.recruitment.status") . ': ' . Locale::translate($details->getRecruitmentStatusKey()), 'L');
     $rssi = null;
     foreach ($articleTexts as $atKey => $articleText) {
         if ($articleText->getRecruitmentInfo() != '') {
             if (!$rssi) {
                 $pdf->MultiRow(50, '', Locale::translate("proposal.recruitment.info") . ': ' . $articleText->getRecruitmentInfo() . ' (' . $articleTextLocales[$atKey] . ')', 'L');
                 $rssi = true;
             } else {
                 $pdf->MultiRow(50, '', $articleText->getRecruitmentInfo() . ' (' . $articleTextLocales[$atKey] . ')', 'L');
             }
         }
     }
     $pdf->MultiRow(50, '', Locale::translate("proposal.recruitment.adScheme") . ': ' . Locale::translate($details->getYesNoKey($details->getAdvertisingScheme())), 'L');
     // Line break
     $pdf->Ln(10);
     //Drug products
     $pdf->SetFont('Times', 'B', 14);
     $pdf->Cell(190, 9, 'II' . Locale::translate('common.queue.long.articleDrugs', array('id' => '')), 0, 1, 'L');
     $pdf->Ln(5);
     foreach ($articleDrugs as $articleDrug) {
         $pdf->SetFont('Times', 'BU', 12);
         $pdf->Cell(190, 9, $articleDrug->getName(), 0, 1, 'L');
         $pdf->SetFont('Times', '', 12);
         $pdf->Ln(3);
         $pdf->MultiRow(50, Locale::translate("proposal.drugInfo.type"), Locale::translate($articleDrug->getTypeKey()), 'L');
         $pdf->MultiRow(50, Locale::translate("proposal.drugInfo.name"), $articleDrug->getName(), 'L');
         $pdf->MultiRow(50, Locale::translate("proposal.drugInfo.brandName"), $articleDrug->getBrandName(), 'L');
         if ($articleDrug->getOtherAdministration() == 'NA') {
             $pdf->MultiRow(50, Locale::translate("proposal.drugInfo.administration"), Locale::translate($articleDrug->getAdministrationKey()), 'L');
         } else {
             $pdf->MultiRow(50, Locale::translate("proposal.drugInfo.administration"), $articleDrug->getOtherAdministration(), 'L');
         }
         if ($articleDrug->getOtherForm() == 'NA') {
             $pdf->MultiRow(50, Locale::translate("proposal.drugInfo.form"), Locale::translate($articleDrug->getFormKey()), 'L');
         } else {
             $pdf->MultiRow(50, Locale::translate("proposal.drugInfo.form"), $articleDrug->getOtherForm(), 'L');
         }
         $pdf->MultiRow(50, Locale::translate("proposal.drugInfo.strength"), $articleDrug->getStrength(), 'L');
         $pdf->MultiRow(50, Locale::translate("proposal.drugInfo.storage"), Locale::translate($articleDrug->getStorageKey()), 'L');
         $pdf->MultiRow(50, Locale::translate("proposal.drugInfo.pharmaClass"), $pharmaClasses[$articleDrug->getPharmaClass()], 'L');
         $firstClass = false;
         $classIIIOrIV = false;
         $classesToDisplay = '';
         foreach ($articleDrug->getClassesArray() as $class) {
             if ($class == ARTICLE_DRUG_INFO_CLASS_III || $class == ARTICLE_DRUG_INFO_CLASS_IV) {
                 $classIIIOrIV = true;
             }
             if (!$firstClass) {
                 $classesToDisplay = Locale::translate($drugStudyClasses[$class]);
             } else {
                 $classesToDisplay = $classesToDisplay . ', ' . Locale::translate($drugStudyClasses[$class]);
             }
             $firstClass = true;
         }
         $pdf->MultiRow(50, Locale::translate("proposal.drugInfo.studyClasses"), $classesToDisplay, 'L');
         if ($classIIIOrIV) {
             $countriesToDisplay = '';
             $firstCountry = false;
             foreach ($articleDrug->getCountriesArray() as $country) {
                 if (!$firstCountry) {
                     $countriesToDisplay = $coutryList[$country];
                 } else {
                     $countriesToDisplay = $countriesToDisplay . ', ' . $coutryList[$country];
                 }
                 $firstCountry = true;
             }
             $pdf->MultiRow(50, '', Locale::translate("proposal.drugInfo.countries") . ': ' . $countriesToDisplay, 'L');
             $pdf->MultiRow(50, '', Locale::translate("proposal.drugInfo.conditionsOfUse") . ': ' . Locale::translate($articleDrug->getDifferentConditionsOfUseKey()), 'L');
         }
         $pdf->MultiRow(50, Locale::translate("proposal.drugInfo.cpr"), Locale::translate($articleDrug->getCPRKey()), 'L');
         if ($articleDrug->getCPR() == ARTICLE_DRUG_INFO_YES) {
             $pdf->MultiRow(50, '', Locale::translate("proposal.drugInfo.drugRegistrationNumber") . ': ' . $articleDrug->getDrugRegistrationNumber(), 'L');
         }
         if ($articleDrug->getImportedQuantity() != '') {
             $pdf->MultiRow(50, Locale::translate("proposal.drugInfo.importedQuantity"), $articleDrug->getImportedQuantity(), 'L');
         }
         $firstManufacturer = false;
         foreach ($articleDrug->getManufacturers() as $manufacturer) {
             $manufacturerTitle = '';
             if (!$firstManufacturer) {
                 $manufacturerTitle = Locale::translate('proposal.drugInfo.manufacturers');
             }
             $pdf->MultiRow(50, $manufacturerTitle, $manufacturer->getName(), 'L');
             $pdf->MultiRow(50, '', Locale::translate('proposal.drugInfo.manufacturer.address') . ': ' . $manufacturer->getAddress(), 'L');
             $firstManufacturer = true;
             $pdf->Ln(2);
         }
         $pdf->Ln(3);
     }
     // Line break
     $pdf->Ln(10);
     // Trial Site(s)
     $pdf->SetFont('Times', 'B', 14);
     $pdf->Cell(190, 9, 'III' . Locale::translate('common.queue.long.articleSites', array('id' => '')), 0, 1, 'L');
     $pdf->Ln(5);
     foreach ($articleSites as $articleSite) {
         $trialSiteObject = $articleSite->getTrialSiteObject();
         $pdf->SetFont('Times', 'BU', 12);
         $pdf->Cell(190, 9, $trialSiteObject->getName(), 0, 1, 'L');
         $pdf->SetFont('Times', '', 12);
         $pdf->Ln(3);
         $pdf->MultiRow(50, Locale::translate("proposal.articleSite.site"), $trialSiteObject->getName(), 'L');
         $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.siteAddress') . ': ' . $trialSiteObject->getAddress(), 'L');
         $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.siteCity') . ': ' . $trialSiteObject->getCity(), 'L');
         $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.siteRegion') . ': ' . $trialSiteObject->getRegionText(), 'L');
         $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.siteLicensure') . ': ' . $trialSiteObject->getLicensure(), 'L');
         $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.siteAccreditation') . ': ' . $trialSiteObject->getAccreditation(), 'L');
         $pdf->Ln(2);
         $pdf->MultiRow(50, Locale::translate("proposal.articleSite.erc"), $articleSite->getERCName(), 'L');
         $pdf->Ln(2);
         $pdf->MultiRow(50, Locale::translate("proposal.articleSite.authority"), $articleSite->getAuthority(), 'L');
         $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.primaryPhone') . ': ' . $articleSite->getPrimaryPhone(), 'L');
         if ($articleSite->getSecondaryPhone()) {
             $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.secondaryPhone') . ': ' . $articleSite->getSecondaryPhone(), 'L');
         }
         if ($articleSite->getFax()) {
             $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.fax') . ': ' . $articleSite->getFax(), 'L');
         }
         $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.email') . ': ' . $articleSite->getEmail(), 'L');
         $pdf->Ln(2);
         $pdf->MultiRow(50, Locale::translate("proposal.articleSite.subjectsNumber"), $articleSite->getSubjectsNumber(), 'L');
         $pdf->Ln(2);
         $countInvestigators = 1;
         foreach ($articleSite->getInvestigators() as $investigator) {
             $investigatorTitle = "";
             if ($countInvestigators == 1) {
                 $investigatorTitle = Locale::translate('user.role.primaryInvestigator');
             } elseif ($countInvestigators == 2) {
                 $investigatorTitle = Locale::translate('user.role.coinvestigator');
             }
             $pdf->MultiRow(50, $investigatorTitle, $investigator->getFullName(), 'L');
             $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.investigator.expertise') . ': ' . $expertisesList[$investigator->getExpertise()], 'L');
             $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.investigator.iPrimaryPhone') . ': ' . $investigator->getPrimaryPhoneNumber(), 'L');
             if ($investigator->getSecondaryPhoneNumber()) {
                 $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.investigator.iSecondaryPhone') . ': ' . $investigator->getSecondaryPhoneNumber(), 'L');
             }
             if ($investigator->getFaxNumber()) {
                 $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.investigator.iFax') . ': ' . $investigator->getFaxNumber(), 'L');
             }
             $pdf->MultiRow(50, '', Locale::translate('proposal.articleSite.investigator.iEmail') . ': ' . $investigator->getEmail(), 'L');
             $countInvestigators++;
         }
         $pdf->Ln(3);
     }
     // Line break
     $pdf->Ln(10);
     // Sponsors
     $pdf->SetFont('Times', 'B', 14);
     $pdf->Cell(190, 9, 'IV' . Locale::translate('common.queue.long.articleSponsors', array('id' => '')), 0, 1, 'L');
     $pdf->Ln(5);
     $pdf->SetFont('Times', '', 12);
     $firstFSource = false;
     foreach ($fundingSources as $fundingSource) {
         $fSourceTitle = '';
         if (!$firstFSource) {
             $fSourceTitle = Locale::translate('proposal.articleSponsor.fundingSources');
         }
         $institution = $fundingSource->getInstitutionObject();
         $pdf->MultiRow(50, $fSourceTitle, $institution->getInstitutionName(), 'L');
         $pdf->MultiRow(50, '', '        ' . Locale::translate('proposal.articleSponsor.acronym') . ': ' . $institution->getInstitutionAcronym(), 'L');
         $pdf->MultiRow(50, '', '        ' . Locale::translate('proposal.articleSponsor.type') . ': ' . Locale::translate($institution->getInstitutionTypeKey()), 'L');
         $pdf->MultiRow(50, '', '        ' . Locale::translate('proposal.articleSponsor.location') . ': ' . $institution->getInstitutionInternationalText(), 'L');
         if ($institution->getInstitutionInternational() == INSTITUTION_INTERNATIONAL) {
             $pdf->MultiRow(50, '', '        ' . Locale::translate('proposal.articleSponsor.locationInternational') . ': ' . $institution->getInstitutionLocationText(), 'L');
         } else {
             $pdf->MultiRow(50, '', '        ' . Locale::translate('proposal.articleSponsor.locationCountry') . ': ' . $institution->getInstitutionLocationText(), 'L');
         }
         $pdf->Ln(2);
         $firstFSource = true;
     }
     $pdf->Ln(1);
     $institution = $pSponsor->getInstitutionObject();
     $pdf->MultiRow(50, Locale::translate("proposal.articleSponsor.primarySponsor"), $institution->getInstitutionName(), 'L');
     $pdf->MultiRow(50, '', '        ' . Locale::translate('proposal.articleSponsor.acronym') . ': ' . $institution->getInstitutionAcronym(), 'L');
     $pdf->MultiRow(50, '', '        ' . Locale::translate('proposal.articleSponsor.type') . ': ' . Locale::translate($institution->getInstitutionTypeKey()), 'L');
     $pdf->MultiRow(50, '', '        ' . Locale::translate('proposal.articleSponsor.location') . ': ' . $institution->getInstitutionInternationalText(), 'L');
     if ($institution->getInstitutionInternational() == INSTITUTION_INTERNATIONAL) {
         $pdf->MultiRow(50, '', '        ' . Locale::translate('proposal.articleSponsor.locationInternational') . ': ' . $institution->getInstitutionLocationText(), 'L');
     } else {
         $pdf->MultiRow(50, '', '        ' . Locale::translate('proposal.articleSponsor.locationCountry') . ': ' . $institution->getInstitutionLocationText(), 'L');
     }
     $pdf->Ln(3);
     $firstSSponsor = false;
     foreach ($sSponsors as $sSponsor) {
         $SSponsorTitle = '';
         if (!$firstSSponsor) {
             $SSponsorTitle = Locale::translate('proposal.articleSponsor.secondarySponsors');
         }
         $institution = $sSponsor->getInstitutionObject();
         $pdf->MultiRow(50, $SSponsorTitle, $institution->getInstitutionName(), 'L');
         $pdf->MultiRow(50, '', '        ' . Locale::translate('proposal.articleSponsor.acronym') . ': ' . $institution->getInstitutionAcronym(), 'L');
         $pdf->MultiRow(50, '', '        ' . Locale::translate('proposal.articleSponsor.type') . ': ' . Locale::translate($institution->getInstitutionTypeKey()), 'L');
         $pdf->MultiRow(50, '', '        ' . Locale::translate('proposal.articleSponsor.location') . ': ' . $institution->getInstitutionInternationalText(), 'L');
         if ($institution->getInstitutionInternational() == INSTITUTION_INTERNATIONAL) {
             $pdf->MultiRow(50, '', '        ' . Locale::translate('proposal.articleSponsor.locationInternational') . ': ' . $institution->getInstitutionLocationText(), 'L');
         } else {
             $pdf->MultiRow(50, '', '        ' . Locale::translate('proposal.articleSponsor.locationCountry') . ': ' . $institution->getInstitutionLocationText(), 'L');
         }
         $pdf->Ln(2);
         $firstSSponsor = true;
     }
     $pdf->Ln(1);
     $pdf->MultiRow(50, Locale::translate("proposal.articleSponsor.croInvolved"), Locale::translate($details->getYesNoKey($details->getCROInvolved())), 'L');
     foreach ($CROs as $CRO) {
         $pdf->MultiRow(50, '', $CRO->getName(), 'L');
         $pdf->MultiRow(50, '', Locale::translate('proposal.articleSponsor.cro.location') . ': ' . $CRO->getInternationalText(), 'L');
         if ($CRO->getInternational() == CRO_INTERNATIONAL) {
             $pdf->MultiRow(50, '', Locale::translate('proposal.articleSponsor.locationInternational') . ': ' . $CRO->getLocationText(), 'L');
         } else {
             $pdf->MultiRow(50, '', Locale::translate('proposal.articleSponsor.locationCountry') . ': ' . $CRO->getLocationText(), 'L');
         }
         $pdf->MultiRow(50, '', Locale::translate('proposal.articleSponsor.cro.city') . ': ' . $CRO->getCity(), 'L');
         $pdf->MultiRow(50, '', Locale::translate('proposal.articleSponsor.cro.address') . ': ' . $CRO->getAddress(), 'L');
         $pdf->MultiRow(50, '', Locale::translate('proposal.articleSponsor.cro.primaryPhone') . ': ' . $CRO->getPrimaryPhone(), 'L');
         if ($CRO->getSecondaryPhone()) {
             $pdf->MultiRow(50, '', Locale::translate('proposal.articleSponsor.cro.secondaryPhone') . ': ' . $CRO->getSecondaryPhone(), 'L');
         }
         if ($CRO->getFax()) {
             $pdf->MultiRow(50, '', Locale::translate('proposal.articleSponsor.cro.fax') . ': ' . $CRO->getFax(), 'L');
         }
         $pdf->MultiRow(50, '', Locale::translate('proposal.articleSponsor.cro.email') . ': ' . $CRO->getEmail(), 'L');
         $pdf->Ln(2);
     }
     $pdf->Ln(1);
     // Line break
     $pdf->Ln(10);
     // Contact Information
     $pdf->SetFont('Times', 'B', 14);
     $pdf->Cell(190, 9, 'V' . Locale::translate('common.queue.long.articleContact', array('id' => '')), 0, 1, 'L');
     $pdf->Ln(5);
     $pdf->SetFont('Times', '', 12);
     $pdf->MultiRow(50, Locale::translate("proposal.articleContact.pq"), $contact->getPQName(), 'L');
     $pdf->MultiRow(50, '', Locale::translate("proposal.articleContact.affiliation") . ': ' . $contact->getPQAffiliation(), 'L');
     $pdf->MultiRow(50, '', Locale::translate("proposal.articleContact.address") . ': ' . $contact->getPQAddress(), 'L');
     $pdf->MultiRow(50, '', Locale::translate("proposal.articleContact.country") . ': ' . $coutryList[$contact->getPQCountry()], 'L');
     $pdf->MultiRow(50, '', Locale::translate("proposal.articleContact.phone") . ': ' . $contact->getPQPhone(), 'L');
     if ($contact->getPQFax() != '') {
         $pdf->MultiRow(50, '', Locale::translate("proposal.articleContact.fax") . ': ' . $contact->getPQFax(), 'L');
     }
     $pdf->MultiRow(50, '', Locale::translate("proposal.articleContact.email") . ': ' . $contact->getPQEmail(), 'L');
     $pdf->Ln(3);
     $pdf->MultiRow(50, Locale::translate("proposal.articleContact.sq"), $contact->getSQName(), 'L');
     $pdf->MultiRow(50, '', Locale::translate("proposal.articleContact.affiliation") . ': ' . $contact->getSQAffiliation(), 'L');
     $pdf->MultiRow(50, '', Locale::translate("proposal.articleContact.address") . ': ' . $contact->getSQAddress(), 'L');
     $pdf->MultiRow(50, '', Locale::translate("proposal.articleContact.country") . ': ' . $coutryList[$contact->getSQCountry()], 'L');
     $pdf->MultiRow(50, '', Locale::translate("proposal.articleContact.phone") . ': ' . $contact->getSQPhone(), 'L');
     if ($contact->getPQFax() != '') {
         $pdf->MultiRow(50, '', Locale::translate("proposal.articleContact.fax") . ': ' . $contact->getSQFax(), 'L');
     }
     $pdf->MultiRow(50, '', Locale::translate("proposal.articleContact.email") . ': ' . $contact->getSQEmail(), 'L');
     $pdf->Output($submission->getProposalId() . '-' . Locale::translate('submission.summary') . '.pdf', "D");
 }
Ejemplo n.º 3
0
         parent::Header();
     }
     function Footer()
     {
         //Position at 1.5 cm from bottom
         $this->SetY(-15);
         //Arial italic 8
         $this->SetFont('Arial', 'I', 8);
         //Page number
         $this->Cell(0, 10, 'Page ' . $this->PageNo() . '/{nb}', 0, 0, 'C');
     }
 }
 $pdf = new PDF('L', $unit = 'mm', $format = 'A4');
 $pdf->AliasNbPages();
 $pdf->SetAuthor("*****@*****.**");
 $pdf->SetSubject("Daily Sales");
 $pdf->SetTitle("Daily Sales");
 $pdf->SetCreator("Imran Zahid");
 $prop = array('color1' => array(255, 255, 255), 'color2' => array(255, 255, 255), 'color3' => array(128, 128, 128), 'padding' => 2, 'font' => array('Arial', '', 10), 'thfont' => array('Arial', 'B', 10));
 $pdf->AddPage();
 $pdf->AddCol('party_name', "20%", 'Party', 'L');
 $pdf->AddCol('vendor', "20%", 'Vendor', 'L');
 $pdf->AddCol('cat_name', "20%", 'Category', 'L');
 $pdf->AddCol('description', "20%", 'Item', 'L');
 $pdf->AddCol("cs", "10%", 'CS', 'R');
 $pdf->AddCol("pc", "10%", 'PC', 'R');
 $pdf->Table($data, $prop);
 $_cMargin = $pdf->cMargin;
 $pdf->cMargin = $prop['padding'];
 $pdf->SetFont('Arial', 'B', 10);
 $pdf->Cell(221.59806666667, 6, "Total", 1, 0, 'C');
Ejemplo n.º 4
0
         //Position at 1.5 cm from bottom
         $this->SetY(-15);
         //Arial italic 8
         $this->SetFont('Arial', 'I', 8);
         //Page number
         //$this->Cell(0, 10, 'Page ' . $this->PageNo() . '/{nb}', 0, 0, 'C');
         $this->SetX($this->lMargin);
         $this->Cell(0, 10, 'Please consider the environment before printing this report', 0, 0, 'L');
         $this->SetX($this->lMargin);
         $this->Cell(0, 10, 'Report generated by nexexcel.com', 0, 0, 'R');
     }
 }
 $pdf = new PDF('P', 'mm', 'A5');
 $pdf->AliasNbPages();
 $pdf->SetAuthor("*****@*****.**");
 $pdf->SetSubject("Purchase Return");
 $pdf->SetTitle("Purchase Return");
 $pdf->SetCreator("Imran Zahid");
 $prop = array('HeaderColor' => array(0, 0, 0), 'HeaderTextColor' => array(255, 255, 255), 'color1' => array(217, 217, 217), 'color2' => array(255, 255, 255), 'textcolor1' => array(0, 0, 0), 'textcolor2' => array(0, 0, 0), 'padding' => 2, 'font' => array('Arial', '', 8), 'thfont' => array('Arial', 'B', 8));
 $title = $_title;
 $pdf->AddPage();
 $where = "";
 if (strlen($_GET['invoice']) > 0) {
     $input = $_GET['invoice'];
     $rangeCharacters = "0123456789, -";
     $billnos = array();
     $ret = containsOnly($input, $rangeCharacters);
     if (containsOnly($input, $rangeCharacters)) {
         $ranges = explode(",", $input);
         for ($j = 0; $j < count($ranges); $j++) {
             $range = trim($ranges[$j]);
Ejemplo n.º 5
0
         //Position at 1.5 cm from bottom
         $this->SetY(-15);
         //Arial italic 8
         $this->SetFont('Arial', 'I', 8);
         //Page number
         //$this->Cell(0, 10, 'Page ' . $this->PageNo() . '/{nb}', 0, 0, 'C');
         $this->SetX($this->lMargin);
         $this->Cell(0, 10, 'Please consider the environment before printing this report', 0, 0, 'L');
         $this->SetX($this->lMargin);
         $this->Cell(0, 10, 'Report generated by nexexcel.com', 0, 0, 'R');
     }
 }
 $pdf = new PDF('L');
 $pdf->AliasNbPages();
 $pdf->SetAuthor("*****@*****.**");
 $pdf->SetSubject("Sales Comparision");
 $pdf->SetTitle("Sales Comparision");
 $pdf->SetCreator("Imran Zahid");
 foreach ($regionals as $city => $regional) {
     $prop = array('HeaderColor' => array(0, 0, 0), 'HeaderTextColor' => array(255, 255, 255), 'color1' => array(217, 217, 217), 'color2' => array(255, 255, 255), 'textcolor1' => array(0, 0, 0), 'textcolor2' => array(0, 0, 0), 'padding' => 1, 'formatNumber' => TRUE, 'font' => array('Arial', '', 8), 'thfont' => array('Arial', 'B', 10));
     $ndata = $regional['data'];
     $totals = $regional['totals'];
     $pdf->AddPage();
     $pdf->AddCol('vendor', '16%', 'Vendor', 'L');
     foreach ($months as $month) {
         $pdf->AddCol($month, '7%', $month, 'R');
     }
     $pdf->Table($ndata, $prop);
     $prop['font'] = array('Arial', 'B', 10);
     $ndata = array();
     $ndata[] = $totals;
         //Position at 1.5 cm from bottom
         $this->SetY(-15);
         //Arial italic 8
         $this->SetFont('Arial', 'I', 8);
         //Page number
         //$this->Cell(0, 10, 'Page ' . $this->PageNo() . '/{nb}', 0, 0, 'C');
         $this->SetX($this->lMargin);
         $this->Cell(0, 10, 'Please consider the environment before printing this report', 0, 0, 'L');
         $this->SetX($this->lMargin);
         $this->Cell(0, 10, 'Report generated by nexexcel.com', 0, 0, 'R');
     }
 }
 $pdf = new PDF('L');
 $pdf->AliasNbPages();
 $pdf->SetAuthor("*****@*****.**");
 $pdf->SetSubject("Sales Vendor Party");
 $pdf->SetTitle("Sales Vendor Party");
 $pdf->SetCreator("Imran Zahid");
 $prop = array('HeaderColor' => array(0, 0, 0), 'HeaderTextColor' => array(255, 255, 255), 'color1' => array(217, 217, 217), 'color2' => array(255, 255, 255), 'textcolor1' => array(0, 0, 0), 'textcolor2' => array(0, 0, 0), 'padding' => 2, 'formatNumber' => TRUE, 'font' => array('Arial', '', 10), 'thfont' => array('Arial', 'B', 12));
 $pdf->AddPage();
 $pdf->AddCol('seq', '8%', 'Inv No', 'L');
 $pdf->AddCol('cno', '5%', 'C-No', 'L');
 $pdf->AddCol('description', '47%', 'Item Description', 'L');
 $pdf->AddCol('sales_qty', '8%', 'Quantity', 'R');
 $pdf->AddCol('sales_rate', '8%', 'Rate', 'R');
 $pdf->AddCol('circular_rate', '8%', 'Circular', 'R');
 $pdf->AddCol('fix_rate', '8%', 'Fix Rate', 'R');
 $pdf->AddCol('diff', '8%', 'Difference', 'R');
 $pdf->Table($data, $prop);
 $prop['font'] = array('Arial', 'B', 12);
 $data = array($tdata);
Ejemplo n.º 7
0
             //Position at 1.5 cm from bottom
             $this->SetY(-15);
             //Arial italic 8
             $this->SetFont('Arial', 'I', 8);
             //Page number
             $this->Cell(0, 10, 'Page ' . $this->PageNo() . '/{nb}', 0, 0, 'C');
             $this->SetX($this->lMargin);
             $this->Cell(0, 10, 'Please consider the environment before printing this report', 0, 0, 'L');
             $this->SetX($this->lMargin);
             $this->Cell(0, 10, 'Report generated by nexexcel.com', 0, 0, 'R');
         }
     }
     $pdf = new PDF('L');
     $pdf->AliasNbPages();
     $pdf->SetAuthor("*****@*****.**");
     $pdf->SetSubject("Order Report");
     $pdf->SetTitle("Order Report");
     $pdf->SetCreator("Imran Zahid");
     $prop = array('HeaderColor' => array(0, 0, 0), 'HeaderTextColor' => array(255, 255, 255), 'color1' => array(217, 217, 217), 'color2' => array(255, 255, 255), 'textcolor1' => array(0, 0, 0), 'textcolor2' => array(0, 0, 0), 'padding' => 2, 'font' => array('Arial', '', 8), 'thfont' => array('Arial', 'B', 10));
     $pdf->AddPage();
     $pdf->AddCol('sno', '5%', 'S.No.', 'C');
     $pdf->AddCol('CNo', '10%', 'Date', 'L');
     $pdf->AddCol('party_name', '20%', 'Manufacturer #', 'L');
     $pdf->AddCol('item', '40%', 'Item Name', 'L');
     $pdf->AddCol('qty', '15%', 'Quantity', 'R');
     $pdf->AddCol('unit', '10%', 'Unit', 'L');
     $pdf->Table($data, $prop);
     $pdf->Output("order_invoice.pdf", "D");
 } else {
     if ($_GET['report'] == 'xls') {
         require_once '../../Classes/PHPExcel.php';
Ejemplo n.º 8
0
$c1h = 170;
$c2h = $c1h / 2;
$c3h = $c2h / 2;
$c4h = $c3h / 2;
$bottom = $top + $c1h;
$pdf = new PDF('L', 'mm', 'Letter');
$pdf->Open();
$pdf->SetTopMargin(13);
$pdf->SetLeftMargin(13);
$pdf->SetRightMargin(10);
$pdf->SetAutoPageBreak(True, 13);
$pdf->AddPage();
$pdf->SetCreator($_SERVER["PHP_SELF"]);
$pdf->SetAuthor("Keith Morrison, keithm@infused.org");
$pdf->SetTitle(sprintf(gtc("Pedigree for %s"), $o->full_name()));
$pdf->SetSubject(gtc("Genealogy"));
# Person 1
$pdf->SetY($top);
$pdf->SetX($c1x);
$pdf->Cell($w, $c1h, '', 1, 0, 'L');
$pdf->SetY($top + $c1h / 2 - 6);
$pdf->SetX($c1x);
$pdf->SetFont($font, 'B', 10);
$pdf->MultiCell($w, 4, isset($g_node_strings[1][0]) ? $g_node_strings[1][0] : '', 0, 'L');
$pdf->SetFont($font, '', 10);
$pdf->Cell($w, 4, isset($g_node_strings[1][1]) ? $g_node_strings[1][1] : '', 0, 2, 'L');
$pdf->Cell($w, 4, isset($g_node_strings[1][2]) ? $g_node_strings[1][2] : '', 0, 0, 'L');
# Person 2
$pdf->SetY($top);
$pdf->SetX($c2x);
$pdf->Cell($w, $c2h, '', 1, 0, 'L');
Ejemplo n.º 9
0
         //Position at 1.5 cm from bottom
         $this->SetY(-15);
         //Arial italic 8
         $this->SetFont('Arial', 'I', 8);
         //Page number
         $this->Cell(0, 10, 'Page ' . $this->PageNo() . '/{nb}', 0, 0, 'C');
         $this->SetX($this->lMargin);
         $this->Cell(0, 10, 'Please consider the environment before printing this report', 0, 0, 'L');
         $this->SetX($this->lMargin);
         $this->Cell(0, 10, 'Report generated by nexexcel.com', 0, 0, 'R');
     }
 }
 $pdf = new PDF();
 $pdf->AliasNbPages();
 $pdf->SetAuthor("*****@*****.**");
 $pdf->SetSubject("PL Statement");
 $pdf->SetTitle("PL Statement");
 $pdf->SetCreator("Imran Zahid");
 $prop = array('color1' => array(255, 255, 255), 'color2' => array(255, 255, 255), 'color3' => array(128, 128, 128), 'padding' => 2, 'formatNumber' => TRUE, 'formatNumberDecimal' => 2, 'font' => array('Arial', '', 8), 'thfont' => array('Arial', 'B', 10));
 $title = $_title;
 $totals = array("sales" => array($rows[0]['Cash Sales'] + $rows[0]['Credit Sales'], $rows[1]['Cash Sales'] + $rows[1]['Credit Sales'], $rows[2]['Cash Sales'] + $rows[2]['Credit Sales']), "sales_return_discount" => array($rows[0]['Sales Return'] + $rows[0]['Sales Discount'], $rows[1]['Sales Return'] + $rows[1]['Sales Discount'], $rows[2]['Sales Return'] + $rows[2]['Sales Discount']), "purchase" => array($rows[0]['Cash Purchase'] + $rows[0]['Credit Purchase'], $rows[1]['Cash Purchase'] + $rows[1]['Credit Purchase'], $rows[2]['Cash Purchase'] + $rows[2]['Credit Purchase']), "purchase_return_discount" => array($rows[0]['Purchase Return'] + $rows[0]['Purchase Discount'], $rows[1]['Purchase Return'] + $rows[1]['Purchase Discount'], $rows[2]['Purchase Return'] + $rows[2]['Purchase Discount']));
 $totals['net_sales'] = array($totals['sales'][0] - $totals['sales_return_discount'][0], $totals['sales'][1] - $totals['sales_return_discount'][1], $totals['sales'][2] - $totals['sales_return_discount'][2]);
 $totals['net_purchase'] = array($totals['purchase'][0] - $totals['purchase_return_discount'][0], $totals['purchase'][1] - $totals['purchase_return_discount'][1], $totals['purchase'][2] - $totals['purchase_return_discount'][2]);
 $totals['cogs'] = array($rows[0]['Open Inventory'] + $totals['net_purchase'][0] - $rows[1]['Close Inventory'], $rows[1]['Open Inventory'] + $totals['net_purchase'][1] - $rows[1]['Close Inventory'], $rows[2]['Open Inventory'] + $totals['net_purchase'][2] - $rows[2]['Close Inventory']);
 $totals['gross_profit'] = array($totals['net_sales'][0] - $totals['cogs'][0], $totals['net_sales'][1] - $totals['cogs'][1], $totals['net_sales'][2] - $totals['cogs'][2]);
 $totals['net_profit_loss'] = array($totals['gross_profit'][0] - $rows[0]['Total Expenses'], $totals['gross_profit'][1] - $rows[1]['Total Expenses'], $totals['gross_profit'][2] - $rows[2]['Total Expenses']);
 $data = array(array("description" => "Cash Sales", "yr1" => number_format($rows[0]['Cash Sales'], 2), "yr2" => number_format($rows[1]['Cash Sales'], 2), "yr3" => number_format($rows[2]['Cash Sales'], 2)), array("description" => "Credit Sales", "yr1" => number_format($rows[0]['Credit Sales'], 2), "yr2" => number_format($rows[1]['Credit Sales'], 2), "yr3" => number_format($rows[2]['Credit Sales'], 2)), array("description" => "Total Sales", "yr1" => number_format($totals['sales'][0], 2), "yr2" => number_format($totals['sales'][1], 2), "yr3" => number_format($totals['sales'][2], 2)), array("description" => "", "yr1" => "", "yr2" => "", "yr3" => ""), array("description" => "Sales Return", "yr1" => number_format($rows[0]['Sales Return'], 2), "yr2" => number_format($rows[1]['Sales Return'], 2), "yr3" => number_format($rows[2]['Sales Return'], 2)), array("description" => "Sales Discount", "yr1" => number_format($rows[0]['Sales Discount'], 2), "yr2" => number_format($rows[1]['Sales Discount'], 2), "yr3" => number_format($rows[2]['Sales Discount'], 2)), array("description" => "Total", "yr1" => number_format($totals['sales_return_discount'][0], 2), "yr2" => number_format($totals['sales_return_discount'][1], 2), "yr3" => number_format($totals['sales_return_discount'][2], 2)), array("description" => "", "yr1" => "", "yr2" => "", "yr3" => ""), array("description" => "Net Sales", "yr1" => number_format($totals['net_sales'][0], 2), "yr2" => number_format($totals['net_sales'][1], 2), "yr3" => number_format($totals['net_sales'][2], 2), "hilite" => "Y"), array("description" => "", "yr1" => "", "yr2" => "", "yr3" => ""), array("description" => "Opening Inventory", "yr1" => number_format($rows[0]['Open Inventory'], 2), "yr2" => number_format($rows[1]['Open Inventory'], 2), "yr3" => number_format($rows[2]['Open Inventory'], 2)), array("description" => "", "yr1" => "", "yr2" => "", "yr3" => ""), array("description" => "Cash Purchase", "yr1" => number_format($rows[0]['Cash Purchase'], 2), "yr2" => number_format($rows[1]['Cash Purchase'], 2), "yr3" => number_format($rows[2]['Cash Purchase'], 2)), array("description" => "Credit Purchase", "yr1" => number_format($rows[0]['Credit Purchase'], 2), "yr2" => number_format($rows[1]['Credit Purchase'], 2), "yr3" => number_format($rows[2]['Credit Purchase'], 2)), array("description" => "Total Purchase", "yr1" => number_format($totals['purchase'][0], 2), "yr2" => number_format($totals['purchase'][1], 2), "yr3" => number_format($totals['purchase'][2], 2)), array("description" => "", "yr1" => "", "yr2" => "", "yr3" => ""), array("description" => "Purchase Return", "yr1" => number_format($rows[0]['Purchase Return'], 2), "yr2" => number_format($rows[1]['Purchase Return'], 2), "yr3" => number_format($rows[2]['Purchase Return'], 2)), array("description" => "Purchase Discount", "yr1" => number_format($rows[0]['Purchase Discount'], 2), "yr2" => number_format($rows[1]['Purchase Discount'], 2), "yr3" => number_format($rows[2]['Purchase Discount'], 2)), array("description" => "Total", "yr1" => number_format($totals['purchase_return_discount'][0], 2), "yr2" => number_format($totals['purchase_return_discount'][1], 2), "yr3" => number_format($totals['purchase_return_discount'][2], 2)), array("description" => "", "yr1" => "", "yr2" => "", "yr3" => ""), array("description" => "Net Purchase", "yr1" => number_format($totals['net_purchase'][0], 2), "yr2" => number_format($totals['net_purchase'][1], 2), "yr3" => number_format($totals['net_purchase'][2], 2), "hilite" => "Y"), array("description" => "", "yr1" => "", "yr2" => "", "yr3" => ""), array("description" => "Closing Inventory", "yr1" => number_format($rows[0]['Close Inventory'], 2), "yr2" => number_format($rows[1]['Close Inventory'], 2), "yr3" => number_format($rows[2]['Close Inventory'], 2)), array("description" => "Cost of Goods Sold", "yr1" => number_format($totals['cogs'][0], 2), "yr2" => number_format($totals['cogs'][1], 2), "yr3" => number_format($totals['cogs'][2], 2), "hilite" => "Y"), array("description" => "", "yr1" => "", "yr2" => "", "yr3" => ""), array("description" => "Gross Profit", "yr1" => number_format($totals['gross_profit'][0], 2), "yr2" => number_format($totals['gross_profit'][1], 2), "yr3" => number_format($totals['gross_profit'][2], 2)), array("description" => "Total Expenses", "yr1" => number_format($rows[0]['Total Expenses'], 2), "yr2" => number_format($rows[1]['Total Expenses'], 2), "yr3" => number_format($rows[2]['Total Expenses'], 2)), array("description" => "", "yr1" => "", "yr2" => "", "yr3" => ""));
 $tempTotal = array("description" => "Net Other Income", "yr1" => (double) 0, "yr2" => (double) 0, "yr3" => (double) 0, "hilite" => "Y");
 $max = max(count($rows[0]['Other Income']), count($rows[1]['Other Income']), count($rows[2]['Other Income']));
 for ($i = 0; $i < $max; $i++) {
     $temp = array("description" => "", "yr1" => (double) 0, "yr2" => (double) 0, "yr3" => (double) 0);
Ejemplo n.º 10
0
         }
         $this->SetFont('Arial', 'B', 8);
         $this->Cell($col1, 6, "Remarks", 0, 0, 'L', true);
         $this->SetFont('Arial', '', 8);
         $this->Cell($col2 + $col1 + $col2 + $xspace, 6, $voucher_remarks, 'B', 1, 'L');
         $this->Ln(2);
         parent::Header();
     }
     function Footer()
     {
     }
 }
 $pdf = new PDF();
 $pdf->AliasNbPages();
 $pdf->SetAuthor("*****@*****.**");
 $pdf->SetSubject("Voucher");
 $pdf->SetTitle("Voucher");
 $pdf->SetCreator("Imran Zahid");
 $prop = array('HeaderColor' => array(0, 0, 0), 'HeaderTextColor' => array(255, 255, 255), 'color1' => array(217, 217, 217), 'color2' => array(255, 255, 255), 'textcolor1' => array(0, 0, 0), 'textcolor2' => array(0, 0, 0), 'padding' => 1, 'formatNumber' => TRUE, 'formatNumberDecimal' => 0, 'printZero' => FALSE, 'font' => array('Arial', '', 8), 'thfont' => array('Arial', 'B', 8));
 foreach ($ndata as $data) {
     $prop['font'] = array('Arial', '', 8);
     $voucher_id = $data['seq'];
     $voucher_date = $data['voucher_date_fmt'];
     $voucher_type = $data['voucher_type'];
     $voucher_by = $data['voucher_by'];
     $voucher_remarks = $data['voucher_remarks'];
     $pdf->AddPage();
     $pdf->AddCol('account_name', '30%', 'Account Name', 'L');
     $pdf->AddCol('remarks', '40%', 'Remarks', 'L');
     $pdf->AddCol('debit_amount', '15%', 'Debit', 'R');
     $pdf->AddCol('credit_amount', '15%', 'Credit', 'R');
Ejemplo n.º 11
0
        //Position at 1.5 cm from bottom
        $this->SetY(-15);
        //Arial italic 8
        $this->SetFont('Arial', 'I', 8);
        //Page number
        $this->Cell(0, 10, 'Page ' . $this->PageNo() . '/{nb}', 0, 0, 'C');
        $this->SetX($this->lMargin);
        $this->Cell(0, 10, 'Please consider the environment before printing this report', 0, 0, 'L');
        $this->SetX($this->lMargin);
        $this->Cell(0, 10, 'Report generated by nexexcel.com', 0, 0, 'R');
    }
}
$pdf = new PDF();
$pdf->AliasNbPages();
$pdf->SetAuthor("*****@*****.**");
$pdf->SetSubject("Account Outstanding");
$pdf->SetTitle("Account Outstanding");
$pdf->SetCreator("Imran Zahid");
$prop = array('HeaderColor' => array(0, 0, 0), 'HeaderTextColor' => array(255, 255, 255), 'color1' => array(217, 217, 217), 'color2' => array(255, 255, 255), 'textcolor1' => array(0, 0, 0), 'textcolor2' => array(0, 0, 0), 'padding' => 2, 'font' => array('Arial', '', 8), 'thfont' => array('Arial', 'B', 10));
$cityName = "";
if (isset($_GET['region']) && strlen($_GET['region']) > 0) {
    $ndata = array();
    foreach ($outstanding as $ret) {
        if ($ret == NULL) {
            continue;
        }
        foreach ($ret['data'] as $row) {
            $city = $row['party_city'];
            if (!isset($ndata["{$city}"])) {
                $ndata["{$city}"] = array();
                $ndata["{$city}"]['data'] = array();
Ejemplo n.º 12
0
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
/**
 * letter_non_embedded certificate type
 *
 * @package    mod_certificate
 * @copyright  Mark Nelson <*****@*****.**>
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */
defined('MOODLE_INTERNAL') || die;
$pdf = new PDF($certificate->orientation, 'pt', 'A4', true, 'UTF-8', false);
$pdf->SetAuthor('Ananda Gestión, S.L.');
$pdf->SetTitle('Certificado de Acreditación');
$pdf->SetSubject('Curso Prevención de Riesgos Laborales');
$pdf->SetMargins(75, 20, 75, true);
$pdf->SetProtection(array('modify'));
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
$pdf->SetAutoPageBreak(false, 0);
$pdf->AddPage();
//página 1
// Define variables
// Landscape
if ($certificate->orientation == 'L') {
    $x = 28;
    $y = 125;
    $sealx = 590;
    $sealy = 425;
    $sigx = 130;
Ejemplo n.º 13
0
         }
     }
     function Footer()
     {
         //Position at 1.5 cm from bottom
         $this->SetY(-15);
         //Arial italic 8
         $this->SetFont('Arial', 'I', 8);
         //Page number
         $this->Cell(0, 10, 'Page ' . $this->PageNo() . '/{nb}', 0, 0, 'C');
     }
 }
 $pdf = new PDF('L');
 $pdf->AliasNbPages();
 $pdf->SetAuthor("*****@*****.**");
 $pdf->SetSubject("Route Wise Sales");
 $pdf->SetTitle("Route Wise Sales");
 $pdf->SetCreator("Imran Zahid");
 $title = "Route Wise Sales";
 foreach ($_GET['route'] as $route) {
     $data = array();
     $ndata = array();
     $result = $mysqli->query("SELECT CONCAT(code, ' - ', description) name FROM sys_codes WHERE sys_codes_ref_id = {$route}");
     $row = $result->fetch_assoc();
     $routeName = $row['name'];
     $data["{$route}"] = array();
     $data["{$route}"]['name'] = $routeName;
     $data["{$route}"]['weeks'] = array();
     $result = $mysqli->query("SELECT p.party_code, p.party_name FROM party p WHERE p.company_ref_id = {$_SESSION['company_id']} AND p.route_no = {$route} ORDER BY p.party_name");
     $parties = array();
     while ($row = $result->fetch_assoc()) {
Ejemplo n.º 14
0
     function printTitle()
     {
         global $_title;
         //Title
         $this->SetFont('Arial', 'B', 8);
         $this->Cell(0, 4, $_title, 0, 1, 'C');
         $this->Ln(1);
     }
     function Footer()
     {
     }
 }
 $pdf = new PDF('P', 'mm', 'MA5');
 $pdf->AliasNbPages();
 $pdf->SetAuthor("*****@*****.**");
 $pdf->SetSubject("Party Age");
 $pdf->SetTitle("Party Age");
 $pdf->SetCreator("Imran Zahid");
 $prop = array('HeaderColor' => array(0, 0, 0), 'HeaderTextColor' => array(255, 255, 255), 'color1' => array(217, 217, 217), 'color2' => array(255, 255, 255), 'textcolor1' => array(0, 0, 0), 'textcolor2' => array(0, 0, 0), 'padding' => 1, 'formatNumber' => true, 'font' => array('Arial', '', 8), 'thfont' => array('Arial', 'B', 8));
 if ($_GET['format'] == 'compact') {
     $pdf->AddPage();
     $pdf->AddCol('party', '28%', 'Party Name', 'L');
     $pdf->AddCol('payt', '8%', 'Pay Terms', 'R');
     $pdf->AddCol('days', '7%', 'Days', 'R');
     $pdf->AddCol("d0", '9.5%', '0-30', 'R');
     $pdf->AddCol("d30", '9.5%', '31-60', 'R');
     $pdf->AddCol("d60", '9.5%', '61-90', 'R');
     $pdf->AddCol("d90", '9.5%', '91-120', 'R');
     $pdf->AddCol("d120", '9.5%', '>120', 'R');
     $pdf->AddCol('total', '9.5%', 'Total', 'R');
     $pdf->Table($ndata, $prop);
Ejemplo n.º 15
0
         parent::Header();
     }
     function Footer()
     {
         //Position at 1.5 cm from bottom
         $this->SetY(-15);
         //Arial italic 8
         $this->SetFont('Arial', 'I', 8);
         //Page number
         $this->Cell(0, 10, 'Page ' . $this->PageNo() . '/{nb}', 0, 0, 'C');
     }
 }
 $pdf = new PDF('L');
 $pdf->AliasNbPages();
 $pdf->SetAuthor("*****@*****.**");
 $pdf->SetSubject("Monthly Expenses");
 $pdf->SetTitle("Monthly Expenses");
 $pdf->SetCreator("Imran Zahid");
 $prop = array('color1' => array(255, 255, 255), 'color2' => array(255, 255, 255), 'color3' => array(128, 128, 128), 'padding' => 1, 'font' => array('Arial', '', 10), 'thfont' => array('Arial', 'B', 10), 'width' => $pdf->w - $pdf->lMargin - $pdf->rMargin);
 $pdf->AddPage();
 $pdf->AddCol('sno', getWidth(3, $prop['width']), 'S#', 'C');
 $pdf->AddCol('account_name', getWidth(18, $prop['width']), 'Account Name', 'L');
 $pdf->AddCol('total', getWidth(7, $prop['width']), 'Total', 'R');
 $pdf->AddCol("jan", getWidth(6, $prop['width']), 'JAN', 'R');
 $pdf->AddCol("feb", getWidth(6, $prop['width']), 'FEB', 'R');
 $pdf->AddCol("mar", getWidth(6, $prop['width']), 'MAR', 'R');
 $pdf->AddCol("apr", getWidth(6, $prop['width']), 'APR', 'R');
 $pdf->AddCol("may", getWidth(6, $prop['width']), 'MAY', 'R');
 $pdf->AddCol("jun", getWidth(6, $prop['width']), 'JUN', 'R');
 $pdf->AddCol("jul", getWidth(6, $prop['width']), 'JUL', 'R');
 $pdf->AddCol("aug", getWidth(6, $prop['width']), 'AUG', 'R');
Ejemplo n.º 16
0
                //Position at 1.5 cm from bottom
                $this->SetY(-15);
                //Arial italic 8
                $this->SetFont('Arial', 'I', 8);
                //Page number
                $this->Cell(0, 10, 'Page ' . $this->PageNo() . '/{nb}', 0, 0, 'C');
                $this->SetX($this->lMargin);
                $this->Cell(0, 10, 'Please consider the environment before printing this report', 0, 0, 'L');
                $this->SetX($this->lMargin);
                $this->Cell(0, 10, 'Report generated by nexexcel.com', 0, 0, 'R');
            }
        }
        $pdf = new PDF('P');
        $pdf->AliasNbPages();
        $pdf->SetAuthor("*****@*****.**");
        $pdf->SetSubject("Missing Challan");
        $pdf->SetTitle("Missing Challan");
        $pdf->SetCreator("Imran Zahid");
        $prop = array('color1' => array(255, 255, 255), 'color2' => array(255, 255, 255), 'padding' => 2, 'formatNumber' => 2, 'font' => array('Arial', '', 8), 'thfont' => array('Arial', 'B', 10));
        $pdf->AddPage();
        foreach ($cities as $city) {
            $pdf->AddCol("bill{$city}", '10%', 'Bill No', 'L');
            $pdf->AddCol('remarks', '40%', 'Remarks', 'L');
        }
        $pdf->Table($ndata, $prop);
        $pdf->Output("missng_challan.pdf", "D");
    }
} else {
    ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
Ejemplo n.º 17
0
         //Position at 1.5 cm from bottom
         $this->SetY(-15);
         //Arial italic 8
         $this->SetFont('Arial', 'I', 8);
         //Page number
         //$this->Cell(0, 10, 'Page ' . $this->PageNo() . '/{nb}', 0, 0, 'C');
         $this->SetX($this->lMargin);
         $this->Cell(0, 10, 'Please consider the environment before printing this report', 0, 0, 'L');
         $this->SetX($this->lMargin);
         $this->Cell(0, 10, 'Report generated by nexexcel.com', 0, 0, 'R');
     }
 }
 $pdf = new PDF('L');
 $pdf->AliasNbPages();
 $pdf->SetAuthor("*****@*****.**");
 $pdf->SetSubject("Back Order");
 $pdf->SetTitle("Back Order");
 $pdf->SetCreator("Imran Zahid");
 $prop = array('HeaderColor' => array(0, 0, 0), 'HeaderTextColor' => array(255, 255, 255), 'color1' => array(217, 217, 217), 'color2' => array(255, 255, 255), 'textcolor1' => array(0, 0, 0), 'textcolor2' => array(0, 0, 0), 'padding' => 1, 'formatNumber' => TRUE, 'formatNumberDecimal' => 0, 'printZero' => FALSE, 'font' => array('Arial', '', 8), 'thfont' => array('Arial', 'B', 10));
 foreach ($data as $cat_name => $d) {
     $prop['font'] = array('Arial', '', 8);
     $title = "Category - {$cat_name}";
     $pdf->AddPage();
     $pdf->AddCol('cno', '4%', 'Comp\\nNo', 'L', 10);
     $pdf->AddCol('manufacturer_no', '9%', 'Part\\nNo', 'L', 10);
     $pdf->AddCol('description', '16%', 'Item\\nDescription', 'L', 10);
     $pdf->AddCol('karachi', '6%', 'Karachi\\nGodown', 'R', 10);
     $pdf->AddCol('lahore', '6%', 'Lahore\\nGodown', 'R', 10);
     $pdf->AddCol('stock_total', '6%', 'Total', 'R', 10);
     $pdf->AddCol('cost', '5%', 'Cost', 'R', 10);
     $pdf->AddCol('amt', '6%', 'Amount', 'R', 10);
Ejemplo n.º 18
0
         //Position at 1.5 cm from bottom
         $this->SetY(-15);
         //Arial italic 8
         $this->SetFont('Arial', 'I', 8);
         //Page number
         $this->Cell(0, 10, 'Page ' . $this->PageNo() . '/{nb}', 0, 0, 'C');
         $this->SetX($this->lMargin);
         $this->Cell(0, 10, 'Please consider the environment before printing this report', 0, 0, 'L');
         $this->SetX($this->lMargin);
         $this->Cell(0, 10, 'Report generated by nexexcel.com', 0, 0, 'R');
     }
 }
 $pdf = new PDF();
 $pdf->AliasNbPages();
 $pdf->SetAuthor("*****@*****.**");
 $pdf->SetSubject("Godown Stock");
 $pdf->SetTitle("Godown Stock");
 $pdf->SetCreator("Imran Zahid");
 $prop = array('HeaderColor' => array(0, 0, 0), 'HeaderTextColor' => array(255, 255, 255), 'color1' => array(217, 217, 217), 'color2' => array(255, 255, 255), 'textcolor1' => array(0, 0, 0), 'textcolor2' => array(0, 0, 0), 'padding' => 2, 'formatNumber' => TRUE, 'font' => array('Arial', '', 8), 'thfont' => array('Arial', 'B', 10));
 $grandTotal = array('Total' => (double) 0);
 foreach ($godowns as $gdn) {
     $grandTotal[$gdn] = (double) 0;
 }
 foreach ($data as $ndata) {
     $vendor = $ndata['vendor'];
     $pdf->AddPage();
     $col = 40 / count($godowns);
     $pdf->AddCol('sno', '3%', 'S#', 'C');
     $pdf->AddCol('category', '37%', 'Category', 'L');
     foreach ($godowns as $gdn) {
         $pdf->AddCol($gdn, $col . '%', $gdn, 'R');
Ejemplo n.º 19
0
         //Position at 1.5 cm from bottom
         $this->SetY(-15);
         //Arial italic 8
         $this->SetFont('Arial', 'I', 8);
         //Page number
         //$this->Cell(0, 10, 'Page ' . $this->PageNo() . '/{nb}', 0, 0, 'C');
         $this->SetX($this->lMargin);
         $this->Cell(0, 10, 'Please consider the environment before printing this report', 0, 0, 'L');
         $this->SetX($this->lMargin);
         $this->Cell(0, 10, 'Report generated by nexexcel.com', 0, 0, 'R');
     }
 }
 $pdf = new PDF();
 $pdf->AliasNbPages();
 $pdf->SetAuthor("*****@*****.**");
 $pdf->SetSubject("Cash Movement");
 $pdf->SetTitle("Cash Movement");
 $pdf->SetCreator("Imran Zahid");
 $prop = array('HeaderColor' => array(0, 0, 0), 'HeaderTextColor' => array(255, 255, 255), 'color1' => array(217, 217, 217), 'color2' => array(255, 255, 255), 'textcolor1' => array(0, 0, 0), 'textcolor2' => array(0, 0, 0), 'padding' => 1, 'formatNumber' => TRUE, 'font' => array('Arial', '', 8), 'thfont' => array('Arial', 'B', 10));
 $title = $_title;
 $pdf->AddPage();
 $col = 100 / $total;
 for ($i = 0; $i < $total; $i++) {
     $align = 'R';
     if ($i % 2 == 0) {
         $align = 'L';
     }
     $pdf->AddCol("{$i}", $col . '%', '', $align);
 }
 $pdf->Table($data, $prop, FALSE, FALSE);
 $pdf->Table($tdata, $prop, TRUE, FALSE);
Ejemplo n.º 20
0
     function Footer()
     {
         //Position at 1.5 cm from bottom
         $this->SetY(-15);
         //Arial italic 8
         $this->SetFont('Arial', 'I', 8);
         //Page number
         $this->Cell(0, 10, 'Page ' . $this->PageNo() . '/{nb}', 0, 0, 'C');
     }
 }
 $distributor = getValue("party_name", "party", "party_code = {$_GET['distributor']}");
 $d_net = (double) 0;
 $pdf = new PDF();
 $pdf->AliasNbPages();
 $pdf->SetAuthor("*****@*****.**");
 $pdf->SetSubject("Distributor Parties Outstanding Report");
 $pdf->SetTitle("Distributor Parties Outstanding Report");
 $pdf->SetCreator("Imran Zahid");
 $prop = array('color1' => array(255, 255, 255), 'color2' => array(255, 255, 255), 'padding' => 2, 'font' => array('Arial', '', 8), 'thfont' => array('Arial', 'B', 10));
 $sql = "" . "  SELECT coa.account_name,\n" . "         sum(vd.debit_amount) - sum(vd.credit_amount) outstanding\n" . "    FROM voucher_detail vd\n" . "         INNER JOIN chart_of_account coa ON coa.account_code = vd.account_code\n" . "         INNER JOIN sales_master sm ON sm.voucher_id = vd.voucher_id\n" . "   WHERE vd.account_code IN (SELECT account_code FROM party WHERE distributor_id = {$_GET['distributor']})\n";
 if (strlen($_GET['date_start']) > 0) {
     $sql .= "     AND TO_DAYS(sm.sale_date) >= TO_DAYS('" . my_sql_date($_GET['date_start']) . "')\n";
 }
 if (strlen($_GET['date_end']) > 0) {
     $sql .= "     AND TO_DAYS(sm.sale_date) <= TO_DAYS('" . my_sql_date($_GET['date_end']) . "')\n";
 }
 if (strlen($_GET['date_start']) + strlen($_GET['date_end']) < 1) {
     $d = date('Y') . "-01-01";
     $sql .= "     AND TO_DAYS(sm.sale_date) >= TO_DAYS('{$d}')\n";
 }
 $sql .= "GROUP BY coa.account_name\n";
Ejemplo n.º 21
0
        if (strlen($ret['party_address']) > 0) {
            $this->Cell(30, 6, "Party Address", 0, 0, 'L');
            $this->Cell(63, 6, $ret['party_address'], 'B', 1, 'L');
        }
        $this->Ln(5);
        //Ensure table header is output
        parent::Header();
    }
    function Footer()
    {
    }
}
$pdf = new PDF('P', 'mm', 'MA5');
$pdf->AliasNbPages();
$pdf->SetAuthor("*****@*****.**");
$pdf->SetSubject("Account Ledger");
$pdf->SetTitle("Account Ledger");
$pdf->SetCreator("Imran Zahid");
$prop = array('HeaderColor' => array(255, 255, 255), 'HeaderTextColor' => array(0, 0, 0), 'color1' => array(255, 255, 255), 'color2' => array(255, 255, 255), 'textcolor1' => array(0, 0, 0), 'textcolor2' => array(0, 0, 0), 'padding' => 2, 'font' => array('Arial', '', 8), 'thfont' => array('Arial', 'B', 10));
foreach ($ledger as $ret) {
    if ($ret == NULL) {
        continue;
    }
    $pdf->AddPage();
    $pdf->AddCol('invseq', '9%', 'Invoice #', 'L');
    $pdf->AddCol('voucher_date', '10%', 'Date', 'L');
    $pdf->AddCol('voucher_cheque', '9%', 'Cheque', 'L');
    //if ($ret['account_cate'] != '276') {
    $pdf->AddCol('voucher_remarks', '42%', 'Description', 'L');
    /*} else {
    		$pdf->AddCol('voucher_remarks', '43%', 'Description', 'L');
Ejemplo n.º 22
0
         //Position at 1.5 cm from bottom
         $this->SetY(-15);
         //Arial italic 8
         $this->SetFont('Arial', 'I', 8);
         //Page number
         //$this->Cell(0, 10, 'Page ' . $this->PageNo() . '/{nb}', 0, 0, 'C');
         $this->SetX($this->lMargin);
         $this->Cell(0, 10, 'Please consider the environment before printing this report', 0, 0, 'L');
         $this->SetX($this->lMargin);
         $this->Cell(0, 10, 'Report generated by nexexcel.com', 0, 0, 'R');
     }
 }
 $pdf = new PDF('L');
 $pdf->AliasNbPages();
 $pdf->SetAuthor("*****@*****.**");
 $pdf->SetSubject("MM Complete");
 $pdf->SetTitle("MM Complete");
 $pdf->SetCreator("Imran Zahid");
 $prop = array('HeaderColor' => array(0, 0, 0), 'HeaderTextColor' => array(255, 255, 255), 'color1' => array(217, 217, 217), 'color2' => array(255, 255, 255), 'textcolor1' => array(0, 0, 0), 'textcolor2' => array(0, 0, 0), 'padding' => 1, 'formatNumber' => TRUE, 'formatNumberDecimal' => 2, 'printZero' => FALSE, 'font' => array('Arial', '', 8), 'thfont' => array('Arial', 'B', 10));
 $col = 5.5;
 $pad = 0;
 if ($_GET['mm'] == 'quantity') {
     $pad = $col * 6;
 } else {
     if ($_GET['mm'] == 'rate') {
         $pad = $col * 3;
     }
 }
 $c = $col * 3 - $col * count($billNos);
 $dw = 20 + $c;
 foreach ($data as $cat_name => $d) {
Ejemplo n.º 23
0
         //Position at 1.5 cm from bottom
         $this->SetY(-15);
         //Arial italic 8
         $this->SetFont('Arial', 'I', 8);
         //Page number
         $this->Cell(0, 10, 'Page ' . $this->PageNo() . '/{nb}', 0, 0, 'C');
         $this->SetX($this->lMargin);
         $this->Cell(0, 10, 'Please consider the environment before printing this report', 0, 0, 'L');
         $this->SetX($this->lMargin);
         $this->Cell(0, 10, 'Report generated by nexexcel.com', 0, 0, 'R');
     }
 }
 $pdf = new PDF('P');
 $pdf->AliasNbPages();
 $pdf->SetAuthor("*****@*****.**");
 $pdf->SetSubject("Inventory Movement");
 $pdf->SetTitle("Inventory Movement");
 $pdf->SetCreator("Imran Zahid");
 $prop = array('HeaderColor' => array(0, 0, 0), 'HeaderTextColor' => array(255, 255, 255), 'color1' => array(217, 217, 217), 'color2' => array(255, 255, 255), 'textcolor1' => array(0, 0, 0), 'textcolor2' => array(0, 0, 0), 'padding' => 2, 'formatNumber' => TRUE, 'font' => array('Arial', '', 8), 'thfont' => array('Arial', 'B', 10));
 $title = $_title;
 $firstPage = true;
 $grandTotal = (double) 0;
 foreach ($data as $godown_name => $ndata) {
     $opening_balance = $ndata['opening_balance'];
     $rate = $ndata['rate'];
     if ($firstPage === true) {
         $pdf->AddPage();
         $firstPage = false;
     }
     $pdf->printTitle();
     $pdf->AddCol('sno', '5%', 'S#', 'C');
Ejemplo n.º 24
0
        }
    }
    function Footer()
    {
        //Position at 1.5 cm from bottom
        $this->SetY(-15);
        //Arial italic 8
        $this->SetFont('Arial', 'I', 8);
        //Page number
        $this->Cell(0, 10, 'Page ' . $this->PageNo() . '/{nb}', 0, 0, 'C');
    }
}
$pdf = new PDF('L');
$pdf->AliasNbPages();
$pdf->SetAuthor("*****@*****.**");
$pdf->SetSubject("Trial Balance");
$pdf->SetTitle("Trial Balance");
$pdf->SetCreator("Imran Zahid");
$title = "Trial Balance";
$pdf->AddPage();
$data = array();
$dr = (double) 0;
$cr = (double) 0;
$sql = "" . "SELECT @rownum:=@rownum+1 as rownum, x.* FROM (\n" . "  SELECT account_name,\n" . "         CASE WHEN account_type = 'DR' THEN\n" . "           SUM(debit_amount - credit_amount)\n" . "           ELSE 0\n" . "         END AS Debit,\n" . "         CASE WHEN account_type = 'CR' THEN\n" . "           SUM(credit_amount - debit_amount)\n" . "           ELSE 0\n" . "         END AS Credit\n" . "    FROM voucher_master vm,\n" . "         voucher_detail vd,\n" . "         chart_of_account coa\n" . "   WHERE vm.voucher_id = vd.voucher_id\n" . "     AND coa.account_code = vd.account_code\n" . "     AND vm.company_ref_id = {$_SESSION['company_id']}\n" . "GROUP BY account_name,account_type) x,\n" . "         (SELECT @rownum:=0) y\n" . "   WHERE x.debit <> 0 OR x.credit <> 0";
$result = $mysqli->query($sql);
while ($row = $result->fetch_assoc()) {
    $dr += $row['Debit'];
    $cr += $row['Credit'];
    $row['Debit'] = number_format($row['Debit'] * 1, 2);
    $row['Credit'] = number_format($row['Credit'] * 1, 2);
    $data[] = $row;
Ejemplo n.º 25
0
         //Position at 1.5 cm from bottom
         $this->SetY(-15);
         //Arial italic 8
         $this->SetFont('Arial', 'I', 8);
         //Page number
         //$this->Cell(0, 10, 'Page ' . $this->PageNo() . '/{nb}', 0, 0, 'C');
         $this->SetX($this->lMargin);
         $this->Cell(0, 10, 'Please consider the environment before printing this report', 0, 0, 'L');
         $this->SetX($this->lMargin);
         $this->Cell(0, 10, 'Report generated by nexexcel.com', 0, 0, 'R');
     }
 }
 $pdf = new PDF('P');
 $pdf->AliasNbPages();
 $pdf->SetAuthor("*****@*****.**");
 $pdf->SetSubject("MM Circular");
 $pdf->SetTitle("MM Circular");
 $pdf->SetCreator("Imran Zahid");
 $prop = array('HeaderColor' => array(0, 0, 0), 'HeaderTextColor' => array(255, 255, 255), 'color1' => array(217, 217, 217), 'color2' => array(255, 255, 255), 'textcolor1' => array(0, 0, 0), 'textcolor2' => array(0, 0, 0), 'padding' => 1, 'formatNumber' => TRUE, 'formatNumberDecimal' => 0, 'font' => array('Arial', '', 8), 'thfont' => array('Arial', 'B', 10));
 foreach ($data as $vid => $d) {
     $vehicle = $d['vehicle'];
     $pdf->AddPage();
     $pdf->AddCol('cno', '5%', '', 'L');
     if ($vendor == 'TIK') {
         $pdf->AddCol('description', '25%', '', 'L');
         $pdf->AddCol('fix_rate', '15%', '', 'R');
     } else {
         $pdf->AddCol('description', '40%', '', 'L');
     }
     $pdf->AddCol('model', '15%', '', 'L');
     $pdf->AddCol('oem', '15%', '', 'L');
Ejemplo n.º 26
0
         //Position at 1.5 cm from bottom
         $this->SetY(-15);
         //Arial italic 8
         $this->SetFont('Arial', 'I', 8);
         //Page number
         $this->Cell(0, 10, 'Page ' . $this->PageNo() . '/{nb}', 0, 0, 'C');
         $this->SetX($this->lMargin);
         $this->Cell(0, 10, 'Please consider the environment before printing this report', 0, 0, 'L');
         $this->SetX($this->lMargin);
         $this->Cell(0, 10, 'Report generated by nexexcel.com', 0, 0, 'R');
     }
 }
 $pdf = new PDF('L');
 $pdf->AliasNbPages();
 $pdf->SetAuthor("*****@*****.**");
 $pdf->SetSubject("Active Trial Balance");
 $pdf->SetTitle("Active Trial Balance");
 $pdf->SetCreator("Imran Zahid");
 $pdf->AddPage();
 $pdf->AddCol('rownum', '5%', 'S.No.', 'C');
 $pdf->AddCol('account_name', '45%', 'Account Name', 'L');
 $pdf->AddCol('debit', '25%', 'Debit', 'R');
 $pdf->AddCol('credit', '25%', 'Credit', 'R');
 $prop = array('HeaderColor' => array(0, 0, 0), 'HeaderTextColor' => array(255, 255, 255), 'color1' => array(217, 217, 217), 'color2' => array(255, 255, 255), 'textcolor1' => array(0, 0, 0), 'textcolor2' => array(0, 0, 0), 'padding' => 2, 'font' => array('Arial', '', 8), 'thfont' => array('Arial', 'B', 10));
 $pdf->Table($ndata, $prop, FALSE, TRUE);
 $width = $pdf->w - $pdf->lMargin - $pdf->rMargin;
 $pdf->SetFont('Arial', 'B', 8);
 $pdf->Cell(50 / 100 * $width, 5, 'Total', 1, 0, 'L', FALSE);
 $pdf->Cell(25 / 100 * $width, 5, number_format($dr, 2), 1, 0, 'R', FALSE);
 $pdf->Cell(25 / 100 * $width, 5, number_format($cr, 2), 1, 0, 'R', FALSE);
 $pdf->Ln();
Ejemplo n.º 27
0
$pdf = new PDF();
$pdf->AliasNbPages();
$pdf->SetMargins(4, 4, 4);
//~ ri esegue la stessa query della ricerca
$campi = $_SESSION['qpdf']['campi'];
$ord = $_SESSION['qpdf']['ord'];
$Risultati = GetRows("view_piano_conti", $campi, $ord, $db);
if (isset($_GET['tipo']) && $_GET['tipo'] != "") {
    $Tipo = $_GET['tipo'];
    switch ($_GET['tipo']) {
        case "movimenti":
            $Titolo = "Stampa Movimenti";
            $pdf->AddPage('L');
            // L = landscape
            $pdf->SetTitle($Titolo);
            $pdf->SetSubject($Titolo);
            break;
        case "mastrini":
            $Titolo = "Stampa Mastrini";
            $pdf->AddPage();
            $pdf->SetTitle($Titolo);
            $pdf->SetSubject($Titolo);
            break;
    }
}
/*
 * 22/08/2009 01:04:49 CEST Claudio Giordano
 *
 * AddPage([string orientation ,[ mixed format]])
 * Cell(float w [, float h [, string txt [, mixed border [, int ln [, string align [
 * , boolean fill [, mixed link]]]]]]])
Ejemplo n.º 28
0
         //Position at 1.5 cm from bottom
         $this->SetY(-15);
         //Arial italic 8
         $this->SetFont('Arial', 'I', 8);
         //Page number
         //$this->Cell(0, 10, 'Page ' . $this->PageNo() . '/{nb}', 0, 0, 'C');
         $this->SetX($this->lMargin);
         $this->Cell(0, 10, 'Please consider the environment before printing this report', 0, 0, 'L');
         $this->SetX($this->lMargin);
         $this->Cell(0, 10, 'Report generated by nexexcel.com', 0, 0, 'R');
     }
 }
 $pdf = new PDF('L');
 $pdf->AliasNbPages();
 $pdf->SetAuthor("*****@*****.**");
 $pdf->SetSubject("Payment Detail");
 $pdf->SetTitle("Payment Detail");
 $pdf->SetCreator("Imran Zahid");
 $prop = array('HeaderColor' => array(0, 0, 0), 'HeaderTextColor' => array(255, 255, 255), 'color1' => array(217, 217, 217), 'color2' => array(255, 255, 255), 'textcolor1' => array(0, 0, 0), 'textcolor2' => array(0, 0, 0), 'padding' => 1, 'formatNumber' => TRUE, 'font' => array('Arial', '', 8), 'thfont' => array('Arial', 'B', 10));
 $title = $_title;
 $pdf->AddPage();
 $pdf->AddCol('name', '20%', 'Party', 'L');
 $pdf->AddCol('term', '5%', 'Term', 'L');
 if (strlen($_GET['month']) > 1) {
     for ($i = $start; $i <= $end; $i++) {
         $pdf->AddCol("ob{$i}", '7.5%', 'Bal', 'R');
         $pdf->AddCol("pay{$i}", '7.5%', 'Payment', 'R');
     }
     $pdf->Table($data, $prop);
     $prop['font'] = array('Arial', 'B', 10);
     $data = array();
        //Position at 1.5 cm from bottom
        $this->SetY(-15);
        //Arial italic 8
        $this->SetFont('Arial', 'I', 7);
        //Page number
        $this->Line(10, 281, 200, 281);
        $this->Cell(0, 3, 'Emitido por: ' . $usuarioNome);
    }
}
//Instancia a classe gerador de pdf
$pdf = new PDF();
//Define os atributos de propriedade do arquivo PDF
$pdf->SetCreator('work | eventos');
$pdf->SetAuthor($usuarioNome . " - " . $empresaNome);
$pdf->SetTitle('Relação de Momentos de Repertório');
$pdf->SetSubject('Relatório gerado automaticamente pelo sistema');
$pdf->AliasNbPages();
$pdf->AddPage();
//Títulos das colunas
$pdf->SetFont('Arial', 'B', 10);
//Define a cor RGB do fundo da celula
$pdf->SetFillColor(178, 178, 178);
//Faz a célula ser preenchida. Isso é feito setando 1 após a expressao de alinhamento
$pdf->Cell(0, 6, 'Descrição do Momento de Repertório', 1, 0, 'L', 1);
$pdf->SetX(170);
$pdf->Cell(0, 6, 'Ativo');
//Monta as linhas com os dados da query
$pdf->SetFont('Arial', '', 10);
while ($dados = mysql_fetch_array($sql)) {
    switch ($dados[ativo]) {
        case 0:
Ejemplo n.º 30
0
             $this->Cell($col3, 4, $pdata[$i + 2], 0, 0, 'L');
             $this->Cell($col4, 4, $pdata[$i + 3], $border, 0, 'L');
             $this->Ln();
         }
         $this->Ln(1);
         //Ensure table header is output
         parent::Header();
     }
     function Footer()
     {
     }
 }
 $pdf = new PDF('P', 'mm', 'MA5');
 $pdf->AliasNbPages();
 $pdf->SetAuthor("*****@*****.**");
 $pdf->SetSubject("Warehouse Transfer");
 $pdf->SetTitle("Warehouse Transfer");
 $pdf->SetCreator("Imran Zahid");
 $prop = array('HeaderColor' => array(0, 0, 0), 'HeaderTextColor' => array(255, 255, 255), 'color1' => array(217, 217, 217), 'color2' => array(255, 255, 255), 'textcolor1' => array(0, 0, 0), 'textcolor2' => array(0, 0, 0), 'padding' => 2, 'font' => array('Arial', '', 8), 'thfont' => array('Arial', 'B', 8));
 foreach ($data as $id => $d) {
     $transDate = $d[0]['trans_date'];
     $billNo = $d[0]['billno'];
     $pdf->AddPage();
     $pdf->AddCol('sno', '5%', 'S#', 'C');
     $pdf->AddCol('cno', '10%', 'Cno', 'L');
     $pdf->AddCol('manufacturer_no', '15%', 'Part No', 'L');
     $pdf->AddCol('item', '35%', 'Description', 'L');
     $pdf->AddCol('cat_name', '20%', 'Model', 'L');
     $pdf->AddCol('qty', '10%', 'Quantity', 'R');
     $pdf->AddCol('unit', '5%', 'Unit', 'C');
     $pdf->Table($d, $prop);