Re: Cakephp,Auth with Oracle connectivity
Nice to know that after such a long time someone is there to help... I will try this and will get back in case it works.. Regards Tapan Thapa On Mon, Apr 11, 2011 at 8:11 PM, ojonam manojo10...@gmail.com wrote: Hi, this is because Oracle has a list of reserved keywords (like User) which make your query impossible to deal with for Oracle. The full list is available here : http://download.oracle.com/docs/cd/B10500_01/appdev.920/a42525/apb.htm. This means that you cannot use the term 'User' directly in a query. Your option is to create an alias for the user model. In the model/user.php file, add the following: class User extends AppModel { var $name = 'User'; var $alias = 'Mem'; Hope this helps! PS: your error is actually an Oracle SQL error. Try using SQLDeveloper or some other client to test these queries independently of cake. -- 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 -- 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: Cakephp,Auth with Oracle connectivity
Hello Manoj, I can confirm that after putting alias, i am able to login with oracle database. However in my login page after putting alias i am getting some notice and warning. *Notice* (8): Trying to get property of non-object [*CORE\cake\libs\view\helper.php*, line *458*] *Warning* (2): array_keys() expects parameter 1 to be array, null given [*CORE\cake\libs\view\helper.php*, line *458*] *Warning* (2): in_array() expects parameter 2 to be array, null given [*CORE\cake\libs\view\helper.php*, line *458*] Can you please suggest how to resolve this issue? Regards Tapan Thapa On Mon, Apr 11, 2011 at 8:33 PM, Tapan Kumar Thapa tapan.th...@hindustantimes.com wrote: Nice to know that after such a long time someone is there to help... I will try this and will get back in case it works.. Regards Tapan Thapa On Mon, Apr 11, 2011 at 8:11 PM, ojonam manojo10...@gmail.com wrote: Hi, this is because Oracle has a list of reserved keywords (like User) which make your query impossible to deal with for Oracle. The full list is available here : http://download.oracle.com/docs/cd/B10500_01/appdev.920/a42525/apb.htm. This means that you cannot use the term 'User' directly in a query. Your option is to create an alias for the user model. In the model/user.php file, add the following: class User extends AppModel { var $name = 'User'; var $alias = 'Mem'; Hope this helps! PS: your error is actually an Oracle SQL error. Try using SQLDeveloper or some other client to test these queries independently of cake. -- 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 -- 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
Small help required...
Hello Group, I am stuck in one situation and i don't know how to come out from that issue. I have created a view with form helper where in i am asking users to select start and end date. Once user is clicking on submit button after selecting start and end date, i am fetching record from my database and showing in another view. Everything is going good so far but now what i want is to create a checkbox right after my record in view (by default checked) and if user click on submit button (a kind of form which i have not created yet.) then i want to update the db record. (I don't know how to achieve this with cake php 1.3.7). Please suggest. Regards Tapan Thapa India -- 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: Small help required...
Thanks it works... (http://book.cakephp.org/view/1414/checkbox) On Mon, Mar 21, 2011 at 5:25 PM, Shaz shazam...@gmail.com wrote: http://book.cakephp.org/view/1414/checkbox http://book.cakephp.org/view/1031/Saving-Your-Data ^^ Have a quick read - it's explained there. On Mar 21, 10:45 am, Tapan Kumar Thapa tapan.th...@hindustantimes.com wrote: Hello Group, I am stuck in one situation and i don't know how to come out from that issue. I have created a view with form helper where in i am asking users to select start and end date. Once user is clicking on submit button after selecting start and end date, i am fetching record from my database and showing in another view. Everything is going good so far but now what i want is to create a checkbox right after my record in view (by default checked) and if user click on submit button (a kind of form which i have not created yet.) then i want to update the db record. (I don't know how to achieve this with cake php 1.3.7). Please suggest. Regards Tapan Thapa India -- 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 -- 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
cakephp 1.3.7 and MongoDB question.
Hello Group, Can any one give me some suggestion how to get distinct or group by columns from MongoDB? I am using https://github.com/ichikaway/mongoDB-Datasource link for Cakephp and MongoDB integration. My query is like this. $winnersdrawnquery = $this-Karbonnincoming-find('all', array( 'fields' = array('msisdn', 'imei', 'received', 'operator', 'circle'), 'order' = rand(), 'limit' = '3', 'group' = 'msisdn', 'conditions' = array(Karbonnincoming.created = array('$gt' = $startdate, '$lte' = $enddate), 'Karbonnincoming.status' = 'Valid'), 'contain' = false)); $this-set('winners', $winnersdrawnquery); But it is not working with group condition. Please suggest. Regards Tapan Thapa -- 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: date time calendar picker
Hello Community, I finally managed to achieve what i was wanting with calendar. Good calendar with date,time and seconds. ( http://www.rainforestnet.com/datetimepicker-tutorial.htm) My code to use above calender in $this-Form-input is: ?php echo $this-Html-script('datetimepicker_css'); //(Actual datetimepicker_css.js i have put under C:\Projects\cakephp-1.3.7-0-g9f58309\app\webroot\js\datetimepicker_css.js) ? p align=center?php echo 'Welcome ' . $this-Session-read('Auth.User.first_name') . '.'; ?/pp align=right?php echo $this-Html-link('Logout', array('controller' = 'users', 'action' = 'logout')); ?/p bReports/b ?php echo $this-Form-create(array('controller' = 'users', 'action' = 'view')); echo $form-input('StartDate',array('label'='StartDate','type'='text', 'onclick'=javascript:NewCssCal ('IncomingStartDate','MMdd','arrow',true,'24',true))); echo $form-input('EndDate',array('label'='EndDate','type'='text', 'onclick'=javascript:NewCssCal ('IncomingEndDate','MMdd','arrow',true,'24',true))); echo $this-Form-end('Search'); ? Thanks all for your input and this is for some else as well if they want to achieve the same. Regards Tapan Thapa India On Wed, Feb 23, 2011 at 9:02 PM, Tapan Kumar Thapa tapan.th...@hindustantimes.com wrote: No i am sorry but i don't want to use ajax at all as i don't have much knowledge on this. I just to enable start and end date search via a calendar which should have date and time with seconds feature so i have found out jquery calendar ( http://jqueryui.com/demos/). I want to implement this with cake form helper (or with any other method). Please suggest. Regards Tapan Thapa India On Wed, Feb 23, 2011 at 5:12 PM, Deividas J jdeivi...@gmail.com wrote: if I understand you well you want to call action with .ajax. I do like this: echo $this-Form-create(null, array( 'default' = false, 'inputDefaults' = array( 'label' = false, 'div' = false ) )); //Input- echo $this-Form-input('StartDate', array( 'type' = 'datetime', 'dateFormat' = 'DMY', 'minYear' = date('Y'), 'maxYear' = date('Y'), 'timeFormat' = '24', 'selected' = date('Y-m-d 0:00:s'), 'attributes' = array(), 'empty' = FALSE ) ); echo $this-Form-input('EndDate', array( 'type' = 'datetime', 'dateFormat' = 'DMY', 'minYear' = date('Y'), 'maxYear' = date('Y'), 'timeFormat' = '24', //'selected' = null, 'selected' = date('Y-m-d H:i:s'), 'attributes' = array(), 'empty' = FALSE ) ); //-- echo $this-Form-end(array( 'label' = 'Search', 'id' = 'seach' )); $this-Js-get('#seach')-event('click', $this-Js-request( array( 'controller' = 'users', 'action' = 'view', ), array( 'async' = true, 'dataExpression' = true, 'type' = 'json', 'method' = 'post', 'data' = $js-serializeForm(array('isForm' = false, 'inline' = true)), 'success' = 'renderTrack(data);', ) )); I hope you looking for this. On Wed, Feb 23, 2011 at 1:33 PM, Tapan Kumar Thapa tapan.th...@hindustantimes.com wrote: Hello Community, Finally i have got one jquery based calendar. http://jqueryui.com/docs/Getting_Started how to from this site: input type=text name=date id=date / *JS:* $('#date').datepicker(); My current code to select date with form helper is: echo $this-Form-create(array('controller' = 'users', 'action' = 'view')); echo $this-Form-input('StartDate', array( 'type' = 'datetime', 'dateFormat' = 'DMY', 'minYear' = date('Y'), 'maxYear' = date('Y'), 'timeFormat' = '24', 'selected' = date('Y-m-d 0:00:s'), 'attributes' = array(), 'empty' = FALSE ) ); echo $this-Form-input('EndDate', array( 'type' = 'datetime', 'dateFormat' = 'DMY', 'minYear' = date('Y'), 'maxYear' = date('Y'), 'timeFormat' = '24', //'selected' = null, 'selected' = date('Y-m-d H:i:s'), 'attributes' = array(), 'empty' = FALSE ) ); echo $this-Form-end('Search'); Can anyone suggest how to use jave script calendar under form-create-input? Please suggest. Regards Tapan Thapa India On Tue, Feb 22, 2011 at 12:46 PM, andy_the ultimate baker anandghaywankar...@gmail.com wrote: u cant expect all that u need will get exactly. u need to change the format in its code. have u tried the options at the right side of page ? and bellow it the possible changes and functions are given just refer them. Anand cake developer www.anshusys.com. On Feb 22, 12:01 pm, Tapan Kumar Thapa tapan.th...@hindustantimes.com wrote: I have seen this web site but i think your suggested calendar does not provide seconds in calendar. Does it? Regards Tapan Thapa India On Tue, Feb 22, 2011 at 12:25 PM, andy_the ultimate baker anandghaywankar...@gmail.com wrote: hi tapan, this is the most light weight date picker with variety of option
Re: date time calendar picker
Hello Community, Finally i have got one jquery based calendar. http://jqueryui.com/docs/Getting_Started how to from this site: input type=text name=date id=date / *JS:* $('#date').datepicker(); My current code to select date with form helper is: echo $this-Form-create(array('controller' = 'users', 'action' = 'view')); echo $this-Form-input('StartDate', array( 'type' = 'datetime', 'dateFormat' = 'DMY', 'minYear' = date('Y'), 'maxYear' = date('Y'), 'timeFormat' = '24', 'selected' = date('Y-m-d 0:00:s'), 'attributes' = array(), 'empty' = FALSE ) ); echo $this-Form-input('EndDate', array( 'type' = 'datetime', 'dateFormat' = 'DMY', 'minYear' = date('Y'), 'maxYear' = date('Y'), 'timeFormat' = '24', //'selected' = null, 'selected' = date('Y-m-d H:i:s'), 'attributes' = array(), 'empty' = FALSE ) ); echo $this-Form-end('Search'); Can anyone suggest how to use jave script calendar under form-create-input? Please suggest. Regards Tapan Thapa India On Tue, Feb 22, 2011 at 12:46 PM, andy_the ultimate baker anandghaywankar...@gmail.com wrote: u cant expect all that u need will get exactly. u need to change the format in its code. have u tried the options at the right side of page ? and bellow it the possible changes and functions are given just refer them. Anand cake developer www.anshusys.com. On Feb 22, 12:01 pm, Tapan Kumar Thapa tapan.th...@hindustantimes.com wrote: I have seen this web site but i think your suggested calendar does not provide seconds in calendar. Does it? Regards Tapan Thapa India On Tue, Feb 22, 2011 at 12:25 PM, andy_the ultimate baker anandghaywankar...@gmail.com wrote: hi tapan, this is the most light weight date picker with variety of option. get this link http://jqueryui.com/demos/datepicker hope this may help u. regards Anand cake developer www.anshusys.com. On Feb 22, 11:18 am, Walther waltherl...@gmail.com wrote: This is the one I use:http://tinyurl.com/6g2xokx It is incredibly powerful! On Feb 21, 5:58 pm, Tapan Kumar Thapa tapan.th...@hindustantimes.com wrote: Hello Community, Can anyone suggest good light weight (with minimum configuration) calendar picker which should have hour, min and seconds feature? Regards Tapan Thapa India -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions sitehttp://ask.cakephp.organd 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 athttp://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 -- 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: date time calendar picker
No i am sorry but i don't want to use ajax at all as i don't have much knowledge on this. I just to enable start and end date search via a calendar which should have date and time with seconds feature so i have found out jquery calendar ( http://jqueryui.com/demos/). I want to implement this with cake form helper (or with any other method). Please suggest. Regards Tapan Thapa India On Wed, Feb 23, 2011 at 5:12 PM, Deividas J jdeivi...@gmail.com wrote: if I understand you well you want to call action with .ajax. I do like this: echo $this-Form-create(null, array( 'default' = false, 'inputDefaults' = array( 'label' = false, 'div' = false ) )); //Input- echo $this-Form-input('StartDate', array( 'type' = 'datetime', 'dateFormat' = 'DMY', 'minYear' = date('Y'), 'maxYear' = date('Y'), 'timeFormat' = '24', 'selected' = date('Y-m-d 0:00:s'), 'attributes' = array(), 'empty' = FALSE ) ); echo $this-Form-input('EndDate', array( 'type' = 'datetime', 'dateFormat' = 'DMY', 'minYear' = date('Y'), 'maxYear' = date('Y'), 'timeFormat' = '24', //'selected' = null, 'selected' = date('Y-m-d H:i:s'), 'attributes' = array(), 'empty' = FALSE ) ); //-- echo $this-Form-end(array( 'label' = 'Search', 'id' = 'seach' )); $this-Js-get('#seach')-event('click', $this-Js-request( array( 'controller' = 'users', 'action' = 'view', ), array( 'async' = true, 'dataExpression' = true, 'type' = 'json', 'method' = 'post', 'data' = $js-serializeForm(array('isForm' = false, 'inline' = true)), 'success' = 'renderTrack(data);', ) )); I hope you looking for this. On Wed, Feb 23, 2011 at 1:33 PM, Tapan Kumar Thapa tapan.th...@hindustantimes.com wrote: Hello Community, Finally i have got one jquery based calendar. http://jqueryui.com/docs/Getting_Started how to from this site: input type=text name=date id=date / *JS:* $('#date').datepicker(); My current code to select date with form helper is: echo $this-Form-create(array('controller' = 'users', 'action' = 'view')); echo $this-Form-input('StartDate', array( 'type' = 'datetime', 'dateFormat' = 'DMY', 'minYear' = date('Y'), 'maxYear' = date('Y'), 'timeFormat' = '24', 'selected' = date('Y-m-d 0:00:s'), 'attributes' = array(), 'empty' = FALSE ) ); echo $this-Form-input('EndDate', array( 'type' = 'datetime', 'dateFormat' = 'DMY', 'minYear' = date('Y'), 'maxYear' = date('Y'), 'timeFormat' = '24', //'selected' = null, 'selected' = date('Y-m-d H:i:s'), 'attributes' = array(), 'empty' = FALSE ) ); echo $this-Form-end('Search'); Can anyone suggest how to use jave script calendar under form-create-input? Please suggest. Regards Tapan Thapa India On Tue, Feb 22, 2011 at 12:46 PM, andy_the ultimate baker anandghaywankar...@gmail.com wrote: u cant expect all that u need will get exactly. u need to change the format in its code. have u tried the options at the right side of page ? and bellow it the possible changes and functions are given just refer them. Anand cake developer www.anshusys.com. On Feb 22, 12:01 pm, Tapan Kumar Thapa tapan.th...@hindustantimes.com wrote: I have seen this web site but i think your suggested calendar does not provide seconds in calendar. Does it? Regards Tapan Thapa India On Tue, Feb 22, 2011 at 12:25 PM, andy_the ultimate baker anandghaywankar...@gmail.com wrote: hi tapan, this is the most light weight date picker with variety of option. get this link http://jqueryui.com/demos/datepicker hope this may help u. regards Anand cake developer www.anshusys.com. On Feb 22, 11:18 am, Walther waltherl...@gmail.com wrote: This is the one I use:http://tinyurl.com/6g2xokx It is incredibly powerful! On Feb 21, 5:58 pm, Tapan Kumar Thapa tapan.th...@hindustantimes.com wrote: Hello Community, Can anyone suggest good light weight (with minimum configuration) calendar picker which should have hour, min and seconds feature? Regards Tapan Thapa India -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions sitehttp://ask.cakephp.organd 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 athttp://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
Re: Auth component question
Yes QA: idusernamepasswordemailfirst_name last_namecreatedmodified 1adminfb1d00be1616be244194b049468f6c571c56d927 ad...@hindustantimes.comAdministratorAdmin\N\N Development: idusernamepasswordemailfirst_name last_namecreatedmodified 1khbkfb1d00be1616be244194b049468f6c571c56d927 k...@khbk.comMahuaaTelevision\N\N Please suggest. Point noted: I am using cakephp 2.0 (cakephp-8cbd9fc) development version on QA and also using cakephp 2.0 (cakephp-'Not know') development version on development machine. Regards Tapan Thapa India On Mon, Feb 21, 2011 at 1:18 PM, Jeremy Burns | Class Outfit jeremybu...@classoutfit.com wrote: And the tables contain the same data? Jeremy Burns *Class Outfit* * * jeremybu...@classoutfit.com jeremybu...@mac.com http://www.classoutfit.com On 21 Feb 2011, at 07:46, Tapan Kumar Thapa wrote: Yes DB structure,code and model files are identical. From Development: (Fetched from mysql yog) CREATE TABLE `users` ( `id` int(10) NOT NULL AUTO_INCREMENT, `username` varchar(40) NOT NULL, `password` varchar(40) NOT NULL, `email` varchar(255) NOT NULL, `first_name` varchar(40) NOT NULL, `last_name` varchar(40) NOT NULL, `created` datetime DEFAULT NULL, `modified` datetime DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `username` (`username`,`email`) ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 From QA: (fetched from cli) mysql show create table users; +---+---+ | Table | Create Table | +---+---+ | users | CREATE TABLE `users` ( `id` int(10) NOT NULL auto_increment, `username` varchar(40) NOT NULL, `password` varchar(40) NOT NULL, `email` varchar(255) NOT NULL, `first_name` varchar(40) NOT NULL, `last_name` varchar(40) NOT NULL, `created` datetime default NULL, `modified` datetime default NULL, PRIMARY KEY (`id`), UNIQUE KEY `username` (`username`,`email`) ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 | +---+---+ 1 row in set (0.00 sec) mysql Please suggest. Regards Tapan Thapa On Mon, Feb 21, 2011 at 1:11 PM, Jeremy Burns | Class Outfit jeremybu...@classoutfit.com wrote: Then your value is not being set in the session and you won't be able to retrieve it. Are you database structures the same? Have you changed anything to do with your User model? Are the code sets identical? Jeremy Burns *Class Outfit* * * jeremybu...@classoutfit.com jeremybu...@mac.com http://www.classoutfit.com On 21 Feb 2011, at 07:39, Tapan Kumar Thapa wrote: Please find the debug info from development machine and QA machine. Development: Array ( [id] = 1 [username] = khbk [email] = k...@khbk.com [first_name] = Mahuaa [last_name] = Television [created] = [modified] = ) QA: Array ( [username] = admin [password] = suresh ) Please suggest Regards Tapan Thapa On Mon, Feb 21, 2011 at 1:07 PM, Jeremy Burns | Class Outfit jeremybu...@classoutfit.com wrote: What happens when you debug out the value of the auth session variables? Is the value there? Jeremy Burns *Class Outfit* * * jeremybu...@classoutfit.com jeremybu...@mac.com http://www.classoutfit.com On 21 Feb 2011, at 07:34, Tapan Kumar Thapa wrote: Unfortunately i am not getting any error but my view shows blank in case no value retrieved from session for first_name. But if i change the code to read username from session it start displaying in my view. Please suggest. Regards Tapan Thapa On Mon, Feb 21, 2011 at 12:52 PM, andy_the ultimate baker
Re: Urgent Help--Please
My find fields array is already having my new date In first parameter however it still comes in last. Pls suggest if you have something else in your mind. Regards Tapan Thapa India Sent from my iPhone On Feb 20, 2011, at 9:21 PM, John Andersen j.andersen...@gmail.com wrote: This is speculation only, but maybe define your field parameter in the find statement, so that the newdate comes first! Enjoy, John On Feb 20, 4:42 pm, Tapan Kumar Thapa tapan.th...@hindustantimes.com wrote: Thanks for your suggestion. I have implemented this in my model. var $virtualFields = array( 'newdate' = 'DATE_FORMAT(Incoming.date, %d-%b-%y)' ); It works as charm however now i have got another problem. now my new date is coming in last like this. SELECT `Incoming`.`time`, `Incoming`.`msisdn`, `Incoming`.`shortcode`, `Incoming`.`operator`, `Incoming`.`circle`, `Incoming`.`keyword`, `Incoming`.`answer`, `Incoming`.`age`, `Incoming`.`gender`, `Incoming`.`status`, *(DATE_FORMAT(`Incoming`.`date`, %d-%b-%y)) AS `Incoming__newdate`* FROM `incomings` AS `Incoming` WHERE `Incoming`.`created` = '2011-02-08 00:00:00' AND `Incoming`.`created` = '2011-02-20 20:55:00' ORDER BY `Incoming`.`id` desc LIMIT 20, 20 However i want like this: SELECT *(DATE_FORMAT(`Incoming`.`date`, %d-%b-%y)) AS `Incoming__newdate`*,`Incoming`.`time`, `Incoming`.`msisdn`, `Incoming`.`shortcode`, `Incoming`.`operator`, `Incoming`.`circle`, `Incoming`.`keyword`, `Incoming`.`answer`, `Incoming`.`age`, `Incoming`.`gender`, `Incoming`.`status` FROM `incomings` AS `Incoming` WHERE `Incoming`.`created` = '2011-02-08 00:00:00' AND `Incoming`.`created` = '2011-02-20 20:55:00' ORDER BY `Incoming`.`id` desc LIMIT 20, 20 Please suggest. Regards Tapan Thapa India On Sun, Feb 20, 2011 at 8:28 PM, John Andersen j.andersen...@gmail.comwrote: Please show us how the view code looks like, maybe we can suggest something based on that. If you can't then you may be able to use a virtual field for this, look at the CakePHP book at: http://book.cakephp.org/view/1608/Virtual-fields Enjoy, John On Feb 20, 3:45 pm, Tapan Kumar Thapa tapan.th...@hindustantimes.com wrote: Unfortunately no(:- I have an export csv option via a html link and i am not presenting this data to my view. Please suggest if this can be achieved in controller itself. Regards Tapan Thapa India [snip] -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions sitehttp://ask.cakephp.organd 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 athttp://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 -- 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: Auth component question
Hello Community, Can you please suggest something? Regards Tapan Thapa India On Mon, Feb 21, 2011 at 1:37 PM, Tapan Kumar Thapa tapan.th...@hindustantimes.com wrote: Yes QA: idusernamepasswordemailfirst_name last_namecreatedmodified 1adminfb1d00be1616be244194b049468f6c571c56d927 ad...@hindustantimes.comAdministratorAdmin\N\N Development: idusernamepasswordemailfirst_name last_namecreatedmodified 1khbkfb1d00be1616be244194b049468f6c571c56d927 k...@khbk.comMahuaaTelevision\N\N Please suggest. Point noted: I am using cakephp 2.0 (cakephp-8cbd9fc) development version on QA and also using cakephp 2.0 (cakephp-'Not know') development version on development machine. Regards Tapan Thapa India On Mon, Feb 21, 2011 at 1:18 PM, Jeremy Burns | Class Outfit jeremybu...@classoutfit.com wrote: And the tables contain the same data? Jeremy Burns *Class Outfit* * * jeremybu...@classoutfit.com jeremybu...@mac.com http://www.classoutfit.com On 21 Feb 2011, at 07:46, Tapan Kumar Thapa wrote: Yes DB structure,code and model files are identical. From Development: (Fetched from mysql yog) CREATE TABLE `users` ( `id` int(10) NOT NULL AUTO_INCREMENT, `username` varchar(40) NOT NULL, `password` varchar(40) NOT NULL, `email` varchar(255) NOT NULL, `first_name` varchar(40) NOT NULL, `last_name` varchar(40) NOT NULL, `created` datetime DEFAULT NULL, `modified` datetime DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `username` (`username`,`email`) ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 From QA: (fetched from cli) mysql show create table users; +---+---+ | Table | Create Table | +---+---+ | users | CREATE TABLE `users` ( `id` int(10) NOT NULL auto_increment, `username` varchar(40) NOT NULL, `password` varchar(40) NOT NULL, `email` varchar(255) NOT NULL, `first_name` varchar(40) NOT NULL, `last_name` varchar(40) NOT NULL, `created` datetime default NULL, `modified` datetime default NULL, PRIMARY KEY (`id`), UNIQUE KEY `username` (`username`,`email`) ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 | +---+---+ 1 row in set (0.00 sec) mysql Please suggest. Regards Tapan Thapa On Mon, Feb 21, 2011 at 1:11 PM, Jeremy Burns | Class Outfit jeremybu...@classoutfit.com wrote: Then your value is not being set in the session and you won't be able to retrieve it. Are you database structures the same? Have you changed anything to do with your User model? Are the code sets identical? Jeremy Burns *Class Outfit* * * jeremybu...@classoutfit.com jeremybu...@mac.com http://www.classoutfit.com On 21 Feb 2011, at 07:39, Tapan Kumar Thapa wrote: Please find the debug info from development machine and QA machine. Development: Array ( [id] = 1 [username] = khbk [email] = k...@khbk.com [first_name] = Mahuaa [last_name] = Television [created] = [modified] = ) QA: Array ( [username] = admin [password] = suresh ) Please suggest Regards Tapan Thapa On Mon, Feb 21, 2011 at 1:07 PM, Jeremy Burns | Class Outfit jeremybu...@classoutfit.com wrote: What happens when you debug out the value of the auth session variables? Is the value there? Jeremy Burns *Class Outfit* * * jeremybu...@classoutfit.com jeremybu...@mac.com http://www.classoutfit.com On 21 Feb 2011, at 07:34, Tapan Kumar Thapa wrote: Unfortunately i am not getting any error but my view shows blank in case no value retrieved from session for first_name
Re: Auth component question
i am writing startdate and enddate to the session but i don't know if i am writing in Auth session or not. Please find my view vode for reading first_name from session. View: p align=centerb?php echo 'Welcome ' . $this-Session-read('Auth.User.first_name'); ?/b/p My controller code which writes startdate and enddate in session: $this-Session-write('startdate', $startdate); $this-Session-write('enddate', $enddate); Fyi: All is working fine in my development machine but i don't know why in QA. Please suggest. Regards Tapan Thapa India On Mon, Feb 21, 2011 at 3:31 PM, Jeremy Burns | Class Outfit jeremybu...@classoutfit.com wrote: If your code and data is identical (the data isn't actually identical, but I guess the differences are not important) then can you show your code? What is your log in method? Are you writing anything to the Auth session key anywhere else? Jeremy Burns *Class Outfit* * * jeremybu...@classoutfit.com jeremybu...@mac.com http://www.classoutfit.com On 21 Feb 2011, at 09:56, Tapan Kumar Thapa wrote: Hello Community, Can you please suggest something? Regards Tapan Thapa India On Mon, Feb 21, 2011 at 1:37 PM, Tapan Kumar Thapa tapan.th...@hindustantimes.com wrote: Yes QA: idusernamepasswordemailfirst_name last_namecreatedmodified 1adminfb1d00be1616be244194b049468f6c571c56d927 ad...@hindustantimes.comAdministratorAdmin\N\N Development: idusernamepasswordemailfirst_name last_namecreatedmodified 1khbkfb1d00be1616be244194b049468f6c571c56d927 k...@khbk.comMahuaaTelevision\N\N Please suggest. Point noted: I am using cakephp 2.0 (cakephp-8cbd9fc) development version on QA and also using cakephp 2.0 (cakephp-'Not know') development version on development machine. Regards Tapan Thapa India On Mon, Feb 21, 2011 at 1:18 PM, Jeremy Burns | Class Outfit jeremybu...@classoutfit.com wrote: And the tables contain the same data? Jeremy Burns *Class Outfit* * * jeremybu...@classoutfit.com jeremybu...@mac.com http://www.classoutfit.com On 21 Feb 2011, at 07:46, Tapan Kumar Thapa wrote: Yes DB structure,code and model files are identical. From Development: (Fetched from mysql yog) CREATE TABLE `users` ( `id` int(10) NOT NULL AUTO_INCREMENT, `username` varchar(40) NOT NULL, `password` varchar(40) NOT NULL, `email` varchar(255) NOT NULL, `first_name` varchar(40) NOT NULL, `last_name` varchar(40) NOT NULL, `created` datetime DEFAULT NULL, `modified` datetime DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `username` (`username`,`email`) ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 From QA: (fetched from cli) mysql show create table users; +---+---+ | Table | Create Table | +---+---+ | users | CREATE TABLE `users` ( `id` int(10) NOT NULL auto_increment, `username` varchar(40) NOT NULL, `password` varchar(40) NOT NULL, `email` varchar(255) NOT NULL, `first_name` varchar(40) NOT NULL, `last_name` varchar(40) NOT NULL, `created` datetime default NULL, `modified` datetime default NULL, PRIMARY KEY (`id`), UNIQUE KEY `username` (`username`,`email`) ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 | +---+---+ 1 row in set (0.00 sec) mysql Please suggest. Regards Tapan Thapa On Mon, Feb 21, 2011 at 1:11 PM, Jeremy Burns | Class Outfit jeremybu...@classoutfit.com wrote: Then your value is not being set in the session and you won't be able to retrieve it. Are you database structures the same? Have you changed anything to do with your User
Re: Auth component question
Please find my complete code of controller fyi: ?php class UsersController extends AppController { var $name = 'Users'; var $uses = array('Incoming', 'User'); var $helpers = array('Html', 'Paginator', 'Form', 'Csv'); var $components = array('Auth'); var $paginate = array( 'limit' = 20, 'fields' = array('date', 'time', 'msisdn', 'shortcode', 'operator', 'circle', 'keyword', 'answer', 'age', 'gender', 'status'), 'order' = array('Incoming.id' = 'desc') ); function beforeFilter() { $this-Auth-autoRedirect = false; parent::beforeFilter(); //$this-Auth-allow('register'); } function index() { $this-redirect(array('action' = 'login')); } function login() { $this-User-set($this-data); if ($this-User-validates()) { if (isset($this-data['User'])) { if ($this-Auth-login($this-data['User'])) { $this-Session-setFlash('You\'ve successfully logged in.'); //$this-redirect('view'); $this-redirect('report'); } $this-Session-setFlash(Username/Password is incorrect); } } } function logout() { $this-Auth-logout(); $this-Session-setFlash('You are now logged out.'); $this-redirect('login'); } function view() { if ($this-data) { $startday = $this-data['Incoming']['StartDate']['day']; $startmonth = $this-data['Incoming']['StartDate']['month']; $startyear = $this-data['Incoming']['StartDate']['year']; $starthour = $this-data['Incoming']['StartDate']['hour']; $startmin = $this-data['Incoming']['StartDate']['min']; $startdate = $startyear-$startmonth-$startday $starthour:$startmin:00; $endday = $this-data['Incoming']['EndDate']['day']; $endmonth = $this-data['Incoming']['EndDate']['month']; $endyear = $this-data['Incoming']['EndDate']['year']; $endhour = $this-data['Incoming']['EndDate']['hour']; $endmin = $this-data['Incoming']['EndDate']['min']; $enddate = $endyear-$endmonth-$endday $endhour:$endmin:00; $this-Session-write('startdate', $startdate); $this-Session-write('enddate', $enddate); $this-set('records', $this-paginate('Incoming', array(Incoming.created = '$startdate' AND Incoming.created = '$enddate' ))); } else { $startdate = $this-Session-read('startdate'); $enddate = $this-Session-read('enddate'); $this-set('records', $this-paginate('Incoming', array(Incoming.created = '$startdate' AND Incoming.created = '$enddate' ))); } } function report() { } function export() { $this-layout = ''; $startdate = $this-Session-read('startdate'); $enddate = $this-Session-read('enddate'); $this-set('Export', $this-Incoming-find('all', array( 'fields' = array('date', 'time', 'msisdn', 'shortcode', 'operator', 'circle', 'keyword', 'answer', 'age', 'gender'), 'order' = Incoming.id desc, 'conditions' = array(Incoming.created = '$startdate' AND Incoming.created = '$enddate' ), 'contain' = false))); } } ? Regards Tapan Thapa India On Mon, Feb 21, 2011 at 4:06 PM, Tapan Kumar Thapa tapan.th...@hindustantimes.com wrote: i am writing startdate and enddate to the session but i don't know if i am writing in Auth session or not. Please find my view vode for reading first_name from session. View: p align=centerb?php echo 'Welcome ' . $this-Session-read('Auth.User.first_name'); ?/b/p My controller code which writes startdate and enddate in session: $this-Session-write('startdate', $startdate); $this-Session-write('enddate', $enddate); Fyi: All is working fine in my development machine but i don't know why in QA. Please suggest. Regards Tapan Thapa India On Mon, Feb 21, 2011 at 3:31 PM, Jeremy Burns | Class Outfit jeremybu...@classoutfit.com wrote: If your code and data is identical (the data isn't actually identical, but I guess the differences are not important) then can you show your code? What is your log in method? Are you writing anything to the Auth session key anywhere else? Jeremy Burns *Class Outfit* * * jeremybu...@classoutfit.com jeremybu...@mac.com http://www.classoutfit.com On 21 Feb 2011, at 09:56, Tapan Kumar Thapa wrote: Hello Community, Can you please suggest something? Regards Tapan Thapa India On Mon, Feb 21, 2011 at 1:37 PM, Tapan Kumar Thapa tapan.th...@hindustantimes.com wrote: Yes QA: idusernamepasswordemailfirst_name last_namecreatedmodified 1adminfb1d00be1616be244194b049468f6c571c56d927 ad...@hindustantimes.comAdministratorAdmin\N\N Development
date time calendar picker
Hello Community, Can anyone suggest good light weight (with minimum configuration) calendar picker which should have hour, min and seconds feature? Regards Tapan Thapa India -- 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: date time calendar picker
Your are the magician Walther...:-) How did you manage to create this kind of beautiful gmail demo search?? Nice one i should admit. The suggested java script calendar will full fill my requirement...I think so but the question is how i should add in my code? Should i need to write my own html to add this java script or there is any changes i need to do in helper class or something else? http://www.rainforestnet.com/datetimepicker.htm (Great calendar) with good explanation. Regards Tapan Thapa India On Tue, Feb 22, 2011 at 11:48 AM, Walther waltherl...@gmail.com wrote: This is the one I use: http://tinyurl.com/6g2xokx It is incredibly powerful! On Feb 21, 5:58 pm, Tapan Kumar Thapa tapan.th...@hindustantimes.com wrote: Hello Community, Can anyone suggest good light weight (with minimum configuration) calendar picker which should have hour, min and seconds feature? Regards Tapan Thapa India -- 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 -- 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: date time calendar picker
I have seen this web site but i think your suggested calendar does not provide seconds in calendar. Does it? Regards Tapan Thapa India On Tue, Feb 22, 2011 at 12:25 PM, andy_the ultimate baker anandghaywankar...@gmail.com wrote: hi tapan, this is the most light weight date picker with variety of option. get this link http://jqueryui.com/demos/datepicker hope this may help u. regards Anand cake developer www.anshusys.com. On Feb 22, 11:18 am, Walther waltherl...@gmail.com wrote: This is the one I use:http://tinyurl.com/6g2xokx It is incredibly powerful! On Feb 21, 5:58 pm, Tapan Kumar Thapa tapan.th...@hindustantimes.com wrote: Hello Community, Can anyone suggest good light weight (with minimum configuration) calendar picker which should have hour, min and seconds feature? Regards Tapan Thapa India -- 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 -- 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
Urgent Help--Please
Hello Community, I have an export function in my controller. function export() { $this-layout = ''; $startdate = $this-Session-read('startdate'); $enddate = $this-Session-read('enddate'); $this-set('Export', $this-Incoming-find('all', array( 'fields' = array('date', 'time', 'msisdn', 'shortcode', 'operator', 'circle', 'keyword', 'answer', 'age', 'gender'), 'order' = Incoming.id desc, 'conditions' = array(Incoming.created = '$startdate' AND Incoming.created = '$enddate' ), 'contain' = false))); } I want this control look like this. function export() { $this-layout = ''; $startdate = $this-Session-read('startdate'); $enddate = $this-Session-read('enddate'); $this-set('Export', $this-Incoming-find('all', array( 'fields' = array('date_format(date, '%d-%b-%y') as date', 'time', 'msisdn', 'shortcode', 'operator', 'circle', 'keyword', 'answer', 'age', 'gender'), 'order' = Incoming.id desc, 'conditions' = array(Incoming.created = '$startdate' AND Incoming.created = '$enddate' ), 'contain' = false))); } Please suggest. Regards Tapan Thapa India -- 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: Urgent Help--Please
Unfortunately no(:- I have an export csv option via a html link and i am not presenting this data to my view. Please suggest if this can be achieved in controller itself. Regards Tapan Thapa India On Sun, Feb 20, 2011 at 8:08 PM, John Andersen j.andersen...@gmail.comwrote: Presentation of the data, your date and time fields, should be done in the view, not in the controller, so just move the formatting to the view. Would that be an acceptable solution for you? Enjoy, John On Feb 20, 2:58 pm, Tapan Kumar Thapa tapan.th...@hindustantimes.com wrote: Hello Community, I have an export function in my controller. function export() { $this-layout = ''; $startdate = $this-Session-read('startdate'); $enddate = $this-Session-read('enddate'); $this-set('Export', $this-Incoming-find('all', array( 'fields' = array('date', 'time', 'msisdn', 'shortcode', 'operator', 'circle', 'keyword', 'answer', 'age', 'gender'), 'order' = Incoming.id desc, 'conditions' = array(Incoming.created = '$startdate' AND Incoming.created = '$enddate' ), 'contain' = false))); } I want this control look like this. function export() { $this-layout = ''; $startdate = $this-Session-read('startdate'); $enddate = $this-Session-read('enddate'); $this-set('Export', $this-Incoming-find('all', array( 'fields' = array('date_format(date, '%d-%b-%y') as date', 'time', 'msisdn', 'shortcode', 'operator', 'circle', 'keyword', 'answer', 'age', 'gender'), 'order' = Incoming.id desc, 'conditions' = array(Incoming.created = '$startdate' AND Incoming.created = '$enddate' ), 'contain' = false))); } Please suggest. Regards Tapan Thapa India -- 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 -- 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: Urgent Help--Please
Thanks for your suggestion. I have implemented this in my model. var $virtualFields = array( 'newdate' = 'DATE_FORMAT(Incoming.date, %d-%b-%y)' ); It works as charm however now i have got another problem. now my new date is coming in last like this. SELECT `Incoming`.`time`, `Incoming`.`msisdn`, `Incoming`.`shortcode`, `Incoming`.`operator`, `Incoming`.`circle`, `Incoming`.`keyword`, `Incoming`.`answer`, `Incoming`.`age`, `Incoming`.`gender`, `Incoming`.`status`, *(DATE_FORMAT(`Incoming`.`date`, %d-%b-%y)) AS `Incoming__newdate`* FROM `incomings` AS `Incoming` WHERE `Incoming`.`created` = '2011-02-08 00:00:00' AND `Incoming`.`created` = '2011-02-20 20:55:00' ORDER BY `Incoming`.`id` desc LIMIT 20, 20 However i want like this: SELECT *(DATE_FORMAT(`Incoming`.`date`, %d-%b-%y)) AS `Incoming__newdate`*,`Incoming`.`time`, `Incoming`.`msisdn`, `Incoming`.`shortcode`, `Incoming`.`operator`, `Incoming`.`circle`, `Incoming`.`keyword`, `Incoming`.`answer`, `Incoming`.`age`, `Incoming`.`gender`, `Incoming`.`status` FROM `incomings` AS `Incoming` WHERE `Incoming`.`created` = '2011-02-08 00:00:00' AND `Incoming`.`created` = '2011-02-20 20:55:00' ORDER BY `Incoming`.`id` desc LIMIT 20, 20 Please suggest. Regards Tapan Thapa India On Sun, Feb 20, 2011 at 8:28 PM, John Andersen j.andersen...@gmail.comwrote: Please show us how the view code looks like, maybe we can suggest something based on that. If you can't then you may be able to use a virtual field for this, look at the CakePHP book at: http://book.cakephp.org/view/1608/Virtual-fields Enjoy, John On Feb 20, 3:45 pm, Tapan Kumar Thapa tapan.th...@hindustantimes.com wrote: Unfortunately no(:- I have an export csv option via a html link and i am not presenting this data to my view. Please suggest if this can be achieved in controller itself. Regards Tapan Thapa India [snip] -- 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 -- 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
Auth component question
Hello Community, I am using auth component in my code and while retrieving first_name from session ($this-Session-read('Auth.User.first_name')) on my development machine(windows with wamp), it is working fine. However if deploying the same code on QA machine (linux with apache and php separately), i am not able to get the first_name from session although i have noticed if i am trying to retrieve username or password from session, it is working. Working on QA - $this-Session-read('Auth.User.username') Working on QA - $this-Session-read('Auth.User.password') *Not working on QA - $this-Session-read('Auth.User.first_name) or $this-Session-read('Auth.User.email')* Please suggest. Regards Tapan Thapa India -- 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: Auth component question
Unfortunately i am not getting any error but my view shows blank in case no value retrieved from session for first_name. But if i change the code to read username from session it start displaying in my view. Please suggest. Regards Tapan Thapa On Mon, Feb 21, 2011 at 12:52 PM, andy_the ultimate baker anandghaywankar...@gmail.com wrote: will u please tell what error is coming out? On Feb 21, 12:12 pm, Tapan Kumar Thapa tapan.th...@hindustantimes.com wrote: Hello Community, I am using auth component in my code and while retrieving first_name from session ($this-Session-read('Auth.User.first_name')) on my development machine(windows with wamp), it is working fine. However if deploying the same code on QA machine (linux with apache and php separately), i am not able to get the first_name from session although i have noticed if i am trying to retrieve username or password from session, it is working. Working on QA - $this-Session-read('Auth.User.username') Working on QA - $this-Session-read('Auth.User.password') *Not working on QA - $this-Session-read('Auth.User.first_name) or $this-Session-read('Auth.User.email')* Please suggest. Regards Tapan Thapa India -- 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 -- 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: Auth component question
Please find the debug info from development machine and QA machine. Development: Array ( [id] = 1 [username] = khbk [email] = k...@khbk.com [first_name] = Mahuaa [last_name] = Television [created] = [modified] = ) QA: Array ( [username] = admin [password] = suresh ) Please suggest Regards Tapan Thapa On Mon, Feb 21, 2011 at 1:07 PM, Jeremy Burns | Class Outfit jeremybu...@classoutfit.com wrote: What happens when you debug out the value of the auth session variables? Is the value there? Jeremy Burns *Class Outfit* * * jeremybu...@classoutfit.com jeremybu...@mac.com http://www.classoutfit.com On 21 Feb 2011, at 07:34, Tapan Kumar Thapa wrote: Unfortunately i am not getting any error but my view shows blank in case no value retrieved from session for first_name. But if i change the code to read username from session it start displaying in my view. Please suggest. Regards Tapan Thapa On Mon, Feb 21, 2011 at 12:52 PM, andy_the ultimate baker anandghaywankar...@gmail.com wrote: will u please tell what error is coming out? On Feb 21, 12:12 pm, Tapan Kumar Thapa tapan.th...@hindustantimes.com wrote: Hello Community, I am using auth component in my code and while retrieving first_name from session ($this-Session-read('Auth.User.first_name')) on my development machine(windows with wamp), it is working fine. However if deploying the same code on QA machine (linux with apache and php separately), i am not able to get the first_name from session although i have noticed if i am trying to retrieve username or password from session, it is working. Working on QA - $this-Session-read('Auth.User.username') Working on QA - $this-Session-read('Auth.User.password') *Not working on QA - $this-Session-read('Auth.User.first_name) or $this-Session-read('Auth.User.email')* Please suggest. Regards Tapan Thapa India -- 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 -- 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 -- 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 -- 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: Auth component question
Yes DB structure,code and model files are identical. From Development: (Fetched from mysql yog) CREATE TABLE `users` ( `id` int(10) NOT NULL AUTO_INCREMENT, `username` varchar(40) NOT NULL, `password` varchar(40) NOT NULL, `email` varchar(255) NOT NULL, `first_name` varchar(40) NOT NULL, `last_name` varchar(40) NOT NULL, `created` datetime DEFAULT NULL, `modified` datetime DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `username` (`username`,`email`) ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 From QA: (fetched from cli) mysql show create table users; +---+---+ | Table | Create Table | +---+---+ | users | CREATE TABLE `users` ( `id` int(10) NOT NULL auto_increment, `username` varchar(40) NOT NULL, `password` varchar(40) NOT NULL, `email` varchar(255) NOT NULL, `first_name` varchar(40) NOT NULL, `last_name` varchar(40) NOT NULL, `created` datetime default NULL, `modified` datetime default NULL, PRIMARY KEY (`id`), UNIQUE KEY `username` (`username`,`email`) ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 | +---+---+ 1 row in set (0.00 sec) mysql Please suggest. Regards Tapan Thapa On Mon, Feb 21, 2011 at 1:11 PM, Jeremy Burns | Class Outfit jeremybu...@classoutfit.com wrote: Then your value is not being set in the session and you won't be able to retrieve it. Are you database structures the same? Have you changed anything to do with your User model? Are the code sets identical? Jeremy Burns *Class Outfit* * * jeremybu...@classoutfit.com jeremybu...@mac.com http://www.classoutfit.com On 21 Feb 2011, at 07:39, Tapan Kumar Thapa wrote: Please find the debug info from development machine and QA machine. Development: Array ( [id] = 1 [username] = khbk [email] = k...@khbk.com [first_name] = Mahuaa [last_name] = Television [created] = [modified] = ) QA: Array ( [username] = admin [password] = suresh ) Please suggest Regards Tapan Thapa On Mon, Feb 21, 2011 at 1:07 PM, Jeremy Burns | Class Outfit jeremybu...@classoutfit.com wrote: What happens when you debug out the value of the auth session variables? Is the value there? Jeremy Burns *Class Outfit* * * jeremybu...@classoutfit.com jeremybu...@mac.com http://www.classoutfit.com On 21 Feb 2011, at 07:34, Tapan Kumar Thapa wrote: Unfortunately i am not getting any error but my view shows blank in case no value retrieved from session for first_name. But if i change the code to read username from session it start displaying in my view. Please suggest. Regards Tapan Thapa On Mon, Feb 21, 2011 at 12:52 PM, andy_the ultimate baker anandghaywankar...@gmail.com wrote: will u please tell what error is coming out? On Feb 21, 12:12 pm, Tapan Kumar Thapa tapan.th...@hindustantimes.com wrote: Hello Community, I am using auth component in my code and while retrieving first_name from session ($this-Session-read('Auth.User.first_name')) on my development machine(windows with wamp), it is working fine. However if deploying the same code on QA machine (linux with apache and php separately), i am not able to get the first_name from session although i have noticed if i am trying to retrieve username or password from session, it is working. Working on QA - $this-Session-read('Auth.User.username') Working on QA - $this-Session-read('Auth.User.password') *Not working on QA - $this-Session-read('Auth.User.first_name) or $this-Session-read('Auth.User.email')* Please suggest. Regards Tapan Thapa India -- Our newest site for the community: CakePHP Video Tutorials http
Re: Form date time question
Hello Community, Can any one suggest any thing on this request? Regards Tapan Thapa India On Sat, Feb 19, 2011 at 11:06 AM, Tapan Kumar Thapa tapan.th...@hindustantimes.com wrote: Hello Community, I am using below code in my view to generate start date and end date. My view is showing start and end date perfectly but without seconds value to select. Can you please suggest something to display and chose seconds as well? ?php echo $this-Form-create(array('controller' = 'users', 'action' = 'view')); echo $this-Form-input('Start Date/Time', array( 'type' = 'datetime', 'dateFormat' = 'DMY', 'minYear' = date('Y') - 1, 'maxYear' = date('Y'), 'timeFormat' = '24', 'selected' = date('Y-m-d 0:00:s'), 'attributes' = array(), 'empty' = FALSE ) ); echo $this-Form-input('End Date/Time', array( 'type' = 'datetime', 'dateFormat' = 'DMY', 'minYear' = date('Y') - 1, 'maxYear' = date('Y'), 'timeFormat' = '24', //'selected' = null, 'selected' = date('Y-m-d H:i:s'), 'attributes' = array(), 'empty' = FALSE ) ); echo $this-Form-end('Search'); ? Regards Tapan Thapa India -- 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
Form date time question
Hello Community, I am using below code in my view to generate start date and end date. My view is showing start and end date perfectly but without seconds value to select. Can you please suggest something to display and chose seconds as well? ?php echo $this-Form-create(array('controller' = 'users', 'action' = 'view')); echo $this-Form-input('Start Date/Time', array( 'type' = 'datetime', 'dateFormat' = 'DMY', 'minYear' = date('Y') - 1, 'maxYear' = date('Y'), 'timeFormat' = '24', 'selected' = date('Y-m-d 0:00:s'), 'attributes' = array(), 'empty' = FALSE ) ); echo $this-Form-input('End Date/Time', array( 'type' = 'datetime', 'dateFormat' = 'DMY', 'minYear' = date('Y') - 1, 'maxYear' = date('Y'), 'timeFormat' = '24', //'selected' = null, 'selected' = date('Y-m-d H:i:s'), 'attributes' = array(), 'empty' = FALSE ) ); echo $this-Form-end('Search'); ? Regards Tapan Thapa India -- 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: Validation Question
I am dam got stuck here. Can some one suggest anything? BR Tapan Thapa On Thu, Feb 17, 2011 at 10:02 AM, Tapan Kumar Thapa tapan.th...@hindustantimes.com wrote: Hello, Now i am trying like this. http://localhost/cakephp/incomings/request/msisdn:/operator:AIRTEL/circle:DELHI but still validation from model class it not working. Please please suggest. My Model: ?php class Incoming extends AppModel { var $name = 'Incoming'; var $validate = array( 'msisdn' = array( 'required' = true, 'allowEmpty' = false, 'rule' = 'numeric', 'message' = 'Please enter a valid msisdn', )); } ? My Controller: ?php class IncomingsController extends AppController { var $name = 'Incomings'; function request() { $this-Incoming-set($this-params['named']['msisdn']); if ($this-Incoming-validates()) { $this-Session-setFlash(Correct); } else { $this-Session-setFlash(Incorrect); } } } ? I am always going in Correct message if condition however i have not given any value in msisdn parameter. *Please please suggest something. I am clue less. Is validation only works in case of post request from view?* Regards Tapan Thapa India On Thu, Feb 17, 2011 at 8:56 AM, Tapan Kumar Thapa tapan.thapa2...@gmail.com wrote: I don't mind using URL like this but are you sure that validation will work like this? Regards Tapan Thapa Sent from my iPhone On Feb 16, 2011, at 11:36 PM, euromark dereurom...@googlemail.com wrote: you are mixing cake pretty urls and plain url style why not going with /.../x:1/y:2/z:3 and using $this-params[named] ? if you don't mind my asking On 16 Feb., 12:49, Tapan Thapa tapan.thapa2...@gmail.com wrote: Hello Community, I want to create a url like this. http://localhost/cakephp/incomings/request/?msisdn=919871701375opera. .. and i am accepting this request in my controller like below code and passing it to model for validation but it is not working in case i left any variable above blank like (circle=) or (msisdn=) incomings_controller.php ?php class IncomingsController extends AppController { var $name = 'Incomings'; function request() { $this-Incoming-set($this-params['url']); $this-Incoming-validates();} } ? incoming model: ?php class Incoming extends AppModel { var $name = 'Incoming'; var $validate = array( 'msisdn' = array( 'rule' = 'notEmpty', 'required' = true, 'message' = 'Please enter a valid msisdn', 'last' = true ), 'operator' = array( 'rule' = 'notEmpty', 'required' = true, 'message' = 'Please enter a valid operator', 'last' = true ), 'circle' = array( 'rule' = 'notEmpty', 'required' = true, 'message' = 'Please enter a valid circle', 'last' = true ) ); } ? Please suggest. Regards Tapan Thapa India tapan.th...@yahoo.com -- 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 -- 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: Validation Question
Sorry to say but it is still not working. Url: http://localhost/cakephp/incomings/request/msisdn:/operator:AIRTEL/circle:DELHI Incoming controller: ?php class IncomingsController extends AppController { var $name = 'Incomings'; function request() { $this-Incoming-set($this-params['named']); if ($this-Incoming-validates()) { $this-Session-setFlash(Correct); } else { $this-Session-setFlash(Incorrect); } } } ? Incoming Model: ?php class Incoming extends AppModel { var $name = 'Incoming'; var $validate = array( 'msisdn' = array( 'required' = true, 'allowEmpty' = false, 'rule' = 'numeric', 'message' = 'Please enter a valid msisdn', )); } ? Please suggest. Is validation only work for post request of is it also work for get request like above? Regards Tapan Thapa India On Thu, Feb 17, 2011 at 4:49 PM, Dr. Tarique Sani tariques...@gmail.comwrote: Try $this-Incoming-set($this-params['named']); Tarique On Thu, Feb 17, 2011 at 4:39 PM, Tapan Kumar Thapa tapan.th...@hindustantimes.com wrote: I am dam got stuck here. Can some one suggest anything? BR Tapan Thapa On Thu, Feb 17, 2011 at 10:02 AM, Tapan Kumar Thapa tapan.th...@hindustantimes.com wrote: Hello, Now i am trying like this. http://localhost/cakephp/incomings/request/msisdn:/operator:AIRTEL/circle:DELHI but still validation from model class it not working. Please please suggest. My Model: ?php class Incoming extends AppModel { var $name = 'Incoming'; var $validate = array( 'msisdn' = array( 'required' = true, 'allowEmpty' = false, 'rule' = 'numeric', 'message' = 'Please enter a valid msisdn', )); } ? My Controller: ?php class IncomingsController extends AppController { var $name = 'Incomings'; function request() { $this-Incoming-set($this-params['named']['msisdn']); if ($this-Incoming-validates()) { $this-Session-setFlash(Correct); } else { $this-Session-setFlash(Incorrect); } } } ? I am always going in Correct message if condition however i have not given any value in msisdn parameter. Please please suggest something. I am clue less. Is validation only works in case of post request from view? Regards Tapan Thapa India On Thu, Feb 17, 2011 at 8:56 AM, Tapan Kumar Thapa tapan.thapa2...@gmail.com wrote: I don't mind using URL like this but are you sure that validation will work like this? Regards Tapan Thapa Sent from my iPhone On Feb 16, 2011, at 11:36 PM, euromark dereurom...@googlemail.com wrote: you are mixing cake pretty urls and plain url style why not going with /.../x:1/y:2/z:3 and using $this-params[named] ? if you don't mind my asking On 16 Feb., 12:49, Tapan Thapa tapan.thapa2...@gmail.com wrote: Hello Community, I want to create a url like this. http://localhost/cakephp/incomings/request/?msisdn=919871701375opera... and i am accepting this request in my controller like below code and passing it to model for validation but it is not working in case i left any variable above blank like (circle=) or (msisdn=) incomings_controller.php ?php class IncomingsController extends AppController { var $name = 'Incomings'; function request() { $this-Incoming-set($this-params['url']); $this-Incoming-validates();} } ? incoming model: ?php class Incoming extends AppModel { var $name = 'Incoming'; var $validate = array( 'msisdn' = array( 'rule' = 'notEmpty', 'required' = true, 'message' = 'Please enter a valid msisdn', 'last' = true ), 'operator' = array( 'rule' = 'notEmpty', 'required' = true, 'message' = 'Please enter a valid operator', 'last' = true ), 'circle' = array( 'rule' = 'notEmpty', 'required' = true, 'message' = 'Please enter a valid circle', 'last' = true ) ); } ? Please suggest. Regards Tapan Thapa India tapan.th...@yahoo.com -- 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 -- 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
Re: Validation Question
Still not working. :-( My Url: http://localhost/cakephp/incomings/request/msisdn:/operator:AIRTEL/circle:DELHI My Controller: ?php class IncomingsController extends AppController { var $name = 'Incomings'; function request() { $this-Incoming-set(array( 'Incoming' = $this-params['named'] )); //$this-Incoming-set($this-params['named']); if ($this-Incoming-validates()==TRUE) { $this-Session-setFlash(Correct); } else { $this-Session-setFlash(Incorrect); } } } ? My Model: ?php class Incoming extends AppModel { var $name = 'Incoming'; var $validate = array( 'msisdn' = array( 'required' = true, 'allowEmpty' = false, 'rule' = 'numeric', 'message' = 'Please enter a valid msisdn', )); } ? Please suggest. Regards Tapan Thapa India On Thu, Feb 17, 2011 at 4:58 PM, John Andersen j.andersen...@gmail.comwrote: When you are setting the model data using the set() method, then you should provide it with at standard structure, not just the value of the msisdn parameter. [code example] $this-Incoming-set( array( 'Incoming' = $this-params['named'] ) ); [/code example] Enjoy, John On 17 Feb., 12:09, Tapan Kumar Thapa tapan.th...@hindustantimes.com wrote: I am dam got stuck here. Can some one suggest anything? BR Tapan Thapa On Thu, Feb 17, 2011 at 10:02 AM, Tapan Kumar Thapa [snip] -- 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 -- 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: Validation Question
I want to validate user input in http get url before inserting into my database table. If user is not sending any data or sending invalid character data in my named parameters then i want to use built in validation feature available in cake php and throw different error message for each named parameters. Please suggest. Regards Tapan Thapa On Thu, Feb 17, 2011 at 5:09 PM, Jeremy Burns | Class Outfit jeremybu...@classoutfit.com wrote: Why do you need to validate it? Is it not enough to just check the value? Jeremy Burns *Class Outfit* * * jeremybu...@classoutfit.com jeremybu...@mac.com http://www.classoutfit.com On 17 Feb 2011, at 11:33, Tapan Kumar Thapa wrote: Sorry to say but it is still not working. Url: http://localhost/cakephp/incomings/request/msisdn:/operator:AIRTEL/circle:DELHI Incoming controller: ?php class IncomingsController extends AppController { var $name = 'Incomings'; function request() { $this-Incoming-set($this-params['named']); if ($this-Incoming-validates()) { $this-Session-setFlash(Correct); } else { $this-Session-setFlash(Incorrect); } } } ? Incoming Model: ?php class Incoming extends AppModel { var $name = 'Incoming'; var $validate = array( 'msisdn' = array( 'required' = true, 'allowEmpty' = false, 'rule' = 'numeric', 'message' = 'Please enter a valid msisdn', )); } ? Please suggest. Is validation only work for post request of is it also work for get request like above? Regards Tapan Thapa India On Thu, Feb 17, 2011 at 4:49 PM, Dr. Tarique Sani tariques...@gmail.comwrote: Try $this-Incoming-set($this-params['named']); Tarique On Thu, Feb 17, 2011 at 4:39 PM, Tapan Kumar Thapa tapan.th...@hindustantimes.com wrote: I am dam got stuck here. Can some one suggest anything? BR Tapan Thapa On Thu, Feb 17, 2011 at 10:02 AM, Tapan Kumar Thapa tapan.th...@hindustantimes.com wrote: Hello, Now i am trying like this. http://localhost/cakephp/incomings/request/msisdn:/operator:AIRTEL/circle:DELHI but still validation from model class it not working. Please please suggest. My Model: ?php class Incoming extends AppModel { var $name = 'Incoming'; var $validate = array( 'msisdn' = array( 'required' = true, 'allowEmpty' = false, 'rule' = 'numeric', 'message' = 'Please enter a valid msisdn', )); } ? My Controller: ?php class IncomingsController extends AppController { var $name = 'Incomings'; function request() { $this-Incoming-set($this-params['named']['msisdn']); if ($this-Incoming-validates()) { $this-Session-setFlash(Correct); } else { $this-Session-setFlash(Incorrect); } } } ? I am always going in Correct message if condition however i have not given any value in msisdn parameter. Please please suggest something. I am clue less. Is validation only works in case of post request from view? Regards Tapan Thapa India On Thu, Feb 17, 2011 at 8:56 AM, Tapan Kumar Thapa tapan.thapa2...@gmail.com wrote: I don't mind using URL like this but are you sure that validation will work like this? Regards Tapan Thapa Sent from my iPhone On Feb 16, 2011, at 11:36 PM, euromark dereurom...@googlemail.com wrote: you are mixing cake pretty urls and plain url style why not going with /.../x:1/y:2/z:3 and using $this-params[named] ? if you don't mind my asking On 16 Feb., 12:49, Tapan Thapa tapan.thapa2...@gmail.com wrote: Hello Community, I want to create a url like this. http://localhost/cakephp/incomings/request/?msisdn=919871701375opera... and i am accepting this request in my controller like below code and passing it to model for validation but it is not working in case i left any variable above blank like (circle=) or (msisdn=) incomings_controller.php ?php class IncomingsController extends AppController { var $name = 'Incomings'; function request() { $this-Incoming-set($this-params['url']); $this-Incoming-validates();} } ? incoming model: ?php class Incoming extends AppModel { var $name = 'Incoming'; var $validate = array( 'msisdn' = array( 'rule' = 'notEmpty', 'required' = true, 'message' = 'Please enter a valid msisdn', 'last' = true ), 'operator' = array( 'rule' = 'notEmpty', 'required' = true, 'message' = 'Please enter a valid operator', 'last' = true ), 'circle' = array( 'rule' = 'notEmpty', 'required' = true, 'message' = 'Please enter a valid circle', 'last' = true ) ); } ? Please
Re: Validation Question
If i put debug statement nothing gets print in my incoming view. If i also put die statement then complete page dies and i got blank white blank page. ?php class IncomingsController extends AppController { var $name = 'Incomings'; function request() { $this-Incoming-set(array( 'Incoming' = $this-params['named'] )); debug($this-Incoming-validates()); //die(debug($this-Incoming-validationErrors)); /* $this-Incoming-set($this-params['named']); if ($this-Incoming-validates()==TRUE) { $this-Session-setFlash(Correct); } else { $this-Session-setFlash(Incorrect); } */ } } ? Please suggest... Regards Tapan Thapa On Thu, Feb 17, 2011 at 5:14 PM, Jeremy Burns | Class Outfit jeremybu...@classoutfit.com wrote: Try something for me... debug($this-Incoming-validates()); die(debug($this-Incoming-validationErrors)); ...rather than checking for true or false. Jeremy Burns *Class Outfit* * * jeremybu...@classoutfit.com jeremybu...@mac.com http://www.classoutfit.com On 17 Feb 2011, at 11:40, Tapan Kumar Thapa wrote: Still not working. :-( My Url: http://localhost/cakephp/incomings/request/msisdn:/operator:AIRTEL/circle:DELHI My Controller: ?php class IncomingsController extends AppController { var $name = 'Incomings'; function request() { $this-Incoming-set(array( 'Incoming' = $this-params['named'] )); //$this-Incoming-set($this-params['named']); if ($this-Incoming-validates()==TRUE) { $this-Session-setFlash(Correct); } else { $this-Session-setFlash(Incorrect); } } } ? My Model: ?php class Incoming extends AppModel { var $name = 'Incoming'; var $validate = array( 'msisdn' = array( 'required' = true, 'allowEmpty' = false, 'rule' = 'numeric', 'message' = 'Please enter a valid msisdn', )); } ? Please suggest. Regards Tapan Thapa India On Thu, Feb 17, 2011 at 4:58 PM, John Andersen j.andersen...@gmail.comwrote: When you are setting the model data using the set() method, then you should provide it with at standard structure, not just the value of the msisdn parameter. [code example] $this-Incoming-set( array( 'Incoming' = $this-params['named'] ) ); [/code example] Enjoy, John On 17 Feb., 12:09, Tapan Kumar Thapa tapan.th...@hindustantimes.com wrote: I am dam got stuck here. Can some one suggest anything? BR Tapan Thapa On Thu, Feb 17, 2011 at 10:02 AM, Tapan Kumar Thapa [snip] -- 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 -- 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 -- 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 -- 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: Validation Question
*Issue resolved:-)* Many thanks John for pointing me to the correct point. My model file name was incomings.php by mistake i think so and that is why validation was not working. Many thanks to Jeremy as well for helping me out. Regards Tapan Thapa India On Thu, Feb 17, 2011 at 6:19 PM, John Andersen j.andersen...@gmail.comwrote: Check your file names! Your model file name should be incoming.php! If it is not, then you may actually be using the AppModel instead of the Incoming Model class! Enjoy, John On 17 Feb., 13:05, Tapan Kumar Thapa tapan.th...@hindustantimes.com wrote: If i put debug statement nothing gets print in my incoming view. If i also put die statement then complete page dies and i got blank white blank page. ?php class IncomingsController extends AppController { var $name = 'Incomings'; function request() { $this-Incoming-set(array( 'Incoming' = $this-params['named'] )); debug($this-Incoming-validates()); //die(debug($this-Incoming-validationErrors)); /* $this-Incoming-set($this-params['named']); if ($this-Incoming-validates()==TRUE) { $this-Session-setFlash(Correct); } else { [snip] -- 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 -- 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: Validation Question
I don't mind using URL like this but are you sure that validation will work like this? Regards Tapan Thapa Sent from my iPhone On Feb 16, 2011, at 11:36 PM, euromark dereurom...@googlemail.com wrote: you are mixing cake pretty urls and plain url style why not going with /.../x:1/y:2/z:3 and using $this-params[named] ? if you don't mind my asking On 16 Feb., 12:49, Tapan Thapa tapan.thapa2...@gmail.com wrote: Hello Community, I want to create a url like this. http://localhost/cakephp/incomings/request/?msisdn=919871701375opera... and i am accepting this request in my controller like below code and passing it to model for validation but it is not working in case i left any variable above blank like (circle=) or (msisdn=) incomings_controller.php ?php class IncomingsController extends AppController { var $name = 'Incomings'; function request() { $this-Incoming-set($this-params['url']); $this-Incoming-validates();} } ? incoming model: ?php class Incoming extends AppModel { var $name = 'Incoming'; var $validate = array( 'msisdn' = array( 'rule' = 'notEmpty', 'required' = true, 'message' = 'Please enter a valid msisdn', 'last' = true ), 'operator' = array( 'rule' = 'notEmpty', 'required' = true, 'message' = 'Please enter a valid operator', 'last' = true ), 'circle' = array( 'rule' = 'notEmpty', 'required' = true, 'message' = 'Please enter a valid circle', 'last' = true ) ); } ? Please suggest. Regards Tapan Thapa India tapan.th...@yahoo.com -- 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 -- 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: Validation Question
Hello, Now i am trying like this. http://localhost/cakephp/incomings/request/msisdn:/operator:AIRTEL/circle:DELHI but still validation from model class it not working. Please please suggest. My Model: ?php class Incoming extends AppModel { var $name = 'Incoming'; var $validate = array( 'msisdn' = array( 'required' = true, 'allowEmpty' = false, 'rule' = 'numeric', 'message' = 'Please enter a valid msisdn', )); } ? My Controller: ?php class IncomingsController extends AppController { var $name = 'Incomings'; function request() { $this-Incoming-set($this-params['named']['msisdn']); if ($this-Incoming-validates()) { $this-Session-setFlash(Correct); } else { $this-Session-setFlash(Incorrect); } } } ? I am always going in Correct message if condition however i have not given any value in msisdn parameter. *Please please suggest something. I am clue less. Is validation only works in case of post request from view?* Regards Tapan Thapa India On Thu, Feb 17, 2011 at 8:56 AM, Tapan Kumar Thapa tapan.thapa2...@gmail.com wrote: I don't mind using URL like this but are you sure that validation will work like this? Regards Tapan Thapa Sent from my iPhone On Feb 16, 2011, at 11:36 PM, euromark dereurom...@googlemail.com wrote: you are mixing cake pretty urls and plain url style why not going with /.../x:1/y:2/z:3 and using $this-params[named] ? if you don't mind my asking On 16 Feb., 12:49, Tapan Thapa tapan.thapa2...@gmail.com wrote: Hello Community, I want to create a url like this. http://localhost/cakephp/incomings/request/?msisdn=919871701375opera. .. and i am accepting this request in my controller like below code and passing it to model for validation but it is not working in case i left any variable above blank like (circle=) or (msisdn=) incomings_controller.php ?php class IncomingsController extends AppController { var $name = 'Incomings'; function request() { $this-Incoming-set($this-params['url']); $this-Incoming-validates();} } ? incoming model: ?php class Incoming extends AppModel { var $name = 'Incoming'; var $validate = array( 'msisdn' = array( 'rule' = 'notEmpty', 'required' = true, 'message' = 'Please enter a valid msisdn', 'last' = true ), 'operator' = array( 'rule' = 'notEmpty', 'required' = true, 'message' = 'Please enter a valid operator', 'last' = true ), 'circle' = array( 'rule' = 'notEmpty', 'required' = true, 'message' = 'Please enter a valid circle', 'last' = true ) ); } ? Please suggest. Regards Tapan Thapa India tapan.th...@yahoo.com -- 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 -- 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