2009-08-30 07:10:45 +00:00
< ? php defined ( " SYSPATH " ) or die ( " No direct script access. " )
/**
* Gallery - a web based photo album viewer and editor
* Copyright ( C ) 2000 - 2009 Bharat Mediratta
*
* This program is free software ; you can redistribute it and / or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation ; either version 2 of the License , or ( at
* your option ) any later version .
*
* This program is distributed in the hope that it will be useful , but
* WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the GNU
* General Public License for more details .
*
* You should have received a copy of the GNU General Public License
* along with this program ; if not , write to the Free Software
* Foundation , Inc . , 51 Franklin Street - Fifth Floor , Boston , MA 02110 - 1301 , USA .
*/
?>
2010-08-30 01:09:23 +00:00
< script >
var b , d ;
function previewImage ( element )
{
var ele = $ ( element ), i = $ ( document . createElement ( 'div' )), img = $ ( new Image ());
img . load ( function (){
var o = $ ( '<div></div>' ) . appendTo ( document . body ) . addClass ( 'ui-widget-overlay' ) . css ({ width : d . width (), height : d . height ()});
i . css ({ 'position' : 'absolute' , left : ( b . width () / 2 ) - ( this . width / 2 ), top : ( b . height () / 2 ) - ( this . height / 2 )}) . click ( function (){ i . remove (); o . remove ();}) . append ( img );
$ ( " body " ) . append ( i );
}) . attr ( 'src' , ele . attr ( 'href' ));
return false ;
}
$ ( window ) . load ( function (){
b = $ ( " body " ); d = $ ( " document " );
$ ( " #gBasketList " ) . find ( " .preview-image " ) . bind ( " click " , function (){ return previewImage ( this )});
});
</ script >
< div class = " g-block " >
< div class = " basketbuttons " >
2009-08-31 20:22:21 +00:00
< ? if ( isset ( $basket -> contents ) && count ( $basket -> contents ) > 0 ) : ?>
2009-08-30 07:10:45 +00:00
< script language = " JavaScript " >
2010-08-30 01:09:23 +00:00
$ ( document ) . ready ( function (){
$ ( " #pickup " ) . click ( function (){
if ( this . checked )
{
window . location = " <?= url::site( " basket / view_basket / nopp " ) ?> " ;
}
else
{
window . location = " <?= url::site( " basket / view_basket / ppon " ) ?> " ;
}
});
})
</ script >
2009-08-30 07:10:45 +00:00
< a href = " <?= url::site( " basket / checkout " ) ?> "
2010-08-30 01:09:23 +00:00
class = " right g-button ui-state-default ui-corner-all ui-icon-right " >
2009-08-30 07:10:45 +00:00
< span class = " ui-icon ui-icon-arrow-1-e " ></ span >< ? = t ( " Proceed to Checkout " ) ?> </a>
2009-08-31 20:22:21 +00:00
< ? endif ; ?>
2010-08-30 01:09:23 +00:00
</ div >
< div class = " g-block-content scrollable " >
2009-08-30 07:10:45 +00:00
< ? if ( isset ( $basket -> contents ) && count ( $basket -> contents ) > 0 ) : ?>
< table id = " gBasketList " >
< tr >
< th >< ? = t ( " Picture " ) ?> </th>
< th >< ? = t ( " Product " ) ?> </th>
< th >< ? = t ( " Quantity " ) ?> </th>
< th >< ? = t ( " Cost " ) ?> </th>
< th >< ? = t ( " Actions " ) ?> </th>
</ tr >
< ? $total = 0 ; ?>
< ? foreach ( $basket -> contents as $key => $prod_details ) : ?>
< tr id = " " class = " <?= text::alternate( " gOddRow " , " gEvenRow " ) ?> " >
< td id = " item-<?= $prod_details->item ?> " class = " core-info " >
< ? $item = $prod_details -> getItem (); ?>
< div id = " basketThumb " >
2010-08-30 01:09:23 +00:00
< a href = " <?= $item->resize_url ()?> " class = " preview-image " >
2009-08-30 07:10:45 +00:00
< img src = " <?= $item->thumb_url ()?> " title = " <?= $item->title ?> " alt = " <?= $item->title ?> " />
2010-08-30 01:09:23 +00:00
</ a >
2009-08-30 07:10:45 +00:00
</ div >
</ td >
< td >
2009-08-31 20:22:21 +00:00
< ? = html :: clean ( $prod_details -> product_description ()) ?>
2009-08-30 07:10:45 +00:00
</ td >
< td >
2009-08-31 20:22:21 +00:00
< ? = html :: clean ( $prod_details -> quantity ) ?>
2009-08-30 07:10:45 +00:00
</ td >
< td >
< ? $total += $prod_details -> cost ?>
2010-08-30 01:09:23 +00:00
< ? = basket :: formatMoneyForWeb ( $prod_details -> cost ); ?>
2009-08-30 07:10:45 +00:00
</ td >
2010-08-30 01:09:23 +00:00
< td class = " g-actions " >
2009-08-30 07:10:45 +00:00
< a href = " <?= url::site( " basket / remove_item / $key " ) ?> "
2010-08-30 01:09:23 +00:00
class = " g-button ui-state-default ui-corner-all ui-icon-left " >
2009-08-30 07:10:45 +00:00
< span class = " ui-icon ui-icon-trash " ></ span >< ? = t ( " Remove " ) ?> </a>
</ td >
</ tr >
< ? endforeach ?>
2009-09-29 22:42:17 +00:00
< ? $postage = $basket -> postage_cost (); ?>
< ? if ( $postage > 0 ) : ?>
2010-08-30 01:09:23 +00:00
< tr class = " <?= text::alternate( " gOddRow " , " gEvenRow " ) ?> " >
< td ></ td >< td ></ td >< td < ? = $basket -> ispp () ? " " : " style= \" text-decoration:line-through \" " ; ?> >Postage and Packaging</td><td <?=$basket->ispp()?"":"style=\"text-decoration:line-through\""; ?>><?= basket::formatMoneyForWeb($postage)?></td><td>
</ td >
2009-09-29 22:42:17 +00:00
</ tr >
2010-08-30 01:09:23 +00:00
< ? if ( basket :: isAllowPickup ()) : ?>
< tr class = " <?= text::alternate( " gOddRow " , " gEvenRow " ) ?> " >< td colspan = " 5 " >< input id = " pickup " type = " checkbox " < ? = $basket -> ispp () ? " " : " checked " ; ?> /> Select if you wish to pick up the photos.</td></tr>
2009-09-29 22:42:17 +00:00
< ? endif ; ?>
2010-08-30 01:09:23 +00:00
< ? endif ; ?>
< tr class = " <?= text::alternate( " gOddRow " , " gEvenRow " ) ?> " >
< td ></ td >< td ></ td >< td > Total Cost </ td >< td id = " total " >< ? = $basket -> ispp () ? basket :: formatMoneyForWeb ( $total + $postage ) : basket :: formatMoneyForWeb ( $total ) ?> </td><td></td>
2009-08-30 07:10:45 +00:00
</ tr >
</ table >
2010-08-30 01:09:23 +00:00
2009-08-30 07:10:45 +00:00
< ? else : ?>
Shopping Basket is Empty
< ? endif ; ?>
</ div >
2010-08-30 01:09:23 +00:00
< div class = " basketbuttons " >
2009-08-31 20:22:21 +00:00
< ? if ( isset ( $basket -> contents ) && count ( $basket -> contents ) > 0 ) : ?>
2009-08-30 07:10:45 +00:00
< a href = " <?= url::site( " basket / checkout " ) ?> "
2010-08-30 01:09:23 +00:00
class = " right g-button ui-state-default ui-corner-all ui-icon-right " >
2009-08-30 07:10:45 +00:00
< span class = " ui-icon ui-icon-arrow-1-e " ></ span >< ? = t ( " Proceed to Checkout " ) ?> </a>
< ? endif ; ?>
2010-08-30 01:09:23 +00:00
</ div >
2009-08-30 07:10:45 +00:00
</ div >