Category Archives: Web Tools

SendGrid API Example

Doc: https://github.com/sendgrid/sendgrid-php

Complete example:
https://github.com/sendgrid/sendgrid-php/blob/master/USE_CASES.md#attachments

Example:

 

TCPDF

Doc: https://tcpdf.org/docs/srcdoc/tcpdf/class-TCPDF/

Note:

  • HTML裡面的圖片網址一定要是完整路徑,不能是localhost, 否則輸出會有”unable to get the size of the image” error
    crontab執行的時候,base_url()就是抓到localhost,所以要注意

Example:

 

Reference:

Localization of datatable

Localization file:

Sample code:

Display priority:

  1. Localization file
  2. paginate option
  3. aria

Reference:

PHPexcel: Error loading file “uploaded_order.xls”: Unknown codepage: 10002

Error loading file “uploaded_order.xls”: Unknown codepage: 10002

Reason: This file could made on Mac and cause some identify issue.

Solution:

Add this line in PHPExcel/Shared/CodePage.php

Reference:

Filezilla Server Connection Issue

How to fix “Can’t open data connection for transfer of “/”” error when connecting to a FTP server with Filezilla server.

  1. Change Filezilla server setting
    Settings -> Passive mode settings -> Use custom port range
    6000-6010
  2. Create a new inbound rule in Windows Firewall for above port range

Reference:

Datatable Server Side Processing

Javascript:

Server:

 

Update Excel Content

 

Set cell value as string

Select All Checkboxes

Reference: