{"id":868,"date":"2026-02-20T06:25:52","date_gmt":"2026-02-20T06:25:52","guid":{"rendered":"https:\/\/fti.gunadarma.ac.id\/elektro\/?page_id=868"},"modified":"2026-09-22T05:08:54","modified_gmt":"2026-09-22T05:08:54","slug":"rps","status":"publish","type":"page","link":"https:\/\/fti.gunadarma.ac.id\/elektro\/rps\/","title":{"rendered":"RPS"},"content":{"rendered":"<!--themify_builder_content-->\n<div id=\"themify_builder_content-868\" data-postid=\"868\" class=\"themify_builder_content themify_builder_content-868 themify_builder tf_clear\">\n                    <div  data-lazy=\"1\" class=\"module_row themify_builder_row tb_o913655 tb_first tf_w\">\n                        <div class=\"row_inner col_align_top tb_col_count_1 tf_box tf_rel\">\n                        <div  data-lazy=\"1\" class=\"module_column tb-column col-full tb_xgzz657 first\">\n                    <!-- module plain text -->\n<div  class=\"module module-plain-text tb_al2l143 \" data-lazy=\"1\">\n        <div class=\"tb_text_wrap\">\n    <!-- =========================================================\n     DAFTAR MATA KULIAH DAN RPS\n     Sumber data: Google Spreadsheet\n     Google Spreadsheet ID:\n     1HIcR7Pbj9nPx04hpvuoiudMWT8NQHYW0\n     ========================================================= -->\n\n<!-- SheetJS untuk membaca file Excel hasil export Google Spreadsheet -->\n<script src=\"https:\/\/cdn.jsdelivr.net\/npm\/xlsx@0.18.5\/dist\/xlsx.full.min.js\"><\/script>\n\n\n\n\n<div class=\"rps-container\">\n\n    <!-- =====================================================\n         JUDUL\n         ===================================================== -->\n    <div class=\"rps-title\">\n        DAFTAR MATA KULIAH DAN RPS \n\t\n    <\/div>\n\n\n    <!-- =====================================================\n         SEARCH\n         ===================================================== -->\n    <div class=\"rps-search-wrapper\"><input type=\"text\" id=\"rpsSearch\" class=\"rps-search\" placeholder=\"Cari mata kuliah...\" autocomplete=\"off\">\n\n    <\/div>\n\n\n    <!-- =====================================================\n         STATUS \/ TABLE\n         ===================================================== -->\n    <div id=\"rpsStatus\" class=\"rps-status rps-loading\">\n        <span class=\"rps-spinner\"><\/span>\n        Sedang mengambil data&#8230;\n    <\/div>\n\n\n    <div id=\"rpsTableContainer\" class=\"rps-table-wrapper\" style=\"display:none;\">\n\n        <table class=\"rps-table\">\n\n            <thead>\n                <tr>\n                    <th class=\"rps-no\">No<\/th>\n                    <th class=\"rps-semester\">Semester<\/th>\n                    <th class=\"rps-kode\">Kode<\/th>\n                    <th>Nama Mata Kuliah<\/th>\n                    <th class=\"rps-sks\">SKS<\/th>\n                    <th class=\"rps-link\">RPS<\/th>\n                <\/tr>\n            <\/thead>\n\n            <tbody id=\"rpsTableBody\">\n            <\/tbody>\n\n        <\/table>\n\n    <\/div>\n\n\n    <div id=\"rpsTotal\" class=\"rps-total\" style=\"display:none;\">\n    <\/div>\n\n<\/div>\n\n\n<script>\n(function () {\n\n    \"use strict\";\n\n    \/* =====================================================\n       KONFIGURASI GOOGLE SPREADSHEET\n       ===================================================== *\/\n\n    const SPREADSHEET_ID =\n        \"1HIcR7Pbj9nPx04hpvuoiudMWT8NQHYW0\";\n\n    \/*\n     * Google Spreadsheet diambil sebagai file XLSX.\n     *\n     * Tidak perlu mengubah URL ini.\n     *\/\n    const EXCEL_URL =\n        \"https:\/\/docs.google.com\/spreadsheets\/d\/\" +\n        SPREADSHEET_ID +\n        \"\/export?format=xlsx\";\n\n\n    \/* =====================================================\n       ELEMENT\n       ===================================================== *\/\n\n    const statusElement =\n        document.getElementById(\"rpsStatus\");\n\n    const tableContainer =\n        document.getElementById(\"rpsTableContainer\");\n\n    const tableBody =\n        document.getElementById(\"rpsTableBody\");\n\n    const searchInput =\n        document.getElementById(\"rpsSearch\");\n\n    const totalElement =\n        document.getElementById(\"rpsTotal\");\n\n\n    \/* =====================================================\n       DATA GLOBAL\n       ===================================================== *\/\n\n    let rpsData = [];\n\n\n    \/* =====================================================\n       NORMALISASI NAMA KOLOM\n       ===================================================== *\/\n\n    function normalizeHeader(value) {\n\n        return String(value || \"\")\n            .trim()\n            .toLowerCase()\n            .replace(\/\\s+\/g, \" \")\n            .replace(\/[_-]\/g, \" \");\n\n    }\n\n\n    \/* =====================================================\n       MENCARI NILAI KOLOM\n       ===================================================== *\/\n\n    function getColumn(row, possibleNames) {\n\n        const keys = Object.keys(row);\n\n        for (let i = 0; i < possibleNames.length; i++) {\n\n            const target =\n                normalizeHeader(possibleNames[i]);\n\n            for (let j = 0; j < keys.length; j++) {\n\n                if (\n                    normalizeHeader(keys[j]) === target\n                ) {\n                    return row[keys[j]];\n                }\n\n            }\n\n        }\n\n        return \"\";\n\n    }\n\n\n    \/* =====================================================\n       MEMBERSIHKAN NILAI\n       ===================================================== *\/\n\n    function cleanValue(value) {\n\n        if (\n            value === null ||\n            value === undefined\n        ) {\n            return \"\";\n        }\n\n        return String(value).trim();\n\n    }\n\n\n    \/* =====================================================\n       VALIDASI URL\n       ===================================================== *\/\n\n    function isValidUrl(value) {\n\n        if (!value) {\n            return false;\n        }\n\n        try {\n\n            const url =\n                new URL(String(value).trim());\n\n            return (\n                url.protocol === \"http:\" ||\n                url.protocol === \"https:\"\n            );\n\n        } catch (error) {\n\n            return false;\n\n        }\n\n    }\n\n\n    \/* =====================================================\n       MEMBUAT LINK RPS\n       ===================================================== *\/\n\n    function createRpsLink(value) {\n\n        const url = cleanValue(value);\n\n        if (!url) {\n\n            return `\n                <span style=\"color:#999;\">\n                    -\n                <\/span>\n            `;\n\n        }\n\n\n        \/*\n         * Jika yang disimpan di spreadsheet adalah URL lengkap.\n         *\/\n        if (isValidUrl(url)) {\n\n            return `\n                <a\n                    href=\"${escapeAttribute(url)}\"\n                    target=\"_blank\"\n                    rel=\"noopener noreferrer\"\n                    class=\"rps-button\"\n                >\n                    \ud83d\udcc4 RPS\n                <\/a>\n            `;\n\n        }\n\n\n        \/*\n         * Jika bukan URL valid, tampilkan teksnya.\n         *\/\n        return `\n            <span style=\"color:#777;\">\n                ${escapeHtml(url)}\n            <\/span>\n        `;\n\n    }\n\n\n    \/* =====================================================\n       ESCAPE HTML\n       ===================================================== *\/\n\n    function escapeHtml(value) {\n\n        return String(value)\n            .replace(\/&\/g, \"&amp;\")\n            .replace(\/<\/g, \"&lt;\")\n            .replace(\/>\/g, \"&gt;\")\n            .replace(\/\"\/g, \"&quot;\")\n            .replace(\/'\/g, \"&#039;\");\n\n    }\n\n\n    \/* =====================================================\n       ESCAPE ATTRIBUTE\n       ===================================================== *\/\n\n    function escapeAttribute(value) {\n\n        return escapeHtml(value);\n\n    }\n\n\n    \/* =====================================================\n       RENDER TABLE\n       ===================================================== *\/\n\n    function renderTable(data) {\n\n        tableBody.innerHTML = \"\";\n\n        if (!data || data.length === 0) {\n\n            tableContainer.style.display = \"block\";\n\n            tableBody.innerHTML = `\n                <tr>\n                    <td\n                        colspan=\"6\"\n                        class=\"rps-empty\"\n                        style=\"text-align:center;padding:30px;\"\n                    >\n                        Data tidak ditemukan.\n                    <\/td>\n                <\/tr>\n            `;\n\n            totalElement.style.display = \"none\";\n\n            return;\n\n        }\n\n\n        data.forEach(function (row, index) {\n\n            \/* =============================================\n               AMBIL DATA BERDASARKAN HEADER\n               ============================================= *\/\n\n            let no = getColumn(\n                row,\n                [\n                    \"No\",\n                    \"Nomor\",\n                    \"No.\"\n                ]\n            );\n\n            let semester = getColumn(\n                row,\n                [\n                    \"Semester\",\n                    \"Sem\"\n                ]\n            );\n\n            let kode = getColumn(\n                row,\n                [\n                    \"Kode\",\n                    \"Kode MK\",\n                    \"Kode Mata Kuliah\",\n                    \"Kode MK.\"\n                ]\n            );\n\n            let nama = getColumn(\n                row,\n                [\n                    \"Nama Mata Kuliah\",\n                    \"Mata Kuliah\",\n                    \"Nama MK\",\n                    \"Nama Mata Kuliah \"\n                ]\n            );\n\n            let sks = getColumn(\n                row,\n                [\n                    \"SKS\",\n                    \"Sks\",\n                    \"Satuan Kredit Semester\"\n                ]\n            );\n\n            let rps = getColumn(\n                row,\n                [\n                    \"RPS\",\n                    \"Link RPS\",\n                    \"URL RPS\",\n                    \"Link\",\n                    \"URL\"\n                ]\n            );\n\n\n            \/* =============================================\n               NOMOR OTOMATIS JIKA KOLOM NO KOSONG\n               ============================================= *\/\n\n            if (!cleanValue(no)) {\n                no = index + 1;\n            }\n\n\n            \/* =============================================\n               BUAT BARIS\n               ============================================= *\/\n\n            const tr =\n                document.createElement(\"tr\");\n\n\n            tr.innerHTML = `\n\n                <td class=\"rps-no\">\n                    ${escapeHtml(no)}\n                <\/td>\n\n                <td class=\"rps-semester\">\n                    ${escapeHtml(semester)}\n                <\/td>\n\n                <td class=\"rps-kode\">\n                    ${escapeHtml(kode)}\n                <\/td>\n\n                <td class=\"rps-nama\">\n                    ${escapeHtml(nama)}\n                <\/td>\n\n                <td class=\"rps-sks\">\n                    ${escapeHtml(sks)}\n                <\/td>\n\n                <td class=\"rps-link\">\n                    ${createRpsLink(rps)}\n                <\/td>\n\n            `;\n\n\n            tableBody.appendChild(tr);\n\n        });\n\n\n        tableContainer.style.display = \"block\";\n\n        totalElement.style.display = \"block\";\n\n        totalElement.innerHTML =\n            \"Menampilkan <strong>\" +\n            data.length +\n            \"<\/strong> mata kuliah.\";\n\n    }\n\n\n    \/* =====================================================\n       LOAD GOOGLE SPREADSHEET\n       ===================================================== *\/\n\n    async function loadExcelData() {\n\n        try {\n\n            statusElement.style.display = \"block\";\n\n            statusElement.className =\n                \"rps-status rps-loading\";\n\n            statusElement.innerHTML = `\n                <span class=\"rps-spinner\"><\/span>\n                Sedang mengambil data dari Google Spreadsheet...\n            `;\n\n\n            \/*\n             * Ambil file Excel dari Google Spreadsheet.\n             *\/\n            const response =\n                await fetch(EXCEL_URL, {\n                    method: \"GET\",\n                    cache: \"no-store\"\n                });\n\n\n            if (!response.ok) {\n\n                throw new Error(\n                    \"HTTP \" + response.status\n                );\n\n            }\n\n\n            \/*\n             * Konversi response menjadi ArrayBuffer.\n             *\/\n            const arrayBuffer =\n                await response.arrayBuffer();\n\n\n            if (!arrayBuffer ||\n                arrayBuffer.byteLength === 0) {\n\n                throw new Error(\n                    \"File spreadsheet kosong.\"\n                );\n\n            }\n\n\n            \/* =============================================\n               BACA EXCEL DENGAN SHEETJS\n               ============================================= *\/\n\n            const workbook =\n                XLSX.read(\n                    arrayBuffer,\n                    {\n                        type: \"array\"\n                    }\n                );\n\n\n            if (\n                !workbook.SheetNames ||\n                workbook.SheetNames.length === 0\n            ) {\n\n                throw new Error(\n                    \"Worksheet tidak ditemukan.\"\n                );\n\n            }\n\n\n            \/*\n             * Menggunakan worksheet pertama.\n             *\/\n            const sheetName =\n                workbook.SheetNames[0];\n\n            const worksheet =\n                workbook.Sheets[sheetName];\n\n\n            \/*\n             * Konversi worksheet menjadi JSON.\n             *\/\n            const data =\n                XLSX.utils.sheet_to_json(\n                    worksheet,\n                    {\n                        defval: \"\",\n                        raw: false\n                    }\n                );\n\n\n            console.log(\n                \"Worksheet:\",\n                sheetName\n            );\n\n            console.log(\n                \"Data:\",\n                data\n            );\n\n\n            \/* =============================================\n               SIMPAN DATA\n               ============================================= *\/\n\n            rpsData = data;\n\n\n            \/* =============================================\n               TAMPILKAN DATA\n               ============================================= *\/\n\n            renderTable(rpsData);\n\n\n            statusElement.style.display = \"none\";\n\n\n        } catch (error) {\n\n            console.error(\n                \"Error membaca Google Spreadsheet:\",\n                error\n            );\n\n\n            tableContainer.style.display = \"none\";\n\n            totalElement.style.display = \"none\";\n\n\n            statusElement.className =\n                \"rps-status rps-error\";\n\n            statusElement.innerHTML = `\n                <strong>\n                    \u26a0 Data tidak dapat dimuat.\n                <\/strong>\n\n                <br><br>\n\n                Pastikan Google Spreadsheet dapat\n                diakses oleh publik atau sudah diatur\n                agar dapat dilihat oleh pengguna yang\n                memiliki link.\n\n                <br><br>\n\n                <small>\n                    Detail error:\n                    ${escapeHtml(error.message)}\n                <\/small>\n            `;\n\n        }\n\n    }\n\n\n    \/* =====================================================\n       SEARCH \/ FILTER\n       ===================================================== *\/\n\n    searchInput.addEventListener(\n        \"input\",\n        function () {\n\n            const keyword =\n                this.value\n                    .toLowerCase()\n                    .trim();\n\n\n            if (!keyword) {\n\n                renderTable(rpsData);\n\n                return;\n\n            }\n\n\n            const filtered =\n                rpsData.filter(function (row) {\n\n                    return Object\n                        .values(row)\n                        .join(\" \")\n                        .toLowerCase()\n                        .includes(keyword);\n\n                });\n\n\n            renderTable(filtered);\n\n        }\n    );\n\n\n    \/* =====================================================\n       JALANKAN PROGRAM\n       ===================================================== *\/\n\n    loadExcelData();\n\n\n})();\n<\/script>\n&#8220;`\n    <\/div>\n<\/div>\n<!-- \/module plain text -->        <\/div>\n                        <\/div>\n        <\/div>\n        <\/div>\n<!--\/themify_builder_content-->","protected":false},"excerpt":{"rendered":"","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-868","page","type-page","status-publish","hentry","has-post-title","has-post-date","has-post-category","has-post-tag","has-post-comment","has-post-author",""],"builder_content":"DAFTAR MATA KULIAH DAN RPS \n <input type=\"text\" id=\"rpsSearch\" placeholder=\"Cari mata kuliah...\" autocomplete=\"off\">\n \n Sedang mengambil data... \n \n <table>\n <thead> <tr> <th>No<\/th> <th>Semester<\/th> <th>Kode<\/th> <th>Nama Mata Kuliah<\/th> <th>SKS<\/th> <th>RPS<\/th> <\/tr> <\/thead>\n <tbody id=\"rpsTableBody\"> <\/tbody>\n <\/table>\n \n \n```","_links":{"self":[{"href":"https:\/\/fti.gunadarma.ac.id\/elektro\/wp-json\/wp\/v2\/pages\/868","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fti.gunadarma.ac.id\/elektro\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/fti.gunadarma.ac.id\/elektro\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/fti.gunadarma.ac.id\/elektro\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/fti.gunadarma.ac.id\/elektro\/wp-json\/wp\/v2\/comments?post=868"}],"version-history":[{"count":46,"href":"https:\/\/fti.gunadarma.ac.id\/elektro\/wp-json\/wp\/v2\/pages\/868\/revisions"}],"predecessor-version":[{"id":1676,"href":"https:\/\/fti.gunadarma.ac.id\/elektro\/wp-json\/wp\/v2\/pages\/868\/revisions\/1676"}],"wp:attachment":[{"href":"https:\/\/fti.gunadarma.ac.id\/elektro\/wp-json\/wp\/v2\/media?parent=868"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}