* * 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"; $mesg = ''; if ($_POST["action"] == 'add') { $service = new TelephonieService($db); $service->ref = $_POST["ref"]; $service->libelle = $_POST["libelle"]; $service->libelle_facture = $_POST["libelle_facture"]; $service->montant = $_POST["montant"]; if ( $service->create($user) == 0) { Header("Location: fiche.php?id=".$service->id); } else { $_GET["action"] = 'create'; } } if ($_GET["action"] == 'active') { $service = new LigneTel($db); $service->fetch_by_id($_GET["id"]); $datea = $db->idate(mktime($h, $m , $s, $_POST["remonth"], $_POST["reday"], $_POST["reyear"])); if ( $service->set_statut($user, 3, $datea) == 0) { Header("Location: fiche.php?id=".$service->id); } } if ($_POST["action"] == 'update') { $service = new TelephonieService($db); $service->id = $_GET["id"]; $service->ref = $_POST["ref"]; $service->libelle = $_POST["libelle"]; $service->libelle_facture = $_POST["libelle_facture"]; $service->montant = $_POST["montant"]; if ( $service->update($user) == 0) { $action = ''; $mesg = 'Fiche mise à jour'; } else { $action = 're-edit'; $mesg = 'Fiche non mise à jour !' . "
" . $entrepot->mesg_error; } } llxHeader("","","Fiche Service"); if ($cancel == $langs->trans("Cancel")) { $action = ''; } /* * Création * */ if ($_GET["action"] == 'create') { $form = new Form($db); print_titre("Nouveau service"); print '
'; print ''; print ''; print ''; print ''; print ''; print ''."\n"; print '
Libellé'; print ''; print '
Libellé Facture'; print ''; print '
Montant HT'; print ''; print '  euros HT
 
'."\n"; print '
'; } else { if ($_GET["id"]) { $service = new TelephonieService($db); if ( $service->fetch($_GET["id"]) == 0 ) { if ($_GET["action"] <> 'edit' && $_GET["action"] <> 're-edit') { $h=0; $head[$h][0] = DOL_URL_ROOT."/telephonie/service/fiche.php?id=".$service->id; $head[$h][1] = $langs->trans("Service"); $hselected = $h; $h++; $head[$h][0] = DOL_URL_ROOT."/telephonie/service/factures.php?id=".$service->id; $head[$h][1] = $langs->trans('Factures'); $h++; dolibarr_fiche_head($head, $hselected, 'Service : '.$service->numero); print_fiche_titre('Fiche Service', $mesg); print ''; print ''; print ''; print ''; print ''; print "
Libellé'.$service->libelle.'
Libellé Facture'.$service->libelle_facture.'
Montant HT'.dolibarr_print_phone($service->montant).'
Statut'.$service->statuts[$service->statut].'

"; print ''; } /* * Edition * * * */ if ($_GET["action"] == 'edit' || $action == 're-edit') { $h=0; $head[$h][0] = DOL_URL_ROOT."/telephonie/service/fiche.php?id=".$service->id; $head[$h][1] = $langs->trans("Service"); $hselected = $h; $h++; dolibarr_fiche_head($head, $hselected, 'Service : '.$service->numero); print_fiche_titre('Edition du service', $mesg); print "
id\" method=\"post\">\n"; print ''; print ''; print ''; print ''; print ''; print ''; print '
Libellé'; print ''; print '
Libellé Facture'; print ''; print '
Montant HT'; print '  euros HT'; print '
'; print '
'; /* * * * */ print ''; } } else { print "Error"; } } } /* ************************************************************************** */ /* */ /* Barre d'action */ /* */ /* ************************************************************************** */ print "\n
\n"; if ($_GET["action"] == '') { print "id\">".$langs->trans("Edit").""; } print "
"; $db->close(); llxFooter("Dernière modification $Date$ révision $Revision$"); ?>