Changeset 176 for dev/common/admin_sync.php
- Timestamp:
- 01/12/07 17:06:34 (14 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
dev/common/admin_sync.php
r162 r176 16 16 { 17 17 $html .= "Could not connect to Server:<br/>\n"; 18 $html .= $http- getError();18 $html .= $http->getError(); 19 19 20 20 $page->addContext($menubox->generate()); … … 79 79 unset($data); 80 80 $results = count($matches[1]); 81 if (isset($_REQUEST['itm_overwrite'])) 82 { 83 $add_qrystr = ''; 84 } 85 else 86 { 87 $add_qrystr = ' AND itm_value=0'; 88 } 89 81 90 for ($i = 0; $i<$results; $i++) 82 91 { 83 $update->execute("update kb3_items set itm_externalid='".addslashes($matches[2][$i])."', itm_value='".addslashes($matches[3][$i])."' where itm_name='".addslashes($matches[1][$i])."' limit 1");92 $update->execute("update kb3_items set itm_externalid='".addslashes($matches[2][$i])."', itm_value='".addslashes($matches[3][$i])."' where itm_name='".addslashes($matches[1][$i])."'".$add_qrystr." limit 1"); 84 93 } 85 94 if ($results == 0) … … 129 138 $html .= "<tr><td width=120><b>Update item values</b></td><td><input type=checkbox name=itm_update id=itm_update"; 130 139 $html .= " checked=\"checked\"></td></tr>"; 140 $html .= "<tr><td width=120><b>Overwrite local values</b></td><td><input type=checkbox name=itm_overwrite id=itm_overwrite"; 141 $html .= " checked=\"checked\">(If disabled only values with 0 will be overwritten)</td></tr>"; 131 142 $html .= '<input type="hidden" name="do" value="sync">'; 132 143 $html .= '<tr><td width=120></td><td><input type=submit name=submit value="Synchronize now"></td></tr></table></form>';