Pagination Sort

2010-05-04 Thread sijo jose
Hi guys,

I have this model Structure -

Model 1 - Union

var $belongsTo = array(
'Address' = array(
'className' = 'Address',
'foreignKey' = 'address_id',
'conditions' = '',
'fields' = '',
'order' = ''
) );


Model 2 - Address

var $belongsTo = array(
'District' = array(
'className' = 'District',
'foreignKey' = 'district_id',
'conditions' = '',
'fields' = '',
'order' = ''
)
);

Model 3  District.
 with fields name and code both varchar.


Now I would like to paginate the Unions which should be ordered in ASC by
Union.Address.District.name ASC

Is that possible and if so how should i write the paginate.

Urgent help need. I am stuck here.





Regards,
-- 
Sijo Jose Chakramakkil

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

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


Re: Pagination Sort

2010-05-04 Thread sijo jose
Well thanks for the prompt reply

I have this model Structure -

Model 1 - Union

var $belongsTo = array(
'Address' = array(
'className' = 'Address',
'foreignKey' = 'address_id',
'conditions' = '',
'fields' = '',
'order' = ''
) );


Model 2 - Address

var $belongsTo = array(
'District' = array(
'className' = 'District',
'foreignKey' = 'district_id',
'conditions' = '',
'fields' = '',
'order' = ''
)
);

Model 3  District.
 with fields name and code both varchar.

Now when I paginate UNION  like this

$this-paginate = array(
'order' = array('Address.street' = 'ASC'),
);


it works fine.

What I need is the next level that is District which is related to Address,
but not to UNION

On Tue, May 4, 2010 at 1:39 PM, Andrei Mita andrei.m...@gmail.com wrote:

 Check out the 2 links below:
 http://book.cakephp.org/view/164/Pagination
 http://book.cakephp.org/view/858/Using-Containable-with-pagination



 On Tue, May 4, 2010 at 11:07 AM, Andrei Mita andrei.m...@gmail.comwrote:

 I believe paginate documentation in the book has a similar example.



 On Tue, May 4, 2010 at 9:48 AM, sijo jose jose.s...@gmail.com wrote:

 Hi guys,

 I have this model Structure -

 Model 1 - Union

 var $belongsTo = array(
 'Address' = array(
  'className' = 'Address',
 'foreignKey' = 'address_id',
  'conditions' = '',
 'fields' = '',
  'order' = ''
 ) );


 Model 2 - Address

 var $belongsTo = array(
 'District' = array(
 'className' = 'District',
  'foreignKey' = 'district_id',
 'conditions' = '',
  'fields' = '',
 'order' = ''
 )
  );

 Model 3  District.
  with fields name and code both varchar.


 Now I would like to paginate the Unions which should be ordered in ASC by
 Union.Address.District.name ASC

 Is that possible and if so how should i write the paginate.

 Urgent help need. I am stuck here.





 Regards,
 --
 Sijo Jose Chakramakkil

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

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



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

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




-- 
Sijo Jose Chakramakkil

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

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


Re: VALIDATION

2009-12-07 Thread sijo jose
Hi Anand,

If you are trying to Save both user and user_phone u might be using saveAll.

So for validating just use

$this-User-saveAll('User',array('validation'='first'));

This will validate both your models.



On Mon, Dec 7, 2009 at 5:31 PM, anand angadi anuang...@gmail.com wrote:

 Hi all,

 I have 2 model called User,user_phone...I have imported user_phone in User
 model...and I have done basic Add,Edit,Delete functionality...

 Now the problem is...

 In my view page I have input  fields as username,password which belongs to
 user table and one more input field as number which belongs to user_phone...

 I am getting validation for username and password but not getting the
 validation for number as it is in different table and model...

 How can I solve this...?

 Cheers:
 Anand

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

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




-- 
Sijo Jose Chakramakkil

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

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


Email Validation

2009-10-06 Thread sijo jose
Hi folks,

I have a email field which is not mandatory. But i would like it to b
validated if at all it is entered.

Please suggest.

-- 
Sijo Jose Chakramakkil

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



SaveAll problem?

2009-07-23 Thread sijo jose
'];
$this-data['Registration']['primary_email']
=$lead['Contact']['primary_email'];
$this-data['Registration']['secondary_email']
=$lead['Contact']['secondary_email'];

$this-data['Registration']['mobile_number']
=$lead['Contact']['mobile_number'];
$this-data['Registration']['home_phone']
=$lead['Contact']['home_phone'];
$this-data['Registration']['office_phone']
=$lead['Contact']['office_phone'];
$this-set('leadID',$lead['Lead']['id']);
$this-set($this-data);
}
$this-Country-recursive = -1;
$this-set('countryList', $this-Country-myGenerateList(null,
null, null,'{n}.Country.id', '{n}.Country.name'));
}
}


My view is dynamic view : I am just pasting the form elements.

?php echo $form-create('Registration', array('action' =
'studyabroadregistration','url'=array('controller' = 'registrations')));?
table class=tabform style=border-top:none cellspacing=1
cellpadding=0  border=0 width=100% 
tr style=height:25px
th align=left colspan=8 h4Personal
Information/h4/th
/tr
tr
tddiv class=formLabel First Name span
class=required*/span/div/td
td?php echo $form-input('first_name', array('label' =
'','className'='formInput'));
  echo $form-hidden('id');  ?/td
tddiv class=formLabel Middle Name/div/td
td?php echo $form-input('middle_name', array('label' =
'','className'='formInput'));?/td
tddiv class=formLabel Last Name span
class=required*/span/div/td
td?php echo $form-input('last_name', array('label' =
'','className'='formInput'));?/td
/tr
tr
tddiv class=formLabel Gender/div/td
td
input name=data[Registration][gender] id=Male
value=Male type=radio checked Male
input name=data[Registration][gender] id=Female
value=Female type=radio Female
/td
tddiv class=formLabel Marital Status /div/td
td?php echo $form-input('marital_status', array('label'
= '','type'='select','empty'='Select','options'=array( 'married'
='Married', 'single' = 'Single', 'divorced' =
'Divorced'),'className'='formInput'));?/td
/tr
tr
tddiv class=formLabel Date Of Birth span
class=required*/span/div/td
td colspan=2?php echo $form-input('dob', array('label'
= '','className'='formInput','timeFormat'=''));?/td
/tr
/table
table class=tabform cellspacing=1 cellpadding=0  border=0
width=100% 
tr style=height:25px
th align=left colspan=9 h4Educational
Summary/h4/th
/tr
tr
td
table border=1 cellspacing=1 width=100%
style=border:1px solid #c0c0c0; 
th class=eligibility_thCourse Name/th
th class=eligibility_thStream/th
th class=eligibility_thYear Of Passing/th
th class=eligibility_thUniversity/th
th class=eligibility_th/th

tr
td style=width:25%;text-align:left;?php
echo
$form-input('EducationDetail.0.course_name',array('label'='','size'='30'));
?/td
td style=width:25%;text-align:left;?php
echo
$form-input('EducationDetail.0.stream',array('label'='','size'='30'));
?/td
td style=width:25%;text-align:left;?php
echo $form-input('EducationDetail.0.year_of_passing',array('label'=''));
?/td
td style=width:22%;text-align:left;?php
echo
$form-input('EducationDetail.0.university_name',array('label'='','size'='30'));
?/td
td style=width:3%;text-align:center;a
href=javascript:addEducationalDetails();img
src=../img/plus_inline1.gif width=10 height=10/a/td

/tr
tr
 td colspan=5 style=padding:0pxdiv
id=parentDiv style=width:100%  /div/td
/tr
/table
/td
/tr
/table

The javascript function here adds rows of educational details row by row
with perfect numbering.

Well this part has been troubling me for some part.
What I have done wrong ? .

Please help.


-- 
Sijo Jose Chakramakkil

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



Re: file validation

2009-03-03 Thread sijo jose
Well Kaushik

I have done my part of validation in controller.

The following site would be helpful in that matter
http://www.keithmedlin.com/2008/01/cakephp-12-file-upload/
http://cakebaker.wordpress.com/2006/04/15/file-upload-with-cakephp/
http://cakebaker.42dh.com/2006/04/15/file-upload-with-cakephp/

Regarding Model validation check this site but I have not work with this.
http://www.jonnyreeves.co.uk/2008/06/cakephp-uploaded-file-validation-in-models/

Regards
Sijo Jose C


On Tue, Mar 3, 2009 at 3:35 PM, kaushik kaushikwo...@gmail.com wrote:


 I want to set a system where file uploading is must and i also want to
 check the extension of file. Is it possible to arrange the validation
 from model or I have to check from controller.

 Can anyone give any idea?
 


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



Re: Session

2009-02-09 Thread sijo jose
Hi majna,

Thx for the tip. It was helpful and it works.

Regards
Sijo Jose C

On Thu, Feb 5, 2009 at 2:40 PM, majna majna...@gmail.com wrote:


 try with
 Configure::write('Session.checkAgent', false);
 Configure::write('Security.level', 'medium');

 On Feb 5, 9:26 am, Cjo jose.s...@gmail.com wrote:
  Hi all,
 
  I have peculiar issue right now.
 
  When ever i double click on a link or a button, I get session out and
  thrown out.
 
  Is this my configuration issue and is there any remedies.
 
  Can I get some help.??
 
  Regards
  Sijo Jose C
 



-- 
Sijo Jose Chakramakkil

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



Updating AROS for USER when changing the User Group.

2009-01-14 Thread sijo jose
Hi all,

I have been stuck at two places.

1. This is regarding User and his corresponding.
Actually I have a User who is assigned a Group 'xx' while he is created.
But at a later stage I would like to regroup him to a Group 'yy'. Simply
changing the User group is not working sice I think the corresponding AROS
is not getting updated. How would I  update the AROS regarding this.

2. I would like to populate the database with some Users when my site gets
to production. This is also because AROS is not being populated.

Any help regarding this would be of great help.

Regards
Sijo Jose C

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



Re: Updating AROS for USER when changing the User Group.

2009-01-14 Thread sijo jose
Thanks
Alexandru...
Regards
Sijo Jose C


On Wed, Jan 14, 2009 at 9:22 PM, Alexandru Ciobanu ics.cake...@gmail.comwrote:


 sijo jose wrote:
  Hi all,
 
  I have been stuck at two places.
 
  1. This is regarding User and his corresponding.
  Actually I have a User who is assigned a Group 'xx' while he is
  created. But at a later stage I would like to regroup him to a Group
  'yy'. Simply changing the User group is not working sice I think the
  corresponding AROS is not getting updated. How would I  update the
  AROS regarding this.
 
  2. I would like to populate the database with some Users when my site
  gets to production. This is also because AROS is not being populated.
 
 http://book.cakephp.org/view/641/Simple-Acl-controlled-Application

 Everything you need it's right here.

 Acl behavior will help you with the updates:
 http://book.cakephp.org/view/645/Acts-As-a-Requester


 



-- 
Sijo Jose Chakramakkil

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



Re: How to validate 2 linked models created from one form?

2008-12-24 Thread sijo jose
Hi,

Since u have created the form for the model Order,

The field title should be referred like

$form-input(Customer.title); directly.

Now when u r saving use saveAll

$this-Order-saveAll($this-data,array('validate' = 'first'));

All the validation rules can be in ur model itself.

The array('validate' = 'first') specifies that all the models must be
validated first before saving recursively.

Also u have to take into consideration that at present cakePHP supports
recursive saving  for first level only.

Think I was helpful.
Regards
Sijo

On Mon, Dec 22, 2008 at 2:42 PM, Hipnotik pork...@gmail.com wrote:


 Hello again ;)
 I have 2 models:

 Order:
 hasOne = Customer

 Customer:
 belongsTo = Order
 var $validate = array(lot of rules)

 I would like to create a form to provide data for Customer object then
 send form to OrdersController and validate.

 How to create proper form?

 I have this:
 $form-create(Order, array(action = send));
 $form-input(Order.Customer.title);
 // more fileds
 $form-end(Send)

 It sends data to send action of OrdersController, but how to create
 Customer object, validate and display errors on the form if occur?

 Thanks for help
 



-- 
Sijo Jose Chakramakkil

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



Re: Error Messages Not Displaying in View or in Validations Array

2008-12-24 Thread sijo jose
hi,

As earlier said u are sending the form data to a
different page...

function thank_you()
  {

 if( !empty($this-data) )
   {
  $this-User-create();
  if( $this-User-save($this-data) )
  {
  }
 else
 {
  $this-redirect(array('action' = 'index'),null,true);
 }
   }
   else
   {
  // we're at this place because a form was not filled in
  $this-redirect(array('action' = 'index'),null,true);
   }
  }


Now in cakePHP the validation works when u call save.
so if  if( $this-User-save($this-data) ) is false it means that ur form
has errors

So what u r doing is that u are redirecting the page when there are form
erros.
So give any redirect page in the else condition it will automatically come
to ur form page.

Also there is no need for $this-User-create();

Think u got the point.

Regards
Sijo Jose C







On Fri, Dec 19, 2008 at 7:24 PM, Smelly_Eddie ollit...@gmail.com wrote:

 Just a guess but it looks like your sending the form data to a
 different page...

 Validation was intended to display on the same model in a circular
 manner. i.e. empty user/add form is shown - data submitted to user/
 add action - user/add validates data - form is repeated if invalid
 OR redirect user to secondary page.




 On Dec 18, 3:51 pm, Tony t3proje...@gmail.com wrote:
  For some reason I can't get my error messages for validations to work.
  I tried outputting the validations by doing:
  pr($this-validationErrors);
 
  But all I get is an empty array. What do you guys see that I'm doing
  wrong?
 
  Thanks,
  Tony
 
  Here's my model:
  
  class User extends AppModel {
 
  var $name = 'User';
 
  // This model is a self-join
  var $belongsTo  =   array(
 
 'ParentMember' = array(
 
   'className' = 'User',
 
   'foreignKey' = 'parent_id'),
  );
 
  var $hasMany=   array(
 
 'ChildMember' = array(
 
   'className' = 'User',
 
   'foreignKey' = 'parent_id'),
  );
 
 // Place the validation rules here:
 
 var  $validate = array(
  'first_name' = array(
  'rule' = 'alphaNumeric',
  'required' = true,
  'message' = 'Name is required. Please
 enter your first name.',
  'last' = true
  ),
  'email' = array(
  'rule' = array('email', true),
  'required' = true,
  'message' = 'Email is required. Please
 enter your email
  address.',
  'last' = true
  ),
  'phone' = array(
  'rule' = array('phone', null, 'us'),
  'message' = 'Phone number is not valid.
 Please enter valid phone
  number.',
  'last' = true
  )
 );
 
  }
 
  
 
  Here's my controller with the method action it's being submitted to:
  
  function thank_you()
  {
  $member = $this-Session-read('teamMember');
  $this-set('pageTitle', 'Before you leave TriVita
 Cooperative
  Marketing\'s website');
  $this-set('bigTitle', 'BEFORE YOU LEAVEbr /A SPECIAL THANK
  YOUbr / FROM ME...');
  $this-set('member', $member);
 
  if( !empty($this-data) )
  {
 
  $this-User-create();
 
  if( $this-User-save($this-data) )
  {
 
  $tony = $this-User-findByAffiliateNumber
  ('11167706');
 
  $prospect =
 $this-User-findById($this-User-id);
 
  $this-set('prospectName', $prospect['User']
  ['first_name']);
  $this-set('tonyEmail', $tony);
 
  if( $prospect['User']['email'] != '' ||
 $prospect['User']
  ['email'] != null )
  {
 
 $this-_sendThankYouEmail($prospect, $member);
  }
  /*
  if( $member['User']['affiliate_number']
 != '11167706')
  {
 
 $this-_sendMemberNotificationEmail($prospect, $member, $tony);
  }
  */
 
 $this-_sendMemberNotificationEmail($prospect, $member, $tony);
  $this-_sendTonyEmail($prospect, $member,
 $tony);
 
  }
  else
  {
  $this-redirect(array('action' = 'index'),null,true

Re: form helper - inputs - textarea - cols?

2008-12-24 Thread sijo jose
Hey why cant u try the $form-input option.

Its quiet easy.

?php echo $form-input('SamplingDetail.sampling_address',
array('error'='Sampling Address cannot be left empty','div' =
'mandatory','type'='textarea','label' = 'Sampling Address', 'rows' = 3,
'cols' = 35)); ?

Regards
Sijo

On Fri, Dec 12, 2008 at 7:31 PM, leberle leberkne...@gmx.de wrote:


 hi all :) one simple (i guess) question: i'm using the inputs method
 for creating several input-elements in my view. i want one field to be
 a textarea, i used

 $html-inputs(
[...bunchofotherinputs],
'mytextfield' = array('type' = 'textarea', 'cols' = 2),
[...]);

 The generated input gets the textarea-option but fails to get the
 number of cols i definied...so i got a textarea thats way to largs.
 Someone can help me with that?
 



-- 
Sijo Jose Chakramakkil

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



Re: Cake Developers in Chennai, TamilNadu, India?

2008-12-24 Thread sijo jose
Yah i have been working for past 4 months.

Regards
Sijo

On Thu, Dec 11, 2008 at 11:15 PM, ravindranathbe
ravindranat...@gmail.comwrote:


 Hi
 I am Ravindranath. Experienced in CakePHP for the past 10 months.
 Able to create highly professional, high quality website on Cakephp.
 You can contact me thro,
 1. email - ravindranat...@gmail.com
 2. mobile - 9380567762

 Regards,

 Ravindranath.

 On Nov 5, 11:04 am, Selva revol...@gmail.com wrote:
  Hello Guys,
 
  I apologize in advance if this is not the appropriate forum to ask
  this question, but I am interested in finding a Cake Developer to work
  on a new project.
 
  Thanks,
  Selva

 



-- 
Sijo Jose Chakramakkil

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



Re: Saving Multiple Models in one save

2008-12-24 Thread sijo jose
Well sorry for not being prompt,

Presently cakePHP supports saving models upto level one only.
So I have changed my code accordingly.
Thanks for your reply which was helpfull.

Regards
Sijo

On Wed, Dec 10, 2008 at 2:52 PM, WebbedIT p...@webbedit.co.uk wrote:


 I haven't gotten around to using saveAll() as yet, but I did spot that
 you haven't created a belongsTo relation from SamplingDetail to
 Intimation to close the hasOne/belongsTo relationship between the two
 models.

 Similarly best practice dictates you should create hasOne
 relationships for

 Processor-SamplingDetail
 Contact-Processor

 Not that I think this will necessarily solve your saleAll issue but it
 is good practice to do so.

 Without using the saveAll function myserlf I can only hazard guesses
 at what you can look at.  I tried looking for a recursive property to
 try and tell the function to go more than 1 level deep, but that
 doesn't exist.  What happens if you change the fields from

 ?php echo $form-input('SamplingDetail.package_description'); ?
 ?php echo $form-input('SamplingDetail.lot_number'); ?
 ?php echo $form-input('SamplingDetail.invoice_number'); ?
 ?php echo $form-input
 ('SamplingDetail.Processor.Contact.firstName'); ?
 ?php echo $form-input
 ('SamplingDetail.Processor.Contact.address'); ?

 to

  ?php echo $form-input('SamplingDetail.package_description'); ?
  ?php echo $form-input('SamplingDetail.lot_number'); ?
  ?php echo $form-input('SamplingDetail.invoice_number'); ?
  ?php echo $form-input
 ('Contact.firstName'); ?
  ?php echo $form-input
 ('Contact.address'); ?

 The fact that Intimation model fields will save from

  ?php echo $form-input('Intimiation.field1'); ?

 And SamplingDetail fields will save from

  ?php echo $form-input('SamplingDetail.field2'); ?

 Means other related fields should save from

  ?php echo $form-input('Processor.field3'); ?
  ?php echo $form-input('Contact.field4'); ?

 Hopefully someone else can join in and clear this up ;)
 



-- 
Sijo Jose Chakramakkil

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



Re: Newbie - multiple model instances in one form and validation

2008-12-24 Thread sijo jose
Hi ,

If the model associations are correct and the for is created using User
just user

$this-User-saveAll($this-data,array('validation'='first'))

will validate all the Models, well as I said the model associations must be
perfect.

Regards
Sijo Jose C

On Wed, Dec 24, 2008 at 4:25 PM, Nature Lover
nature_lover1...@yahoo.co.inwrote:


 Hi!

 I am new to CakePHP and currently working on an e-commerce site having
 three models:

 User( id, name, joined)
 UserProfile( id, user_id, title, age, email )
 UserContacts( id, user_id, name, address)

 Currently receiving data from a form as below:

 $this-data['User']['name']
 $this-data['UserProfile']['title']
 $this-data['UserProfile']['age']
 $this-data['UserProfile']['email']
 $this-data['UserContact']['0']['name']
 $this-data['UserContact']['0']['address']
 $this-data['UserContact']['1']['name']
 $this-data['UserContact']['1']['address']

 tried to validate data in User controller as:

 $this-User-set($this-data);
 $this-User-UserProfile-set($this-data);
 $this-User-UserContact-set($this-data);

 if($this-User-validates())
 {
if($this-User-UserProfile-validates())
{
if($this-User-UserContact-validates())
{
$this-set('status','valid');
}
}
 }
 else
 {$this-set('status','invalid');}

 Here proper validation fails for UserContacts although showing errors
 as
 $this-validationErrors['UserContact']['fieldname']
 instead of
 $this-validationErrors['UserContact']['0']['fieldname'] and
 $this-validationErrors['UserContact']['1']['fieldname']

 Also tried to use saveAll with validate=only, but failed due to
 foreign key constrains as getting error:

 'This field cannot be left blank'
 for
 $this-validationErrors['UserProfile']['user_id'] and
 $this-validationErrors['UserContact']['0']['user_id']
 $this-validationErrors['UserContact']['1']['user_id']

 Please help me to get out of this hurdle.

 Thanks!
 



-- 
Sijo Jose Chakramakkil

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



Re: Saving a Model with belongsTo association

2008-11-23 Thread sijo jose
Hi,

Thanks dude, My naming conventions was all correct just that I forgot to use
saveAll()


Regards
Sijo
On Tue, Nov 18, 2008 at 10:16 PM, thatsgreat2345
[EMAIL PROTECTED]wrote:


 It is all about how you name your forms and it will return the proper
 structure that a simple save can handle. Check out this link

 http://book.cakephp.org/view/84/Saving-Related-Model-Data-hasOne-hasMany-belongsTo

 On Nov 18, 3:32 am, Cjo [EMAIL PROTECTED] wrote:
  Hi,
 
  I am new to cake php and have been playing around for some time. First
  of all thanks for all the replies for earlier queries.
 
  Regarding this post. I have 2 Models Exporter which belong to User.
  I am doing a page for creating a New Exporter. But for creating a
  Exporter I would have to save the corresponding User. All I need is
  that all the information regarding the Exporter and its corresponding
  User be taken from the same form.
 
  Can anybody help me with this. I would like to have a example
  regarding this. How would be the form be looking and it naming
  conventions for User fields. Validation also required for the User
  fields.
 
  Regards.
 



-- 
Sijo Jose Chakramakkil

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



Re: CSS formatting not appearing

2008-11-22 Thread sijo jose
I agree with ROD. If it is CSS, firebug rocks.

On Sun, Nov 23, 2008 at 2:22 AM, Rob [EMAIL PROTECTED] wrote:


 First, I would suggest you get a copy of Firebug - it rocks when
 trying to debug CSS issues.

 What exactly do you mean 'none of my CSS formats were applied'?

 If you left off the punctuation when you modified the #content, that
 would break things, but if all you did was to change the first element
 in the padding from 0px to 10px, that would only fail if another CSS
 tag prevented the change from being applied.

 On Nov 21, 12:05 pm, CJL [EMAIL PROTECTED] wrote:
  (sorry I hit send by accident)
 
  Below is my original style.css:
 
  #content {
clear:both;
  margin-left: auto;
  margin-right: auto;
padding: 0px 40px 10px 40px;
background-color: #fff;
color: #333;
  text-align: left;
  width: 100%;
 
  Then I just changed the padding to:
 
  padding: 20px 40px 10px 40px
 
  After that, none of my CSS formats were applied.  I went back to the
  style.css file and changed the padding back to the original settings,
  but still none of my CSS formats are appearing.  Any help would be
  greatly appreciated.  Thanks!
 
  On Nov 21, 11:51 am, CJL [EMAIL PROTECTED] wrote:
 
   Hello,
 
   First off, I'm new to CakePHP and web development in general, so I
   apologize in advance if my question is a stupid one or has been asked
   already.  I've read up to chapter 7 in the cookbook, and I'd say I
   understand it on a high level, but can figure out the details if I
   know where to look.  I've installed CakePHP 1.1 and I am using MAMP.
 
   Problem: My CSS formatting is not appearing, but what's strange is
   that it worked at first, then I made a tiny change to a padding
   argument, and now all my formatting is gone.  Below is my app/views/
   layouts/default.thtml:
 
   !doctype html public -//W3C//DTD HTML 4.01 Transitional//EN
   html
   head
   titleMy Page -- ?php echo $title_for_layout ?/title
   link rel=stylesheet type=text/css href=/css/style.css
   !--[if IE 7]link rel=stylesheet type=text/css href=/css/
   ie7_style.css![endif]--
   script type=text/javascript src=/js/prototype.js/script
   script type=text/javascript src=/js/scriptaculous.js/script
   /head
   body
 
   div id=container
   div id=content
   div id=logo
   ?php echo $html-image('logo.jpg')?
   /div
   div
 ?php echo $this-renderElement('menu',
 array('key'='val'))?
   /div
 
   div id=header
   ?php $session-flash();?
   /div
 
   div
   ?php echo $content_for_layout?
   /div
   /div
   div id=footer/div
   /div
 
   /body
   /html
 
   So initially, like I said, my CSS worked.  I wanted to mess around and
   change my #content in the CSS file.  Below is the original style.css:
 
 
 



-- 
Sijo Jose Chakramakkil

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



Re: File List in a particular Directory

2008-11-05 Thread sijo jose
Thx dude

On Tue, Nov 4, 2008 at 8:23 PM, AD7six [EMAIL PROTECTED] wrote:




 On Nov 4, 2:30 pm, Cjo [EMAIL PROTECTED] wrote:
  Hi,
 
  I have to show all the files that I have uploaded through my
  application.
  Please help me with this.
 
  Regards
  Cjo

 http://api.cakephp.org/class_folder.html#cae6a10175cdf45d5e303edbe6432dfc
 



-- 
Sijo Jose Chakramakkil

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