2005-04-09 10:55:30 +02:00
|
|
|
|
<?PHP
|
|
|
|
|
|
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
2007-07-31 01:22:06 +02:00
|
|
|
|
* Copyright (C) 2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
2005-04-09 10:55:30 +02:00
|
|
|
|
*
|
|
|
|
|
|
* 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.
|
|
|
|
|
|
* or see http://www.gnu.org/
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
2007-07-31 01:22:06 +02:00
|
|
|
|
/**
|
2008-10-25 13:16:39 +02:00
|
|
|
|
* \file htdocs/includes/modules/expedition/methode_expedition.modules.php
|
|
|
|
|
|
* \ingroup expedition
|
|
|
|
|
|
* \brief Fichier contenant la classe mere de generation de bon de livraison en PDF
|
|
|
|
|
|
* et la classe mere de numerotation des bons de livraisons
|
|
|
|
|
|
* \version $Id$
|
2008-10-21 23:27:20 +02:00
|
|
|
|
*/
|
2007-07-31 01:22:06 +02:00
|
|
|
|
|
2009-01-28 16:09:37 +01:00
|
|
|
|
require_once(DOL_DOCUMENT_ROOT.'/lib/pdf.lib.php');
|
2007-07-31 01:22:06 +02:00
|
|
|
|
require_once(DOL_DOCUMENT_ROOT.'/includes/fpdf/fpdfi/fpdi_protection.php');
|
2005-09-03 17:14:34 +02:00
|
|
|
|
|
2008-10-25 13:16:39 +02:00
|
|
|
|
|
2007-07-31 01:22:06 +02:00
|
|
|
|
/**
|
2008-10-25 13:16:39 +02:00
|
|
|
|
* \class methode_expedition
|
|
|
|
|
|
* \brief Classe mere des methodes expeditions
|
2008-10-21 23:27:20 +02:00
|
|
|
|
*/
|
2007-09-12 00:01:18 +02:00
|
|
|
|
class methode_expedition
|
2005-04-09 10:55:30 +02:00
|
|
|
|
{
|
|
|
|
|
|
|
2008-10-21 23:27:20 +02:00
|
|
|
|
function methode_expedition($db=0)
|
|
|
|
|
|
{
|
|
|
|
|
|
$this->db = $db;
|
2008-10-29 23:25:34 +01:00
|
|
|
|
$this->name = "NOT DEFINED";
|
|
|
|
|
|
$this->description = "ERROR IN MODULE DESCRIPTION";
|
2008-10-21 23:27:20 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
2009-01-28 16:09:37 +01:00
|
|
|
|
|
2008-10-29 23:25:34 +01:00
|
|
|
|
/**
|
|
|
|
|
|
* \brief Renvoi la liste des mod<EFBFBD>les actifs
|
|
|
|
|
|
* \param db Handler de base
|
|
|
|
|
|
*/
|
|
|
|
|
|
function liste_modeles($db)
|
2008-10-21 23:27:20 +02:00
|
|
|
|
{
|
2008-10-29 23:25:34 +01:00
|
|
|
|
$type='invoice';
|
|
|
|
|
|
$liste=array();
|
|
|
|
|
|
$sql ="SELECT nom as id, nom as lib";
|
|
|
|
|
|
$sql.=" FROM ".MAIN_DB_PREFIX."document_model";
|
|
|
|
|
|
$sql.=" WHERE type = '".$type."'";
|
2008-10-21 23:27:20 +02:00
|
|
|
|
|
2008-10-29 23:25:34 +01:00
|
|
|
|
$resql = $db->query($sql);
|
|
|
|
|
|
if ($resql)
|
2008-10-21 23:27:20 +02:00
|
|
|
|
{
|
2008-10-29 23:25:34 +01:00
|
|
|
|
$num = $db->num_rows($resql);
|
|
|
|
|
|
$i = 0;
|
|
|
|
|
|
while ($i < $num)
|
2008-10-21 23:27:20 +02:00
|
|
|
|
{
|
2008-10-29 23:25:34 +01:00
|
|
|
|
$row = $db->fetch_row($resql);
|
|
|
|
|
|
$liste[$row[0]]=$row[1];
|
|
|
|
|
|
$i++;
|
2008-10-21 23:27:20 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2008-10-29 23:25:34 +01:00
|
|
|
|
else
|
2008-10-21 23:27:20 +02:00
|
|
|
|
{
|
2009-02-20 23:53:15 +01:00
|
|
|
|
dol_print_error($db);
|
2008-10-29 23:25:34 +01:00
|
|
|
|
return -1;
|
2008-10-21 23:27:20 +02:00
|
|
|
|
}
|
2008-10-29 23:25:34 +01:00
|
|
|
|
return $liste;
|
2008-10-21 23:27:20 +02:00
|
|
|
|
}
|
2009-01-28 16:09:37 +01:00
|
|
|
|
|
2005-04-09 10:55:30 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
?>
|