. * --------------------------------------------------------------------- */ $AJAX_INCLUDE = 1; include ('../inc/includes.php'); header("Content-Type: text/html; charset=UTF-8"); Html::header_nocache(); Session::checkLoginUser(); if (isset($_REQUEST['action'])) { $answer = []; switch ($_REQUEST['action']) { case 'move_item': $item_rack = new Item_Rack; $item_rack->getFromDB((int) $_POST['id']); $answer['status'] = $item_rack->update([ 'id' => (int) $_POST['id'], 'position' => (int) $_POST['position'], 'hpos' => (int) $_POST['hpos'], ]); break; case 'move_pdu': $pdu_rack = new PDU_Rack; $pdu_rack->getFromDB((int) $_POST['id']); $answer['status'] = $pdu_rack->update([ 'id' => (int) $_POST['id'], 'position' => (int) $_POST['position'] ]); break; case 'move_rack': $rack = new Rack; $rack->getFromDB((int) $_POST['id']); $answer['status'] = $rack->update([ 'id' => (int) $_POST['id'], 'dcrooms_id' => (int) $_POST['dcrooms_id'], 'position' => (int) $_POST['x'].",".(int) $_POST['y'], ]); break; case 'show_pdu_form': PDU_Rack::showFirstForm((int) $_REQUEST['racks_id']); exit; } echo json_encode($answer); }