mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-08 18:12:53 +01:00
111 lines
3.3 KiB
PHP
111 lines
3.3 KiB
PHP
<?PHP
|
|
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
*
|
|
* $Id$
|
|
* $Source$
|
|
*
|
|
*/
|
|
|
|
require("./pre.inc.php");
|
|
|
|
llxHeader();
|
|
|
|
if ($sortfield == "")
|
|
{
|
|
$sortfield="lower(l.title)";
|
|
}
|
|
if ($sortorder == "")
|
|
{
|
|
$sortorder="ASC";
|
|
}
|
|
|
|
if ($page == -1) { $page = 0 ; }
|
|
$limit = $conf->liste_limit;
|
|
$offset = $limit * $page ;
|
|
|
|
$form = '<form action="index.php">'.
|
|
'<input type="hidden" name="mode" value="search">'.
|
|
'<input type="hidden" name="mode-search" value="soc">'.
|
|
'Titre : <input type="text" name="searchvalue" class="flat" size="15"> '.
|
|
'<input type="submit" class="flat" value="go"></form>';
|
|
|
|
|
|
print_barre_liste("Liste des Livres", $page, $PHP_SELF, "", $sortfield, $sortorder, $form);
|
|
|
|
$sql = "SELECT l.rowid, l.title, l.oscid, l.ref, l.status FROM ".MAIN_DB_PREFIX."livre as l";
|
|
|
|
if ($searchvalue)
|
|
{
|
|
$sql .= " WHERE l.title like '%$searchvalue%'";
|
|
}
|
|
|
|
$sql .= " ORDER BY $sortfield $sortorder ";
|
|
$sql .= $db->plimit( $limit ,$offset);
|
|
|
|
if ( $db->query($sql) )
|
|
{
|
|
$num = $db->num_rows();
|
|
$i = 0;
|
|
print "<p><TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
|
|
print "<TR class=\"liste_titre\"><td>";
|
|
print_liste_field_titre("Réf.",$PHP_SELF, "l.ref");
|
|
print "</td><td>";
|
|
print_liste_field_titre("Titre",$PHP_SELF, "l.title");
|
|
print "</td>";
|
|
print '<td colspan="3"> </td>';
|
|
print "</TR>\n";
|
|
$var=True;
|
|
while ($i < $num) {
|
|
$objp = $db->fetch_object( $i);
|
|
$var=!$var;
|
|
print "<TR $bc[$var]>";
|
|
|
|
print '<td><a href="fiche.php?id='.$objp->rowid.'"><img src="/theme/'.$conf->theme.'/img/filenew.png" border="0" alt="Fiche livre"></a> ';
|
|
|
|
print "<a href=\"fiche.php?id=$objp->rowid\">$objp->ref</a></TD>\n";
|
|
print "<TD width='70%'><a href=\"fiche.php?id=$objp->rowid\">$objp->title</a></TD>\n";
|
|
|
|
|
|
if ($objp->status == 1)
|
|
{
|
|
print '<td align="center"><img src="/theme/'.$conf->theme.'/img/icon_status_green.png" border="0"></a></td>';
|
|
print '<td align="center"><img src="/theme/'.$conf->theme.'/img/icon_status_red_light.png" border="0"></a></td>';
|
|
print '<TD align="right"><a href="'.OSC_CATALOG_URL.'product_info.php?products_id='.$objp->oscid.'">Fiche en ligne</a></TD>';
|
|
}
|
|
else
|
|
{
|
|
print '<td align="center"><img src="/theme/'.$conf->theme.'/img/icon_status_green_light.png" border="0"></a></td>';
|
|
print '<td align="center"><img src="/theme/'.$conf->theme.'/img/icon_status_red.png" border="0"></a></td>';
|
|
print '<td> </td>';
|
|
}
|
|
|
|
print "</TR>\n";
|
|
$i++;
|
|
}
|
|
print "</TABLE>";
|
|
$db->free();
|
|
}
|
|
else
|
|
{
|
|
print $db->error();
|
|
}
|
|
|
|
$db->close();
|
|
|
|
llxFooter("<em>Dernière modification $Date$ révision $Revision$</em>");
|
|
?>
|