From baaa077370c8d61a71879288e1aa3fa9ecdfb942 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Tue, 21 Jun 2005 15:41:50 +0000 Subject: [PATCH] =?UTF-8?q?Ajout=20cr=E9ation=20des=20commerciaux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/telephonie/distributeurs/fiche.php | 58 +++++++++++++++++++++-- 1 file changed, 53 insertions(+), 5 deletions(-) diff --git a/htdocs/telephonie/distributeurs/fiche.php b/htdocs/telephonie/distributeurs/fiche.php index aab51fa0fc3..e1053d7c5f0 100644 --- a/htdocs/telephonie/distributeurs/fiche.php +++ b/htdocs/telephonie/distributeurs/fiche.php @@ -24,6 +24,7 @@ require("./pre.inc.php"); if (!$user->rights->telephonie->lire) accessforbidden(); $distri = new DistributeurTelephonie($db); +$commercial = new CommercialTelephonie($db); if($_POST["action"] == 'add') { @@ -41,9 +42,23 @@ if($_POST["action"] == 'add') { Header("Location: index.php"); } - } +if($_POST["action"] == 'add_commercial') +{ + $commercial->nom = $_POST["nom"]; + $commercial->prenom = $_POST["prenom"]; + $commercial->distri = $_GET["distri"]; + + if ($commercial->create() <> 0) + { + $_GET["action"] = "create_commercial"; + } + else + { + Header("Location: distributeur.php?id=".$_GET["distri"]); + } +} llxHeader('','Telephonie - Statistiques - Distributeurs'); @@ -55,6 +70,43 @@ llxHeader('','Telephonie - Statistiques - Distributeurs'); $h = 0; + +if ($_GET["action"] == 'create_commercial') +{ + $distri = new DistributeurTelephonie($db); + $distri->fetch($_GET["distri"]); + + + $head[$h][0] = DOL_URL_ROOT.'/telephonie/distributeurs/fiche.php?action=create'; + $head[$h][1] = "Nouveau commercial"; + $hselected = $h; + $h++; + + dolibarr_fiche_head($head, $hselected, $distri->nom); + + print '
'; + print ''; + + print ''; + + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + + print ''; + + print '
Prénom'.$commercial->error_string["prenom"].'
Nom'.$commercial->error_string["nom"].'

'; + + print "
"; + +} + +if ($_GET["action"] == 'create') +{ + $head[$h][0] = DOL_URL_ROOT.'/telephonie/distributeurs/fiche.php?action=create'; $head[$h][1] = "Nouveau distributeur"; $hselected = $h; @@ -62,10 +114,6 @@ $h++; dolibarr_fiche_head($head, $hselected, "Distributeurs"); - - -if ($_GET["action"] == 'create') -{ print '
'; print '';