Commit 35d16f82257b7dcd1d02f64323f30a7633588bcc

Authored by mukhtar
1 parent 2e0b6a00

no message


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@884 c91229c3-7414-0410-bfa2-8a42b809f60b
presentation/lookAndFeel/knowledgeTree/store.php
@@ -80,7 +80,8 @@ for ($i = 0; $i < count($aKeys); $i++) { @@ -80,7 +80,8 @@ for ($i = 0; $i < count($aKeys); $i++) {
80 $sRowStart = $aKeys[$i]; 80 $sRowStart = $aKeys[$i];
81 81
82 $iColumnCount++; 82 $iColumnCount++;
83 - } 83 + }
  84 +
84 85
85 if ($iPrimaryKey < 0) { 86 if ($iPrimaryKey < 0) {
86 //perform an insert 87 //perform an insert
@@ -138,7 +139,7 @@ for ($i = 0; $i &lt; count($aKeys); $i++) { @@ -138,7 +139,7 @@ for ($i = 0; $i &lt; count($aKeys); $i++) {
138 //perform an update 139 //perform an update
139 $sQuery = "UPDATE $sTableName SET "; 140 $sQuery = "UPDATE $sTableName SET ";
140 for ($j = 0; $j < count($aColumns) -1; $j++) { 141 for ($j = 0; $j < count($aColumns) -1; $j++) {
141 - $sQuery .= $aColumns[$j] . " = "; 142 + $sQuery .= $aColumns[$j] . " = ";
142 switch ($aTypes[$j]) { 143 switch ($aTypes[$j]) {
143 case 0: 144 case 0:
144 //id 145 //id
@@ -147,15 +148,15 @@ for ($i = 0; $i &lt; count($aKeys); $i++) { @@ -147,15 +148,15 @@ for ($i = 0; $i &lt; count($aKeys); $i++) {
147 case 1: 148 case 1:
148 $sQuery .= "'" . addslashes($aValues[$j]) . "', "; 149 $sQuery .= "'" . addslashes($aValues[$j]) . "', ";
149 break; 150 break;
150 - case 2:  
151 - $sQuery .= $aValues[$j] . ", "; 151 + case 2:
  152 + $sQuery .= ($aValues[count($aTypes) -1] ? 1 : 0) . ", ";
152 break; 153 break;
153 case 3: 154 case 3:
154 $sQuery .= $aValues[$j] . ", "; 155 $sQuery .= $aValues[$j] . ", ";
155 break; 156 break;
156 default: 157 default:
157 break; 158 break;
158 - } 159 + }
159 } 160 }
160 $sQuery .= $aColumns[count($aTypes) -1] . " = "; 161 $sQuery .= $aColumns[count($aTypes) -1] . " = ";
161 switch ($aTypes[count($aTypes) -1]) { 162 switch ($aTypes[count($aTypes) -1]) {