index.php 881 B

123456789101112131415161718192021222324
  1. <?php
  2. if (cfr('SWITCHESEDIT')) {
  3. if (ubRouting::checkGet('switchid')) {
  4. //run replace
  5. if (ubRouting::checkPost(array('switchreplace', 'toswtichreplace', 'replaceemployeeid'))) {
  6. $oldSwitchId = ubRouting::post('switchreplace');
  7. $newSwitchId = ubRouting::post('toswtichreplace');
  8. zb_SwitchReplace($oldSwitchId, $newSwitchId, ubRouting::post('replaceemployeeid'));
  9. ubRouting::nav('?module=switches&edit=' . $newSwitchId);
  10. }
  11. //display form
  12. $switchId = ubRouting::get('switchid', 'int');
  13. $switchData = zb_SwitchGetData($switchId);
  14. show_window(__('Switch replacement') . ': ' . $switchData['location'] . ' - ' . $switchData['ip'], zb_SwitchReplaceForm($switchId));
  15. } else {
  16. show_error(__('Strange exeption'));
  17. }
  18. } else {
  19. show_error(__('Access denied'));
  20. }