Re: Warning (2): Cannot modify header information - headers already sent by

2011-10-04 Thread BLABLABLA
HI..

The problem was the encoding. I have had the encoding UTF8, but needed the
encoding UTF8 without BOM. 

--
View this message in context: 
http://cakephp.1045679.n5.nabble.com/Warning-2-Cannot-modify-header-information-headers-already-sent-by-tp4860658p4867920.html
Sent from the CakePHP mailing list archive at Nabble.com.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Warning (2): Cannot modify header information - headers already sent by

2011-10-03 Thread BLABLABLA
PLEASE HELP ME!

FAILURE:
Warning (2): Cannot modify header information - headers already sent by
(output started at
/var/customers/webs/usr05/mkn151/app/models/category.php:1)
[CORE/cake/libs/controller/controller.php, line 742]

CONTROLLER:
Auth->allow('choosecategories');
}
// Liste der Kategorien
function index() {
$this->Category->recursive = 0;
$this->set('categories', $this->paginate());
}
// Detailansicht
function view($id = null) {
if (!$id) {
$this->Session->setFlash(__('Ungültige Kategorie', 
true));
$this->redirect(array('action' => 'index'));
}
$this->set('category', $this->Category->read(null, $id));
}
// Kategorie hinzufügen
function add() {
if (!empty($this->data)) {
$this->Category->create();
if ($this->Category->save($this->data)) {
$this->Session->setFlash(__('Kategorie wurde 
gespeichert.', true));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('Kategorie konnte 
nicht gespeichert werden.
Versuchen Sie es nochmal.', true));
}
}
$highscores = $this->Category->Highscore->find('list');
$this->set(compact('highscores'));
}
// Kategorie bearbeiten
function edit($id = null) {
if (!$id && empty($this->data)) {
$this->Session->setFlash(__('Ungültige Kategorie', 
true));
$this->redirect(array('action' => 'index'));
}
if (!empty($this->data)) {
if ($this->Category->save($this->data)) {
$this->Session->setFlash(__('Kategorie wurde 
gespeichert.', true));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('Kategorie konnte 
nicht gespeichert werden.
Versuchen Sie es nochmal.', true));
}
}
if (empty($this->data)) {
$this->data = $this->Category->read(null, $id);
}
$highscores = $this->Category->Highscore->find('list');
$this->set(compact('highscores'));
}
// Kategorie löschen
function delete($id = null) {
if (!$id) {
$this->Session->setFlash(__('Ungültige Kategorie Id', 
true));
$this->redirect(array('action'=>'index'));
}
if ($this->Category->delete($id)) {
$this->Session->setFlash(__('Kategorie wurde 
gelöscht.', true));
$this->redirect(array('action'=>'index'));
}
$this->Session->setFlash(__('Kategorie wurden nicht gelöscht.', 
true));
$this->redirect(array('action' => 'index'));
}
// Kategorien auswählen
function choosecategories() {
//Session zu Beginn des neuen Spieles leeren
$this->Session->destroy();
//Kategorien auslesen
if(empty($this->data)){
$this->set('categories', $this->Category->find('all'));
}else{
$categories = array();
foreach ($this->data['Category'] as $key => $cat):
if($cat == 1){
array_push($categories, $key);
}
endforeach;
//Sessions setzen
if(count($categories) > 0){
$this->Session->write('categories', 
$categories);
$this->Session->write('startTime', date('Y-m-d 
H:i:s'));
$this->Session->write('joker', true);
$this->Session->write('points', 0);
$this->redirect(array('controller' => 
'questions', 'action' => 'game'));
}else{
$this->set('categories', 
$this->Category->find('all'));
}
}   
}
}
?>

--
View this message in context: 
http://cakephp.1045679.n5.nabble.com/Warning-2-Cannot-modify-header-information-headers-already-sent-by-tp4860658p4860658.html
Sent from the CakePHP mailing list archive at Nabble.com.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.ca

display many tables in cake php on the same page

2010-10-14 Thread blablabla
I am using cake php

I have a table called relates that holds the primary id values from
the other tables.

I used cakephp to generate the crud. it works fine. if you click on
the number in the relates table it goes to the appropriate table and
displays the information like it should.


how can you combine the information from the other tables and display
the information instead of showing the relationships primary ids?

example:
//relate table show this
Client 1
Client Address 1
Contact 1
Contact Info 1
Accounting 1

I would like to look like this

client: john smith
client: address 123 easy st
Contact: sam
Contact Info: 714-822-
Accounting: 500.00

I know my code for the model is not correct but when i join the tables
i get no errors but the tables that i join do not display. basically i
need this query to be used but i cant figure how to make it show more
than one table at a time

PHP Syntax (Toggle Plain Text)

   1.
   array(
  11.
  'className' => 'Relate',
  12.
  'foreignKey' => 'relate_id',
  13.
  'conditions' => '',
  14.
  'fields' => '',
  15.
  'order' => ''
  16.
  ),
  17.
  'Client' => array(
  18.
  'className' => 'Client',
  19.
  'foreignKey' => 'client_id',
  20.
  'conditions' => '',
  21.
  'fields' => '',
  22.
  'order' => ''
  23.
  ),
  24.
  'ClientAddress' => array(
  25.
  'className' => 'ClientAddress',
  26.
  'foreignKey' => 'client_address_id',
  27.
  'conditions' => '',
  28.
  'fields' => '',
  29.
  'order' => ''
  30.
  ),
  31.
  'Contact' => array(
  32.
  'className' => 'Contact',
  33.
  'foreignKey' => 'contact_id',
  34.
  'conditions' => '',
  35.
  'fields' => '',
  36.
  'order' => ''
  37.
  ),
  38.
  'ContactInfo' => array(
  39.
  'className' => 'ContactInfo',
  40.
  'foreignKey' => 'contact_info_id',
  41.
  'conditions' => '',
  42.
  'fields' => '',
  43.
  'order' => ''
  44.
  ),
  45.
  'Accounting' => array(
  46.
  'className' => 'Accounting',
  47.
  'foreignKey' => 'accounting_id',
  48.
  'conditions' => '',
  49.
  'fields' => '',
  50.
  'order' => ''
  51.
  ),var $hasOne = array(
  52.
  'ChildRelate' => array(
  53.
  'className' => 'Relate',
  54.
  'foreignKey' => 'relate_id',
  55.
  'dependent' => false,
  56.
  'conditions' => '',
  57.
  'fields' => '',
  58.
  'order' => ''
  59.
  )
  60.
  );
  61.

  62.
  var $hasMany = array(
  63.
  'ChildRelate' => array(
  64.
  'className' => 'Relate',
  65.
  'foreignKey' => 'relate_id',
  66.
  'dependent' => false,
  67.
  'conditions' => '',
  68.
  'fields' => '',
  69.
  'order' => '',
  70.
  'limit' => '',
  71.
  'offset' => '',
  72.
  'exclusive' => '',
  73.
  'finderQuery' => '',
  74.
  'counterQuery' => ''
  75.
  )
  76.
  );
  77.

  78.
  }
  79.
  ?>

 array( 'className' => 'Relate', 'foreignKey'
=> 'relate_id', 'conditions' => '', 'fields' => '', 'order' => '' ),
'Client' => array( 'className' => 'Client', 'foreignKey' =>
'client_id', 'conditions' => '', 'fields' => '', 'order' => '' ),
'ClientAddress' => array( 'className' => 'ClientAddress', 'foreignKey'
=> 'client_address_id', 'conditions' => '', 'fields' => '', 'order' =>
'' ), 'Contact' => array( 'className' => 'Contact', 'foreignKey' =>
'contact_id', 'conditions' => '', 'fields' => '', 'order' => '' ),
'ContactInfo' => array( 'className' => 'ContactInfo', 'foreignKey' =>
'contact_info_id', 'conditions' => '', 'fields' => '', 'order' =>
'' ), 'Accounting' => array( 'className' => 'Accounting', 'foreignKey'
=> 'accounting_id', 'conditions' => '', 'fields' => '', 'order' =>
'' ),var $hasOne = array( 'ChildRelate' => array( 'className' =>
'Relate', 'foreignKey' => 'relate_id', 'dependent' => false,
'conditions' => '', 'fields' => '', 'order' => '' ) ); var $hasMany =
array( 'ChildRelate' => array( 'className' => 'Relate', 'foreignKey'
=> 'relate_id', 'dependent' => false, 'conditions' => '', 'fields' =>
'', 'order' => '', 'limit' => '', 'offset' => '', 'exclusive' => '',
'finderQuery' => '', 'counterQuery' => '' ) ); } ?>

heres the sql query. relate is the table that relates all the tables
together
I know that the names are not complaint to cakephp's name scheme but
it will be. I am justing looking for some direction and a format to
help me out

"SELECT
agency.agency,
agency_address.agent_address,
agency.agency_id,
bond.bond_number,
bond.Surety,
bond.bond_type,
bond.paying_state,
bond.bond_state,
bond.term,
bond.cancellation_clause,
bond.bond_amt,
bond.first_issue_date,
bond.issue_date,
bond.exp_date,
bond.red_stared,
bond.red_stared_date,
bond.date_purged,
bond.bond_id,
client.client_id,
client.client_name,
agency_contact.agent_first,
agency_contact.agent_last,
agency_info.agent_phone,
agency_info.agent_fax,
agency_info.agent_email,
bond.bond_nu