Complex query not possible using Cakephp?

2013-08-08 Thread Pablito Pablito
Hello everyone,

I have a complex query for summarizing data that looks like:

$sql = 'SELECT
  severity,
  SUM( IF( c.name = "ABC", 1, 0 ) ) AS 
"ABC",
  SUM( IF( c.name = "XYZ", 1, 0 ) ) AS 
"XYZ",
FROM events s
INNER JOIN classes 
c ON c.id = s.class_id
group by severity
with rollup'


it generates partial totals for a list of items using row values, the query 
works perfect on the terminal.

The issue I'm having is that Cake's query() is overwritting results, I was 
trying to run a direct query using:

$db =& ConnectionManager::getDataSource('dbc');
$result = mysql_query($sql, $db->_connection ); 

but _connection() is protected.

Is there a way to override all of Cake's objects and just call 
mysql_query() / mysql_fetch_assoc() ? 


p.s.: this is just for some complex reports I have to build, for the rest 
I'm using cake's great Model objects :)

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.




Layout and

2013-04-30 Thread Pablito Pablito
Hello everyone,

I enabled the cache helper on one of my controllers and it's working 
perfectly with some major issue that has forced me to disable. I have in my 
default layout a call to include a file:

include "header.php"; it's the typical header with some static menues and a 
"sign in" link an there is where my problem starts, this link has the 
typical if() to checking for a user signed in and either show the sign in 
link or the user's name. I have added  &  tags 
around the whole  element holding that code but the view will 
not generate the different content. 

I have 
read http://book.cakephp.org/2.0/en/core-libraries/helpers/cache.html 
several times but I don't seem to figure out if something is wrong or what 
I want is not possible. 

Some extra details:

1) Configuration is ok, cached views are being stored on the tmp directory 
and they show an incredible speed increment. 
2) I tried clearing my browser cache and restarting the webserver. 

Can someone confirm if what I'm trying to achieve is possible?

cheers!

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Migrar Sistema CAKEPHP

2013-04-23 Thread Pablito Pablito
Depende la version. Si estas en la misma major version, no es mucho mas 
complejo que actualizar tu lib/Cake y ver la guia que los devs de Cakephp 
publican con cada update. Si estas en 1.3 a 2.3 o cuando salga la version 3 
seguro los cambios sean mayores. 

No es facil de responder la pregunta porque depende de los cambios que 
ocurran en el core de Cakephp. 

Saludos.


On Monday, April 22, 2013 6:38:00 PM UTC-3, MicLti wrote:
>
> Hola buen dia 
> Es dificil migrar un sistema de una version antigua a la mas nueva de 
> cakephp
> que componentes son los que mas cambian cuando salen nuevas versiones
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Ajax Login.

2013-03-18 Thread Pablito Pablito
I'm trying to use the Auth Component authentication working using ajax and 
I'm failing to do so. I can get it to work fine with its default 
functionality but what I need to do is to use a form that gets rendered on 
a page after certain actions and then use ajax to try to log the user in. 

Is there a way to just provide the username and password avoiding the 
rendering of the default cake's login form?

thanks in advance.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Auth Component; Strange behavior

2013-03-11 Thread Pablito Pablito
Still learning Cake but maybe you have some code conflicting with auth on 
your AppController beforeFilter? Happened to me when trying out the Auth 
component. 

Pablo.

On Monday, March 11, 2013 6:15:02 AM UTC-3, CrotchFrog wrote:
>
> Using Cake 2.2.5
>
> My app is exhibiting a strange behavior in one of my controller/views. I 
> have $this->Auth->allowedActions = array('view', 'index'); defined in the 
> beforeFilter of one of my controllers. When an authenticated user navigates 
> to the index view, Auth Component does not work on that page. Removing 
> 'index' from allowedActions gets Auth Component working but then does not 
> allow public access to that view. This is the only controller/view 
> exhibiting this behavior, all others work fine. 
>
> Any idea what could be going on here? 
>
> - ED 
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.