{"id":2326,"date":"2020-11-27T11:46:54","date_gmt":"2020-11-27T10:46:54","guid":{"rendered":"http:\/\/localhost\/bdl\/?page_id=2326"},"modified":"2024-10-05T12:20:27","modified_gmt":"2024-10-05T12:20:27","slug":"simulateur-immobilier-2","status":"publish","type":"page","link":"https:\/\/www.bdl.dz\/ar\/simulateur-immobilier-2\/","title":{"rendered":"Simulateur Immobilier 2"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"2326\" class=\"elementor elementor-2326\">\n\t\t\t\t        <section class=\"elementor-section elementor-top-section elementor-element elementor-element-bc1ddcc elementor-section-boxed elementor-section-height-default elementor-section-height-default exad-glass-effect-no wpr-particle-no wpr-jarallax-no wpr-parallax-no wpr-sticky-section-no wpr-equal-height-no exad-sticky-section-no\" data-id=\"bc1ddcc\" data-element_type=\"section\" data-e-type=\"section\">\n            \n                        <div class=\"elementor-container elementor-column-gap-default \">\n                    <div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-2fb9597 exad-glass-effect-no exad-sticky-section-no\" data-id=\"2fb9597\" data-element_type=\"column\" data-e-type=\"column\">\n        <div class=\"elementor-widget-wrap elementor-element-populated\">\n                    \n        \t\t<div class=\"elementor-element elementor-element-8afd0c3 exad-sticky-section-no exad-glass-effect-no elementor-widget elementor-widget-text-editor\" data-id=\"8afd0c3\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<!DOCTYPE html>\n<html lang=\"ar\">\n<head>\n    <meta charset=\"UTF-8\" \/>\n    <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\" \/>\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" \/>\n    <script src=\"https:\/\/unpkg.com\/pdf-lib\"><\/script>\n    <script src=\"https:\/\/unpkg.com\/fontkit@1.8.1\/dist\/fontkit.js\"><\/script>\n    <style type=\"text\/css\">\n        .cancel {\n            position: absolute;\n            width: 30px;\n            height: 30px;\n            background: #fff;\n            border-radius: 100%;\n            display: flex;\n            align-items: center;\n            justify-content: center;\n            top: 0;\n            right: -35px;\n            border: 0;\n            cursor: pointer;\n            padding: 0;\n        }\n\n        .preview {\n            position: fixed;\n            top: 0;\n            left: 0;\n            width: 100vw;\n            height: 100vh;\n            display: none;\n            justify-content: center;\n            padding: 2rem;\n            box-sizing: border-box;\n            background-color: #0000005d;\n            overflow-y: auto;\n            z-index: 999;\n        }\n\n        .preview-container {\n            width: 600px;\n            height: 800px;\n            background-color: white;\n            border-radius: 10px;\n            padding: 1rem;\n            position: relative;\n        }\n\n        #section-to-print {\n            display: none;\n            width: 100%;\n            height: 1122px;\n            justify-items: center;\n            font-family: 'Amiri', serif;\n        }\n\n        .image {\n            text-align: center;\n            margin-bottom: 60px;\n        }\n\n        .paragraph {\n            margin-block: 35px;\n            font-style: normal;\n            color: black;\n            text-align: right;\n            font-size: 1.1em;\n        }\n\n        @media print {\n            html, body {\n                height: 100vh;\n                margin: 0 !important;\n                padding: 0 !important;\n                overflow: hidden !important;\n            }\n            div {\n                visibility: hidden;\n            }\n            #section-to-print {\n                display: grid;\n                font-style: normal;\n                position: fixed;\n                right: 0;\n                top: 0;\n            }\n            .vis {\n                visibility: visible;\n            }\n        }\n    <\/style>\n    <title>Simulation mourabaha vehicule<\/title>\n<\/head>\n<body>\n<div class=\"container\">\n    <div class=\"form\" style=\"display: flex; flex-direction: column; gap: 2rem; width: 60%; margin: auto;\">\n        <div class=\"title\"><\/div>\n        <div class=\"form-grid\" style=\"display: flex; flex-direction: column; gap: 1rem\">\n            <div class=\"form-input\">\n                <label style=\"font-weight: bold; text-align: right\">\u0646\u0648\u0639 \u0627\u0644\u0627\u0626\u062a\u0645\u0627\u0646<\/label>\n                <select type=\"option\" id=\"type_credit\">\n                    <option value=\"1\">\u0634\u0631\u0627\u0621 \u0645\u0646  \u0645\u0642\u0627\u0648\u0644<\/option>\n                    <option value=\"2\">\u0634\u0631\u0627\u0621 \u0645\u0646 \u0641\u0631\u062f<\/option>\n                    <option value=\"3\">\u0634\u0631\u0627\u0621 \u0639\u0644\u0649 \u062e\u0631\u064a\u0637\u0629<\/option>\n                    <option value=\"4\">\u0634\u0631\u0627\u0621 VSP \/ LSP<\/option>\n                    <option value=\"5\">\u0634\u0631\u0627\u0621 \u0641\u064a \u062a\u0639\u0627\u0648\u0646\u064a\u0629 \u0639\u0642\u0627\u0631\u064a\u0629<\/option>\n                    <option value=\"6\">\u0627\u0644\u0628\u0646\u0627\u0621 \u0627\u0644\u0630\u0627\u062a\u064a<\/option>\n                    <option value=\"7\">\u0627\u0644\u062a\u0646\u0645\u064a\u0629<\/option>\n                    <option value=\"8\">\u062a\u0648\u0633\u064a\u0639<\/option>\n                    <option value=\"9\">\u0628\u0646\u0627\u0621 \u0641\u064a \u0627\u0644\u0645\u0646\u0637\u0642\u0629 \u0627\u0644\u0631\u064a\u0641\u064a\u0629<\/option>\n                <\/select>\n            <\/div>\n            <div class=\"form-input\">\n                <label style=\"font-weight: bold\">\u0627\u0644\u062f\u062e\u0644 \u0627\u0644\u0634\u0647\u0631\u064a<\/label>\n                <input type=\"text\" id=\"amount\" placeholder=\"\u0627\u0644\u062f\u062e\u0644 \u0627\u0644\u0634\u0647\u0631\u064a\" \/>\n            <\/div>\n            <div class=\"form-input\">\n                <label style=\"font-weight: bold\">\u0627\u0644\u0633\u0646<\/label>\n                <input type=\"text\" id=\"duree\" placeholder=\"\u0623\u062f\u062e\u0644 \u0627\u0644\u0639\u0645\u0631\" \/>\n            <\/div>\n        <\/div>\n        <button class=\"create\" type=\"button\" onclick=\"printPdf()\">\n            \u062d\u0633\u0627\u0628\n        <\/button>\n    <\/div>\n<\/div>\n<div id=\"section-to-print\">\n    <div class=\"vis\">\n        <div class=\"image vis\">\n            <img decoding=\"async\" data-src=\"https:\/\/www.bdl.dz\/ar\/wp-content\/uploads\/2022\/12\/logo-1.png\" alt=\"logo\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 408px; --smush-placeholder-aspect-ratio: 408\/122;\" \/>\n        <\/div>\n        <p class=\"paragraph\">\n            \u0645\u0631\u062d\u0628\u064b\u0627\u060c\n        <\/p>\n        <p class=\"paragraph\">\n            \u0644\u0642\u062f \u0627\u0633\u062a\u0644\u0645\u0646\u0627 \u0637\u0644\u0628 \u0645\u062d\u0627\u0643\u0627\u0629 \u0644\u0640 (<span id=\"type_text\"><\/span>) \u0627\u0644\u062e\u0627\u0635 \u0628\u0643 \u0648\u0646\u0634\u0643\u0631\u0643 \u0639\u0644\u0649 \u0627\u062e\u062a\u064a\u0627\u0631 BDL.\n        <\/p>\n        <p class=\"paragraph\">\n            \u0628\u0639\u062f \u0645\u0631\u0627\u062c\u0639\u0629 \u0637\u0644\u0628\u0643\u060c \u0646\u0633\u0631\u062f \u0644\u0643\u0645 \u062a\u0645\u0648\u064a\u0644 (<span id=\"type_text_2\"><\/span>) \u0628\u0645\u0628\u0644\u063a (<span id=\"total\"><\/span> \u062f.\u062c) \u0628\u062a\u0637\u0628\u064a\u0642 \u0645\u0639\u062f\u0644 \u0641\u0627\u0626\u062f\u0629 (<span id=\"rate\"><\/span>).<br>\n            \u0633\u064a\u062a\u0645 \u0633\u062f\u0627\u062f \u0647\u0630\u0627 \u0627\u0644\u0640 (<span id=\"type_text_3\"><\/span>) \u0645\u0646 \u062e\u0644\u0627\u0644 \u0627\u0644\u062e\u0635\u0645 \u0627\u0644\u0634\u0647\u0631\u064a \u0645\u0646 \u062d\u0633\u0627\u0628\u0643 \u0628\u0645\u0628\u0644\u063a (<span id=\"mens\"><\/span> \u062f.\u062c) \u0639\u0644\u0649 \u0645\u062f\u0627\u0631 \u0641\u062a\u0631\u0629 (<span id=\"duration\"><\/span>).\n        <\/p>\n        <p class=\"paragraph\">\n            \u0644\u0644\u062d\u0635\u0648\u0644 \u0639\u0644\u0649 \u0645\u0632\u064a\u062f \u0645\u0646 \u0627\u0644\u0645\u0639\u0644\u0648\u0645\u0627\u062a\u060c \u0644\u0627 \u062a\u062a\u0631\u062f\u062f \u0641\u064a \u0627\u0644\u0627\u062a\u0635\u0627\u0644 \u0628\u0646\u0627 \u0639\u0644\u0649 3312 \u0623\u0648 021994800.\n        <\/p>\n        <p class=\"paragraph\">\n            \u0641\u0631\u064a\u0642 BDL\u060c \u0627\u0644\u062a\u0627\u0631\u064a\u062e [<span id=\"date\"><\/span>]\n        <\/p>\n        <p class=\"paragraph\">\n            \u0645\u0644\u0627\u062d\u0638\u0629: \u062a\u0639\u062a\u0628\u0631 \u0647\u0630\u0647 \u0627\u0644\u0645\u062d\u0627\u0643\u0627\u0629 \u0625\u0634\u0627\u0631\u064a\u0629 \u0648\u0644\u0627 \u062a\u062d\u0645\u0644 \u0642\u064a\u0645\u0629 \u062a\u0639\u0627\u0642\u062f\u064a\u0629.\n        <\/p>\n    <\/div>\n<\/div>\n<script>\n    function formaterNombre(fltValeur) {\n        var strSepMilliers = \" \";\n        var strSepDecimal = \",\";\n        var intNbDecimales = 2;\n        var strResultat = \"\";\n        var strPartieEntiere = String(Math.floor(fltValeur));\n\n        var intNbBlocs = parseInt(strPartieEntiere.length \/ 3);\n        var intLongPremBloc = strPartieEntiere.length % 3;\n        strResultat = strPartieEntiere.substr(0, intLongPremBloc);\n        for (var intIdxBloc = 0; intIdxBloc < intNbBlocs; intIdxBloc++)\n            strResultat += strSepMilliers + strPartieEntiere.substr(intIdxBloc * 3 + intLongPremBloc, 3);\n\n        var strPartieDecimale = \"\";\n        if (fltValeur == Math.floor(fltValeur))\n            while (strPartieDecimale.length < intNbDecimales) strPartieDecimale += \"0\";\n        else\n            strPartieDecimale = String(\n                Math.round(\n                    (fltValeur - Math.floor(fltValeur)) * Math.pow(10, intNbDecimales)\n                )\n            );\n        strResultat += strSepDecimal + strPartieDecimale;\n\n        return strResultat;\n    }\n\n    const duration = (age) => (75 - age > 35 ? 35 : 75 - age);\n    const interest = (revenue, value) => {\n        let rate;\n        if ([1, 3, 4, 9].includes(value)) {\n            if (revenue > 20000 && revenue <= 120000) {\n                rate = 0.01;\n            } else if (revenue > 120000 && revenue <= 240000) {\n                rate = 0.03;\n            } else {\n                rate = 0.0625;\n            }\n        } else {\n            rate = 0.0625;\n        }\n        return rate \/ 12;\n    };\n    const annuity = (revenue) =>\n        revenue < 60000\n            ? 0.3\n            : revenue >= 60000 && revenue <= 120000\n                ? 0.45\n                : 0.5;\n\n    let calculate = (revenue, value, age) => {\n        let df = 6;\n        let n = duration(age) * 12;\n        let a = revenue * annuity(revenue);\n        let x1 = df - n;\n        let y1 = 1 + interest(revenue, value);\n        let y2 = Math.pow(y1, -df);\n        let y3 = Math.pow(y1, x1);\n        let c = ((a * y2) \/ interest(revenue, value)) * (1 - y3);\n        let rs = Math.round(c * 100) \/ 100;\n        let mens = Math.round(a * 100) \/ 100;\n        console.log({\n            total: formaterNombre(rs),\n            mens: formaterNombre(mens),\n            duration: `${duration(age)} \u0633\u0646\u0629`,\n            rate: `${interest(revenue, value) * 1200} %`,\n        });\n        return {\n            total: formaterNombre(rs),\n            mens: formaterNombre(mens),\n            duration: `${duration(age)} \u0633\u0646\u0629`,\n            rate: `${interest(revenue, value) * 1200} %`,\n        };\n    };\n\n    async function printPdf() {\n        let select = document.getElementById(\"type_credit\");\n        var valeur = select.value;\n        let type = select.options[select.selectedIndex].text;\n        var amount = document.getElementById(\"amount\").value;\n        const d = new Date();\n        var duree = document.getElementById(\"duree\").value;\n\n        const { total, mens, duration, rate } = calculate(amount, valeur, duree);\n\n        \/\/ Populate the HTML with the calculated values\n        document.getElementById(\"type_text\").textContent = type;\n        document.getElementById(\"type_text_2\").textContent = type;\n        document.getElementById(\"type_text_3\").textContent = type;\n        document.getElementById(\"total\").textContent = total;\n        document.getElementById(\"mens\").textContent = mens;\n        document.getElementById(\"duration\").textContent = duration;\n        document.getElementById(\"rate\").textContent = rate;\n        document.getElementById(\"date\").textContent = d.toISOString().split(\"T\")[0];\n\n        window.print();\n    }\n\n    function closeBtn() {\n        document.getElementById(\"preview\").style.display = \"none\";\n    }\n<\/script>\n<\/body>\n<\/html>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t            <\/div>\n        <\/div>\n                    <\/div>\n        <\/section>\n        \t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Simulation mourabaha vehicule \u0646\u0648\u0639 \u0627\u0644\u0627\u0626\u062a\u0645\u0627\u0646 \u0634\u0631\u0627\u0621 \u0645\u0646 \u0645\u0642\u0627\u0648\u0644\u0634\u0631\u0627\u0621 \u0645\u0646 \u0641\u0631\u062f\u0634\u0631\u0627\u0621 \u0639\u0644\u0649 \u062e\u0631\u064a\u0637\u0629\u0634\u0631\u0627\u0621 VSP \/ LSP\u0634\u0631\u0627\u0621 \u0641\u064a \u062a\u0639\u0627\u0648\u0646\u064a\u0629 \u0639\u0642\u0627\u0631\u064a\u0629\u0627\u0644\u0628\u0646\u0627\u0621 \u0627\u0644\u0630\u0627\u062a\u064a\u0627\u0644\u062a\u0646\u0645\u064a\u0629\u062a\u0648\u0633\u064a\u0639\u0628\u0646\u0627\u0621 \u0641\u064a \u0627\u0644\u0645\u0646\u0637\u0642\u0629 \u0627\u0644\u0631\u064a\u0641\u064a\u0629 \u0627\u0644\u062f\u062e\u0644 \u0627\u0644\u0634\u0647\u0631\u064a \u0627\u0644\u0633\u0646 \u062d\u0633\u0627\u0628 \u0645\u0631\u062d\u0628\u064b\u0627\u060c \u0644\u0642\u062f \u0627\u0633\u062a\u0644\u0645\u0646\u0627 \u0637\u0644\u0628 \u0645\u062d\u0627\u0643\u0627\u0629 \u0644\u0640 () \u0627\u0644\u062e\u0627\u0635 \u0628\u0643 \u0648\u0646\u0634\u0643\u0631\u0643 \u0639\u0644\u0649 \u0627\u062e\u062a\u064a\u0627\u0631 BDL. \u0628\u0639\u062f \u0645\u0631\u0627\u062c\u0639\u0629 \u0637\u0644\u0628\u0643\u060c \u0646\u0633\u0631\u062f \u0644\u0643\u0645 \u062a\u0645\u0648\u064a\u0644 () \u0628\u0645\u0628\u0644\u063a ( \u062f.\u062c) \u0628\u062a\u0637\u0628\u064a\u0642 \u0645\u0639\u062f\u0644 \u0641\u0627\u0626\u062f\u0629 (). \u0633\u064a\u062a\u0645 \u0633\u062f\u0627\u062f \u0647\u0630\u0627 \u0627\u0644\u0640 () \u0645\u0646 \u062e\u0644\u0627\u0644 \u0627\u0644\u062e\u0635\u0645 \u0627\u0644\u0634\u0647\u0631\u064a \u0645\u0646 \u062d\u0633\u0627\u0628\u0643 \u0628\u0645\u0628\u0644\u063a ( \u062f.\u062c) \u0639\u0644\u0649 \u0645\u062f\u0627\u0631 \u0641\u062a\u0631\u0629 (). \u0644\u0644\u062d\u0635\u0648\u0644 \u0639\u0644\u0649 \u0645\u0632\u064a\u062f \u0645\u0646 \u0627\u0644\u0645\u0639\u0644\u0648\u0645\u0627\u062a\u060c \u0644\u0627 \u062a\u062a\u0631\u062f\u062f \u0641\u064a \u0627\u0644\u0627\u062a\u0635\u0627\u0644 \u0628\u0646\u0627 \u0639\u0644\u0649 3312 \u0623\u0648 021994800. \u0641\u0631\u064a\u0642 BDL\u060c \u0627\u0644\u062a\u0627\u0631\u064a\u062e [] \u0645\u0644\u0627\u062d\u0638\u0629: \u062a\u0639\u062a\u0628\u0631 \u0647\u0630\u0647 \u0627\u0644\u0645\u062d\u0627\u0643\u0627\u0629 \u0625\u0634\u0627\u0631\u064a\u0629 \u0648\u0644\u0627 \u062a\u062d\u0645\u0644 \u0642\u064a\u0645\u0629 \u062a\u0639\u0627\u0642\u062f\u064a\u0629.<\/p>\n","protected":false},"author":1,"featured_media":3746,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-2326","page","type-page","status-publish","has-post-thumbnail","hentry"],"_links":{"self":[{"href":"https:\/\/www.bdl.dz\/ar\/wp-json\/wp\/v2\/pages\/2326","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bdl.dz\/ar\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.bdl.dz\/ar\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.bdl.dz\/ar\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bdl.dz\/ar\/wp-json\/wp\/v2\/comments?post=2326"}],"version-history":[{"count":0,"href":"https:\/\/www.bdl.dz\/ar\/wp-json\/wp\/v2\/pages\/2326\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.bdl.dz\/ar\/wp-json\/wp\/v2\/media\/3746"}],"wp:attachment":[{"href":"https:\/\/www.bdl.dz\/ar\/wp-json\/wp\/v2\/media?parent=2326"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}