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/  Your IP : 172.18.0.1   [ Reverse IP ]
Web Server : Apache/2.4.38 (Debian)
System : Linux a1822d00732a 4.15.0-39-generic #42-Ubuntu SMP Tue Oct 23 15:48:01 UTC 2018 x86_64
User : www-data ( 33)
PHP Version : 7.1.33
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Domains : 0 Domains
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /var/www/html/app/frontModule/presenters/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /var/www/html/app/frontModule/presenters/DownloadPresenter.php
<?php

namespace App\frontModule\Presenters;


use Nette\Application\BadRequestException;
use Nette\Application\Responses\FileResponse;
use PHPExcel;
use PHPExcel_IOFactory;
use PHPExcel_Style_Alignment;
use PHPExcel_Style_Fill;
use PHPExcel_Worksheet_Drawing;
use Promoteus\Component\ProductImageModernizer;
use Promoteus\ProductRepository;

class DownloadPresenter extends BasePresenter
{

    public function actionGetPraskladLogs()
    {
        try {
            (new FileResponse(APP_DIR . '/components/prasklad/log/prasklad.log', 'prasklad.log', true))
                ->send($this->getHttpRequest(), $this->getHttpResponse());
        } catch (BadRequestException $e) {
            $this->flashMessage($e->getMessage());
            $this->redirect(400, "admin:Homepage:default", 'danger');
        }
        die;
    }

    /**
     * @throws \PHPExcel_Exception
     * @throws \PHPExcel_Reader_Exception
     * @throws \PHPExcel_Writer_Exception
     */
    public function actionProductsStore()
    {
        $l = self::getLanguage();
        /** @var ProductRepository $productRepository */
        $productRepository = $this->context->getService('productRepository');
        /** @var ProductImageModernizer $productImageModernizer */
        $productImageModernizer = $this->context->getService('productImageModernizer');

        $user_group = ($this->user->identity->data["client"]['user_group_id'] ?? 1);

        $products = $productRepository->getStockProductsExport($user_group, null);

        /*
        foreach ($products as $product){
            echo "<pre>";
            var_dump($product);
            echo "</pre>";

        }

        die();
        /**
         * PHPExcel
         *
         * Copyright (C) 2006 - 2013 PHPExcel
         *
         * This library is free software; you can redistribute it and/or
         * modify it under the terms of the GNU Lesser General Public
         * License as published by the Free Software Foundation; either
         * version 2.1 of the License, or (at your option) any later version.
         *
         * This library is distributed in the hope that it will be useful,
         * but WITHOUT ANY WARRANTY; without even the implied warranty of
         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
         * Lesser General Public License for more details.
         *
         * You should have received a copy of the GNU Lesser General Public
         * License along with this library; if not, write to the Free Software
         * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
         *
         * @category   PHPExcel
         * @package    PHPExcel
         * @copyright  Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
         * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt	LGPL
         * @version    1.7.9, 2013-06-02
         */

        /** Error reporting */
        error_reporting(E_ALL);
        ini_set('display_errors', TRUE);
        ini_set('display_startup_errors', TRUE);

        define('EOL', (PHP_SAPI == 'cli') ? PHP_EOL : '<br />');

        date_default_timezone_set('Europe/London');

// Create new PHPExcel object
        $objPHPExcel = new PHPExcel();

// Set document properties
        $objPHPExcel->getProperties()->setCreator("PROMOTEus")
            ->setLastModifiedBy("PROMOTEus")
            ->setTitle($l['cenik-skladovych-produktu'])
            ->setSubject($l['cenik-skladovych-produktu'])
            ->setDescription($l['cenik-skladovych-produktu'])
            ->setKeywords("USB, powerbank, selfie stick")
            ->setCategory($l['ex-cenik']);

        $objPHPExcel->getDefaultStyle()
            ->getAlignment()
            ->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER)
            ->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
        $objPHPExcel->getActiveSheet()->getStyle("A1:M1")->getFont()->setBold(true);

        $objPHPExcel->setActiveSheetIndex(0)
            ->setCellValue('A1', $l['ex-obrazek'])
            ->setCellValue('B1', $l['ex-kod'])
            ->setCellValue('C1', $l['ex-popis'])
            ->setCellValue('D1', $l['ex-kategorie'])
            ->setCellValue('E1', $l['ex-barva'])
            ->setCellValue('F1', $l['ex-kapacita'])
            ->setCellValue('G1', $l['ex-povrch'])
            ->setCellValue('H1', $l['ex-cena'])
            ->setCellValue('I1', $l['ex-poplatky'])
            ->setCellValue('J1', $l['ex-skladem'])
            ->setCellValue('K1', $l['ex-na-ceste'])
            ->setCellValue('L1', $l['ex-datum'])
            ->setCellValue('M1', $l['ex-baleni']);

        $objPHPExcel->getActiveSheet()->getColumnDimension('A')->setWidth(20);
        $objPHPExcel->getActiveSheet()->getColumnDimension('B')->setWidth(10);
        $objPHPExcel->getActiveSheet()->getColumnDimension('C')->setWidth(30);
        $objPHPExcel->getActiveSheet()->getColumnDimension('D')->setWidth(20);
        $objPHPExcel->getActiveSheet()->getColumnDimension('E')->setWidth(15);
        $objPHPExcel->getActiveSheet()->getColumnDimension('F')->setWidth(15);
        $objPHPExcel->getActiveSheet()->getColumnDimension('G')->setWidth(22);
        $objPHPExcel->getActiveSheet()->getColumnDimension('H')->setWidth(12);
        $objPHPExcel->getActiveSheet()->getColumnDimension('I')->setWidth(12);
        $objPHPExcel->getActiveSheet()->getColumnDimension('J')->setWidth(15);
        $objPHPExcel->getActiveSheet()->getColumnDimension('K')->setWidth(12);
        $objPHPExcel->getActiveSheet()->getColumnDimension('L')->setWidth(20);
        $objPHPExcel->getActiveSheet()->getColumnDimension('M')->setWidth(30);

        $i = 2;
        foreach ($products['list'] as $product) {
            $imgMin = $productImageModernizer->getProductImages($product['code'], 1)[0]['min'];
            if ($product['image'] != "" && file_exists(WWW_DIR . $imgMin)) {
                $objDrawing = new PHPExcel_Worksheet_Drawing();
                $objDrawing->setName('image_' . $product['code']);
                $objDrawing->setDescription('image_' . $product['code']);
                $objDrawing->setPath(WWW_DIR . $imgMin);       // filesystem reference for the image file
                $objDrawing->setWidthAndHeight(120, 120);
                $objDrawing->setResizeProportional(false);
                $objDrawing->setCoordinates('A' . $i);    // pins the top-left corner of the image to cell D24
                $objDrawing->setOffsetX(5);                // pins the top left corner of the image at an offset of 10 points horizontally to the right of the top-left corner of the cell
                $objDrawing->setOffsetY(5);                // pins the top left corner of the image at an offset of 10 points horizontally to the right of the top-left corner of the cell
                $objDrawing->setWorksheet($objPHPExcel->getActiveSheet());
            }

            $objPHPExcel->setActiveSheetIndex(0)
                ->setCellValue('B' . $i, $product['code'])
                ->setCellValue('C' . $i, $product['name'])
                ->setCellValue('D' . $i, $product['cat'])
                ->setCellValue('E' . $i, $product['col'])
                ->setCellValue('F' . $i, $product['capa'])
                ->setCellValue('G' . $i, $product['surface'])
                ->setCellValue('H' . $i, $product['price'])
                ->setCellValue('J' . $i, $product['stock'])
                ->setCellValue('K' . $i, $product['ordered'])
                ->setCellValue('L' . $i, $product['date_available'])
                ->setCellValue('M' . $i, $product['pack']);

            if (self::getLanguageData() === 'cze') {
                $objPHPExcel->setActiveSheetIndex(0)->setCellValue('I' . $i, $product['fee']);
            } else {
                $objPHPExcel->setActiveSheetIndex(0)->setCellValue('I' . $i, "-");
            }

            $objPHPExcel->getActiveSheet()->getRowDimension($i)->setRowHeight(100);
            $objPHPExcel->getActiveSheet()->getStyle('C' . $i)->getAlignment()->setWrapText(true);
            $objPHPExcel->getActiveSheet()->getStyle('D' . $i)->getAlignment()->setWrapText(true);
            $color_code = str_replace("#", "", $product['hex']);

//break up the color in its RGB components
            $r = hexdec(substr($color_code, 0, 2));
            $g = hexdec(substr($color_code, 2, 2));
            $b = hexdec(substr($color_code, 4, 2));

//do simple weighted avarage
//
//(This might be overly simplistic as different colors are perceived
// differently. That is a green of 128 might be brighter than a red of 128.
// But as long as it's just about picking a white or black text color...)
            if ($r + $g + $b > 382) {
                $text_color = "000000";
            } else {
                $text_color = "ffffff";
            }


            $objPHPExcel->getActiveSheet()->getStyle('E' . $i)->applyFromArray(
                array('fill' => array('type' => PHPExcel_Style_Fill::FILL_SOLID,
                    'color' => array('rgb' => $color_code))));
            $objPHPExcel->getActiveSheet()->getStyle('E' . $i)->getFont()->getColor()->applyFromArray(array("rgb" => $text_color));
            $i++;
        }
//$objPHPExcel->getActiveSheet()->setAutoFilter('D1:G1');
// Redirect output to a client’s web browser (Excel2007)
        $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
        header('Content-type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
        header('Content-Disposition: attachment; filename="' . $l['promoteus_cenik_skladovych_polozek'] . '.xlsx"');
        $objWriter->save('php://output');
        exit();
    }
}

Anon7 - 2022
AnonSec Team