Exemplo n.º 1
0
 function pdftransactionAction()
 {
     $fromdate = $this->_request->getParam('fdate');
     $dateconvertor = new App_Model_dateConvertor();
     $Date = $dateconvertor->mysqlformat($fromdate);
     $this->view->fdate = $Date;
     $asofDate = $dateconvertor->normalformat($fromdate);
     $this->view->asofdate = $asofDate;
     $incomeexpenditure = new Incomeexpenditure_Model_Incomeexpenditure();
     $this->view->income = $income = $incomeexpenditure->incomedetails($Date);
     $this->view->expenditure = $expenditure = $incomeexpenditure->expendituredetails($Date);
     $app = $this->view->baseUrl();
     $word = explode('/', $app);
     $projname = '';
     for ($i = 0; $i < count($word); $i++) {
         if ($i > 0 && $i < count($word) - 1) {
             $projname .= '/' . $word[$i];
         }
     }
     $pdf = new Zend_Pdf();
     $page = $pdf->newPage(Zend_Pdf_Page::SIZE_A4);
     $pdf->pages[] = $page;
     // Image
     $image_name = "/var/www/" . $projname . "/public/images/logo.jpg";
     $image = Zend_Pdf_Image::imageWithPath($image_name);
     //$page->drawImage($image, 25, 770, 570, 820);
     $page->drawImage($image, 20, 780, 120, 830);
     $page->setLineWidth(1)->drawLine(20, 20, 580, 20);
     //bottom horizontal
     $page->setLineWidth(1)->drawLine(20, 20, 20, 830);
     //left vertical
     $page->setLineWidth(1)->drawLine(580, 25, 580, 830);
     //right vertical
     $page->setLineWidth(1)->drawLine(20, 830, 580, 830);
     //top horizontal
     $x1 = 45;
     $x2 = 250;
     $x3 = 330;
     $x4 = 500;
     $my = 735;
     $y1 = 710;
     $y2 = 710;
     $totalincome = 0;
     $totalexpe = 0;
     //set the font
     $page->setFont(Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA), 8);
     $text = array($this->view->translate('Income and Expenditure'), $this->view->translate('Income'), $this->view->translate('Amount'), $this->view->translate('Expenditure'), $this->view->translate('Amount'), $this->view->translate('Grand total'));
     $criteria = $this->view->translate('As of') . " " . $asofDate;
     $currency = "* " . $this->view->translate('Amount in Rs');
     // // // file:///var/www/IDF/application/modules/incomeexpenditure/controllers/IndexController.php
     /*$page->drawText("Date : ".date('d/m/Y'),500, 800); //date('Y-m-d')
       $page->drawText("Date : ".date('d/m/Y'),500, 800);*/
     $page->drawText($text[0], 185, 780);
     $page->drawText($text[0], 185, 780);
     $page->drawText($criteria, 500, 780);
     //Search criteria
     $page->drawText($criteria, 500, 780);
     $page->drawText($currency, 500, 770);
     //Currency
     $page->drawText($currency, 500, 770);
     $page->drawText($text[1], $x1, $my);
     $page->drawText($text[2], $x2, $my);
     $page->drawText($text[3], $x3, $my);
     $page->drawText($text[4], $x4, $my);
     $page->drawLine(30, 750, 570, 750);
     $page->drawLine(30, 730, 570, 730);
     foreach ($income as $income) {
         $page->drawText($income['header'], $x1, $y1);
         $page->drawText($income['credit'], $x2, $y1);
         $totalincome += $income['credit'];
         $y1 = $y1 - 15;
     }
     foreach ($expenditure as $expe) {
         $page->drawText($expe['header'], $x3, $y2);
         $page->drawText($expe['credit'], $x4, $y2);
         $totalexpe += $expe['credit'];
         $y2 = $y2 - 15;
     }
     $page->drawLine(30, $y1, 570, $y1);
     $page->drawLine(30, $y1 - 20, 570, $y1 - 20);
     $page->drawText($text[5], $x1, $y1 - 15);
     $page->drawText(sprintf("%4.2f", $totalincome), $x2, $y1 - 15);
     $page->drawText($text[5], $x3, $y1 - 15);
     $page->drawText(sprintf("%4.2f", $totalexpe), $x4, $y1 - 15);
     // Virtual table
     $page->setLineWidth(1)->drawLine(30, $y1 - 20, 30, 750);
     //Table left vertical
     $page->setLineWidth(1)->drawLine(300, $y1 - 20, 300, 750);
     //Table center vertical
     $page->setLineWidth(1)->drawLine(570, $y1 - 20, 570, 750);
     //table rigth vertical
     $pdfData = $pdf->render();
     $account_number = $Date;
     // 		$pdf->save('/var/www/ourbank/reports/incomeexpenditure.pdf');
     //$path = '/var/www/ourbank/reports/incomeexpenditure.pdf';
     $pdf->save('/var/www/' . $projname . '/reports/' . $account_number . 'incomeexpenditure.pdf');
     $path = '/var/www/' . $projname . '/reports/' . $account_number . 'incomeexpenditure.pdf';
     chmod($path, 0777);
 }
Exemplo n.º 2
0
 public function holidayeditAction()
 {
     //calling the holiday form
     $holidayForm = new Holiday_Form_Holiday();
     $this->view->form = $holidayForm;
     //getting id
     $id = $this->_getParam('id');
     $this->view->id = $id;
     // calling holiday model
     $holiday = new Holiday_Model_Holiday();
     //listing office names
     $officename = $this->view->adm->viewRecord("ourbank_officehierarchy", "id", "DESC");
     foreach ($officename as $officename) {
         $holidayForm->office_id->addMultiOption($officename['id'], $officename['type']);
     }
     //displaying the values to edit
     $result = $holiday->getHoliday($id);
     $dateconvert = new App_Model_dateConvertor();
     foreach ($result as $holidaydetails) {
         $this->view->form->name->setValue($holidaydetails['name']);
         $this->view->form->office_id->setValue($holidaydetails['office_id']);
         $this->view->form->holiday_from->setValue($dateconvert->normalformat($holidaydetails['holiday_from']));
         $this->view->form->holiday_upto->setValue($dateconvert->normalformat($holidaydetails['holiday_upto']));
         $this->view->form->repayment_date->setValue($dateconvert->normalformat($holidaydetails['repayment_date']));
     }
     //update action
     if ($this->_request->isPost() && $this->_request->getPost('Update')) {
         if ($this->_request->isPost()) {
             $formData = $this->_request->getPost();
             if ($holidayForm->isValid($formData)) {
                 //update and edit
                 $formdata1 = array('name' => $formData['name'], 'office_id' => $formData['office_id'], 'holiday_from' => $dateconvert->mysqlformat($formData['holiday_from']), 'holiday_upto' => $dateconvert->mysqlformat($formData['holiday_upto']), 'repayment_date' => $dateconvert->mysqlformat($formData['repayment_date']), 'created_by' => $this->view->createdby);
                 $previousdata = $this->view->adm->editRecord("ourbank_holiday", $id);
                 $this->view->adm->updateLog("ourbank_holiday_log", $previousdata[0], $this->view->createdby);
                 //update
                 $this->view->adm->updateRecord("ourbank_holiday", $id, $formdata1);
                 $this->_redirect("/holiday");
             }
         }
     }
 }
Exemplo n.º 3
0
 function pdfgenerationAction()
 {
     $declarationform = new Declaration_Form_Account();
     $this->view->form = $declarationform;
     $this->view->membercode = $memcode = $this->_request->getParam('membercode');
     if (substr($memcode, 4, 1) == 2 or substr($memcode, 4, 1) == 3) {
         $this->view->groupresult = $result = $this->view->dbobj->getmembers($memcode);
         //
         if ($result) {
             $declarationform->populate($result[0]);
             $this->view->groupcode = $groupcode = $result[0]['groupcode'];
             $this->view->relation = $result = $this->view->dbobj->getrelations($groupcode);
         }
     } else {
         $this->view->result = $result = $this->view->dbobj->getmember($memcode);
         //
         if ($result) {
             $declarationform->populate($result[0]);
             $this->view->membercode1 = $familyid = $result[0]['family_id'];
             $this->view->relation = $result = $this->view->dbobj->getrelation($familyid);
             $dbobj = new Declaration_Model_Dec();
             $app = $this->view->baseUrl();
             $word = explode('/', $app);
             $projname = $word[1];
             $title1 = "declaration";
             $this->view->pageTitle = $title1;
             $pdf = new Zend_Pdf();
             $page = new Zend_Pdf_Page(Zend_Pdf_Page::SIZE_A4);
             $pdf->pages[] = $page;
             // Image
             $image_name = "/var/www/" . $projname . "/public/images/logo.jpg";
             $image = Zend_Pdf_Image::imageWithPath($image_name);
             //$page->drawImage($image, 25, 770, 570, 820);
             $page->drawImage($image, 30, 770, 130, 820);
             $page->setLineWidth(1)->drawLine(25, 25, 570, 25);
             //bottom horizontal
             $page->setLineWidth(1)->drawLine(25, 25, 25, 820);
             //left vertical
             $page->setLineWidth(1)->drawLine(570, 25, 570, 820);
             //right vertical
             $page->setLineWidth(1)->drawLine(570, 820, 25, 820);
             //top horizonta
             // define font resource
             $font = Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA);
             // Image
             $image_name = "/var/www/" . $projname . "/public/images/logo.jpg";
             $image = Zend_Pdf_Image::imageWithPath($image_name);
             $Declaration = new Declaration_Model_Dec();
             $memcode = $this->_request->getParam('membercode');
             $familyid = $this->_request->getParam('membercode1');
             $showgetmember = $Declaration->getmember($memcode);
             $showgetrelation = $Declaration->getrelation($familyid);
             $dateconvert = new App_Model_dateConvertor();
             foreach ($this->view->result as $result) {
             }
             // write text to page
             $page->setFont($font, 12)->drawText('DECLARATION', 240, 720);
             //                 $page->setLineWidth(1)->drawLine(0, 800, 820, 250);
             $page->setFont($font, 10)->drawText('(TO BE SUBMITTED BY THE BORROWER UNDER SBI JOINT LIABILITY GROUP)', 72, 700);
             $page->setFont($font, 9)->drawText('I,' . $result['name'] . ' (Name of the borrower), Son of ' . $this->view->relation[0]['fathername'] . '', 72, 670);
             $page->setFont($font, 9)->drawText('Aged around ' . $result['age'] . ' years,presently residing at ' . $result['street'] . ' do here by', 72, 655);
             $page->setFont($font, 9)->drawText('Solemnly affirm and sincerely state on Oath as follows:', 72, 625);
             $page->setFont($font, 9)->drawText('i)  I propose to avail a crop loan under SBI JLG scheme against hypothecation of the crop which the loan is to be sanctioned.', 72, 605);
             $page->setFont($font, 9)->drawText('ii) In this connection, I confirm that and declare that I am land less labourer / share cropper /tenant farmer /oral lessee', 72, 585);
             $page->setFont($font, 9)->drawText('( Stricke out which ever not applicable ).', 80, 575);
             $page->setFont($font, 9)->drawText('iii) I hereby declare and confirm furture that the properties mentioned in the schedule to the affidavit is the property which', 72, 555);
             $page->setFont($font, 9)->drawText('is the subject matter of lease (Oral /written) in my favour for year to year or for period of  ' . $dateconvert->normalformat($result['created_date']) . '', 80, 545);
             $page->setFont($font, 9)->drawText('year as mentioned in the document and the lease is presently in force and Sri ' . $result['landowner_name'] . ' is the lesser and ', 80, 535);
             $page->setFont($font, 9)->drawText('the owner of the property (a copy of the lease deed is enclosed).', 80, 525);
             $page->setFont($font, 9)->drawText('iv)I hereby declare and confirm further that I have not committed any default in paying the lease amount to the lesser and', 72, 505);
             $page->setFont($font, 9)->drawText('have not committed any breach of the terms and conditions of the lease.Moreover,I declare further  that there are no', 80, 495);
             $page->setFont($font, 9)->drawText('arrears of any lease amount.', 80, 485);
             $page->setFont($font, 9)->drawText('v) I have also not resorted to outside borrowing against security of the present crop which is the subject matter of the bank', 72, 465);
             $page->setFont($font, 9)->drawText('finance.The crop to be raised is free from the charge/encumbrances.', 80, 455);
             // add page to document
             $pdf->pages[] = $page;
             $pdfData = $pdf->render();
             $pdfData = $pdf->render();
             $pdf->save('/var/www/' . $projname . '/reports/declaration.pdf');
             $path = '/var/www/' . $projname . '/reports/declaration.pdf';
             chmod($path, 0777);
             //                 $this->_redirect('/declaration/index');
         }
     }
 }
Exemplo n.º 4
0
 public function pdftransactionAction()
 {
     $app = $this->view->baseUrl();
     $word = explode('/', $app);
     $projname = $word[1];
     $Date = $this->_request->getParam('field1');
     $branch = $this->_request->getParam('field2');
     $officer = $this->_request->getParam('field3');
     $resulttitle = $this->_request->getParam('result');
     $branchname = new Overduelist_Model_Overduelist();
     $dateconvertor = new App_Model_dateConvertor();
     $this->view->date1 = $dateconvertor->normalformat($Date);
     $this->view->field1 = $Date;
     $result = $branchname->getbanknames($branch);
     $this->view->val = 10;
     $bankname = $branchname->getbanknames($branch);
     foreach ($bankname as $bankname1) {
         $this->view->bankname = $bankname1['name'];
     }
     $officename = $branchname->getofficername($officer);
     foreach ($officename as $officename1) {
         $this->view->officername = $officename1['name'];
     }
     $pdf = new Zend_Pdf();
     $page = $pdf->newPage(Zend_Pdf_Page::SIZE_A4);
     $pdf->pages[] = $page;
     // Image
     $image_name = "/var/www/" . $projname . "/public/images/logo.jpg";
     $image = Zend_Pdf_Image::imageWithPath($image_name);
     //$page->drawImage($image, 25, 770, 570, 820);
     $page->drawImage($image, 30, 770, 130, 820);
     $page->setLineWidth(1)->drawLine(25, 25, 570, 25);
     //bottom horizontal
     $page->setLineWidth(1)->drawLine(25, 25, 25, 820);
     //left vertical
     $page->setLineWidth(1)->drawLine(570, 25, 570, 820);
     //right vertical
     $page->setLineWidth(1)->drawLine(570, 820, 25, 820);
     //top horizontal
     //set the font
     $page->setFont(Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA), 8);
     $text = array("Over due list", "Account Number", "Number of overdue", "Age(in days)", "OverDue Amount", "Total", "Outstanding Balance", "From Date:", "To Date:", "There is not Outstanding Balance in between two dates");
     $x1 = 80;
     $x2 = 250;
     $x3 = 220;
     $x4 = 320;
     $x6 = 450;
     $y1 = 700;
     $page->drawLine(50, 740, 550, 740);
     $page->drawLine(50, 720, 550, 720);
     $page->drawText($text[0], $x2, 770);
     $page->drawText($text[1], $x1, 725);
     $page->drawText($text[2], $x3, 725);
     $page->drawText($text[3], $x4, 725);
     if ($this->view->officername) {
         $page->drawText("Loan officer: " . $this->view->officername, $x6, 745);
     }
     if ($this->view->bankname) {
         $page->drawText("Bank: " . $this->view->bankname, $x6, 755);
     }
     $page->drawText("As of " . $this->view->date1, $x6, 765);
     $page->drawText("Amount in Rs", $x1, 745);
     $page->drawText($text[4], $x6, 725);
     $arrayLoan = $branchname->search($Date, $branch, $officer);
     $this->view->loanView = $arrayLoan;
     $outstanding_amount = "0";
     foreach ($arrayLoan as $loanduelist) {
         $outstanding_amount += $loanduelist['overdue'];
         $page->drawText($loanduelist['account_number'], $x1, $y1);
         $pos = $dateconvertor->position($loanduelist['totalinstallments'], $x4 - 20);
         $page->drawText($loanduelist['totalinstallments'], $pos + 2, $y1);
         $pos = $dateconvertor->position($dateconvertor->dateDiff($loanduelist['installment_date'], $Date), $x6 - 70);
         $page->drawText($dateconvertor->dateDiff($loanduelist['installment_date'], $Date), $pos + 2, $y1);
         $pos = $dateconvertor->position(sprintf("%4.2f", $loanduelist['overdue']), 540);
         $page->drawText(sprintf("%4.2f", $loanduelist['overdue']), $pos + 2, $y1);
         //$page->drawText($loanduelist['overdue'],$x6, $y1);
         $y1 -= 15;
     }
     $page->drawLine(50, $y1, 550, $y1);
     $y2 = $y1 - 10;
     $page->drawText($text[5], $x1, $y2);
     $pos = $dateconvertor->position(sprintf("%4.2f", $outstanding_amount), 540);
     $page->drawText(sprintf("%4.2f", $outstanding_amount), $pos + 2, $y1 - 10);
     //        $page->drawText($outstanding_amount, $x6, $y2);
     $y3 = $y2 - 5;
     $page->drawLine(50, $y3, 550, $y3);
     $pdfData = $pdf->render();
     $pdf->save('/var/www/' . $projname . '/reports/overduelist.pdf');
     $path = '/var/www/' . $projname . '/reports/overduelist.pdf';
     chmod($path, 0777);
     //$this->_redirect('/reports/loandue');
 }