Skip to content

Instantly share code, notes, and snippets.

@evantishuk
evantishuk / or_where
Created April 11, 2012 02:37
or_where fiasco
if(is_array($status))
{
$or = null;
foreach($status as $s)
{
$orders->{"{$or}where"}('status', '=', $s);
$or = 'or_';
}
}
public function send_receipt_to_customer($order, $duplicate = false) {
$to = trim($order->billing_address->email);
$to = (filter_var($to, FILTER_VALIDATE_EMAIL)) ? $to : false;
$to = (Config::get('environment') == Fuel::DEVELOPMENT) ? debugEmailAddress : $to;
if($to)
{
$subject = ' receipt for your order';
$subject = $duplicate ? 'Duplicate'.$subject : 'A'.$subject;
syntax on
filetype on
" spaces instead of tabs
" prefer 2 spaces
set softtabstop=2
set tabstop=2
set shiftwidth=2
$("select")
.focus(function(){
$(this)
.data("origWidth", $(this).css("width"))
.css("width", "auto");
})
.blur(function(){
$(this)
.css("width", $(this).data("origWidth"));
});