From 0c20a8c35f062c8732109ec6a100e35988207336 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Sun, 22 Jun 2003 14:40:17 +0000 Subject: [PATCH] Nouvelle syntaxe --- htdocs/includes/boxes/box_factures.php | 6 ++--- htdocs/includes/boxes/box_osc_client.php | 2 +- htdocs/includes/boxes/box_propales.php | 34 ++++++++++++++++++++---- 3 files changed, 33 insertions(+), 9 deletions(-) diff --git a/htdocs/includes/boxes/box_factures.php b/htdocs/includes/boxes/box_factures.php index 1a1099863ab..57e2da974b8 100644 --- a/htdocs/includes/boxes/box_factures.php +++ b/htdocs/includes/boxes/box_factures.php @@ -42,9 +42,9 @@ if ($result) { $objp = $db->fetch_object( $i); - $info_box_contents[$i] = array('align' => 'center', - 'text' => $objp->facnumber . " " . $objp->nom, - 'url' => DOL_URL_ROOT."/compta/facture.php3?facid=".$objp->facid); + $info_box_contents[$i][0] = array('align' => 'center', + 'text' => $objp->facnumber . " " . $objp->nom, + 'url' => DOL_URL_ROOT."/compta/facture.php3?facid=".$objp->facid); $i++; } } diff --git a/htdocs/includes/boxes/box_osc_client.php b/htdocs/includes/boxes/box_osc_client.php index 91e354898db..7943d285f49 100644 --- a/htdocs/includes/boxes/box_osc_client.php +++ b/htdocs/includes/boxes/box_osc_client.php @@ -39,7 +39,7 @@ if ($result) { $objp = $db->fetch_object( $i); - $info_box_contents[$i] = array('align' => 'center', + $info_box_contents[$i][0] = array('align' => 'center', 'text' => $objp->cus, 'url' => "/boutique/client/"); $i++; diff --git a/htdocs/includes/boxes/box_propales.php b/htdocs/includes/boxes/box_propales.php index ebd1050694b..7fd8c3dbfa4 100644 --- a/htdocs/includes/boxes/box_propales.php +++ b/htdocs/includes/boxes/box_propales.php @@ -21,14 +21,38 @@ */ $info_box_head = array(); -$info_box_head[] = array('text' => "Propales"); +$info_box_head[] = array('text' => "5 dernières propositions"); $info_box_contents = array(); -$info_box_contents[0] = array('align' => 'center', - 'text' => "factures0"); -$info_box_contents[1] = array('align' => 'center', - 'text' => "factures1"); +$sql = "SELECT s.nom,s.idp,p.ref,".$db->pdate("p.datep")." as dp,p.rowid"; +$sql .= " FROM llx_societe as s,llx_propal as p WHERE p.fk_soc = s.idp"; +$sql .= " ORDER BY p.datep DESC, p.ref DESC "; +$sql .= $db->plimit(5, 0); + +$result = $db->query($sql); + +if ($result) +{ + $num = $db->num_rows(); + + $i = 0; + + while ($i < $num) + { + $objp = $db->fetch_object( $i); + + $info_box_contents[$i][0] = array('align' => 'center', + 'text' => $objp->ref, + 'url' => DOL_URL_ROOT."/comm/propal.php3?propalid=".$objp->rowid); + + $info_box_contents[$i][1] = array('align' => 'center', + 'text' => $objp->nom, + 'url' => DOL_URL_ROOT."/comm/propal.php3?propalid=".$objp->rowid); + $i++; + } +} + new infoBox($info_box_head, $info_box_contents);