AnonSec Shell
Server IP : 54.36.91.62  /  Your IP : 216.73.217.112
Web Server : Apache
System : Linux webm013.cluster127.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64
User : coopiak ( 151928)
PHP Version : 8.3.23
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/coopiak/amisdesseniors-fr/nice/administrator/components/com_rsform/helpers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/coopiak/amisdesseniors-fr/nice/administrator/components/com_rsform/helpers/excelxml.php
<?php
/**
* @package RSForm! Pro
* @copyright (C) 2007-2019 www.rsjoomla.com
* @license GPL, http://www.gnu.org/copyleft/gpl.html
*/

defined('_JEXEC') or die;

class RSFormProXLS
{
	protected $file;
	protected $title;
	protected $rows = array();
	
	public function __construct($title = '') {
		$this->setTitle($title);
	}
	
	public function setTitle($title) {
		$title = preg_replace("/[\\\|:|\/|\?|\*|\[|\]]/", '', $title);
		$title = substr($title, 0, 31);
		$this->title = $title;
	}
	
	protected function escape($string) {
		return htmlspecialchars($string, ENT_COMPAT, 'UTF-8');
	}
	
	protected function addRow($values) {
		$cells = array();
		foreach ($values as $value) {
			$cells[] = $this->addCell($value);
		}
		$this->rows[] = '<Row>'."\n".implode("\n", $cells)."\n".'</Row>';
	}
	
	protected function addCell($value) {
		if (is_numeric($value)) {
			$type = 'Number';
		} else {
			$type  = 'String';
		}
		return '<Cell><Data ss:Type="'.$type.'">'.$this->escape($value).'</Data></Cell>'; 
	}
	
	public function open($file, $mode) {
		// Create the file pointer.
		$this->file = @fopen($file, $mode);
		
		// File has been opened successfully.
        if (is_resource($this->file)) {
			// First time this file is opened, add the Workbook & Worksheet header.
			if ($mode == 'w') {
				$header = array(
					'<?xml version="1.0" encoding="UTF-8"?>',
					'<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:html="http://www.w3.org/TR/REC-html40">',
					'<Worksheet ss:Name="'.$this->escape($this->title).'">',
					'<Table>'
				);
				fwrite($this->file, implode("\n", $header)."\n");
			}
			return true;
		} else {
			return false;
		}
	}
	
	public function write($data) {
		foreach ($data as $k => $v) {
			$this->addRow($v);
		}

		fwrite($this->file, implode("\n", $this->rows)."\n");
	}

	public function writeFooter()
	{
		// Nothing to write, finish up the Excel file.
		$footer = array(
			'</Table>',
			'</Worksheet>',
			'</Workbook>'
		);
		fwrite($this->file, implode("\n", $footer));
	}
	
	public function close() {
		return fclose($this->file);
	}
	
	public function writeHeaders($headers) {
		$this->addRow($headers);
	}
}

Anon7 - 2022
AnonSec Team