Element vertical alight middle
2020-03-12 18:49:09
.align-items-center { -webkit-box-align: center!important; -ms-flex-align: center!important; align-items: center!important; } ...2020-03-12 18:49:09
.align-items-center { -webkit-box-align: center!important; -ms-flex-align: center!important; align-items: center!important; } ...2020-03-05 15:28:19
function fileExt(file) { var extension = file.substr( (file.lastIndexOf('.') +1) ); switch(extension) { case 'jpeg': case 'jpg': ...2020-03-05 15:24:15
function validEmail( email ) { var emailArr = email.split(","); var ret = false; for(var i=0; i<emailArr.length;i++) ...2020-03-05 15:21:44
function formatBytes(bytes, decimals = 2) { if (bytes === 0) return '0 Bytes'; const k = 1024; const dm = decimals < 0 ? 0 : decimals; const ...2020-03-05 15:14:06
$('.modal-second').on('hidden.bs.modal', function () { if( ($('.modal-first').data('bs.modal') || {})._isShown ) { $('.modal-first').css('z-index','1050'); ...2019-10-08 16:04:08
Example for Video spliting function by interval (time range) Looping to images (.jpg) in folder ex <ul style="list-style: none" id="thumb-list"> <?php foreach(glob('ex/'.$h.'*.jpg') ...2019-08-21 12:00:01
if( @getimagesize($image_url) ) { return true; } else { return false; } ...2019-07-03 17:04:01
import random print(f'{random.randrange(1,10):02}') ...2019-07-03 10:47:51
Open interpreter console >>> import os >>> os.getcwd() 'C:\\Users\User_name\AppData\Local\Programs\Python\Python37-32' >>> os.chdir('/temp/') >>> os.getcwd() 'C:\\temp' >>> ...2019-06-19 14:55:48
SELECT YR, CONCAT('฿', FORMAT(AVG(PRC), 2)) AVG_MTH, FORMAT(MAX(PRC),2) MX, FORMAT(MIN(PRC),2) MN FROM ( SELECT CONCAT(month(order_date),'/',year(order_date)) MNT, year(order_date) YR , SUM(net_price) ...2019-06-13 16:53:01
HTML: <div class="video-thumbnail"> <img src="video_cover.jpg" alt=""> </div> CSS: .video-thumbnail { ...2019-03-26 16:11:33
Run Tell Amgr Run "Folder_path\dabase_name.nsf" 'Schedule_Name' Cancel Tell Amgr Cancel "Folder_path\dabase_name.nsf" 'Schedule_Name' Ref: https://www.ibm.com/ ...2019-03-25 17:39:38
This problem occurred after some uninstallation, such as Ads management MOD. Don't worry, you can restore files and make the website back to work again. But you still need to find a way to uninstall it. After ...2019-03-22 23:16:03
For SMF v2.0.15 After submitting website and verified by adsense programs (put code in <head> tag) Ads banner will be ready to display If there is an automatic setting. For this article, it is recommended to display an Adsense ...2019-03-12 17:21:06
Open file path: ../Themes/Theme_name/index.template.php find the line of function templete_menu(){ and look at the looping (foreach statement) foreach ($context['menu_buttons'] as $act => $button) {... Insert ...2019-02-25 15:48:24
จากที่ก่อนหน้านี้ (ปลายปี2018) ทางธนาคารแห่งประเทศไทย (ธปท) ได้พัฒนา API Exchange Rate จากเวอร์ชั่นเก่า มาเป็นตัวใหม่ ส่งผลให้ Application ของเว็บไซ์ที่เคยเขียนไว้ ไม่สามารถเชื่อมต่อ API ตัวเดิมได้ ดังนั้นเราจะมาลองเชื่อมต่อ API ...2019-01-17 17:23:38
1. Create a view and get data from database (some form). 2. Create the first column for the categories that you need of each document (rename to Year) 3. Click the column then put formula to below box: @Year(DocDate) DocDate ...2019-01-11 11:24:58
This script will delete some field (check out previous user) and unlock the document. FIELD CurrentUser := @DeleteField; @DocLock([UNLOCK]); ...2019-01-11 11:12:54
This code is conditon IF THEN ELSE and DO somthing (group of statement) @If( A=A; @Do( Some command; ...... ...... ); A=B; @Do( Some command; ..... ..... ); A=C; ...2018-10-09 12:11:13
$('iframe').load(function() { this.style.height = this.contentWindow.document.body.offsetHeight + 'px'; }); Ref: https://stackoverflow.com/questions/3846132/jquery-get-height-of-iframe-content-when-loaded ...2018-09-14 14:47:45
SELECT t.SubcateCode, t.NewsID, t.PrintDate, t.Story, t.Headline from IRNews t INNER JOIN ( SELECT NewsID,SubcateCode, MAX(PrintDate) as MaxDate FROM IRNews WHERE CategoryCode='EVN' ...2018-07-06 15:32:38
Set config php.ini max_input_vars = 1000 *Default at 1000 fields If you want to define many IN condition with sql command (MySQL) If you want to POST these values (very many fields) to the sql statement via IN ...2018-06-14 23:18:53
UPDATE tbl_name SET column_name = REPLACE(column_name , 'from_string', 'to_string') ...2018-06-12 23:52:23
$('input[name=test]').keyup(function(){ this.value = this.value.toUpperCase(); }); ...2018-06-12 11:09:12
UPDATE Table_name set Column_date = DATE_ADD (Column_date , INTERVAL 543 YEAR) WHERE YEAR(Column_date )=2018 ...2018-05-18 00:57:15
PHP Export excel alert: Warning: tempnam(): open_basedir restriction in effect. File() is not within the allowed path(s): __ Warning: fopen(): Filename cannot be empty in __ Insert this code on export page: error_reporting(E_ERROR ...2018-03-06 18:33:21
$('input[name=xxx]').keyup(function() { var $th = $(this); $th.val( $th.val().replace(/[^a-zA-Z0-9]/g, function(str) { alert('กรุณากรอกข้อมูลเป็นภาษาอังกฤษและตัวเลขเท่านั้น'); ...2018-02-28 17:53:01
PHP error log: PHP Fatal error: Uncaught PHPExcel_Writer_Exception: Could not open ____ for writing. in C:\___Dir___wwwClassesPHPExcelWriterExcel2007.php:234 Stack trace: #0 C:\___Dir___wwwcommonget_report.php(331): ...2018-02-28 17:28:24
SELECT *, IF(Column1 IS NULL or Column1 = ' ', 'n/a' , Column1) FROM Table_name ...2018-02-22 17:41:33
SELECT z.delivery_type, IF(dt.detail IS NULL or dt.detail = '', pt.status_desc, dt.detail) as DT, count(*) CNT, z.price FROM ( SELECT d.pack_type, d.delivery_type, d.price FROM postmail_header h RIGHT JOIN ...2018-02-21 16:14:05
1. Get datetime data from some column in database. SELECT date_format(datetime_column,'%Y-%m-%d') DAT, date_format(datetime_column,'%H:%i:%s') TIM FROM table WHERE Something 2. Put data into each an input (eg. datepicker, ...2018-02-08 17:42:11
Wanted: A1, A2, A3, A4,... Z100 But query with sorting (ORDER BY asc) A1 A10 A11 .. A2 A21 A22 My way to works. SELECT issue FROM table ORDER BY substr(issue,1,1) ...2017-12-25 11:28:05
PHP: (process.php) $json = array(); $json[0] = "Code 1"; $json[1] = "Message"; echo json_encode($json); AJAX (Jquery): $("some_form").on('submit',(function(e) ...2017-11-03 14:57:11
SELECT date_format(DATE_ADD(column_date, INTERVAL 543 YEAR),'%d/%m/%Y') FROM column_date ...2017-07-26 16:33:04
Split word by space or plus character to array. $arr = preg_split("/[s,+]/", trim($_GET['text_search'])); And call function markWord for replace hightlight styles. function markWord($arr,$str) { ...2017-05-29 11:47:58
Example: System: Request Job (Ticket) Table: Employee (ID,Name,Surname) Type (Of request) : (ID, Name) Approver (Head of each the system,type) : (ID,SYS_ID, TYP_ID, EMP_ID) Query: Fetch ...2017-03-13 17:00:25
<?php ini_set('max_execution_time', 300); //300 seconds = 5 minutes /* connect to notes */ $hostname = '{mail.yourhost.com/imap/ssl}INBOX'; $username = 'xxx@yourhost.com'; $password = 'xxx'; /* ...2017-03-08 11:20:30
function remTag($text) { $text = strip_tags($text, '', <p>); // Kill all except <p> tag $text = preg_replace('#<p class="some">(.*?)</p>#', '', $text); // Remove ...2017-02-01 14:28:26
Modal popup for confirm before send post data <form id="form"> <button type="submit" class="btn btn-success" onclick="return preSave();">บันทึกข้อมูล</button> </form> <div ...2017-01-11 17:57:50
PHP ฟังก์ชั่นสำหรับจัดการกับ single quote (') ก่อนที่จะ insert ลงฐานข้อมูล function string_sanitize($s) { $result = str_replace(" ' ", " ' ' ", $s); return ...2017-01-06 14:24:13
How to create link Logout and redirect for Lotus notes command on web application <a href="/path/application.nsf?Logout&redirectto=/path/yourApp.nsf/LoginPage">Logout</a> ...2016-11-29 15:40:42
In case user enters text and press enter for new lines into textarea of form. Break line won't insert to database. So this way to make easy the line breaks within database. This is line This is line This is line $text ...2016-11-25 21:09:55
Fix: fatal error call to undefined function ocilogon() on xampp 1. Open file C://xampp/php/php.ini find line ;extension=php_ldap.dll and remove semi-colon (;) at front extension=php_ldap.dll 2. ...2016-11-23 11:46:51
This is the jquery code for disabling form submit by press Enter button. But it allowed to key press Shift+Enter for insert new line to textarea <script> $(function() { // DOM ready ...2016-11-14 14:18:01
Bootstrap Input tags http://bootstrap-tagsinput.github.io/bootstrap-tagsinput/examples/ Jquery Multiple select 2 side http://crlcu.github.io/multiselect/ http://quasipartikel.at/multiselect/ หากข้อมูลมีจำนวนไม่มากนัก ...2016-11-01 12:00:40
หลายคนคงจะเคยเห็นกันอยู่บ่อยๆ นะครับ เวลาที่เข้าไปยังเว็บไซต์ใดเว็บนึ่ง แล้วมี Popup เด้งขึ้นมาแสดงที่หน้า Home page ก่อนจะเข้าไปชมเว็บไซต์ ประโยชน์ของ popup ลักษณะนี้ คือสามารถโปรโมต โฆษณา ประชาสัมพันธ์ข้อมูลข่าวสารต่างๆ เพื่อนำเสนอข้อมูลแก่ ...2016-10-04 15:42:47
Include bootstrap.css (Download) <link rel="stylesheet" type="text/css" href="bootstrap.css"> HTML ให้สร้าง attribute class ชื่อ pagination <ul class="pagination"> ...2016-09-29 22:58:43
เป็น PHP ฟังก์ชั่น ที่ใช้สำหรับแบ่งหน้า ในกรณีดึงข้อมูลมาแสดงเป็น Item list พร้อมกับ css จัดรูปแบบเพื่อความสะดวกใช้งาน pagination.php <?php function displayPaging( $total, $limit, $pagenumber, $baseurl, ...2016-09-26 13:10:36
PHP โค้ดสำหรับฟอร์มอับโหลดไฟล์ หลายไฟล์ โดยมีการตรวจสอบนามสกุลของไฟล์ และจำกัดขนาด size พร้อมกับเช็ค error ขณะอับโหลด HTML <form action="file_upload.php" method="post" enctype="multipart/form-data"> <input ...2016-09-23 12:59:29
Oracle two dates differance (Buddhist year) SELECT to_date('29/09/2559', 'DD/MM/YYYY') -to_date('25/09/2559', 'DD/MM/YYYY') FROM dual; Test result on Toad for Oracle TO_DATE('29/09/2559','DD/MM/YYYY')-TO_DATE('25/09/2559','DD/MM/YYYY') --------------------------------------------------------------------- ...2016-09-20 19:07:22
Video 1. เปิด XAMPP Control ขึ้นมา กดปุ่ม start ให้กับ apache และ mysql จากนั้นกดปุ่ม admin ที่ MySQL เพื่อเข้าหน้า control panel ของ phpmyadmin 2. เข้าเมนู SQL แล้วพิมพ์ sql ในช่องด้านล่าง UPDATE ...2016-09-17 11:54:12
Script นี้เป็น framework ที่ผมสร้างขึ้นมา ทำงานบน Form ที่ให้ User กรอกรายละเอียดจังหวัด อำเภอ ตำบล และรหัสไปรษณีย์ ซึ่งมีการทำงานแบบ Dropdown List เลือกข้อมูลแบบลำดับขั้น โดยเลือกจากจังหวัดก่อน จากนั้น javascript ที่ทำงานแบบ Ajax จะไป Run คำสั่งในไฟล์ ...2016-09-15 12:20:01
In the newer PHP3 is not supported. Errors caused by the variable declaration without single or double quote. <?php $id = $_GET[id]; ?> Error reporting Notice: Use of undefined constant id - assumed ...2016-09-09 17:00:27
PHP Script for random one of array key <?PHP $text = array(); $text[] = 'Content 1'; $text[] = 'Content 2'; $text[] = 'Content 3'; echo $text[ array_rand($text,1) ]; ?> If you want ...2016-09-09 12:29:10
datepicker เป็นสคริปท์ที่ถูกใช้งานค่อนข้างบ่อยครั้ง สำหรับผู้ที่ต้องเขียน form input วัน/เดือน/ปี และส่วนตัวผมก็ใช้แทบทุกเว็บไซต์ที่มี back office เมื่อเวลาจะใช้ที ก็หลงๆลืมๆ ว่าจะใช้ไฟล์ไหนหรือฟังก์ชั่นอะไรบ้าง ผมเลยถือโอกาสนี้ นำมันมารวบรวมไว้บนเว็บฯ ...2016-09-09 11:15:25
The PHP script including condition terms before loaded content. If the condition is false The script will redirecting back to the login page with location parameters. Main page (index.php) <?php if ...2016-09-08 16:55:06
This is a technique used for printing documents on the browser for Lotusnotes Web application platform. It uses javascript in through ajax function to run commands on lotusnotes script and return by print plain text with a Html header. This ...2016-09-08 11:07:33
How to call the function on parent window with javascript ? Main page <html> <head> <script> function openNew(){ popup_path = 'popup.html; ...2016-09-06 17:10:10
เป็นฟังชั่นในการตัด html tag ออกจาก text เพื่อการใช้งานข้อมูลแบบ plain text function strip(html) { var tmp = document.createElement("DIV"); tmp.innerHTML = html; return ...2016-09-06 12:09:07
Uncaught TypeError: window.showModalDialog is not a function เป็นเพราะ Chrome ในเวอชั่นใหม่ๆ ได้เลิก support function นี้ ดังนั้น เราจึงต้องปรับเปลี่ยนวิธีการเปิด popup ใหม่ showModalDialog มีข้อดีคือ มันสามารถส่งตัวแปรไปรับค่าจาก popup แล้ว ...2016-09-05 11:42:40
ประโยชน์ของการ submit ไฟล์ sitemap กับเว็บไซต์ search engine นั้น เปรียบเสมือนการทำสารบัญเว็บไซต์ เพื่อให้กับเว็บค้นหาอย่าง google, bing เพื่อให้มันจัดเก็บแผนผังเว็บไซต์ของเราไว้ในฐานข้อมูลเว็บเสริชเหล่านั้น ทำให้ช่วยในเรื่อง SEO ...2016-09-05 11:20:43
สำหรับ PHP สามารถใช้ฟังก์ชั่น format_number ได้เลย ถูกใช้บ่อยในการเขียนโปรแกรมเกี่ยวกับตัวเลข จำนวนเงิน Price PHP Function $number = 1234.5678 echo number_format($number, 2); // Output: 1,234.57 Lotus ...2016-08-10 17:01:45
การดึงภาพและข้อมูลอื่นๆที่เกี่ยวข้องจาก board ในเว็บไซต์ Pinterest นั่น เราสามารถทำผ่าน API ที่เขาจัดเตรียมไว้ให้ ซึ่งวิธีการนั้นง่ายมากๆ ครับ แต่ก่อนอื่นคุณเป็นเป็นสมาชิกของ pinterest ก่อนนะ แล้วเข้าไปที่ 1. เข้าไปที่หน้า https://developers.pinterest.com/tools/api-explorer/ ...2016-08-09 19:10:34
1. ลำดับแรกคุณต้องมี Account ของ Instagram ก่อนนะครับ จากนั้นเข้าไปที่หน้านี้เลย https://www.instagram.com/developer 2. จากนั้นเลือก Manage Clients และกดปุ่ม Register a new client 3. กรอกรายละเอียดที่จำเป็น ...2016-01-04 14:58:09
SQL query paging in Oracle Select * from ( Select a.*,b.*, row_number() over (order by a.ID desc) as row_no from DB.TABLE1 a LEFT JOIN DB.TABLE2 b on b.ID=a.bID order by a.ID desc ) where row_no between ...2016-01-01 00:00:01
Jquery enable select option box (disabled attribute) Not work $('select[test]').attr('disabled',''); Work $('select[test]').prop('disabled',false); ...2015-09-20 12:37:42
PHP script สำหรับตรวจสอบข้อความ เช็คตัวอักษร ว่าเป็นอักษรไทย และวรรณยุกต์ หรือไม่ <?PHP if(!ereg('^[ก-์ ะ-ู เ-แ]+$', $text)) { // Something ...2015-09-20 11:23:29
แก้ปัญหาการส่งอีเมลจาก Lotus Notes web platform ส่งเข้า Gmail แล้วไม่มี Form header ปัญหานี้เกิดจาก การสร้างตัวแปร string ที่มีเครื่องหมาย น้อยกว่า (<) หรือมากกว่า ( >) รวมอยู่ใน string แล้วคลุมด้วย Double quote ("__") ทำให้โปรแกรมตีความหมายผิดพลาด ...2015-03-06 11:35:06
Fix for IE And SSL Secure 1. If isset session_start(); put before if(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE')) { session_cache_limiter("public"); } session_start(); 2. ...2015-01-27 15:12:54
SQL Query finding range an overlaps another booking (Time): SELECT COUNT(*) FORM Table_name WHERE NOT ('8:00:00' > Table.endtime OR '9:40:00' < Table.starttime) Reference: http://stackoverflow.com/questions/ ...2015-01-24 14:20:22
PHP ใช้แปลง date เป็นเดือนไทย พ.ศ. $month_arr=array( "1"=>"มกราคม", "2"=>"กุมภาพันธ์", "3"=>"มีนาคม", ...2015-01-10 15:08:53
PHP remove text or not numbers from string preg_replace("/[^0-9]/","",'099-777-999xxx-abc55'); output: 09977799955 ...2014-09-26 16:42:14
php ใช้สำหรับลบ string ออกจากตัวเลข เหลือไว้แค่ ตัวเลข 0-9 และ จุดทศนิยม (.) เหมาะกับการนำไปทำ PHP Validation <?php $strNumber = "4/B.2T322,15T"; $number = preg_replace( ...2014-09-23 15:01:08
PHP strip_tags เป็นฟังก์ชั่นตัด html tag ให้เหลือไว้เพียง Content text ที่อยู่ภายใน tag นั้น <?php $text = '<p>Test paragraph + <span style="color:red">Read more</span></p> <a href="#"><b>link</b></a>'; echo ...2014-07-23 14:54:36
PHP ฟังก์ชั่น หาจำนวนวัน จาก 2 Date function datediff ( $start, $end ) { $datediff = strtotime(dateform($end)) - strtotime(dateform($start)); return floor($datediff / (60 * 60 * 24)); } function ...2014-06-20 11:45:55
sql สำหรับแบ่งหน้าข้อมูล record จากฐานข้อมูล Oracle Example: SELECT outer.* FROM (SELECT ROWNUM rn, inner.* FROM ( SELECT e.* FROM employee e ORDER BY hiredate) inner) outer WHERE ...2013-03-27 15:33:51
วิธีการ query ข้อมูลโดยเปรียบเทียบจากวันที่ DateTime ในฐานข้อมูล Mssql (Date only) ตัวอย่าง SELECT * FROM table WHERE convert(char(10), Field_date , 103) = '20/12/2013' ซึ่งเลข 103 คือ format แบบ d/m/Y อ้างอิงจาก: http://www.w3schools.com/sql/func_convert.asp ...2013-03-11 15:13:51
javascript แบบ inline สำหรับการใช้งาน เปลี่ยน address ไปยังหน้าเพจที่ต้องการ ด้วยการใช้ select box และ onchange event ตัวอย่าง <select onchange='document.location.href=this.options[this.selectedIndex].value;'> <option ...2013-02-28 12:11:46
ปัญหานี้เกิดขึ้นจากการวางคำสั่งไว้ใน $().ready(function() { ... } ซึ่งจะสามารถทำงานได้ครั้งเดียวที่โหลดเพจขึ้นมา แต่ถ้ามีการเขียน เปลี่ยนแก้ไข html แบบ dynamic โดยใช้ innerText innerHtml , ajax หรือพวก open popup แล้วจะกลับมาทำงานในหน้า window.opener ซึ่งบางงาน ...2013-02-12 17:50:31
คำสั่ง SQL ใช้สำหรับเรียกดูข้อมูล ที่มีค่าที่สูงที่สุด ในแต่ละ group ตัวอย่าง. การหาค่าเฉลี่ยของเงินเดือนที่สูงสุดในแต่ละแผนก SELECT Department,max(avg_sal) FROM ( SELECT Department,avg(salary) as avg_sal FROM employee GROUP ...