Linux sothorn202 5.15.0-161-generic #171-Ubuntu SMP Sat Oct 11 08:17:01 UTC 2025 x86_64
Apache/2.4.52 (Ubuntu)
: 202.28.82.202 | : 216.73.216.9
pkexec version 0.105
Cant Read [ /etc/named.conf ]
iqtd
RED EYES BYPASS SHELL!
Terminal
Auto Root
Adminer
Backdoor Destroyer
Kernel Exploit
Lock Shell
Lock File
Create User
+ Create Folder
+ Create File
/
home /
lifelonglearn /
commert /
accout /
Kotchasan /
[ HOME SHELL ]
NAME
SIZE
PERMISSION
ACTION
Cache
[ DIR ]
drwxr-xr-x
Database
[ DIR ]
drwxr-xr-x
Http
[ DIR ]
drwxr-xr-x
Log
[ DIR ]
drwxr-xr-x
Orm
[ DIR ]
drwxr-xr-x
PHPMailer
[ DIR ]
drwxr-xr-x
Psr
[ DIR ]
drwxr-xr-x
Accordion.php
2.59
KB
-rwxr-xr-x
ApiController.php
5.59
KB
-rwxr-xr-x
ApiException.php
431
B
-rwxr-xr-x
ArrayTool.php
16.99
KB
-rwxr-xr-x
CKEditor.php
5.5
KB
-rwxr-xr-x
Collection.php
4.73
KB
-rwxr-xr-x
Config.php
8.7
KB
-rwxr-xr-x
Controller.php
512
B
-rwxr-xr-x
Country.php
31.94
KB
-rwxr-xr-x
Csv.php
9.82
KB
-rwxr-xr-x
Curl.php
8.35
KB
-rwxr-xr-x
Currency.php
12.71
KB
-rwxr-xr-x
DOMNode.php
6.07
KB
-rwxr-xr-x
DOMParser.php
6.58
KB
-rwxr-xr-x
DataTable.php
50.94
KB
-rwxr-xr-x
Database.php
3.26
KB
-rwxr-xr-x
Date.php
8.26
KB
-rwxr-xr-x
Email.php
7.12
KB
-rwxr-xr-x
File.php
4.52
KB
-rwxr-xr-x
Files.php
3.05
KB
-rwxr-xr-x
Form.php
36.01
KB
-rwxr-xr-x
Grid.php
1.02
KB
-rwxr-xr-x
Html.php
21.1
KB
-rwxr-xr-x
HtmlTable.php
6.97
KB
-rwxr-xr-x
Htmldoc.php
4.37
KB
-rwxr-xr-x
Image.php
13.58
KB
-rwxr-xr-x
InputItem.php
20.1
KB
-rwxr-xr-x
InputItemException.php
449
B
-rwxr-xr-x
Inputs.php
4.29
KB
-rwxr-xr-x
KBase.php
561
B
-rwxr-xr-x
Kotchasan.php
2.73
KB
-rwxr-xr-x
Language.php
18.22
KB
-rwxr-xr-x
ListItem.php
7.77
KB
-rwxr-xr-x
Login.php
9.3
KB
-rwxr-xr-x
Menu.php
2.92
KB
-rwxr-xr-x
Mime.php
51.18
KB
-rwxr-xr-x
Model.php
1.31
KB
-rwxr-xr-x
Number.php
2.64
KB
-rwxr-xr-x
ObjectTool.php
3.73
KB
-rwxr-xr-x
Password.php
2.97
KB
-rwxr-xr-x
Pdf.php
43.15
KB
-rwxr-xr-x
Province.php
11.71
KB
-rwxr-xr-x
Router.php
5.45
KB
-rwxr-xr-x
Session.php
2.22
KB
-rwxr-xr-x
Singleton.php
1.3
KB
-rwxr-xr-x
Tab.php
3.72
KB
-rwxr-xr-x
Template.php
8.37
KB
-rwxr-xr-x
Text.php
12.89
KB
-rwxr-xr-x
Validator.php
2.7
KB
-rwxr-xr-x
View.php
8.16
KB
-rwxr-xr-x
Xls.php
3.04
KB
-rwxr-xr-x
load.php
15.54
KB
-rwxr-xr-x
Delete
Unzip
Zip
${this.title}
Close
Code Editor : Csv.php
<?php /** * @filesource Kotchasan/Csv.php * * @copyright 2016 Goragod.com * @license https://www.kotchasan.com/license/ * * @see https://www.kotchasan.com/ */ namespace Kotchasan; /** * CSV function * * @author Goragod Wiriya <admin@goragod.com> * * @since 1.0 */ class Csv { /** * @var mixed */ private $charset; /** * @var mixed */ private $columns; /** * @var mixed */ private $datas; /** * @var mixed */ private $keys; /** * ฟังก์ชั่นนำเข้าข้อมูล CSV * คืนค่าข้อมูลที่อ่านได้เป็นแอเรย์ * * @param string $csv ชื่อไฟล์รวมพาธ * @param array $columns ข้อมูลคอลัมน์ array('column1' => 'data type', 'column2' => 'data type', ....) * @param array $keys ชื่อคอลัมน์สำหรับตรวจข้อมูลซ้ำ null(default) หมายถึงไม่ตรวจสอบ * @param string $charset รหัสภาษาของไฟล์ ค่าเริ่มต้นคือ UTF-8 * * @return array */ public static function import($csv, $columns, $keys = null, $charset = 'UTF-8') { $obj = new static(); $obj->columns = $columns; $obj->datas = array(); $obj->charset = strtoupper($charset); $obj->keys = $keys; $obj->read($csv, array($obj, 'importDatas'), array_keys($columns)); return $obj->datas; } /** * อ่านไฟล์ CSV ทีละแถวส่งไปยังฟังก์ชั่น $onRow * แถวแรกของข้อมูลคือ Header ต้องระบุเสมอ * * @param string $file ชื่อไฟล์รวมพาธ * @param mixed $onRow ฟังก์ชั่นรับค่าแต่ละแถว function($data){} * @param array $headers แอเรย์เก็บชื่อคอลัมน์สำหรับการทดสอบความถูกต้อง ถ้าไม่ระบุจะไม่ตรวจสอบ * * @throws Exception ถ้า Header ของไฟล์ CSV ไม่ถูกต้อง */ public static function read($file, $onRow, $headers = null, $charset = 'UTF-8') { $columns = array(); $f = @fopen($file, 'r'); if ($f) { // charset $charset = strtoupper($charset); while (($data = fgetcsv($f)) !== false) { if (empty($columns)) { if (is_array($headers)) { if (count($headers) != count($data)) { throw new \Exception('Invalid CSV Header'); } else { if ($charset == 'UTF-8') { // remove BOM $data[0] = self::removeBomUtf8($data[0]); } else { // แปลงเป็น UTF-8 foreach ($data as $k => $v) { $data[$k] = iconv($charset, 'UTF-8//IGNORE', $v); } } // ตรวจสอบ Header foreach ($headers as $k) { if (!in_array($k, $data)) { throw new \Exception('Column '.$k.' not found'); } } } } $columns = $data; } else { $items = array(); foreach ($data as $k => $v) { if (isset($columns[$k])) { if ($charset == 'UTF-8') { $items[$columns[$k]] = $v; } else { // แปลงเป็น UTF-8 $items[$columns[$k]] = iconv($charset, 'UTF-8//IGNORE', $v); } } } call_user_func($onRow, $items); } } fclose($f); } } /** * สร้างไฟล์ CSV สำหรับดาวน์โหลด * คืนค่า true * * @param string $file ชื่อไฟล์ ไม่ต้องมีนามสกุล * @param array $header ส่วนหัวของข้อมูล * @param array $datas ข้อมูล * @param string $charset ภาษาของ CSV ค่าเริ่มต้นคือ UTF-8 * @param bool $bom true (default) ใส่ BOM ลงในไฟล์ CSV ถ้าเป็น UTF-8 * * @return bool */ public static function send($file, $header, $datas, $charset = 'UTF-8', $bom = true) { // header header('Content-Type: text/csv;charset="'.$charset.'"'); header('Content-Disposition: attachment;filename="'.$file.'.csv"'); // create stream $f = fopen('php://output', 'w'); if ($charset == 'UTF-8' && $bom) { // UTF-8 with BOM fwrite($f, "\xEF\xBB\xBF"); } // charset $charset = strtoupper($charset); // csv header if (!empty($header)) { fputcsv($f, self::convert($header, $charset)); } // content foreach ($datas as $item) { fputcsv($f, self::convert($item, $charset)); } // close fclose($f); // คืนค่า สำเร็จ return true; } /** * remove BOM * * @param $s * * @return string */ private static function removeBomUtf8($s) { if (substr($s, 0, 3) == chr(hexdec('EF')).chr(hexdec('BB')).chr(hexdec('BF'))) { return substr($s, 3); } else { return $s; } } /** * แปลงข้อมูลเป็นภาษาที่เลือก * * @param array $datas * @param string $charset * * @return array */ private static function convert($datas, $charset) { if ($charset != 'UTF-8') { foreach ($datas as $k => $v) { if ($v != '') { $datas[$k] = iconv('UTF-8', $charset.'//IGNORE', $v); } } } return $datas; } /** * ฟังก์ชั่นรับค่าจากการอ่าน CSV * * @param array $data */ private function importDatas($data) { $save = array(); foreach ($this->columns as $key => $type) { $save[$key] = null; if (isset($data[$key])) { if (is_array($type)) { $save[$key] = call_user_func($type, $data[$key]); } elseif ($type == 'int') { $save[$key] = (int) $data[$key]; } elseif ($type == 'double') { $save[$key] = (float) $data[$key]; } elseif ($type == 'float') { $save[$key] = (float) $data[$key]; } elseif ($type == 'number') { $save[$key] = preg_replace('/[^0-9]+/', '', $data[$key]); } elseif ($type == 'en') { $save[$key] = preg_replace('/[^a-zA-Z0-9]+/', '', $data[$key]); } elseif ($type == 'date') { if (preg_match('/^([0-9]{4,4})[\-\/]([0-9]{1,2})[\-\/]([0-9]{1,2})$/', $data[$key], $match)) { $save[$key] = "$match[1]-$match[2]-$match[3]"; } elseif (preg_match('/^([0-9]{1,2})[\-\/]([0-9]{1,2})[\-\/]([0-9]{4,4})$/', $data[$key], $match)) { $save[$key] = "$match[3]-$match[2]-$match[1]"; } } elseif ($type == 'datetime') { if (preg_match('/^([0-9]{4,4})[\-\/]([0-9]{2,2})[\-\/]([0-9]{2,2})\s([0-9]{2,2}):([0-9]{2,2}):([0-9]{2,2})$/', $data[$key])) { $save[$key] = $data[$key]; } elseif (preg_match('/^([0-9]{2,2})[\-\/]([0-9]{2,2})[\-\/]([0-9]{4,4})\s(([0-9]{2,2}):([0-9]{2,2}):([0-9]{2,2}))$/', $data[$key], $match)) { $save[$key] = "$match[4]-$match[3]-$match[2] $match[1]"; } } elseif ($type == 'time') { if (preg_match('/^([0-9]{2,2}):([0-9]{2,2}):([0-9]{2,2})$/', $data[$key])) { $save[$key] = $data[$key]; } } elseif ($this->charset == 'UTF-8') { $save[$key] = \Kotchasan\Text::topic($data[$key]); } else { $save[$key] = iconv($this->charset, 'UTF-8', \Kotchasan\Text::topic($data[$key])); } } } if (empty($this->keys)) { $this->datas[] = $save; } else { $keys = ''; foreach ($this->keys as $item) { if ($save[$item] !== null && $save[$item] !== '') { $keys .= $save[$item]; } else { $save = null; continue; } } if (!empty($save) && !isset($this->datas[$keys])) { $this->datas[$keys] = $save; } } } }
Close