1 | <?php |
---|
2 | // for easier patching |
---|
3 | |
---|
4 | // Note: DO UPDATES ALWAYS OVER THE ITEM NAMES, SO NO KB's |
---|
5 | // DATABASES GET SCREWED UP. |
---|
6 | // |
---|
7 | // |
---|
8 | if (!config::get("DBUpdate")) |
---|
9 | config::set("DBUpdate","000"); |
---|
10 | |
---|
11 | // Current update version of Database |
---|
12 | define(CURRENT_DB_UPDATE,config::get("DBUpdate")); |
---|
13 | //Update version of this autoupgrade.php |
---|
14 | define(LASTEST_DB_UPDATE,"007"); |
---|
15 | |
---|
16 | function updateDB(){ |
---|
17 | // if update nesseary run updates |
---|
18 | if (CURRENT_DB_UPDATE < LASTEST_DB_UPDATE ){ |
---|
19 | |
---|
20 | update001(); |
---|
21 | update002(); |
---|
22 | update003(); |
---|
23 | update004(); |
---|
24 | update005(); |
---|
25 | |
---|
26 | update007(); |
---|
27 | } |
---|
28 | } |
---|
29 | |
---|
30 | /* |
---|
31 | * Too much has changed between update005 and current status for a clean |
---|
32 | * update006. Restarting from update007 in the hope that the differences |
---|
33 | * between 5 and 7 are worked out and an update006 implemented |
---|
34 | */ |
---|
35 | |
---|
36 | function update001(){ |
---|
37 | //Checking if this Update already done |
---|
38 | if (CURRENT_DB_UPDATE < "001" ) |
---|
39 | { |
---|
40 | require_once("common/includes/class.item.php"); |
---|
41 | // Changing ShieldBooster Slot from None to Mid Slot |
---|
42 | $ShieldBoosterGroup = item::get_group_id("Small Shield Booster I"); |
---|
43 | update_slot_of_group($ShieldBoosterGroup,0,2); |
---|
44 | |
---|
45 | // Changing Tracking Scripts Slot from None to Mid Slot |
---|
46 | $ScriptGroupID1 = item::get_group_id("Optimal Range"); |
---|
47 | update_slot_of_group($ScriptGroupID1,0,2); |
---|
48 | |
---|
49 | // Changing Warp Disruption Scripts Slot from None to Mid Slot |
---|
50 | $ScriptGroupID2 = item::get_group_id("Focused Warp Disruption"); |
---|
51 | update_slot_of_group($ScriptGroupID2,0,2); |
---|
52 | |
---|
53 | // Changing Tracking Disruption Scripts Slot from None to Mid Slot |
---|
54 | $ScriptGroupID3 = item::get_group_id("Optimal Range Disruption"); |
---|
55 | update_slot_of_group($ScriptGroupID3,0,2); |
---|
56 | |
---|
57 | // Changing Sensor Booster Scripts Slot from None to Mid Slot |
---|
58 | $ScriptGroupID4 = item::get_group_id("Targeting Range"); |
---|
59 | update_slot_of_group($ScriptGroupID4,0,2); |
---|
60 | |
---|
61 | // Changing Sensor Dampener Scripts Slot from None to Mid Slot |
---|
62 | $ScriptGroupID5 = item::get_group_id("Scan Resolution Dampening"); |
---|
63 | update_slot_of_group($ScriptGroupID5,0,2); |
---|
64 | |
---|
65 | // Changing Energy Weapon Slot from None to High Slot |
---|
66 | $EnergyWeaponGroup = item::get_group_id("Gatling Pulse Laser I"); |
---|
67 | update_slot_of_group($EnergyWeaponGroup,0,1); |
---|
68 | |
---|
69 | // Changing Group of Salvager I to same as Small Tractor Beam I |
---|
70 | $item = new Item(); |
---|
71 | $item->lookup("Salvager I"); |
---|
72 | $SalvagerTypeId = $item->getId(); |
---|
73 | $SalvagerGroup = item::get_group_id("Salvager I"); |
---|
74 | $TractorBeam = item::get_group_id("Small Tractor Beam I"); |
---|
75 | move_item_to_group($SalvagerTypeId,$SalvagerGroup ,$TractorBeam); |
---|
76 | |
---|
77 | //writing Update Status into ConfigDB |
---|
78 | config::set("DBUpdate","001"); |
---|
79 | } |
---|
80 | } |
---|
81 | |
---|
82 | function update002(){ |
---|
83 | // to correct the already existing Salvager in med slots. |
---|
84 | // missed it in update001 |
---|
85 | if (CURRENT_DB_UPDATE < "002" ) |
---|
86 | { |
---|
87 | require_once("common/includes/class.item.php"); |
---|
88 | $SalvagerGroup = item::get_group_id("Salvager I"); |
---|
89 | update_slot_of_group($SalvagerGroup,2,1); |
---|
90 | config::set("DBUpdate","002"); |
---|
91 | } |
---|
92 | } |
---|
93 | |
---|
94 | function update003(){ |
---|
95 | // Warefare Links and Command Prozessor were midslot items in install file, should be high slot |
---|
96 | if (CURRENT_DB_UPDATE < "003" ) |
---|
97 | { |
---|
98 | require_once("common/includes/class.item.php"); |
---|
99 | $WarfareLinkGroup = item::get_group_id("Skirmish Warfare Link - Rapid Deployment"); |
---|
100 | update_slot_of_group($WarfareLinkGroup,2,1); |
---|
101 | config::set("DBUpdate","003"); |
---|
102 | } |
---|
103 | } |
---|
104 | |
---|
105 | function update004(){ |
---|
106 | // new trinity ships are wrong saved as T1 shipes |
---|
107 | if (CURRENT_DB_UPDATE < "004" ) |
---|
108 | { |
---|
109 | $qry = new DBQuery(); |
---|
110 | |
---|
111 | $query = "UPDATE kb3_ships |
---|
112 | INNER JOIN kb3_ship_classes ON scl_id = shp_class |
---|
113 | SET shp_techlevel = 2 |
---|
114 | WHERE scl_class IN ('Electronic Attack Ship','Heavy Interdictor','Black Ops','Marauder','Heavy Interdictor','Jump Freighter') |
---|
115 | AND shp_techlevel = 1;"; |
---|
116 | $qry->execute($query); |
---|
117 | config::set("DBUpdate","004"); |
---|
118 | } |
---|
119 | } |
---|
120 | |
---|
121 | function update005(){ |
---|
122 | // Blueprints and small fixes |
---|
123 | if (CURRENT_DB_UPDATE < "005" ) |
---|
124 | { |
---|
125 | $qry = new DBQuery(); |
---|
126 | $query = <<<EOF |
---|
127 | INSERT INTO `kb3_invtypes` (`typeID`, `groupID`, `typeName`, `description`, `icon`, `radius`, `mass`, `volume`, `capacity`, `portionSize`, `raceID`, `basePrice`, `marketGroupID`) VALUES (29249, 105, 'Magnate Blueprint', '', '0', 0, 0, 0.01, 0, 1, 0, 0, 0); |
---|
128 | |
---|
129 | INSERT INTO `kb3_invtypes` (`typeID`, `groupID`, `typeName`, `description`, `icon`, `radius`, `mass`, `volume`, `capacity`, `portionSize`, `raceID`, `basePrice`, `marketGroupID`) VALUES (29267, 111, 'Apotheosis Blueprint', '', '0', 0, 0, 0.01, 0, 1, 0, 0, 0); |
---|
130 | |
---|
131 | INSERT INTO `kb3_invtypes` (`typeID`, `groupID`, `typeName`, `description`, `icon`, `radius`, `mass`, `volume`, `capacity`, `portionSize`, `raceID`, `basePrice`, `marketGroupID`) VALUES (29338, 106, 'Omen Navy Issue Blueprint', '', '0', 0, 0, 0.01, 0, 1, 0, 0, 0); |
---|
132 | |
---|
133 | INSERT INTO `kb3_invtypes` (`typeID`, `groupID`, `typeName`, `description`, `icon`, `radius`, `mass`, `volume`, `capacity`, `portionSize`, `raceID`, `basePrice`, `marketGroupID`) VALUES (29339, 106, 'Scythe Fleet Issue Blueprint', '', '0', 0, 0, 0.01, 0, 1, 0, 0, 0); |
---|
134 | |
---|
135 | INSERT INTO `kb3_invtypes` (`typeID`, `groupID`, `typeName`, `description`, `icon`, `radius`, `mass`, `volume`, `capacity`, `portionSize`, `raceID`, `basePrice`, `marketGroupID`) VALUES (29341, 106, 'Osprey Navy Issue Blueprint', '', '0', 0, 0, 0.01, 0, 1, 0, 0, 0); |
---|
136 | |
---|
137 | INSERT INTO `kb3_invtypes` (`typeID`, `groupID`, `typeName`, `description`, `icon`, `radius`, `mass`, `volume`, `capacity`, `portionSize`, `raceID`, `basePrice`, `marketGroupID`) VALUES (29345, 106, 'Exequror Navy Issue Blueprint', '', '0', 0, 0, 0.01, 0, 1, 0, 0, 0); |
---|
138 | |
---|
139 | INSERT INTO `kb3_dgmtypeattributes` (`typeID`, `attributeID`, `value`) VALUES ('29249', '422', '1'); |
---|
140 | |
---|
141 | UPDATE `kb3_dgmattributetypes` SET `icon` = '50_11' WHERE `attributeID`='180'; |
---|
142 | UPDATE `kb3_dgmattributetypes` SET `icon` = '50_11' WHERE `attributeID`='181'; |
---|
143 | |
---|
144 | UPDATE `kb3_dgmattributetypes` SET `icon` = '50_11' WHERE `attributeID`='182'; |
---|
145 | UPDATE `kb3_dgmattributetypes` SET `icon` = '50_11' WHERE `attributeID`='183'; |
---|
146 | UPDATE `kb3_dgmattributetypes` SET `icon` = '50_11' WHERE `attributeID`='184'; |
---|
147 | |
---|
148 | UPDATE `kb3_dgmattributetypes` SET `icon` = '50_11' WHERE `attributeID`='228'; |
---|
149 | UPDATE `kb3_dgmattributetypes` SET `icon` = '50_11' WHERE `attributeID`='229'; |
---|
150 | UPDATE `kb3_dgmattributetypes` SET `icon` = '50_11' WHERE `attributeID`='230'; |
---|
151 | UPDATE `kb3_dgmattributetypes` SET `icon` = '50_11' WHERE `attributeID`='231'; |
---|
152 | UPDATE `kb3_dgmattributetypes` SET `icon` = '50_11' WHERE `attributeID`='232'; |
---|
153 | |
---|
154 | UPDATE `kb3_dgmattributetypes` SET `icon` = '50_11' WHERE `attributeID`='277'; |
---|
155 | UPDATE `kb3_dgmattributetypes` SET `icon` = '50_11' WHERE `attributeID`='278'; |
---|
156 | UPDATE `kb3_dgmattributetypes` SET `icon` = '50_11' WHERE `attributeID`='279'; |
---|
157 | |
---|
158 | UPDATE `kb3_dgmattributetypes` SET `icon` = '04_12' WHERE `attributeID`='193'; |
---|
159 | UPDATE `kb3_dgmattributetypes` SET `icon` = '04_12' WHERE `attributeID`='235'; |
---|
160 | |
---|
161 | UPDATE `kb3_dgmattributetypes` SET `icon` = '22_14' WHERE `attributeID`='108'; |
---|
162 | UPDATE `kb3_dgmattributetypes` SET `icon` = '22_14' WHERE `attributeID`='197'; |
---|
163 | |
---|
164 | UPDATE `kb3_dgmattributetypes` SET `icon` = '07_15' WHERE `attributeID`='137'; |
---|
165 | |
---|
166 | UPDATE `kb3_dgmattributetypes` SET `icon` = '24_01' WHERE `attributeID`='77'; |
---|
167 | |
---|
168 | UPDATE `kb3_dgmattributetypes` SET `icon` = '22_08' WHERE `attributeID`='153'; |
---|
169 | |
---|
170 | UPDATE `kb3_dgmattributetypes` SET `icon` = '07_15' WHERE `attributeID`='484'; |
---|
171 | EOF; |
---|
172 | |
---|
173 | $qry->execute($query); |
---|
174 | config::set("DBUpdate","005"); |
---|
175 | |
---|
176 | } |
---|
177 | } |
---|
178 | |
---|
179 | function update007() |
---|
180 | { |
---|
181 | //Checking if this Update already done |
---|
182 | if (CURRENT_DB_UPDATE < "007" ) |
---|
183 | { |
---|
184 | $qry = new DBQuery(true); |
---|
185 | // Add columns for external ids. |
---|
186 | $qry->execute("SHOW COLUMNS FROM kb3_alliances LIKE 'all_external_id'"); |
---|
187 | $testresult = $qry->recordCount(); |
---|
188 | if(!$testresult) |
---|
189 | { |
---|
190 | $sql = "ALTER TABLE `kb3_alliances` ". |
---|
191 | "ADD `all_external_id` INT( 11 ) UNSIGNED NULL ". |
---|
192 | "DEFAULT NULL , ADD UNIQUE ( all_external_id )"; |
---|
193 | $qry->execute($sql); |
---|
194 | } |
---|
195 | |
---|
196 | $qry->execute("SHOW COLUMNS FROM kb3_corps LIKE 'crp_external_id'"); |
---|
197 | $testresult = $qry->recordCount(); |
---|
198 | if(!$testresult) |
---|
199 | { |
---|
200 | $sql = "ALTER TABLE `kb3_corps` ". |
---|
201 | "ADD `crp_external_id` INT( 11 ) UNSIGNED NULL ". |
---|
202 | "DEFAULT NULL , ADD UNIQUE ( crp_external_id )"; |
---|
203 | $qry->execute($sql); |
---|
204 | } |
---|
205 | |
---|
206 | /* |
---|
207 | * Needs more code changes first to change |
---|
208 | * plt_externalid == 0 checks to plt_externalid IS NULL |
---|
209 | * |
---|
210 | $sql = " ALTER TABLE `kb3_pilots` CHANGE `plt_externalid` `plt_externalid` INT( 11 ) UNSIGNED NULL DEFAULT NULL "; |
---|
211 | $qry->execute($sql); |
---|
212 | |
---|
213 | // Remove bugged non-unique external ids. |
---|
214 | $sql = "UPDATE kb3_pilots old JOIN ". |
---|
215 | "(SELECT DISTINCT a.plt_id ". |
---|
216 | "FROM kb3_pilots a, kb3_pilots b ". |
---|
217 | "WHERE a.plt_externalid = b.plt_externalid ". |
---|
218 | "AND a.plt_id <> b.plt_id AND a.plt_externalid > 0) new ". |
---|
219 | "ON old.plt_id = new.plt_id SET old.plt_externalid = 0 "; |
---|
220 | $qry->execute($sql); |
---|
221 | |
---|
222 | $sql = "UPDATE kb3_pilots set plt_externalid = NULL WHERE plt_externalid = 0"; |
---|
223 | if( $qry->execute($sql)) |
---|
224 | { |
---|
225 | $qry->execute(" ALTER TABLE `kb3_pilots` ". |
---|
226 | "DROP INDEX `plt_externalid` , ". |
---|
227 | "ADD UNIQUE `plt_externalid` ( `plt_externalid` ) "); |
---|
228 | } |
---|
229 | */ |
---|
230 | $qry->execute("SHOW COLUMNS FROM kb3_kills LIKE 'kll_external_id'"); |
---|
231 | $testresult = $qry->recordCount(); |
---|
232 | if(!$testresult) |
---|
233 | { |
---|
234 | $sql = "ALTER TABLE `kb3_kills` ". |
---|
235 | "ADD `kll_external_id` INT( 11 ) UNSIGNED NULL ". |
---|
236 | "DEFAULT NULL , ADD UNIQUE ( kll_external_id )"; |
---|
237 | $qry->execute($sql); |
---|
238 | } |
---|
239 | // Add isk loss column to kb3_kills |
---|
240 | $sql = "ALTER TABLE `kb3_kills` ADD `kll_isk_loss` FLOAT NOT NULL DEFAULT '0'"; |
---|
241 | $qry->execute($sql); |
---|
242 | // Update price with items destroyed and ship value, excluding |
---|
243 | // blueprints since default cost is for BPO and BPC looks identical |
---|
244 | $sql = "UPDATE kb3_kills |
---|
245 | INNER JOIN kb3_ships ON kb3_ships.shp_id = kll_ship_id |
---|
246 | LEFT JOIN kb3_ships_values ON kb3_ships_values.shp_id = kll_ship_id |
---|
247 | set kll_isk_loss = if(isnull(shp_value),shp_baseprice,shp_value)"; |
---|
248 | $qry->execute($sql); |
---|
249 | $sql = "UPDATE kb3_kills INNER JOIN (SELECT itd_kll_id, |
---|
250 | sum(if(typeName LIKE '%Blueprint%',0,if(isnull(itd_quantity), |
---|
251 | 0,itd_quantity * if(price = 0 OR isnull(price),basePrice,price)))) |
---|
252 | AS killcost |
---|
253 | FROM kb3_items_destroyed |
---|
254 | LEFT JOIN kb3_item_price ON kb3_item_price.typeID = itd_itm_id |
---|
255 | LEFT JOIN kb3_invtypes ON itd_itm_id = kb3_invtypes.typeID |
---|
256 | GROUP BY itd_kll_id) cost on kll_id = itd_kll_id |
---|
257 | SET kll_isk_loss = kll_isk_loss + killcost"; |
---|
258 | $qry->execute($sql); |
---|
259 | if(config::get(kd_droptototal)) |
---|
260 | $sql = "UPDATE kb3_kills INNER JOIN (SELECT itd_kll_id, |
---|
261 | sum(if(typeName LIKE '%Blueprint%',0,if(isnull(itd_quantity), |
---|
262 | 0,itd_quantity * if(price = 0 OR isnull(price),basePrice,price)))) |
---|
263 | AS killcost |
---|
264 | FROM kb3_items_dropped |
---|
265 | LEFT JOIN kb3_item_price ON kb3_item_price.typeID = itd_itm_id |
---|
266 | LEFT JOIN kb3_invtypes ON itd_itm_id = kb3_invtypes.typeID |
---|
267 | GROUP BY itd_kll_id) cost on kll_id = itd_kll_id |
---|
268 | SET kll_isk_loss = kll_isk_loss + killcost"; |
---|
269 | $qry->execute($sql); |
---|
270 | |
---|
271 | $qry->execute("SHOW COLUMNS FROM kb3_kills LIKE 'kll_fb_crp_id'"); |
---|
272 | if($qry->recordCount()) $qry->execute("ALTER TABLE `kb3_kills` DROP `kll_fb_crp_id`"); |
---|
273 | $qry->execute("SHOW COLUMNS FROM kb3_kills LIKE 'kll_fb_all_id'"); |
---|
274 | if($qry->recordCount()) $qry->execute("ALTER TABLE `kb3_kills` DROP `kll_fb_all_id`"); |
---|
275 | // Drop unused columns |
---|
276 | $qry->execute("SHOW COLUMNS FROM kb3_corps LIKE 'crp_trial'"); |
---|
277 | if($qry->recordCount()) $qry->execute("ALTER TABLE kb3_corps DROP crp_trial"); |
---|
278 | $qry->execute("SHOW COLUMNS FROM kb3_pilots LIKE 'plt_killpoints'"); |
---|
279 | if($qry->recordCount()) $qry->execute("ALTER TABLE kb3_pilots DROP plt_killpoints"); |
---|
280 | $qry->execute("SHOW COLUMNS FROM kb3_pilots LIKE 'plt_losspoints'"); |
---|
281 | if($qry->recordCount()) $qry->execute("ALTER TABLE kb3_pilots DROP plt_losspoints"); |
---|
282 | $qry->execute("SHOW INDEX FROM kb3_inv_detail"); |
---|
283 | |
---|
284 | // Add corp and alliance index to kb3_inv_detail |
---|
285 | $indexcexists = false; |
---|
286 | $indexaexists = false; |
---|
287 | while($testresult = $qry->getRow()) |
---|
288 | if($testresult['Column_name'] == 'ind_crp_id') |
---|
289 | $indexcexists = true; |
---|
290 | if($testresult['Column_name'] == 'ind_all_id') |
---|
291 | $indexaexists = true; |
---|
292 | if(!indexcexists) |
---|
293 | $qry->execute("ALTER TABLE `kb3_inv_detail` ADD INDEX ( `ind_crp_id` ) "); |
---|
294 | if(!indexaexists) |
---|
295 | $qry->execute("ALTER TABLE `kb3_inv_detail` ADD INDEX ( `ind_all_id` ) "); |
---|
296 | // Add table for api cache |
---|
297 | $sql = "CREATE TABLE IF NOT EXISTS `kb3_apicache` ( |
---|
298 | `cfg_site` varchar(16) NOT NULL default '', |
---|
299 | `cfg_key` varchar(32) NOT NULL default '', |
---|
300 | `cfg_value` text NOT NULL, |
---|
301 | PRIMARY KEY (`cfg_site`,`cfg_key`) |
---|
302 | )"; |
---|
303 | $qry->execute($sql); |
---|
304 | $qry->execute("CREATE TABLE IF NOT EXISTS `kb3_apilog` ( |
---|
305 | `log_site` VARCHAR( 20 ) NOT NULL , |
---|
306 | `log_keyname` VARCHAR( 20 ) NOT NULL , |
---|
307 | `log_posted` INT NOT NULL , |
---|
308 | `log_errors` INT NOT NULL , |
---|
309 | `log_ignored` INT NOT NULL , |
---|
310 | `log_verified` INT NOT NULL , |
---|
311 | `log_totalmails` INT NOT NULL , |
---|
312 | `log_source` VARCHAR( 20 ) NOT NULL , |
---|
313 | `log_type` VARCHAR( 20 ) NOT NULL , |
---|
314 | `log_timestamp` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' |
---|
315 | ) ENGINE = MYISAM "); |
---|
316 | |
---|
317 | // set update complete |
---|
318 | config::set('API_DBUpdate', '1'); |
---|
319 | |
---|
320 | // Add subsystem slot |
---|
321 | $qry->execute("SELECT 1 FROM kb3_inv_detail WHERE itt_slot = 7"); |
---|
322 | if(!$qry->recordCount()) |
---|
323 | { |
---|
324 | $qry->execute("INSERT INTO `kb3_item_locations` (`itl_id`, `itl_location`) VALUES(7, 'Subsystem Slot')"); |
---|
325 | $qry->execute("UPDATE `kb3_item_types` SET `itt_slot` = '7' WHERE `kb3_item_types`.`itt_id` = 954 LIMIT 1"); |
---|
326 | $qry->execute("UPDATE `kb3_item_types` SET `itt_slot` = '7' WHERE `kb3_item_types`.`itt_id` = 955 LIMIT 1"); |
---|
327 | $qry->execute("UPDATE `kb3_item_types` SET `itt_slot` = '7' WHERE `kb3_item_types`.`itt_id` = 956 LIMIT 1"); |
---|
328 | $qry->execute("UPDATE `kb3_item_types` SET `itt_slot` = '7' WHERE `kb3_item_types`.`itt_id` = 957 LIMIT 1"); |
---|
329 | $qry->execute("UPDATE `kb3_item_types` SET `itt_slot` = '7' WHERE `kb3_item_types`.`itt_id` = 958 LIMIT 1"); |
---|
330 | } |
---|
331 | $qry->execute("TRUNCATE kb3_inv_all"); |
---|
332 | $qry->execute("TRUNCATE kb3_inv_crp"); |
---|
333 | $qry->execute("TRUNCATE kb3_inv_plt"); |
---|
334 | |
---|
335 | config::set("DBUpdate","007"); |
---|
336 | } |
---|
337 | } |
---|
338 | |
---|
339 | function update_slot_of_group($id,$oldSlot = 0 ,$newSlot){ |
---|
340 | $qry = new DBQuery(); |
---|
341 | $query = "UPDATE kb3_item_types |
---|
342 | SET itt_slot = $newSlot WHERE itt_id = $id and itt_slot = $oldSlot;"; |
---|
343 | $qry->execute($query); |
---|
344 | $query = "UPDATE kb3_items_destroyed |
---|
345 | INNER JOIN kb3_invtypes ON groupID = $id AND itd_itm_id = typeID |
---|
346 | SET itd_itl_id = $newSlot |
---|
347 | WHERE itd_itl_id = $oldSlot;"; |
---|
348 | $qry->execute($query); |
---|
349 | |
---|
350 | $query = "UPDATE kb3_items_dropped |
---|
351 | INNER JOIN kb3_invtypes ON groupID = $id AND itd_itm_id = typeID |
---|
352 | SET itd_itl_id = $newSlot |
---|
353 | WHERE itd_itl_id = $oldSlot;"; |
---|
354 | $qry->execute($query); |
---|
355 | } |
---|
356 | |
---|
357 | function move_item_to_group($id,$oldGroup ,$newGroup){ |
---|
358 | $qry = new DBQuery(); |
---|
359 | $query = "UPDATE kb3_invtypes |
---|
360 | SET groupID = $newGroup |
---|
361 | WHERE typeID = $id AND groupID = $oldGroup;"; |
---|
362 | $qry->execute($query); |
---|
363 | } |
---|
364 | |
---|
365 | ?> |
---|