Ver Mensaje Individual
  #1 (permalink)  
Antiguo 26/05/2008, 11:49
alfil123
 
Fecha de Ingreso: agosto-2005
Mensajes: 722
Antigüedad: 18 años, 8 meses
Puntos: 2
consulta de lineas de codigo

hola amigos miren no entiendo como modificar una consulta que se carga en una tabla, el problema es que no se carga la primera columna, y la ultima esta vacia. bueno la verdad nose como:
$fieldarray =array();
$fieldarray['sale_id_voucher'] = 'ID Sale';
//$fieldarray['Sale_Status_ID'] = 'Status';
$fieldarray['Sale_Date_Opened'] = 'Date Opened';
$fieldarray['Start_Date'] = 'Commence Date';
$fieldarray['Total_Money_Paid'] = 'Total Paid';
$fieldarray['Edit_Pane'] = ' ';

$table = '';
$type = 'sortable resizable';
$table = "<table class='".$type."' width = '100%'>";
$table_top = "<thead><tr>";
$table_bottom = "<tfoot><tr>";

foreach($fieldarray as $key => $value)
{
$table_top .= "<th class='sortfirstdesc sortcol' id='".$key."'>".$value."</th>";
$table_bottom .= "<th>".$value."</th>";
}
$table_results = "<tbody>";
foreach($results as $top_key => $top_value)
{
$table_results .= "<tr class='rowodd'>";

foreach($fieldarray as $field_key => $field_value)
{
foreach($top_value as $key => $value)
{
if($key == $field_key )
{
$table_results .= "<td>";
// carga la tabla

$table_results .= $value;
$table_results .= "</td>";
}
else
{
//do nothing
}
}

}
$openWindowString = "onClick = 'editSale(".'"'.$top_value['Sale_ID_Voucher'].'"'.",".'"'.$status.'"'.",".'"'.$status_id.'"'.") '";

$edit_pane = "<img src = '".IMG."/edit.gif' ".$openWindowString.">";

$table_results .= "<td>";
$table_results .= $edit_pane;
$table_results .= "</td>";
$table_results .= "</tr>";
}
$table_results .= "</tbody>";

$table_top .= "</tr></thead>";
$table_bottom .= "</tr></tfoot>";

$table .= $table_top.$table_results.$table_bottom."</table>";
return $table;

la $table se carga a una tabla con smarty,
porfavor ayudeme amigos