Changeset 5890
- Timestamp:
- 07/24/08 13:46:44 (2 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/centreon/www/include/configuration/configObject/host/DB-Func.php
r5851 r5890 842 842 while ($hst =& $DBRESULT->fetchRow()) 843 843 $oldTp[$hst["host_tpl_id"]] = $hst["host_tpl_id"]; 844 for ($i=0;$i <= $_POST['nbOfSelect']; $i++) 845 { 844 for ($i=0;$i <= $_POST['nbOfSelect']; $i++){ 846 845 $tpSelect = "tpSelect_" . $i; 847 $newTp[$_POST[$tpSelect]] = $_POST[$tpSelect]; 846 if (isset($_POST[$tpSelect])) 847 $newTp[$_POST[$tpSelect]] = $_POST[$tpSelect]; 848 848 } 849 foreach ($oldTp as $val)850 {849 850 foreach ($oldTp as $val){ 851 851 /* 852 852 * if not set, then that means a template was removed … … 861 861 if (PEAR::isError($DBRESULT)) 862 862 print "DB Error : ".$DBRESULT->getDebugInfo()."<br />"; 863 for ($i=0, $j = 1;$i <= $_POST['nbOfSelect']; $i++) 864 { 863 for ($i=0, $j = 1;$i <= $_POST['nbOfSelect']; $i++){ 865 864 $tpSelect = "tpSelect_" . $i; 866 if ( !isset($already_stored[$_POST[$tpSelect]]) && $_POST[$tpSelect]) {865 if (isset($_POST[$tpSelect]) && !isset($already_stored[$_POST[$tpSelect]]) && $_POST[$tpSelect]) { 867 866 $rq = "INSERT INTO host_template_relation (`host_host_id`, `host_tpl_id`, `order`) VALUES (". $host_id .", ". $_POST[$tpSelect] .", ". $j .")"; 868 867 $DBRESULT =& $pearDB->query($rq); … … 881 880 $DBRESULT =& $pearDB->query("DELETE FROM `on_demand_macro_host` WHERE `host_host_id`='".$host_id."'"); 882 881 883 for ($i=0; $i <= $_POST['nbOfMacro']; $i++) 884 { 882 for ($i=0; $i <= $_POST['nbOfMacro']; $i++){ 885 883 $macInput = "macroInput_" . $i; 886 884 $macValue = "macroValue_" . $i;
