Skip to content
Snippets Groups Projects
Commit ca3924a3 authored by Rodolphe Quiedeville's avatar Rodolphe Quiedeville
Browse files

Ajout accs au fichier

parent 7a0557c4
No related branches found
No related tags found
No related merge requests found
......@@ -25,7 +25,7 @@ $page = $_GET["page"];
$sortorder = $_GET["sortorder"];
$sortfield = $_GET["sortfield"];
llxHeader('','Fiche Prlvement');
llxHeader('','Bon de prlvement');
/*
* Scurit accs client
*/
......@@ -43,13 +43,38 @@ $h++;
dolibarr_fiche_head($head, $hselected, 'Prlvement');
/*
* Recherche
*
*
*/
$prev_id = $_GET["id"];
if ($_GET["id"])
{
$bon = new BonPrelevement($db,"");
if ($bon->fetch($_GET["id"]) == 0)
{
print '<table class="border" width="100%">';
print '<tr><td width="20%">Rfrence</td><td>'.$bon->ref.'</td></tr>';
print '<tr><td width="20%">Date</td><td>'.strftime("%d %b %Y",$bon->datec).'</td></tr>';
print '<tr><td width="20%">Montant</td><td>'.price($bon->amount).'</td></tr>';
print '<tr><td width="20%">Fichier</td><td>';
$encfile = urlencode(DOL_DATA_ROOT.'/prelevement/bon/'.$bon->ref);
print '<a href="'.DOL_URL_ROOT.'/document.php?type=text/plain&amp;file='.$encfile.'">'.$bon->ref.'</a>';
print '</td></tr>';
print '</table>';
}
else
{
print "Erreur";
}
}
if ($page == -1) { $page = 0 ; }
......@@ -57,7 +82,8 @@ $offset = $conf->liste_limit * $page ;
$pageprev = $page - 1;
$pagenext = $page + 1;
$prev_id = $_GET["id"];
if ($sortorder == "") {
$sortorder="DESC";
}
......@@ -79,13 +105,6 @@ $sql .= " , ".MAIN_DB_PREFIX."facture as f";
$sql .= " WHERE p.rowid=".$prev_id;
$sql .= " AND pf.fk_prelevement = p.rowid";
$sql .= " AND pf.fk_facture = f.rowid";
if ($_GET["search_client"])
{
$sel =urldecode($_GET["search_client"]);
$sql .= " AND s.nom LIKE '%".$sel."%'";
}
$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset);
$result = $db->query($sql);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment