hoanbn | October 29, 2008
Việc phân trang trong cakephp 1.1 đã được tôi đề cập ở bài trước vì vậy tôi sẽ không hướng dẫn chi tiết các bạn cách làm phân trang trong cakephp 1.1 nữa. Các bạn có thể xem lại tại http://i-php.net/2008/10/pagination-phan-trang-trong-cakephp-11x/. Ở bài viết này tôi chỉ đi hướng dẫn cách phân trang khi tìm [...]
Category: CakePHP, php |
No Comments »
Tags: CakePHP, paging, phantrang
hoanbn | October 28, 2008
Như chúng ta đã biết, cakephp viết theo mô hình MVC, do vậy khi ta viết các đoạn lệnh của chương trình chủ yếu chúng ta chỉ viết ở các thư mục trong app như model, controller, views, component(trong controller) và helper (trong views). Các file source chủ yếu sẽ được viết trên các thư [...]
Category: CakePHP, php |
No Comments »
Tags: bootstrap, CakePHP
chaubl | October 28, 2008
Convert ‘23/12/1988′ to ‘1988/12/23′
function toYMDDate($mdyDate)
{
$mdyDate = explode(“/”,$mdyDate);
krsort($mdyDate);
return implode(“/”,$mdyDate);
}
Category: mysql, php |
No Comments »
Tags: convert date, SQL Date
habogay | October 28, 2008
1.Request bluehost cho access bằng ssh
2.Tiến hành connect lên server bằng ssh client (PuTTY,Bitvise)
3.Các bước cài đặt :
~$mkdir _src
~$cd _src
_src$wget http://subversion.tigris.org/downloads/subversion-1.4.6.tar.gz
_src$wget http://subversion.tigris.org/downloads/subversion-deps-1.4.6.tar.gz
_src$tar -xzvf subversion-1.4.6.tar.gz
_src$tar -xzvf subversion-deps-1.4.6.tar.gz
_src$cd subversion-1.4.6
_src/subversion-1.4.6$cd apr
_src/subversion-1.4.6/apr$./configure –enable-shared –prefix=$HOME
_src/subversion-1.4.6/apr$make && make install
_src/subversion-1.4.6/apr$cd ../apr-util
_src/subversion-1.4.6/apr-util$./configure –enable-shared –prefix=$HOME \
–with-expat=builtin –with-apr=$HOME \
–without-berlekey-db
_src/subversion-1.4.6/apr-util$make && make install
_src/subversion-1.4.6/apr-util$cd ../neon
_src/subversion-1.4.6/neon$EXTRA_CFLAGS=”-L/usr/lib64 -fPIC”
_src/subversion-1.4.6/neon$CFLAGS=”-L/usr/lib64 -fPIC”
_src/subversion-1.4.6/neon$./configure [...]
Category: svn |
No Comments »
Tags:
chaubl | October 28, 2008
Returning TOP Records
Microsoft SQL Server
SELECT TOP 10 column FROM table
MySQL
SELECT column FROM table LIMIT 10
Returning TOP PERCENT Records
Microsoft SQL Server
SELECT TOP 50 PERCENT * FROM table
MySQL
SELECT @percentage := ROUND(COUNT(*) * 50/100) FROM table;
PREPARE STMT FROM ‘SELECT * FROM table LIMIT ?’;
EXECUTE STMT USING @percentage;
Category: mysql |
No Comments »
Tags: mssql, mysql, select, sql
habogay | October 28, 2008
preg_match_all(‘/(href=)(.*?)(“)/i’,$response,$patterns);
var_dump($patterns[2]);
Category: php |
No Comments »
Tags: preg_match
habogay | October 28, 2008
http://i-php.net/flex/Survey.swf
Category: flex |
1 Comment »
Tags: drag-drop, flex, keo tha
tuannh | October 25, 2008
doremi
- Xác định ngày đầu tuần (thứ 2)
<?php
$date_time = getdate();
$day = $date_time['wday']-1;
$date = new DateTime($date_time['mday'].’-’.$date_time['mon'].’-’.$date_time['year']);
$date->modify(“-{$day} day”);
return $date->format(“Y-m-d”);
?>
Hoặc :
<?php
$day = date(‘d-m-Y’, strtotime(“last Monday”));
echo $day;
?>
Để tìm ngày thứ 2 của tuần tiếp theo thì thay ‘last’ bằng ‘next’.
Để xác định ngày hiện tại và ngày đầu tuần cách nhau bao nhiêu ngày ta dùng hàm sau [...]
Category: php |
No Comments »
Tags:
habogay | October 19, 2008
http://code.google.com/p/phptraining/source/browse/trunk/download_limited.php
Category: Uncategorized |
No Comments »
Tags: php limit download speed
hoanbn | October 16, 2008
Đối với cakephp 1.1.x, hiện tại chưa hỗ trợ sẵn việc phân trang giống như trong cakephp 1.2. Đối với cakephp 1.2 bạn chỉ việc dùng sẵn helper là có thể phân trang được. Với bản cakephp 1.1 việc phân trang sẽ do chúng ta tự làm. Sau đây tôi xin hướng dẫn các bạn [...]
Category: CakePHP |
No Comments »
Tags: