diff --git a/.htaccess b/.htaccess index de2b7b0..86ad8fd 100644 --- a/.htaccess +++ b/.htaccess @@ -9,6 +9,7 @@ RewriteRule ^mentionslegales$ /mentionslegales.php [L] RewriteRule ^transparence$ /transparence.php [L] RewriteRule ^faq$ /faq.php [L] RewriteRule ^finances$ /finances.php [L] +RewriteRule ^tarifs$ /tarifs.php [L] ## nginx rules #location /cgu { @@ -32,4 +33,3 @@ RewriteRule ^finances$ /finances.php [L] #location /faq { # rewrite ^/faq$ /faq.php last; #} - diff --git a/assets/calc.js b/assets/calc.js new file mode 100644 index 0000000..5c471c3 --- /dev/null +++ b/assets/calc.js @@ -0,0 +1,326 @@ +const storage_price = [.0656,.0878,.1093,.1231]; + +const prices = { + nc: { + storage: storage_price, + users: [0.66,1.16,1.76,2.16], + options: { + lxc: { + basePrice: 31, + factor: 1.217 + }, + dedicated: { + basePrice: 64, + factor: 1.753 + }, + onprem: { + basePrice: 111, + factor: 1.498 + }, + vol: [75,90,105,120] + } + }, + wh: { + storage: storage_price, + sites: [3.6,4.7,6.9,9.1], + options: { + preinstall: { + basePrice: 3.773, + factor: 1.168 + } + } + }, + mail: { + storage: storage_price, + users: [2.1,4.2,7.3,11.4], + options: { + catchall: { + basePrice: 3.787, + factor: 1.196 + } + } + }, + vps: { + storage: storage_price.map(x => x * 1.1297), + cpu: [6.146, 7.687, 9.218, 10.749], + ram: [1.646, 2.057, 2.468, 2.879] + } +}; + + +$('.ui.accordion') + .accordion({ + exclusive: true, + collapsible: false + }) +; + +$('.ui.sticky') + .sticky() +; +$('.shape').shape(); + +$('.ui.toggle.checkbox').checkbox({ + onChange: function () { + updatePrice(); + } +}); + +$('#nc_opt_vol_val').on('change', function() { + updatePrice(); +}); + +$('.ui.toggle.checkbox.nc_opt_lxc').checkbox({ + onChange: function() { + updatePrice(); + $('#ncusers').shape('flip up'); + $('#nextcloud_users_source').toggleClass('disabled'); + }, + onChecked: function() { + $('.ui.toggle.checkbox.nc_opt_decicated').checkbox('set enabled'); + }, + onUnchecked: function() { + $('.ui.toggle.checkbox.nc_opt_decicated').checkbox('uncheck').checkbox('set disabled'); + $('.ui.toggle.checkbox.nc_opt_onprem').checkbox('uncheck').checkbox('set disabled'); + } +}); +$('.ui.toggle.checkbox.nc_opt_decicated').checkbox({ + onChange: function() { + updatePrice(); + }, + onChecked: function() { + $('.ui.toggle.checkbox.nc_opt_onprem').checkbox('set enabled'); + }, + onUnchecked: function() { + $('.ui.toggle.checkbox.nc_opt_onprem').checkbox('uncheck').checkbox('set disabled'); + } +}).checkbox('set disabled'); +$('.ui.toggle.checkbox.nc_opt_onprem').checkbox({ + onChange: function() { + updatePrice(); + } +}).checkbox('set disabled'); + +$('#nextcloud_stockage_source') + .slider({ + showThumbTooltip: true, + restrictedLabels: [0, 50, 100, 200, 300, 400, 500], + min: 0, + max: 500, + step: 5, + autoAdjustLabels: false, + onMove: function(range, firstVal, secondVal) { + $('#nextcloud_stockage_display').html(firstVal); + updatePrice(); + } + }) +; + +$('#nextcloud_users_source') + .slider({ + showThumbTooltip: true, + restrictedLabels: [0, 5, 10, 15, 20, 30, 40, 50], + min: 0, + max: 50, + // step: 10, + autoAdjustLabels: false, + onMove: function(range, firstVal, secondVal) { + $('#nextcloud_users_display').html(firstVal); + updatePrice(); + } + }) +; + +$('#wh_stockage_source') + .slider({ + showThumbTooltip: true, + restrictedLabels: [0, 5, 10, 25, 50, 75, 100], + min: 0, + max: 100, + step: 1, + autoAdjustLabels: false, + onMove: function(range, firstVal, secondVal) { + $('#wh_stockage_display').html(firstVal); + updatePrice(); + } + }) +; + +$('#wh_sites_source') + .slider({ + showThumbTooltip: true, + restrictedLabels: [0, 5, 10, 15, 20], + min: 0, + max: 20, + // step: 10, + autoAdjustLabels: false, + onMove: function(range, firstVal, secondVal) { + $('#wh_sites_display').html(firstVal); + updatePrice(); + } + }) +; + + +$('#mail_stockage_source') + .slider({ + showThumbTooltip: true, + restrictedLabels: [0, 5, 10, 25, 50, 75, 100], + min: 0, + max: 100, + step: 1, + autoAdjustLabels: false, + onMove: function(range, firstVal, secondVal) { + $('#mail_stockage_display').html(firstVal); + updatePrice(); + } + }) +; + +$('#mail_users_source') + .slider({ + showThumbTooltip: true, + restrictedLabels: [0, 5, 10, 15, 20], + min: 0, + max: 20, + // step: 10, + autoAdjustLabels: false, + onMove: function(range, firstVal, secondVal) { + $('#mail_users_display').html(firstVal); + updatePrice(); + } + }) +; + +$('#vps_stockage_source') + .slider({ + showThumbTooltip: true, + restrictedLabels: [0, 25, 50, 75, 100, 200, 300, 400, 500], + min: 0, + max: 500, + step: 25, + autoAdjustLabels: false, + onMove: function(range, firstVal, secondVal) { + $('#vps_stockage_display').html(firstVal); + updatePrice(); + } + }) +; + +$('#vps_cpu_source') + .slider({ + showThumbTooltip: true, + restrictedLabels: [0, 1, 2, 4, 8, 16, 32, 48, 64], + min: 0, + max: 64, + step: 1, + autoAdjustLabels: false, + onMove: function(range, firstVal, secondVal) { + $('#vps_cpu_display').html(firstVal); + updatePrice(); + } + }) +; + +$('#vps_ram_source') + .slider({ + showThumbTooltip: true, + restrictedLabels: [0, 1, 2, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128], + min: 0, + max: 128, + step: 1, + autoAdjustLabels: false, + onMove: function(range, firstVal, secondVal) { + $('#vps_ram_display').html(firstVal); + updatePrice(); + } + }) +; + + + +function updatePrice() { + let ncPriceStorage = $('#nextcloud_stockage_source').slider('get value'); + const ncPriceUsers = $('#nextcloud_users_source').slider('get value'); + const whPriceStorage = $('#wh_stockage_source').slider('get value'); + const whPriceSites = $('#wh_sites_source').slider('get value'); + const mailPriceStorage = $('#mail_stockage_source').slider('get value'); + const mailPriceUsers = $('#mail_users_source').slider('get value'); + + const vpsPriceStorage = $('#vps_stockage_source').slider('get value'); + const vpsPriceCpu = $('#vps_cpu_source').slider('get value'); + const vpsPriceRam = $('#vps_ram_source').slider('get value'); + + const cbNcLxc = $('.ui.toggle.checkbox.nc_opt_lxc').checkbox('is checked'); + const cbNcDedicated = $('.ui.toggle.checkbox.nc_opt_decicated').checkbox('is checked'); + const cbNcOnprem = $('.ui.toggle.checkbox.nc_opt_onprem').checkbox('is checked'); + const cbWhPreinstall = $('.ui.toggle.checkbox.wh_opt_preinstall').checkbox('is checked'); + const cbMailCatchall = $('.ui.toggle.checkbox.mail_opt_catchall').checkbox('is checked'); + + let opt = { basePrice: 0, factor: 1 }; + + if (cbNcLxc) { + opt = prices.nc.options.lxc; + } + if (cbNcLxc && cbNcDedicated) { + opt = prices.nc.options.dedicated; + } + if (cbNcLxc && cbNcDedicated && cbNcOnprem) { + opt = prices.nc.options.onprem; + } + + const ncOptVol = $('.ui.checkbox.nc_opt_vol').checkbox('is checked') + ? parseInt($('#nc_opt_vol_val').val()) || 1 + : 0; + + for (let i=0; i<4; i++) { + + // base nc price calculation + let ncPrice = ncPriceStorage * prices.nc.storage[i]; + if (!cbNcLxc) ncPrice += ncPriceUsers * prices.nc.users[i]; + + // add options pricing if any + ncPrice = (ncPrice + opt.basePrice) * opt.factor; + + if (ncOptVol>0) ncPrice += Math.max(100, Math.pow(ncOptVol, 0.7) * prices.nc.options.vol[i]); + + if (ncOptVol>0) { + if (i == 0) { + $('#teraeurolow').html((ncPrice / ncOptVol).toPrecision(3)); + } + + if (i == 3) { + $('#teraeurohigh').html((ncPrice / ncOptVol).toPrecision(3)); + } + } else { + $('#teraeurolow').html('-'); + $('#teraeurohigh').html('-'); + } + + // base wh price calculation + let whPrice = whPriceStorage * prices.wh.storage[i] + + whPriceSites * prices.wh.sites[i]; + if (cbWhPreinstall) whPrice = (whPrice + prices.wh.options.preinstall.basePrice) * prices.wh.options.preinstall.factor; + + // base mail price calculation + let mailPrice = mailPriceStorage * prices.mail.storage[i] + + mailPriceUsers * prices.mail.users[i]; + if (cbMailCatchall) mailPrice = (mailPrice + prices.mail.options.catchall.basePrice) * prices.mail.options.catchall.factor; + + // base VPS price calculation + let vpsPrice = vpsPriceStorage * prices.vps.storage[i] + + vpsPriceCpu * prices.vps.cpu[i] + + vpsPriceRam * prices.vps.ram[i]; + + let totalPrice = ncPrice + whPrice + mailPrice + vpsPrice; + + totalPrice = Math.ceil(totalPrice); + $('#price_'+i).html(totalPrice+'€'); + } + +} + +$(document) + .ready(function() { + updatePrice(); + }); diff --git a/tarifs.php b/tarifs.php new file mode 100644 index 0000000..6d44b84 --- /dev/null +++ b/tarifs.php @@ -0,0 +1,444 @@ + + +
+ + + +Tarif libre ne veut pas dire gratuit, mais estimer la valeur d'un service n'est pas une mince affaire. Pour vous aider dans le choix du tarif de votre offre, voici un calculateur qui vous permettra à la fois de sélectionner vos options et de connaître la fourchette habituelle dans laquelle vous pourrez vous positionner.
+Ce calculateur est là pour vous assister dans vos choix et vous donner une idée des tarifs habituels. La fourchette donnée n'est pas définitive ni contractuelle, tout est négociable et peut être revu ensemble à tout moment.
+Pour l'utiliser, choisissez dans chaque catégorie les spécifications que vous estimez adéquates à votre besoin, et la fourchette de tarif sera mise à jour automatiquement.
+La fourchette de tarif se présente en 4 tranches:
+Volume de stockage à répartir entre vos comptes et dossiers partagés.
+ + ++ Personnalisation et installation d'applications à volonté.
+Les dossiers partagés sont à compter comme un compte supplémentaire.
+Volume de stockage à répartir entre vos différents sites. Il s'agit d'un quota souple: la limite "dure" étant de 2 fois le quota souple.
+ + +Un site comprend une adresse en HTTPS, une base de données (limitée à 500Mo) et jusqu'à 3 comptes FTP.
+ +Volume de stockage à répartir entre vos différentes boîtes mail.
+ + +Le nombre de boîtes mail dont vous avez besoin.
+ +Volume de stockage attaché à votre VPS.
+ + +Nombre de cœurs pour le processeur virtuel de votre VPS.
+ + +Volume de mémoire vive.
+ + +