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
protected function _getStackTrace(Exception $e) { | |
$trace = $e->getTrace(); | |
$out = array(); | |
foreach ($trace as $frame) { | |
if (isset($frame['file']) && isset($frame['line'])) { | |
if (strpos($frame['file'], 'app') !== false){ | |
$basename = '<span style = "color: green;text-transform:none;font-size:12px">' . basename($frame['file']) . '</span>'; | |
}else{ | |
$basename = basename($frame['file']); | |
} |
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
SELECT * | |
FROM `table` | |
WHERE `TableID` NOT IN ( | |
SELECT `table`.`TableID` | |
FROM `table` JOIN `reservation_table` | |
WHERE `reservation_table`.`TableID` = `table`.`TableID` | |
&& `reservation_table`.`DateTime` > NOW() | |
&& `reservation_table`.`DateTime` < ( NOW() + INTERVAL 2 HOUR ) | |
) |
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
<?php | |
#Put `AppUsersController.php` in `app/Controller` | |
App::uses('UsersController', 'Users.Controller'); | |
class AppUsersController extends UsersController { | |
public function beforeFilter() | |
{ |
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
<?php | |
/** | |
* Copyright 2007-2010, Cake Development Corporation (http://cakedc.com) | |
* | |
* Licensed under The MIT License | |
* Redistributions of files must retain the above copyright notice. | |
* | |
* @copyright Copyright 2007-2010, Cake Development Corporation (http://cakedc.com) | |
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) |
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
class Article extends ArticlesAppModel { | |
var $belongsTo = array( | |
'ArticlesCategory' => array( | |
'className' => 'Articles.ArticlesCategory', | |
'foreignKey' => 'articles_category_id' | |
) | |
, 'User'); | |
var $hasOne = array('Avatar' => array('className' => 'Image', 'foreignKey' => 'model_id', 'conditions' => array('Avatar.type' => 'hasOne', 'Avatar.model' => 'Article'))); | |
} |
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
$(function(){ | |
$("#flashMessage,#authMessage").hide(); | |
// $("#flashMessage").css('left', ( $(window).width()-$("#flashMessage").outerWidth()) /2 ); | |
$("#flashMessage,#authMessage").css('top', 0).css('left',0); | |
$("#flashMessage,#authMessage").slideDown('fast'); | |
setTimeout(function(){ | |
$("#flashMessage,#authMessage").slideUp('slow') | |
},10000); | |
// $(":submit").click(function(){ | |
// $(this).closest("form").submit(); |
NewerOlder