public function indexAction() { $searchForm = new Receiptpayment_Form_Search(); $this->view->form = $searchForm; $this->view->title = "Receipts and payments"; if ($this->_request->isPost() && $this->_request->getPost('Search')) { $formData = $this->_request->getPost(); $dateconvertor = new App_Model_dateConvertor(); $fromDate = $dateconvertor->mysqlformat($this->_request->getParam('field1')); $toDate = $dateconvertor->mysqlformat($this->_request->getParam('field2')); $this->view->field1 = $this->_request->getParam('field1'); $this->view->field2 = $this->_request->getParam('field2'); $this->view->pageTitle = "Receipt and Payment"; $formData = $this->_request->getPost(); if ($searchForm->isValid($formData)) { $this->view->savings = 10; $transaction = new Receiptpayment_Model_Receiptpayment(); //Saving Account Credit and Debit $this->view->savingsCredit = $transaction->totalSavingsCredit($fromDate, $toDate); $this->view->savingsDebit = $transaction->totalSavingsDebit($fromDate, $toDate); //Opening and Closing Balace Calculation //Opening Balance Saving Account Credit and Debit $this->view->openingsavingsCredit = $transaction->openingBalance($fromDate, $toDate); $this->view->openingsavingsDebit = $transaction->closingBalance($fromDate, $toDate); $this->view->field1 = $this->_request->getParam('field1'); $this->view->field2 = $this->_request->getParam('field2'); } } }
public function searchRoles($post) { $convertdate = new App_Model_dateConvertor(); if ($post['granteddate']) { $searchdate = $convertdate->mysqlformat($post['granteddate']); } else { $searchdate = $post['granteddate']; } $select = $this->select()->setIntegrityCheck(false)->from('ourbank_grant')->where('name like "%" ? "%" ', $post['grantname'])->where('created_date like "%" ? "%" ', $searchdate); $result = $this->fetchAll($select); return $result->toArray(); // return searched grant details }
function indexAction() { $path = $this->view->baseUrl(); $this->view->form = $searchForm = new Ledgerbalancebook_Form_Search($path); $dateconvertor = new App_Model_dateConvertor(); $GeneralList = new Ledgerbalancebook_Model_Ledgerbookbalance(); $officename = $GeneralList->getHier(); foreach ($officename as $officename) { $searchForm->hierarchy->addMultiOption($officename['id'], $officename['type']); } if ($this->_request->isPost() && $this->_request->getPost('Search')) { $formData = $this->_request->getPost(); if ($searchForm->isValid($formData)) { $this->view->date1 = $this->_request->getParam('date1'); $fromDate = $dateconvertor->mysqlformat($this->view->date1); $hierarchy = $this->_request->getParam('hierarchy'); $branch = $this->_request->getParam('branch'); $this->view->ledegerList = $GeneralList->generalLedger($fromDate, $hierarchy, $branch); $this->view->ledegerListAssets = $GeneralList->generalLedgerAssets($fromDate, $hierarchy, $branch); } } }
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); }
public function editcropAction() { $this->view->title = $this->view->translate('Edit Contact'); $this->view->title = $this->view->translate('Add Crop'); //Base line data $familycommon = new Familycommonview_Model_familycommonview(); $this->view->memberid = $this->_getParam('id'); $this->view->membername = $familycommon->getfamily($this->_getParam('id')); //agriculture view $this->view->agriculture = $edit_agriculture = $familycommon->getagriculturedetails($this->_getParam('id')); $this->view->acretotal = $familycommon->getacretotal($this->_getParam('id')); $this->view->guntatotal = $familycommon->getguntatotal($this->_getParam('id')); $revvillageid = $this->view->membername[0]['rev_village_id']; if ($revvillageid) { $revvillagename = $this->view->adm->editRecord("ourbank_master_villagelist", $revvillageid); } //getting module id and submodule id $module = $familycommon->getmodule('Family'); foreach ($module as $module_id) { } $this->view->mod_id = $module_id['parent']; $this->view->sub_id = $module_id['module_id']; $this->view->insurance = $familycommon->getinsurance($this->_getParam('id')); //load crop details form with two arguments ... $form = new Crop_Form_Crop($this->_getParam('id'), $this->_getParam('subId')); $this->view->form = $form; $this->view->id = $this->_getParam('id'); $this->view->submitform = new Crop_Form_Submit(); //dynamically change the path name $addressmodel = new Address_Model_addressInformation(); $module_name = $addressmodel->getmodule($this->view->subId); foreach ($module_name as $module_view) { $path1 = $module_view['module_description'] . 'commonview'; } $path1 = $this->view->path1 = strtolower($path1); $crop = new Crop_Model_Crop(); $this->view->cropdetails = $crop->getCrop(); $this->view->seasondetails = $crop->getSeason(); $this->view->units = $crop->getUnits(); //update contact details if ($this->_request->getPost('submit')) { $formdata = $this->_request->getPost(); // echo '<pre>'; print_r($formdata); // if($formdata['enteredacre']>=$formdata['availableacre']){ // $this->view->errormsg="<p style='color:red;'>The Entered acres should be less than or equal to ".$formdata['availableacre']; // } else { $id = $this->_getParam('id'); $crop = new Crop_Model_Crop(); $editCrop = $crop->getCropdetails($id); for ($j = 0; $j < count($editCrop); $j++) { $this->view->adm->addRecord("ourbank_cropdetails_log", $editCrop[$j]); } $crop->deletecrop($id); $tenant = $this->_getParam('tenant'); $acer = $this->_getParam('acre'); $gunta = $this->_getParam('gunta'); $season = $this->_getParam('season'); $unit = $this->_getParam('unit'); $quantity = $this->_getParam('quantity'); $marketed = $this->_getParam('marketed'); $price = $this->_getParam('price'); $realised = $this->_getParam('realised'); $soldDate = $this->_getParam('date'); $dateconvert = new App_Model_dateConvertor(); $i = 0; foreach ($this->_getParam('crop_id') as $val) { if ($soldDate[$i]) { if ($soldDate[$i] == "00/00/0000" or $soldDate[$i] == NULL) { $date = date("y/m/d H:i:s"); } else { $date = $dateconvert->mysqlformat($soldDate[$i]); } } else { echo $date = date("y/m/d H:i:s"); } $crop = array('family_id' => $id, 'crop_id' => $val, 'land_id' => $tenant[$i], 'season_id' => $season[$i], 'acre' => $acer[$i], 'gunta' => $gunta[$i], 'unit' => $unit[$i], 'quantity' => $quantity[$i], 'marketed' => $marketed[$i], 'price' => $price[$i], 'realised' => $realised[$i], 'sold_date' => $date); $i++; $this->view->adm->addRecord("ourbank_cropdetails", $crop); } $this->_redirect('/familycommonview/index/commonview/id/' . $id); // } } else { //set the contact details in the contact form... $sub_id = $this->_getParam('subId'); $id = $this->_getParam('id'); $individualcommon = new Familycommonview_Model_familycommonview(); $this->view->editCrop = $individualcommon->getcrop($this->_getParam('id')); } }
public function pdftransactionAction() { //rupees right alignment function position($amt, $posValue) { $len = strlen($amt); $pos = $posValue - 35 - $len * 4; return $pos; } $fromDate = $this->_request->getParam('date'); $branchid = $this->_request->getParam('office'); $this->view->field1 = $fromDate; $this->view->branchid = $branchid; // $fromDate = $this->_request->getParam('field1'); // $this->view->field1 = $fromDate; //date format instance $dateconvertor = new App_Model_dateConvertor(); $cfromDate = $dateconvertor->mysqlformat($fromDate); $pdf = new Zend_Pdf(); $page = $pdf->newPage(Zend_Pdf_Page::SIZE_A4); $pdf->pages[] = $page; //Path $app = $this->view->baseUrl(); $word = explode('/', $app); $projname = $word[1]; // Image $image_name = "/var/www/" . $projname . "/public/images/logo.jpg"; $image = Zend_Pdf_Image::imageWithPath($image_name); $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 $page->setFont(Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA), 9); $page->drawText("Cash Scroll", 270, 780); $page->drawText("Cash Scroll", 270, 780); //set the font $page->setFont(Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA), 8); $y1 = 745; $page->drawText("Credit", 50, $y1); $page->drawText("Debit", 310, $y1); $y1 = 745; $y2 = 740; $page->drawText("As of From " . $fromDate, 465, $y1); //For Top Header $text = array("", "SL No.", "Particulars", "Amount", "Total", "Particulars", "Opening Cash", "Closing Cash"); $this->view->savings = 10; $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], 240, 780); $page->drawText($text[0], 240, 780); $x1 = 60; $x2 = 120; $x3 = 310; $x4 = 315; $x5 = 390; $x6 = 570; $page->drawLine(50, 740, 550, 740); $page->drawLine(50, 720, 550, 720); $page->drawText($text[1], $x1, 725); $page->drawText($text[2], $x2, 725); $page->drawText($text[3], 250, 725); $page->drawText($text[1], $x4, 725); $page->drawText($text[5], $x5, 725); $page->drawText($text[3], 510, 725); $y1 = 710; $y2 = 710; $transaction = new Cashscroll_Model_Cashscroll(); $this->view->savings = 10; $this->view->savingsCredit = $transaction->totalSavingsCredit($cfromDate, $branchid); $this->view->savingsDebit = $transaction->totalSavingsDebit($cfromDate, $branchid); //Credit and Debit $savingsCredit = $transaction->totalSavingsCredit($cfromDate, $branchid); $savingsDebit = $transaction->totalSavingsDebit($cfromDate, $branchid); // Opening Cash $openingBalance = 0; $osc = $transaction->openingBalance($cfromDate, $branchid); foreach ($osc as $osc1) { $openingBalance = $osc1->openingBalance; } $this->view->openingBalance = $openingBalance; $amountCredit = "0"; $amountDebit = "0"; $i = 0; $j = 0; foreach ($savingsCredit as $savingsCredit) { $i++; $page->drawText($i, $x1, $y1); $page->drawText($savingsCredit->account_number, $x2, $y1); // $page->drawText($savingsCredit->amount_to_bank,$x3, $y1); $pos = position(sprintf("%4.2f", $savingsCredit->amount_to_bank), $x3); $page->drawText(sprintf("%4.2f", $savingsCredit->amount_to_bank), $pos + 2, $y1); $amountCredit = $amountCredit + $savingsCredit->amount_to_bank; $y1 = $y1 - 15; } foreach ($savingsDebit as $savingsDebit) { $j++; $page->drawText($j, $x4, $y2); $page->drawText($savingsDebit->account_number, $x5, $y2); // $page->drawText($savingsDebit->amount_from_bank,$x6, $y2); $pos = position(sprintf("%4.2f", $savingsDebit->amount_from_bank), $x6); $page->drawText(sprintf("%4.2f", $savingsDebit->amount_from_bank), $pos + 2, $y2); $amountDebit = $amountDebit + $savingsDebit->amount_from_bank; $y2 = $y2 - 15; } $page->drawLine(50, $y1, 550, $y1); //opening balnce $page->drawText($text[6], $x1, $y1 - 10); // $page->drawText(sprintf("%4.2f", $openingBalance), $x3, $y1 -10); $pos = position(sprintf("%4.2f", $openingBalance), $x3); $page->drawText(sprintf("%4.2f", $openingBalance), $pos + 2, $y1 - 10); //closing Balance $page->drawText($text[7], $x4, $y1 - 10); // $page->drawText(sprintf("%4.2f", ( $sum = ($amountCredit + $openingBalance) - $amountDebit)), $x6, $y1 -10); $pos = position(sprintf("%4.2f", $sum = $amountCredit + $openingBalance - $amountDebit), $x6); $page->drawText(sprintf("%4.2f", $sum = $amountCredit + $openingBalance - $amountDebit), $pos + 2, $y1 - 10); $page->drawLine(50, $y1 = $y1 - 20, 550, $y1); $page->drawLine(50, $y1 - 20, 550, $y1 - 20); $page->drawText($text[4], $x1, $y1 - 15); $page->drawText($text[4], $x1, $y1 - 15); $pos = position(sprintf("%4.2f", $amountCredit + $openingBalance), $x3); $page->drawText(sprintf("%4.2f", $amountCredit + $openingBalance), $pos + 2, $y1 - 15); // $page->drawText(sprintf("%4.2f", ($amountCredit + $openingBalance)), $x3, $y1 -15); // $page->drawText(sprintf("%4.2f", ($amountCredit + $openingBalance)), $x3, $y1 -15); $page->drawText($text[4], $x4, $y1 - 15); $page->drawText($text[4], $x4, $y1 - 15); // $page->drawText(sprintf("%4.2f", $amountDebit + $sum), $x6, $y1 -15); // $page->drawText(sprintf("%4.2f", $amountDebit + $sum), $x6, $y1 -15); $pos = position(sprintf("%4.2f", $amountDebit + $sum), $x6); $page->drawText(sprintf("%4.2f", $amountDebit + $sum), $pos + 2, $y1 - 15); // Virtual table $page->setLineWidth(1)->drawLine(50, $y1 - 20, 50, 740); //Table left vertical $page->setLineWidth(1)->drawLine(300, $y1 - 20, 300, 740); //Table center vertical $page->setLineWidth(1)->drawLine(550, $y1 - 20, 550, 740); //table rigth vertical //$page->drawText("ಭಾವನಾ. ಕೆ. ಎಸ್ ",$x6 + 30, $y1 -15, 'UTF-8'); $pdfData = $pdf->render(); $pdf->save('/var/www/' . $projname . '/reports/cashscroll.pdf'); $path = '/var/www/' . $projname . '/reports/cashscroll.pdf'; chmod($path, 0777); }
function pdftransactionAction() { $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]; } } $Dispdate = $this->_request->getParam('field1'); $this->view->field1 = $Dispdate; $dateconvertor = new App_Model_dateConvertor(); $Date = $dateconvertor->mysqlformat($Dispdate); $title1 = $this->view->translate('Loan Supplementary'); $this->view->pageTitle = $title1; $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 //set the font $page->setFont(Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA), 8); $text = array($this->view->translate('Loan Supplementary'), $this->view->translate('Sl'), $this->view->translate('Particulars'), $this->view->translate('A/C No.'), $this->view->translate('Cash'), $this->view->translate('Transfer'), $this->view->translate('Total')); $criteria = $this->view->translate('As of') . $Dispdate; $currency = "* " . $this->view->translate('Amount in Rs'); $this->view->savings = 10; // $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], 200, 780); $page->drawText($text[0], 200, 780); $page->drawText($criteria, 500, 780); //Search criteria $page->drawText($criteria, 500, 780); $page->drawText($currency, 500, 770); //Currency $page->drawText($currency, 500, 770); $my = 735; $x1 = 33; $x2 = 45; $x3 = 135; $x4 = 170; $x5 = 210; $x6 = 260; $x7 = 300; $x8 = 312; $x9 = 402; $x10 = 437; $x11 = 477; $x12 = 530; $page->drawLine(30, 750, 570, 750); $page->drawLine(30, 730, 570, 730); $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->drawText($text[5], $x5, $my); $page->drawText($text[6], $x6, $my); $page->drawText($text[1], $x7, $my); $page->drawText($text[2], $x8, $my); $page->drawText($text[3], $x9, $my); $page->drawText($text[4], $x10, $my); $page->drawText($text[5], $x11, $my); $page->drawText($text[6], $x12, $my); $y1 = 710; $y2 = 710; $this->view->loan = 10; $transaction = new Loansupplementary_Model_Loansupplementary(); // //Loan Account Credit and Debit $loanCredit = $transaction->totalloanCredit($Date); $this->view->loanCredit = $loanCredit; $loanDebit = $transaction->totalloanDebit($Date); $this->view->loanDedit = $loanDebit; $totalCredit = "0"; $totalTransferCredit = "0"; $totalDebit = "0"; $totalTransferDebit = "0"; $i = 0; $columntotal1 = 0; $columntotal = 0; $columntotald = 0; $columntotald1 = 0; foreach ($loanCredit as $loansCredit) { $i++; $columntotal = 0; if ($loansCredit->paymenttype_id == 1 or $loansCredit->paymenttype_id == 5) { $page->drawText($i, $x1, $y1); $productname = "To " . $loansCredit->account_number; $page->drawText($productname, $x2, $y1); $page->drawText($loansCredit->account_id, $x3, $y1); if ($loansCredit->paymenttype_id == 1) { $page->drawText($loansCredit->amount_to_bank, $x4, $y1); $totalCredit = $totalCredit + $loansCredit->amount_to_bank; $columntotal += $loansCredit->amount_to_bank; } elseif ($loansCredit->paymenttype_id == 5) { $page->drawText($loansCredit->amount_to_bank, $x5, $y1); $totalTransferCredit = $totalTransferCredit + $loansCredit->amount_to_bank; $columntotal += $loansCredit->amount_to_bank; } $page->drawText(sprintf("%4.2f", $columntotal), $x6, $y1); $page->drawText(sprintf("%4.2f", $columntotal), $x6, $y1); $columntotal1 += $columntotal; $y1 = $y1 - 15; } } $i = 0; foreach ($loanDebit as $loansDebit) { $i++; $columntotald = 0; if ($loansDebit->paymenttype_id == 1 or $loansDebit->paymenttype_id == 5) { $page->drawText($i, $x7, $y2); $productnamed = "By " . $loansDebit->account_number; $page->drawText($productnamed, $x8, $y2); $page->drawText($loansDebit->account_id, $x9, $y2); if ($loansDebit->paymenttype_id == 1) { $page->drawText($loansDebit->amount_from_bank, $x10, $y2); $totalDebit = $totalCredit + $loansDebit->amount_from_bank; $columntotald += $loansDebit->amount_from_bank; } elseif ($loansDebit->paymenttype_id == 5) { $page->drawText($loansDebit->amount_from_bank, $x11, $y2); $totalTransferDebit = $totalTransferDebit + $loansDebit->amount_from_bank; $columntotald += $loansDebit->amount_from_bank; } $page->drawText(sprintf("%4.2f", $columntotald), $x12, $y2); $page->drawText(sprintf("%4.2f", $columntotald), $x12, $y2); $columntotald1 += $columntotald; $y2 = $y2 - 15; } } $page->drawLine(30, $y1, 570, $y1); $page->drawLine(30, $y1 - 20, 570, $y1 - 20); $page->drawText($text[6], $x1, $y1 - 15); $page->drawText($text[6], $x1, $y1 - 15); if ($totalCredit != "0") { $page->drawText(sprintf("%4.2f", $totalCredit), $x4, $y1 - 15); $page->drawText(sprintf("%4.2f", $totalCredit), $x4, $y1 - 15); } else { $page->drawText("----", $x4, $y1 - 15); $page->drawText("----", $x4, $y1 - 15); } if ($totalTransferCredit != "0") { $page->drawText(sprintf("%4.2f", $totalTransferCredit), $x5, $y1 - 15); $page->drawText(sprintf("%4.2f", $totalTransferCredit), $x5, $y1 - 15); } else { $page->drawText("----", $x5, $y1 - 15); $page->drawText("----", $x5, $y1 - 15); } if ($columntotal1 != "0") { $page->drawText(sprintf("%4.2f", $columntotal1), $x6, $y1 - 15); $page->drawText(sprintf("%4.2f", $columntotal1), $x6, $y1 - 15); } else { $page->drawText("----", $x6, $y1 - 15); $page->drawText("----", $x6, $y1 - 15); } if ($totalDebit != "0") { $page->drawText(sprintf("%4.2f", $totalDebit), $x10, $y1 - 15); $page->drawText(sprintf("%4.2f", $totalDebit), $x10, $y1 - 15); } else { $page->drawText("----", $x10, $y1 - 15); $page->drawText("----", $x10, $y1 - 15); } if ($totalTransferDebit != "0") { $page->drawText(sprintf("%4.2f", $totalTransferDebit), $x11, $y1 - 15); $page->drawText(sprintf("%4.2f", $totalTransferDebit), $x11, $y1 - 15); } else { $page->drawText("----", $x11, $y1 - 15); $page->drawText("----", $x11, $y1 - 15); } if ($columntotald1 != "0") { $page->drawText(sprintf("%4.2f", $columntotald1), $x12, $y1 - 15); $page->drawText(sprintf("%4.2f", $columntotald1), $x12, $y1 - 15); } else { $page->drawText("----", $x12, $y1 - 15); $page->drawText("----", $x12, $y1 - 15); } // Virtual table $page->setLineWidth(1)->drawLine(30, $y1 - 20, 30, 750); //Table left vertical $page->setLineWidth(1)->drawLine(298, $y1 - 20, 298, 750); //Table center vertical $page->setLineWidth(1)->drawLine(570, $y1 - 20, 570, 750); //table rigth vertical $pdfData = $pdf->render(); $pdf->save('/var/www/' . $projname . '/reports/loansupplementary.pdf'); $path = '/var/www/' . $projname . '/reports/loansupplementary.pdf'; chmod($path, 0777); }
public function mainSearch($input, $fieldname, $table, $condition) { $dateconvert = new App_Model_dateConvertor(); function checkingDate($value) { return preg_match('`^\\d{1,2}/\\d{1,2}/\\d{4}$`', $value); } $keyvalue = array_filter($input); $searchcounter = count($keyvalue); if ($searchcounter > 0) { for ($i = 1; $i <= count($fieldname); $i++) { $inputA = $fieldname['input' . $i]; $inputB = $input['s' . $i]; $checkdate = checkingDate($inputB); if ($checkdate == 1) { $inputB = $dateconvert->mysqlformat($inputB); $where[] = "a." . $inputA . " like '%" . $inputB . "%'"; } else { $where[] = "a." . $inputA . " like '%" . $inputB . "%'"; } } $condwhere = implode(" AND ", $where); if ($condition) { $wherecond = 'AND (' . $condition . ')'; } else { $wherecond = ''; } $this->db = Zend_Db_Table::getDefaultAdapter(); $sql = "SELECT * FROM " . $table . " as a WHERE " . $condwhere . " {$wherecond} ORDER BY a.DateofEntry Desc"; $result = $this->db->fetchAll($sql); // echo $sql; return $result; } else { if ($condition) { $select = $this->select()->setIntegrityCheck(false)->join(array('a' => $table), array('id'))->order(array('a.id DESC'))->where($condition); $result = $this->fetchAll($select); } else { $select = $this->select()->setIntegrityCheck(false)->join(array('a' => $table), array('id'))->order(array('a.id DESC')); $result = $this->fetchAll($select); } return $result->toArray(); } }
public function editassetAction() { $this->view->title = $this->view->translate('Edit Livingasset details'); //Base line data $familycommon = new Familycommonview_Model_familycommonview(); $this->view->memberid = $this->_getParam('id'); $this->view->membername = $familycommon->getfamily($this->_getParam('id')); // // // // $revvillageid = $this->view->membername[0]['rev_village_id']; // // // // if ($revvillageid) { // // // // $revvillagename = $this->view->adm->editRecord("ourbank_master_villagelist",$revvillageid); // // // // $this->view->revvillagename=$revvillagename[0]['name']; // // // // } //getting module id and submodule id $module = $familycommon->getmodule('Family'); foreach ($module as $module_id) { } $this->view->mod_id = $module_id['parent']; $this->view->sub_id = $module_id['module_id']; $this->view->insurance = $familycommon->getinsurance($this->_getParam('id')); //edit assets $this->view->memberid = $member_id = $this->_getParam('id'); //load form for living assets $this->view->submoduleid = $this->_getParam('subId'); //dynamically change the path name //get all type of living assets $this->view->liveasset_details = $this->view->adm->viewRecord("ourbank_master_liveassets", "id", "DESC"); //update contact details if ($this->_request->isPost() && $this->_request->getPost('Submit')) { $id = $this->_getParam('id'); $submoduleid = $this->_getParam('subid'); $asset_db = new Livingassets_Model_livingassets(); $editAsset = $asset_db->getAssetdetails($id); for ($j = 0; $j < count($editAsset); $j++) { $this->view->adm->addRecord("ourbank_liveassetdetails_log", $editAsset[$j]); } $asset_db->deleteasset($id); $number = $this->_getParam('number'); $value = $this->_getParam('value'); $date = $this->_getParam('date'); $dateconvert = new App_Model_dateConvertor(); $i = 0; foreach ($this->_getParam('assettype') as $val) { if ($date[$i]) { if ($date[$i] == "00/00/0000" or $date[$i] == NULL) { $dates = date("y/m/d H:i:s"); } else { $dates = $dateconvert->mysqlformat($date[$i]); } } else { $dates = date("y/m/d H:i:s"); } if ($value[$i]) { $values = $value[$i]; } else { $values = 0; } $assettype = array('submodule_id' => $submoduleid, 'family_id' => $id, 'liveasset_id' => $val, 'number' => $number[$i], 'date_of_value' => $dates, 'value' => $values); $i++; $this->view->adm->addRecord("ourbank_liveassetdetails", $assettype); } $this->_redirect('/familycommonview/index/commonview/id/' . $id); } else { //set the contact details in the contact form... $sub_id = $this->_getParam('subId'); $id = $this->_getParam('id'); $individualcommon = new Familycommonview_Model_familycommonview(); $this->view->editAsset = $individualcommon->getlivingassetsdetails($id); //$form->populate($editContact[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"); } } } }