Re: Saving Multiple Records in look

2013-12-14 Thread Sanjeev Divekar
Hello,

I got solution. Please read http://goo.gl/qxL8QR

Regards,

On Wednesday, 11 December 2013 16:53:53 UTC+5:30, Sanjeev Divekar wrote:

 Hello,

 I am facing strange problem first time. I am trying to insert simple 
 records in database with Custom Auto Increment Values e.g 1, 2, 
 3. but unable to get Incremented value. Each record get updated with 
 same max number.

 *Controller Code*
 public function dobulk() {
 for($i=0;$i5;$i++) {
 $data = array();
 $this-Tmp-create();
 $data['Tmp']['invoice_no'] = $this-Tmp-get_no();
 $data['Tmp']['invoice_date'] = '2013-12-11';
 $this-Tmp-save($data);
 }
}

 *Model Code*
 public function get_no() {
 $strSql = SELECT
 LPAD(IFNULL(RIGHT(MAX(invoice_no),5),0) + 1,5,'0') AS max_id
 FROM tmps
 ;;

 $result = $this-query($strSql);
 $invoice_no = $result[0][0]['max_id'];
 return $invoice_no;
 }

 *Database Table*
 CREATE TABLE `tmps` (
   `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
   `invoice_no` varchar(20) DEFAULT NULL,
   `invoice_date` date DEFAULT NULL,
   PRIMARY KEY (`id`)
 ) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1

 Thanks in advance.



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

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


Validation Question

2013-12-14 Thread Advantage+
How do you validate / invalidate 1 field based on the other.

 

Example:

User changing password I have 

Confirm current (no issues there)

New Password input

Confirm New Password input

 

Now I have it set password has to be minimum 8 characters for the sake of
the question.

User enters new password 15 chars, all good, then confirm is 5 chars and I
get hit with 2 errors. 

Different passwords entered for new password field and Password must be
minimum of 8 for confirm field. 

No need to have 2 error messages I would think since the new password passed
validation should only be 1 message saying not the same.

 

Any ideas? Best to put all the validation rules on new password and simply
check they match on the confirm field?

 

I might have answered my own question.

 

But like to know what you think.

 

Thanks,

Dave

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

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


CakeAdvent: Dispatch filters, Asset Compression, Composer, OAuth and more!

2013-12-14 Thread Jose Diaz-Gonzalez
Hi all! I'm here to remind you all to read the CakeAdvent series! There
have been quite a few new posts, covering a few interesting topics:

- Asset compression
- Composer usage and composer app templates
- OAuth integration
- Background queuing systems
- Custom Exception handlers
- Dispatch filters
- Class aliasing

Here is a quick listing:

Part 6 - Building Service
Classeshttp://josediazgonzalez.com/2013/12/06/building-service-classes/
Part 7 - A quick rundown on Asset
Compressionhttp://josediazgonzalez.com/2013/12/07/a-quick-rundown-on-asset-compression/
Part 8 - Composing your applications from
pluginshttp://josediazgonzalez.com/2013/12/08/composing-your-applications-from-plugins/
Part 9 - Simplifying OAuth
integrationhttp://josediazgonzalez.com/2013/12/09/simplifying-oauth-integration/
Part 10 - Queue in scalable
applicationshttp://josediazgonzalez.com/2013/12/10/queue-in-scalable-applications/
Part 11 - Giving the gift of CakePHP to the
Communityhttp://josediazgonzalez.com/2013/12/11/giving-the-gift-of-cakephp-to-the-community/
Part 12 - Abusing Exceptions to provide model-layer
redirectionhttp://josediazgonzalez.com/2013/12/12/abusing-exceptions-to-provide-model-layer-redirection/
Part 13 - Simple application maintenance
modehttp://josediazgonzalez.com/2013/12/13/simple-application-maintenance-mode/
Part 14 - Creating a custom session flash
handlerhttp://josediazgonzalez.com/2013/12/14/creating-a-custom-session-flash-handler/

I'll be sending the posts in to the google groups more often now. There
will be 12 more posts, covering a similarly wide-range of topics. Here's to
12 more days of Advent Calendar!

Jose

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

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


Re: Cakephp Website Project

2013-12-14 Thread Jose Diaz-Gonzalez
The whole codebase can be written in CakePHP, and CakePHP can be used with
any Javascript framework you'd like to use.


On Tue, Dec 10, 2013 at 2:34 PM, Dean Haines vbpu...@gmail.com wrote:

 hi guys, im just about to embark on a new project whereby my custoer
 requires a backen which will allow administrators to add and manage a large
 product catalog which will feed a website shop front end.

 I am new to cakephp and after some research would like to build the
 project using cakephp. am I right in thinking that only the backend can be
 written using cakephp? im assuming it is and the front end would be written
 by hand. I would ver much be interested to her what others have done.

 Thanks in advance.

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

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


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

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