This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Remove special character, only Allow alphabets and numbers | |
function vn_to_str($str) { | |
$unicode = array( | |
'a' => 'á|à|ả|ã|ạ|ă|ắ|ặ|ằ|ẳ|ẵ|â|ấ|ầ|ẩ|ẫ|ậ', | |
'd' => 'đ', | |
'e' => 'é|è|ẻ|ẽ|ẹ|ê|ế|ề|ể|ễ|ệ', | |
'i' => 'í|ì|ỉ|ĩ|ị', | |
'o' => 'ó|ò|ỏ|õ|ọ|ô|ố|ồ|ổ|ỗ|ộ|ơ|ớ|ờ|ở|ỡ|ợ', | |
'u' => 'ú|ù|ủ|ũ|ụ|ư|ứ|ừ|ử|ữ|ự', | |
'y' => 'ý|ỳ|ỷ|ỹ|ỵ', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create app with ui router | |
var app = angular.module('app', ['ui.router']); | |
// Controller | |
app.controller('indexCtrl', function ($scope, mainService) { | |
}); | |
// Service for PHP server | |
app.factory('mainService', function ($http) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Table | |
<table class="table table-hover"> | |
<thead> | |
<tr> | |
<th>Tiêu chí</th> | |
<th>Kết quả</th> | |
</tr> | |
</thead> | |
<tbody> | |
<tr> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set auto increment for uuid column | |
ALTER TABLE category | |
ADD CONSTRAINT DF_category_id DEFAULT newid() for id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Full calendar not display | |
--> add media="print" in <link rel .... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// include angular file upload (https://github.com/minhphong306/base_lib/blob/master/angular-file-upload/angular-file-upload.min.js) and ng-thumb | |
var app = angular.module('app', ['angularFileUpload']); | |
// Factory | |
app.factory('mainFactory', function ($http, $rootScope, $q, $log) { | |
var domain = "service/"; | |
var factory = {}; | |
factory.doAction = function (data, uri) { | |
return $http({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Form element (form group) | |
// input | |
<div class="form-group"> | |
<label class="control-label col-sm-3">Tên danh mục</label> | |
<div class="col-sm-9"> | |
<input ng-model="category.add_model.name" | |
type="text" class="form-control" | |
placeholder="Nhập tên danh mục" autofocus required> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Host name="expenditure.hihi" appBase="webapps/JSP-Expenditure-Management" | |
unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"> | |
<Alias>expenditure.hihi</Alias> | |
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" | |
prefix="localhost_access_log" suffix=".txt" | |
pattern="%h %l %u %t "%r" %s %b" /> | |
<Context path="" docBase="" | |
debug="0" reloadable="true"/> | |
</Host> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteEngine On | |
RewriteBase / | |
# Thay cái /webapp bằng thư mục bạn muốn chuyển | |
RewriteCond %{THE_REQUEST} /webapp/([^\s?]*) [NC] | |
RewriteRule ^ %1 [L,NE,R=302] | |
# Thay cả ở đây nữa nhá | |
RewriteRule ^(.*)$ webapp/index.php?$1 [L,QSA] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE IF NOT EXISTS `duplicate` ( | |
`inc_id` int(11) NOT NULL AUTO_INCREMENT, | |
`username` varchar(50) COLLATE utf8_vietnamese_ci NOT NULL, | |
`note` varchar(200) COLLATE utf8_vietnamese_ci DEFAULT NULL, | |
PRIMARY KEY (`inc_id`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_vietnamese_ci; |