Empfehlungen: Erweiterte Suche

View von 2 Models - ich bekomm das nicht hin...

Ausgabedaten formatieren und darstellen

View von 2 Models - ich bekomm das nicht hin...

Beitragvon kobold » Do 26. Aug 2010, 17:51

hab das model "reference"
Code: Alles auswählen
<?php
class Reference extends AppModel {

    var $name = 'Reference';

}
?>


und "consultant"
Code: Alles auswählen
<?php
class Consultant extends AppModel {

    var $name = 'Consultant';

}
?>


den references_controller
Code: Alles auswählen
<?php
class ReferencesController extends AppController {
var $name = 'References';
var $uses = array('Reference', 'Consultant');

var $paginate = array('limit' => 5, 'page' => 1);

    function index() {
        $this->set('references', $this->paginate('Reference'));
    }

}
?>


und die view "index"
Code: Alles auswählen

<?php echo $paginator->sort('ID', 'id') ?><br/>
<?php echo $paginator->sort('Name', 'cust_name') ?><br/>
 
  <?php foreach ($references as $reference): ?>
</tr>
<table width="470" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="170" valign="top"><?php echo $html->image($reference['Reference']['cust_picture']) ?></td>
    <td width="400"valign="top"><p><strong><?php echo $reference['Reference']['cust_name']; ?>
        <?php echo $reference['Reference']['cust_lastname']; ?>,
        <?php echo $reference['Reference']['cust_city']; ?></strong> </p>        
<p><?php echo $reference['Reference']['cust_comment']; ?></p>
  </tr>
</table>
<br />
<?php echo $awdHtml->infoBoxStart() ?> </p>

ZUGRIFF AUF MODEL CONSULTANT

<?php echo $awdHtml->infoBoxCollapseStart() ?>

ZUGRIFF AUF MODEL CONSULTANT

  <?php echo $awdHtml->infoBoxCollapseEnd() ?> <?php echo $awdHtml->infoBoxEnd() ?>
 <br/>

<?php endforeach; ?>
</tr>
<table width="470" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="70" align="left"><?php echo $paginator->prev();?> </td>
 <td width="230" align="center"><?php echo $paginator->numbers();?></td>
 <td width="70" align="right"><?php echo $paginator->next();?> </td>
</td>
  </tr>
</table>




<?php echo $javascript->link('jquery-1.2.3.min') ?> <?php echo $javascript->link('jquery/infobox') ?> </p>



Ich hab in der Tabelle "references" die auch in der Tabelle "consultants" vorkommt - anhand dieser Nummer soll bei jeder Referenz der dazupassende Consultant ausgegeben werden - bin ein newby und tüftle an dem Ganzen schon eine Woche - hab auch alle möglichen Tutorials und Foreneinträge gelesen, brings aber nicht zusammen... Kann mir jemand auf die Sprünge helfen???? Wenn das Problem gelöst ist, solls dann noch ein Drop-Down geben, wo nach dem consultant sortiert werden kann...

Dank Euch,
Manu
kobold
 
Beiträge: 4
Registriert: Do 26. Aug 2010, 17:37

Zurück zu Views

Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 1 Gast