Re: how do I get a barcode inside a table?

2013-08-07 Thread ravage1984
http://vintasoft.com/vsbarcode-dotnet-index.html
May be?

Google is your friend:
http://www.google.ch/search?hl=de&q=barcode+pdf+einlesen#bav=on.2,or.r_qf.&fp=a2c38355a318043b&hl=de&q=barcode+image+read

Barcodes are nothing but a string of digits, where's your problem?

Am Mittwoch, 7. August 2013 09:53:51 UTC+2 schrieb sneha kulkarni:
>
> Hi,
>  
> how do I get a barcode inside a table? Now it just floats outside the 
> table in
> the upper left corner of the pdf. How do I get it inside the td?
>  Help much appreciated.
>

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

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




Error array

2013-08-07 Thread Advantage+
Is there a way to grab / view the errors from a form.

 

Let me explain. 

My forms get sent ajax and all my forms are elements so when submitting a
form all I need to update is the form itself, not the whole view. 

JSON response success: function (response.html) in the scripting returns the
form element back into its response html which is just
the form element with the errors on the form if any as normal.

 

But if there was a way to simply grab the errors collected from cake for the
field and simply use the js to add the error class and message to the
appropriate field that would be much easier. 

There would be no need to return an element cutting back on the overhead.

 

Basically if there was a method to grab errors for each field something like
this:

 

Errors = array(

User = array(

Field = array(

Name = city

Message = Please enter your
city

)

)

);

 

I could simply add the error message / class to each field.

Maybe there is a way already but I could not see anything other than the
list of error messages.

 

Thanks guys,

 

Dave

 

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

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




Re: Convert simple threaded to a tree

2013-08-07 Thread euromark
If you already got the parent_id filled out, just use the recover 
functionality of the behavior
Either from console (CLI) via shell or from your controller action call 
$this->Model->recover()
This should fix your lft/rght fields based on your parent_id


Am Mittwoch, 7. August 2013 19:03:52 UTC+2 schrieb Mohammad Naghavi:
>
> I had this model for a long time and my table and model already has 
> parent_id and existing data inside the table has relations. The new fields 
> added are lft and rght which has for now only NULL values inside. I want to 
> fill these in a way that the tree behavior can be used with this existing 
> data and relation.
>
> Regards,
> Mohammad
> On Aug 7, 2013 6:18 PM, "euromark" > 
> wrote:
>
>> Do not forget the parent_id
>>
>> Also, what do you mean with existing data?
>> By default it would all be just a flat list (none of them would have a 
>> parent).
>> This is also a valid tree
>>
>> How would you be able to tell which is the parent of which?
>> If it can be automated, there is an easy way to do that with Cake.
>> But first, you need to find out how it can be automated. Otherwise you 
>> need to manually
>> edit each record.
>>
>>
>> Am Mittwoch, 7. August 2013 17:03:25 UTC+2 schrieb Mohammad Naghavi:
>>>
>>> Hi all,
>>> this is straight forward, I have a bid table, which used parent_id to 
>>> make a threaded hierarchy. now after a time that the application is used, 
>>> I'm facing problems that can be done perfectly using tree behavior. I have 
>>> added the lft and rght columns but can find an easy way to convert existing 
>>> data into a tree behavior compatible form. 
>>>
>>> the last way is to make a temporary table, read from current and write 
>>> into new, and later swap old with new and remove the old, but I have too 
>>> much data in the table that it may not be possible at least at once.
>>>
>>> do you have any idea how to do it easier? It can be done also directly 
>>> in DB (mysql).
>>>
>>> Thanks in advance for any suggestion.
>>> Mohammad
>>>  
>>  -- 
>> Like Us on FaceBook https://www.facebook.com/CakePHP
>> Find us on Twitter http://twitter.com/CakePHP
>>  
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "CakePHP" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to cake-php+u...@googlegroups.com .
>> To post to this group, send email to cake...@googlegroups.com
>> .
>> Visit this group at http://groups.google.com/group/cake-php.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>

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

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




Re: CakePHP 2.x Date Field Helper set year?

2013-08-07 Thread euromark
the rule stays the same, you just apply a different start value to check 
against.

< TODAY
is the same as
< $startValue
for your custom validation method anyway


Am Mittwoch, 7. August 2013 20:06:50 UTC+2 schrieb Eric Haskins:
>
> Hey everyone quick question. 
>
>  I have an app and Im having issues with "Users" setting birthdates to 
> 2013-12-13 as an example.  I know I should have a validator to make sure it 
> isnt a future date but is there a way to seed the start year say 4 years 
> ago?  
>

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

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




CakePHP 2.x Date Field Helper set year?

2013-08-07 Thread Eric Haskins
Hey everyone quick question. 

 I have an app and Im having issues with "Users" setting birthdates to 
2013-12-13 as an example.  I know I should have a validator to make sure it 
isnt a future date but is there a way to seed the start year say 4 years 
ago?  

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

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




Re: Convert simple threaded to a tree

2013-08-07 Thread Mohammad Naghavi
I had this model for a long time and my table and model already has
parent_id and existing data inside the table has relations. The new fields
added are lft and rght which has for now only NULL values inside. I want to
fill these in a way that the tree behavior can be used with this existing
data and relation.

Regards,
Mohammad
On Aug 7, 2013 6:18 PM, "euromark"  wrote:

> Do not forget the parent_id
>
> Also, what do you mean with existing data?
> By default it would all be just a flat list (none of them would have a
> parent).
> This is also a valid tree
>
> How would you be able to tell which is the parent of which?
> If it can be automated, there is an easy way to do that with Cake.
> But first, you need to find out how it can be automated. Otherwise you
> need to manually
> edit each record.
>
>
> Am Mittwoch, 7. August 2013 17:03:25 UTC+2 schrieb Mohammad Naghavi:
>>
>> Hi all,
>> this is straight forward, I have a bid table, which used parent_id to
>> make a threaded hierarchy. now after a time that the application is used,
>> I'm facing problems that can be done perfectly using tree behavior. I have
>> added the lft and rght columns but can find an easy way to convert existing
>> data into a tree behavior compatible form.
>>
>> the last way is to make a temporary table, read from current and write
>> into new, and later swap old with new and remove the old, but I have too
>> much data in the table that it may not be possible at least at once.
>>
>> do you have any idea how to do it easier? It can be done also directly in
>> DB (mysql).
>>
>> Thanks in advance for any suggestion.
>> Mohammad
>>
>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

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

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




Re: Convert simple threaded to a tree

2013-08-07 Thread euromark
Do not forget the parent_id

Also, what do you mean with existing data?
By default it would all be just a flat list (none of them would have a 
parent).
This is also a valid tree

How would you be able to tell which is the parent of which?
If it can be automated, there is an easy way to do that with Cake.
But first, you need to find out how it can be automated. Otherwise you need 
to manually
edit each record.


Am Mittwoch, 7. August 2013 17:03:25 UTC+2 schrieb Mohammad Naghavi:
>
> Hi all,
> this is straight forward, I have a bid table, which used parent_id to make 
> a threaded hierarchy. now after a time that the application is used, I'm 
> facing problems that can be done perfectly using tree behavior. I have 
> added the lft and rght columns but can find an easy way to convert existing 
> data into a tree behavior compatible form. 
>
> the last way is to make a temporary table, read from current and write 
> into new, and later swap old with new and remove the old, but I have too 
> much data in the table that it may not be possible at least at once.
>
> do you have any idea how to do it easier? It can be done also directly in 
> DB (mysql).
>
> Thanks in advance for any suggestion.
> Mohammad
>  

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

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




Re: 3.0: a peek into CakePHP's future

2013-08-07 Thread ravage1984
Indeed, CakePHP shouldn't be (tightly) coupled with any frontend framework.
Joomla! for example learnt its lessons when they wanted to get rid of the 
coupled mootools.

If CakePHP should be coupled, then certainly with the most popular anyway.
There are many tastes, preferences etc and thus opnions vary very much.

Nonetheless jQuery is the most popular and most widely used one.
But still I wouldn't couple CakePHP with it too tightly.
It's too easy to download the newest version of jQuery or link it through a 
CDN in your views anyway.

I think for many developers having scaffolding and baking with a powerful 
and javascript-empowered UI seem very useful at first.
That's why they want to have CakePHP to also include those frontend tools.
But after some experience with baking and scaffolding I must say I'd prefer 
that CakePHP would even dump it down.

Integration of such frameworks or improved scaffolding in any way should be 
done trhough plugins.
So the integration of jQuery itself or TwitterBootstrap (which is based on 
jQuery) for example, which are both very popular, could and should - IMHO - 
be done in a "first class citizen" plugin - if there is enough demand for 
it.

There are already such projects around.
For example:
https://github.com/slywalker/cakephp-plugin-boost_cake (or it's 
predecessor).
or some you find here:
http://plugins.cakephp.org/packages?query=admin

I think it would make sense to "outsource" these efforts away from the 
project itself to a few dedicated and by the CakePHP lead 
(oficially/inofficially) supported projects.

Marc

On Tuesday, August 6, 2013 6:21:54 PM UTC+2, mark_story wrote:
>
> I don't think we'll be introducing another tight coupling with a client 
> side framework. In the past we had an integration with prototype, and 
> anyone not using prototype was left out. Choosing something like ember or 
> angular would make CakePHP unsuitable for people wanting to use the other 
> client side framework. I'd rather leave CakePHP un-opinionated about client 
> side frameworks and leave that integration up to the developer.
>
> -Mark
>

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

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




Convert simple threaded to a tree

2013-08-07 Thread Mohammad Naghavi
Hi all,
this is straight forward, I have a bid table, which used parent_id to make
a threaded hierarchy. now after a time that the application is used, I'm
facing problems that can be done perfectly using tree behavior. I have
added the lft and rght columns but can find an easy way to convert existing
data into a tree behavior compatible form.

the last way is to make a temporary table, read from current and write into
new, and later swap old with new and remove the old, but I have too much
data in the table that it may not be possible at least at once.

do you have any idea how to do it easier? It can be done also directly in
DB (mysql).

Thanks in advance for any suggestion.
Mohammad

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

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




Re: legacy db with non standard foreignkey hasMany association

2013-08-07 Thread Simon Males
I've never done anything like this but you can tell the Campaign model
what the primary key is using the $primaryKey attribute.

http://book.cakephp.org/2.0/en/models/model-attributes.html#primarykey

class Campaign extends AppModel {
  $primaryKey = 'code';
}

On Wed, Aug 7, 2013 at 6:59 AM, NikNik  wrote:
>
> Hello,
> I must work on a pretty old database and I am forced to use a table (
> Campaign ) that didn't have a numeric primary key .
> The former primary key was the field "code" varchar(6). So I had to add an
> autoincrement  id field.
>
> Campaign hasMany Users
>
> in the Campaign model I then have:
>
> public $hasMany = array(
> 'User' => array(
> 'className' => 'User',
> 'foreignKey'   => false,
> 'conditions' => 'User.campaign_id=Campaign.code'
>   )
> );
>
> in the User model I have:
>
> public $belongsTo = array(
> 'Campaign'=>array(
>   'className' => 'Campaign',
>   'foreignKey'=>false,
>   'conditions'=> array('User.campaign_id = Campaign.code')
>   ),
> );
>
>
> But when I go to /campaigns/view/103
> the campaign data are shown correctly but if I want to show also the related
> Users belonging to the given Campaign_id
> I get
> Column not found: 1054 Unknown column 'Campaign.code' in 'where clause'
>
> And the breaking query is:
>
> SELECT `User`.`id`, `User`.`field2`, `User`.`field3`, `User`.`field4`  FROM
> `mydb`.`users` AS `User` WHERE `Campaign`.`code`=`User`.`campaign_id`
>
> No join is created so th Campaign.code is unknown...
>
>
> I know I should change the model structure but It would mean change a huge
> amount of things..
>
>
> Please help
> THANKS
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>



-- 
Simon Males

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

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




Re: after div closing tag form ends

2013-08-07 Thread Simon Males
You'll have to share some source code and the rendered markup.

Otherwise it is impossible to help.

On Wed, Aug 7, 2013 at 3:50 PM, mreza_golestan  wrote:
> hi i have a form that has two part by a 2 div $this->form->create is in the
> first div + some input now i want close this div
> and after that some input in the second div but cakephp automatically close
> form after seeing even i dont use $this->form->end what can i do?
>
>
>
> --
> View this message in context: 
> http://cakephp.1045679.n5.nabble.com/after-div-closing-tag-form-ends-tp5715990.html
> Sent from the CakePHP mailing list archive at Nabble.com.
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>



-- 
Simon Males

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

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




Re: userCake with CakePHP

2013-08-07 Thread Simon Males
What is userCake?

On Wed, Aug 7, 2013 at 5:55 AM, Sebastien Roy  wrote:
> Hi,
>
> I wan't to use userCake with MVC Cake ...
>
> I'm not sure where to start...
>
> Do I put all the userCake's model files in models folder Cake's app and all
> the others userCake's files in Controller folder of Cake's app?
>
> Thanks,
> Sebastien
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>



-- 
Simon Males

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

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




Re: Naming Question

2013-08-07 Thread euromark
The model should not be called Sortable. Then it's fine.
As components are registered besides models

// controller
$this->Sortable->foo() // component

whereas behavior methods are used just as if they were part of the model

// controller
$this->MyModel->foo() // behavior


Am Dienstag, 6. August 2013 22:57:54 UTC+2 schrieb advantage+:
>
> That was just a typo and just a sample example. So correct if it was 
>
>  
>
> public $actsAs = array('Sortable.Sortable');
>
>  
>
> and component defined in App controller the question remains the same.
>
>  
>
> In any controller using this where is Cake looking for the sortable->sort 
> function such as
> "$this->Sortable->sort($data);" Is it looking for the component first? 
> Model / Behavior? As does this eat up resources having Cake look in 
> multiple places for this sort() function.
>
>  
>
> That’s what I want to know, with the Component / Model / Behavior having 
> the same name is that bad. Is this sending Cake on a quest thru all of 
> these files until it finds it? 
>
> How does it know to look in the Component first, Model Second, Behavior 
> third? That’s the question I was curious about.
>
>  
>
> Thanks.
>
>  
>
> Dave
>
>  
>
> *From:* cake...@googlegroups.com  [mailto:
> cake...@googlegroups.com ] *On Behalf Of *euromark
> *Sent:* Tuesday, August 06, 2013 6:19 PM
> *To:* cake...@googlegroups.com 
> *Subject:* Re: Naming Question
>
>  
>
> It's not Sortable.sortable, but Sortable.Sortable
>
> same goes for the behavior of such a plugin:
>
>  
>
> public $actsAs = array('Sortable.Sortable');
>
>
>
> Am Dienstag, 6. August 2013 21:02:53 UTC+2 schrieb advantage+:
>
> Just a quick question,
>
>  
>
> I downloaded a plugin call it "Sortable" since I do not want to knock 
> anyone's work and looking at the plugin I noticed the names of the Model 
> and Component are the same "Sortable".
>
>  
>
> AppController has the component Sortable.sortable in the array.
>
> So in any controller using the plugin it calls for 
> "$this->Sortable->sort($data);" for example.
>
> Respective model has $actsAs = "Sortable";
>
>  
>
> Is this bad? Is Cake going to take a hit looking in the Sortable 
> Model/Behavior and the Sortable Component for the sort function?
>
> Where does it look first for the "$this->Sortable->sort($data);"? In the 
> Sortable Component or Model?
>
>  
>
> Is this how it should be done? Just curious.
>
>  
>
> *Dave Maharaj*
>
> *Freelance Designer | Developer*
> [image: Description: header_logo]
> www.movepixels.com  |  d...@movepixels.com  |  709.800.0852
>
>  
>
> -- 
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>  
> --- 
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to cake-php+u...@googlegroups.com .
> To post to this group, send email to cake...@googlegroups.com
> .
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  
>

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

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




Re: How do you get last insert ID after changing primary key?

2013-08-07 Thread Jas
I also tried changing primary key back to ID and still get NULL from 
getInsertID()


On Wednesday, August 7, 2013 6:34:57 PM UTC+10, Jas wrote:
>
> I want to "insert or update if exist" a table where the column is 'mac' is 
> to be unique and not the primary key.
> So I used:
> //change primary key to mac
> $this->Office->Customer->primaryKey = 'mac';
> $customer['Customer']['mac'] = $mac;
>
> if($this->Office->Customer->save($customer)){
>  //get the Customer ID that was inserted or updated
>  $office['Office']['customer_id'] = 
> $this->Office->Customer->getInsertID();
>
>
> }
>
> Because I change primaryKey, getInsertID returns NULL.  Setting the column 
> to unique causes a duplicate error.
>

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

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




How do you get last insert ID after changing primary key?

2013-08-07 Thread Jas
I want to "insert or update if exist" a table where the column is 'mac' is 
to be unique and not the primary key.
So I used:
//change primary key to mac
$this->Office->Customer->primaryKey = 'mac';
$customer['Customer']['mac'] = $mac;

if($this->Office->Customer->save($customer)){
 //get the Customer ID that was inserted or updated
 $office['Office']['customer_id'] = 
$this->Office->Customer->getInsertID();
   
   
}

Because I change primaryKey, getInsertID returns NULL.  Setting the column 
to unique causes a duplicate error.

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

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




after div closing tag form ends

2013-08-07 Thread mreza_golestan
hi i have a form that has two part by a 2 div $this->form->create is in the
first div + some input now i want close this div
and after that some input in the second div but cakephp automatically close
form after seeing even i dont use $this->form->end what can i do?



--
View this message in context: 
http://cakephp.1045679.n5.nabble.com/after-div-closing-tag-form-ends-tp5715990.html
Sent from the CakePHP mailing list archive at Nabble.com.

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

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




how do I get a barcode inside a table?

2013-08-07 Thread sneha kulkarni
Hi,

how do I get a barcode inside a table? Now it just floats outside the table
in
the upper left corner of the pdf. How do I get it inside the td?
 Help much appreciated.

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

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