Changeset 3253320
- Timestamp:
- 03/10/2025 12:41:59 PM (12 months ago)
- Location:
- sofk-air-conditioning-calaculate/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (1 diff)
-
sofk-air-conditioning-calculate.php (modified) (27 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sofk-air-conditioning-calaculate/trunk/readme.txt
r3194700 r3253320 4 4 Requires at least: 4.6 5 5 Tested up to: 6.7.1 6 Stable tag: 1. 06 Stable tag: 1.1 7 7 License: GPL2 8 8 License URI: https://www.gnu.org/licenses/gpl-2.0.html 9 10 9 Simple air conditioning calculator plugin for WordPress websites. 11 12 10 == Description == 13 14 11 This plugin adds a simple air conditioning calculator to your WordPress website. You can easily insert the calculator into your posts or pages using the shortcode `[air_condition_cal]`. 15 16 12 == Installation == 17 18 13 1. Upload the `sofk-air-conditioning-calculate` folder to the `/wp-content/plugins/` directory 19 14 2. Activate the plugin through the 'Plugins' menu in WordPress 20 15 3. Use the shortcode `[air_condition_cal]` in your posts or pages to display the calculator. 21 22 16 == Screenshots == 23 24 17 1.  25 18 Frontend Screenshot. 26 27 19 2.  28 20 Backend screenshot. 29 30 21 == Frequently Asked Questions == 31 32 22 = How do I use the calculator? = 33 34 23 Simply insert the shortcode `[air_condition_cal]` into your posts or pages where you want the calculator to appear. 35 36 24 == Changelog == 37 38 25 = 1.0 = 39 26 * Initial release 40 41 27 == Upgrade Notice == 42 43 28 = 1.0 = 44 29 Initial release 45 46 30 == Privacy Policy == 47 31 This plugin does not collect any personal data. 48 49 32 == Credits == 50 51 33 This plugin is developed by Sofk Pvt Ltd. 52 53 34 == Support == 54 55 35 For support, please visit [plugin support forum](https://wordpress.org/support/plugin/air-conditioning-calculator/). 56 57 36 == Plugin URI == 58 59 37 [Plugin Homepage](https://sofkpvtltd.com/shopfromreel/air-conditioning-calculator/) 60 61 38 == Author == 62 63 39 [Sofk Pvt Ltd](https://sofkpvtltd.com/) 64 65 40 == License == 66 67 41 Licensed under the GNU General Public License v2.0, see [License URI](https://www.gnu.org/licenses/gpl-2.0.html) 68 -
sofk-air-conditioning-calaculate/trunk/sofk-air-conditioning-calculate.php
r3194705 r3253320 1 1 <?php 2 2 /** 3 * @package Sofk Air Conditioning calculate3 * @package Sofk Air Conditioning calculate 4 4 */ 5 5 /* … … 14 14 Text Domain: sofk-air-conditioning-calculate 15 15 Domain Path: /languages 16 17 16 */ 18 17 if ( ! defined( 'ABSPATH' ) ) exit; 19 18 global $plugin_url ,$plugin_dir; 20 21 19 $plugin_url = plugins_url()."/sofk-air-conditioning-calculate"; 22 20 $plugin_dir = plugin_dir_path( __FILE__ ); 23 21 if (!function_exists('SFACC_hook_css')) { 24 22 function SFACC_hook_css() { 25 global $wpdb,$woocommerce,$plugin_url; 26 27 wp_enqueue_script('air_cond-prototype'); 28 wp_enqueue_script('air_cond_bootstrap',$plugin_url."/js/bootstrap.min.js"); 29 wp_enqueue_style( 'bootsrap-air_cond',$plugin_url."/css/bootstrap.min.css"); 23 global $wpdb,$woocommerce,$plugin_url; 24 wp_enqueue_script('air_cond-prototype'); 25 wp_enqueue_script('air_cond_bootstrap',$plugin_url."/js/bootstrap.min.js"); 26 wp_enqueue_style( 'bootsrap-air_cond',$plugin_url."/css/bootstrap.min.css"); 30 27 wp_enqueue_style( 'style-air_cond',$plugin_url."/css/air-con-cala-style.css"); 31 32 } 33 28 } 34 29 add_action('wp_head', 'SFACC_hook_css'); 35 30 } 36 37 31 if (!function_exists('SFACC_cal_function')) { 38 32 function SFACC_cal_function() { … … 68 62 color: <?php echo esc_html($btn_hover_color)?>;} 69 63 </style> 70 71 64 <div class="air_condition_cal"> 72 65 <div class="container"> … … 79 72 <output class="bubble"></output> 80 73 <input type="range" class="form-range range" id="length" min="<?php echo esc_html($room_length_min);?>" max="<?php echo esc_html($room_length_max);?>" step="0.5" value="0" name="length"> 81 74 82 75 </div> 83 76 <div class="col range-wrap"> … … 86 79 <input type="range" class="form-range range" id="width" min="<?php echo esc_html($room_width_min);?>" max="<?php echo esc_html($room_width_max);?>" step="0.5" value="0" name="width"> 87 80 </div> 88 </div> 81 </div> 89 82 </div> 90 83 <div class="form-group"> … … 107 100 <div class="form-group"> 108 101 <label for="exampleFormControlInput1">Sunlight Exposure</label> 109 <div class="check_group row"> 102 <div class="check_group row"> 110 103 <div class="form-check form-check-inline col"> 111 104 <input class="form-check-input" type="radio" name="sunlight" id="sunlight1" value="<?php echo esc_html($sunlight_exposure_shaded);?>"> … … 128 121 <input class="form-check-input" type="radio" name="insulated" id="insulated2" value="<?php echo esc_html($insulated_no);?>"> 129 122 <label class="form-check-label" for="insulated2">No</label> 130 </div> 131 </div> 123 </div> 124 </div> 132 125 </div> 133 126 <span class="error_message text-danger"></span> 134 127 <div class="form-group"> 135 <button type="button" class="air_calculate"><?php echo esc_html($btn_text);?></button> 136 <div class="air_cal_result">Result: <span class="result_value">NaN kW</span></div> 128 <button type="button" class="air_calculate"><?php echo esc_html($btn_text);?></button> 129 <div class="air_cal_result">Result: <span class="result_value">NaN kW</span></div> 137 130 <div class="form-group floor-input">Floor: <span class="floor"></span></div> 138 131 </div> … … 140 133 <div class="ac_listing"> 141 134 <div class="row"> 142 135 143 136 </div> 144 137 </div> … … 147 140 </div> 148 141 <script> 149 150 142 jQuery(".air_calculate").click(function(){ 151 143 flag = 1; … … 156 148 return; 157 149 } 158 150 159 151 width = jQuery('input[name="width"]').val(); 160 152 if(width == ''){ … … 163 155 return; 164 156 } 165 157 166 158 room_height = jQuery('input[name="room_height"]:checked').val(); 167 159 168 160 // if(room_height == '' || room_height == undefined){ 169 161 if(isNaN(room_height)){ … … 172 164 return; 173 165 } 174 175 166 176 167 sunlight = jQuery('input[name="sunlight"]:checked').val(); 177 168 // if(sunlight == '' || sunlight == undefined){ … … 181 172 return; 182 173 } 183 184 174 185 175 insulated = jQuery('input[name="insulated"]:checked').val(); 186 176 // if(insulated == '' || insulated == undefined){ … … 208 198 } 209 199 } 210 200 211 201 // result = length * width * room_height * sunlight * insulated; 212 202 213 203 if(result != ''){ 214 204 jQuery('.result_value').html(result.toFixed(2)+' kW'); … … 218 208 jQuery('.floor').html(width_length.toFixed(2)+' m2'); 219 209 } 220 221 }); 210 211 }); 222 212 </script> 223 213 <script> … … 226 216 const range = wrap.querySelector(".range"); 227 217 const bubble = wrap.querySelector(".bubble"); 228 229 218 range.addEventListener("input", () => { 230 219 setBubble(range, bubble); … … 232 221 setBubble(range, bubble); 233 222 }); 234 235 223 function setBubble(range, bubble) { 236 224 const val = range.value; … … 239 227 const newVal = Number(((val - min) * 100) / (max - min)); 240 228 bubble.innerHTML = val+'m'; 241 242 229 // Sorta magic numbers based on size of the native UI thumb 243 230 bubble.style.left = `calc(${newVal}% + (${18 - newVal * 0.3}px))`; 244 231 } 245 246 232 </script> 247 233 <?php … … 249 235 return $output; 250 236 ob_end_clean(); 251 237 252 238 } 253 239 add_shortcode( 'air_condition_cal', 'SFACC_cal_function' ); 254 240 } 255 256 257 241 /* air condition calculation admin setting*/ 258 242 add_action('admin_menu', 'SFACC_cal_create_menu'); 259 260 243 if (!function_exists('SFACC_cal_create_menu')) { 261 244 function SFACC_cal_create_menu() { 262 263 245 //create new top-level menu 264 246 add_menu_page('Air Condition Cal Settings', 'Air Condition Cal', 'administrator', 'air_condition_cal', 'SFACC_cal_settings_page' ); 265 266 247 //call register settings function 267 248 add_action( 'admin_init', 'SFACC_cool_plugin_settings' ); 268 249 } 269 250 } 270 271 251 if (!function_exists('SFACC_cool_plugin_settings')) { 272 252 function SFACC_cool_plugin_settings() { … … 293 273 register_setting( 'SFACC-cool-plugin-settings-group', 'daikin_ac_url' ); 294 274 register_setting( 'SFACC-cool-plugin-settings-group', 'contact_url' ); 295 296 } 297 } 298 275 } 276 } 299 277 if (!function_exists('SFACC_cal_settings_page')) { 300 278 function SFACC_cal_settings_page() { … … 306 284 float: left;} 307 285 .air_condition_cal_settings input[type='color']{max-width: 40px;} 308 309 286 </style> 310 287 <div class="wrap myheader"> … … 322 299 <td></td> 323 300 </tr> 324 301 325 302 <tr valign="top"> 326 303 <th scope="row">Room Width</th> … … 330 307 <td></td> 331 308 </tr> 332 309 333 310 <tr valign="top"> 334 311 <th scope="row">Room Height</th> … … 338 315 <td></td> 339 316 </tr> 340 317 341 318 <tr valign="top"> 342 319 <th scope="row">Sunlight Exposure</th> … … 346 323 <td></td> 347 324 </tr> 348 325 349 326 <tr valign="top"> 350 327 <th scope="row">Roof Area Insulated</th> … … 354 331 <td></td> 355 332 </tr> 356 333 357 334 <tr valign="top"> 358 335 <th scope="row">Button</th> … … 369 346 <td></td> 370 347 </tr> 371 372 <!--<tr valign="top">--> 373 <!--<th scope="row">AC Image Url</th>--> 374 <!--<td><label> Toshiba AC Image Url</label><input type="text" name="toshiba_ac_url" value="<?php echo esc_attr( get_option('toshiba_ac_url') ); ?>" placeholder="Enter Toshiba AC Image Url"/></td>--> 375 <!--<td><label> Daikin AC Image Url</label><input type="text" name="daikin_ac_url" value="<?php echo esc_attr( get_option('daikin_ac_url') ); ?>" placeholder="Enter Daikin AC Image Url"/></td>--> 376 <!--<td></td>--> 377 <!--</tr>--> 378 379 <!--<tr valign="top">--> 380 <!--<th scope="row">Contact Url</th>--> 381 <!--<td><label> Contact Url</label><input type="text" name="contact_url" value="<?php echo esc_attr( get_option('contact_url') ); ?>" placeholder="Enter Roof Contact Url"/></td>--> 382 <!--<td></td>--> 383 <!--<td></td>--> 384 <!--<td></td>--> 385 <!--</tr>--> 386 348 349 387 350 </table> 388 351 389 352 <?php submit_button(); ?> 390 391 353 </form> 392 354 </div>
Note: See TracChangeset
for help on using the changeset viewer.