From c8e29cc2c90dbf2c5cd3be0d62bf4d5b494803d8 Mon Sep 17 00:00:00 2001 From: Daniel Camargo Date: Fri, 3 May 2013 08:54:33 -0300 Subject: [PATCH] changed the giftcard getPagePiece to work at cockpit. --- include/controllers/default/cockpit/giftcards/index.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/controllers/default/cockpit/giftcards/index.php b/include/controllers/default/cockpit/giftcards/index.php index 8bc2e3d1c..a33c8fb3b 100644 --- a/include/controllers/default/cockpit/giftcards/index.php +++ b/include/controllers/default/cockpit/giftcards/index.php @@ -4,7 +4,7 @@ class Controller_giftcards extends Crunchbutton_Controller_Account { public function init() { c::view()->page = 'giftcards'; - if( c::getPagePiece(2) == 'new' ){ + if( c::getPagePiece(1) == 'new' ){ $id_user = $_GET[ 'id_user' ]; if( $id_user != '' ){ $user = Crunchbutton_User::o( $id_user ); @@ -31,15 +31,15 @@ class Controller_giftcards extends Crunchbutton_Controller_Account { c::view()->users = Crunchbutton_User::q('SELECT DISTINCT( u.id_user ), u.name, u.phone, u.email FROM user u INNER JOIN user_auth ua ON ua.id_user = u.id_user WHERE u.active = 1 ORDER BY u.name ASC');; c::view()->display('giftcards/new'); - } else if( c::getPagePiece(2) == 'sms' ){ + } else if( c::getPagePiece(1) == 'sms' ){ c::view()->display('giftcards/sms'); - } else if( c::getPagePiece(2) == 'email' ){ + } else if( c::getPagePiece(1) == 'email' ){ c::view()->display('giftcards/email'); } else { - $giftcard = Crunchbutton_Promo::o(c::getPagePiece(2)); + $giftcard = Crunchbutton_Promo::o(c::getPagePiece(1)); if ($giftcard->id_promo) { c::view()->users = Crunchbutton_User::q('SELECT u.id_user, u.name, u.phone, u.email FROM user u INNER JOIN user_auth ua ON ua.id_user = u.id_user WHERE u.active = 1 ORDER BY u.name ASC');; c::view()->giftcard = $giftcard;