noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 07/11: Task #1206 - ADMINISTRATION MODELE #12


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 07/11: Task #1206 - ADMINISTRATION MODELE #1206 : change description
Date: Thu, 05 Nov 2015 10:21:11 +0000

sparkyx pushed a commit to branch master
in repository noalyss.

commit a253e9ead94cbea74861766f5b805b0e3d693ac3
Author: Dany De Bontridder <address@hidden>
Date:   Thu Nov 5 10:03:42 2015 +0100

    Task #1206 - ADMINISTRATION MODELE
    #1206 : change description
---
 include/modele.inc.php |   20 +++++++++-----------
 1 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/include/modele.inc.php b/include/modele.inc.php
index 1d1deab..fe6bd3d 100644
--- a/include/modele.inc.php
+++ b/include/modele.inc.php
@@ -30,24 +30,22 @@ if ( !defined ('ALLOWED')) die('Forbidden');
 require_once NOALYSS_INCLUDE.'/lib/class_itext.php';
 require_once NOALYSS_INCLUDE.'/lib/class_icheckbox.php';
 require_once  NOALYSS_INCLUDE.'/class/class_extension.php';
+require_once NOALYSS_INCLUDE.'/lib/class_html_input.php';
 
 $sa = (isset($_REQUEST['sa'])) ? $_REQUEST['sa'] : 'list';
 if (isset($_POST['upd']) &&
                isset($_POST['m']))
 {
-       if (isset($_POST['name']) && isset($_POST['desc']))
+    $name=HtmlInput::default_value_post('name',"");
+    $desc =HtmlInput::default_value_post('desc',"");
+    $mod_id=HtmlInput::default_value_post("m", 0);
+    
+       if (trim($name) != "" && $mod_id != 0 && isNumber($mod_id)==1)
        {
-               extract($_POST);
                $cn = new Database();
-               if (strlen(trim($name)) != 0
-                               && $cn->get_value('select count(*) from 
modeledef where ' .
-                                               'mod_name=$1 and mod_id !=$2', 
array(trim($name), $m)) == 0
-               )
-               {
-
-                       $cn->exec_sql("update modeledef set mod_name=$1, " .
-                                       " mod_desc=$2 where mod_id=$3 ", 
array(trim($name), trim($desc), $m));
-               }
+                $cn->exec_sql("update modeledef set mod_name=$1, " .
+                                       " mod_desc=$2 where mod_id=$3 ", 
+                        array(trim($name), trim($desc), $mod_id));
        }
        $sa = "list";
 }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]