From c0f79397dd75e03a7a40303f82926e8187697d07 Mon Sep 17 00:00:00 2001 From: M.Gergo Date: Fri, 8 Mar 2019 23:32:47 +0100 Subject: Rev: 4455 --- .../policy/private/fenntarto/admin/nodes-pre.php | 69 ++++++++++++++++++++++ .../www/policy/private/fenntarto/admin/nodes.php | 9 +++ .../fenntarto/naplo/tantargyfelosztas-pre.php | 65 ++++++++++++++++++++ .../private/fenntarto/naplo/tantargyfelosztas.php | 11 ++++ 4 files changed, 154 insertions(+) create mode 100644 mayor-orig/mayor-fenntarto/www/policy/private/fenntarto/admin/nodes-pre.php create mode 100644 mayor-orig/mayor-fenntarto/www/policy/private/fenntarto/admin/nodes.php create mode 100644 mayor-orig/mayor-fenntarto/www/policy/private/fenntarto/naplo/tantargyfelosztas-pre.php create mode 100644 mayor-orig/mayor-fenntarto/www/policy/private/fenntarto/naplo/tantargyfelosztas.php (limited to 'mayor-orig/mayor-fenntarto/www/policy/private') diff --git a/mayor-orig/mayor-fenntarto/www/policy/private/fenntarto/admin/nodes-pre.php b/mayor-orig/mayor-fenntarto/www/policy/private/fenntarto/admin/nodes-pre.php new file mode 100644 index 00000000..9e93b4b1 --- /dev/null +++ b/mayor-orig/mayor-fenntarto/www/policy/private/fenntarto/admin/nodes-pre.php @@ -0,0 +1,69 @@ +getPublicKey(); + $ADAT['my']['nodeId'] = $RPC->getNodeId(); + + if ($action == 'addNode') { + + $DATA['userAccount'] = _USERACCOUNT; + $DATA['nodeId'] = readVariable($_POST['nodeId'], 'id'); + $DATA['OMKod'] = readVariable($_POST['OMKod'], 'numeric unsigned'); + + addNodeToRPCRequs($DATA); + $ADAT['requ'] = getRPCRequests(_USERACCOUNT); + + } elseif ($action == 'setRequ') { + + $DATA['userAccount'] = _USERACCOUNT; + $DATA['nodeId'] = readVariable($_POST['nodeId'], 'id'); + $DATA['OMKod'] = readVariable($_POST['OMKod'], 'numeric unsigned'); + $DATA['requ'] = readVariable($_POST['requ'], 'enum', 'OMKod', $ADAT['requests']); + + setRequests($DATA); + $ADAT['requ'] = getRPCRequests(_USERACCOUNT); + + } elseif ($action == 'delRequ') { + + $DATA['userAccount'] = _USERACCOUNT; + $DATA['nodeId'] = readVariable($_POST['nodeId'], 'id'); + $DATA['OMKod'] = readVariable($_POST['OMKod'], 'numeric unsigned'); + + delNodeFromRPCRequs($DATA); + $ADAT['requ'] = getRPCRequests(_USERACCOUNT); + + } elseif ($action == 'checkJogosultsag') { + + // honnan + $DATA['nodeId'] = $ADAT['my']['nodeId']; + $DATA['userAccount'] = _USERACCOUNT; + // hova + $remoteNodeId = readVariable($_POST['nodeId'], 'id'); + $RPC->setRemoteHostByNodeId($remoteNodeId); + $DATA['OMKod'] = readVariable($_POST['OMKod'], 'numeric unsigned'); + // mit + $DATA['func'] = 'getPrivilegeInfo'; + + $RPC->setRequestTarget('naplo'); + $ADAT['rpcResult'] = $RPC->sendRequest($DATA); + if (is_array($ADAT['rpcResult']['alert'])) foreach ($ADAT['rpcResult']['alert'] as $alert) $_SESSION['alert'][] = $alert; + elseif (isset($ADAT['rpcResult']['alert'])) $_SESSION['alert'][] = $ADAT['rpcResult']['alert']; + if (is_array($ADAT['rpcResult']['priv'])) $ADAT['nodes'][ $RPC->getRemoteNodeId() ][0]['priv'] = $ADAT['rpcResult']['priv']; + //dump($ADAT['rpcResult']); + + } + + +?> \ No newline at end of file diff --git a/mayor-orig/mayor-fenntarto/www/policy/private/fenntarto/admin/nodes.php b/mayor-orig/mayor-fenntarto/www/policy/private/fenntarto/admin/nodes.php new file mode 100644 index 00000000..c01ea6f5 --- /dev/null +++ b/mayor-orig/mayor-fenntarto/www/policy/private/fenntarto/admin/nodes.php @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/mayor-orig/mayor-fenntarto/www/policy/private/fenntarto/naplo/tantargyfelosztas-pre.php b/mayor-orig/mayor-fenntarto/www/policy/private/fenntarto/naplo/tantargyfelosztas-pre.php new file mode 100644 index 00000000..5ae7643c --- /dev/null +++ b/mayor-orig/mayor-fenntarto/www/policy/private/fenntarto/naplo/tantargyfelosztas-pre.php @@ -0,0 +1,65 @@ +getPublicKey(); + $ADAT['my']['nodeId'] = $RPC->getNodeId(); + + $tanev = $ADAT['tanev'] = readVariable($_POST['tanev'], 'numeric unsigned'); + $ADAT['show'] = $req = readVariable($_POST['req'], 'string', null); + // Kívánt tantárgyfelosztást adó node-ok lekérdezése + $ADAT['requs'] = getRPCRequests(_USERACCOUNT, 'Tantárgyfelosztás'); + foreach ($ADAT['requs'] as $index => $rAdat) { + $nAdat = getPublicDataFromLocalKeychain($rAdat['nodeId']); + $ADAT['requs'][$index]['nev'] = $nAdat['nev']; + } + + if (isset($tanev)) { + + // Ezek jobb lenne, ha RPC-ből jönnének??? + // Most két helyen javíandó, ha változik (naplo/include/tantargyfelosztas) + $ADAT['evfolyamJelek'] = getEvfolyamJelek(array('result'=>'idonly')); + $ADAT['finanszírozott pedagógus létszám'] = array( + 'általános iskola' => 11.8, // 11.8 tanuló / 1 pedagógus + 'gimnázium' => 12.5, // 12.5 tanuló / 1 pedagógus + 'szakiskola, Híd programok' => 12, // ... + 'szakközépiskola, nem szakkképző évfolyam' => 12.4, + 'szakközépiskola, szakkképző évfolyam' => 13.7 + ); // -- TODO szakgimnázium??? + + + + if (is_array($ADAT['requs'])) foreach ($ADAT['requs'] as $rAdat) { + if (!in_array($rAdat['nodeId'].'/'.$rAdat['OMKod'], $req)) continue; + // honnan + $DATA['nodeId'] = $ADAT['my']['nodeId']; + $DATA['userAccount'] = _USERACCOUNT; + // hova + $RPC->setRemoteHostByNodeId($rAdat['nodeId']); + $DATA['OMKod'] = $rAdat['OMKod']; + // mit + $DATA['func'] = 'getTantargyfelosztasStat'; + $DATA['tanev'] = $tanev; + + $RPC->setRequestTarget('naplo'); + $ADAT['rpcResult'] = $RPC->sendRequest($DATA); + // alert + if (is_array($ADAT['rpcResult']['alert'])) foreach ($ADAT['rpcResult']['alert'] as $alert) $_SESSION['alert'][] = $alert; + elseif (isset($ADAT['rpcResult']['alert'])) $_SESSION['alert'][] = $ADAT['rpcResult']['alert']; + + $ADAT['intezmeny'][] = $ADAT['rpcResult']['IA']; + //dump($ADAT['rpcResult']); + } + } + } +?> \ No newline at end of file diff --git a/mayor-orig/mayor-fenntarto/www/policy/private/fenntarto/naplo/tantargyfelosztas.php b/mayor-orig/mayor-fenntarto/www/policy/private/fenntarto/naplo/tantargyfelosztas.php new file mode 100644 index 00000000..168366af --- /dev/null +++ b/mayor-orig/mayor-fenntarto/www/policy/private/fenntarto/naplo/tantargyfelosztas.php @@ -0,0 +1,11 @@ +0) putStat($ADAT); + + +?> \ No newline at end of file -- cgit v1.2.3