Changeset 759708
- Timestamp:
- 08/21/2013 02:48:54 AM (13 years ago)
- Location:
- farm-calculators/trunk
- Files:
-
- 4 edited
-
farm-calculators.php (modified) (4 diffs)
-
js/calculators.js (modified) (5 diffs)
-
readme.md (modified) (3 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
farm-calculators/trunk/farm-calculators.php
r759516 r759708 7 7 Description: Add farm calculators to your website to help users determine various farming and crop related information. 8 8 9 Version: 0. 29 Version: 0.3 10 10 Author: Bryce Johnston 11 11 Author URI: http://www.wingdspur.com … … 28 28 *******************************************************************************************/ 29 29 30 $fc_version = '0. 2';30 $fc_version = '0.3'; 31 31 $fc_dirname = plugin_basename(dirname(__FILE__)); 32 32 … … 228 228 <label for="kernals_area">Area Kernals were Counted (ft<sup>2</sup>):</label> 229 229 <input name="kernals_area" id="kernals_area" type="number" step="any" class="input-medium" /><br /> 230 <button type="submit" class="btn" name="ccalculateSorghumHarvestYieldLoss" id="calculateSorghumHarvestYieldLoss">Calculate</button> 230 <button type="submit" class="btn" name="calculateSorghumHarvestYieldLoss" id="calculateSorghumHarvestYieldLoss">Calculate</button> 231 </fieldset>'; 232 $code .= '<br /> 233 <label>Estimated Yield Loss (bu/ac):</label> 234 <input name="yield_loss" type="text" class="input-medium" readonly="readonly" /> 235 </form>'; 236 $code .= ' 237 </div>'; 238 239 return $code; 240 } 241 242 function farming_calc_soybean_harvest_yield_loss_shortcode() { 243 extract( shortcode_atts( array( 244 'class' => 'farmCalculator', 245 ), $atts ) ); 246 247 $class = esc_attr($class); 248 249 $code = '<div class="'.$class.'"> 250 <form> 251 <div class="errors"></div>'; 252 $code .=' 253 <h4>Soybean Harvest Loss</h4> 254 <p><i>Also recommended to check standing crop for pre-harvest losses.</i></p> 255 <p> 256 <label for="beans_count">Beans Counted on Ground:</label><br /> 257 <input name="beans_count" id="beans_count" type="number" step="any" class="input-medium" /> 258 </p> 259 <p> 260 <label for="beans_area">Area Beans were Counted (ft<sup>2</sup>):</label><br /> 261 <input name="beans_area" id="beans_area" type="number" step="any" class="input-medium" /> 262 </p> 263 <p> 264 <button type="submit" class="btn" name="calculateSoybeanHarvestYieldLoss" id="calculateSoybeanHarvestYieldLoss">Calculate</button> 265 </p> 266 <p> 267 <label>Estimated Yield Loss (bu/ac):</label><br /> 268 <input name="yield_loss" type="text" class="input-medium" readonly="readonly" /> 269 </p> 270 </form>'; 271 $code .= ' 272 </div>'; 273 274 return $code; 275 } 276 277 function farming_calc_soybean_harvest_yield_loss_bs_shortcode() { 278 extract( shortcode_atts( array( 279 'class' => 'farmCalculator', 280 ), $atts ) ); 281 282 $class = esc_attr($class); 283 284 $code = '<div class="'.$class.'"> 285 <form> 286 <div class="errors"></div>'; 287 $code .='<fieldset> 288 <legend>Soybean Harvest Loss</legend>'; 289 $code .=' 290 <label for="beans_count">Beans Counted on Ground:</label> 291 <input name="beans_count" id="beans_count" type="number" step="any" class="input-medium" /> 292 <label for="beans_area">Area Beans were Counted (ft<sup>2</sup>):</label> 293 <input name="beans_area" id="beans_area" type="number" step="any" class="input-medium" /><br /> 294 <button type="submit" class="btn" name="calculateSoybeanHarvestYieldLoss" id="calculateSoybeanHarvestYieldLoss">Calculate</button> 295 </fieldset>'; 296 $code .= '<br /> 297 <label>Estimated Yield Loss (bu/ac):</label> 298 <input name="yield_loss" type="text" class="input-medium" readonly="readonly" /> 299 </form>'; 300 $code .= ' 301 </div>'; 302 303 return $code; 304 } 305 306 function farming_calc_sunflower_harvest_yield_loss_shortcode() { 307 extract( shortcode_atts( array( 308 'class' => 'farmCalculator', 309 ), $atts ) ); 310 311 $class = esc_attr($class); 312 313 $code = '<div class="'.$class.'"> 314 <form> 315 <div class="errors"></div>'; 316 $code .=' 317 <h4>Sunflower Harvest Loss</h4> 318 <p><i>Also recommended to check standing crop for pre-harvest losses.</i></p> 319 <p> 320 <label for="seeds_count">Seeds Counted on Ground:</label><br /> 321 <input name="seeds_count" id="seeds_count" type="number" step="any" class="input-medium" /> 322 </p> 323 <p> 324 <label for="seeds_area">Area Seeds were Counted (ft<sup>2</sup>):</label><br /> 325 <input name="seeds_area" id="seeds_area" type="number" step="any" class="input-medium" /> 326 </p> 327 <p> 328 <button type="submit" class="btn" name="calculateSunflowerHarvestYieldLoss" id="calculateSunflowerHarvestYieldLoss">Calculate</button> 329 </p> 330 <p> 331 <label>Estimated Yield Loss (bu/ac):</label><br /> 332 <input name="yield_loss" type="text" class="input-medium" readonly="readonly" /> 333 </p> 334 </form>'; 335 $code .= ' 336 </div>'; 337 338 return $code; 339 } 340 341 function farming_calc_sunflower_harvest_yield_loss_bs_shortcode() { 342 extract( shortcode_atts( array( 343 'class' => 'farmCalculator', 344 ), $atts ) ); 345 346 $class = esc_attr($class); 347 348 $code = '<div class="'.$class.'"> 349 <form> 350 <div class="errors"></div>'; 351 $code .='<fieldset> 352 <legend>Sunflower Harvest Loss</legend>'; 353 $code .=' 354 <label for="seeds_count">Seeds Counted on Ground:</label> 355 <input name="seeds_count" id="beans_count" type="number" step="any" class="input-medium" /> 356 <label for="seeds_area">Area Seeds were Counted (ft<sup>2</sup>):</label> 357 <input name="seeds_area" id="seeds_area" type="number" step="any" class="input-medium" /><br /> 358 <button type="submit" class="btn" name="calculateSunflowerHarvestYieldLoss" id="calculateSunflowerHarvestYieldLoss">Calculate</button> 231 359 </fieldset>'; 232 360 $code .= '<br /> … … 246 374 add_shortcode('farming_calc_sorghum_harvest_yield_loss', 'farming_calc_sorghum_harvest_yield_loss_shortcode'); 247 375 add_shortcode('farming_calc_sorghum_harvest_yield_loss_bs', 'farming_calc_sorghum_harvest_yield_loss_bs_shortcode'); 376 add_shortcode('farming_calc_soybean_harvest_yield_loss', 'farming_calc_soybean_harvest_yield_loss_shortcode'); 377 add_shortcode('farming_calc_soybean_harvest_yield_loss_bs', 'farming_calc_soybean_harvest_yield_loss_bs_shortcode'); 378 add_shortcode('farming_calc_sunflower_harvest_yield_loss', 'farming_calc_sunflower_harvest_yield_loss_shortcode'); 379 add_shortcode('farming_calc_sunflower_harvest_yield_loss_bs', 'farming_calc_sunflower_harvest_yield_loss_bs_shortcode'); 248 380 249 381 ?> -
farm-calculators/trunk/js/calculators.js
r759516 r759708 13 13 $("#calculateSorghumHarvestYieldLoss").bind('click submit', function() { 14 14 calculateSorghumHarvestYieldLoss(this.form); 15 return false; 16 }); 17 18 $("#calculateSoybeanHarvestYieldLoss").bind('click submit', function() { 19 calculateSoybeanHarvestYieldLoss(this.form); 20 return false; 21 }); 22 23 $("#calculateSunflowerHarvestYieldLoss").bind('click submit', function() { 24 calculateSunflowerHarvestYieldLoss(this.form); 15 25 return false; 16 26 }); … … 45 55 return false; 46 56 } 47 48 57 var stand_count = form.stand_count.value; 49 58 var row_length = form.row_length.value; 50 59 var row_spacing = form.row_spacing.value; 51 60 var acre_sq_feet = 43560; 52 53 61 var population = 0; 54 62 population = stand_count/(row_spacing/12*row_length/acre_sq_feet); 55 56 63 form.crop_population.value = roundHundred(population); 57 64 } … … 63 70 return false; 64 71 } 65 66 72 var stand_count = form.stand_count.value; 67 73 var hoop_size = form.hoop_size.value; … … 69 75 var pi = 3.14159265358979; 70 76 var base_pow = (hoop_size/12)/2; 71 72 77 var population = 0; 73 78 population = stand_count/(3.14159265358979*(Math.pow(base_pow,2))/acre_sq_feet); 74 75 79 form.crop_population.value = roundHundred(population); 76 80 } … … 82 86 return false; 83 87 } 84 85 88 var kernals_count = form.kernals_count.value; 86 89 var kernals_area = form.kernals_area.value; 87 88 90 var yield_loss = 0; 89 91 yield_loss = kernals_count/kernals_area/18.5; 92 form.yield_loss.value = roundTenth(yield_loss); 93 } 90 94 95 function calculateSoybeanHarvestYieldLoss(form) { 96 if (!isValid(form.beans_count, 0, 1000)) { 97 return false; 98 } else if (!isValid(form.beans_area, 0, 1000)) { 99 return false; 100 } 101 var beans_count = form.beans_count.value; 102 var beans_area = form.beans_area.value; 103 var yield_loss = 0; 104 yield_loss = beans_count/beans_area/4; 91 105 form.yield_loss.value = roundTenth(yield_loss); 106 } 92 107 108 function calculateSunflowerHarvestYieldLoss(form) { 109 if (!isValid(form.seeds_count, 0, 1000)) { 110 return false; 111 } else if (!isValid(form.seeds_area, 0, 1000)) { 112 return false; 113 } 114 var seeds_count = form.seeds_count.value; 115 var seeds_area = form.seeds_area.value; 116 var yield_loss = 0; 117 yield_loss = seeds_count/seeds_area/10*100; 118 form.yield_loss.value = roundTenth(yield_loss); 93 119 } 94 120 -
farm-calculators/trunk/readme.md
r759516 r759708 2 2 3 3 Contributors: wingdspur 4 Requires at least: 3. 54 Requires at least: 3.0 5 5 Tested up to: 3.6 6 Stable tag: 0. 26 Stable tag: 0.3 7 7 Tags: farm, crop, farming, calculator, yield, population, agriculture 8 8 License: GPLv3 or later … … 18 18 You can use following shortcodes if activated: 19 19 20 [farming_calc_crop_population] 20 ### Crop Population 21 [farming_calc_crop_population] 22 [farming_calc_crop_population_bs] (for bootstrap themes) 21 23 Shows a calculator for determing crop population based on stand count, row length, and row spacing. 22 24 23 [farming_calc_crop_population_bs] 24 Same as above but styled for bootstrap themes. 25 26 [farming_calc_crop_population_hoop] 25 ### Crop Population (Hoop Method) 26 [farming_calc_crop_population_hoop] 27 [farming_calc_crop_population_hoop_bs] (for bootstrap themes) 27 28 Shows a calculator for determing crop population based on stand count and hoop size. 28 29 29 [farming_calc_crop_population_hoop_bs] 30 Same as above but styled for bootstrap themes. 31 30 ### Grain Sorghum Harvest Yield Loss 32 31 [farming_calc_sorghum_harvest_yield_loss] 32 [farming_calc_sorghum_harvest_yield_loss_bs] (for bootstrap themes) 33 33 Shows a calculator for determing grain sorghum harvest yield loss based on kernels counted on ground and the size of the area they were counted in. 34 34 35 [farming_calc_sorghum_harvest_yield_loss_bs] 36 Same as above but styled for bootstrap themes. 35 ### Soybean Harvest Yield Loss 36 [farming_calc_soybean_harvest_yield_loss] 37 [farming_calc_soybean_harvest_yield_loss_bs] (for bootstrap themes) 38 Shows a calculator for determing soybean harvest yield loss based on beans counted on ground and the size of the area they were counted in. 39 40 ### Sunflower Harvest Yield Loss 41 [farming_calc_sunflower_harvest_yield_loss] 42 [farming_calc_sunflower_harvest_yield_loss_bs] (for bootstrap themes) 43 Shows a calculator for determing sunflower harvest yield loss based on seeds counted on ground and the size of the area they were counted in. 37 44 38 45 More shortcodes will follow soon. … … 54 61 ## Changelog 55 62 63 ### 0.3 64 * Added soybean harvest yield loss calculator. 65 * Added sunflower harvest yield loss calculator. 66 56 67 ### 0.2 57 68 * Added grain sorghum harvest yield loss calculator. -
farm-calculators/trunk/readme.txt
r759516 r759708 2 2 3 3 Contributors: wingdspur 4 Requires at least: 3. 54 Requires at least: 3.0 5 5 Tested up to: 3.6 6 Stable tag: 0. 26 Stable tag: 0.3 7 7 Tags: farm, crop, farming, calculator, yield, population, agriculture 8 8 License: GPLv3 or later … … 18 18 You can use following shortcodes if activated: 19 19 20 [farming_calc_crop_population] 20 = Crop Population = 21 [farming_calc_crop_population] 22 [farming_calc_crop_population_bs] (for bootstrap themes) 21 23 Shows a calculator for determing crop population based on stand count, row length, and row spacing. 22 24 23 [farming_calc_crop_population_bs] 24 Same as above but styled for bootstrap themes. 25 26 [farming_calc_crop_population_hoop] 25 = Crop Population (Hoop Method) = 26 [farming_calc_crop_population_hoop] 27 [farming_calc_crop_population_hoop_bs] (for bootstrap themes) 27 28 Shows a calculator for determing crop population based on stand count and hoop size. 28 29 29 [farming_calc_crop_population_hoop_bs] 30 Same as above but styled for bootstrap themes. 31 30 = Grain Sorghum Harvest Yield Loss = 32 31 [farming_calc_sorghum_harvest_yield_loss] 32 [farming_calc_sorghum_harvest_yield_loss_bs] (for bootstrap themes) 33 33 Shows a calculator for determing grain sorghum harvest yield loss based on kernels counted on ground and the size of the area they were counted in. 34 34 35 [farming_calc_sorghum_harvest_yield_loss_bs] 36 Same as above but styled for bootstrap themes. 35 = Soybean Harvest Yield Loss = 36 [farming_calc_soybean_harvest_yield_loss] 37 [farming_calc_soybean_harvest_yield_loss_bs] (for bootstrap themes) 38 Shows a calculator for determing soybean harvest yield loss based on beans counted on ground and the size of the area they were counted in. 39 40 = Sunflower Harvest Yield Loss = 41 [farming_calc_sunflower_harvest_yield_loss] 42 [farming_calc_sunflower_harvest_yield_loss_bs] (for bootstrap themes) 43 Shows a calculator for determing sunflower harvest yield loss based on seeds counted on ground and the size of the area they were counted in. 37 44 38 45 More shortcodes will follow soon. … … 54 61 == Changelog == 55 62 63 = 0.3 = 64 * Added soybean harvest yield loss calculator. 65 * Added sunflower harvest yield loss calculator. 66 56 67 = 0.2 = 57 68 * Added grain sorghum harvest yield loss calculator.
Note: See TracChangeset
for help on using the changeset viewer.