This file contains 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 | |
// store in App/Model/Book.php | |
App::uses('AppModel', 'Model'); | |
class Book extends AppModel | |
{ | |
public $useTable = false; | |
} |
This file contains 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> | |
<div class="control-group"> | |
<label for="name" class="control-label">Name</label> | |
<div class="controls"> | |
<input type="text" name="name" id="name" class="required" /> | |
</div> | |
</div> | |
<div class="control-group"> | |
<div class="controls"> |
This file contains 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 | |
// filename: user_group.class.php | |
class UserGroup extends ADODB_Active_Record { | |
public $_table = 'osa_user_groups'; | |
} |
This file contains 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 | |
spl_autoload_register('seed_autoload'); | |
function seed_autoload($class_name) { | |
$the_class_name = from_camel_case($class_name); | |
if(file_exists(MODEL_DIR .'/' .$the_class_name .'.class.php')) | |
require_once MODEL_DIR .'/' .$the_class_name .'.class.php'; | |
} |
This file contains 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 | |
// the Controller | |
class EnquiriesController extends AppController { | |
function junk() { | |
$this->paginate = array('junk'); | |
$this->set('junk', $this->paginate()); | |
} | |
} |
This file contains 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 | |
// the Model | |
class Enquiry extends AppModel { | |
public $_findMethods = array('junk' => true); | |
protected function _findJunk($state, $query, $results = array()) { | |
if ($state == 'before') { | |
$query['conditions']['Enquiry.mailbox'] = 'JUNK'; | |
return $query; |
This file contains 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
jQuery(function() { | |
current_page = $("div.pagination ul li.current").html(); | |
$('div.pagination ul li.current').addClass('active').html("<span>"+current_page+"</span>"); | |
var prev = $("li.prev"); | |
var prev_txt = $("li.prev").text(); | |
var new_prev = ($("li.prev").hasClass("disabled") == true) ? $("li.prev").html("<span>previous</span>") : prev.html(); | |
var next = $("li.next"); | |
var next_txt = $("li.next").text(); |
This file contains 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(){ | |
var dates = $('#ClaimClaimFrom, #ClaimClaimTo').datepicker({ | |
defaultDate: "-2w", | |
dateFormat: 'yy-mm-dd', | |
changeMonth: true, | |
firstDay: 1, | |
onSelect: function(selectedDate) { | |
var option = this.id == "ClaimClaimFrom" ? "minDate" : "maxDate", | |
instance = $(this).data('datepicker'), | |
date = $.datepicker.parseDate( |