Re: How can i hide the cakephp .ctp extension

2011-01-27 Thread Narendra Padala
thanks
On Thu, Jan 27, 2011 at 3:08 PM, Joshua Muheim  wrote:

> Hey Narendra
>
> I guess you are very new to CakePHP? .ctp extensions are never shown
> to the end user, they are only used by CakePHP internally.
>
> I guess you should take a look at the CakePHP book first...
> http://book.cakephp.org/view/1078/Views
>
> Have fun!
>
> On Thu, Jan 27, 2011 at 10:32 AM, Narendra Padala
>  wrote:
> > Hi...Flocks
> >
> >
> > Problem:
> > I have the following URLs for my website:
> >
> > www.example.com/services.ctp
> >
> > However, i would like to hide file extensions from the end users, and
> > allow them to access to the files using the following URLs:
> >
> > www.example.com/services
> >
> >
> > Can u please explain me, how can i do this.
> >
> > --
> > Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> > Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
> >
> >
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.comFor
> >  more options, visit this group at
> http://groups.google.com/group/cake-php
> >
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


How can i hide the cakephp .ctp extension

2011-01-27 Thread Narendra Padala
Hi...Flocks


Problem:
I have the following URLs for my website:

www.example.com/services.ctp

However, i would like to hide file extensions from the end users, and
allow them to access to the files using the following URLs:

www.example.com/services


Can u please explain me, how can i do this.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: compleax query

2010-06-22 Thread Narendra Padala
Hi flocks,
I am also new to cakephp ..is there any mistake excuse, try like
this,

$campaign_store_dates = $this->CampaignStoreDate->find('all',
   array('joins' =>
array(array( 'table' => 'stores',
   'alias' =>
's',
   'type' =>
'left',
 
'foreignKey' => false,
 
'conditions'=> array('AND'=>array(
'CampaignStoreDate.campaign_id = s.store_id',
's.store_id=CampaignStoreDate.campaign_id';



On Jun 22, 12:23 pm, Jeremy Burns | Class Outfit
 wrote:
> Are you using the containable behaviour (highly recommended)? If so:
>
> $results = $this->CampaignStoreDate->find(
>         'all',
>         array(
>                 'contain' => array(
>                         'Campaign',
>                         'Store'
>                 ),
>                 'fields' => array(
>                         'Model.fieldname',
>                         etc...
>                 )
>         )
> );
>
> Jeremy Burns
> Class Outfit
>
> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> On 22 Jun 2010, at 08:07, rakeshyadav rakeshyadav wrote:
>
> > Hi all,
>
> >       Any body tell me the required cakephp query for below SQL query
>
> >       SELECT *
> > FROM campaign_store_dates cd, campaigns c, stores s
> > WHERE (
> > c.campaign_id = cd.campaign_id
> > AND s.store_id = cd.store_id
> > )
>
> > Thanks in advance,
> > Rakesh
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others 
> > with their CakePHP related questions.
>
> > You received this message because you are subscribed to the Google Groups 
> > "CakePHP" group.
> > To post to this group, send email to cake-php@googlegroups.com
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Internationalizing the Application

2010-06-21 Thread Narendra Padala
Hi all,

I am new to cakephp. But have implemented so many cakephp concepts.
Now I want to implement internationalization to my application.
I dont know wat to use. i18n, p28n or l10n.
I even dont the difference between them.

I was read the below articles but i didn't get,

http://book.cakephp.org/view/163/Localization-in-CakePHP
http://bakery.cakephp.org/articles/view/p28n-the-top-to-bottom-persistent-internationalization-tutorial
http://book.cakephp.org/view/162/Internationalizing-Your-Application

Please give me one sample so that I can continue with it for my modules.
Thanks in advance.



Regards,
Narendra

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: i was defined one global variable in core.php how can i use that variable in my app controller

2010-06-18 Thread Narendra Padala
Sir why it will not work "constant" variable declared in core.php file, for
themes, why i am going for Configure::write('xxx', 'blue');  ,
Configure::read('xxx')  and bootstrap.php,   is there any reason to go for
this.  Let me know?

On Tue, Jun 15, 2010 at 11:33 PM, cricket  wrote:

> On Jun 15, 8:11 am, Narendra Padala  wrote:
> > Hi all I am new to cake php,
> >
> > I am created some themes like red, green blue etc.
> >
> > i have to use these themes in my appliaction.
> >
> > so i defined in my app controller like this
> >
> > var $view = 'Theme';
> > var $theme = 'black'; // here i need global value.
> >
> > this value i have to set in the core .php
> >
> > like this i wrote
> >
> > define('', 'blue');
> >
> > now i need use the '' value to
> >
> > var $theme = $''  // here how can i use.
> >
> > Please any one can help me out to solove this problem
>
> I would use bootstrap.php, not core.php. And, instead of define(), I'd
> do:
>
> Configure::write('xxx', 'blue');
>
> In AppController, use Configure::read('xxx') to get the value.
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


i was defined one global variable in core.php how can i use that variable in my app controller

2010-06-15 Thread Narendra Padala
Hi all I am new to cake php,

I am created some themes like red, green blue etc.

i have to use these themes in my appliaction.

so i defined in my app controller like this

var $view = 'Theme';
var $theme = 'black'; // here i need global value.


this value i have to set in the core .php

like this i wrote

define('', 'blue');


now i need use the '' value to

var $theme = $''  // here how can i use.


Please any one can help me out to solove this problem


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


problem in inserting data into PostgresSql

2010-06-09 Thread Narendra Padala
Hi, I am new to cake php, i am using postgres db, i don't have any
permissions to change the db. when i am creating the register page  the
following error was shown ,  i wrote code like this.


This is my table in db


Table "public.tbluser"
 Column |  Type  |
Modifiers
++-
 lnguser| integer| not null default
nextval(('"tbluser_lnguser_seq"'::text)::regclass)
 strfname   | character varying(100) | not null
 strlname   | character varying(100) | not null
 struid | character varying(100) | not null
 strpid | character varying(100) | not null
 lnguser_group  | integer| not null
 strtelarea | character varying(20)  |
 strtelno   | character varying(20)  |
 stremail   | character varying(100) |
 struserconfirm | character varying(100) |
 dtmregistered  | date   |
 dtmapproved| date   |
 blnchatuser| bit(1) |
Indexes:
"tbluser_pkey" PRIMARY KEY, btree (lnguser)



register.ctp
-
Create an Account

create('Tbluser', array('controller' => 'tblusers', 'action'
=> 'register'));

echo $form->input('strfname', array('type' => 'text',
  'label' => 'First Name :'));

echo $form->input('strlname', array('type' => 'text',
  'label' => 'Last Name :'));

echo $form->input('struid', array('type' => 'text',
  'label' => 'User Name :'));

echo $form->input('strpid', array('type' => 'password',
  'label' => 'Password :'));

echo $form->input('stremail', array('type' => 'text',
  'label' => 'Email :'));

echo $form->hidden('lnguser_group', array('value' => 13));


echo $form->submit('Create Account');

echo $form->end();
?>

---
register method in controller
--
function register() {

// If the user submitted the form…
if (!empty($this->data)) {


   // echo $strpid=$this->data['Tbluser']['strpid'];

$this->Tbluser->create();

$this->Tbluser->save($this->data);

$this->redirect(array('action' => 'login'));

}
}

---

Error


*Warning* (2) : pg_query() [function.pg-query
]: Query failed: ERROR:  invalid
input syntax for integer: "nextval(('"tbluser_lnguser_seq"'"
[*CORE/cake/libs/model/datasources/dbo/dbo_postgres.php*, line *155*]
*Warning* (512) : *SQL Error:* ERROR:  invalid
input syntax for integer: "nextval(('"tbluser_lnguser_seq"'"
[*CORE/cake/libs/model/datasources/dbo_source.php*, line *526*]

Code  | Context 

$sql=   "INSERT INTO "tbluser" ("lnguser", "strfname", "strlname",
"struid", "strpid", "stremail", "lnguser_group") VALUES
('nextval((''"tbluser_lnguser_seq"''', 'satya', 'satya', 'satya',
'2768113314c97c6bdb22c8ce5c1c74b14c1b5462', 'satya', '1')"
$error  =   "ERROR:  invalid input syntax for integer:
"nextval(('"tbluser_lnguser_seq"'""
$out=   null

$out = null;if ($error) {
trigger_error("SQL
Error: {$this->error}", E_USER_WARNING);

DboSource::showQuery() -
CORE/cake/libs/model/datasources/dbo_source.php, line 526
DboSource::execute() - CORE/cake/libs/model/datasources/dbo_source.php, line 202
DboSource::create() - CORE/cake/libs/model/datasources/dbo_source.php, line 586
Model::save() - CORE/cake/libs/model/model.php, line 1287
TblusersController::register() -
APP/controllers/tblusers_controller.php, line 40
Object::dispatchMethod() - CORE/cake/libs/object.php, line 115
Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 226
Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 193
[main] - APP/webroot/index.php, line 87

*Query:* INSERT INTO "tbluser" ("lnguser", "strfname", "strlname", "struid",
"strpid", "stremail", "lnguser_group") VALUES
('nextval((''"tbluser_lnguser_seq"''', 'satya', 'satya', 'satya',
'2768113314c97c6bdb22c8ce5c1c74b14c1b5462', 'satya', '1')

*Warning* (2) : Cannot modify header information
- headers already sent by (output started at
/var/www/wizard_auth/cake/basics.php:108)
[*CORE/cake/libs/controller/controller.php*, line *646*]



Please any one can help me out how to solove this problem...!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed t

Re: problem in auth component when i was creating a login controller.

2010-06-08 Thread Narendra Padala
Thanks sir,
its working fine.!

On Tue, Jun 8, 2010 at 8:40 PM, calvin  wrote:

> Don't post the same question twice, please. You already had people
> helping you with this in the other thread.
>
> On Jun 8, 4:16 am, Narendra Padala  wrote:
> > Hi i am new to cake php, when i am  creating a login authentication using
> > app controller the following error was showed so please help me out. here
> > data base i am using postgress sql, here i dont have permission to
> chanage
> > the databse.
> >
> > this is app_controller.php
> > --
> >
> >  >
> > class AppController extends Controller {
> >
> > var $components = array('Auth', 'RequestHandler');
> >
> > var $uses = array ('Tbluser') ;
> >
> > var $helpers = array('Javascript','Html','Form','Ajax');
> >
> > function beforeFilter(){
> >
> > $this->Auth->loginAction = array('admin' => false, 'controller'
> =>
> > 'tblusers', 'action' => 'login');
> >
> > $this->Auth->authError = "Sorry, you are lacking access.";
> >
> > $this->Auth->loginError = "No, you fool! That's not the right
> > password!";
> >
> > $this->Auth->userModel = 'Tbluser';
> >
> > $this->Auth->authorize = 'tblusers';
> >
> > $this->Auth->fields = array('username' => 'struid', 'password' =>
> > 'strpid');
> >
> > $this->Auth->allow('login');
> >
> > $username = $this->Auth->user('struid');
> >
> > $id = $this->Auth->user('lnguser');
> >
> > $this->set('userId', $this->Auth->user('lnguser'));
> >
> > $this->Auth->loginRedirect = array('controller' => 'tblusers',
> > 'action' => 'index');
> >
> > }
> >
> > function isAuthorized() {
> > return true;
> > }
> >
> > }
> >
> > ?>
> >
> > Error Message :
> > 
> >
> > *Warning* (512) : Auth::isAuthorized() -
> > $authorize is set to an incorrect value.  Allowed settings are:
> > "actions", "crud", "model" or null.
> > [*CORE/cake/libs/controller/components/auth.php*, line *525*]
> > *Warning* (2) : Cannot modify header information
> > - headers already sent by (output started at
> > /var/www/wizard_auth/cake/basics.php:108)
> > [*CORE/cake/libs/controller/controller.php*, line *646*]
> >
> > Please any one can help me out...thanks in advance..!
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


problem in auth component when i was creating a login controller.

2010-06-08 Thread Narendra Padala
Hi i am new to cake php, when i am  creating a login authentication using
app controller the following error was showed so please help me out. here
data base i am using postgress sql, here i dont have permission to chanage
the databse.


this is app_controller.php
--

Auth->loginAction = array('admin' => false, 'controller' =>
'tblusers', 'action' => 'login');

$this->Auth->authError = "Sorry, you are lacking access.";

$this->Auth->loginError = "No, you fool! That's not the right
password!";

$this->Auth->userModel = 'Tbluser';

$this->Auth->authorize = 'tblusers';

$this->Auth->fields = array('username' => 'struid', 'password' =>
'strpid');

$this->Auth->allow('login');

$username = $this->Auth->user('struid');

$id = $this->Auth->user('lnguser');

$this->set('userId', $this->Auth->user('lnguser'));

$this->Auth->loginRedirect = array('controller' => 'tblusers',
'action' => 'index');

}

function isAuthorized() {
return true;
}

}
?>


Error Message :


*Warning* (512) : Auth::isAuthorized() -
$authorize is set to an incorrect value.  Allowed settings are:
"actions", "crud", "model" or null.
[*CORE/cake/libs/controller/components/auth.php*, line *525*]
*Warning* (2) : Cannot modify header information
- headers already sent by (output started at
/var/www/wizard_auth/cake/basics.php:108)
[*CORE/cake/libs/controller/controller.php*, line *646*]


Please any one can help me out...thanks in advance..!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: How to create login page using app_controller.php

2010-06-08 Thread Narendra Padala
I was changed some changes in my app controller after that i got this error
message

this is code what i am wrote
--
app_controller.php
---
Auth->userModel = 'Tbluser';

$this->Auth->authorize = 'tblusers';

$this->Auth->fields = array('username' => 'struid', 'password' =>
'strpid');

$this->Auth->allow('login');

$username = $this->Auth->user('struid');

$id = $this->Auth->user('lnguser');

$this->set('userId', $this->Auth->user('lnguser '));

$this->Auth->loginRedirect = array('controller' => 'tblusers',
'action' => 'index');

}

function isAuthorized() {

 return true;

 }
}
?>


Erros:

*Warning* (512) : Auth::isAuthorized() -
$authorize is set to an incorrect value.  Allowed settings are:
"actions", "crud", "model" or null.
[*CORE/cake/libs/controller/components/auth.php*, line *525*]

Code  | Context 

$type   =   "tblusers"
$object =   null
$user   =   array(
"Tbluser" => array(
"lnguser" => "35",
"strfname" => "d",
"strlname" => "",
"struid" => "admin",
"lnguser_group" => "13",
"strtelarea" => null,
"strtelno" => "dd",
"stremail" => "dd",
"struserconfirm" => null,
"dtmregistered" => null,
"dtmapproved" => null,
"blnchatuser" => null
)
)
$valid  =   false

break;default:
trigger_error(__('Auth::isAuthorized() - $authorize is set to an
incorrect value.  Allowed settings are: "actions", "crud", "model" or
null.', true), E_USER_WARNING);

AuthComponent::isAuthorized() -
CORE/cake/libs/controller/components/auth.php, line 525
AuthComponent::startup() -
CORE/cake/libs/controller/components/auth.php, line 400
Component::startup() - CORE/cake/libs/controller/component.php, line 111
Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 209
Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 193
[main] - APP/webroot/index.php, line 87

*Warning* (2) : Cannot modify header information
- headers already sent by (output started at
/var/www/wizard_auth/cake/basics.php:108)
[*CORE/cake/libs/controller/controller.php*, line *646*]








Code  | Context 

$type   =   "tblusers"
$object =   null
$user   =   array(
"Tbluser" => array(
"lnguser" => "35",
"strfname" => "d",
"strlname" => "",
"struid" => "admin",
"lnguser_group" => "13",
"strtelarea" => null,
"strtelno" => "dd",
"stremail" => "dd",
"struserconfirm" => null,
"dtmregistered" => null,
"dtmapproved" => null,
"blnchatuser" => null
)
)
$valid  =   false

break;default:
trigger_error(__('Auth::isAuthorized() - $authorize is set to an
incorrect value.  Allowed settings are: "actions", "crud", "model" or
null.', true), E_USER_WARNING);

AuthComponent::isAuthorized() -
CORE/cake/libs/controller/components/auth.php, line 525
AuthComponent::startup() -
CORE/cake/libs/controller/components/auth.php, line 400
Component::startup() - CORE/cake/libs/controller/component.php, line 111
Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 209
Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 193
[main] - APP/webroot/index.php, line 87

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: How to create login page using app_controller.php

2010-06-07 Thread Narendra Padala
its not at all showing the index page, its back to the login page only
in the debugger no wuery also executed


On Tue, Jun 8, 2010 at 12:07 PM, Jeremy Burns  wrote:

> What errors are you getting?
>
> Jeremy Burns
> jeremybu...@me.com 
>
>
> On 8 Jun 2010, at 07:28, Narendra Padala wrote:
>
> Hi am new to cakephp, i am using postgress sql database this is an existing
> database here i am not having permissions to change any thing in database.
> but i have to wrote user authentication using app_controller.php
> so tried to wrote code like this but it was not working properly please any
> one can help me out to solve this problem.
>
>
> -
> Database table:
> -
> table name: tbluser
> -
>
>
>  Column |  Type  |
> Modifiers
>
> ++-
>  lnguser| integer| not null default
> nextval(('"tbluser_lnguser_seq"'::text)::regclass)
>  strfname   | character varying(100) | not null
>  strlname   | character varying(100) | not null
>  struid | character varying(100) | not null
>  strpid | character varying(100) | not null
>  lnguser_group  | integer| not null
>  strtelarea | character varying(20)  |
>  strtelno   | character varying(20)  |
>  stremail   | character varying(100) |
>  struserconfirm | character varying(100) |
>  dtmregistered  | date   |
>  dtmapproved| date   |
>  blnchatuser| bit(1) |
> Indexes:
> "tbluser_pkey" PRIMARY KEY, btree (lnguser)
>
>
> 
> Model : tbluser.php
> 
> 
> class Tbluser extends AppModel {
>
> var $useTable = 'tbluser';
> }
> ?>
>
>
>
> -
> Controller : tblusers_controller.php
> -
> 
> class TblusersController extends AppController {
>
> var $name = "Tblusers";
>
> var $uses = array('Tbluser');
>
> var $helpers = array('Html', 'Form');
>
> function login() {
>
> }
>
> function index() {
>
> }
> function logout() {
>
> $this->Session->setFlash('Successfully logout');
>
> $this->redirect($this->Auth->logout());
> }
>
>
> }
>
> ?>
>
>
> ---
> Login page : login.ctp
> ---
>
>  if ($session->check('Message.auth')) {
>$session->flash('auth');
> }
> if ($form->isFieldError('User.username')) {
> e($form->error ('User.username', null));
> }
> ?>
>
> 
> 
> create('Tbluser',array('action' => 'login'))); ?>
>
> 
>   
>  Username 
>  text('struid')); ?> 
>   
>
> 
> 
>   
>  Password 
>  password('strpid')); ?> 
>   
>
> 
> 
>   
>   
> submit('Login')); ?>
>   
> 
> end()); ?>
> 
> 
>
>
>
> ---
> index page : login.ctp
> ---
>  echo "Welcome cakephp world ...!";
> ?>
>
>
>
>
> 
> App Controller : app_controller.php
> 
>
> 
> class AppController extends Controller {
> {
> var $components = array('Auth', 'RequestHandler');
>
> var $uses = array ('Tbluser') ;
>
> var $helpers = array('Javascript','Html','Form','Ajax');
>
> function beforeFilter(){
>
> $this->Auth->allow('adduser');
>
> $struid = $this->Auth->user('struid');
>
> $id = $this->Auth->user('lnguser');
>
> $this -> Session -> write('struid', $struid);
>
> $this -> Session -> write('id', $id);
>
> $this->set('struid', $this->Auth->user('struid'));
>
> $this->set('userId', $this->Auth->user('lnguser&#

How to create login page using app_controller.php

2010-06-07 Thread Narendra Padala
Hi am new to cakephp, i am using postgress sql database this is an existing
database here i am not having permissions to change any thing in database.
but i have to wrote user authentication using app_controller.php
so tried to wrote code like this but it was not working properly please any
one can help me out to solve this problem.


-
Database table:
-
table name: tbluser
-


 Column |  Type  |
Modifiers
++-
 lnguser| integer| not null default
nextval(('"tbluser_lnguser_seq"'::text)::regclass)
 strfname   | character varying(100) | not null
 strlname   | character varying(100) | not null
 struid | character varying(100) | not null
 strpid | character varying(100) | not null
 lnguser_group  | integer| not null
 strtelarea | character varying(20)  |
 strtelno   | character varying(20)  |
 stremail   | character varying(100) |
 struserconfirm | character varying(100) |
 dtmregistered  | date   |
 dtmapproved| date   |
 blnchatuser| bit(1) |
Indexes:
"tbluser_pkey" PRIMARY KEY, btree (lnguser)



Model : tbluser.php





-
Controller : tblusers_controller.php
-
Session->setFlash('Successfully logout');

$this->redirect($this->Auth->logout());
}


}

?>


---
Login page : login.ctp
---

check('Message.auth')) {
   $session->flash('auth');
}
if ($form->isFieldError('User.username')) {
e($form->error ('User.username', null));
}
?>



create('Tbluser',array('action' => 'login'))); ?>

  
 Username 
 text('struid')); ?> 
  



  
 Password 
 password('strpid')); ?> 
  



  
  
submit('Login')); ?>
  

end()); ?>





---
index page : login.ctp
---






App Controller : app_controller.php


Auth->allow('adduser');

$struid = $this->Auth->user('struid');

$id = $this->Auth->user('lnguser');

$this -> Session -> write('struid', $struid);

$this -> Session -> write('id', $id);

$this->set('struid', $this->Auth->user('struid'));

$this->set('userId', $this->Auth->user('lnguser'));

$this->Auth->loginRedirect = array('controller' => 'tblusers',
'action' => 'index');

}

function isAuthorized() {

 return true;

 }

}

?>


please any one can help me out...here i attached the copy code as text file.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


How to Add/Remove records dyanmically...

2010-06-04 Thread Narendra Padala
Hi i am new to cakephp, here i attached the screen shot off my application
please see that attachment,
any one having the related sample code please help me out.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

Re: How to pass array value from one ctp file to another ctp file

2010-06-03 Thread Narendra Padala
can u please send any working example...

On Wed, Jun 2, 2010 at 6:56 PM, Shaz  wrote:

> Use elements, you can pass values between them:
>
> $this->element('whatever', $valuetobepassed);
>
> On 2 June, 13:16, Narendra Padala  wrote:
> > Hi flocks,
> > I am,  new to cake php  actually i want display one report, in the down i
> > put the link download link for Excel.
> >
> > For that purpose , i have to display same content for report and  excel,
> so
> > i was set the query results in one variable rows, using that variable i
> was
> > displayed the records now same variable i have to use in  In the
> > export_xls.ctp file so, for that purpose i passed variable through query
> > string. so in that time i din't get data, simple its shows array() in
> > address bar.
> >
> > so how to pass array value form one ctp to ctp in same controller. please
> > help me out.
> >
> > I wrote code like this...
> >
> > MyConroller
> >
> --
> >
> >  > class MyviewsController extends AppController {
> >
> > var $name = 'Myviews';
> >
> > function display() {
> >
> > $this->Myview->recursive = 1;
> > $data = $this->Myview->find('all');
> > $this->set('rows',$data);
> > }
> >
> > function export_xls($data) {
> >
> > $this->set('rows',$data);
> > $this->render('export_xls','export_xls');
> >
> > }}
> >
> > ?>
> >
> >
> ---
> > ctp files
> >
> 
> > display.ctp
> >
> > 
> > .tableTd {
> >border-width: 0.5pt;
> > border: solid;
> > }
> > .tableTdContent{
> > border-width: 0.5pt;
> > border: solid;
> > }
> > #titles{
> > font-weight: bolder;
> > }
> >
> > 
> > 
> > 
> > Export To Excel Sample
> > 
> > 
> > Date:
> > 
> > 
> > 
> > Number of Rows:
> > 
> > 
> > 
> > 
> > 
> > 
> > Column 1
> > Column 2
> > 
> >  > echo '';
> > echo ' class="tableTdContent">'.$row['Myview']['no'].'';
> > echo ' > class="tableTdContent">'.$row['Myview']['name'].'';
> > echo '';
> > endforeach;
> > ?>
> > 
> > 
> > 
> > 
> >
> > image('button_excel_onclick.gif',
> > array('border' => '0',
> >   'url' => array('controller'=>
> 'myviews',
> >  'action' =>
> 'export_xls',
> > $rows)));
> > ?>
> > 
> > 
> > 
> >
> -
> > export_xls.ctp
> >
> 
> > 
> > .tableTd {
> >border-width: 0.5pt;
> > border: solid;
> > }
> > .tableTdContent{
> > border-width: 0.5pt;
> > border: solid;
> > }
> > #titles{
> > font-weight: bolder;
> > }
> >
> > 
> > 
> > 
> > Export To Excel Sample
> > 
> > 
> > Date:
> > 
> > 
> > 
> > Number of Rows:
> > 
> > 
> > 
> > 
> > 
> > 
> > Column 1
> > Column 2
> > 
> >  > echo '';
> > echo ' class="tableTdContent">'.$row['Myview']['no'].'';
> > echo ' > class="tableTdContent">'.$row['Myview']['name'].'';
> > echo '';
> > endforeach;
> > ?>
> > 
> >
> ---
> >
> > please any one can help me out..!
> >
> > thanks in advance...!
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: how i call function in cake link

2010-06-02 Thread Narendra Padala
link('edit', array('controller'=>'dashboards',
 'action'=>'
'partner/'.$data[$i]['Partner']['id']'));
?>


On Wed, Jun 2, 2010 at 5:49 PM, mike karthauser wrote:

>
> On 2 Jun 2010, at 12:21, Dilip Godhani wrote:
>
>  e($html->link('Edit',array('controller'=>'dashboards','action'=>'partner/'.$data[$i]['Partner']['id'])));
> ?>
>
>
> by reading how in the book
> http://book.cakephp.org/view/836/link
>
> --
> Mike Karthäuser
> Managing Director - Brightstorm Ltd
> Email: mi...@brightstorm.co.uk
> Web: http://www.brightstorm.co.uk
> Tel: 07939 252144
> Address: 1 Brewery Court, North Street, Bristol, BS3 1JS
>
>  Check out the new CakePHP Questions site http://cakeqs.org and help
> others with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


How to pass array value from one ctp file to another ctp file

2010-06-02 Thread Narendra Padala
Hi flocks,
I am,  new to cake php  actually i want display one report, in the down i
put the link download link for Excel.

For that purpose , i have to display same content for report and  excel, so
i was set the query results in one variable rows, using that variable i was
displayed the records now same variable i have to use in  In the
export_xls.ctp file so, for that purpose i passed variable through query
string. so in that time i din't get data, simple its shows array() in
address bar.

so how to pass array value form one ctp to ctp in same controller. please
help me out.

I wrote code like this...

MyConroller
--

Myview->recursive = 1;
$data = $this->Myview->find('all');
$this->set('rows',$data);
}

function export_xls($data) {

$this->set('rows',$data);
$this->render('export_xls','export_xls');

}
}
?>




---
ctp files

display.ctp


.tableTd {
   border-width: 0.5pt;
border: solid;
}
.tableTdContent{
border-width: 0.5pt;
border: solid;
}
#titles{
font-weight: bolder;
}




Export To Excel Sample


Date:



Number of Rows:






Column 1
Column 2

';
echo ''.$row['Myview']['no'].'';
echo ''.$row['Myview']['name'].'';
echo '';
endforeach;
?>





image('button_excel_onclick.gif',
array('border' => '0',
  'url' => array('controller'=> 'myviews',
 'action' => 'export_xls',
$rows)));
?>



-
export_xls.ctp


.tableTd {
   border-width: 0.5pt;
border: solid;
}
.tableTdContent{
border-width: 0.5pt;
border: solid;
}
#titles{
font-weight: bolder;
}




Export To Excel Sample


Date:



Number of Rows:






Column 1
Column 2

';
echo ''.$row['Myview']['no'].'';
echo ''.$row['Myview']['name'].'';
echo '';
endforeach;
?>

---

please any one can help me out..!

thanks in advance...!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: how i apply css on $html->link

2010-05-26 Thread Narendra Padala
link('Add', array('controller'=>
$this->params['controller'],

'action'=>'view'),

array('class'=>'footer-link'));
 ?>


On Wed, May 26, 2010 at 2:19 PM, Narendra Padala wrote:

>echo $html->link('Add',
> 'add',array('class'=>'footer-link'));
> ?>
>
>
>
> On Wed, May 26, 2010 at 12:30 PM, Ed Propsner wrote:
>
>> I would use:
>>
>> $html->div('current', $html->link('Add', array(
>>'controller' => $this->params['controller'],
>> 'action'=>'view'
>>)
>>   )
>>);
>>
>> - Ed
>>
>> On Wed, May 26, 2010 at 2:41 AM, Dilip Godhani 
>> wrote:
>>
>>> Can any One hellp
>>>
>>> How i Apply css in $html->link
>>> i give css following
>>>  >> $html->link('Add',array('controller'=>$this->params['controller'],'action'=>'view'),array('class'=>'current'));
>>> ?>
>>>
>>> --
>>> Dilip Godhani
>>> Jr Software Developer, Entourage Solutions
>>> e-mail: di...@entouragesolutions.com
>>>   dilip.godh...@gmail.com
>>> Web.: www.entouragesolutions.com
>>> m. 9913822582
>>>
>>> Check out the new CakePHP Questions site http://cakeqs.org and help
>>> others with their CakePHP related questions.
>>>
>>> You received this message because you are subscribed to the Google Groups
>>> "CakePHP" group.
>>> To post to this group, send email to cake-php@googlegroups.com
>>> To unsubscribe from this group, send email to
>>> cake-php+unsubscr...@googlegroups.comFor
>>>  more options, visit this group at
>>> http://groups.google.com/group/cake-php?hl=en
>>>
>>
>>  Check out the new CakePHP Questions site http://cakeqs.org and help
>> others with their CakePHP related questions.
>>
>> You received this message because you are subscribed to the Google Groups
>> "CakePHP" group.
>> To post to this group, send email to cake-php@googlegroups.com
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.comFor
>>  more options, visit this group at
>> http://groups.google.com/group/cake-php?hl=en
>>
>
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: how i apply css on $html->link

2010-05-26 Thread Narendra Padala
link('Add',
'add',array('class'=>'footer-link'));
?>


On Wed, May 26, 2010 at 12:30 PM, Ed Propsner  wrote:

> I would use:
>
> $html->div('current', $html->link('Add', array(
>'controller' => $this->params['controller'],
> 'action'=>'view'
>)
>   )
>);
>
> - Ed
>
> On Wed, May 26, 2010 at 2:41 AM, Dilip Godhani wrote:
>
>> Can any One hellp
>>
>> How i Apply css in $html->link
>> i give css following
>>  > $html->link('Add',array('controller'=>$this->params['controller'],'action'=>'view'),array('class'=>'current'));
>> ?>
>>
>> --
>> Dilip Godhani
>> Jr Software Developer, Entourage Solutions
>> e-mail: di...@entouragesolutions.com
>>   dilip.godh...@gmail.com
>> Web.: www.entouragesolutions.com
>> m. 9913822582
>>
>> Check out the new CakePHP Questions site http://cakeqs.org and help
>> others with their CakePHP related questions.
>>
>> You received this message because you are subscribed to the Google Groups
>> "CakePHP" group.
>> To post to this group, send email to cake-php@googlegroups.com
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.comFor
>>  more options, visit this group at
>> http://groups.google.com/group/cake-php?hl=en
>>
>
>  Check out the new CakePHP Questions site http://cakeqs.org and help
> others with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: How to join 2 tables in the controller

2010-05-25 Thread Narendra Padala
thanks ... for giving good suggestion

On Tue, May 25, 2010 at 6:58 PM, Dilip Godhani wrote:

> cakephp support relation u create one model in model folder and give
> relationship of two table cake automatic join that two table
>
>
> On Tue, May 25, 2010 at 6:57 PM, Narendra Padala 
> wrote:
>
>>  $storeDivisions = $this->Store->find('all',
>> array('joins' => array(
>>array('table' => 'divisions',
>>  'alias' => 'd',
>>  'type' => 'left',
>>  'foreignKey' => false,
>>  'conditions'=>
>> array('Store.division_id = d.division_id')
>> )
>>  ),
>>'conditions'=>array('d.country_id'=>1),
>> n
>
>

>   'order'=>array('Store.store_name ASC')
>> ));
>>
>>
>> On Wed, May 19, 2010 at 9:18 AM, Jeremy Burns  wrote:
>>
>>> I would start by reading this part of the online 
>>> guide<http://book.cakephp.org/view/1000/Models>.
>>> Setting up models is key to just about everything you do in Cake, so simply
>>> finding out how to join two tables will only move you on to your next
>>> problem.
>>>
>>>
>>> Jeremy Burns
>>> jeremybu...@me.com
>>>
>>>
>>> On 18 May 2010, at 12:29, cakephpBbsr wrote:
>>>
>>> Hello Team,
>>>
>>> I want to join two tables in controller using find().Can u provide me
>>> some sample code.
>>>
>>> Thanks
>>> Rasmi
>>>
>>> Check out the new CakePHP Questions site http://cakeqs.org and help
>>> others with their CakePHP related questions.
>>>
>>> You received this message because you are subscribed to the Google Groups
>>> "CakePHP" group.
>>> To post to this group, send email to cake-php@googlegroups.com
>>> To unsubscribe from this group, send email to
>>> cake-php+unsubscr...@googlegroups.com For more options, visit this group
>>> at http://groups.google.com/group/cake-php?hl=en
>>>
>>>
>>>  Check out the new CakePHP Questions site http://cakeqs.org and help
>>> others with their CakePHP related questions.
>>>
>>> You received this message because you are subscribed to the Google Groups
>>> "CakePHP" group.
>>> To post to this group, send email to cake-php@googlegroups.com
>>> To unsubscribe from this group, send email to
>>> cake-php+unsubscr...@googlegroups.comFor
>>>  more options, visit this group at
>>> http://groups.google.com/group/cake-php?hl=en
>>>
>>
>>  Check out the new CakePHP Questions site http://cakeqs.org and help
>> others with their CakePHP related questions.
>>
>> You received this message because you are subscribed to the Google Groups
>> "CakePHP" group.
>> To post to this group, send email to cake-php@googlegroups.com
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.comFor
>>  more options, visit this group at
>> http://groups.google.com/group/cake-php?hl=en
>>
>
>
>
> --
> Dilip Godhani
> Jr Software Developer, Entourage Solutions
> e-mail: di...@entouragesolutions.com
>   dilip.godh...@gmail.com
> Web.: www.entouragesolutions.com
> m. 9913822582
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: How to join 2 tables in the controller

2010-05-25 Thread Narendra Padala
 $storeDivisions = $this->Store->find('all',
array('joins' => array(
   array('table' => 'divisions',
 'alias' => 'd',
 'type' => 'left',
 'foreignKey' => false,
 'conditions'=>
array('Store.division_id = d.division_id')
)
 ),
   'conditions'=>array('d.country_id'=>1),
   'order'=>array('Store.store_name ASC')
));


On Wed, May 19, 2010 at 9:18 AM, Jeremy Burns  wrote:

> I would start by reading this part of the online 
> guide.
> Setting up models is key to just about everything you do in Cake, so simply
> finding out how to join two tables will only move you on to your next
> problem.
>
>
> Jeremy Burns
> jeremybu...@me.com
>
>
> On 18 May 2010, at 12:29, cakephpBbsr wrote:
>
> Hello Team,
>
> I want to join two tables in controller using find().Can u provide me
> some sample code.
>
> Thanks
> Rasmi
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php?hl=en
>
>
>  Check out the new CakePHP Questions site http://cakeqs.org and help
> others with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: Can Any one Helllp me?

2010-05-25 Thread Narendra Padala
$suppliers = $this->Supplier->find('all',
array(
'conditions' =>

array('AND',array('supplier_name'=>'narendra',

   'supplier_id'
=> $sId)
   ),

'order' =>
array(

'supplier_id ASC')));



On Wed, May 19, 2010 at 4:02 PM, Jeremy Burns  wrote:

> http://book.cakephp.org/view/1017/Retrieving-Your-Data
>
> Jeremy Burns
> jeremybu...@me.com 
>
>
> On 19 May 2010, at 11:28, Dilip Godhani wrote:
>
> Hello
>
> How i use Order by with and condition can any one give me one good
> example??
>
> Thanks..!
>
>
> --
> Dilip Godhani
> Jr Software Developer, Entourage Solutions
> e-mail: di...@entouragesolutions.com
>   dilip.godh...@gmail.com
> Web.: www.entouragesolutions.com
> m. 9913822582
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php?hl=en
>
>
>  Check out the new CakePHP Questions site http://cakeqs.org and help
> others with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: Creating custom report

2010-05-25 Thread Narendra Padala
thanks... for correction

On Tue, May 25, 2010 at 6:27 PM, Dilip Godhani wrote:

>
> Heyy
> error in this statement
>
> $$this->set('authakeUsers',$
> authakeUserQuery);
>
>
> correct folowing
> $this->set('authakeUsers',$
> authakeUserQuery);
> Try this
>
> On Tue, May 25, 2010 at 6:25 PM, Narendra Padala 
> wrote:
>
>> put code to ur controller
>> --
>> $createdValue='12.34.00';
>> $authakeUserQuery=$this->authakeUser->find('all',
>>
>> array('conditions'=>array('authakeUser.created'=>$createdValue)));
>>
>> $$this->set('authakeUsers',$authakeUserQuery);
>>
>>
>> --.ctp file
>> 
>> 
>> login
>> password
>> email
>> created
>> updated
>> 
>> > foreach($authakeUsers as $authakeUser) {
>> ?>
>> 
>>   
>>   
>>   
>>   
>>   
>> 
>> 
>> 
>>
>> I am also new to cake php, as per my scope i did like this, but u have to
>> ask question clearly and u have to try.?
>>
>> On Tue, May 25, 2010 at 12:19 PM, WebbedIT  wrote:
>>
>>> What have you tried and where have you got stuck?
>>>
>>> Check out the new CakePHP Questions site http://cakeqs.org and help
>>> others with their CakePHP related questions.
>>>
>>> You received this message because you are subscribed to the Google Groups
>>> "CakePHP" group.
>>> To post to this group, send email to cake-php@googlegroups.com
>>> To unsubscribe from this group, send email to
>>> cake-php+unsubscr...@googlegroups.comFor
>>>  more options, visit this group at
>>> http://groups.google.com/group/cake-php?hl=en
>>>
>>
>>  Check out the new CakePHP Questions site http://cakeqs.org and help
>> others with their CakePHP related questions.
>>
>> You received this message because you are subscribed to the Google Groups
>> "CakePHP" group.
>> To post to this group, send email to cake-php@googlegroups.com
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.comFor
>>  more options, visit this group at
>> http://groups.google.com/group/cake-php?hl=en
>>
>
>
>
> --
> Dilip Godhani
> Jr Software Developer, Entourage Solutions
> e-mail: di...@entouragesolutions.com
>   dilip.godh...@gmail.com
> Web.: www.entouragesolutions.com
> m. 9913822582
>
>  Check out the new CakePHP Questions site http://cakeqs.org and help
> others with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: Creating custom report

2010-05-25 Thread Narendra Padala
put code to ur controller
--
$createdValue='12.34.00';
$authakeUserQuery=$this->authakeUser->find('all',

array('conditions'=>array('authakeUser.created'=>$createdValue)));

$$this->set('authakeUsers',$authakeUserQuery);


--.ctp file


login
password
email
created
updated



  
  
  
  
  




I am also new to cake php, as per my scope i did like this, but u have to
ask question clearly and u have to try.?

On Tue, May 25, 2010 at 12:19 PM, WebbedIT  wrote:

> What have you tried and where have you got stuck?
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


please any one can help me to convert this complex query in to cakephp

2010-05-20 Thread Narendra Padala
Hi All, I am new to cakephp
please any one can help me to convert this complex query in to cakephp

Query   SELECT `c`.`campaign_id`, `c`.`supplier_id`, `c`.`brand`,
`c`.`start_date`,
   `c`.`end_date` FRamOM `campaigns` as `c`
LEFT JOIN `campaign_stores` as `cs` ON `c`.`campaign_id`
= `cs`.`campaign_id`
LEFT JOIN `stores` as `s` ON `cs`.`store_id` =
`s`.`store_id`
WHERE
((c.start_date >= '2010-05-19' AND c.start_date <=
'2010-06-30')
OR (c.end_date >= '2010-05-19' AND c.end_date <=
'2010-06-30')
OR ('2010-05-19' >= c.start_date AND '2010-05-19' <=
c.end_date)
OR ('2010-06-30' >= c.start_date AND '2010-06-30' <=
c.end_date))
AND `c`.`status` NOT IN ('request', 'cancelled')
AND `s`.`store_id` = '3'

Thanks in adavance
On Thu, May 20, 2010 at 6:45 PM, Jeremy Burns  wrote:

> It's TestStore - I just posted a correction.
>
>
> Jeremy Burns
> jeremybu...@me.com 
>
>
> On 20 May 2010, at 14:14, Narendra Padala wrote:
>
> hi here model class name
>
>  Table test_stores: test_store.php, model class TestStores
>
>
> "TestStores" or TestStore. i have doubt let me clarify please
>
> var $name=TestStores; or var $name=TestStore
>
> On Thu, May 20, 2010 at 6:32 PM, Jeremy Burns  wrote:
>
>> Model conventions: http://book.cakephp.org/view/901/CakePHP-Conventions
>>
>> But in case you can't be bothered to read it, let me spell it out for you.
>>
>> Table name - lower case, plural, underscored.
>> Field names: lowercase, underscored.
>> Model filename: Singular, camel cased.
>> Model class name:  Singular, camel cased.
>>
>> So your models are:
>>
>> Table stores: store.php, model class Store
>> Table test_stores: test_store.php, model class TestStores
>>
>> Jeremy Burns
>> jeremybu...@me.com 
>> (Skype) +44 208 123 3822 (jeremy_burns)
>> (m) +44 7973 481949
>> (h) +44 208 530 7573
>>
>> On 20 May 2010, at 13:54, Narendra Padala wrote:
>>
>> Hi...All i am new to cakephp, i have problem in creating model please help
>> me out...!
>>
>> My table names like this
>>
>> Table one : stores
>> Table two : test_stores
>>
>> For one i create like this.
>>
>> File name: store.php
>> 
>> > class Stores extends AppModel {
>> var $name = 'Store';
>> }
>> ?>
>> For second table how can i create model help me out.?
>>
>> For "test_stores" this how can i create model ?
>>
>>
>>
>> Thanks in Advance.
>>
>> Check out the new CakePHP Questions site http://cakeqs.org and help
>> others with their CakePHP related questions.
>>
>> You received this message because you are subscribed to the Google Groups
>> "CakePHP" group.
>> To post to this group, send email to cake-php@googlegroups.com
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com For more options, visit this group
>> at http://groups.google.com/group/cake-php?hl=en
>>
>>
>>
>> Check out the new CakePHP Questions site http://cakeqs.org and help
>> others with their CakePHP related questions.
>>
>> You received this message because you are subscribed to the Google Groups
>> "CakePHP" group.
>> To post to this group, send email to cake-php@googlegroups.com
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.comFor
>>  more options, visit this group at
>> http://groups.google.com/group/cake-php?hl=en
>>
>
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php?hl=en
>
>
>  Check out the new CakePHP Questions site http://cakeqs.org and help
> others with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: How create model in cakephp [Naming conventions Problem]

2010-05-20 Thread Narendra Padala
thanq

On Thu, May 20, 2010 at 6:44 PM, Narendra Padala wrote:

> hi here model class name
>
>
>  Table test_stores: test_store.php, model class TestStores
>
>
> "TestStores" or TestStore. i have doubt let me clarify please
>
> var $name=TestStores; or var $name=TestStore
>
>
> On Thu, May 20, 2010 at 6:32 PM, Jeremy Burns  wrote:
>
>> Model conventions: http://book.cakephp.org/view/901/CakePHP-Conventions
>>
>> But in case you can't be bothered to read it, let me spell it out for you.
>>
>> Table name - lower case, plural, underscored.
>> Field names: lowercase, underscored.
>> Model filename: Singular, camel cased.
>> Model class name:  Singular, camel cased.
>>
>> So your models are:
>>
>> Table stores: store.php, model class Store
>> Table test_stores: test_store.php, model class TestStores
>>
>> Jeremy Burns
>> jeremybu...@me.com 
>> (Skype) +44 208 123 3822 (jeremy_burns)
>> (m) +44 7973 481949
>> (h) +44 208 530 7573
>>
>> On 20 May 2010, at 13:54, Narendra Padala wrote:
>>
>> Hi...All i am new to cakephp, i have problem in creating model please help
>> me out...!
>>
>> My table names like this
>>
>> Table one : stores
>> Table two : test_stores
>>
>> For one i create like this.
>>
>> File name: store.php
>> 
>> > class Stores extends AppModel {
>> var $name = 'Store';
>> }
>> ?>
>> For second table how can i create model help me out.?
>>
>> For "test_stores" this how can i create model ?
>>
>>
>>
>> Thanks in Advance.
>>
>> Check out the new CakePHP Questions site http://cakeqs.org and help
>> others with their CakePHP related questions.
>>
>> You received this message because you are subscribed to the Google Groups
>> "CakePHP" group.
>> To post to this group, send email to cake-php@googlegroups.com
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com For more options, visit this group
>> at http://groups.google.com/group/cake-php?hl=en
>>
>>
>>  Check out the new CakePHP Questions site http://cakeqs.org and help
>> others with their CakePHP related questions.
>>
>> You received this message because you are subscribed to the Google Groups
>> "CakePHP" group.
>> To post to this group, send email to cake-php@googlegroups.com
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.comFor
>>  more options, visit this group at
>> http://groups.google.com/group/cake-php?hl=en
>>
>
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: How create model in cakephp [Naming conventions Problem]

2010-05-20 Thread Narendra Padala
hi here model class name

 Table test_stores: test_store.php, model class TestStores


"TestStores" or TestStore. i have doubt let me clarify please

var $name=TestStores; or var $name=TestStore

On Thu, May 20, 2010 at 6:32 PM, Jeremy Burns  wrote:

> Model conventions: http://book.cakephp.org/view/901/CakePHP-Conventions
>
> But in case you can't be bothered to read it, let me spell it out for you.
>
> Table name - lower case, plural, underscored.
> Field names: lowercase, underscored.
> Model filename: Singular, camel cased.
> Model class name:  Singular, camel cased.
>
> So your models are:
>
> Table stores: store.php, model class Store
> Table test_stores: test_store.php, model class TestStores
>
> Jeremy Burns
> jeremybu...@me.com 
> (Skype) +44 208 123 3822 (jeremy_burns)
> (m) +44 7973 481949
> (h) +44 208 530 7573
>
> On 20 May 2010, at 13:54, Narendra Padala wrote:
>
> Hi...All i am new to cakephp, i have problem in creating model please help
> me out...!
>
> My table names like this
>
> Table one : stores
> Table two : test_stores
>
> For one i create like this.
>
> File name: store.php
> 
>  class Stores extends AppModel {
> var $name = 'Store';
> }
> ?>
> For second table how can i create model help me out.?
>
> For "test_stores" this how can i create model ?
>
>
>
> Thanks in Advance.
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php?hl=en
>
>
>  Check out the new CakePHP Questions site http://cakeqs.org and help
> others with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Name Convention Problem in creating model please help me out

2010-05-20 Thread Narendra Padala
Hi...All i am new to cakephp, i have problem in creating model please
help me out...!

My table names like this

Table one : stores
Table two : test_stores

For one i create like this.

File name: store.php


For second table how can i create model help me out.?

For "test_stores" this how can i create model ?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


How create model in cakephp [Naming conventions Problem]

2010-05-20 Thread Narendra Padala
Hi...All i am new to cakephp, i have problem in creating model please help
me out...!

My table names like this

Table one : stores
Table two : test_stores

For one i create like this.

File name: store.php


For second table how can i create model help me out.?

For "test_stores" this how can i create model ?



Thanks in Advance.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: How write where condition for this " ('2010-05-19' >= c.start_date AND '2010-05-19' <= c.end_date) " in cake php

2010-05-19 Thread Narendra Padala
there i have one doubt in my query


I converted this query in to cake like this...its working

((c.start_date >= '{$this->startDate}' AND c.start_date <=
'{$this->endDate}')


 array('AND'=>array('Campaign.start_date >='=>$strDate),
array('Campaign.start_date =<'=>$endDate))


but this query how can i convert into cake php please help me out

  ('2010-05-19' >= c.start_date AND '2010-05-19' <= c.end_date)
  ('   value'  >= 'filed name'  AND 'value' <='filed name')

 cakephp ?...


any one please help me out.


On Wed, May 19, 2010 at 6:38 PM, Jeremy Burns  wrote:

> http://book.cakephp.org/view/1030/Complex-Find-Conditions
>
> Jeremy Burns
> jeremybu...@me.com 
>
>
> On 19 May 2010, at 14:06, Narendra Padala wrote:
>
> Hi ...All I am new to cake php, I need to write where conditions like this
> please any one can help me out
>
>
> WHERE
> ((c.start_date >= '2010-05-19' AND c.start_date <=
> '2010-06-30')
> OR (c.end_date >= '2010-05-19' AND c.end_date <=
> '2010-06-30')
> OR ('2010-05-19' >= c.start_date AND '2010-05-19' <=
> c.end_date)
> OR ('2010-06-30' >= c.start_date AND '2010-06-30' <=
> c.end_date))
> AND `c`.`status` NOT IN ('request', 'cancelled')
> AND `s`.`store_id` = '3'
>
> Please any one can convert this query in to cakephp please help me
> out...thanks in advance.
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php?hl=en
>
>
>  Check out the new CakePHP Questions site http://cakeqs.org and help
> others with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: How to display the joins table data in cake php

2010-05-19 Thread Narendra Padala
thanks you sir , its working fine!

On Wed, May 19, 2010 at 6:29 PM, Jeremy Burns  wrote:

> Type this:
>
> die(debug($storeDivisions));
>
> ...just before you try to access it, and you'll see its shape.
>
> Jeremy Burns
> jeremybu...@me.com 
>
>
> On 19 May 2010, at 13:54, Narendra Padala wrote:
>
> Hi...All !
> i am new to cake php i am writting query like this , i am using left join i
> wrote the query like below, but i dont know how to display that fileds data
> please help me out
>
> $storeDivisions = $this->Store->find('all',
>   array('joins' =>
> array(
>
> array( 'table' => 'divisions',
>
>  'alias' => 'd',
>
>   'type' => 'left',
>
>  'foreignKey' => false,
>
>  'conditions'=> array('Store.division_id = d.division_id')
>
> )
>
>),
>
> 'conditions'=>array('d.country_id'=>1),
>
> 'order'=>array('Store.store_name ASC')
>)
>  );
>
>
>
> query is working but i am not able to display get divsions table data how
> to retrive that data, i worte like this
>
> foreach ($storeDivisions as & $storeDivision){
> echo "Name :".$storeDivision['Store']['store_name']."; // here
> i get result
> echo "Id :".$storeDivisions['d']['name']."";  //
> here i didnt get the result,
> }
>
>
>
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php?hl=en
>
>
>  Check out the new CakePHP Questions site http://cakeqs.org and help
> others with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


How write where condition in cakephp

2010-05-19 Thread Narendra Padala
Hi ...All I am new to cake php, I need to write where conditions like this
please any one can help me out


WHERE
((c.start_date >= '2010-05-19' AND c.start_date <=
'2010-06-30')
OR (c.end_date >= '2010-05-19' AND c.end_date <=
'2010-06-30')
OR ('2010-05-19' >= c.start_date AND '2010-05-19' <=
c.end_date)
OR ('2010-06-30' >= c.start_date AND '2010-06-30' <=
c.end_date))
AND `c`.`status` NOT IN ('request', 'cancelled')
AND `s`.`store_id` = '3'

Please any one can convert this query in to cakephp please help me
out...thanks in advance.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


How to display the joins table data in cake php

2010-05-19 Thread Narendra Padala
Hi...All !
i am new to cake php i am writting query like this , i am using left join i
wrote the query like below, but i dont know how to display that fileds data
please help me out

$storeDivisions = $this->Store->find('all',
  array('joins' =>
array(

array( 'table' => 'divisions',

 'alias' => 'd',

  'type' => 'left',

 'foreignKey' => false,

 'conditions'=> array('Store.division_id = d.division_id')

)

   ),

'conditions'=>array('d.country_id'=>1),

'order'=>array('Store.store_name ASC')
   )
 );



query is working but i am not able to display get divsions table data how to
retrive that data, i worte like this

foreach ($storeDivisions as & $storeDivision){
echo "Name :".$storeDivision['Store']['store_name']."; // here i
get result
echo "Id :".$storeDivisions['d']['name']."";  // here
i didnt get the result,
}

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


How write joins in cakephp please help me out

2010-05-18 Thread Narendra Padala
I am new to cakephp, If any one can help me how to write left joins in
cake php. please conver below query in cakephp

$sql = "SELECT `c`.`campaign_id`, `c`.`supplier_id`,
`c`.`brand`, `c`.`start_date`, `c`.`end_date` FROM `campaigns` as `c`
LEFT JOIN `campaign_stores` as `cs` ON
`c`.`campaign_id` = `cs`.`campaign_id`
LEFT JOIN `stores` as `s` ON `cs`.`store_id` =
`s`.`store_id`
WHERE
((c.start_date >= '{$this->startDate}' AND
c.start_date <= '{$this->endDate}')
OR (c.end_date >= '{$this->startDate}' AND
c.end_date <= '{$this->endDate}')
OR ('{$this->startDate}' >= c.start_date AND
'{$this->startDate}' <= c.end_date)
OR ('{$this->endDate}' >= c.start_date AND '{$this-
>endDate}' <= c.end_date))
AND `c`.`status` != 'request'
AND `s`.`store_id` = '$storeId'";



Thanks in advance.!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


How write joins in cakephp please help me out

2010-05-18 Thread Narendra Padala
Hi..All,

I am new to cakephp, If any one can help me how to write left joins in cake
php. please conver below query in cakephp

$sql = "SELECT `c`.`campaign_id`, `c`.`supplier_id`,
`c`.`brand`, `c`.`start_date`, `c`.`end_date` FROM `campaigns` as `c`
LEFT JOIN `campaign_stores` as `cs` ON `c`.`campaign_id`
= `cs`.`campaign_id`
LEFT JOIN `stores` as `s` ON `cs`.`store_id` =
`s`.`store_id`
WHERE
((c.start_date >= '{$this->startDate}' AND c.start_date
<= '{$this->endDate}')
OR (c.end_date >= '{$this->startDate}' AND c.end_date <=
'{$this->endDate}')
OR ('{$this->startDate}' >= c.start_date AND
'{$this->startDate}' <= c.end_date)
OR ('{$this->endDate}' >= c.start_date AND
'{$this->endDate}' <= c.end_date))
AND `c`.`status` != 'request'
AND `s`.`store_id` = '$storeId'";



Thanks in advance.!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: how write update query in cakephp

2010-05-13 Thread Narendra Padala
*Warning* (512): *SQL Error:* ERROR:  duplicate key value violates
unique constraint "tblcdlog_pkey"
[*CORE/cake/libs/model/datasources/dbo_source.php*, line *526*]



On Thu, May 13, 2010 at 6:28 PM, Jeremy Burns  wrote:

> I'm sorry to sound unhelpful, but have you read the error message?
>
>
> Jeremy Burns
> jeremybu...@me.com 
>
>
> On 13 May 2010, at 13:53, Narendra Padala wrote:
>
> hi sir,
> i did that one now i got this error sir please help me out sir
>
> *Warning* (2): pg_query() [function.pg-query 
> <http://php.net/function.pg-query>]: Query failed: ERROR:  duplicate key 
> value violates unique constraint "tblcdlog_pkey" 
> [*CORE/cake/libs/model/datasources/dbo/dbo_postgres.php*, line *155*]
>
> Code | Context
>
> $sql  =   "INSERT INTO "tblcdlog" ("lngcdlog", "dtmcreated", 
> "lngcdlog_type", "blnsuccess", "tblcdlog_id", "strerrordesc") VALUES ('157', 
> '2010-05-13 13:42:50', '1', '0', '124', 'Naru')"
>
> pg_query - [internal], line ??
> DboPostgres::_execute() - 
> CORE/cake/libs/model/datasources/dbo/dbo_postgres.php, line 155
> DboSource::execute() - CORE/cake/libs/model/datasources/dbo_source.php, line 
> 189
> DboSource::create() - CORE/cake/libs/model/datasources/dbo_source.php, line 
> 586
> Model::save() - CORE/cake/libs/model/model.php, line 1287
> TblstoresController::datacdload() - APP/controllers/tblstores_controller.php, 
> line 1037
> Object::dispatchMethod() - CORE/cake/libs/object.php, line 115
> Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 226
> Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 193
> [main] - APP/webroot/index.php, line 87
>
> *Warning* (512): *SQL Error:* ERROR:  duplicate key value violates unique 
> constraint "tblcdlog_pkey" 
> [*CORE/cake/libs/model/datasources/dbo_source.php*, line *526*]
>
> Code | Context
>
> $sql  =   "INSERT INTO "tblcdlog" ("lngcdlog", "dtmcreated", 
> "lngcdlog_type", "blnsuccess", "tblcdlog_id", "strerrordesc") VALUES ('157', 
> '2010-05-13 13:42:50', '1', '0', '124', 'Naru')"
> $error=   "ERROR:  duplicate key value violates unique constraint 
> "tblcdlog_pkey""
> $out  =   null
>
> $out = null;if ($error) {
> trigger_error("SQL Error: 
> {$this->error}", E_USER_WARNING);
>
> DboSource::showQuery() - CORE/cake/libs/model/datasources/dbo_source.php, 
> line 526
> DboSource::execute() - CORE/cake/libs/model/datasources/dbo_source.php, line 
> 202
> DboSource::create() - CORE/cake/libs/model/datasources/dbo_source.php, line 
> 586
> Model::save() - CORE/cake/libs/model/model.php, line 1287
> TblstoresController::datacdload() - APP/controllers/tblstores_controller.php, 
> line 1037
> Object::dispatchMethod() - CORE/cake/libs/object.php, line 115
> Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 226
> Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 193
> [main] - APP/webroot/index.php, line 87
>
> *Query:* INSERT INTO "tblcdlog" ("lngcdlog", "dtmcreated", "lngcdlog_type", 
> "blnsuccess", "tblcdlog_id", "strerrordesc") VALUES ('157', '2010-05-13 
> 13:42:50', '1', '0', '124', 'Naru')
>
>
>
> I wrote code like this...
>
> $this->data['Tblcdlog']['lngcdlog']=157;
> $this->data['Tblcdlog']['dtmcreated']='2010-05-13
> 13:42:50';
> $this->data['Tblcdlog']['lngcdlog_type']=1;
>     $this->data['Tblcdlog']['blnsuccess']=0;
> $this->data['Tblcdlog']['tblcdlog_id']=124;
> $this->data['Tblcdlog']['strerrordesc']='Naru';
>
>
> $this->Tblcdlog->save($this->data);
>
> Please help me out sir
>
>
> On Thu, May 13, 2010 at 6:10 PM, Jeremy Burns  wrote:
>
>> That's a fairly self explanatory error message. Your dtmcreated field
>> cannot be null. You need to include the dtmcreatedthild and a matching value
>> in the update statement.
>>
>> Something like:
>>
>> $this->data['Tblcdlog']['lngcdlog']=157;
>> $this->data['Tblcdlog']['strerrordesc&#

Re: how write update query in cakephp

2010-05-13 Thread Narendra Padala
hi sir,
i did that one now i got this error sir please help me out sir

*Warning* (2) : pg_query() [function.pg-query
<http://php.net/function.pg-query>]: Query failed: ERROR:  duplicate
key value violates unique constraint "tblcdlog_pkey"
[*CORE/cake/libs/model/datasources/dbo/dbo_postgres.php*, line *155*]

Code  | Context 

$sql=   "INSERT INTO "tblcdlog" ("lngcdlog", "dtmcreated",
"lngcdlog_type", "blnsuccess", "tblcdlog_id", "strerrordesc") VALUES
('157', '2010-05-13 13:42:50', '1', '0', '124', 'Naru')"

pg_query - [internal], line ??
DboPostgres::_execute() -
CORE/cake/libs/model/datasources/dbo/dbo_postgres.php, line 155
DboSource::execute() - CORE/cake/libs/model/datasources/dbo_source.php, line 189
DboSource::create() - CORE/cake/libs/model/datasources/dbo_source.php, line 586
Model::save() - CORE/cake/libs/model/model.php, line 1287
TblstoresController::datacdload() -
APP/controllers/tblstores_controller.php, line 1037
Object::dispatchMethod() - CORE/cake/libs/object.php, line 115
Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 226
Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 193
[main] - APP/webroot/index.php, line 87

*Warning* (512) : *SQL Error:* ERROR:  duplicate
key value violates unique constraint "tblcdlog_pkey"
[*CORE/cake/libs/model/datasources/dbo_source.php*, line *526*]

Code  | Context 

$sql=   "INSERT INTO "tblcdlog" ("lngcdlog", "dtmcreated",
"lngcdlog_type", "blnsuccess", "tblcdlog_id", "strerrordesc") VALUES
('157', '2010-05-13 13:42:50', '1', '0', '124', 'Naru')"
$error  =   "ERROR:  duplicate key value violates unique constraint
"tblcdlog_pkey""
$out=   null

$out = null;if ($error) {
trigger_error("SQL
Error: {$this->error}", E_USER_WARNING);

DboSource::showQuery() -
CORE/cake/libs/model/datasources/dbo_source.php, line 526
DboSource::execute() - CORE/cake/libs/model/datasources/dbo_source.php, line 202
DboSource::create() - CORE/cake/libs/model/datasources/dbo_source.php, line 586
Model::save() - CORE/cake/libs/model/model.php, line 1287
TblstoresController::datacdload() -
APP/controllers/tblstores_controller.php, line 1037
Object::dispatchMethod() - CORE/cake/libs/object.php, line 115
Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 226
Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 193
[main] - APP/webroot/index.php, line 87

*Query:* INSERT INTO "tblcdlog" ("lngcdlog", "dtmcreated",
"lngcdlog_type", "blnsuccess", "tblcdlog_id", "strerrordesc") VALUES
('157', '2010-05-13 13:42:50', '1', '0', '124', 'Naru')



I wrote code like this...

$this->data['Tblcdlog']['lngcdlog']=157;
$this->data['Tblcdlog']['dtmcreated']='2010-05-13 13:42:50';
$this->data['Tblcdlog']['lngcdlog_type']=1;
$this->data['Tblcdlog']['blnsuccess']=0;
$this->data['Tblcdlog']['tblcdlog_id']=124;
$this->data['Tblcdlog']['strerrordesc']='Naru';


$this->Tblcdlog->save($this->data);

Please help me out sir


On Thu, May 13, 2010 at 6:10 PM, Jeremy Burns  wrote:

> That's a fairly self explanatory error message. Your dtmcreated field
> cannot be null. You need to include the dtmcreatedthild and a matching value
> in the update statement.
>
> Something like:
>
> $this->data['Tblcdlog']['lngcdlog']=157;
> $this->data['Tblcdlog']['strerrordesc']='value';
>
> *$this->data['Tblcdlog']['dtmcreated']='value';*
>
> $this->Tblcdlog->save($this->data);
>
>
>
> Jeremy Burns
> jeremybu...@me.com 
>
>
> On 13 May 2010, at 13:36, Narendra Padala wrote:
>
> when i am tried above like that, i got this error message
>
> *Warning* (2): pg_query() [function.pg-query 
> <http://php.net/function.pg-query>]: Query failed: ERROR:  null value in 
> column "dtmcreated" violates not-null constraint 
> [*CORE/cake/libs/model/datasources/dbo/dbo_postgres.php*, line *155*]
>
> Code | Context
>
> $sql  =   "INSERT INTO "tblcdlog" ("lngcdlog", "strerrordesc") VALUES 
> ('157', 'value')"
>
> pg_query - [internal], line ??
> DboPost

Re: how write update query in cakephp

2010-05-13 Thread Narendra Padala
when i am tried above like that, i got this error message

*Warning* (2) : pg_query() [function.pg-query
<http://php.net/function.pg-query>]: Query failed: ERROR:  null value
in column "dtmcreated" violates not-null constraint
[*CORE/cake/libs/model/datasources/dbo/dbo_postgres.php*, line *155*]

Code  | Context 

$sql=   "INSERT INTO "tblcdlog" ("lngcdlog", "strerrordesc") VALUES
('157', 'value')"

pg_query - [internal], line ??
DboPostgres::_execute() -
CORE/cake/libs/model/datasources/dbo/dbo_postgres.php, line 155
DboSource::execute() - CORE/cake/libs/model/datasources/dbo_source.php, line 189
DboSource::create() - CORE/cake/libs/model/datasources/dbo_source.php, line 586
Model::save() - CORE/cake/libs/model/model.php, line 1287
TblstoresController::datacdload() -
APP/controllers/tblstores_controller.php, line 1031
Object::dispatchMethod() - CORE/cake/libs/object.php, line 115
Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 226
Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 193
[main] - APP/webroot/index.php, line 87

*Warning* (512) : *SQL Error:* ERROR:  null value
in column "dtmcreated" violates not-null constraint
[*CORE/cake/libs/model/datasources/dbo_source.php*, line *526*]

Code  | Context 

$sql=   "INSERT INTO "tblcdlog" ("lngcdlog", "strerrordesc") VALUES
('157', 'value')"
$error  =   "ERROR:  null value in column "dtmcreated" violates not-null
constraint"
$out=   null

$out = null;if ($error) {
trigger_error("SQL
Error: {$this->error}", E_USER_WARNING);

DboSource::showQuery() -
CORE/cake/libs/model/datasources/dbo_source.php, line 526
DboSource::execute() - CORE/cake/libs/model/datasources/dbo_source.php, line 202
DboSource::create() - CORE/cake/libs/model/datasources/dbo_source.php, line 586
Model::save() - CORE/cake/libs/model/model.php, line 1287
TblstoresController::datacdload() -
APP/controllers/tblstores_controller.php, line 1031
Object::dispatchMethod() - CORE/cake/libs/object.php, line 115
Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 226
Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 193
[main] - APP/webroot/index.php, line 87

*Query:* INSERT INTO "tblcdlog" ("lngcdlog", "strerrordesc") VALUES
('157', 'value')



this is my table structure




   Table "public.tblcdlog"
 Column  |Type |
   Modifiers
-+-+-
 lngcdlog| integer | not null default
nextval('tblcdlog_lngcdlog_seq'::regclass)
 dtmcreated  | timestamp without time zone | not null
 strcdno | character varying(50)   |
 strversion  | character varying(50)   |
 lngcdlog_type   | integer | not null
 blnsuccess  | bit(1)  | not null
 strerrordesc| character varying(255)  |
 strupdateno | character varying(10)   |
 blnlogged_to_rr | boolean | not null default false
 tblcdlog_id | integer | not null default
nextval('tblcdlog_id_seq'::regclass)
Indexes:
"tblcdlog_pkey" PRIMARY KEY, btree (lngcdlog)
Foreign-key constraints:
"tblcdlog_lngcdlog_type_fkey" FOREIGN KEY (lngcdlog_type)
REFERENCES tlkcdlog_type(lngcdlog_type)

--


i wrote code like this


$this->data['Tblcdlog']['lngcdlog']=157;
$this->data['Tblcdlog']['strerrordesc']='value';
$this->Tblcdlog->save($this->data);



Please any one help me out



On Thu, May 13, 2010 at 4:46 PM, Dilip Godhani wrote:

> Hi,
> Suppose u want to update one row and its id is 1
> then u want
> following array
>
> $this->data['ModdelName']['id']=1;
> $this->data['ModdelName']['2field']='value';
>
> $this->ModelName->save($this->data);
>
>
> Array
> (
> [ModelName] => Array
> (
> [id] => 1
> [2field] => 'value'
> )
> )
>
>
>
>
> On Thu, May 13, 2010 at 3:52 PM, Narendra Padala 
> wrote:
>
>>
>>  Sir, looked at sir, but i am not getting properly, can u write one
>> example for my above code..please help me out sir
>>
>> On Thu, May 13, 2010 at 3:31 PM, Jeremy Burns  wrote:
>>
>>> Have you even looked at the online guide?
>>> http://book.cakephp.org/view/1031/Saving-Your-

Re: how write update query in cakephp

2010-05-13 Thread Narendra Padala
 Sir, looked at sir, but i am not getting properly, can u write one example
for my above code..please help me out sir
On Thu, May 13, 2010 at 3:31 PM, Jeremy Burns  wrote:

> Have you even looked at the online guide?
> http://book.cakephp.org/view/1031/Saving-Your-Data
>
> Jeremy Burns
> jeremybu...@me.com
>
>
> On 13 May 2010, at 11:00, Narendra Padala wrote:
>
> >
> > Hi...All!,
> >
> > I am new to cake php,I am suing postgreSql i need to update some
> > fields in my database. In my controller my code like thishere i
> > need convert these update command to cake, Please anyone can help me
> > out how to convert this in to cake.
> >
> >
> > function fun() {
> >
> > /**
> > ( 1 )**/
> > pg_exec($conn,"UPDATE tblcdlog SET strerrordesc = 'The CD could not be
> > mounted. Make sure it is a valid $COMPANY_NAME Data CD.' WHERE
> > lngcdlog = $lngCDLog");
> >
> >
> > /*** Here some content related to our script
> > */
> > $fError = fopen("/tmp/errorlog", "a+");
> > fwrite($fError, "ERROR : The CD may not be loaded in this $DEST_NAME...
> > \n\n");
> > fclose($fError);
> >
> > /
> >
> (2)/
> > pg_exec($conn,"UPDATE tblcdlog SET strerrordesc = 'There is not
> > sufficient space on your hard drive.' WHERE lngcdlog = $lngCDLog");
> >
> > /*** Here some content related to our script
> > */
> > $fError = fopen("/tmp/errorlog", "a+");
> > fwrite($fError, "ERROR : The CD may not be loaded in this $DEST_NAME...
> > \n\n");
> > fclose($fError);
> >
> > /
> >
> **(3)**/
> > pg_exec($conn,"UPDATE tblcdlog SET strerrordesc = 'There is not
> > sufficient space on your hard drive.' WHERE lngcdlog = $lngCDLog");
> >
> > /*** Here some content related to our script
> > */
> > $fError = fopen("/tmp/errorlog", "a+");
> > fwrite($fError, "ERROR : The CD may not be loaded in this $DEST_NAME...
> > \n\n");
> > fclose($fError);
> >
> > /
> >
> **(4)**/
> > pg_exec($conn,"UPDATE tblcdlog SET strerrordesc = 'The CD is not a
> > valid $COMPANY_NAME data CD.' WHERE lngcdlog = $lngCDLog");
> >
> > /*** Here some content related to our script
> > */
> > $fError = fopen("/tmp/errorlog", "a+");
> > fwrite($fError, "ERROR : The CD may not be loaded in this $DEST_NAME...
> > \n\n");
> > fclose($fError);
> >
> > /
> >
> **(5)**/
> > pg_exec($conn,"UPDATE tblcdlog SET strerrordesc = 'The CD may not be
> > loaded in this $DEST_NAME.' WHERE lngcdlog = $lngCDLog");
> >
> > /*** Here some content related to our script
> > */
> > $fError = fopen("/tmp/errorlog", "a+");
> > fwrite($fError, "ERROR : The CD may not be loaded in this $DEST_NAME...
> > \n\n");
> > fclose($fError);
> >
> > /
> >
> **(6)**/
> > pg_exec($conn,"UPDATE tblcdlog SET strcdno = '$identifiercode' WHERE
> > lngcdlog = $lngCDLog");
> >
> > /*** Here some content related to our script
> > */
> > $fError = fopen("/tmp/errorlog", "a+");
> > fwrite($fError, "ERROR : The CD may not be loaded in this $DEST_NAME...
> > \n\n");
> > fclose($fError);
> >
> > /
> >
> **(7)**/
> > pg_exec($conn,"UPDATE tblcdlog SET strerrordesc = 'Invalid
> > $COMPANY_NAME CD-Rom ID Code.' WHERE lngcdlog = $lngCDLog");
> >
> > /*** Here some content related to our script
> > */
> > $fError = fopen("/tmp/errorlog", "a+");
> > fwrite($fError, "ERROR : The CD may not be loaded in this $DEST_NAME...
> > \n\n");
> > fclose($fError);
> 

how write update query in cakephp

2010-05-13 Thread Narendra Padala

Hi...All!,

I am new to cake php,I am suing postgreSql i need to update some
fields in my database. In my controller my code like thishere i
need convert these update command to cake, Please anyone can help me
out how to convert this in to cake.


function fun() {

/**
( 1 )**/
pg_exec($conn,"UPDATE tblcdlog SET strerrordesc = 'The CD could not be
mounted. Make sure it is a valid $COMPANY_NAME Data CD.' WHERE
lngcdlog = $lngCDLog");


/*** Here some content related to our script
*/
$fError = fopen("/tmp/errorlog", "a+");
fwrite($fError, "ERROR : The CD may not be loaded in this $DEST_NAME...
\n\n");
fclose($fError);

/
(2)/
pg_exec($conn,"UPDATE tblcdlog SET strerrordesc = 'There is not
sufficient space on your hard drive.' WHERE lngcdlog = $lngCDLog");

/*** Here some content related to our script
*/
$fError = fopen("/tmp/errorlog", "a+");
fwrite($fError, "ERROR : The CD may not be loaded in this $DEST_NAME...
\n\n");
fclose($fError);

/
**(3)**/
pg_exec($conn,"UPDATE tblcdlog SET strerrordesc = 'There is not
sufficient space on your hard drive.' WHERE lngcdlog = $lngCDLog");

/*** Here some content related to our script
*/
$fError = fopen("/tmp/errorlog", "a+");
fwrite($fError, "ERROR : The CD may not be loaded in this $DEST_NAME...
\n\n");
fclose($fError);

/
**(4)**/
pg_exec($conn,"UPDATE tblcdlog SET strerrordesc = 'The CD is not a
valid $COMPANY_NAME data CD.' WHERE lngcdlog = $lngCDLog");

/*** Here some content related to our script
*/
$fError = fopen("/tmp/errorlog", "a+");
fwrite($fError, "ERROR : The CD may not be loaded in this $DEST_NAME...
\n\n");
fclose($fError);

/
**(5)**/
pg_exec($conn,"UPDATE tblcdlog SET strerrordesc = 'The CD may not be
loaded in this $DEST_NAME.' WHERE lngcdlog = $lngCDLog");

/*** Here some content related to our script
*/
$fError = fopen("/tmp/errorlog", "a+");
fwrite($fError, "ERROR : The CD may not be loaded in this $DEST_NAME...
\n\n");
fclose($fError);

/
**(6)**/
pg_exec($conn,"UPDATE tblcdlog SET strcdno = '$identifiercode' WHERE
lngcdlog = $lngCDLog");

/*** Here some content related to our script
*/
$fError = fopen("/tmp/errorlog", "a+");
fwrite($fError, "ERROR : The CD may not be loaded in this $DEST_NAME...
\n\n");
fclose($fError);

/
**(7)**/
pg_exec($conn,"UPDATE tblcdlog SET strerrordesc = 'Invalid
$COMPANY_NAME CD-Rom ID Code.' WHERE lngcdlog = $lngCDLog");

/*** Here some content related to our script
*/
$fError = fopen("/tmp/errorlog", "a+");
fwrite($fError, "ERROR : The CD may not be loaded in this $DEST_NAME...
\n\n");
fclose($fError);

/
**(8)**/
pg_exec($conn,"UPDATE tblcdlog SET strerrordesc = 'The CD has already
been loaded, and may not be loaded again.' WHERE lngcdlog =
$lngCDLog");

/*** Here some content related to our script
*/
$fError = fopen("/tmp/errorlog", "a+");
fwrite($fError, "ERROR : The CD may not be loaded in this $DEST_NAME...
\n\n");
fclose($fError);

/
**(9)**/
pg_exec($conn,"UPDATE tblcdlog SET blnsuccess = '1', strversion =
'$strVersion', strupdateno = '$strUpdateNo' WHERE lngcdlog =
$lngCDLog");

}



Please help me out Thanks in Advance..!



Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


when i am trying to insert a data in to database the following error shows please help me out

2010-05-12 Thread Narendra Padala
Hi..!,
I am new to cake php,usuing PostgreSql,When i am inserting a record
its shows the follwoing error any one please help me out.

Error:
-
Warning (2):pg_query() [function.pg-query]: Query failed: ERROR:
relation "tblcdlog_id_seq" does not exist [CORE/cake/libs/model/
datasources/dbo/dbo_postgres.php, line 155]

Warning (512):SQL Error: ERROR:  relation "tblcdlog_id_seq" does not
exist [CORE/cake/libs/model/datasources/dbo_source.php, line 526

Query: SELECT currval('tblcdlog_id_seq') as max


---
My database table structure like this
Sequence "public.tblcdlog_lngcdlog_seq"
   Column |  Type
---+-
 sequence_name | name
 last_value   | bigint
increment_by  | bigint
 max_value | bigint
 min_value | bigint
 cache_value   | bigint
 log_cnt   | bigint
 is_cycled | boolean
 is_called | boolean




Table : tblcdlog

   Table "public.tblcdlog"
 Column  |Type
|  Modifiers
-+-
+-
 lngcdlog | integer| not null
default nextval('tblcdlog_lngcdlog_seq'::regclass)
 dtmcreated| timestamp without time zone | not null
 strcdno  | character varying(50)   |
 strversion   | character varying(50)   |
 lngcdlog_type | integer   | not null
 blnsuccess | bit(1)  | not
null
 strerrordesc| character varying(255)  |
 strupdateno | character varying(10)   |
 blnlogged_to_rr |  boolean  | not null
default false
Indexes:
"tblcdlog_pkey" PRIMARY KEY, btree (lngcdlog)
Foreign-key constraints:
"tblcdlog_lngcdlog_type_fkey" FOREIGN KEY (lngcdlog_type)
REFERENCES tlkcdlog_type(lngcdlog_type)



I was worte code like this...!

   $strDate = date("Y-m-d H:i:s");
   echo $this->data['Tblcdlog']['dtmcreated']= $strDate;
   echo $this->data['Tblcdlog']['strcdno']= "C520080205";
   echo $this->data['Tblcdlog']['lngcdlog_type'] = 1;
   echo $this->data['Tblcdlog']['blnsuccess'] = 0;
   $this->Tblcdlog->create();
   if ($this->Tblcdlog->save($this->data)) {
$this->Session->setFlash('The clockin has been
saved');
   }

I have to insert data  this much only after some time i will update
the remaing fileds please help me outthanks in advance










Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


How to insert data in postgesql using cakephp

2010-05-10 Thread Narendra Padala
Hi i am new to cake php, how to insert data in to cakephp, i am using
PostgreSql please help me out.

$strDate="12-12-2010";
$IngCDLog_Type=".gif";


pg_exec($conn,"INSERT INTO tblcdlog(dtmcreated, strcdno,
lngcdlog_type, blnsuccess) VALUES ('$strDate', 'Unknown CD',
$lngCDLog_Type, '0')");

please any one help me, how to convert the above query into cakephp.

thanks in advance

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: email sending

2010-05-09 Thread Narendra Padala
Hi..! , i am  new to cakephp , i found this link for sending emails , i hope
you it will helpful for you

http://edwardawebb.com/web-development/cakephp/simple-email-component-cakephp


On Mon, May 10, 2010 at 4:42 AM, Renato de Freitas Freire <
renat...@gmail.com> wrote:

> i never could get smtp auth with core email component...
> and with phpmailer i did it like a piece of cake...
>
>
> --
> Renato de Freitas Freire
> ren...@morfer.org
>
>
> On Sun, May 9, 2010 at 1:54 PM, Ma'moon  wrote:
>
>> @Renato because the email component from CakePHP is a core component and
>> it fits much better with the framework, plus, whats exactly does phpMailer
>> gives you while Cake's email component doesn't?
>>
>>
>> On Sun, May 9, 2010 at 5:16 PM, Renato de Freitas Freire <
>> renat...@gmail.com> wrote:
>>
>>> Im using phpMailer to send emails with cakephp...
>>> It works really great for me...
>>>
>>> Why dont you try?
>>>
>>> --
>>> Renato de Freitas Freire
>>> ren...@morfer.org
>>>
>>>
>>>
>>> On Sat, May 8, 2010 at 10:13 AM, John Andersen 
>>> wrote:
>>>
 Or use your Gmail as your mail account in a smtp setup.
 See http://book.cakephp.org/view/176/Email for understanding of the
 Email component.
 Enjoy,
   John

 On May 8, 4:10 pm, "Ma'moon"  wrote:
 > Yes, you need to install an MTA in order to send emails from your
 server
 >
 [snip]

 Check out the new CakePHP Questions site http://cakeqs.org and help
 others with their CakePHP related questions.

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

>>>
>>>  Check out the new CakePHP Questions site http://cakeqs.org and help
>>> others with their CakePHP related questions.
>>>
>>> You received this message because you are subscribed to the Google Groups
>>> "CakePHP" group.
>>> To post to this group, send email to cake-php@googlegroups.com
>>> To unsubscribe from this group, send email to
>>> cake-php+unsubscr...@googlegroups.comFor
>>>  more options, visit this group at
>>> http://groups.google.com/group/cake-php?hl=en
>>>
>>
>>  Check out the new CakePHP Questions site http://cakeqs.org and help
>> others with their CakePHP related questions.
>>
>> You received this message because you are subscribed to the Google Groups
>> "CakePHP" group.
>> To post to this group, send email to cake-php@googlegroups.com
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.comFor
>>  more options, visit this group at
>> http://groups.google.com/group/cake-php?hl=en
>>
>
>  Check out the new CakePHP Questions site http://cakeqs.org and help
> others with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: how to display the particular month wise and partuclar day wise recods

2010-05-07 Thread Narendra Padala
i got it like this,

 $timesheet = $this->Timesheet->find('all',
  array('conditions' =>
array(
'user_id' =>
$id,'MONTH(`date`)'=>$currentMonth)));


On Fri, May 7, 2010 at 11:42 AM, heh  wrote:

> hi I'm new to cake too. But for doing in a standard sql you can use
>
> Ex: select * from timesheets where user_id='$id' AND 'date'='month';
> as
> select * from timesheets where user_id='$id' AND
> month('date')='month';
>
> assuming that you use mysql like me.
> for cake syntax you have to dig a bit about find condition.
> Sorry if it doesn't you much , a newb like you t000
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


how to display the particular month wise and partuclar day wise recods

2010-05-06 Thread Narendra Padala
Hi..!

I am new to cakephp, how to display the particular month wise and
partuclar day wise recods.
I was stored date database table "$date = date('Y-d-m');" format.

$id=$user_id;
$day=date(d);
$month=date(m);

Ex: select * from timesheets where user_id='$id' AND 'date'='month';
 
^
   'here idont know how to compare month, if u
know please help me out'





this is my table structure
-
table name: timesheets

id  int(11)
user_id int(11)
datedate
time_in time
time_outtime

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


how write update query in cakephp

2010-05-06 Thread Narendra Padala
Hi..!
I am new to cakephp,how to conver the following qyery in to cakephp
please any can help me out.

$timem _out = date('H:i:s');
$date = date('Y-d-m');

UPDATE Timesheets SET time_out = '$time_out' WHERE id = '2' AND date =
'$date';

thanks in advance...!


Actually this is my for data.


create('Timesheet',
array('action' => 'clockout')));
e($form->hidden('user_id',array('value'=>
$user_id)));
e($form->hidden('time_out',array('value'=>
$time_out )));
e($form->hidden('date',array('value'=>
$date)));
e($form->submit('Clock Out'));
e($form->end());
}
else {
echo "Clock Out";
   }

?>


here i need to write that update code please help me out


function clockout() {

$this->Timesheet->create();

$currentdate=$this->data['Timesheet']['date'];
$id=$this->data['Timesheet']['user_id'];

echo "here we want to update the time_out field using this id
(".$id.") and current date ".$currentdate;

   }

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: plz help me out

2010-04-30 Thread Narendra Padala
I was tried like this is correct or  not i dont know any one can help me out
$rsCDLog = pg_numrows($rsCDLog);


var $intCDLogCnt = $this->Tblcdlog->find(
 'count', array(
'conditions' => array(
'Tblcdlog.blnsuccess' => 1
),
'fields' => array(
'Tblcdlog.dtmcreated'
)
        )
);

On Fri, Apr 30, 2010 at 4:13 PM, Narendra Padala wrote:

> $intProfileCnt = pg_numrows($rsProfile);
>
>
> var $intCDLogCnt = $this->Tblcdlog->find(
>  'count', array(
> 'conditions' => array(
> 'Tblcdlog.blnsuccess' => 1
> ),
> 'fields' => array(
> 'Tblcdlog.dtmcreated'
> )
> )
> );
>
> I was tried like this is correct or  not i dont know any one can help me
> out
>
>
> On Wed, Apr 28, 2010 at 3:54 PM, Jeremy Burns wrote:
>
>> Almost...
>>
>> You need to run finds/counts against the model that is related to your
>> table. For your table tblmusicprofiles your model will be Tblmusicprofile
>> (singular, camel cased).
>>
>> So, for example, your find statement would be something like this:
>>
>> $rsProfile = $this->Tblmusicprofile->find(
>> 'all',
>>  array(
>> 'conditions' => array(
>> 'Tblmusicprofile.lngprofile' => '$PROFILE_ID'
>>  ),
>> 'fields' => array(
>> 'Tblmusicprofile.strprofilename'
>>  )
>> )
>> );
>>
>> I would also recommend looking up the Containable behaviour (
>> http://book.cakephp.org/view/1323/Containable).
>>
>> Your table naming convention is not ideal. I'd point you towards
>> http://book.cakephp.org/view/903/Model-and-Database-Conventions for more
>> details.
>>
>>
>>  Jeremy Burns
>> jeremybu...@me.com 
>>
>>
>> On 28 Apr 2010, at 11:13, chandrasekhar reddy wrote:
>>
>> I am new for cakephp plz help me out . below statements are correct or
>> wrong . idontknow
>>
>>
>> While converting this sql query into cakephp for result set and count
>>
>> 1.  Result set
>>
>> $rsProfile = pg_exec($conn,"SELECT strprofilename FROM tblmusicprofiles
>> WHERE lngprofile = $PROFILE_ID");
>>
>>
>>
>> var $rsProfile = $this->tblmusicprofiles->find('all', array('conditions'
>> => array('tblmusicprofiles.lngprofile' => '$PROFILE_ID'),
>>  'fields' => array('tblmusicprofiles.strprofilename')));
>>
>>
>>
>>
>> 2. count
>>
>>  $intProfileCnt = pg_numrows($rsProfile);
>>
>>
>> var $intProfileCnt = $this->tblmusicprofiles->find('count',
>> array('conditions' => array('tblmusicprofiles.lngprofile' => '$PROFILE_ID'),
>>'fields' => array('tblmusicprofiles.strprofilename')));
>>
>>
>>
>>
>> Check out the new CakePHP Questions site http://cakeqs.org and help
>> others with their CakePHP related questions.
>>
>> You received this message because you are subscribed to the Google Groups
>> "CakePHP" group.
>> To post to this group, send email to cake-php@googlegroups.com
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com For more options, visit this group
>> at http://groups.google.com/group/cake-php?hl=en
>>
>>
>>  Check out the new CakePHP Questions site http://cakeqs.org and help
>> others with their CakePHP related questions.
>>
>> You received this message because you are subscribed to the Google Groups
>> "CakePHP" group.
>> To post to this group, send email to cake-php@googlegroups.com
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.comFor
>>  more options, visit this group at
>> http://groups.google.com/group/cake-php?hl=en
>>
>
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: plz help me out

2010-04-30 Thread Narendra Padala
$intProfileCnt = pg_numrows($rsProfile);


var $intCDLogCnt = $this->Tblcdlog->find(
 'count', array(
'conditions' => array(
'Tblcdlog.blnsuccess' => 1
),
'fields' => array(
'Tblcdlog.dtmcreated'
)
)
);

I was tried like this is correct or  not i dont know any one can help me out

On Wed, Apr 28, 2010 at 3:54 PM, Jeremy Burns  wrote:

> Almost...
>
> You need to run finds/counts against the model that is related to your
> table. For your table tblmusicprofiles your model will be Tblmusicprofile
> (singular, camel cased).
>
> So, for example, your find statement would be something like this:
>
> $rsProfile = $this->Tblmusicprofile->find(
> 'all',
> array(
> 'conditions' => array(
> 'Tblmusicprofile.lngprofile' => '$PROFILE_ID'
> ),
> 'fields' => array(
> 'Tblmusicprofile.strprofilename'
> )
> )
> );
>
> I would also recommend looking up the Containable behaviour (
> http://book.cakephp.org/view/1323/Containable).
>
> Your table naming convention is not ideal. I'd point you towards
> http://book.cakephp.org/view/903/Model-and-Database-Conventions for more
> details.
>
>
> Jeremy Burns
> jeremybu...@me.com 
>
>
> On 28 Apr 2010, at 11:13, chandrasekhar reddy wrote:
>
> I am new for cakephp plz help me out . below statements are correct or
> wrong . idontknow
>
>
> While converting this sql query into cakephp for result set and count
>
> 1.  Result set
>
> $rsProfile = pg_exec($conn,"SELECT strprofilename FROM tblmusicprofiles
> WHERE lngprofile = $PROFILE_ID");
>
>
>
> var $rsProfile = $this->tblmusicprofiles->find('all', array('conditions' =>
> array('tblmusicprofiles.lngprofile' => '$PROFILE_ID'),
>  'fields' => array('tblmusicprofiles.strprofilename')));
>
>
>
>
> 2. count
>
>  $intProfileCnt = pg_numrows($rsProfile);
>
>
> var $intProfileCnt = $this->tblmusicprofiles->find('count',
> array('conditions' => array('tblmusicprofiles.lngprofile' => '$PROFILE_ID'),
>'fields' => array('tblmusicprofiles.strprofilename')));
>
>
>
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php?hl=en
>
>
>  Check out the new CakePHP Questions site http://cakeqs.org and help
> others with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


how to convert postgresql $intCDLogCnt = pg_numrows($rsCDLog); function into cake

2010-04-30 Thread Narendra Padala
Hi...Everyone!

I am new to cakephp , I am using postgres sql, i have problem like
this i am able to convert this psql query to cake but
pg_numrows() is i am not able convert. so please any one can help me
out.


 $rsCDLog = pg_exec($conn, "SELECT dtmcreated  FROM tblcdlog WHERE
blnsuccess = '1'");

 $rsProfile = $this->Tblcdlog->find('all',
 array('conditions' => array(
 
'Tblcdlog.blnsuccess' => 1),
   'fields' => array(
 
'Tblcdlog.dtmcreated')));


 $intCDLogCnt = pg_numrows($rsCDLog);

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: I have a problem when i am creating user login authentication

2010-04-29 Thread Narendra Padala
Its currently running project, thats why are not at all do any changes in
the database table.
I have to use the same table only, i have no right to change the table, is
their any way please help me out
On Thu, Apr 29, 2010 at 12:48 PM, Andrei Mita  wrote:

> I believe your table should be pluralized: users
>
> Also, why do you use tbl before you table names?
>
>
>
> On Thu, Apr 29, 2010 at 10:11 AM, Narendra Padala 
> wrote:
>
>>
>>
>> Hi..Every one ,
>> i am using postgresql database for cake when i am creating the user
>> authentication its show errors,
>> hope u i wrote properly but it shows Error, i wrote code like this
>> please any one can help me out.
>>
>>
>> My Database Table Name "tbluser "
>> --
>>
>>
>> Columns|  Type
>> |  Modifiers
>> +
>> +-
>>  lnguser| integer| not null default
>> nextval(('"tbluser_lnguser_seq"'::text)::regclass)
>>  strfname   | character varying(100) | not null
>>  strlname   | character varying(100) | not null
>>  struid | character varying(100) | not null
>>  strpid | character varying(100) | not null
>>  lnguser_group  | integer| not null
>>  strtelarea | character varying(20)  |
>>  strtelno   | character varying(20)  |
>>  stremail   | character varying(100) |
>>  struserconfirm | character varying(100) |
>>  dtmregistered  | date   |
>>  dtmapproved| date   |
>>  blnchatuser| bit(1) |
>> Indexes:
>>"tbluser_pkey" PRIMARY KEY, btree (lnguser)
>>
>>
>>
>> --
>>
>> Model : tbluser.php
>>
>> class Tbluser extends AppModel {
>>
>>var $useTable = 'tbluser';
>>
>> }
>>
>>
>> --
>>
>> Controller:tblusers_controller.php
>>
>>
>> class TblusersController extends AppController {
>>
>>var $name = "Tblusers";
>>
>>function login() {
>>
>>}
>>
>>function index() {
>>
>>}
>>function logout() {
>>
>>$this->Session->setFlash('Logout');
>>
>>$this->redirect($this->Auth->logout());
>>}
>> }
>>
>> --
>> App Controller :app_controller.php
>>
>>
>> class AppController extends Controller {
>>
>>var $uses=array('Tbluser');
>>
>>var $components = array('Auth');
>>
>>function beforeFilter(){
>>$this->Auth->loginRedirect = array('controller'=> 'tblusers',
>>   'action' => 'index');
>>$this->Auth->logoutRedirect = array('controller'=> 'tblusers',
>>'action' => 'login');
>>
>>$this->Auth->allow('login');
>>
>>$this->Auth->authorize = 'controller';
>>
>>$this->set('loggedIn', $this->Auth->Tbluser('lnguser')); //
>> Here I am getting the error
>>}
>>
>>function isAuthorized() {
>>return true;
>>}
>> }
>>
>> 
>> viewfile : login.ctp
>>
>> create('Tbluser',
>>  array(
>>  'action' => 'login'));
>> ?>
>>> cellpadding="0">
>>
>>> valign="middle">USERNAME
>>> td>
>>
>>> e($form->text('struid'));
>>?>
>>
>> 
>>

I have a problem when i am creating user login authentication

2010-04-29 Thread Narendra Padala


Hi..Every one ,
i am using postgresql database for cake when i am creating the user
authentication its show errors,
hope u i wrote properly but it shows Error, i wrote code like this
please any one can help me out.


My Database Table Name "tbluser "
--


 Columns|  Type
|  Modifiers
+
+-
 lnguser| integer| not null default
nextval(('"tbluser_lnguser_seq"'::text)::regclass)
 strfname   | character varying(100) | not null
 strlname   | character varying(100) | not null
 struid | character varying(100) | not null
 strpid | character varying(100) | not null
 lnguser_group  | integer| not null
 strtelarea | character varying(20)  |
 strtelno   | character varying(20)  |
 stremail   | character varying(100) |
 struserconfirm | character varying(100) |
 dtmregistered  | date   |
 dtmapproved| date   |
 blnchatuser| bit(1) |
Indexes:
"tbluser_pkey" PRIMARY KEY, btree (lnguser)


--

Model : tbluser.php

class Tbluser extends AppModel {

var $useTable = 'tbluser';

}


--

Controller:tblusers_controller.php


class TblusersController extends AppController {

var $name = "Tblusers";

function login() {

}

function index() {

}
function logout() {

$this->Session->setFlash('Logout');

$this->redirect($this->Auth->logout());
}
}

--
App Controller :app_controller.php


class AppController extends Controller {

var $uses=array('Tbluser');

var $components = array('Auth');

function beforeFilter(){
$this->Auth->loginRedirect = array('controller'=> 'tblusers',
   'action' => 'index');
$this->Auth->logoutRedirect = array('controller'=> 'tblusers',
'action' => 'login');

$this->Auth->allow('login');

$this->Auth->authorize = 'controller';

$this->set('loggedIn', $this->Auth->Tbluser('lnguser')); //
Here I am getting the error
}

function isAuthorized() {
return true;
}
}


viewfile : login.ctp

 create('Tbluser',
  array(
  'action' => 'login'));
 ?>


USERNAME


text('struid'));
?>

 


 
 
 
 


PASSWORD


password('strpid');
?>

 


 
 
 
 



submit('signin.gif',array(
 'onclick'
=> 'validate()'));

?>

end(); ?>

-
Fatal error: Call to undefined method AuthComponent::tbluser() in /
home/narendra/wizard_mvc/app/app_controller.php


Please help me out.! Thanks in advance

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: How to write to_char() function in cakephp

2010-04-26 Thread Narendra Padala
thanks sir

On Mon, Apr 26, 2010 at 10:00 PM, cricket  wrote:

> On Apr 26, 9:44 am, Narendra Padala  wrote:
> > Hi all,
> > I am new to cakephp i have problem like this please help me out sir
> >
> > $currentday = date("w");
> >
> > $rsStoreTime = pg_exec($conn, "SELECT
> > intdaynumber,to_char(dtmopeningtime,'HH24:mi') AS
> > dtmopeningtime,to_char(dtmclosingtime,'HH24:mi') AS dtmclosingtime
> > FROM tblstorehours where intdaynumber = '$currentday'");
> >
> > above query  how can i convert into cakephp
> >
> > and
> >
> > $intCnt = pg_numrows($rsStoreTime);
> >
> > this query also how can i convert into cakephp .
>
> It's a bit tricky to provide an example as your names do not follow
> Cake's convention, so I'll have to assume a few things. First, that
> the model name is StoreHour (maybe you should post the model name and
> its associations).
>
> So, from StoreHoursController:
>
> $rsStoreTime = $this->StoreHour->find(
>'first',
>array(
>'fields' => array(
>'StoreHour.intdaynumber',
> 'to_char(dtmopeningtime,"HH24:mi") AS
> dtmopeningtime',
> 'to_char(dtmclosingtime,"HH24:mi") AS
> dtmclosingtime'
>),
>'conditions' => array(
>'StoreHour.intdaynumber' => date('w')
>)
>)
> );
>
>
> But there's one thing you have to know about Cake. When using
> calculated fields like this, Cake puts the result in a spearate array
> than normal. See this article for a clear explanation as well as a
> quick fix:
>
>
> http://teknoid.wordpress.com/2008/09/29/dealing-with-calculated-fields-in-cakephps-find/
>
> Also, if you're using version 1.3 you should have a look at "virtual
> fields". See here:
>
> http://book.cakephp.org/view/1608/Virtual-fields
>
>
> But you really should re-name things to follow Cake's naming
> conventions, though. It'll save you a lot of trouble in the end.
>
> table: store_hours
>
> fields: day (not reserved in Postgres), opening_time, closing_time
>
> And, while i'm a big fan of using a database's built-in functions (and
> a big fan of PG) I wonder if it's worth doing all this in the query.
> You could simply make the conversion in the view using PHP.
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


How to write to_char() function in cakephp

2010-04-26 Thread Narendra Padala
Hi all,
I am new to cakephp i have problem like this please help me out sir



$currentday = date("w");



$rsStoreTime = pg_exec($conn, "SELECT
intdaynumber,to_char(dtmopeningtime,'HH24:mi') AS
dtmopeningtime,to_char(dtmclosingtime,'HH24:mi') AS dtmclosingtime
FROM tblstorehours where intdaynumber = '$currentday'");

above query  how can i convert into cakephp

and

$intCnt = pg_numrows($rsStoreTime);


this query also how can i convert into cakephp .

Sir any one please help me out sir, thanks in advance

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


How to display form submitted data without using model and with model in the same controller

2010-04-22 Thread Narendra Padala
How to display form submitted data without using model and with model
in the same controller
Hi..All,
I am new to cake php i have problem like this



Table:

 CREATE TABLE `user`.`users` (
  `name` VARCHAR( 60 ) NOT NULL
   );


Step :1

Model : user.php



Step : 2

controller : users_controller.php

data[name];  // this is data base field- 'name'
}

function testtwo()
{
 echo this->data[testname];   // here out pot is not
displayed
}

}

?>



STEP 3:

View files 1 : testone.ctp

 create(null, array('action'
=>'testone'));
  e($form->text('name');
  echo $form->submit('TestOneDisp');
  echo $form->end();
 ?>



View files 2 : testtwo.ctp

 create(null, array('action'
=>'testtwo'));
  e($form->text('testname');
  echo $form->submit('TestTwoDisp');
  echo $form->end();
 ?>


Suppose when i am using var $uses =array(); i am getting the testtwo
output, but not getting the testone out put. if leave the  var
$uses=array() i am getting the testone output but not getting the
testtwo output. so please help me out. i have to display both results
in the same controller.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


where can i write controller for elements please help me out.

2010-04-21 Thread Narendra Padala

Hi All,
I am new to cakephp, When i am try to create menu i have problem,
where can i write controller for elements please help me out.


include file code here : views/elements/gravitybar.ctp
--

---gravitybar.ctp code start---



 

   
  
   

   

   



image($arrImages[$mainmenu],array('title'=>$hint,
 
'border'=>0,
 
'url' => array(
 
'controller'=>$ctrl,
 
'action'=>'$metchod',
 
$intCurrentMenu,)));
?>







  
  

   image($strMenuImg,array('title'=> $hint,
 
'border'=>0,
  'url' =>
array(
 
'controller'=>$ctrl,
 
'action'=>'index',$strMenuURL,)));
   ?>
  
  

 

  
  











 

  






---gravitybar.ctp code end---


Controller method
---

function gravitybar($intCurrentMenu=-1){

 if(!isset($intCurrentMenu)){
  $intCurrentMenu = "-1";
 // $this->set('intCurrentMenu', $intCurrentMenu );
 }

 if($intCurrentMenu == ""){
 $intCurrentMenu = "-1";
 $this->set('intCurrentMenu', $intCurrentMenu );
 }


 if(isset($intCurrentMenu)){
 // $this->set('intCurrentMenu', $intCurrentMenu );
 }




 ## Start menu population ##



 $arrMenuItem = array("Wizard",
  "Advertisements",
  "Music",
  "Settings",
  "Logs",
  "Program Options"
 );




 $arrMenuHint = array("Links on wizard main page",
  "Play advertisements",
  "Manipulate music",
  "Change settings",
  "View logs",
  "Create users and groups");







 //$strURLDir = "player/";


 $arrMenuChild[0] = array("Volumes",
  "Format Clock",
  "Times",
  "Today's Music",
  "Feedback",
  "Profiles",
  "Media Loader",
  "System",
  "Reports",
  "Details",
  "Broadcast Manager"
);


 $arrMenuImg[0] = array("wizard_volume.png",
"format_clock.gif",
"wizard_time.png",
"wizard_music.png",
"wizard_feedback.png",
"wizard_profile.png",
"media_loader1.png",
"wizard_diagnostic.png",
"wizard_reports.png",
"wizard_details.png",
"broadcast1.png"
  );


 $arrMenuURL[0] = array("volumes.php",
"format_clock/index.php",
"store_times.php",
"todays_music.php",
"feedback.php",
"profiles.php",
"medialoader.php",
"system.php",
"menu.php",
"store_details.php",
"broadcastmanagement.php"
   );





 //$strURLDir = "";



 $arrMenuChild[1] = array("Play an Advertisement",
  "Multiple Scheduler",
  "Media Loader",
  "Advertisement Schedule",
  "Scheduled Files In Waiting",
  "Scheduled Files Played"
 );


 $arrMenuImg[1] = array("play.gif",
"multiple.png",
"medialoader.png",
"annsched.png",
"schedfileswait.png",
"schedfilesplayed.png"
   );


 $arrMenuURL[1] = array("custom_scheduler.php",
 

How to avoid the redundant code, is it possible to write that code write in one function and we have to call other functions, please help me out

2010-04-21 Thread Narendra Padala
Hi all i am new to cake php please help me

My problem is:

common code for all the controller methods and other controller
methods also

--common code start---

 if(!isset($intCurrentMenu)){
  $intCurrentMenu = "-1";
 // $this->set('intCurrentMenu', $intCurrentMenu );
 }

 if($intCurrentMenu == ""){
 $intCurrentMenu = "-1";
 $this->set('intCurrentMenu', $intCurrentMenu );
 }


 if(isset($intCurrentMenu)){
 // $this->set('intCurrentMenu', $intCurrentMenu );
 }




 ## Start menu population ##



 $arrMenuItem = array("Wizard",
  "Advertisements",
  "Music",
  "Settings",
  "Logs",
  "Program Options"
 );




 $arrMenuHint = array("Links on wizard main page",
  "Play advertisements",
  "Manipulate music",
  "Change settings",
  "View logs",
  "Create users and groups");







 //$strURLDir = "player/";


 $arrMenuChild[0] = array("Volumes",
  "Format Clock",
  "Times",
  "Today's Music",
  "Feedback",
  "Profiles",
  "Media Loader",
  "System",
  "Reports",
  "Details",
  "Broadcast Manager"
);


 $arrMenuImg[0] = array("wizard_volume.png",
"format_clock.gif",
"wizard_time.png",
"wizard_music.png",
"wizard_feedback.png",
"wizard_profile.png",
"media_loader1.png",
"wizard_diagnostic.png",
"wizard_reports.png",
"wizard_details.png",
"broadcast1.png"
  );


 $arrMenuURL[0] = array("volumes.php",
"format_clock/index.php",
"store_times.php",
"todays_music.php",
"feedback.php",
"profiles.php",
"medialoader.php",
"system.php",
"menu.php",
"store_details.php",
"broadcastmanagement.php"
   );





 //$strURLDir = "";



 $arrMenuChild[1] = array("Play an Advertisement",
  "Multiple Scheduler",
  "Media Loader",
  "Advertisement Schedule",
  "Scheduled Files In Waiting",
  "Scheduled Files Played"
 );


 $arrMenuImg[1] = array("play.gif",
"multiple.png",
"medialoader.png",
"annsched.png",
"schedfileswait.png",
"schedfilesplayed.png"
   );


 $arrMenuURL[1] = array("custom_scheduler.php",
"custom_scheduler_multiple.php",
"medialoader.php",
"announcement_schedule.php",
"schedfiles_waiting.php",
"schedfiles_played.php"
   );


 //$strURLDir = "";


 $arrMenuChild[2] = array("Music History",
  "Music Profiles",
  "Media Loader",
  "CD-ROM Tray"
 );


 $arrMenuImg[2] = array("music_history.gif",
"music_profiles.png",
"medialoader.png",
"cdromtray.png"
   );


 $arrMenuURL[2] = array("music_history.php",
"music_profiles.php",
"medialoader.php",
"cdromtray.php"
   );



 //$strURLDir = "";


 

Is it possible to write common code in one function and i have to call that function when i was required

2010-04-20 Thread Narendra Padala
 Hi all..!
 I am new to cakephp i have problem, i have to use same code in
multiple functions, example



My Problem is, how can i avoid this code redundancy , Is their any the
common code will write one file and i have to include file, or i have
to write the common code in one function and
i have to call in the controller functions. Please help me
outthanks in advance

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: Sending view parameters to javascript function

2010-04-16 Thread Narendra Padala
hi all

var username=Form.Element.getValue('UserUsername');


i have a  doubt

"UserUsername "  - field  name or form name or model name and is there any
specilalcharacte between User and Username.

i am using this both form name and inputfiled name

Form name : echo $form->create('User', array('action' =>'login'));

input filed :  echo $form->input(username);

I am using
On Fri, Apr 16, 2010 at 4:27 PM, Ed Propsner  wrote:

> If it's your Javascript that's not working I would use:
>
> function validate(
>{
> var username=Form.Element.getValue('UserUsername');
> window.alert("username");
>}
>
> - Ed
>
> On Fri, Apr 16, 2010 at 6:46 AM, Ambika Kulkarni <
> ambikakulkarn...@gmail.com> wrote:
>
>> Hi All,
>>
>> I want to send the post data to a javascript function. I have put the
>> code below . Please help name
>>
>> view.ctp
>> If I am just calling the js function it works.
>>
>> .
>> function  validate(){
>> window.alert("It's working");
>> }
>>
>> create('User', array('action' =>'login'));
>>  echo $form->input(username);
>> echo $form-
>>
>> >submit('signin.gif',array('width'=>100,'height'=>22,'onclick'=>'validate()'));
>>  echo $form->end();
>>  ?>
>>
>> But when I am trying to do like the following it wont work
>>
>>function validate()
>>{
>> var username=document.User.username.value;
>> window.alert("username");
>>}
>>
>> create('User', array('action' =>'login'));
>>  echo $form->input(username);
>> echo $form->submit('signin.gif',array('width'=>100,
>> 'height'=>22,'onclick'=>'validate()'));
>> echo $form->end(); ?>
>>
>>
>> Check out the new CakePHP Questions site http://cakeqs.org and help
>> others with their CakePHP related questions.
>>
>> You received this message because you are subscribed to the Google Groups
>> "CakePHP" group.
>> To post to this group, send email to cake-php@googlegroups.com
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.comFor
>>  more options, visit this group at
>> http://groups.google.com/group/cake-php?hl=en
>>
>
>  Check out the new CakePHP Questions site http://cakeqs.org and help
> others with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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


Re: Sending view parameters to javascript function

2010-04-16 Thread Narendra Padala
Hi !
I am using the same code, but i am not getting the out. please help me
out

On Apr 16, 3:57 pm, Ed Propsner  wrote:
> If it's your Javascript that's not working I would use:
>
> function validate()
>        {
>             var username=Form.Element.getValue('UserUsername');
>             window.alert("username");
>        }
>
> - Ed
>
> On Fri, Apr 16, 2010 at 6:46 AM, Ambika Kulkarni 
>
>
> > wrote:
> > Hi All,
>
> > I want to send the post data to a javascript function. I have put the
> > code below . Please help name
>
> > view.ctp
> > If I am just calling the js function it works.
>
> > .
> > function  validate()    {
> >             window.alert("It's working");
> > }
>
> > create('User', array('action' =>'login'));
> >  echo $form->input(username);
> > echo $form-
>
> > >submit('signin.gif',array('width'=>100,'height'=>22,'onclick'=>'validate()'));
> >  echo $form->end();
> >  ?>
>
> > But when I am trying to do like the following it wont work
>
> >        function validate()
> >        {
> >             var username=document.User.username.value;
> >             window.alert("username");
> >        }
>
> > create('User', array('action' =>'login'));
> >  echo $form->input(username);
> > echo $form->submit('signin.gif',array('width'=>100,
> > 'height'=>22,'onclick'=>'validate()'));
> > echo $form->end(); ?>
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> > with their CakePHP related questions.
>
> > You received this message because you are subscribed to the Google Groups
> > "CakePHP" group.
> > To post to this group, send email to cake-php@googlegroups.com
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.comFor
> >  more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
> their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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