Thursday, March 31, 2011

Change Croogo Version

Hi i Can Use Croogo 1.2 and project done to 70 %...
So i can change version 1.3 ..means ovveride the existing version .
so is it possible??

--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Re: Delegates

appmodel and appcontroller would also allow you to have methods that are available to everything would it not?


On Fri, Apr 1, 2011 at 1:15 PM, Jeremy Burns | Class Outfit <jeremyburns@classoutfit.com> wrote:
Hmmmm. The model is your business layer really, but if you need something else you could use a component (http://book.cakephp.org/view/993/Components) simply because they can be made available to many controllers.

On 31 Mar 2011, at 20:29, anasmughal wrote:

With CakePHP, I wish to have a delegate layer between my models and
controllers.

The delegate would handle business logic for my application. I want
this logic to be available to many controllers.

Could someone kindly guide me on what is the best practice for that.
Thanks.

-- 
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+unsubscribe@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+unsubscribe@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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Re: JS question

Use HtmlHelper::scriptBlock

On Apr 1, 2011 6:28 AM, "Krissy Masters" <naked.cake.baker@gmail.com> wrote:

I can not seem to figure out how to output all javascript codeblocks in 1
place on the page.

I have elements that might require a scriptblock then some other element on
the page. How can I output the js in the element and the view into 1 spot in
the layout rather than in the middle of the page top bottom of where the
element gets placed.

Read the cookbook scriptStart codeblock js->outputbuffer tried various
things and everything just gets spit out all over.

<script type="text/javascript">
.
</script>

Thanks,

K

--
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+unsubscribe@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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

JS question

I can not seem to figure out how to output all javascript codeblocks in 1
place on the page.

I have elements that might require a scriptblock then some other element on
the page. How can I output the js in the element and the view into 1 spot in
the layout rather than in the middle of the page top bottom of where the
element gets placed.

Read the cookbook scriptStart codeblock js->outputbuffer tried various
things and everything just gets spit out all over.

<script type="text/javascript">
.
</script>

Thanks,

K

--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Re: multiple file upload in php

I would like to know how you would setup uploadify for cake. Could you
please post instructions?

On Mar 31, 3:49 am, Ravi <raviverma.5...@gmail.com> wrote:
> Hi Rishab,
>
> You can use Uploadify (http://www.uploadify.com/). This is a free
> flash uploading utility for PHP.
>
> And also it is quite easy to implement your own multiple file
> uploading functionality. Do let me know if you need instructions to
> implement your own functionality.
>
> Thanks,
> Ravi Verma
>
> On Mar 31, 12:46 pm, Rishab Jain <jairis...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Hi,
>
> > Does anybody know of a good multiple file upload in cakephp (or even php for
> > that matter). I'm not looking for many input tags for upload, but for an
> > interface where I can upload many files in one go.
>
> > And it should be a freeware.
>
> > regards,
> > Rishab

--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Re: RES: You favorite IDE/ Dev Setup?

I'm trying to see if there is something better to do cakePHP instead
of geany. Which is cool and all but I'd like something a little
better. I actually tried out NetBeans and I like it a lot so I'll
probably use that now.

It has autocomplete, a better interface, and (for lack of better
words) figures out how cake php and all my code is organized.

I think something is being done, so Post your setup :)

On Mar 31, 11:18 pm, Jeremy Burns | Class Outfit
<jeremybu...@classoutfit.com> wrote:
> What's the fascination with/usefulness of/relevance of this thread? I haven't seen trends that might influence anyone, any surprises or any advice. It's like show and tell from school days.
>
> Jeremy Burns
> Class Outfit
>
> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> On 1 Apr 2011, at 00:23, Anas Mughal wrote:
>
>
>
>
>
>
>
> > Mac or Ubuntu
> > Eclipse/PDT
> > xDebug
> > FireBug/FirePHP
> > FireCake
> > debug_kit
> > Smarty
> > Propel
>
> > --
> > anas mughal
> >http://anas-mughal.com
>
> > On Thu, Mar 31, 2011 at 3:55 PM, euromark <dereurom...@googlemail.com> wrote:
> > @tilen:
> > i know
>
> > one really annoying bug, though^^
> > at home i use two screens, with phpdesigner on the extra one - but if
> > I disconnect it to work somewhere else (without second screen)
> > the search window etc is still way out of the screen on the "right"
> > where the second monitor would be (i cannot use the search anymore
> > until i get home.. *grr*)
>
> > On 31 Mrz., 23:37, "pancary" <panc...@gmail.com> wrote:
> > > WinXP
> > > Eclipse PHP
> > > Yii/Cake
> > > W - Windows
> > > A - Apache
> > > M - MySql
> > > P - PHP
> > > Oracle SQL Developer/Navicat
>
> > > -----Mensagem original-----
> > > De: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] Em nome de
> > > Chris
> > > Enviada em: quinta-feira, 31 de março de 2011 13:50
> > > Para: CakePHP
> > > Assunto: Re: You favorite IDE/ Dev Setup?
>
> > > How often do you use NetBeans over geany? I haven't really figured out how I
> > > want to use Netbeans
>
> > > On Mar 31, 7:10 am, LipeDjow <liped...@gmail.com> wrote:
>
> > > > Ubuntu
> > > > NetBeans / Geany
> > > > SVN / Git
> > > > Apache
> > > > MySql
>
> > > --
> > > Our newest site for the community: CakePHP Video Tutorialshttp://tv.cakephp.orgCheckout the new CakePHP Questions sitehttp://ask.cakephp.organdhelp others with their CakePHP related questions.
>
> > > To unsubscribe from this group, send email to
> > > cake-php+unsubscribe@googlegroups.com For more options, visit this group
> > > cake-php+athttp://groups.google.com/group/cake-php
>
> > --
> > Our newest site for the community: CakePHP Video Tutorialshttp://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+unsubscribe@googlegroups.com For more options, visit this group athttp://groups.google.com/group/cake-php
>
> > --
> > Anas Mughal
>
> > --
> > Our newest site for the community: CakePHP Video Tutorialshttp://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+unsubscribe@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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

RE: Validate HABTM Multiple

I can, but why should I have to validate the Category in the Post model?

I was just under the assumption cake would handle that with saveAll since
there is nothing mentioning that it can't validate HABTM models. The "ALL"
in saveAll makes it sounds like it would save all related data.

$this->Post->saveAll( $this->data, array('validate' => 'only') ) to me
sounds like " if all of this data were to validate it could all be saved".
Post is related to Category HABTM relation and the book says save related
data in 1 call (db supports that is) if it validates.

Not being an ass but that sounds like saveSome() if your validating it
first.....no?

-----Original Message-----
From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
Of Jeremy Burns | Class Outfit
Sent: Friday, April 01, 2011 12:53 AM
To: cake-php@googlegroups.com
Subject: Re: Validate HABTM Multiple

Couldn't you write a custom validation rule in the Post model that examines
the count of the Category key of the data array passed in?

Jeremy Burns
Class Outfit

jeremyburns@classoutfit.com
http://www.classoutfit.com

On 1 Apr 2011, at 01:18, Krissy Masters wrote:

> How can you validate the number of "multiple" selected?
>
> I have a Post which hasMany, and HABTM relations so saving with :
>
> if ( $this->Post->saveAll( $this->data, array('validate' => 'only') ) )
> {//only testing to get errors
>
> but I never get any validation errors for the HABTM model
>
> Category:
> public $validate = array(
>
> 'Category' => array(
> 'multiple' => array(
> 'required' => false,
> 'allowEmpty' => true,
> 'rule' => array(
> 'multiple', array('max' => 3),
> 'message' => 'Please select one, two or
> three options'))));
>
>
> Post HABTM Category
>
> Ideas?
>
> Thanks
>
> K
>
> --
> 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+unsubscribe@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+unsubscribe@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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Re: Validate HABTM Multiple

Couldn't you write a custom validation rule in the Post model that examines the count of the Category key of the data array passed in?

Jeremy Burns
Class Outfit

jeremyburns@classoutfit.com
http://www.classoutfit.com

On 1 Apr 2011, at 01:18, Krissy Masters wrote:

> How can you validate the number of "multiple" selected?
>
> I have a Post which hasMany, and HABTM relations so saving with :
>
> if ( $this->Post->saveAll( $this->data, array('validate' => 'only') ) )
> {//only testing to get errors
>
> but I never get any validation errors for the HABTM model
>
> Category:
> public $validate = array(
>
> 'Category' => array(
> 'multiple' => array(
> 'required' => false,
> 'allowEmpty' => true,
> 'rule' => array(
> 'multiple', array('max' => 3),
> 'message' => 'Please select one, two or
> three options'))));
>
>
> Post HABTM Category
>
> Ideas?
>
> Thanks
>
> K
>
> --
> 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+unsubscribe@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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Re: RES: You favorite IDE/ Dev Setup?

What's the fascination with/usefulness of/relevance of this thread? I haven't seen trends that might influence anyone, any surprises or any advice. It's like show and tell from school days.

On 1 Apr 2011, at 00:23, Anas Mughal wrote:

Mac or Ubuntu
Eclipse/PDT
xDebug
FireBug/FirePHP
FireCake
debug_kit
Smarty
Propel

--
anas mughal
http://anas-mughal.com



On Thu, Mar 31, 2011 at 3:55 PM, euromark <dereuromark@googlemail.com> wrote:
@tilen:
i know

one really annoying bug, though^^
at home i use two screens, with phpdesigner on the extra one - but if
I disconnect it to work somewhere else (without second screen)
the search window etc is still way out of the screen on the "right"
where the second monitor would be (i cannot use the search anymore
until i get home.. *grr*)


On 31 Mrz., 23:37, "pancary" <panc...@gmail.com> wrote:
> WinXP
> Eclipse PHP
> Yii/Cake
> W - Windows
> A - Apache
> M - MySql
> P - PHP
> Oracle SQL Developer/Navicat
>
> -----Mensagem original-----
> De: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] Em nome de
> Chris
> Enviada em: quinta-feira, 31 de março de 2011 13:50
> Para: CakePHP
> Assunto: Re: You favorite IDE/ Dev Setup?
>
> How often do you use NetBeans over geany? I haven't really figured out how I
> want to use Netbeans
>
> On Mar 31, 7:10 am, LipeDjow <liped...@gmail.com> wrote:
>
> > Ubuntu
> > NetBeans / Geany
> > SVN / Git
> > Apache
> > MySql
>
> --
> Our newest site for the community: CakePHP Video Tutorialshttp://tv.cakephp.orgCheck 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+unsubscribe@googlegroups.com For more options, visit this group
> cake-php+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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php



--
Anas Mughal






--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Re: Delegates

Hmmmm. The model is your business layer really, but if you need something else you could use a component (http://book.cakephp.org/view/993/Components) simply because they can be made available to many controllers.

On 31 Mar 2011, at 20:29, anasmughal wrote:

With CakePHP, I wish to have a delegate layer between my models and
controllers.

The delegate would handle business logic for my application. I want
this logic to be available to many controllers.

Could someone kindly guide me on what is the best practice for that.
Thanks.

-- 
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

RE: Change an existing variable to another existing variable value????

General PHP? Google PHP Groups I don't know.

This is CakePHP specifically for CakePHP Framework. Questions related to
using the Framework.

K

-----Original Message-----
From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
Of maepl2@yahoo.com
Sent: Friday, April 01, 2011 12:12 AM
To: CakePHP
Subject: Re: Change an existing variable to another existing variable
value????

What do you mean??? where should I be????

On Mar 31, 7:07 pm, euromark <dereurom...@googlemail.com> wrote:
> you are in the wrong group, sir! :)
>
> On 31 Mrz., 23:32, "mae...@yahoo.com" <mae...@yahoo.com> wrote:
>
>
>
> > How do I change an existing variable value to another variable value
> > that a user selected from a drop down menu?  I have a dropdown that
> > allows a user to select an amount based on ounces.   The shopping cart
> > was set up to take the variable $price into the cart.  In the
> > database, I have $price, $price1, $price2, $3price.  If the user
> > selects $price2 from the dropdown, I need the $price variable to
> > change to what is inside $price2.   I know I need some type of case of
> > switch, but I do not know how to do that so that it changes
> > $price?     Any help greatly appreciated.....
>
> > <?php
> > // Check to see the URL variable is set and that it exists in the
> > database
> > if (isset($_GET['id'])) {
> >         // Connect to the MySQL database
> >     include "storescripts/connect_to_mysql.php";
> >         $id = preg_replace('#[^0-9]#i', '', $_GET['id']);
> >         // Use this var to check to see if this ID exists, if yes then
get
> > the product
> >         // details, if no then exit this script and give message why
> >         $sql = mysql_query("SELECT * FROM products WHERE id='$id' LIMIT
1");
> >         $productCount = mysql_num_rows($sql); // count the output amount
> >     if ($productCount > 0) {
> >                 // get all the product details
> >                 while($row = mysql_fetch_array($sql)){
> >                          $product_name = $row['product_name'];
> >                          $price = $row['price'];
> >                          $price1 = $row['price1'];
> >                          $price2 = $row['price2'];
> >                          $price3 = $row['price3'];
> >                          $oz = $row['oz'];
> >                          $oz1 = $row['oz1'];
> >                          $oz2 = $row["oz2"];
> >                          $oz3 = $row["oz3"];
> >                          $details = $row["details"];
> >                         }
>
> >         } else {
> >                 echo "That item does not exist.";
> >             exit();
> >         }
>
> > } else {
>
> >         echo "Data to render this page is missing.";
> >         exit();
>
> > }
>
> > ?>
> > <?php
>
> > mysql_close();
> > ?>
> > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> > <html xmlns="http://www.w3.org/1999/xhtml">
> > <head>
> > <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
> > <title><?php echo $product_name; ?></title>
> > <link rel="stylesheet" href="style/style.css" type="text/css"
> > media="screen" />
> > <style type="text/css">
> > <!--
> > a:link {
> >         text-decoration: none;}
>
> > a:visited {
> >         text-decoration: none;}
>
> > a:hover {
> >         text-decoration: none;}
>
> > a:active {
> >         text-decoration: none;}
>
> > -->
> > </style></head>
> > <body>
> > <div align="center" id="mainWrapper">
> >   <?php include_once("templates/template_header.php");?>
> >   <div id="pageContent">
> >   <table width="100%" border="0" cellspacing="0" cellpadding="5">
> >   <tr>
> >     <td width="19%" valign="top"><img src="inventory_images/<?php echo
> > $id; ?>.jpg" width="188" height="188" alt="<?php echo $product_name; ?>"
/>
>
> >       <a href="inventory_images/<?php echo $id; ?>.jpg">View Full Size
> > Image</a></td>
> >     <td width="81%" valign="top"><h2><?php echo $product_name; ?></h2>
> >       <h1>
> >                 <label>Please select a amount</label>
> >         <select name="price"id="price">
> >                 <option value="">Choose</option>
> >                 <option value="price1"><?php echo $price1 ."  "?><?php
echo  $oz1  ?></option>
>
> >                 <option value="price2"><?php echo $price2 ."  "?><?php
echo  $oz2  ?></option>
>
> >                 <option value="price3"><?php echo $price3 ."  "?><?php
echo  $oz3  ?></option>
>
> >                         </select>
> >           </h1>
> >           <h1><?php echo $details; ?></h1>
> > <br />
> >               <form id="form1" name="form1" method="post"
> > action="cart.php">
> >         <input type="hidden" name="pid" id="pid" value="<?php echo
> > $id; ?>" />
> >         <input type="submit" name="button" id="button" value="Add to
> > Shopping Cart" />
> >       </form>      </td>
> >     </tr>
> > </table>
> >   </div>
> >   <?php include_once("templates/template_footer.php");?>
> > </div>
> > </body>
> > </html>- Hide quoted text -
>
> - Show quoted text -

--
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+unsubscribe@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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Re: Change an existing variable to another existing variable value????

What do you mean??? where should I be????

On Mar 31, 7:07 pm, euromark <dereurom...@googlemail.com> wrote:
> you are in the wrong group, sir! :)
>
> On 31 Mrz., 23:32, "mae...@yahoo.com" <mae...@yahoo.com> wrote:
>
>
>
> > How do I change an existing variable value to another variable value
> > that a user selected from a drop down menu?  I have a dropdown that
> > allows a user to select an amount based on ounces.   The shopping cart
> > was set up to take the variable $price into the cart.  In the
> > database, I have $price, $price1, $price2, $3price.  If the user
> > selects $price2 from the dropdown, I need the $price variable to
> > change to what is inside $price2.   I know I need some type of case of
> > switch, but I do not know how to do that so that it changes
> > $price?     Any help greatly appreciated.....
>
> > <?php
> > // Check to see the URL variable is set and that it exists in the
> > database
> > if (isset($_GET['id'])) {
> >         // Connect to the MySQL database
> >     include "storescripts/connect_to_mysql.php";
> >         $id = preg_replace('#[^0-9]#i', '', $_GET['id']);
> >         // Use this var to check to see if this ID exists, if yes then get
> > the product
> >         // details, if no then exit this script and give message why
> >         $sql = mysql_query("SELECT * FROM products WHERE id='$id' LIMIT 1");
> >         $productCount = mysql_num_rows($sql); // count the output amount
> >     if ($productCount > 0) {
> >                 // get all the product details
> >                 while($row = mysql_fetch_array($sql)){
> >                          $product_name = $row['product_name'];
> >                          $price = $row['price'];
> >                          $price1 = $row['price1'];
> >                          $price2 = $row['price2'];
> >                          $price3 = $row['price3'];
> >                          $oz = $row['oz'];
> >                          $oz1 = $row['oz1'];
> >                          $oz2 = $row["oz2"];
> >                          $oz3 = $row["oz3"];
> >                          $details = $row["details"];
> >                         }
>
> >         } else {
> >                 echo "That item does not exist.";
> >             exit();
> >         }
>
> > } else {
>
> >         echo "Data to render this page is missing.";
> >         exit();
>
> > }
>
> > ?>
> > <?php
>
> > mysql_close();
> > ?>
> > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> > <html xmlns="http://www.w3.org/1999/xhtml">
> > <head>
> > <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
> > <title><?php echo $product_name; ?></title>
> > <link rel="stylesheet" href="style/style.css" type="text/css"
> > media="screen" />
> > <style type="text/css">
> > <!--
> > a:link {
> >         text-decoration: none;}
>
> > a:visited {
> >         text-decoration: none;}
>
> > a:hover {
> >         text-decoration: none;}
>
> > a:active {
> >         text-decoration: none;}
>
> > -->
> > </style></head>
> > <body>
> > <div align="center" id="mainWrapper">
> >   <?php include_once("templates/template_header.php");?>
> >   <div id="pageContent">
> >   <table width="100%" border="0" cellspacing="0" cellpadding="5">
> >   <tr>
> >     <td width="19%" valign="top"><img src="inventory_images/<?php echo
> > $id; ?>.jpg" width="188" height="188" alt="<?php echo $product_name; ?>" />
>
> >       <a href="inventory_images/<?php echo $id; ?>.jpg">View Full Size
> > Image</a></td>
> >     <td width="81%" valign="top"><h2><?php echo $product_name; ?></h2>
> >       <h1>
> >                 <label>Please select a amount</label>
> >         <select name="price"id="price">
> >                 <option value="">Choose</option>
> >                 <option value="price1"><?php echo $price1 ."  "?><?php echo  $oz1  ?></option>
>
> >                 <option value="price2"><?php echo $price2 ."  "?><?php echo  $oz2  ?></option>
>
> >                 <option value="price3"><?php echo $price3 ."  "?><?php echo  $oz3  ?></option>
>
> >                         </select>
> >           </h1>
> >           <h1><?php echo $details; ?></h1>
> > <br />
> >               <form id="form1" name="form1" method="post"
> > action="cart.php">
> >         <input type="hidden" name="pid" id="pid" value="<?php echo
> > $id; ?>" />
> >         <input type="submit" name="button" id="button" value="Add to
> > Shopping Cart" />
> >       </form>      </td>
> >     </tr>
> > </table>
> >   </div>
> >   <?php include_once("templates/template_footer.php");?>
> > </div>
> > </body>
> > </html>- Hide quoted text -
>
> - Show quoted text -

--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Re: Datasource schemas defined into models

Overload DataSource::isInterfaceSupported() method to not report
listSources() method as available if you don't like it so much.

On Mar 31, 4:34 pm, Clément Hallet <clem...@challet.eu> wrote:
> I overloaded the $mydatasource->describe() method to return the $model->_schema value ($model comes as a parameter to describe). It would
>
> work but an other issue (at least, it seems to be for me).
>
> My real issue is elsewhere and I wonder if it's a mistake in the
> global design. Let's focus on it :
>
> The function Model->setSource() is called to link a model to a table.
> While doing it, there is the next test : "if($db->isInterfaceSupported('listSources'))" and erase the $model->_schema
>
> from the schema if true. I guess it's done to later rely on a schema
> coming from the datasource.
>
> And so if no schema is coming from the datasource, the $model->_schema
> would be used instead. But it's not ! because even when not
> implementing the "mydatasource->listSources" method, it comes from the
> Datasoure inheritance. It means that every one datasource (according
> it extends DataSource) can't rely on its $models->_schema (because
> they're always reseted).
>
> The aim of this inherited method is to cache the sources ant it's
> called internally by its overloading methods ("parent::listSources()")
> but it can't be a replacement (because the cache may not be already
> setted). So there is no point to have the same method names and get
> inheritance.
>
> I made the according changes herehttp://goo.gl/QTBtJand would like
> to have others' opinion before to make a pull request.
>
> Please let me know if I missed something in that description.
>
> On 30 mar, 04:43, "Dr. Loboto" <drlob...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Model have schema() method which call describe() method of data source
> > if supported. For manual per-model schemas you can override its
> > schema() method. For datasource-managed schemas you should take a look
> > into its describe() method.
>
> > On 29 Đ¼Đ°Ñ€, 03:50, Clément Hallet <clem...@challet.eu> wrote:
>
> > > Hello CakePHP,
>
> > > Trying to implement a CouchDB datasource and to closely follow the
> > > CakePHP guidelines,
> > > I'm in a trick situation :
>
> > > When saving a new record, it's required to have the fields matching
> > > the schema :https://github.com/cakephp/cakephp/blob/master/cake/libs/model/model....
> > > So, i put a $_schema in my model to match what i want to save.
>
> > > The problem is that this schema is automatically reseted to "array()"
> > > at initialization :https://github.com/cakephp/cakephp/blob/master/cake/libs/model/model....
>
> > > Even when removing the "listSources" method from my Datasource, it's
> > > still reseted because of the test "$db->isInterfaceSupported('listSources')"  :
>
> > > In fact my datasource extends "Datasource" (i think it's required)
> > > which have it's own "listSources" method for caching children ones.
>
> > > So I would like to ask : is this Datasource->listSources method is
> > > compatible with per-Model defined schemas ? or am I doing wrong ?
>
> > > --
> > > Clément

--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Validate HABTM Multiple

How can you validate the number of "multiple" selected?

I have a Post which hasMany, and HABTM relations so saving with :

if ( $this->Post->saveAll( $this->data, array('validate' => 'only') ) )
{//only testing to get errors

but I never get any validation errors for the HABTM model

Category:
public $validate = array(

'Category' => array(
'multiple' => array(
'required' => false,
'allowEmpty' => true,
'rule' => array(
'multiple', array('max' => 3),
'message' => 'Please select one, two or
three options'))));


Post HABTM Category

Ideas?

Thanks

K

--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

1 form 2 models - how to validate without savingAll?

Hi all,

I had been searching for the answer yet I don't find it!

I'm having a 3 steps form so I'm not saving the data in each step, only validating it and passing it hidden in each step.

In the form I use 2 different models.

So if I try to validate like this:
$this->User->set($this->data);
$this->User->Profile->set($this->data);
if ($this->User->validates() && $this->User->Profile->validates()) { ...

I'm only getting the User data validated. If I comment the first line the one that sets the data for User model then I get the Profile data validated.

So How can I get them both at the same time???  (without using saveAll!)

thanks!

--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Re: RES: You favorite IDE/ Dev Setup?

Mac or Ubuntu
Eclipse/PDT
xDebug
FireBug/FirePHP
FireCake
debug_kit
Smarty
Propel

--
anas mughal
http://anas-mughal.com



On Thu, Mar 31, 2011 at 3:55 PM, euromark <dereuromark@googlemail.com> wrote:
@tilen:
i know

one really annoying bug, though^^
at home i use two screens, with phpdesigner on the extra one - but if
I disconnect it to work somewhere else (without second screen)
the search window etc is still way out of the screen on the "right"
where the second monitor would be (i cannot use the search anymore
until i get home.. *grr*)


On 31 Mrz., 23:37, "pancary" <panc...@gmail.com> wrote:
> WinXP
> Eclipse PHP
> Yii/Cake
> W - Windows
> A - Apache
> M - MySql
> P - PHP
> Oracle SQL Developer/Navicat
>
> -----Mensagem original-----
> De: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] Em nome de
> Chris
> Enviada em: quinta-feira, 31 de março de 2011 13:50
> Para: CakePHP
> Assunto: Re: You favorite IDE/ Dev Setup?
>
> How often do you use NetBeans over geany? I haven't really figured out how I
> want to use Netbeans
>
> On Mar 31, 7:10 am, LipeDjow <liped...@gmail.com> wrote:
>
> > Ubuntu
> > NetBeans / Geany
> > SVN / Git
> > Apache
> > MySql
>
> --
> Our newest site for the community: CakePHP Video Tutorialshttp://tv.cakephp.orgCheck 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+unsubscribe@googlegroups.com For more options, visit this group
> cake-php+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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php



--
Anas Mughal





--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Re: Change an existing variable to another existing variable value????

you are in the wrong group, sir! :)

On 31 Mrz., 23:32, "mae...@yahoo.com" <mae...@yahoo.com> wrote:
> How do I change an existing variable value to another variable value
> that a user selected from a drop down menu?  I have a dropdown that
> allows a user to select an amount based on ounces.   The shopping cart
> was set up to take the variable $price into the cart.  In the
> database, I have $price, $price1, $price2, $3price.  If the user
> selects $price2 from the dropdown, I need the $price variable to
> change to what is inside $price2.   I know I need some type of case of
> switch, but I do not know how to do that so that it changes
> $price?     Any help greatly appreciated.....
>
> <?php
> // Check to see the URL variable is set and that it exists in the
> database
> if (isset($_GET['id'])) {
>         // Connect to the MySQL database
>     include "storescripts/connect_to_mysql.php";
>         $id = preg_replace('#[^0-9]#i', '', $_GET['id']);
>         // Use this var to check to see if this ID exists, if yes then get
> the product
>         // details, if no then exit this script and give message why
>         $sql = mysql_query("SELECT * FROM products WHERE id='$id' LIMIT 1");
>         $productCount = mysql_num_rows($sql); // count the output amount
>     if ($productCount > 0) {
>                 // get all the product details
>                 while($row = mysql_fetch_array($sql)){
>                          $product_name = $row['product_name'];
>                          $price = $row['price'];
>                          $price1 = $row['price1'];
>                          $price2 = $row['price2'];
>                          $price3 = $row['price3'];
>                          $oz = $row['oz'];
>                          $oz1 = $row['oz1'];
>                          $oz2 = $row["oz2"];
>                          $oz3 = $row["oz3"];
>                          $details = $row["details"];
>                         }
>
>         } else {
>                 echo "That item does not exist.";
>             exit();
>         }
>
> } else {
>
>         echo "Data to render this page is missing.";
>         exit();
>
> }
>
> ?>
> <?php
>
> mysql_close();
> ?>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml">
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
> <title><?php echo $product_name; ?></title>
> <link rel="stylesheet" href="style/style.css" type="text/css"
> media="screen" />
> <style type="text/css">
> <!--
> a:link {
>         text-decoration: none;}
>
> a:visited {
>         text-decoration: none;}
>
> a:hover {
>         text-decoration: none;}
>
> a:active {
>         text-decoration: none;}
>
> -->
> </style></head>
> <body>
> <div align="center" id="mainWrapper">
>   <?php include_once("templates/template_header.php");?>
>   <div id="pageContent">
>   <table width="100%" border="0" cellspacing="0" cellpadding="5">
>   <tr>
>     <td width="19%" valign="top"><img src="inventory_images/<?php echo
> $id; ?>.jpg" width="188" height="188" alt="<?php echo $product_name; ?>" />
>
>       <a href="inventory_images/<?php echo $id; ?>.jpg">View Full Size
> Image</a></td>
>     <td width="81%" valign="top"><h2><?php echo $product_name; ?></h2>
>       <h1>
>                 <label>Please select a amount</label>
>         <select name="price"id="price">
>                 <option value="">Choose</option>
>                 <option value="price1"><?php echo $price1 ."  "?><?php echo  $oz1  ?></option>
>
>                 <option value="price2"><?php echo $price2 ."  "?><?php echo  $oz2  ?></option>
>
>                 <option value="price3"><?php echo $price3 ."  "?><?php echo  $oz3  ?></option>
>
>                         </select>
>           </h1>
>           <h1><?php echo $details; ?></h1>
> <br />
>               <form id="form1" name="form1" method="post"
> action="cart.php">
>         <input type="hidden" name="pid" id="pid" value="<?php echo
> $id; ?>" />
>         <input type="submit" name="button" id="button" value="Add to
> Shopping Cart" />
>       </form>      </td>
>     </tr>
> </table>
>   </div>
>   <?php include_once("templates/template_footer.php");?>
> </div>
> </body>
> </html>

--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Re: RES: You favorite IDE/ Dev Setup?

@tilen:
i know

one really annoying bug, though^^
at home i use two screens, with phpdesigner on the extra one - but if
I disconnect it to work somewhere else (without second screen)
the search window etc is still way out of the screen on the "right"
where the second monitor would be (i cannot use the search anymore
until i get home.. *grr*)


On 31 Mrz., 23:37, "pancary" <panc...@gmail.com> wrote:
> WinXP
> Eclipse PHP
> Yii/Cake
> W - Windows
> A - Apache
> M - MySql
> P - PHP
> Oracle SQL Developer/Navicat
>
> -----Mensagem original-----
> De: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] Em nome de
> Chris
> Enviada em: quinta-feira, 31 de março de 2011 13:50
> Para: CakePHP
> Assunto: Re: You favorite IDE/ Dev Setup?
>
> How often do you use NetBeans over geany? I haven't really figured out how I
> want to use Netbeans
>
> On Mar 31, 7:10 am, LipeDjow <liped...@gmail.com> wrote:
>
> > Ubuntu
> > NetBeans / Geany
> > SVN / Git
> > Apache
> > MySql
>
> --
> Our newest site for the community: CakePHP Video Tutorialshttp://tv.cakephp.orgCheck 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+unsubscribe@googlegroups.com For more options, visit this group
> cake-php+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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Re: Change an existing variable to another existing variable value????

This list is for qustions about using the CakePHP frameork.

On Thu, Mar 31, 2011 at 5:32 PM, maepl2@yahoo.com <maepl2@yahoo.com> wrote:
> How do I change an existing variable value to another variable value
> that a user selected from a drop down menu?  I have a dropdown that
> allows a user to select an amount based on ounces.   The shopping cart
> was set up to take the variable $price into the cart.  In the
> database, I have $price, $price1, $price2, $3price.  If the user
> selects $price2 from the dropdown, I need the $price variable to
> change to what is inside $price2.   I know I need some type of case of
> switch, but I do not know how to do that so that it changes
> $price?     Any help greatly appreciated.....
>
> <?php
> // Check to see the URL variable is set and that it exists in the
> database
> if (isset($_GET['id'])) {
>        // Connect to the MySQL database
>    include "storescripts/connect_to_mysql.php";
>        $id = preg_replace('#[^0-9]#i', '', $_GET['id']);
>        // Use this var to check to see if this ID exists, if yes then get
> the product
>        // details, if no then exit this script and give message why
>        $sql = mysql_query("SELECT * FROM products WHERE id='$id' LIMIT 1");
>        $productCount = mysql_num_rows($sql); // count the output amount
>    if ($productCount > 0) {
>                // get all the product details
>                while($row = mysql_fetch_array($sql)){
>                         $product_name = $row['product_name'];
>                         $price = $row['price'];
>                         $price1 = $row['price1'];
>                         $price2 = $row['price2'];
>                         $price3 = $row['price3'];
>                         $oz = $row['oz'];
>                         $oz1 = $row['oz1'];
>                         $oz2 = $row["oz2"];
>                         $oz3 = $row["oz3"];
>                         $details = $row["details"];
>                        }
>
>        } else {
>                echo "That item does not exist.";
>            exit();
>        }
>
> } else {
>        echo "Data to render this page is missing.";
>        exit();
> }
>
>
> ?>
> <?php
>
>
> mysql_close();
> ?>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
> www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml">
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
> <title><?php echo $product_name; ?></title>
> <link rel="stylesheet" href="style/style.css" type="text/css"
> media="screen" />
> <style type="text/css">
> <!--
> a:link {
>        text-decoration: none;
> }
> a:visited {
>        text-decoration: none;
> }
> a:hover {
>        text-decoration: none;
> }
> a:active {
>        text-decoration: none;
> }
> -->
> </style></head>
> <body>
> <div align="center" id="mainWrapper">
>  <?php include_once("templates/template_header.php");?>
>  <div id="pageContent">
>  <table width="100%" border="0" cellspacing="0" cellpadding="5">
>  <tr>
>    <td width="19%" valign="top"><img src="inventory_images/<?php echo
> $id; ?>.jpg" width="188" height="188" alt="<?php echo $product_name; ?
>>" />
>      <a href="inventory_images/<?php echo $id; ?>.jpg">View Full Size
> Image</a></td>
>    <td width="81%" valign="top"><h2><?php echo $product_name; ?></h2>
>      <h1>
>                <label>Please select a amount</label>
>        <select name="price"id="price">
>                <option value="">Choose</option>
>                <option value="price1"><?php echo $price1 ."  "?><?php echo  $oz1  ?
>></option>
>                <option value="price2"><?php echo $price2 ."  "?><?php echo  $oz2  ?
>></option>
>                <option value="price3"><?php echo $price3 ."  "?><?php echo  $oz3  ?
>></option>
>                        </select>
>          </h1>
>          <h1><?php echo $details; ?></h1>
> <br />
>              <form id="form1" name="form1" method="post"
> action="cart.php">
>        <input type="hidden" name="pid" id="pid" value="<?php echo
> $id; ?>" />
>        <input type="submit" name="button" id="button" value="Add to
> Shopping Cart" />
>      </form>      </td>
>    </tr>
> </table>
>  </div>
>  <?php include_once("templates/template_footer.php");?>
> </div>
> </body>
> </html>
>
> --
> 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+unsubscribe@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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Re: How do I display all comments for a post.

foreach ($posts as $post) //main foreach for displaying posts
{
    ///somewhere where you want comments do this
   foreach ($post['Comment'] as $comment)
   {
      pr($comment);
   }
}
--
Lep pozdrav, Tilen Majerle



2011/3/31 Elguapaul <elguapaul@gmail.com>
I have 2 tables, posts and comments.  I have setup posts hasMany
comments and comments belongsTo posts model relations.  I am using a
foreign key in the comments table pointing back to the post id.

I want to display the Post and the all related comments.  At the
moment I can display the post and a specified comment by using the
View code below.  How do I display all the comments for a post?


View Code:
       <?php
       $i = 0;
       foreach ($posts as $post):
               $class = null;
               if ($i++ % 2 == 0) {
                       $class = ' altrow';
               }
       ?>
       <div class="homepage<?php echo $class;?>">
               <p><h3><?php echo $post['Post']['title']; ?></h3></p>
               <p><?php echo $post['Post']['body']; ?></p><br />

<!-- Comments below -->
<p><?php echo $post['Comment']['0']['body'];?></p>
</div>
<?php endforeach; ?>


This is the pr() output:

Array
(
 [0] => Array
       (
           [Post] => Array
               (
                   [id] => 2
                   [title] => A title once again
                   [body] => And the post body follows.
                   [created] => 2011-03-17 09:15:40
                   [modified] =>
               )

           [Comment] => Array
               (
                   [0] => Array
                       (
                           [id] => 2
                           [post_id] => 2
                           [title] => COMMENTSA title once again
                           [body] => AndCOMMENTS the post body
follows.
                           [created] => 2011-03-22 16:31:03
                           [modified] =>
                       )

                   [1] => Array
                       (
                           [id] => 4
                           [post_id] => 2
                           [title] =>
                           [body] => This is another comment for the
first post
                           [created] => 2011-03-22 17:28:34
                           [modified] => 2011-03-22 17:28:34
                       )

               )

       )


I am new to Cakephp so thanks in advance.

--
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+unsubscribe@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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

RES: You favorite IDE/ Dev Setup?

WinXP
Eclipse PHP
Yii/Cake
W - Windows
A - Apache
M - MySql
P - PHP
Oracle SQL Developer/Navicat

-----Mensagem original-----
De: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] Em nome de
Chris
Enviada em: quinta-feira, 31 de março de 2011 13:50
Para: CakePHP
Assunto: Re: You favorite IDE/ Dev Setup?

How often do you use NetBeans over geany? I haven't really figured out how I
want to use Netbeans

On Mar 31, 7:10 am, LipeDjow <liped...@gmail.com> wrote:
> Ubuntu
> NetBeans / Geany
> SVN / Git
> Apache
> MySql

--
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+unsubscribe@googlegroups.com For more options, visit this group
cake-php+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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Change an existing variable to another existing variable value????

How do I change an existing variable value to another variable value
that a user selected from a drop down menu? I have a dropdown that
allows a user to select an amount based on ounces. The shopping cart
was set up to take the variable $price into the cart. In the
database, I have $price, $price1, $price2, $3price. If the user
selects $price2 from the dropdown, I need the $price variable to
change to what is inside $price2. I know I need some type of case of
switch, but I do not know how to do that so that it changes
$price? Any help greatly appreciated.....

<?php
// Check to see the URL variable is set and that it exists in the
database
if (isset($_GET['id'])) {
// Connect to the MySQL database
include "storescripts/connect_to_mysql.php";
$id = preg_replace('#[^0-9]#i', '', $_GET['id']);
// Use this var to check to see if this ID exists, if yes then get
the product
// details, if no then exit this script and give message why
$sql = mysql_query("SELECT * FROM products WHERE id='$id' LIMIT 1");
$productCount = mysql_num_rows($sql); // count the output amount
if ($productCount > 0) {
// get all the product details
while($row = mysql_fetch_array($sql)){
$product_name = $row['product_name'];
$price = $row['price'];
$price1 = $row['price1'];
$price2 = $row['price2'];
$price3 = $row['price3'];
$oz = $row['oz'];
$oz1 = $row['oz1'];
$oz2 = $row["oz2"];
$oz3 = $row["oz3"];
$details = $row["details"];
}

} else {
echo "That item does not exist.";
exit();
}

} else {
echo "Data to render this page is missing.";
exit();
}


?>
<?php


mysql_close();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $product_name; ?></title>
<link rel="stylesheet" href="style/style.css" type="text/css"
media="screen" />
<style type="text/css">
<!--
a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: none;
}
a:active {
text-decoration: none;
}
-->
</style></head>
<body>
<div align="center" id="mainWrapper">
<?php include_once("templates/template_header.php");?>
<div id="pageContent">
<table width="100%" border="0" cellspacing="0" cellpadding="5">
<tr>
<td width="19%" valign="top"><img src="inventory_images/<?php echo
$id; ?>.jpg" width="188" height="188" alt="<?php echo $product_name; ?
>" />
<a href="inventory_images/<?php echo $id; ?>.jpg">View Full Size
Image</a></td>
<td width="81%" valign="top"><h2><?php echo $product_name; ?></h2>
<h1>
<label>Please select a amount</label>
<select name="price"id="price">
<option value="">Choose</option>
<option value="price1"><?php echo $price1 ." "?><?php echo $oz1 ?
></option>
<option value="price2"><?php echo $price2 ." "?><?php echo $oz2 ?
></option>
<option value="price3"><?php echo $price3 ." "?><?php echo $oz3 ?
></option>
</select>
</h1>
<h1><?php echo $details; ?></h1>
<br />
<form id="form1" name="form1" method="post"
action="cart.php">
<input type="hidden" name="pid" id="pid" value="<?php echo
$id; ?>" />
<input type="submit" name="button" id="button" value="Add to
Shopping Cart" />
</form> </td>
</tr>
</table>
</div>
<?php include_once("templates/template_footer.php");?>
</div>
</body>
</html>

--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Re: How to know if a user has left a particular page

On Thu, Mar 31, 2011 at 5:15 PM, euromark <dereuromark@googlemail.com> wrote:
> "The exact handling of the unload event has varied from version to
> version of browsers. For example, some versions of Firefox trigger the
> event when a link is followed, but not when the window is closed. In
> practical usage, behavior should be tested on all supported browsers,
> and contrasted with the proprietary beforeunload event."
> source: http://api.jquery.com/unload/
>
> so it seems this is not an exact science

Yes, onUnload has never been reliable. Pinging with AJAX is the more
suitable approach anyway. The problem should not be formulated as
learning the exact moment when the user left the page but instead
testing whether the user was there recently. Set some value for the
period of time between pings. If, at the time you check, the ping
timestamp is older than that value, pause for some time, then check
again. If the timestamp hasn't changed, user can be considered gone.

--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Re: multiple file upload in php

On Thu, Mar 31, 2011 at 3:34 PM, Rishab Jain <jairishab@gmail.com> wrote:
> Hi,
>
> This works fine when I created a non-cakephp based setup. However, when I
> try to use it in a cake based setup, it gives me an error. After almost an
> hour of debugging, I saw that the problem lies in,
>
>         $('#file_upload').uploadify({
>           'uploader'  : 'path_to_uploadifyswf/uploadify.swf',
>           'script'    : 'http://dev.mydomain.com/multiupload/',
>           'cancelImg' : 'pathtoimages/cancel.png',
>           'folder'    : 'uploaded_files',
>           'multi'       : true,
>
> Here, when I give the script URL to be of an action of a controller, it
> gives me a 302 Error. However, when I change it to
>           'script'    :
> 'http://dev.mydomain.com/non_cake_based_setup/multiupload.php',
>
> It works then.
>
> Really have no idea about this behaviour. Anybody having any idea here?

Do you have a route for '/multiupload/'? That needs to point to a
controller somehow.

Mine is:
Router::connect(
'/upload',
array('controller' => 'files', 'action' => 'upload')
);

BTW, I'm using Nick Baker's FileUpload plugin and jQuery.MultiFile.
http://www.webtechnick.com/blogs/view/221/CakePHP_File_Upload_Plugin
http://code.google.com/p/jquery-multifile-plugin/

--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php