├── skin ├── booking │ ├── loader.html │ ├── main.html │ ├── welcome.html │ ├── page.html │ ├── login.html │ ├── member.html │ ├── settings.php │ ├── forgotfrm.html │ ├── loginfrm.html │ ├── registerfrm.html │ ├── privacy_en.html │ ├── privacy_la.html │ ├── privacy_th.html │ ├── index.html │ └── 404.html ├── default │ ├── loader.html │ ├── welcome.html │ ├── login.html │ ├── page.html │ ├── member.html │ ├── settings.php │ ├── main.html │ ├── index.html │ ├── forgotfrm.html │ ├── privacy_en.html │ ├── privacy_la.html │ ├── privacy_th.html │ ├── loginfrm.html │ ├── registerfrm.html │ └── 404.html ├── ext │ ├── c.png │ ├── avi.png │ ├── bmp.png │ ├── cpp.png │ ├── css.png │ ├── dll.png │ ├── doc.png │ ├── exe.png │ ├── flv.png │ ├── gif.png │ ├── htm.png │ ├── iso.png │ ├── jpg.png │ ├── js.png │ ├── mov.png │ ├── mp3.png │ ├── mpg.png │ ├── ogg.png │ ├── pdf.png │ ├── php.png │ ├── png.png │ ├── ppt.png │ ├── psd.png │ ├── rar.png │ ├── rm.png │ ├── rtf.png │ ├── sql.png │ ├── swf.png │ ├── tar.png │ ├── tgz.png │ ├── txt.png │ ├── wav.png │ ├── wma.png │ ├── wmv.png │ ├── xls.png │ ├── xml.png │ ├── zip.png │ ├── aiff.png │ ├── docx.png │ ├── file.png │ ├── html.png │ ├── jpeg.png │ ├── midi.png │ ├── pptx.png │ ├── tiff.png │ ├── webp.png │ ├── xlsx.png │ └── xvid.png ├── img │ ├── blank.gif │ ├── noicon.png │ └── kotchasan.png ├── fonts │ ├── icomoon.eot │ ├── icomoon.ttf │ ├── icomoon.woff │ ├── leelawad.ttf │ ├── supermarket-webfont.eot │ ├── supermarket-webfont.ttf │ ├── supermarket-webfont.woff │ ├── supermarket-webfont.woff2 │ ├── thsarabunnew-webfont.eot │ ├── thsarabunnew-webfont.ttf │ ├── thsarabunnew-webfont.woff │ ├── thsarabunnew_bold-webfont.eot │ ├── thsarabunnew_bold-webfont.ttf │ ├── thsarabunnew_bold-webfont.woff │ ├── thsarabunnew_italic-webfont.eot │ ├── thsarabunnew_italic-webfont.ttf │ ├── thsarabunnew_italic-webfont.woff │ ├── thsarabunnew_bolditalic-webfont.eot │ ├── thsarabunnew_bolditalic-webfont.ttf │ └── thsarabunnew_bolditalic-webfont.woff ├── .htaccess └── dark.css ├── robots.txt ├── favicon.ico ├── language ├── en.gif ├── la.gif ├── th.gif ├── en.js ├── th.js └── la.js ├── install ├── img │ ├── en.gif │ ├── th.gif │ ├── help.png │ ├── valid.png │ ├── invalid.png │ └── white-grad.png ├── complete.php ├── settings │ ├── database.php │ └── config.php ├── style.css ├── upgrade1.php ├── step2.php ├── index.php ├── upgrade0.php └── step1.php ├── .gitignore ├── modules ├── car │ ├── img │ │ └── noimage.png │ ├── controllers │ │ ├── init.php │ │ ├── vehicles.php │ │ ├── setup.php │ │ ├── approve.php │ │ └── settings.php │ ├── style.css │ ├── models │ │ ├── category.php │ │ ├── categories.php │ │ ├── checker.php │ │ └── chauffeur.php │ ├── views │ │ ├── tools.php │ │ └── home.php │ └── script.js └── index │ ├── controllers │ ├── api.php │ ├── login.php │ ├── privacy.php │ ├── export.php │ ├── otp.php │ ├── member.php │ ├── page.php │ ├── welcome.php │ ├── memberstatus.php │ ├── register.php │ ├── permission.php │ ├── language.php │ ├── modules.php │ ├── sms.php │ ├── theme.php │ ├── linesettings.php │ ├── apis.php │ ├── loginpage.php │ ├── telegramsettings.php │ ├── usage.php │ ├── system.php │ ├── mailserver.php │ ├── consentsettings.php │ ├── editprofile.php │ ├── write.php │ └── categories.php │ ├── models │ ├── category.php │ ├── province.php │ ├── telegram.php │ ├── activate.php │ ├── checker.php │ ├── forgot.php │ ├── log.php │ └── consentsettings.php │ └── views │ ├── otp.php │ ├── login.php │ ├── tabmenus.php │ └── consent.php ├── Kotchasan ├── Psr │ └── Log │ │ ├── LoggerAwareInterface.php │ │ ├── LogLevel.php │ │ └── NullLogger.php ├── ApiException.php ├── Http │ ├── Message.php │ └── NotFound.php ├── InputItemException.php ├── Cache │ ├── Exception.php │ ├── Cache.php │ └── CacheItem.php ├── Database │ ├── Exception.php │ ├── Db.php │ └── Schema.php ├── Controller.php ├── KBase.php ├── Grid.php ├── Model.php └── Singleton.php ├── loader.php ├── api.php ├── index.php ├── export.php ├── line ├── webhook.php └── callback.php ├── Gcms ├── Router.php └── Sms.php ├── .htaccess ├── README.md ├── load.php ├── Thaibluksms └── Sms.php └── js ├── google.js ├── facebook.js ├── pdpa.js └── ddpanel.js /skin/booking/loader.html: -------------------------------------------------------------------------------- 1 | {CONTENT} -------------------------------------------------------------------------------- /skin/booking/main.html: -------------------------------------------------------------------------------- 1 | {CONTENT} -------------------------------------------------------------------------------- /skin/default/loader.html: -------------------------------------------------------------------------------- 1 | {CONTENT} -------------------------------------------------------------------------------- /skin/booking/welcome.html: -------------------------------------------------------------------------------- 1 | {CONTENT} -------------------------------------------------------------------------------- /skin/default/welcome.html: -------------------------------------------------------------------------------- 1 | {CONTENT} -------------------------------------------------------------------------------- /robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Allow: / 3 | -------------------------------------------------------------------------------- /skin/booking/page.html: -------------------------------------------------------------------------------- 1 |
คุณได้ทำการติดตั้ง Kotchasan เป็นที่เรียบร้อยแล้ว
'; 4 | echo 'เพื่อความปลอดภัย กรุณาลบไดเร็คทอรี่ install/ ออกก่อนดำเนินการต่อ
'; 5 | echo ''; 6 | -------------------------------------------------------------------------------- /Kotchasan/Psr/Log/LoggerAwareInterface.php: -------------------------------------------------------------------------------- 1 | 2 | 3 |คุณจะต้องระบุข้อมูลสมาชิกผู้ดูแลระบบสูงสุด
'; 8 | echo ''; 9 | if (empty($username)) { 10 | echo '
กรุณากรอกชื่อผู้ใช้ของผู้ดูแลระบบสูงสุด
'; 11 | } else { 12 | echo 'กรุณากรอกชื่อผู้ใช้ของผู้ดูแลระบบสูงสุด
'; 13 | } 14 | echo ''; 15 | if (empty($password)) { 16 | echo '
กรุณากรอกรหัสผ่านของผู้ดูแลระบบสูงสุด
'; 17 | } else { 18 | echo 'กรุณากรอกรหัสผ่านของผู้ดูแลระบบสูงสุด
'; 19 | } 20 | echo ''; 21 | echo ''; 22 | echo ''; 23 | } 24 | -------------------------------------------------------------------------------- /Kotchasan/Grid.php: -------------------------------------------------------------------------------- 1 | 8 | * @package Kotchasan 9 | */ 10 | 11 | namespace Kotchasan; 12 | 13 | /** 14 | * This class represents a grid system used for layout purposes. 15 | * 16 | * @see https://www.kotchasan.com/ 17 | */ 18 | class Grid extends \Kotchasan\Template 19 | { 20 | /** 21 | * @var int The number of columns in the grid 22 | */ 23 | protected $cols; 24 | 25 | /** 26 | * Constructor 27 | */ 28 | public function __construct() 29 | { 30 | // Set the default number of columns to 1 31 | $this->cols = 1; 32 | } 33 | 34 | /** 35 | * Get the number of columns in the grid. 36 | * 37 | * @return int The number of columns 38 | */ 39 | public function getCols() 40 | { 41 | return $this->cols; 42 | } 43 | 44 | /** 45 | * Set the number of columns in the grid. 46 | * 47 | * @param int $cols The number of columns (must be greater than 0) 48 | * 49 | * @return static This Grid instance for method chaining 50 | */ 51 | public function setCols($cols) 52 | { 53 | // Ensure the number of columns is at least 1 54 | $this->cols = max(1, (int) $cols); 55 | // Set the value of 'num' property to match the number of columns 56 | $this->num = $this->cols; 57 | return $this; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /load.php: -------------------------------------------------------------------------------- 1 | 6 | * @copyright 2016 Goragod.com 7 | * @license https://www.kotchasan.com/license/ 8 | * 9 | * @see https://www.kotchasan.com/ 10 | */ 11 | /** 12 | * document root (full path) 13 | * eg /home/user/public_html/ 14 | * 15 | * @var string 16 | */ 17 | define('ROOT_PATH', str_replace('\\', '/', dirname(__FILE__)).'/'); 18 | /** 19 | * โฟลเดอร์เก็บข้อมูล 20 | * 21 | * @var string 22 | */ 23 | define('DATA_FOLDER', 'datas/'); 24 | /** 25 | * 0 (default) บันทึกเฉพาะข้อผิดพลาดร้ายแรงลง error_log.php 26 | * 1 บันทึกข้อผิดพลาดและคำเตือนลง error_log.php 27 | * 2 แสดงผลข้อผิดพลาดและคำเตือนออกทางหน้าจอ (ใช้เฉพาะตอนออกแบบเท่านั้น) 28 | * 29 | * @var int 30 | */ 31 | define('DEBUG', 0); 32 | /** 33 | * false (default) 34 | * true บันทึกการ query ฐานข้อมูลลง log (ใช้เฉพาะตอนออกแบบเท่านั้น) 35 | * 36 | * @var bool 37 | */ 38 | define('DB_LOG', false); 39 | /** 40 | * ภาษาเริ่มต้น 41 | * auto = อัตโนมัติจากบราวเซอร์ 42 | * th, en ตามภาษาที่เลือก 43 | * 44 | * @var string 45 | */ 46 | define('INIT_LANGUAGE', 'th'); 47 | /** 48 | * เปิด/ปิดการใช้งาน Session บน Database 49 | * ต้องติดตั้งตาราง sessions ด้วย 50 | * 51 | * @var bool 52 | */ 53 | define('USE_SESSION_DATABASE', false); 54 | /* 55 | * ระบุ SQL Mode ที่ต้องการ 56 | * หากพบปัญหาการใช้งาน 57 | * 58 | * @var string 59 | */ 60 | //define('SQL_MODE', ''); 61 | /** 62 | * load Kotchasan 63 | */ 64 | include 'Kotchasan/load.php'; 65 | -------------------------------------------------------------------------------- /Thaibluksms/Sms.php: -------------------------------------------------------------------------------- 1 | 17 | * 18 | * @since 1.0 19 | */ 20 | class Sms extends \Kotchasan\KBase 21 | { 22 | /** 23 | * ส่ง SMS. 24 | * 25 | * @param $msisdn 26 | * @param $message 27 | * 28 | * @return string 29 | */ 30 | public static function send($msisdn, $message) 31 | { 32 | if (!empty(self::$cfg->sms_username) && !empty(self::$cfg->sms_password)) { 33 | include_once 'sms.class.php'; 34 | 35 | return \sms::send_sms(self::$cfg->sms_username, self::$cfg->sms_password, $msisdn, $message, self::$cfg->sms_sender, '', self::$cfg->sms_type); 36 | } 37 | 38 | return ''; 39 | } 40 | 41 | /** 42 | * ตรวจสอบเครดิต 43 | * 44 | * @param $premium 45 | * 46 | * @return string 47 | */ 48 | public static function check_credit($premium) 49 | { 50 | if (!empty(self::$cfg->sms_username) && !empty(self::$cfg->sms_password)) { 51 | include_once 'sms.class.php'; 52 | $type = $premium ? 'credit_remain_premium' : 'credit_remain'; 53 | 54 | return \sms::check_credit(self::$cfg->sms_username, self::$cfg->sms_password, $type); 55 | } 56 | 57 | return ''; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /modules/car/models/checker.php: -------------------------------------------------------------------------------- 1 | 19 | * 20 | * @since 1.0 21 | */ 22 | class Model 23 | { 24 | /** 25 | * ตรวจสอบรถว่าง 26 | * คืนค่า true ถ้ารถว่าง 27 | * ไม่ว่าง คืนค่า false 28 | * 29 | * @param array $save 30 | * 31 | * @return bool 32 | */ 33 | public static function availability($save) 34 | { 35 | $where = [ 36 | ['vehicle_id', $save['vehicle_id']], 37 | Sql::create('(`status`=1 OR `approve`>1)') 38 | ]; 39 | if (!empty($save['id'])) { 40 | $where[] = ['id', '!=', $save['id']]; 41 | } 42 | $search = \Kotchasan\Model::createQuery() 43 | ->from('car_reservation') 44 | ->where($where) 45 | ->andWhere([ 46 | Sql::create("('$save[end]' BETWEEN `begin` AND `end`)"), 47 | Sql::create("('$save[begin]' BETWEEN `begin` AND `end`)"), 48 | Sql::create("(`begin` BETWEEN '$save[begin]' AND '$save[end]' AND `end` BETWEEN '$save[begin]' AND '$save[end]')") 49 | ], 'OR') 50 | ->first('id'); 51 | return $search === false ? true : false; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /install/step2.php: -------------------------------------------------------------------------------- 1 | '; 6 | echo 'คุณจะต้องระบุข้อมูลสมาชิกผู้ดูแลระบบ ซึ่งจะมีสิทธิสูงสุดในระบบ ห้ามลืม ห้ามหาย
'; 8 | echo ''; 9 | if (empty($username)) { 10 | echo '
กรุณากรอกชื่อผู้ใช้ที่ต้องการ ใช้ในการเข้าระบบเป็นผู้ดูแลสูงสุด
'; 11 | } else { 12 | echo 'กรุณากรอกชื่อผู้ใช้ที่ต้องการ ใช้ในการเข้าระบบเป็นผู้ดูแลสูงสุด
'; 13 | } 14 | echo ''; 15 | if (empty($password)) { 16 | echo '
กรุณากรอกรหัสผ่านที่ต้องการ ใช้ในการเข้าระบบเป็นผู้ดูแลสูงสุด
'; 17 | } else { 18 | echo 'กรุณากรอกรหัสผ่านที่ต้องการ ใช้ในการเข้าระบบเป็นผู้ดูแลสูงสุด
'; 19 | } 20 | echo ''; 21 | echo ''; 22 | echo ''; 23 | } 24 | -------------------------------------------------------------------------------- /modules/index/controllers/export.php: -------------------------------------------------------------------------------- 1 | 20 | * 21 | * @since 1.0 22 | */ 23 | class Controller extends \Kotchasan\Controller 24 | { 25 | /** 26 | * Controller สำหรับส่งออกข้อมูล 27 | * 28 | * @param Request $request 29 | */ 30 | public function index(Request $request) 31 | { 32 | // ตัวแปรป้องกันการเรียกหน้าเพจโดยตรง 33 | define('MAIN_INIT', 'export'); 34 | // session cookie 35 | $request->initSession(); 36 | // กำหนด skin ให้กับ template 37 | Template::init(self::$cfg->skin); 38 | // ตรวจสอบโมดูลที่เรียก 39 | $className = \Index\Main\Controller::parseRequest($request); 40 | $ret = false; 41 | if ($className && method_exists($className, 'export')) { 42 | // create Class 43 | $ret = createClass($className)->export($request); 44 | } 45 | if ($ret === false) { 46 | // ไม่พบโมดูล หรือ ไม่สามารถทำรายการได้ 47 | new \Kotchasan\Http\NotFound(); 48 | } elseif (is_string($ret)) { 49 | // คืนค่าเป็น string มา เช่น พิมพ์ 50 | echo $ret; 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /modules/index/views/otp.php: -------------------------------------------------------------------------------- 1 | 21 | * 22 | * @since 1.0 23 | */ 24 | class View extends \Gcms\View 25 | { 26 | /** 27 | * ฟอร์มยืนยันหมายเลขโทรศัพท์ (OTP) 28 | * 29 | * @param Request $request 30 | * @param array $payload 31 | * @param string $token 32 | * 33 | * @return string 34 | */ 35 | public static function render(Request $request, $payload, $token) 36 | { 37 | // otp.html 38 | $template = Template::createFromFile(ROOT_PATH.self::$cfg->skin.'/otp.html'); 39 | $template->add([ 40 | '/{ID}/' => $token, 41 | '/{TIME}/' => \Gcms\View::getTimeElapsed($payload['expired']), 42 | '/{TOKEN}/' => $request->createToken(), 43 | /* ภาษา */ 44 | '/{LNG_([^}]+)}/e' => '\Kotchasan\Language::parse(array(1=>"$1"))', 45 | /* ภาษา ที่ใช้งานอยู่ */ 46 | '/{LANGUAGE}/' => Language::name(), 47 | /* template name */ 48 | '/{SKIN}/' => self::$cfg->skin, 49 | /* website URL */ 50 | '/{WEBURL}/' => WEB_URL, 51 | // เลขเวอร์ชั่นของไฟล์ 52 | '/{REV}/' => isset(self::$cfg->reversion) ? self::$cfg->reversion : '' 53 | ]); 54 | // คืนค่า HTML 55 | return $template->render(); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /js/google.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Google signin Script 3 | * 4 | * @filesource js/google.js 5 | * @link https://www.kotchasan.com/ 6 | * @copyright 2018 Goragod.com 7 | * @license https://www.kotchasan.com/license/ 8 | */ 9 | function initGooleSignin(google_client_id) { 10 | window.setTimeout(function() { 11 | loadJavascript( 12 | "apis-google", 13 | "https://accounts.google.com/gsi/client", 14 | googleSigninLoad 15 | ); 16 | }, 100); 17 | window.google_client_id = google_client_id; 18 | } 19 | 20 | var googleSigninLoad = function() { 21 | var handleCredentialResponse = function(response) { 22 | let responsePayload = jwt_decode(response.credential), 23 | q = []; 24 | if ($E("token")) { 25 | q.push("token=" + $E("token").value); 26 | } 27 | q.push("id=" + encodeURIComponent(responsePayload.sub)); 28 | q.push("name=" + encodeURIComponent(responsePayload.name)); 29 | q.push("image=" + encodeURIComponent(responsePayload.picture)); 30 | q.push("email=" + encodeURIComponent(responsePayload.email)); 31 | send(WEB_URL + "index.php/" + ($E("google_action") ? $E("google_action").value : "index/model/gglogin/chklogin"), q.join("&"), socialLoginSubmit); 32 | }; 33 | google.accounts.id.initialize({ 34 | client_id: window.google_client_id + ".apps.googleusercontent.com", 35 | callback: handleCredentialResponse 36 | }); 37 | if ($E("google_login")) { 38 | var o = { 39 | theme: "outline", 40 | size: "large" 41 | }; 42 | var datas = $E("google_login").dataset; 43 | for (var prop in datas) { 44 | o[prop] = datas[prop]; 45 | } 46 | google.accounts.id.renderButton($E("google_login"), o); 47 | } 48 | }; 49 | -------------------------------------------------------------------------------- /skin/booking/loginfrm.html: -------------------------------------------------------------------------------- 1 |ไฟล์และโฟลเดอร์ทั้งหมดตามรายการด้านล่างต้องถูกสร้างขึ้น และกำหนดค่าให้สามารถเขียนได้
'; 5 | echo 'ไฟล์และโฟลเดอร์ทั้งหมดตามรายการด้านล่างต้องถูกสร้างขึ้น และกำหนดค่าให้สามารถเขียนได้
'; 5 | echo '