Exemplo n.º 1
0
		';
        break;
    case 'update':
        if (isset($_GET['id'])) {
            $id = $_GET['id'];
        } elseif (isset($_POST['id'])) {
            $id = $_POST['id'];
        } else {
            // TODO ERROR
        }
        if (!isset($_POST['parameterValue'])) {
            // Todo error
            echo 'erreur value';
        } else {
            $paramM = new parameterManager();
            $paramM->update($id, $_POST['parameterValue']);
            // TODO
            echo 'Le paramètre vient d\'être modifié!';
            echo '<script type="text/javascript">dataTable.ajax.reload();</script>';
        }
        break;
        // Display the table content
    // Display the table content
    case 'jsonList':
        $dataArray['data'] = array();
        $q0 = get_link()->prepare("SELECT \n\t\t\t\t\t\t\t\t\tparam.id AS ID,\n\t\t\t\t\t\t\t\t\tparam.id_plugin AS ID_PLUGIN,\n\t\t\t\t\t\t\t\t\tparam.name AS NAME,\n\t\t\t\t\t\t\t\t\tpg.name AS PLUGINNAME,\n\t\t\t\t\t\t\t\t\tparam.parameter_value AS PARAMETER_VALUE,\n\t\t\t\t\t\t\t\t\tparam.default_value AS DEFAULT_VALUE,\n\t\t\t\t\t\t\t\t\tparam.created_date AS CREATED_DATE,\n\t\t\t\t\t\t\t\t\tparam.created_id AS CREATED_ID,\n\t\t\t\t\t\t\t\t\tparam.edited_date AS EDITED_DATE,\n\t\t\t\t\t\t\t\t\tparam.edited_id AS EDITED_ID,\n\t\t\t\t\t\t\t\t\tparam.deleted_date AS DELETED_DATE,\n\t\t\t\t\t\t\t\t\tparam.deleted_id AS DELETED_ID\n\t\t\t\t\t\t\t\tFROM \n\t\t\t\t\t\t\t\t" . get_ini('BDD_PREFIX') . "core_parameters param ,\n\t\t\t\t\t\t\t\t" . get_ini('BDD_PREFIX') . "core_plugins pg\n\t\t\t\t\t\t\t\tWHERE \n\t\t\t\t\t\t\t\tparam.id_plugin=pg.id\n\t\t\t\t\t\t\t\tORDER BY pg.name ASC,param.name ASC");
        $q0->execute();
        while ($r0 = $q0->fetch(PDO::FETCH_OBJ)) {
            array_push($dataArray['data'], array("ID" => $r0->ID, "PLUGINNAME" => $r0->PLUGINNAME, "NAME" => $r0->NAME, "PARAMETER_VALUE" => $r0->PARAMETER_VALUE, "DEFAULT_VALUE" => $r0->DEFAULT_VALUE, "ACTION" => '<a href="#" data-toggle="modal" data-target="#popup" onClick="insertLoader(\'#popupContent\');setPopupTitle(\'Modifier le paramètre\');$(\'#popupContent\').load(\'index.php?m=a&g=core&p=admin_parameters&a=update_form&id=' . $r0->ID . '\');"><span class="iconastic-edit-write"> Modifier </span></a>'));
        }
        $q0->closeCursor();