Io in pratica faccio cosi:
nel file nome.php metto prima di tutto
case "mostradati":
mostradati();
break;
Poi definisco la funzione.
function mostradati($userid){
global $database;
$userid = trim( mosGetParam( $_REQUEST, 'userid', "" ) );
$id = trim( mosGetParam( $_REQUEST, 'id', "" ) );
$cognome = trim( mosGetParam( $_REQUEST, 'cognome', "" ) );
$nome = trim( mosGetParam( $_REQUEST, 'nome', "" ) );
$row = new anaformativa ($database);
$row->load($id);
$lists = array();
$sql = "SELECT id, cognome, nome FROM #__anafor_nominativi ORDER By id";
$database->setQuery($sql);
if (!$database->query()) {
echo $database->stderr();
return;
}
HTML_anaformativa::modificadati($row,$userid);
return true;
}
Poi nel file nome.class.php inserisco i seguenti dati.
class anaformativa extends mosDBTable {
var $id=null;
var $userid=null;
var $cognome=null;
var $nome=null;
/**
* @param db - database connector object
*/
function anaformativa(&$db) {
$this->mosDBTable('#__anafor_nominativi', 'id', $db);
}
}
e infine nel file nome.html.php (per adesso ho creato un link mostra che mi dovrebbe richiamare i campi)
<tr><td><a href="index.php?option=com_ana_formativa&task=mostradati&userid=<?php echo $userid;?>">Mostra dati[/url]</td></tr>
con la seguente funzione
function mostradati(&$row,$userid) {
global $mosConfig_live_site;
global $my;
$id=$row->id;
$idUtente=1;
?>
<div>
<p class="componentheading">Anagrafica</p>
<table width="100%" border="0" cellspacing="2" cellpadding="0"> <tr class="<?php echo $tabclass[$k]; ?>">
<td width="20%" valign="top">Cognome: </td>
<td><?php echo $row->cognome; ?></td>
</tr>
<tr class="<?php echo $tabclass[$k]; ?>">
<td width="20%" valign="top"><strong>Nome:</srong></td>
<td><?php echo $row->nome; ?></td>
</tr>
</table>
</div>
<?php
}
dov'è che sbaglio secondo te?
ora mo da anche un errore..anzi 2..
Warning: Missing argument 1 for mostradati() in /var/www/test/components/com_ana_formativa/ana_formativa.php on line 610
Fatal error: Call to undefined function: modificadati() in /var/www/test/components/com_ana_formativa/ana_formativa.php on line 627
che pizzaaaaaaaaa!!!!
Graze