예제 #1
0
 /**
  * export the content in a pdf file
  * @param array $items
  */
 public function bulk_export($items)
 {
     $isp = Isp::getActiveISP();
     $pdf = new Shineisp_Commons_PdfList();
     $translator = Shineisp_Registry::getInstance()->Zend_Translate;
     // Get the records from the order table
     $creditnotes = self::get_items($items, "creditnote_id, i.number as invoicenum, DATE_FORMAT(o.order_date, '" . Settings::getMySQLDateFormat('dateformat') . "') as orderdate, c.company as company, CONCAT(c.firstname, ' ', c.lastname) as fullname, cn.total as total, cn.total_vat as vat, cn.total as grandtotal, s.status as status", 'cn.creationdate');
     // Create the PDF header
     $grid['headers']['title'] = $translator->translate('Credit Note List');
     $grid['headers']['subtitle'] = $translator->translate('List Credit Notes');
     $grid['footer']['text'] = $isp['company'] . " - " . $isp['website'];
     if (!empty($creditnotes[0])) {
         // Create the columns of the grid
         $grid['columns'][] = array("value" => $translator->translate('Credit Note'), 'size' => 50);
     }
     $grid['columns'][] = array("value" => $translator->translate('Invoice'), 'size' => 50);
     $grid['columns'][] = array("value" => $translator->translate('Date'), 'size' => 100);
     $grid['columns'][] = array("value" => $translator->translate('Company'));
     $grid['columns'][] = array("value" => $translator->translate('Fullname'));
     $grid['columns'][] = array("value" => $translator->translate('Total'), 'size' => 50);
     $grid['columns'][] = array("value" => $translator->translate('VAT'), 'size' => 50);
     $grid['columns'][] = array("value" => $translator->translate('Grand Total'), 'size' => 50);
     $grid['columns'][] = array("value" => $translator->translate('Status'), 'size' => 100);
     // Getting the records values and delete the first column the customer_id field.
     foreach ($creditnotes as $item) {
         $values = array_values($item);
         $grid['records'][] = $values;
     }
     // Create the PDF
     die($pdf->create($grid));
     return false;
 }
예제 #2
0
 /**
  * export the content in a pdf file
  * @param array $items
  */
 public function bulk_export($items)
 {
     $isp = Isp::getActiveISP();
     $pdf = new Shineisp_Commons_PdfList();
     $translator = Shineisp_Registry::getInstance()->Zend_Translate;
     // Get the records from the customer table
     $customers = self::get_customers($items);
     // Create the PDF header
     $grid['headers']['title'] = $translator->translate('Customer Listing');
     $grid['headers']['subtitle'] = $translator->translate('Selected customer list');
     $grid['footer']['text'] = $isp['company'] . " - " . $isp['website'];
     if (!empty($customers[0])) {
         // Create the columns of the grid
         $grid['columns'][] = array("value" => $translator->translate('Company'));
     }
     $grid['columns'][] = array("value" => $translator->translate('Firstname'), 'size' => 100);
     $grid['columns'][] = array("value" => $translator->translate('Lastname'), 'size' => 80);
     $grid['columns'][] = array("value" => $translator->translate('Email'));
     $grid['columns'][] = array("value" => $translator->translate('City'), 'size' => 100);
     $grid['columns'][] = array("value" => $translator->translate('Area'), 'size' => 80);
     $grid['columns'][] = array("value" => $translator->translate('Status'), 'size' => 80);
     // Getting the records values and delete the first column the customer_id field.
     foreach ($customers as $customer) {
         $values = array_values($customer);
         array_shift($values);
         $grid['records'][] = $values;
     }
     // Create the PDF
     die($pdf->create($grid));
     return false;
 }
예제 #3
0
파일: Reviews.php 프로젝트: kokkez/shineisp
 /**
  * export the content in a pdf file
  * @param array $items
  */
 public function bulk_export($items)
 {
     $isp = Isp::getActiveISP();
     $pdf = new Shineisp_Commons_PdfList();
     $translator = Shineisp_Registry::getInstance()->Zend_Translate;
     // Get the records from the reviews table
     $reviews = self::get_reviews($items, "review_id, nick, subject, review");
     // Create the PDF header
     $grid['headers']['title'] = $translator->translate('Product Reviews List');
     $grid['headers']['subtitle'] = $translator->translate('List of the product reviews.');
     $grid['footer']['text'] = $isp['company'] . " - " . $isp['website'];
     if (!empty($reviews[0])) {
         // Create the columns of the grid
         $grid['columns'][] = array("value" => $translator->translate('Nick'), 'size' => 100);
     }
     $grid['columns'][] = array("value" => $translator->translate('Subject'), 'size' => 100);
     $grid['columns'][] = array("value" => $translator->translate('review'));
     // Getting the records values and delete the first column the customer_id field.
     foreach ($reviews as $item) {
         $values = array_values($item);
         array_shift($values);
         $grid['records'][] = $values;
     }
     // Create the PDF
     die($pdf->create($grid));
     return false;
 }
예제 #4
0
파일: Domains.php 프로젝트: kokkez/shineisp
 /**
  * export the content in a pdf file
  * @param array $items
  */
 public function bulk_export($items)
 {
     $isp = Isp::getActiveISP();
     $pdf = new Shineisp_Commons_PdfList();
     $translator = Shineisp_Registry::getInstance()->Zend_Translate;
     // Get the records from the domains table
     $domains = self::get_domains($items, "d.domain_id, \r\n\t\t\t\t\t\t\t\t\t\t\t  CONCAT(d.domain, '.', d.tld) as domain, \r\n\t\t\t\t\t\t\t\t\t\t\t  DATE_FORMAT(d.creation_date, '" . Settings::getMySQLDateFormat('dateformat') . "') as creation_date, \r\n\t\t\t\t\t\t\t\t\t\t\t  DATE_FORMAT(d.expiring_date, '" . Settings::getMySQLDateFormat('dateformat') . "') as expiring_date, , \r\n\t\t\t\t\t\t\t\t\t\t\t  DATEDIFF(expiring_date, CURRENT_DATE) as days,\r\n                       \t\t\t\t\t\t  IF(d.autorenew = 1, 'YES', 'NO') as renew,\r\n\t\t\t\t\t\t\t\t\t\t\t  s.status as status", "d.expiring_date, d.domain");
     // Create the PDF header
     $grid['headers']['title'] = $translator->translate('Domain Listing');
     $grid['headers']['subtitle'] = $translator->_("List of the domains since %s and sorted by the expiring date and domain name", date('d/m/Y H:i:s'));
     $grid['footer']['text'] = $isp['company'] . " - " . $isp['website'];
     if (!empty($domains[0])) {
         // Create the columns of the grid
         $grid['columns'][] = array("value" => $translator->translate('Domain'));
     }
     $grid['columns'][] = array("value" => $translator->translate('Creation Date'), 'size' => 80);
     $grid['columns'][] = array("value" => $translator->translate('Expiry Date'), 'size' => 80);
     $grid['columns'][] = array("value" => $translator->translate('Days'), 'size' => 80);
     $grid['columns'][] = array("value" => $translator->translate('Automatic Renewal'), 'size' => 80);
     $grid['columns'][] = array("value" => $translator->translate('Status'), 'size' => 80);
     // Getting the records values and delete the first column the customer_id field.
     foreach ($domains as $domain) {
         $values = array_values($domain);
         array_shift($values);
         $grid['records'][] = $values;
     }
     // Create the PDF
     die($pdf->create($grid));
     return false;
 }
예제 #5
0
 /**
  * export the content in a pdf file
  * @param array $items
  */
 public function bulk_pdf_export($items)
 {
     $isp = Isp::getActiveISP();
     $pdf = new Shineisp_Commons_PdfList();
     $translator = Shineisp_Registry::getInstance()->Zend_Translate;
     // Get the records from the order table
     $orders = self::get_invoices($items, "invoice_id, number as num, order_id as orderid, DATE_FORMAT(invoice_date, '" . Settings::getMySQLDateFormat('dateformat') . "') as invoicedate, \n\t\tc.company as company, CONCAT(c.firstname, ' ', c.lastname) as fullname, o.total as total, o.vat as vat, o.grandtotal as grandtotal,", 'number, invoice_date');
     // Create the PDF header
     $grid['headers']['title'] = $translator->translate('Invoices Listing');
     $grid['headers']['subtitle'] = $translator->translate('Here you can see the invoices listing');
     $grid['footer']['text'] = $isp['company'] . " - " . $isp['website'];
     if (!empty($orders[0])) {
         $total = 0;
     }
     $vat = 0;
     $grandtotal = 0;
     // Create the columns of the grid
     $grid['columns'][] = array("value" => $translator->translate('Invoice'), 'size' => 50);
     $grid['columns'][] = array("value" => $translator->translate('Order'), 'size' => 50);
     $grid['columns'][] = array("value" => $translator->translate('Date'), 'size' => 100);
     $grid['columns'][] = array("value" => $translator->translate('Company'));
     $grid['columns'][] = array("value" => $translator->translate('Fullname'));
     $grid['columns'][] = array("value" => $translator->translate('Total'), 'size' => 50);
     $grid['columns'][] = array("value" => $translator->translate('VAT'), 'size' => 50);
     $grid['columns'][] = array("value" => $translator->translate('Grand Total'), 'size' => 50);
     // Getting the records values and delete the first column the customer_id field.
     foreach ($orders as $item) {
         $values = array_values($item);
         array_shift($values);
         $grid['records'][] = $values;
         $total += is_numeric($values[5]) ? $values[5] : 0;
         $vat += is_numeric($values[6]) ? $values[6] : 0;
         $grandtotal += is_numeric($values[7]) ? $values[7] : 0;
     }
     $grid['records'][] = array('', '', '', '', $translator->translate('Totals'), $total, $vat, $grandtotal);
     // Create the PDF
     die($pdf->create($grid));
     return false;
 }
예제 #6
0
 /**
  * export the content in a pdf file
  * @param array $items
  */
 public function bulk_export($items)
 {
     $isp = Isp::getActiveISP();
     $pdf = new Shineisp_Commons_PdfList();
     $translator = Shineisp_Registry::getInstance()->Zend_Translate;
     // Get the records from the payment table
     $orders = self::get_payments($items, "p.payment_id,\r\n\t\t\t\t\t\t\t\t\t\t\t  o.order_id as orderid,\r\n\t\t\t\t\t\t\t\t\t\t\t  o.order_date as orderdate,\r\n\t\t\t\t\t\t\t\t\t\t\t  i.number as invoice,\r\n                                              DATE_FORMAT(p.paymentdate, '" . Settings::getMySQLDateFormat('dateformat') . "') as paymentdate,\r\n                                              CONCAT(c.firstname, ' ', c.lastname, ' ', c.company) as customer,\r\n                                              CONCAT(r.firstname, ' ', r.lastname, ' ', r.company) as reseller,\r\n                                              p.reference as reference,\r\n                                              p.confirmed as confirmed,\r\n                                              p.income as income,\r\n                                              p.outcome as outcome,\r\n\t\t\t\t\t\t\t\t\t\t\t  o.grandtotal as grandtotal\r\n                                              ", 'o.order_date');
     // Create the PDF header
     $grid['headers']['title'] = $translator->translate('Payment Transaction Listing');
     $grid['headers']['subtitle'] = $translator->translate('List of the payment transactions');
     $grid['footer']['text'] = $isp['company'] . " - " . $isp['website'];
     if (!empty($orders[0])) {
         // Create the columns of the grid
         $grid['columns'][] = array("value" => $translator->translate('Payment'), 'size' => 50);
         $grid['columns'][] = array("value" => $translator->translate('Order'), 'size' => 50);
         $grid['columns'][] = array("value" => $translator->translate('Order Date'), 'size' => 50);
         $grid['columns'][] = array("value" => $translator->translate('Invoice'), 'size' => 100);
         $grid['columns'][] = array("value" => $translator->translate('Transaction Date'), 'size' => 100);
         $grid['columns'][] = array("value" => $translator->translate('Company'));
         $grid['columns'][] = array("value" => $translator->translate('Reseller'));
         $grid['columns'][] = array("value" => $translator->translate('Reference'));
         $grid['columns'][] = array("value" => $translator->translate('Confirmed'));
         $grid['columns'][] = array("value" => $translator->translate('Income'), 'size' => 50);
         $grid['columns'][] = array("value" => $translator->translate('Expense'), 'size' => 50);
         $grid['columns'][] = array("value" => $translator->translate('Grand Total'), 'size' => 50);
         // Getting the records values and delete the first column the customer_id field.
         foreach ($orders as $item) {
             $values = array_values($item);
             $grid['records'][] = $values;
         }
         // Create the PDF
         die($pdf->create($grid));
     }
     return false;
 }
예제 #7
0
파일: Tickets.php 프로젝트: kokkez/shineisp
 /**
  * export the content in a pdf file
  * @param array $items
  */
 public function bulkexport($items)
 {
     $isp = Isp::getActiveISP();
     $pdf = new Shineisp_Commons_PdfList();
     $translator = Shineisp_Registry::getInstance()->Zend_Translate;
     $fields = " t.ticket_id,\n\t\t\t\t\tt.subject as subject, \n\t\t\t\t\ttc.category as category, \n\t\t\t\t\ts.status as status, \n\t\t\t\t\tDATE_FORMAT(t.date_open, '" . Settings::getMySQLDateFormat('dateformat') . " %H:%i') as creation_date, \n\t\t\t\t\tDATE_FORMAT(t.date_updated, '" . Settings::getMySQLDateFormat('dateformat') . " %H:%i') as updated_at, \n\t\t\t\t\tCONCAT(c.firstname, ' ', c.lastname) as fullname,\n\t\t\t\t\tc.company as company";
     // Get the records from the customer table
     $tickets = self::get_tickets($items, $fields);
     // Create the PDF header
     $grid['headers']['title'] = $translator->translate('Tickets List');
     $grid['headers']['subtitle'] = $translator->translate('List of the selected tickets');
     $grid['footer']['text'] = $isp['company'] . " - " . $isp['website'];
     if (!empty($tickets[0])) {
         // Create the columns of the grid
         $grid['columns'][] = array("value" => $translator->translate('Subject'), 'size' => 100);
     }
     $grid['columns'][] = array("value" => $translator->translate('Category'), 'size' => 80);
     $grid['columns'][] = array("value" => $translator->translate('Status'));
     $grid['columns'][] = array("value" => $translator->translate('Creation Date'), 'size' => 100);
     $grid['columns'][] = array("value" => $translator->translate('Upload Date'), 'size' => 80);
     $grid['columns'][] = array("value" => $translator->translate('Fullname'), 'size' => 80);
     $grid['columns'][] = array("value" => $translator->translate('Company'), 'size' => 80);
     // Getting the records values and delete the first column the customer_id field.
     foreach ($tickets as $ticket) {
         $values = array_values($ticket);
         array_shift($values);
         $grid['records'][] = $values;
     }
     // Create the PDF
     die($pdf->create($grid));
     return false;
 }
예제 #8
0
 /**
  * export the content in a pdf file
  * @param array $items
  */
 public function bulk_pdf_export($items)
 {
     $isp = Isp::getActiveISP();
     $pdf = new Shineisp_Commons_PdfList();
     $translator = Shineisp_Registry::getInstance()->Zend_Translate;
     // Get the records from the purchase invoices table
     $invoices = self::get_invoices($items, "purchase_id, \r\n\t\t\t\t\t\t\t\t\t\t\t\tDATE_FORMAT(creationdate, '" . Settings::getMySQLDateFormat('dateformat') . "') as creationdate, \r\n\t\t\t\t\t\t\t\t\t\t\t\tnumber as number, \r\n\t\t\t\t\t\t\t\t\t\t\t\tcompany as company, \r\n\t\t\t\t\t\t\t\t\t\t\t\tpm.method as method,\r\n\t\t\t\t\t\t\t\t\t\t\t\ttotal_net as net, \r\n\t\t\t\t\t\t\t\t\t\t\t\ttotal_vat as vat, \r\n\t\t\t\t\t\t\t\t\t\t\t\ttotal as total,\r\n\t\t\t\t\t\t\t\t\t\t\t\ts.status as status", 'number, creationdate');
     // Create the PDF header
     $grid['headers']['title'] = $translator->translate('Purchases Invoices List');
     $grid['headers']['subtitle'] = $translator->translate('List of the the purchases invoices');
     $grid['footer']['text'] = $isp['company'] . " - " . $isp['website'];
     if (!empty($invoices[0])) {
         $total = 0;
     }
     $vat = 0;
     $grandtotal = 0;
     // Create the columns of the grid
     $grid['columns'][] = array("value" => $translator->translate('Date'), 'size' => 100);
     $grid['columns'][] = array("value" => $translator->translate('Number'), 'size' => 50);
     $grid['columns'][] = array("value" => $translator->translate('Company'));
     $grid['columns'][] = array("value" => $translator->translate('Method'), 'size' => 50);
     $grid['columns'][] = array("value" => $translator->translate('Total Net'), 'size' => 50);
     $grid['columns'][] = array("value" => $translator->translate('VAT'), 'size' => 50);
     $grid['columns'][] = array("value" => $translator->translate('Total'), 'size' => 50);
     $grid['columns'][] = array("value" => $translator->translate('Status'), 'size' => 50);
     // Getting the records values and delete the first column the customer_id field.
     foreach ($invoices as $item) {
         $values = array_values($item);
         array_shift($values);
         $grid['records'][] = $values;
         $total += is_numeric($values[4]) ? $values[4] : 0;
         $vat += is_numeric($values[5]) ? $values[5] : 0;
         $grandtotal += is_numeric($values[6]) ? $values[6] : 0;
     }
     $grid['records'][] = array('', '', '', '', $total, $vat, $grandtotal, '');
     // Create the PDF
     die($pdf->create($grid));
     return false;
 }