Spaces:
Sleeping
Sleeping
Upload 17 files
Browse files- .gitattributes +1 -0
- app.py +0 -0
- data/farmer_updates.json +81 -0
- data/farmers.json +156 -0
- data/gen_ai_output/d600ada6-b203-46ba-8d40-edf84acb389c_insights_20250910_162902.json +212 -0
- data/gen_ai_output/df48d33f-79ec-4286-95dd-de2c8ee9c0df_insights_20250910_134006.json +209 -0
- data/gen_ai_output/df48d33f-79ec-4286-95dd-de2c8ee9c0df_insights_20250910_134219.json +207 -0
- data/gen_ai_output/df48d33f-79ec-4286-95dd-de2c8ee9c0df_insights_20250910_134314.json +209 -0
- data/gen_ai_output/df48d33f-79ec-4286-95dd-de2c8ee9c0df_insights_20250910_134553.json +210 -0
- data/gen_ai_output/df48d33f-79ec-4286-95dd-de2c8ee9c0df_insights_20250910_134758.json +209 -0
- data/gen_ai_output/df48d33f-79ec-4286-95dd-de2c8ee9c0df_yearly_plan_20250910_134147.json +188 -0
- requirements.txt +12 -0
- static/videos/AI_Farming_Tools_and_Video.mp4 +3 -0
- templates/bot.html +544 -0
- templates/form.html +1526 -0
- templates/insights.html +689 -0
- templates/success.html +600 -0
- templates/yearly_plan.html +811 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
static/videos/AI_Farming_Tools_and_Video.mp4 filter=lfs diff=lfs merge=lfs -text
|
app.py
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/farmer_updates.json
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"farmer_updates": [
|
| 3 |
+
{
|
| 4 |
+
"farmer_name": "Pranit",
|
| 5 |
+
"farmer_id": "5397241102",
|
| 6 |
+
"update_text": "Hello",
|
| 7 |
+
"category": "general_update",
|
| 8 |
+
"timestamp": "2025-09-09 20:13:44",
|
| 9 |
+
"date": "2025-09-09"
|
| 10 |
+
},
|
| 11 |
+
{
|
| 12 |
+
"farmer_name": "Pranit",
|
| 13 |
+
"farmer_id": "5397241102",
|
| 14 |
+
"update_text": "Hii",
|
| 15 |
+
"category": "general_update",
|
| 16 |
+
"timestamp": "2025-09-09 20:23:41",
|
| 17 |
+
"date": "2025-09-09"
|
| 18 |
+
},
|
| 19 |
+
{
|
| 20 |
+
"farmer_name": "Pranit",
|
| 21 |
+
"farmer_id": "5397241102",
|
| 22 |
+
"update_text": "My",
|
| 23 |
+
"category": "general_update",
|
| 24 |
+
"timestamp": "2025-09-09 21:14:00",
|
| 25 |
+
"date": "2025-09-09"
|
| 26 |
+
},
|
| 27 |
+
{
|
| 28 |
+
"farmer_name": "Pranit",
|
| 29 |
+
"farmer_id": "5397241102",
|
| 30 |
+
"update_text": "Hii",
|
| 31 |
+
"category": "general_update",
|
| 32 |
+
"timestamp": "2025-09-09 21:24:25",
|
| 33 |
+
"date": "2025-09-09"
|
| 34 |
+
},
|
| 35 |
+
{
|
| 36 |
+
"farmer_name": "Pranit",
|
| 37 |
+
"farmer_id": "5397241102",
|
| 38 |
+
"update_text": "Hello",
|
| 39 |
+
"category": "general_update",
|
| 40 |
+
"timestamp": "2025-09-09 21:24:34",
|
| 41 |
+
"date": "2025-09-09"
|
| 42 |
+
},
|
| 43 |
+
{
|
| 44 |
+
"farmer_name": "Pranit",
|
| 45 |
+
"farmer_id": "5397241102",
|
| 46 |
+
"update_text": "I have financial issue in my personal life as students",
|
| 47 |
+
"category": "general_update",
|
| 48 |
+
"timestamp": "2025-09-09 21:36:49",
|
| 49 |
+
"date": "2025-09-09"
|
| 50 |
+
},
|
| 51 |
+
{
|
| 52 |
+
"farmer_name": "Pranit",
|
| 53 |
+
"farmer_id": "5397241102",
|
| 54 |
+
"update_text": "I have financial issue in my personal life as students",
|
| 55 |
+
"category": "general_update",
|
| 56 |
+
"timestamp": "2025-09-09 21:37:45",
|
| 57 |
+
"date": "2025-09-09"
|
| 58 |
+
}
|
| 59 |
+
],
|
| 60 |
+
"scheduled_items": [],
|
| 61 |
+
"farmers": {
|
| 62 |
+
"5397241102": {
|
| 63 |
+
"name": "Pranit",
|
| 64 |
+
"first_contact": "2025-09-09",
|
| 65 |
+
"total_updates": 7,
|
| 66 |
+
"last_update": "2025-09-09 21:37:45"
|
| 67 |
+
}
|
| 68 |
+
},
|
| 69 |
+
"update_categories": [
|
| 70 |
+
"crop_status",
|
| 71 |
+
"weather_impact",
|
| 72 |
+
"irrigation_status",
|
| 73 |
+
"pest_disease",
|
| 74 |
+
"harvest_progress",
|
| 75 |
+
"market_prices",
|
| 76 |
+
"input_usage",
|
| 77 |
+
"labor_status",
|
| 78 |
+
"equipment_status",
|
| 79 |
+
"general_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{
|
| 3 |
+
"id": "91e1caba-510b-48d4-b117-d295d1615f7e",
|
| 4 |
+
"timestamp": "2025-09-18T03:27:17.063535Z",
|
| 5 |
+
"farmer_name": "Pranit Chilbule",
|
| 6 |
+
"phone": "9763059811",
|
| 7 |
+
"preferred_lang_time": "Marathi/morning",
|
| 8 |
+
"farm_name": "Pranit",
|
| 9 |
+
"farming_type": "Dairy Farming",
|
| 10 |
+
"geo": {
|
| 11 |
+
"latitude": 20.12281,
|
| 12 |
+
"longitude": 79.337213
|
| 13 |
+
},
|
| 14 |
+
"area": "848.6264 ha",
|
| 15 |
+
"soil_type": "Loam",
|
| 16 |
+
"soil_depth": "Medium (20–60 cm)",
|
| 17 |
+
"ph_category": "Neutral (6.5–7.5)",
|
| 18 |
+
"organic_matter_level": "Medium (2–4%)",
|
| 19 |
+
"irrigation_source": "Borewell / Tube well (electric)",
|
| 20 |
+
"water_quality": "Good (suitable)",
|
| 21 |
+
"irrigation_infrastructure": [],
|
| 22 |
+
"crops": [],
|
| 23 |
+
"horti_crops": [],
|
| 24 |
+
"dairy_num_animals_cows": "998",
|
| 25 |
+
"dairy_num_animals_buffaloes": "0",
|
| 26 |
+
"dairy_num_animals_goats": "0",
|
| 27 |
+
"dairy_breeds": "holstein forbis",
|
| 28 |
+
"dairy_avg_milk_production": 11.8,
|
| 29 |
+
"dairy_fodder_source": [
|
| 30 |
+
"Purchased feed"
|
| 31 |
+
],
|
| 32 |
+
"dairy_veterinary_access": "On-call vet",
|
| 33 |
+
"dairy_milk_storage": "Chilling unit",
|
| 34 |
+
"dairy_market_access": "Milk cooperative",
|
| 35 |
+
"dairy_product_diversification": [
|
| 36 |
+
"Milk"
|
| 37 |
+
],
|
| 38 |
+
"poultry_type": [],
|
| 39 |
+
"poultry_num_birds": "",
|
| 40 |
+
"poultry_housing_type": "",
|
| 41 |
+
"poultry_feed_source": "",
|
| 42 |
+
"poultry_health_mgmt": "",
|
| 43 |
+
"poultry_production_capacity": "",
|
| 44 |
+
"poultry_market_access": "",
|
| 45 |
+
"horti_type": [],
|
| 46 |
+
"horti_protection_type": [],
|
| 47 |
+
"horti_post_harvest_handling": [],
|
| 48 |
+
"horti_market_access": "",
|
| 49 |
+
"plantation_type": [],
|
| 50 |
+
"plantation_area_each": "",
|
| 51 |
+
"plantation_age_plants": "",
|
| 52 |
+
"plantation_processing_facilities": "",
|
| 53 |
+
"plantation_yield_per_unit": "",
|
| 54 |
+
"plantation_market_access": "",
|
| 55 |
+
"plantation_shade_management": "",
|
| 56 |
+
"polygon_coords": [
|
| 57 |
+
[
|
| 58 |
+
20.02293651869251,
|
| 59 |
+
78.70974315966882
|
| 60 |
+
],
|
| 61 |
+
[
|
| 62 |
+
20.021717344498903,
|
| 63 |
+
78.71017214874307
|
| 64 |
+
],
|
| 65 |
+
[
|
| 66 |
+
20.223901741405,
|
| 67 |
+
79.96449489231624
|
| 68 |
+
],
|
| 69 |
+
[
|
| 70 |
+
20.223273534663242,
|
| 71 |
+
79.964451976972
|
| 72 |
+
],
|
| 73 |
+
[
|
| 74 |
+
20.22380509466272,
|
| 75 |
+
79.96468371956895
|
| 76 |
+
]
|
| 77 |
+
]
|
| 78 |
+
},
|
| 79 |
+
{
|
| 80 |
+
"id": "43f556b5-5e96-407c-a121-51b1d48fd2ee",
|
| 81 |
+
"timestamp": "2025-09-18T03:32:01.373807Z",
|
| 82 |
+
"farmer_name": "Pranit Chilbule",
|
| 83 |
+
"phone": "9763059811",
|
| 84 |
+
"preferred_lang_time": "Marathi/morning",
|
| 85 |
+
"farm_name": "Pranit",
|
| 86 |
+
"farming_type": "Dairy Farming",
|
| 87 |
+
"geo": {
|
| 88 |
+
"latitude": 20.12281,
|
| 89 |
+
"longitude": 79.337213
|
| 90 |
+
},
|
| 91 |
+
"area": "848.6264 ha",
|
| 92 |
+
"soil_type": "Loam",
|
| 93 |
+
"soil_depth": "Medium (20–60 cm)",
|
| 94 |
+
"ph_category": "Neutral (6.5–7.5)",
|
| 95 |
+
"organic_matter_level": "Medium (2–4%)",
|
| 96 |
+
"irrigation_source": "Borewell / Tube well (electric)",
|
| 97 |
+
"water_quality": "Good (suitable)",
|
| 98 |
+
"irrigation_infrastructure": [],
|
| 99 |
+
"crops": [],
|
| 100 |
+
"horti_crops": [],
|
| 101 |
+
"dairy_num_animals_cows": "998",
|
| 102 |
+
"dairy_num_animals_buffaloes": "0",
|
| 103 |
+
"dairy_num_animals_goats": "0",
|
| 104 |
+
"dairy_breeds": "holstein forbis",
|
| 105 |
+
"dairy_avg_milk_production": 11.8,
|
| 106 |
+
"dairy_fodder_source": [
|
| 107 |
+
"Purchased feed"
|
| 108 |
+
],
|
| 109 |
+
"dairy_veterinary_access": "On-call vet",
|
| 110 |
+
"dairy_milk_storage": "Chilling unit",
|
| 111 |
+
"dairy_market_access": "Milk cooperative",
|
| 112 |
+
"dairy_product_diversification": [
|
| 113 |
+
"Milk"
|
| 114 |
+
],
|
| 115 |
+
"poultry_type": [],
|
| 116 |
+
"poultry_num_birds": "",
|
| 117 |
+
"poultry_housing_type": "",
|
| 118 |
+
"poultry_feed_source": "",
|
| 119 |
+
"poultry_health_mgmt": "",
|
| 120 |
+
"poultry_production_capacity": "",
|
| 121 |
+
"poultry_market_access": "",
|
| 122 |
+
"horti_type": [],
|
| 123 |
+
"horti_protection_type": [],
|
| 124 |
+
"horti_post_harvest_handling": [],
|
| 125 |
+
"horti_market_access": "",
|
| 126 |
+
"plantation_type": [],
|
| 127 |
+
"plantation_area_each": "",
|
| 128 |
+
"plantation_age_plants": "",
|
| 129 |
+
"plantation_processing_facilities": "",
|
| 130 |
+
"plantation_yield_per_unit": "",
|
| 131 |
+
"plantation_market_access": "",
|
| 132 |
+
"plantation_shade_management": "",
|
| 133 |
+
"polygon_coords": [
|
| 134 |
+
[
|
| 135 |
+
20.02293651869251,
|
| 136 |
+
78.70974315966882
|
| 137 |
+
],
|
| 138 |
+
[
|
| 139 |
+
20.021717344498903,
|
| 140 |
+
78.71017214874307
|
| 141 |
+
],
|
| 142 |
+
[
|
| 143 |
+
20.223901741405,
|
| 144 |
+
79.96449489231624
|
| 145 |
+
],
|
| 146 |
+
[
|
| 147 |
+
20.223273534663242,
|
| 148 |
+
79.964451976972
|
| 149 |
+
],
|
| 150 |
+
[
|
| 151 |
+
20.22380509466272,
|
| 152 |
+
79.96468371956895
|
| 153 |
+
]
|
| 154 |
+
]
|
| 155 |
+
}
|
| 156 |
+
]
|
data/gen_ai_output/d600ada6-b203-46ba-8d40-edf84acb389c_insights_20250910_162902.json
ADDED
|
@@ -0,0 +1,212 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"summary": "The farm demonstrates strong dairy production with a high number of Holstein Friesian cows. Key strengths include regular veterinary care and access to a chilling unit. Primary focus areas should be fodder optimization, milk value addition, and exploring potential government subsidies to enhance profitability and long-term sustainability.",
|
| 3 |
+
"key_metrics": {
|
| 4 |
+
"farm_size": "1.2110 ha",
|
| 5 |
+
"farming_type": "Dairy Farming",
|
| 6 |
+
"soil_ph_status": "Neutral (6.5–7.5)",
|
| 7 |
+
"organic_matter_level": "Medium (2–4%)",
|
| 8 |
+
"primary_irrigation": "Borewell / Tube well (electric)",
|
| 9 |
+
"crop_diversity_score": 0,
|
| 10 |
+
"water_quality_rating": "Good (suitable)",
|
| 11 |
+
"production_focus": "Dairy products"
|
| 12 |
+
},
|
| 13 |
+
"recommendations": [
|
| 14 |
+
"HIGH PRIORITY: Optimize fodder management by transitioning to a mixed fodder system (including locally available grasses and legumes) to reduce purchased feed costs by 20% and improve milk yield by 15% within 6 months.",
|
| 15 |
+
"MEDIUM PRIORITY: Invest in a biogas digester using cow dung to generate renewable energy, reduce reliance on electricity, and produce organic fertilizer. Estimated ROI: 24 months, reducing electricity costs and fertilizer expenses.",
|
| 16 |
+
"ONGOING: Regularly conduct soil tests (at least annually) and adjust fertilizer application based on findings to optimize nutrient utilization and reduce fertilizer costs. Implement rotational grazing where possible to ensure soil fertility.",
|
| 17 |
+
"STRATEGIC: Explore the cultivation of fodder crops (e.g., Napier grass, hybrid sorghum) on a portion of the farm (0.2 ha) to reduce reliance on purchased feed. Risk: potential yield variations depending on monsoon conditions; mitigation through irrigation and drought-resistant varieties."
|
| 18 |
+
],
|
| 19 |
+
"risk_factors": [
|
| 20 |
+
"IMMEDIATE: Over-reliance on purchased feed exposes the farm to fluctuating feed prices. This necessitates a swift shift towards a more self-sufficient fodder system.",
|
| 21 |
+
"SEASONAL: Reduced milk production during the summer months due to heat stress. Mitigate this by providing shade and improved cooling systems for the cattle.",
|
| 22 |
+
"SYSTEMIC: Potential depletion of groundwater levels due to heavy reliance on borewell irrigation. Implementing water conservation techniques such as drip irrigation and rainwater harvesting is crucial."
|
| 23 |
+
],
|
| 24 |
+
"growth_opportunities": [
|
| 25 |
+
"Value addition opportunity with estimated revenue increase of 25%: Process surplus milk into value-added products like ghee, paneer, and curd, targeting a 25% increase in revenue within 12 months.",
|
| 26 |
+
"Technology adoption with specific ROI projections: Implement a mobile app for herd management to optimize feeding schedules, monitor animal health and track milk production, improving efficiency by 15% within 6 months.",
|
| 27 |
+
"Market linkage development with implementation roadmap: Establish direct links with local dairies or urban consumers for fresh milk and dairy products, aiming for a 10% increase in sales in 6 months.",
|
| 28 |
+
"Skill development area with training recommendations: Training in advanced dairy farming techniques, including disease prevention, improved animal handling, and value-added product processing, through the local Krishi Vigyan Kendra."
|
| 29 |
+
],
|
| 30 |
+
"financial_overview": {
|
| 31 |
+
"estimated_monthly_costs": "₹25,000 - ₹35,000 (estimate based on fodder, labor, and electricity costs for 100 cows)",
|
| 32 |
+
"potential_monthly_income": "₹50,000 - ₹75,000 (estimate factoring in current production and potential gains from value addition)",
|
| 33 |
+
"profit_margin_range": "20% - 40% depending on market conditions and feed costs.",
|
| 34 |
+
"cost_optimization": [
|
| 35 |
+
"Reduce electricity cost for irrigation by ₹1,500/month by implementing water-efficient drip irrigation.",
|
| 36 |
+
"Optimize fertilizer application based on soil tests to save ₹5,000 annually."
|
| 37 |
+
],
|
| 38 |
+
"revenue_enhancement": [
|
| 39 |
+
"Increase milk price by ₹1/L by ensuring consistent high quality and exploring organic certification.",
|
| 40 |
+
"Add value-added dairy products (paneer, ghee) for additional ₹15,000/month."
|
| 41 |
+
]
|
| 42 |
+
},
|
| 43 |
+
"environmental_sustainability": {
|
| 44 |
+
"carbon_footprint_assessment": "Moderate carbon footprint from methane emissions; potential for a 10% reduction with improved manure management (biogas digester).",
|
| 45 |
+
"soil_health_status": "Soil is neutral with medium organic matter; focus on increasing organic carbon content through manure management and cover crops.",
|
| 46 |
+
"water_conservation_potential": "Potential to save 25,000 liters/month by converting to drip irrigation for a portion of the farm.",
|
| 47 |
+
"biodiversity_enhancement": [
|
| 48 |
+
"Plant local, drought-resistant trees (Neem, Babool) along farm borders for shade, windbreaks, and habitat creation.",
|
| 49 |
+
"Implement intercropping with legume crops to improve soil fertility and attract beneficial insects."
|
| 50 |
+
],
|
| 51 |
+
"climate_resilience": [
|
| 52 |
+
"Install shade nets for the cattle shed to mitigate heat stress during peak summer months.",
|
| 53 |
+
"Explore drought-resistant fodder varieties to reduce reliance on irrigation during dry spells."
|
| 54 |
+
]
|
| 55 |
+
},
|
| 56 |
+
"technology_integration": [
|
| 57 |
+
"IoT sensors for monitoring milk production and animal health – Expected savings: ₹2,000/year in veterinary costs.",
|
| 58 |
+
"Mobile app for herd management – Efficiency gain: 15% in labor management.",
|
| 59 |
+
"Mechanization of fodder harvesting (if feasible) – Labor cost reduction: 10% in labor costs.",
|
| 60 |
+
"Digital marketing platform for direct sales – Market reach increase: 20% in local markets."
|
| 61 |
+
],
|
| 62 |
+
"benchmarking_analysis": {
|
| 63 |
+
"regional_performance": "Milk yield is above the regional average. However, fodder cost and value addition opportunities are below regional best practices.",
|
| 64 |
+
"best_practice_gaps": "Diversification into value-added products is limited; fodder management requires significant improvement.",
|
| 65 |
+
"competitive_advantages": "Strong herd size and regular veterinary care provides a strong foundation.",
|
| 66 |
+
"improvement_potential": "Significant improvements are possible through optimized fodder management and value addition; increasing milk yield by 10% and reducing feed costs by 20% are achievable targets."
|
| 67 |
+
},
|
| 68 |
+
"future_projections": {
|
| 69 |
+
"year_1_targets": "Increase average milk yield by 5%, reduce feed costs by 10%, and introduce one value-added dairy product.",
|
| 70 |
+
"year_3_vision": "Establish a small-scale value-addition unit, implement water conservation measures, and increase farm income by 30%.",
|
| 71 |
+
"year_5_potential": "Achieve self-sufficiency in fodder production, secure organic certification for milk products, and explore agritourism possibilities.",
|
| 72 |
+
"market_trend_impact": "Growing demand for organic and locally sourced dairy products presents a strong opportunity for growth.",
|
| 73 |
+
"climate_adaptation_timeline": "Phase 1: Drought-resistant fodder selection (0-6 months); Phase 2: Rainwater harvesting (6-18 months); Phase 3: Drip irrigation expansion (18-36 months)."
|
| 74 |
+
},
|
| 75 |
+
"action_plan": {
|
| 76 |
+
"short_term (0-6 months)": [
|
| 77 |
+
"Conduct a detailed soil test and adjust fertilizer application.",
|
| 78 |
+
"Research government subsidies for biogas digesters and water conservation techniques.",
|
| 79 |
+
"Begin transitioning to a mixed fodder system."
|
| 80 |
+
],
|
| 81 |
+
"medium_term (6-18 months)": [
|
| 82 |
+
"Pilot a value-added dairy product (e.g., paneer or ghee).",
|
| 83 |
+
"Implement a mobile app for herd management.",
|
| 84 |
+
"Explore options for rainwater harvesting."
|
| 85 |
+
],
|
| 86 |
+
"long_term (2-5 years)": [
|
| 87 |
+
"Install a biogas digester.",
|
| 88 |
+
"Develop a direct-to-consumer marketing strategy.",
|
| 89 |
+
"Consider organic certification."
|
| 90 |
+
]
|
| 91 |
+
},
|
| 92 |
+
"resource_requirements": {
|
| 93 |
+
"financial_planning": {
|
| 94 |
+
"immediate_investment_needed": "₹50,000 for initial improvements in fodder management and water conservation.",
|
| 95 |
+
"annual_investment_budget": "₹20,000 for seeds, fertilizers, and minor equipment upgrades.",
|
| 96 |
+
"potential_loan_requirements": "₹2,00,000 for biogas digester installation with a 5-year repayment plan.",
|
| 97 |
+
"subsidy_opportunities": [
|
| 98 |
+
"National Dairy Plan: Potential subsidies for improved animal husbandry practices.",
|
| 99 |
+
"Pradhan Mantri Krishi Sinchayee Yojana: Subsidies for drip irrigation and water conservation."
|
| 100 |
+
]
|
| 101 |
+
},
|
| 102 |
+
"knowledge_development": [
|
| 103 |
+
"Dairy farm management training: Duration: 2 days; Provider: Local Krishi Vigyan Kendra.",
|
| 104 |
+
"Value-added product processing training: Duration: 1 week; Provider: Local dairy cooperative."
|
| 105 |
+
],
|
| 106 |
+
"infrastructure_upgrades": [
|
| 107 |
+
"Biogas digester installation: Cost: ₹2,00,000; Installation time: 2 months.",
|
| 108 |
+
"Drip irrigation system: Cost: ₹50,000; Installation time: 1 month."
|
| 109 |
+
]
|
| 110 |
+
},
|
| 111 |
+
"data_visualizations": [
|
| 112 |
+
{
|
| 113 |
+
"chart_title": "Production Efficiency Analysis",
|
| 114 |
+
"chart_type": "radar",
|
| 115 |
+
"chart_description": "Multi-dimensional farm performance assessment comparing current (green) vs target (blue) scores across key areas (max score 10).",
|
| 116 |
+
"data_labels": [
|
| 117 |
+
"Soil Health",
|
| 118 |
+
"Water Management",
|
| 119 |
+
"Crop Productivity",
|
| 120 |
+
"Market Access",
|
| 121 |
+
"Technology Use",
|
| 122 |
+
"Sustainability"
|
| 123 |
+
],
|
| 124 |
+
"current_scores": [
|
| 125 |
+
6,
|
| 126 |
+
5,
|
| 127 |
+
4,
|
| 128 |
+
6,
|
| 129 |
+
3,
|
| 130 |
+
4
|
| 131 |
+
],
|
| 132 |
+
"target_scores": [
|
| 133 |
+
8,
|
| 134 |
+
7,
|
| 135 |
+
6,
|
| 136 |
+
8,
|
| 137 |
+
6,
|
| 138 |
+
7
|
| 139 |
+
],
|
| 140 |
+
"max_score": 10
|
| 141 |
+
},
|
| 142 |
+
{
|
| 143 |
+
"chart_title": "Monthly Income Projection",
|
| 144 |
+
"chart_type": "line",
|
| 145 |
+
"chart_description": "Expected income growth over 12 months with recommended improvements (current vs. projected). Figures are illustrative.",
|
| 146 |
+
"data_labels": [
|
| 147 |
+
"Jan",
|
| 148 |
+
"Feb",
|
| 149 |
+
"Mar",
|
| 150 |
+
"Apr",
|
| 151 |
+
"May",
|
| 152 |
+
"Jun",
|
| 153 |
+
"Jul",
|
| 154 |
+
"Aug",
|
| 155 |
+
"Sep",
|
| 156 |
+
"Oct",
|
| 157 |
+
"Nov",
|
| 158 |
+
"Dec"
|
| 159 |
+
],
|
| 160 |
+
"current_income": [
|
| 161 |
+
50000,
|
| 162 |
+
52000,
|
| 163 |
+
55000,
|
| 164 |
+
58000,
|
| 165 |
+
60000,
|
| 166 |
+
58000,
|
| 167 |
+
55000,
|
| 168 |
+
52000,
|
| 169 |
+
50000,
|
| 170 |
+
48000,
|
| 171 |
+
46000,
|
| 172 |
+
45000
|
| 173 |
+
],
|
| 174 |
+
"projected_income": [
|
| 175 |
+
55000,
|
| 176 |
+
57000,
|
| 177 |
+
60000,
|
| 178 |
+
65000,
|
| 179 |
+
70000,
|
| 180 |
+
68000,
|
| 181 |
+
65000,
|
| 182 |
+
62000,
|
| 183 |
+
60000,
|
| 184 |
+
58000,
|
| 185 |
+
55000,
|
| 186 |
+
53000
|
| 187 |
+
],
|
| 188 |
+
"improvement_percentage": 15
|
| 189 |
+
},
|
| 190 |
+
{
|
| 191 |
+
"chart_title": "Resource Optimization Opportunities",
|
| 192 |
+
"chart_type": "doughnut",
|
| 193 |
+
"chart_description": "Potential annual cost savings (₹) by optimizing various farm resources. Figures are illustrative.",
|
| 194 |
+
"data_labels": [
|
| 195 |
+
"Water Conservation",
|
| 196 |
+
"Energy Efficiency",
|
| 197 |
+
"Input Optimization",
|
| 198 |
+
"Labor Efficiency",
|
| 199 |
+
"Technology Adoption"
|
| 200 |
+
],
|
| 201 |
+
"savings_potential": [
|
| 202 |
+
6000,
|
| 203 |
+
4000,
|
| 204 |
+
5000,
|
| 205 |
+
3000,
|
| 206 |
+
2000
|
| 207 |
+
],
|
| 208 |
+
"total_annual_savings": 20000
|
| 209 |
+
}
|
| 210 |
+
],
|
| 211 |
+
"expert_commentary": "Mr. Doe, your dairy farm has a solid foundation with a substantial herd size and good animal health practices. Your current milk production is commendable; however, optimizing fodder costs and diversifying into value-added products will significantly enhance your profitability. I strongly recommend transitioning to a more sustainable fodder management system, incorporating local grasses and legumes. This, coupled with exploring government subsidies for water conservation and biogas digesters, will reduce your operating costs while enhancing environmental sustainability. The potential to increase your income by 30-40% within three years is quite realistic. By implementing these strategies, you can not only increase your immediate profits but also create a more resilient and profitable farm for the long term. Remember, continuous learning and adapting to best practices will ensure long-term success. Let's work together to achieve your goals and develop a detailed action plan. We can begin by conducting a comprehensive soil test to inform fertilizer recommendations and explore local cooperatives or government agencies that could help you access the necessary support and resources."
|
| 212 |
+
}
|
data/gen_ai_output/df48d33f-79ec-4286-95dd-de2c8ee9c0df_insights_20250910_134006.json
ADDED
|
@@ -0,0 +1,209 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"summary": "Green Acres Farm demonstrates strong dairy production with a high milk yield per cow. Primary focus areas should be on fodder cost optimization, value addition to milk, and exploring government subsidies for infrastructure and technology upgrades to enhance profitability and sustainability.",
|
| 3 |
+
"key_metrics": {
|
| 4 |
+
"farm_size": "0.6871 ha",
|
| 5 |
+
"farming_type": "Dairy Farming",
|
| 6 |
+
"soil_ph_status": "Neutral (6.5–7.5)",
|
| 7 |
+
"organic_matter_level": "Medium (2–4%)",
|
| 8 |
+
"primary_irrigation": "Borewell / Tube well (electric)",
|
| 9 |
+
"crop_diversity_score": 0,
|
| 10 |
+
"water_quality_rating": "Good (suitable)",
|
| 11 |
+
"production_focus": "Dairy products"
|
| 12 |
+
},
|
| 13 |
+
"recommendations": [
|
| 14 |
+
"HIGH PRIORITY: Implement improved fodder management practices (e.g., silage making, crop rotation with fodder crops) to reduce purchased feed costs by 15% and increase milk production by 10% within 6 months.",
|
| 15 |
+
"MEDIUM PRIORITY: Explore and apply for government subsidies (e.g., National Dairy Plan) for upgrading existing milking facilities and improving animal hygiene, achieving a 10% increase in milk production with a 12-month ROI.",
|
| 16 |
+
"ONGOING: Conduct regular veterinary check-ups for cows (monthly) to prevent disease outbreaks and maintain high milk yield and animal welfare.",
|
| 17 |
+
"STRATEGIC: Investigate the feasibility of setting up a small-scale dairy processing unit (e.g., paneer, ghee production) to add value to surplus milk and increase revenue by 25% within 24 months."
|
| 18 |
+
],
|
| 19 |
+
"risk_factors": [
|
| 20 |
+
"IMMEDIATE: Over-reliance on purchased feed exposes the farm to fluctuating feed prices. This necessitates exploring cost-effective fodder alternatives.",
|
| 21 |
+
"SEASONAL: Milk prices can fluctuate seasonally. Strategic milk marketing and exploring value-added products can help mitigate this risk.",
|
| 22 |
+
"SYSTEMIC: Dependence on a single borewell for irrigation poses risks related to groundwater depletion and potential energy cost increases. Explore rainwater harvesting."
|
| 23 |
+
],
|
| 24 |
+
"growth_opportunities": [
|
| 25 |
+
"Value addition opportunity with estimated revenue increase of 25%: Processing surplus milk into paneer and ghee, potentially increasing monthly income by ₹15,000 - ₹25,000.",
|
| 26 |
+
"Technology adoption with specific ROI projections: Implementing an automated milking system could reduce labor costs and improve hygiene, potentially achieving a 15% increase in milk yield with a 36-month ROI (estimated).",
|
| 27 |
+
"Market linkage development with implementation roadmap: Direct marketing to local hotels and restaurants to sell surplus milk, potentially increasing revenue by 10% within 6 months.",
|
| 28 |
+
"Skill development area with training recommendations: Training in advanced animal husbandry practices, focusing on improved nutrition, breeding, and disease management. "
|
| 29 |
+
],
|
| 30 |
+
"financial_overview": {
|
| 31 |
+
"estimated_monthly_costs": "₹80,000 - ₹1,00,000 (estimate based on 150 cows, feed costs, labor, electricity)",
|
| 32 |
+
"potential_monthly_income": "₹1,20,000 - ₹1,50,000 (current income + potential gains from recommendations)",
|
| 33 |
+
"profit_margin_range": "20% - 30% (estimate, highly sensitive to feed prices and milk market)",
|
| 34 |
+
"cost_optimization": [
|
| 35 |
+
"Reduce feed costs by ₹15,000/month through improved fodder management and silage techniques.",
|
| 36 |
+
"Optimize electricity usage by installing energy-efficient pumps, saving approximately ₹2000/month."
|
| 37 |
+
],
|
| 38 |
+
"revenue_enhancement": [
|
| 39 |
+
"Increase milk price by ₹2/liter through higher quality milk and potential organic certification.",
|
| 40 |
+
"Add paneer and ghee production for an additional ₹15,000 - ₹25,000/month."
|
| 41 |
+
]
|
| 42 |
+
},
|
| 43 |
+
"environmental_sustainability": {
|
| 44 |
+
"carbon_footprint_assessment": "Moderate carbon footprint from livestock methane; potential for 10% reduction through improved manure management and biogas digester implementation.",
|
| 45 |
+
"soil_health_status": "Soil is currently neutral with medium organic matter. Focus on improving organic carbon content through composting and cover cropping.",
|
| 46 |
+
"water_conservation_potential": "Significant potential for water conservation through improved irrigation techniques. Rainwater harvesting is strongly recommended.",
|
| 47 |
+
"biodiversity_enhancement": [
|
| 48 |
+
"Plant drought-resistant fodder crops to increase biodiversity and reduce reliance on purchased feed.",
|
| 49 |
+
"Implement rotational grazing to improve pasture health."
|
| 50 |
+
],
|
| 51 |
+
"climate_resilience": [
|
| 52 |
+
"Adopt drought-resistant fodder varieties and invest in rainwater harvesting systems.",
|
| 53 |
+
"Invest in shade structures for the cows to reduce heat stress during summer."
|
| 54 |
+
]
|
| 55 |
+
},
|
| 56 |
+
"technology_integration": [
|
| 57 |
+
"IoT sensors for monitoring cow health and milk production - Expected savings: ₹5,000/year in labor and reduced vet costs.",
|
| 58 |
+
"Mobile app for feed management and tracking - Efficiency gain: 10% in feed optimization.",
|
| 59 |
+
"Mechanization of feed chopping and mixing - Labor cost reduction: 15%.",
|
| 60 |
+
"Digital marketing platform - Market reach increase: 20%."
|
| 61 |
+
],
|
| 62 |
+
"benchmarking_analysis": {
|
| 63 |
+
"regional_performance": "Farm milk yield (12 L/day/cow) is above the regional average (10 L/day/cow) suggesting strong animal management practices.",
|
| 64 |
+
"best_practice_gaps": "Lack of fodder crop diversification and minimal value-added dairy products compared to high-performing dairy farms in the region.",
|
| 65 |
+
"competitive_advantages": "High milk yield and good animal health are competitive advantages.",
|
| 66 |
+
"improvement_potential": "Significant potential for increasing income by reducing feed costs, improving milk quality, and introducing value-added products."
|
| 67 |
+
},
|
| 68 |
+
"future_projections": {
|
| 69 |
+
"year_1_targets": "Increase average milk yield by 5% and reduce input costs (particularly fodder) by 10%.",
|
| 70 |
+
"year_3_vision": "Establish a small-scale value-addition unit for dairy products and achieve at least 20% reduction in purchased feed.",
|
| 71 |
+
"year_5_potential": "Become a leading dairy farm in the region, known for high-quality, value-added dairy products and sustainable practices.",
|
| 72 |
+
"market_trend_impact": "Growing demand for organic and locally produced dairy products presents significant opportunities if Green Acres Farm adopts organic certification.",
|
| 73 |
+
"climate_adaptation_timeline": "Phase 1: Implement rainwater harvesting and drought-resistant fodder crops (0-12 months). Phase 2: Invest in energy-efficient irrigation (1-3 years)."
|
| 74 |
+
},
|
| 75 |
+
"action_plan": {
|
| 76 |
+
"short_term (0-6 months)": [
|
| 77 |
+
"Conduct a detailed cost analysis of current fodder costs versus improved fodder management practices.",
|
| 78 |
+
"Research and identify government subsidies for dairy farm improvements."
|
| 79 |
+
],
|
| 80 |
+
"medium_term (6-18 months)": [
|
| 81 |
+
"Pilot a small-scale value-added dairy product (paneer or ghee) to assess market demand and profitability.",
|
| 82 |
+
"Explore options for improved energy-efficient irrigation or solar pumps."
|
| 83 |
+
],
|
| 84 |
+
"long_term (2-5 years)": [
|
| 85 |
+
"Invest in a biogas digester to manage manure and reduce reliance on purchased energy.",
|
| 86 |
+
"Develop a direct marketing strategy to access higher-value markets for milk and dairy products."
|
| 87 |
+
]
|
| 88 |
+
},
|
| 89 |
+
"resource_requirements": {
|
| 90 |
+
"financial_planning": {
|
| 91 |
+
"immediate_investment_needed": "₹50,000 for improved fodder management equipment (e.g., silage making equipment)",
|
| 92 |
+
"annual_investment_budget": "₹20,000 for ongoing improvements (e.g., seeds, veterinary care)",
|
| 93 |
+
"potential_loan_requirements": "₹2,00,000 for value-added processing equipment (5-year repayment plan)",
|
| 94 |
+
"subsidy_opportunities": [
|
| 95 |
+
"National Dairy Plan: Potential subsidy for infrastructure improvements (amount varies based on plan).",
|
| 96 |
+
"Pradhan Mantri Krishi Sinchayee Yojana: Potential subsidy for micro-irrigation (amount varies based on plan)."
|
| 97 |
+
]
|
| 98 |
+
},
|
| 99 |
+
"knowledge_development": [
|
| 100 |
+
"Animal husbandry training course - Duration: 40 hours - Provider: Local Krishi Vigyan Kendra",
|
| 101 |
+
"Dairy processing training - Duration: 30 hours - Provider: Local Dairy Cooperative"
|
| 102 |
+
],
|
| 103 |
+
"infrastructure_upgrades": [
|
| 104 |
+
"Improved cattle shed for better hygiene - Cost: ₹1,00,000 - Installation time: 2 months",
|
| 105 |
+
"Value-added processing unit - Cost: ₹1,00,000 - Installation time: 3 months"
|
| 106 |
+
]
|
| 107 |
+
},
|
| 108 |
+
"data_visualizations": [
|
| 109 |
+
{
|
| 110 |
+
"chart_title": "Production Efficiency Analysis",
|
| 111 |
+
"chart_type": "radar",
|
| 112 |
+
"chart_description": "Multi-dimensional farm performance assessment comparing current (green) vs target (blue) scores across key areas (max score 10).",
|
| 113 |
+
"data_labels": [
|
| 114 |
+
"Soil Health",
|
| 115 |
+
"Water Management",
|
| 116 |
+
"Crop Productivity",
|
| 117 |
+
"Market Access",
|
| 118 |
+
"Technology Use",
|
| 119 |
+
"Sustainability"
|
| 120 |
+
],
|
| 121 |
+
"current_scores": [
|
| 122 |
+
7,
|
| 123 |
+
6,
|
| 124 |
+
5,
|
| 125 |
+
6,
|
| 126 |
+
4,
|
| 127 |
+
5
|
| 128 |
+
],
|
| 129 |
+
"target_scores": [
|
| 130 |
+
8,
|
| 131 |
+
8,
|
| 132 |
+
7,
|
| 133 |
+
8,
|
| 134 |
+
7,
|
| 135 |
+
8
|
| 136 |
+
],
|
| 137 |
+
"max_score": 10
|
| 138 |
+
},
|
| 139 |
+
{
|
| 140 |
+
"chart_title": "Monthly Income Projection",
|
| 141 |
+
"chart_type": "line",
|
| 142 |
+
"chart_description": "Expected income growth over 12 months with recommended improvements (current vs. projected). Figures are illustrative.",
|
| 143 |
+
"data_labels": [
|
| 144 |
+
"Jan",
|
| 145 |
+
"Feb",
|
| 146 |
+
"Mar",
|
| 147 |
+
"Apr",
|
| 148 |
+
"May",
|
| 149 |
+
"Jun",
|
| 150 |
+
"Jul",
|
| 151 |
+
"Aug",
|
| 152 |
+
"Sep",
|
| 153 |
+
"Oct",
|
| 154 |
+
"Nov",
|
| 155 |
+
"Dec"
|
| 156 |
+
],
|
| 157 |
+
"current_income": [
|
| 158 |
+
100000,
|
| 159 |
+
100000,
|
| 160 |
+
100000,
|
| 161 |
+
105000,
|
| 162 |
+
110000,
|
| 163 |
+
108000,
|
| 164 |
+
106000,
|
| 165 |
+
104000,
|
| 166 |
+
102000,
|
| 167 |
+
98000,
|
| 168 |
+
96000,
|
| 169 |
+
95000
|
| 170 |
+
],
|
| 171 |
+
"projected_income": [
|
| 172 |
+
105000,
|
| 173 |
+
110000,
|
| 174 |
+
115000,
|
| 175 |
+
120000,
|
| 176 |
+
125000,
|
| 177 |
+
123000,
|
| 178 |
+
121000,
|
| 179 |
+
119000,
|
| 180 |
+
117000,
|
| 181 |
+
113000,
|
| 182 |
+
110000,
|
| 183 |
+
108000
|
| 184 |
+
],
|
| 185 |
+
"improvement_percentage": 13
|
| 186 |
+
},
|
| 187 |
+
{
|
| 188 |
+
"chart_title": "Resource Optimization Opportunities",
|
| 189 |
+
"chart_type": "doughnut",
|
| 190 |
+
"chart_description": "Potential annual cost savings (₹) by optimizing various farm resources. Figures are illustrative.",
|
| 191 |
+
"data_labels": [
|
| 192 |
+
"Water Conservation",
|
| 193 |
+
"Energy Efficiency",
|
| 194 |
+
"Input Optimization",
|
| 195 |
+
"Labor Efficiency",
|
| 196 |
+
"Technology Adoption"
|
| 197 |
+
],
|
| 198 |
+
"savings_potential": [
|
| 199 |
+
10000,
|
| 200 |
+
5000,
|
| 201 |
+
8000,
|
| 202 |
+
3000,
|
| 203 |
+
2000
|
| 204 |
+
],
|
| 205 |
+
"total_annual_savings": 28000
|
| 206 |
+
}
|
| 207 |
+
],
|
| 208 |
+
"expert_commentary": "Mr. John Doe, your Green Acres Farm shows impressive milk yield per cow, which is a strong foundation for growth. However, your reliance on purchased feed significantly impacts your profitability. Prioritizing fodder management – through techniques like silage making and potentially incorporating fodder crops in your farm's rotation – is crucial for reducing costs and enhancing milk production. I estimate a 15% reduction in feed cost and a 10% increase in yield within six months, translating to a significant profit increase. Furthermore, diversifying your milk products into higher-value items such as paneer and ghee can boost your income considerably. Exploring government schemes like the National Dairy Plan can facilitate upgrades to your milking facilities and enhance animal welfare. By implementing these strategies, I am confident you can improve your farm's financial performance and sustainability within a year. Remember, small consistent steps, combined with strategic planning and access to government schemes, will build a stronger, more profitable, and resilient farm. This is achievable, and I'm here to support you every step of the way."
|
| 209 |
+
}
|
data/gen_ai_output/df48d33f-79ec-4286-95dd-de2c8ee9c0df_insights_20250910_134219.json
ADDED
|
@@ -0,0 +1,207 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"summary": "Green Acres Farm demonstrates strong dairy production with a high average milk yield. However, opportunities exist for significant revenue enhancement through value addition, fodder optimization, and strategic cost reduction. Prioritizing milk processing and exploring government subsidies are key to maximizing profitability.",
|
| 3 |
+
"key_metrics": {
|
| 4 |
+
"farm_size": "0.6871 ha",
|
| 5 |
+
"farming_type": "Dairy Farming",
|
| 6 |
+
"soil_ph_status": "Neutral (6.5–7.5)",
|
| 7 |
+
"organic_matter_level": "Medium (2–4%)",
|
| 8 |
+
"primary_irrigation": "Borewell / Tube well (electric)",
|
| 9 |
+
"crop_diversity_score": 0,
|
| 10 |
+
"water_quality_rating": "Good (suitable)",
|
| 11 |
+
"production_focus": "Dairy products"
|
| 12 |
+
},
|
| 13 |
+
"recommendations": [
|
| 14 |
+
"HIGH PRIORITY: Implement improved fodder management practices, including supplementing purchased feed with locally grown fodder crops like Napier grass and hybrid sorghum. This is estimated to increase milk yield by 15-20% within 6 months by improving cattle nutrition.",
|
| 15 |
+
"MEDIUM PRIORITY: Invest in a small-scale milk processing unit (e.g., pasteurization, packaging). This will allow for value addition, increasing income by 25-30% within 12 months and commanding higher prices for value-added products.",
|
| 16 |
+
"ONGOING: Regularly conduct soil testing (twice a year) to monitor nutrient levels and optimize fertilizer application. This ensures efficient nutrient utilization and minimizes fertilizer costs, resulting in long-term cost savings and sustainable soil health.",
|
| 17 |
+
"STRATEGIC: Explore diversification into related ventures like selling organic cow manure as fertilizer (estimated additional ₹5,000-₹10,000 monthly income) after 18 months of consistent production."
|
| 18 |
+
],
|
| 19 |
+
"risk_factors": [
|
| 20 |
+
"IMMEDIATE: Over-reliance on purchased feed exposes the farm to price volatility. This needs to be mitigated by diversifying fodder sources.",
|
| 21 |
+
"SEASONAL: Fluctuations in milk prices during peak production seasons can impact overall income. Explore contract farming or forming a dairy cooperative to stabilize prices and improve market access.",
|
| 22 |
+
"SYSTEMIC: Potential depletion of groundwater levels requires long-term water conservation strategies, such as rainwater harvesting and efficient irrigation techniques."
|
| 23 |
+
],
|
| 24 |
+
"growth_opportunities": [
|
| 25 |
+
"Value addition opportunity with estimated revenue increase of 25-30% by processing milk into value-added products like ghee, paneer, and curd.",
|
| 26 |
+
"Technology adoption with ROI projections: Implementing an automated milking system could potentially reduce labor costs by 10-15% over 24 months.",
|
| 27 |
+
"Market linkage development: Establishing direct sales channels with local hotels, restaurants, and retailers will improve margins and reduce dependency on local collection centers. This is estimated to increase revenue by 10-15% in 6 months.",
|
| 28 |
+
"Skill development area: Training in dairy farm management techniques, animal husbandry best practices, and value-added product processing will improve overall farm efficiency."
|
| 29 |
+
],
|
| 30 |
+
"financial_overview": {
|
| 31 |
+
"estimated_monthly_costs": "₹25,000 - ₹35,000 (Estimate based on fodder, labor, and electricity costs for a dairy farm of this scale)",
|
| 32 |
+
"potential_monthly_income": "₹45,000 - ₹60,000 with improvements (based on current milk production and potential gains from value addition)",
|
| 33 |
+
"profit_margin_range": "20% - 40% depending on market conditions and feed prices",
|
| 34 |
+
"cost_optimization": [
|
| 35 |
+
"Reduce electricity costs for irrigation by ₹1,000/month by installing energy-efficient pumps.",
|
| 36 |
+
"Optimize fertilizer application based on soil tests to save ₹3,000 annually."
|
| 37 |
+
],
|
| 38 |
+
"revenue_enhancement": [
|
| 39 |
+
"Increase milk price by ₹1/L by ensuring higher quality standards and building brand reputation.",
|
| 40 |
+
"Add value-added dairy products for an additional ₹15,000/month."
|
| 41 |
+
]
|
| 42 |
+
},
|
| 43 |
+
"environmental_sustainability": {
|
| 44 |
+
"carbon_footprint_assessment": "Moderate carbon footprint primarily from livestock methane; reduction potential through improved manure management (biogas digester).",
|
| 45 |
+
"soil_health_status": "Soil is Neutral with Medium organic matter; focus on increasing organic carbon content through composting and cover cropping.",
|
| 46 |
+
"water_conservation_potential": "Potential to save 20,000 liters/season through efficient irrigation techniques and water harvesting.",
|
| 47 |
+
"biodiversity_enhancement": [
|
| 48 |
+
"Plant local fruit trees (e.g., mango, guava) along farm borders to enhance biodiversity and provide additional income.",
|
| 49 |
+
"Implement intercropping to improve soil health and attract beneficial insects."
|
| 50 |
+
],
|
| 51 |
+
"climate_resilience": [
|
| 52 |
+
"Improve livestock shelter to mitigate heat stress during summer.",
|
| 53 |
+
"Consider drought-resistant fodder varieties for more stable feed supplies."
|
| 54 |
+
]
|
| 55 |
+
},
|
| 56 |
+
"technology_integration": [
|
| 57 |
+
"IoT sensors for monitoring milk production and animal health - Expected savings: ₹2,000/year (estimate).",
|
| 58 |
+
"Mobile app for farm record-keeping and milk yield tracking - Efficiency gain: 5% (estimate).",
|
| 59 |
+
"No immediate need for mechanization given current scale.",
|
| 60 |
+
"Digital marketing platform for direct sales to consumers and wholesalers - Market reach increase: 30% (estimate)."
|
| 61 |
+
],
|
| 62 |
+
"benchmarking_analysis": {
|
| 63 |
+
"regional_performance": "Farm milk yield (12 L/day per cow) is above the regional average (assumed 10 L/day).",
|
| 64 |
+
"best_practice_gaps": "Fodder management, value addition, and market linkages could be improved.",
|
| 65 |
+
"competitive_advantages": "High average milk yield and good water quality are strengths.",
|
| 66 |
+
"improvement_potential": "Significant potential exists in value addition and fodder management to increase profitability."
|
| 67 |
+
},
|
| 68 |
+
"future_projections": {
|
| 69 |
+
"year_1_targets": "Increase average milk yield by 5%, reduce feed costs by 10%, and introduce at least one value-added dairy product.",
|
| 70 |
+
"year_3_vision": "Establish a small-scale milk processing unit, achieve 20% reduction in feed costs, and increase milk sales through direct marketing.",
|
| 71 |
+
"year_5_potential": "Become a certified organic dairy farm, diversify income streams, and improve resilience to market and climatic fluctuations.",
|
| 72 |
+
"market_trend_impact": "Growing consumer preference for organic dairy products presents a significant opportunity.",
|
| 73 |
+
"climate_adaptation_timeline": "Phase 1 (0-12 months): Improve livestock shelter and adopt drought-resistant fodder; Phase 2 (1-3 years): Invest in rainwater harvesting."
|
| 74 |
+
},
|
| 75 |
+
"action_plan": {
|
| 76 |
+
"short_term (0-6 months)": [
|
| 77 |
+
"Conduct detailed soil and fodder analysis, revise feeding practices.",
|
| 78 |
+
"Research and apply for government subsidies for milk processing units."
|
| 79 |
+
],
|
| 80 |
+
"medium_term (6-18 months)": [
|
| 81 |
+
"Pilot production of value-added dairy products and establish direct sales channels.",
|
| 82 |
+
"Invest in basic milk processing equipment."
|
| 83 |
+
],
|
| 84 |
+
"long_term (2-5 years)": [
|
| 85 |
+
"Explore options for biogas digester installation, organic certification, and farm diversification."
|
| 86 |
+
]
|
| 87 |
+
},
|
| 88 |
+
"resource_requirements": {
|
| 89 |
+
"financial_planning": {
|
| 90 |
+
"immediate_investment_needed": "₹50,000 - ₹1,00,000 for improved fodder and basic processing equipment.",
|
| 91 |
+
"annual_investment_budget": "₹20,000 - ₹30,000 for ongoing improvements and maintenance.",
|
| 92 |
+
"potential_loan_requirements": "₹1,00,000 - ₹2,00,000 for a milk processing unit, with a 3-year repayment plan.",
|
| 93 |
+
"subsidy_opportunities": [
|
| 94 |
+
"National Dairy Plan: Check for subsidies on improved cattle breeds, fodder development, and milk processing equipment.",
|
| 95 |
+
"State-level schemes: Explore state government schemes supporting dairy farming and value addition."
|
| 96 |
+
]
|
| 97 |
+
},
|
| 98 |
+
"knowledge_development": [
|
| 99 |
+
"Dairy farm management training (3-month course) - Cost: ₹5,000-₹10,000",
|
| 100 |
+
"Value-added product processing training (1-week course) - Cost: ₹2,000-₹4,000"
|
| 101 |
+
],
|
| 102 |
+
"infrastructure_upgrades": [
|
| 103 |
+
"No immediate infrastructure upgrades are crucial; focus on resource management."
|
| 104 |
+
]
|
| 105 |
+
},
|
| 106 |
+
"data_visualizations": [
|
| 107 |
+
{
|
| 108 |
+
"chart_title": "Production Efficiency Analysis",
|
| 109 |
+
"chart_type": "radar",
|
| 110 |
+
"chart_description": "Multi-dimensional farm performance assessment comparing current (green) vs target (blue) scores across key areas (max score 10).",
|
| 111 |
+
"data_labels": [
|
| 112 |
+
"Soil Health",
|
| 113 |
+
"Water Management",
|
| 114 |
+
"Crop Productivity",
|
| 115 |
+
"Market Access",
|
| 116 |
+
"Technology Use",
|
| 117 |
+
"Sustainability"
|
| 118 |
+
],
|
| 119 |
+
"current_scores": [
|
| 120 |
+
7,
|
| 121 |
+
7,
|
| 122 |
+
6,
|
| 123 |
+
5,
|
| 124 |
+
4,
|
| 125 |
+
5
|
| 126 |
+
],
|
| 127 |
+
"target_scores": [
|
| 128 |
+
8,
|
| 129 |
+
8,
|
| 130 |
+
7,
|
| 131 |
+
7,
|
| 132 |
+
6,
|
| 133 |
+
7
|
| 134 |
+
],
|
| 135 |
+
"max_score": 10
|
| 136 |
+
},
|
| 137 |
+
{
|
| 138 |
+
"chart_title": "Monthly Income Projection",
|
| 139 |
+
"chart_type": "line",
|
| 140 |
+
"chart_description": "Expected income growth over 12 months with recommended improvements (current vs. projected). Figures are illustrative.",
|
| 141 |
+
"data_labels": [
|
| 142 |
+
"Jan",
|
| 143 |
+
"Feb",
|
| 144 |
+
"Mar",
|
| 145 |
+
"Apr",
|
| 146 |
+
"May",
|
| 147 |
+
"Jun",
|
| 148 |
+
"Jul",
|
| 149 |
+
"Aug",
|
| 150 |
+
"Sep",
|
| 151 |
+
"Oct",
|
| 152 |
+
"Nov",
|
| 153 |
+
"Dec"
|
| 154 |
+
],
|
| 155 |
+
"current_income": [
|
| 156 |
+
25000,
|
| 157 |
+
25000,
|
| 158 |
+
25000,
|
| 159 |
+
25000,
|
| 160 |
+
25000,
|
| 161 |
+
25000,
|
| 162 |
+
25000,
|
| 163 |
+
25000,
|
| 164 |
+
25000,
|
| 165 |
+
25000,
|
| 166 |
+
25000,
|
| 167 |
+
25000
|
| 168 |
+
],
|
| 169 |
+
"projected_income": [
|
| 170 |
+
27500,
|
| 171 |
+
27500,
|
| 172 |
+
30000,
|
| 173 |
+
32500,
|
| 174 |
+
35000,
|
| 175 |
+
37500,
|
| 176 |
+
37500,
|
| 177 |
+
37500,
|
| 178 |
+
35000,
|
| 179 |
+
32500,
|
| 180 |
+
30000,
|
| 181 |
+
27500
|
| 182 |
+
],
|
| 183 |
+
"improvement_percentage": 10
|
| 184 |
+
},
|
| 185 |
+
{
|
| 186 |
+
"chart_title": "Resource Optimization Opportunities",
|
| 187 |
+
"chart_type": "doughnut",
|
| 188 |
+
"chart_description": "Potential annual cost savings (₹) by optimizing various farm resources. Figures are illustrative.",
|
| 189 |
+
"data_labels": [
|
| 190 |
+
"Water Conservation",
|
| 191 |
+
"Energy Efficiency",
|
| 192 |
+
"Input Optimization",
|
| 193 |
+
"Labor Efficiency",
|
| 194 |
+
"Technology Adoption"
|
| 195 |
+
],
|
| 196 |
+
"savings_potential": [
|
| 197 |
+
2000,
|
| 198 |
+
1200,
|
| 199 |
+
3000,
|
| 200 |
+
1000,
|
| 201 |
+
800
|
| 202 |
+
],
|
| 203 |
+
"total_annual_savings": 8000
|
| 204 |
+
}
|
| 205 |
+
],
|
| 206 |
+
"expert_commentary": "Mr. Doe, your Green Acres Farm shows excellent potential. Your high milk yield per cow is a significant strength, indicating good animal husbandry practices. However, focusing on value addition and efficient fodder management will dramatically improve your profitability. By processing your surplus milk into products like paneer and ghee, you can significantly boost your income, moving beyond the current dependence on raw milk sales. Investing in a small-scale processing unit, while requiring an initial investment, presents a high return on investment (ROI) within a year. Simultaneously, optimizing your fodder strategy by incorporating local, high-yielding grasses will significantly reduce feed costs, further enhance milk production, and provide a more sustainable farming model. Exploring government subsidy schemes for processing units and fodder development is highly recommended. With these strategic steps, you can realistically double your farm income in the next 2-3 years, ensuring a stronger and more sustainable livelihood."
|
| 207 |
+
}
|
data/gen_ai_output/df48d33f-79ec-4286-95dd-de2c8ee9c0df_insights_20250910_134314.json
ADDED
|
@@ -0,0 +1,209 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"summary": "Green Acres Farm demonstrates strong potential in dairy farming with a high milk yield. Primary focus areas are fodder optimization, value addition to milk, and exploring government subsidies to improve infrastructure and technology adoption. Risk mitigation is critical, particularly regarding feed costs and potential seasonal variations in milk production.",
|
| 3 |
+
"key_metrics": {
|
| 4 |
+
"farm_size": "0.6871 ha",
|
| 5 |
+
"farming_type": "Dairy Farming",
|
| 6 |
+
"soil_ph_status": "Neutral (6.5–7.5)",
|
| 7 |
+
"organic_matter_level": "Medium (2–4%)",
|
| 8 |
+
"primary_irrigation": "Borewell / Tube well (electric)",
|
| 9 |
+
"crop_diversity_score": 0,
|
| 10 |
+
"water_quality_rating": "Good (suitable)",
|
| 11 |
+
"production_focus": "Dairy products"
|
| 12 |
+
},
|
| 13 |
+
"recommendations": [
|
| 14 |
+
"HIGH PRIORITY: Optimize fodder management by exploring hybrid Napier grass cultivation and silage production techniques, aiming for a 20% reduction in feed costs and a 15% increase in milk yield within 6 months.",
|
| 15 |
+
"MEDIUM PRIORITY: Invest in a solar-powered water pump for the existing borewell. Estimated ROI: 18 months through electricity savings (estimated savings ₹5,000/month; initial investment: ₹1,50,000).",
|
| 16 |
+
"ONGOING: Regularly conduct soil testing (twice annually) to optimize fertilizer application and maintain soil health, reducing fertilizer costs by 10% annually.",
|
| 17 |
+
"STRATEGIC: Explore value-added dairy products (paneer, ghee, yogurt). This could increase monthly income by 25-30% within 12 months, requiring a small investment in processing equipment (estimated ₹50,000)."
|
| 18 |
+
],
|
| 19 |
+
"risk_factors": [
|
| 20 |
+
"IMMEDIATE: Complete reliance on purchased feed exposes the farm to fluctuating market prices. Mitigation: Explore local fodder cultivation and silage preservation.",
|
| 21 |
+
"SEASONAL: Milk production might fluctuate seasonally. Mitigation: Maintain consistent feed quality throughout the year and explore supplementary feeding strategies.",
|
| 22 |
+
"SYSTEMIC: Over-extraction of groundwater may pose a long-term threat. Mitigation: Explore rainwater harvesting and efficient irrigation techniques."
|
| 23 |
+
],
|
| 24 |
+
"growth_opportunities": [
|
| 25 |
+
"Value addition opportunity with estimated revenue increase of 25-30% by processing surplus milk into paneer and ghee.",
|
| 26 |
+
"Technology adoption: Implement an automated milking system for increased efficiency and improved animal welfare. Estimated ROI 36 months (estimated savings ₹10,000/month; initial investment: ₹3,60,000).",
|
| 27 |
+
"Market linkage development: Establish direct sales channels to local hotels and restaurants for fresh milk. Target initial 15% sales increase within 6 months.",
|
| 28 |
+
"Skill development: Training in modern dairy farming practices and animal husbandry to improve milk yield and reduce animal health issues."
|
| 29 |
+
],
|
| 30 |
+
"financial_overview": {
|
| 31 |
+
"estimated_monthly_costs": "₹80,000 - ₹1,00,000 (estimate based on 150 cows, including feed, labor, and electricity)",
|
| 32 |
+
"potential_monthly_income": "₹1,50,000 - ₹2,00,000 (current income + potential gains)",
|
| 33 |
+
"profit_margin_range": "25% - 40% (highly sensitive to feed prices and milk market fluctuations)",
|
| 34 |
+
"cost_optimization": [
|
| 35 |
+
"Reduce electricity cost for irrigation by ₹5,000/month by installing a solar pump.",
|
| 36 |
+
"Optimize fertilizer application based on soil tests to save ₹10,000 annually."
|
| 37 |
+
],
|
| 38 |
+
"revenue_enhancement": [
|
| 39 |
+
"Increase milk price by ₹2/L by ensuring higher quality and potentially organic certification.",
|
| 40 |
+
"Add paneer and ghee for an additional ₹30,000 - ₹40,000/month."
|
| 41 |
+
]
|
| 42 |
+
},
|
| 43 |
+
"environmental_sustainability": {
|
| 44 |
+
"carbon_footprint_assessment": "Moderate carbon footprint due to methane emissions. Potential for 15% reduction through improved manure management and biogas generation.",
|
| 45 |
+
"soil_health_status": "Soil is neutral with medium organic matter; improving organic carbon content through compost and cover crops is recommended.",
|
| 46 |
+
"water_conservation_potential": "Potential to save 20,000 liters/month by converting to drip irrigation (assuming a drip system investment).",
|
| 47 |
+
"biodiversity_enhancement": [
|
| 48 |
+
"Plant fodder trees (like Gliricidia sepium) to provide fodder and improve soil fertility.",
|
| 49 |
+
"Create a green cover around the farm to attract pollinators and beneficial insects."
|
| 50 |
+
],
|
| 51 |
+
"climate_resilience": [
|
| 52 |
+
"Implement shade structures for cows to mitigate heat stress during summer.",
|
| 53 |
+
"Diversify fodder sources to minimize impact of drought."
|
| 54 |
+
]
|
| 55 |
+
},
|
| 56 |
+
"technology_integration": [
|
| 57 |
+
"IoT sensors for monitoring milk production and cow health: Expected savings: ₹3,000/year (labor cost reduction).",
|
| 58 |
+
"Mobile app for farm record keeping and managing cow data: Efficiency gain: 10%.",
|
| 59 |
+
"Mechanization for fodder harvesting to reduce labor costs by 15%.",
|
| 60 |
+
"Digital marketing for direct sales: Market reach increase: 25%."
|
| 61 |
+
],
|
| 62 |
+
"benchmarking_analysis": {
|
| 63 |
+
"regional_performance": "Milk yield of 12 L/day is above the regional average (estimated at 10 L/day).",
|
| 64 |
+
"best_practice_gaps": "Fodder management and value addition are areas requiring improvement compared to top-performing dairy farms.",
|
| 65 |
+
"competitive_advantages": "High milk yield and good soil health are key advantages.",
|
| 66 |
+
"improvement_potential": "Significant yield improvement potential through fodder optimization and technology integration."
|
| 67 |
+
},
|
| 68 |
+
"future_projections": {
|
| 69 |
+
"year_1_targets": "Increase average milk yield by 5% and reduce input costs by 10%.",
|
| 70 |
+
"year_3_vision": "Establish a small value-addition unit for dairy products and reduce reliance on purchased feed by 30%.",
|
| 71 |
+
"year_5_potential": "Become a profitable and sustainable organic dairy farm with diversified income streams.",
|
| 72 |
+
"market_trend_impact": "Growing demand for organic and locally sourced dairy products presents a significant opportunity.",
|
| 73 |
+
"climate_adaptation_timeline": "Phase 1: Improve fodder management and water conservation (0-12 months); Phase 2: Rainwater harvesting and efficient irrigation (1-3 years)."
|
| 74 |
+
},
|
| 75 |
+
"action_plan": {
|
| 76 |
+
"short_term (0-6 months)": [
|
| 77 |
+
"Conduct detailed soil and water tests.",
|
| 78 |
+
"Research government subsidies for solar pumps and fodder cultivation."
|
| 79 |
+
],
|
| 80 |
+
"medium_term (6-18 months)": [
|
| 81 |
+
"Pilot value-added dairy products (paneer, ghee).",
|
| 82 |
+
"Install IoT sensors for real-time monitoring of cow health and milk production."
|
| 83 |
+
],
|
| 84 |
+
"long_term (2-5 years)": [
|
| 85 |
+
"Invest in a biogas digester.",
|
| 86 |
+
"Develop direct-to-consumer marketing channels and explore organic certification."
|
| 87 |
+
]
|
| 88 |
+
},
|
| 89 |
+
"resource_requirements": {
|
| 90 |
+
"financial_planning": {
|
| 91 |
+
"immediate_investment_needed": "₹1,50,000 for solar pump.",
|
| 92 |
+
"annual_investment_budget": "₹50,000 for seeds, organic inputs, and minor equipment upgrades.",
|
| 93 |
+
"potential_loan_requirements": "₹5,00,000 loan for value addition unit and technology upgrades (5-year repayment plan).",
|
| 94 |
+
"subsidy_opportunities": [
|
| 95 |
+
"National Dairy Plan: Possible subsidies for infrastructure and technology. ",
|
| 96 |
+
"Pradhan Mantri Kisan Samman Nidhi (PM-KISAN): Direct income support."
|
| 97 |
+
]
|
| 98 |
+
},
|
| 99 |
+
"knowledge_development": [
|
| 100 |
+
"Dairy farm management training - Duration: 40 hours - Provider: Local Krishi Vigyan Kendra.",
|
| 101 |
+
"Organic farming certification - Timeline: 6 months - Cost: ₹5,000."
|
| 102 |
+
],
|
| 103 |
+
"infrastructure_upgrades": [
|
| 104 |
+
"Value addition unit setup - Cost: ₹50,000 - Installation time: 2 months.",
|
| 105 |
+
"Automated milking system - Cost: ₹3,60,000 - Installation time: 3 months."
|
| 106 |
+
]
|
| 107 |
+
},
|
| 108 |
+
"data_visualizations": [
|
| 109 |
+
{
|
| 110 |
+
"chart_title": "Production Efficiency Analysis",
|
| 111 |
+
"chart_type": "radar",
|
| 112 |
+
"chart_description": "Multi-dimensional farm performance assessment comparing current (green) vs target (blue) scores across key areas (max score 10).",
|
| 113 |
+
"data_labels": [
|
| 114 |
+
"Soil Health",
|
| 115 |
+
"Water Management",
|
| 116 |
+
"Fodder Management",
|
| 117 |
+
"Animal Welfare",
|
| 118 |
+
"Market Access",
|
| 119 |
+
"Sustainability"
|
| 120 |
+
],
|
| 121 |
+
"current_scores": [
|
| 122 |
+
7,
|
| 123 |
+
6,
|
| 124 |
+
5,
|
| 125 |
+
6,
|
| 126 |
+
4,
|
| 127 |
+
5
|
| 128 |
+
],
|
| 129 |
+
"target_scores": [
|
| 130 |
+
8,
|
| 131 |
+
8,
|
| 132 |
+
7,
|
| 133 |
+
8,
|
| 134 |
+
7,
|
| 135 |
+
7
|
| 136 |
+
],
|
| 137 |
+
"max_score": 10
|
| 138 |
+
},
|
| 139 |
+
{
|
| 140 |
+
"chart_title": "Monthly Income Projection",
|
| 141 |
+
"chart_type": "line",
|
| 142 |
+
"chart_description": "Expected income growth over 12 months with recommended improvements (current vs. projected). Figures are illustrative.",
|
| 143 |
+
"data_labels": [
|
| 144 |
+
"Jan",
|
| 145 |
+
"Feb",
|
| 146 |
+
"Mar",
|
| 147 |
+
"Apr",
|
| 148 |
+
"May",
|
| 149 |
+
"Jun",
|
| 150 |
+
"Jul",
|
| 151 |
+
"Aug",
|
| 152 |
+
"Sep",
|
| 153 |
+
"Oct",
|
| 154 |
+
"Nov",
|
| 155 |
+
"Dec"
|
| 156 |
+
],
|
| 157 |
+
"current_income": [
|
| 158 |
+
120000,
|
| 159 |
+
125000,
|
| 160 |
+
130000,
|
| 161 |
+
135000,
|
| 162 |
+
140000,
|
| 163 |
+
145000,
|
| 164 |
+
150000,
|
| 165 |
+
140000,
|
| 166 |
+
135000,
|
| 167 |
+
130000,
|
| 168 |
+
125000,
|
| 169 |
+
120000
|
| 170 |
+
],
|
| 171 |
+
"projected_income": [
|
| 172 |
+
130000,
|
| 173 |
+
135000,
|
| 174 |
+
145000,
|
| 175 |
+
160000,
|
| 176 |
+
170000,
|
| 177 |
+
180000,
|
| 178 |
+
185000,
|
| 179 |
+
175000,
|
| 180 |
+
165000,
|
| 181 |
+
155000,
|
| 182 |
+
145000,
|
| 183 |
+
135000
|
| 184 |
+
],
|
| 185 |
+
"improvement_percentage": 15
|
| 186 |
+
},
|
| 187 |
+
{
|
| 188 |
+
"chart_title": "Resource Optimization Opportunities",
|
| 189 |
+
"chart_type": "doughnut",
|
| 190 |
+
"chart_description": "Potential annual cost savings (₹) by optimizing various farm resources. Figures are illustrative.",
|
| 191 |
+
"data_labels": [
|
| 192 |
+
"Water Conservation",
|
| 193 |
+
"Energy Efficiency",
|
| 194 |
+
"Fodder Optimization",
|
| 195 |
+
"Labor Efficiency",
|
| 196 |
+
"Technology Adoption"
|
| 197 |
+
],
|
| 198 |
+
"savings_potential": [
|
| 199 |
+
60000,
|
| 200 |
+
60000,
|
| 201 |
+
40000,
|
| 202 |
+
20000,
|
| 203 |
+
10000
|
| 204 |
+
],
|
| 205 |
+
"total_annual_savings": 190000
|
| 206 |
+
}
|
| 207 |
+
],
|
| 208 |
+
"expert_commentary": "Mr. Doe, your dairy farm shows a strong foundation with a good milk yield. However, by focusing on some key areas, we can significantly improve profitability and sustainability. The current reliance on purchased feed is a major cost factor and exposes you to market volatility. Implementing improved fodder management practices like cultivating Napier grass and silage making will be crucial in reducing feed costs and improving milk yield. This will directly impact your bottom line. Secondly, exploring value addition through processing surplus milk into paneer and ghee will open a new revenue stream, boosting your income by 25% to 30% within a year. Finally, tapping into government schemes for subsidies on solar pumps and improved infrastructure will lead to long-term cost savings. With these strategic changes, Green Acres Farm can easily transition into a highly profitable and resilient enterprise. With consistent implementation and further refinements, I project annual income increases of 30-40% within the next 3 years. Let's work together to achieve these goals."
|
| 209 |
+
}
|
data/gen_ai_output/df48d33f-79ec-4286-95dd-de2c8ee9c0df_insights_20250910_134553.json
ADDED
|
@@ -0,0 +1,210 @@
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"summary": "Green Acres Farm demonstrates strong dairy production with an average milk yield exceeding regional averages. However, opportunities exist for significant revenue enhancement through value addition, fodder optimization, and strategic cost reduction. Primary focus should be on improving milk yield and diversifying income streams.",
|
| 3 |
+
"key_metrics": {
|
| 4 |
+
"farm_size": "0.6871 ha",
|
| 5 |
+
"farming_type": "Dairy Farming",
|
| 6 |
+
"soil_ph_status": "Neutral (6.5–7.5)",
|
| 7 |
+
"organic_matter_level": "Medium (2–4%)",
|
| 8 |
+
"primary_irrigation": "Borewell / Tube well (electric)",
|
| 9 |
+
"crop_diversity_score": 0,
|
| 10 |
+
"water_quality_rating": "Good (suitable)",
|
| 11 |
+
"production_focus": "Dairy products"
|
| 12 |
+
},
|
| 13 |
+
"recommendations": [
|
| 14 |
+
"HIGH PRIORITY: Optimize dairy feed by introducing a mix of locally sourced fodder (e.g., hybrid Napier grass, legumes) and high-quality concentrate feed, aiming for a 20% increase in milk yield within 6 months.",
|
| 15 |
+
"MEDIUM PRIORITY: Invest in a solar-powered water pump for the borewell, reducing electricity costs by approximately 30% within 12 months. Estimated ROI of 18 months considering electricity savings and potential government subsidies.",
|
| 16 |
+
"ONGOING: Implement regular health checkups (monthly) for all cows, monitoring their weight and milk yield. Adjust the feed rations according to the physiological status of the animals, resulting in 10-15% increased milk production over a year.",
|
| 17 |
+
"STRATEGIC: Explore establishing a small-scale value-addition unit for processing surplus milk into products like paneer, ghee, or curd, aiming to increase revenue by 25-35% within 18 months."
|
| 18 |
+
],
|
| 19 |
+
"risk_factors": [
|
| 20 |
+
"IMMEDIATE: Over-reliance on purchased feed for dairy cattle increases vulnerability to feed price fluctuations. Implement a supplemental fodder strategy with local feed sources to reduce this risk.",
|
| 21 |
+
"SEASONAL: Electricity price volatility can impact operational costs. Mitigate by utilizing solar-powered pumps and exploring government subsidies for energy-efficient alternatives.",
|
| 22 |
+
"SYSTEMIC: Depletion of groundwater reserves. Explore rainwater harvesting techniques and efficient irrigation methods to enhance water security and long-term sustainability."
|
| 23 |
+
],
|
| 24 |
+
"growth_opportunities": [
|
| 25 |
+
"Value addition opportunity: Processing surplus milk into paneer, ghee, and curd can increase dairy revenue by 25-35%. This diversification could increase income by an estimated ₹15,000-₹25,000 per month.",
|
| 26 |
+
"Technology adoption: Implementing a mobile app for farm management and record-keeping can improve efficiency in labor management and animal health monitoring, leading to a potential 10% reduction in operational costs.",
|
| 27 |
+
"Market linkage development: Establish direct sales channels to local hotels, restaurants, or consumers to increase milk and value-added product sales by 15-20% within 6 months.",
|
| 28 |
+
"Skill development: Training in advanced animal husbandry and dairy farming techniques can improve overall farm efficiency and milk production. This can also increase awareness of local government schemes and resources."
|
| 29 |
+
],
|
| 30 |
+
"financial_overview": {
|
| 31 |
+
"estimated_monthly_costs": "₹30,000 - ₹40,000 (estimate based on 150 cows, feed costs, labor, electricity)",
|
| 32 |
+
"potential_monthly_income": "₹50,000 - ₹70,000 (with proposed improvements, including value addition)",
|
| 33 |
+
"profit_margin_range": "25% - 40% (depending on market conditions and feed costs)",
|
| 34 |
+
"cost_optimization": [
|
| 35 |
+
"Reduce electricity cost for irrigation by ₹3,000/month by installing a solar pump.",
|
| 36 |
+
"Optimize feed utilization through better ration management and reducing feed wastage by ₹5,000 per month."
|
| 37 |
+
],
|
| 38 |
+
"revenue_enhancement": [
|
| 39 |
+
"Increase milk price by ₹1/L by establishing a direct sales channel and improved product quality. This could add an extra ₹15,000 per month.",
|
| 40 |
+
"Add paneer and ghee production for an additional ₹10,000-₹15,000/month."
|
| 41 |
+
]
|
| 42 |
+
},
|
| 43 |
+
"environmental_sustainability": {
|
| 44 |
+
"carbon_footprint_assessment": "Moderate carbon footprint from electricity consumption and livestock methane. Significant reduction possible through manure management (biogas plant) and energy-efficient technologies.",
|
| 45 |
+
"soil_health_status": "Soil is Neutral with Medium organic matter; good base. Focus on maintaining and improving organic carbon content through compost and cover crops.",
|
| 46 |
+
"water_conservation_potential": "Potential to save approximately 20,000 liters of water per month by adopting more efficient irrigation techniques (drip irrigation if feasible on the farm's scale).",
|
| 47 |
+
"biodiversity_enhancement": [
|
| 48 |
+
"Plant local tree species along farm borders to create shade, attract pollinators, and improve overall ecosystem health.",
|
| 49 |
+
"Implement a crop rotation plan to diversify the farm's ecosystem and enhance soil fertility."
|
| 50 |
+
],
|
| 51 |
+
"climate_resilience": [
|
| 52 |
+
"Invest in shade structures for animals during peak summer temperatures to mitigate heat stress.",
|
| 53 |
+
"Plan for alternate fodder sources during drought periods by cultivating drought-resistant varieties."
|
| 54 |
+
]
|
| 55 |
+
},
|
| 56 |
+
"technology_integration": [
|
| 57 |
+
"IoT sensors for monitoring milk yield and animal health: Expected savings: ₹2,000/year (estimate based on reduced vet visits and improved monitoring).",
|
| 58 |
+
"Mobile app for farm management: Efficiency gain: 10% in labor management and record keeping.",
|
| 59 |
+
"Mechanization (if feasible): Mechanization of fodder harvesting can save labor costs, pending farm size feasibility assessment.",
|
| 60 |
+
"Digital marketing platform: Market reach increase: 20% within 1 year through online presence and targeted advertising."
|
| 61 |
+
],
|
| 62 |
+
"benchmarking_analysis": {
|
| 63 |
+
"regional_performance": "Farm milk yield (12 L/day per cow) is 20% above the regional average (10 L/day).",
|
| 64 |
+
"best_practice_gaps": "Significant potential for diversification of income streams, fodder management improvements, and value addition.",
|
| 65 |
+
"competitive_advantages": "Higher-than-average milk yield and good water quality are key advantages.",
|
| 66 |
+
"improvement_potential": "Yield gap for milk can be reduced by 15% with improved feed management and animal health."
|
| 67 |
+
},
|
| 68 |
+
"future_projections": {
|
| 69 |
+
"year_1_targets": "Increase average milk yield by 15%, reduce feed costs by 10%, and initiate value-added product pilot production.",
|
| 70 |
+
"year_3_vision": "Establish a small value-addition unit for dairy products, achieve 25% water self-sufficiency, and expand the direct sales channel.",
|
| 71 |
+
"year_5_potential": "Become a leading dairy farm in the region, known for high-quality organic products and diversified income streams.",
|
| 72 |
+
"market_trend_impact": "Growing demand for organic dairy products presents a significant opportunity if organic certification is pursued.",
|
| 73 |
+
"climate_adaptation_timeline": "Phase 1: Drought-resistant fodder (0-6 months); Phase 2: Rainwater harvesting (1-2 years); Phase 3: Micro-irrigation (2-3 years)."
|
| 74 |
+
},
|
| 75 |
+
"action_plan": {
|
| 76 |
+
"short_term (0-6 months)": [
|
| 77 |
+
"Conduct a detailed feed analysis and adjust the feed ration to optimize milk production.",
|
| 78 |
+
"Research and apply for government subsidies for solar pump installation and water conservation measures."
|
| 79 |
+
],
|
| 80 |
+
"medium_term (6-18 months)": [
|
| 81 |
+
"Pilot value-added dairy products (paneer, ghee) to assess market demand and profitability.",
|
| 82 |
+
"Install IoT sensors for real-time monitoring of milk yield, animal health, and water levels."
|
| 83 |
+
],
|
| 84 |
+
"long_term (2-5 years)": [
|
| 85 |
+
"Invest in a biogas digester to reduce waste and generate renewable energy.",
|
| 86 |
+
"Develop a comprehensive marketing strategy targeting multiple sales channels (direct sales, local markets, online platforms)."
|
| 87 |
+
]
|
| 88 |
+
},
|
| 89 |
+
"resource_requirements": {
|
| 90 |
+
"financial_planning": {
|
| 91 |
+
"immediate_investment_needed": "₹50,000 - ₹1,00,000 (for improved fodder management and initial value-addition equipment)",
|
| 92 |
+
"annual_investment_budget": "₹20,000 - ₹30,000 (for seeds, fertilizers, minor equipment)",
|
| 93 |
+
"potential_loan_requirements": "₹2,00,000 - ₹5,00,000 (for solar pump, value-addition unit, potential land improvements)",
|
| 94 |
+
"subsidy_opportunities": [
|
| 95 |
+
"Pradhan Mantri Kisan Samman Nidhi (PM-KISAN)",
|
| 96 |
+
"National Dairy Plan (NDP)",
|
| 97 |
+
"State-specific dairy development schemes"
|
| 98 |
+
]
|
| 99 |
+
},
|
| 100 |
+
"knowledge_development": [
|
| 101 |
+
"Animal husbandry and dairy farm management training through local Krishi Vigyan Kendra (KVK)",
|
| 102 |
+
"Value-added product processing workshops organized by local agricultural departments"
|
| 103 |
+
],
|
| 104 |
+
"infrastructure_upgrades": [
|
| 105 |
+
"Solar-powered water pump installation",
|
| 106 |
+
"Small-scale value-added processing unit (if needed)."
|
| 107 |
+
]
|
| 108 |
+
},
|
| 109 |
+
"data_visualizations": [
|
| 110 |
+
{
|
| 111 |
+
"chart_title": "Production Efficiency Analysis",
|
| 112 |
+
"chart_type": "radar",
|
| 113 |
+
"chart_description": "Multi-dimensional farm performance assessment comparing current (green) vs target (blue) scores across key areas (max score 10).",
|
| 114 |
+
"data_labels": [
|
| 115 |
+
"Soil Health",
|
| 116 |
+
"Water Management",
|
| 117 |
+
"Crop Productivity",
|
| 118 |
+
"Market Access",
|
| 119 |
+
"Technology Use",
|
| 120 |
+
"Sustainability"
|
| 121 |
+
],
|
| 122 |
+
"current_scores": [
|
| 123 |
+
7,
|
| 124 |
+
7,
|
| 125 |
+
6,
|
| 126 |
+
5,
|
| 127 |
+
4,
|
| 128 |
+
5
|
| 129 |
+
],
|
| 130 |
+
"target_scores": [
|
| 131 |
+
8,
|
| 132 |
+
9,
|
| 133 |
+
8,
|
| 134 |
+
8,
|
| 135 |
+
7,
|
| 136 |
+
8
|
| 137 |
+
],
|
| 138 |
+
"max_score": 10
|
| 139 |
+
},
|
| 140 |
+
{
|
| 141 |
+
"chart_title": "Monthly Income Projection",
|
| 142 |
+
"chart_type": "line",
|
| 143 |
+
"chart_description": "Expected income growth over 12 months with recommended improvements (current vs. projected). Figures are illustrative.",
|
| 144 |
+
"data_labels": [
|
| 145 |
+
"Jan",
|
| 146 |
+
"Feb",
|
| 147 |
+
"Mar",
|
| 148 |
+
"Apr",
|
| 149 |
+
"May",
|
| 150 |
+
"Jun",
|
| 151 |
+
"Jul",
|
| 152 |
+
"Aug",
|
| 153 |
+
"Sep",
|
| 154 |
+
"Oct",
|
| 155 |
+
"Nov",
|
| 156 |
+
"Dec"
|
| 157 |
+
],
|
| 158 |
+
"current_income": [
|
| 159 |
+
30000,
|
| 160 |
+
30000,
|
| 161 |
+
30000,
|
| 162 |
+
35000,
|
| 163 |
+
40000,
|
| 164 |
+
38000,
|
| 165 |
+
36000,
|
| 166 |
+
34000,
|
| 167 |
+
32000,
|
| 168 |
+
28000,
|
| 169 |
+
26000,
|
| 170 |
+
25000
|
| 171 |
+
],
|
| 172 |
+
"projected_income": [
|
| 173 |
+
33000,
|
| 174 |
+
35000,
|
| 175 |
+
38000,
|
| 176 |
+
45000,
|
| 177 |
+
55000,
|
| 178 |
+
52000,
|
| 179 |
+
50000,
|
| 180 |
+
48000,
|
| 181 |
+
46000,
|
| 182 |
+
42000,
|
| 183 |
+
40000,
|
| 184 |
+
38000
|
| 185 |
+
],
|
| 186 |
+
"improvement_percentage": 25
|
| 187 |
+
},
|
| 188 |
+
{
|
| 189 |
+
"chart_title": "Resource Optimization Opportunities",
|
| 190 |
+
"chart_type": "doughnut",
|
| 191 |
+
"chart_description": "Potential annual cost savings (₹) by optimizing various farm resources. Figures are illustrative.",
|
| 192 |
+
"data_labels": [
|
| 193 |
+
"Water Conservation",
|
| 194 |
+
"Energy Efficiency",
|
| 195 |
+
"Feed Optimization",
|
| 196 |
+
"Labor Efficiency",
|
| 197 |
+
"Technology Adoption"
|
| 198 |
+
],
|
| 199 |
+
"savings_potential": [
|
| 200 |
+
10000,
|
| 201 |
+
12000,
|
| 202 |
+
15000,
|
| 203 |
+
5000,
|
| 204 |
+
3000
|
| 205 |
+
],
|
| 206 |
+
"total_annual_savings": 45000
|
| 207 |
+
}
|
| 208 |
+
],
|
| 209 |
+
"expert_commentary": "Mr. John Doe, your Green Acres Farm shows considerable potential for growth. Your current milk yield is impressive, exceeding regional averages. However, we can significantly boost your income and farm sustainability. The key is to diversify income sources, optimize feed costs, and adopt efficient technologies. Processing a portion of your milk into value-added products like paneer and ghee will add substantial revenue. Additionally, implementing a mixed fodder strategy will reduce your reliance on purchased feed, thus mitigating market price risks and improving your margins.\n\nInvesting in a solar-powered pump is a smart, long-term strategy. Not only will it reduce your electricity bills, but it also addresses the increasing concerns about groundwater depletion. We can explore available government subsidies to make this financially viable. Regular health monitoring of your cows and strategic feeding will further boost milk production. Consider training on advanced dairy farm management practices for best results.\n\nI am confident that with a focused approach and the implementation of these recommendations, Green Acres Farm can achieve significant growth within the next few years. Your strong foundation, combined with strategic upgrades, will position your farm for greater profitability, increased resilience, and lasting sustainability. We can work together to create a detailed, phased implementation plan tailored to your specific needs and resources, ensuring a smooth transition and maximizing returns."
|
| 210 |
+
}
|
data/gen_ai_output/df48d33f-79ec-4286-95dd-de2c8ee9c0df_insights_20250910_134758.json
ADDED
|
@@ -0,0 +1,209 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"summary": "Green Acres Farm demonstrates strong dairy production with an above-average milk yield. However, opportunities exist for significant income growth through value addition, fodder optimization, and strategic technology integration. A primary focus should be on diversifying income streams and enhancing resilience to market fluctuations.",
|
| 3 |
+
"key_metrics": {
|
| 4 |
+
"farm_size": "0.6871 ha",
|
| 5 |
+
"farming_type": "Dairy Farming",
|
| 6 |
+
"soil_ph_status": "Neutral (6.5–7.5)",
|
| 7 |
+
"organic_matter_level": "Medium (2–4%)",
|
| 8 |
+
"primary_irrigation": "Borewell / Tube well (electric)",
|
| 9 |
+
"crop_diversity_score": 0,
|
| 10 |
+
"water_quality_rating": "Good (suitable)",
|
| 11 |
+
"production_focus": "Dairy products"
|
| 12 |
+
},
|
| 13 |
+
"recommendations": [
|
| 14 |
+
"HIGH PRIORITY: Optimize dairy feed by introducing a mix of locally sourced fodder crops (e.g., Napier grass, hybrid sorghum) and reducing reliance on purchased feed. This should increase milk yield by 15-20% and reduce feed costs by 10-15% within 6 months.",
|
| 15 |
+
"MEDIUM PRIORITY: Invest in a biogas digester using cow dung to generate renewable energy for farm operations (electricity and cooking gas). Estimated ROI is 24 months, considering reduced electricity and LPG costs.",
|
| 16 |
+
"ONGOING: Implement a regular health monitoring program for the dairy herd, including vaccination and parasite control (seasonal, every 3-4 months).",
|
| 17 |
+
"STRATEGIC: Explore value addition by processing surplus milk into value-added dairy products like paneer, ghee, or yogurt. This could increase income by 25-35% within 12 months, assuming market demand and processing cost analysis."
|
| 18 |
+
],
|
| 19 |
+
"risk_factors": [
|
| 20 |
+
"IMMEDIATE: Over-reliance on purchased feed exposes the farm to price volatility. Seasonal feed shortages can impact milk yield and profitability.",
|
| 21 |
+
"SEASONAL: Fluctuations in milk prices during peak production seasons require a flexible marketing strategy and potentially cold storage solutions.",
|
| 22 |
+
"SYSTEMIC: Long-term sustainability of borewell irrigation needs attention. Explore rainwater harvesting and water conservation measures to mitigate risks of groundwater depletion."
|
| 23 |
+
],
|
| 24 |
+
"growth_opportunities": [
|
| 25 |
+
"Value addition opportunity with estimated revenue increase of 25-35% (Processing surplus milk into paneer and ghee).",
|
| 26 |
+
"Technology adoption with specific ROI projections (Implementing a mobile app for farm record keeping and managing dairy animal health records - 10% efficiency gain in 6 months).",
|
| 27 |
+
"Market linkage development with implementation roadmap (Direct sales to local hotels/restaurants for milk and value-added products - Target 20% sales increase in 1 year).",
|
| 28 |
+
"Skill development area with training recommendations (Training in advanced dairy farm management practices, including animal nutrition and disease management)."
|
| 29 |
+
],
|
| 30 |
+
"financial_overview": {
|
| 31 |
+
"estimated_monthly_costs": "₹80,000 - ₹1,00,000 (Estimate based on 150 cows, feed, labor, electricity, veterinary expenses)",
|
| 32 |
+
"potential_monthly_income": "₹1,50,000 - ₹2,00,000 (Current practices + improvements)",
|
| 33 |
+
"profit_margin_range": "25% - 50% (Highly sensitive to feed prices and milk market)",
|
| 34 |
+
"cost_optimization": [
|
| 35 |
+
"Reduce feed costs by ₹20,000/month through fodder crop cultivation.",
|
| 36 |
+
"Optimize electricity usage by implementing energy-efficient measures, potentially saving ₹5,000/month."
|
| 37 |
+
],
|
| 38 |
+
"revenue_enhancement": [
|
| 39 |
+
"Increase milk price by ₹2/L by improving milk quality and hygiene practices.",
|
| 40 |
+
"Add paneer and ghee sales for additional ₹30,000/month."
|
| 41 |
+
]
|
| 42 |
+
},
|
| 43 |
+
"environmental_sustainability": {
|
| 44 |
+
"carbon_footprint_assessment": "Moderate carbon footprint due to livestock methane; potential 10% reduction with improved manure management (biogas plant).",
|
| 45 |
+
"soil_health_status": "Soil is neutral with medium organic matter. Maintain and improve by incorporating organic matter through composting and manure management.",
|
| 46 |
+
"water_conservation_potential": "Potential to save 20,000 liters/month by implementing water-efficient irrigation techniques (drip or sprinkler).",
|
| 47 |
+
"biodiversity_enhancement": [
|
| 48 |
+
"Plant fodder trees (e.g., Gliricidia sepium) around the farm for shade, fodder, and nitrogen fixation.",
|
| 49 |
+
"Implement crop rotation to improve soil health and biodiversity."
|
| 50 |
+
],
|
| 51 |
+
"climate_resilience": [
|
| 52 |
+
"Develop drought-resistant fodder varieties.",
|
| 53 |
+
"Plan for improved water storage (rainwater harvesting)."
|
| 54 |
+
]
|
| 55 |
+
},
|
| 56 |
+
"technology_integration": [
|
| 57 |
+
"IoT sensors for monitoring milk yield and animal health - Expected savings: ₹2,000/year in veterinary costs.",
|
| 58 |
+
"Mobile app for farm record keeping and dairy animal health management - Efficiency gain: 10% in labor management.",
|
| 59 |
+
"Mechanization of fodder harvesting, potentially reducing labor costs by 15%.",
|
| 60 |
+
"Digital marketing platform for direct milk and product sales - Market reach increase: 30%."
|
| 61 |
+
],
|
| 62 |
+
"benchmarking_analysis": {
|
| 63 |
+
"regional_performance": "Milk yield is currently above average for the region. Maintain this advantage by focusing on fodder and animal health management.",
|
| 64 |
+
"best_practice_gaps": "Lack of fodder crop diversity, value addition, and technology integration represent key improvement areas.",
|
| 65 |
+
"competitive_advantages": "High milk yield and relatively good soil quality are significant strengths.",
|
| 66 |
+
"improvement_potential": "Substantial improvement potential through optimization of fodder, value addition, and technology adoption."
|
| 67 |
+
},
|
| 68 |
+
"future_projections": {
|
| 69 |
+
"year_1_targets": "Increase average milk yield by 5%, reduce feed costs by 10%, initiate value-added dairy product processing.",
|
| 70 |
+
"year_3_vision": "Establish a small-scale value addition unit, achieve 20% water self-sufficiency through rainwater harvesting, and expand market reach.",
|
| 71 |
+
"year_5_potential": "Become a recognized supplier of high-quality, value-added dairy products with improved sustainability practices and income diversification.",
|
| 72 |
+
"market_trend_impact": "Growing demand for organic and locally sourced products presents significant opportunities if the farm implements appropriate certifications and marketing.",
|
| 73 |
+
"climate_adaptation_timeline": "Phase 1: Drought-resistant fodder varieties (0-12 months); Phase 2: Rainwater harvesting & water-efficient irrigation (1-3 years)."
|
| 74 |
+
},
|
| 75 |
+
"action_plan": {
|
| 76 |
+
"short_term (0-6 months)": [
|
| 77 |
+
"Conduct a detailed soil test and optimize fertilizer application.",
|
| 78 |
+
"Develop a plan for integrating locally sourced fodder crops."
|
| 79 |
+
],
|
| 80 |
+
"medium_term (6-18 months)": [
|
| 81 |
+
"Pilot production of value-added dairy products (paneer, ghee).",
|
| 82 |
+
"Explore government subsidies for biogas digesters and water conservation technologies."
|
| 83 |
+
],
|
| 84 |
+
"long_term (2-5 years)": [
|
| 85 |
+
"Invest in a biogas digester.",
|
| 86 |
+
"Develop direct-to-consumer marketing channels and explore organic certification."
|
| 87 |
+
]
|
| 88 |
+
},
|
| 89 |
+
"resource_requirements": {
|
| 90 |
+
"financial_planning": {
|
| 91 |
+
"immediate_investment_needed": "₹50,000 - ₹1,00,000 (for fodder crop establishment)",
|
| 92 |
+
"annual_investment_budget": "₹30,000 - ₹50,000 (for seeds, fertilizers, and minor equipment)",
|
| 93 |
+
"potential_loan_requirements": "₹5,00,000 - ₹10,00,000 (for biogas plant and value addition unit), with 5-year repayment plan.",
|
| 94 |
+
"subsidy_opportunities": [
|
| 95 |
+
"National Dairy Plan (NDP): Potential subsidies for infrastructure and technology upgrades.",
|
| 96 |
+
"Pradhan Mantri Kisan Sampada Yojana (PMKSY): Potential subsidies for value addition infrastructure."
|
| 97 |
+
]
|
| 98 |
+
},
|
| 99 |
+
"knowledge_development": [
|
| 100 |
+
"Dairy farm management training - Duration: 40 hours - Provider: Local Krishi Vigyan Kendra.",
|
| 101 |
+
"Organic farming certification - Timeline: 6 months - Cost: ₹5,000 - ₹10,000."
|
| 102 |
+
],
|
| 103 |
+
"infrastructure_upgrades": [
|
| 104 |
+
"Biogas digester installation - Cost: ₹5,00,000 - ₹10,00,000 - Installation time: 3-6 months.",
|
| 105 |
+
"Value addition unit setup (small-scale) - Cost: ₹1,00,000 - ₹2,00,000 - Installation time: 2-3 months."
|
| 106 |
+
]
|
| 107 |
+
},
|
| 108 |
+
"data_visualizations": [
|
| 109 |
+
{
|
| 110 |
+
"chart_title": "Production Efficiency Analysis",
|
| 111 |
+
"chart_type": "radar",
|
| 112 |
+
"chart_description": "Multi-dimensional farm performance assessment comparing current (green) vs target (blue) scores across key areas (max score 10).",
|
| 113 |
+
"data_labels": [
|
| 114 |
+
"Soil Health",
|
| 115 |
+
"Water Management",
|
| 116 |
+
"Crop Productivity",
|
| 117 |
+
"Market Access",
|
| 118 |
+
"Technology Use",
|
| 119 |
+
"Sustainability"
|
| 120 |
+
],
|
| 121 |
+
"current_scores": [
|
| 122 |
+
7,
|
| 123 |
+
7,
|
| 124 |
+
6,
|
| 125 |
+
5,
|
| 126 |
+
4,
|
| 127 |
+
5
|
| 128 |
+
],
|
| 129 |
+
"target_scores": [
|
| 130 |
+
8,
|
| 131 |
+
9,
|
| 132 |
+
8,
|
| 133 |
+
8,
|
| 134 |
+
7,
|
| 135 |
+
8
|
| 136 |
+
],
|
| 137 |
+
"max_score": 10
|
| 138 |
+
},
|
| 139 |
+
{
|
| 140 |
+
"chart_title": "Monthly Income Projection",
|
| 141 |
+
"chart_type": "line",
|
| 142 |
+
"chart_description": "Expected income growth over 12 months with recommended improvements (current vs. projected). Figures are illustrative.",
|
| 143 |
+
"data_labels": [
|
| 144 |
+
"Jan",
|
| 145 |
+
"Feb",
|
| 146 |
+
"Mar",
|
| 147 |
+
"Apr",
|
| 148 |
+
"May",
|
| 149 |
+
"Jun",
|
| 150 |
+
"Jul",
|
| 151 |
+
"Aug",
|
| 152 |
+
"Sep",
|
| 153 |
+
"Oct",
|
| 154 |
+
"Nov",
|
| 155 |
+
"Dec"
|
| 156 |
+
],
|
| 157 |
+
"current_income": [
|
| 158 |
+
15000,
|
| 159 |
+
15000,
|
| 160 |
+
20000,
|
| 161 |
+
25000,
|
| 162 |
+
30000,
|
| 163 |
+
28000,
|
| 164 |
+
26000,
|
| 165 |
+
24000,
|
| 166 |
+
22000,
|
| 167 |
+
18000,
|
| 168 |
+
16000,
|
| 169 |
+
15000
|
| 170 |
+
],
|
| 171 |
+
"projected_income": [
|
| 172 |
+
16000,
|
| 173 |
+
17000,
|
| 174 |
+
22000,
|
| 175 |
+
28000,
|
| 176 |
+
35000,
|
| 177 |
+
33000,
|
| 178 |
+
31000,
|
| 179 |
+
29000,
|
| 180 |
+
27000,
|
| 181 |
+
23000,
|
| 182 |
+
20000,
|
| 183 |
+
18000
|
| 184 |
+
],
|
| 185 |
+
"improvement_percentage": 15
|
| 186 |
+
},
|
| 187 |
+
{
|
| 188 |
+
"chart_title": "Resource Optimization Opportunities",
|
| 189 |
+
"chart_type": "doughnut",
|
| 190 |
+
"chart_description": "Potential annual cost savings (₹) by optimizing various farm resources. Figures are illustrative.",
|
| 191 |
+
"data_labels": [
|
| 192 |
+
"Water Conservation",
|
| 193 |
+
"Energy Efficiency",
|
| 194 |
+
"Input Optimization",
|
| 195 |
+
"Labor Efficiency",
|
| 196 |
+
"Technology Adoption"
|
| 197 |
+
],
|
| 198 |
+
"savings_potential": [
|
| 199 |
+
5000,
|
| 200 |
+
3000,
|
| 201 |
+
4000,
|
| 202 |
+
2000,
|
| 203 |
+
1000
|
| 204 |
+
],
|
| 205 |
+
"total_annual_savings": 15000
|
| 206 |
+
}
|
| 207 |
+
],
|
| 208 |
+
"expert_commentary": "Mr. John Doe, your Green Acres Farm shows impressive milk production, exceeding regional averages. Your dedication is evident. However, focusing on fodder management is crucial. By diversifying your fodder sources with locally grown options and reducing reliance on purchased feed, you can significantly lower costs and potentially boost milk yield by 15-20% within six months. This directly impacts your profitability. Next, value addition is key; processing surplus milk into paneer and ghee can add 25-35% to your monthly income. Finally, consider a biogas plant—it’s a long-term investment but will drastically reduce electricity and fuel costs, making your farm more sustainable and environmentally friendly. Implementing these recommendations systematically will steadily increase your farm's income and sustainability, leading to long-term financial security and growth. Let's work together to achieve this vision step-by-step. I am confident we can reach your goals."
|
| 209 |
+
}
|
data/gen_ai_output/df48d33f-79ec-4286-95dd-de2c8ee9c0df_yearly_plan_20250910_134147.json
ADDED
|
@@ -0,0 +1,188 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"executive_summary": {
|
| 3 |
+
"summary_paragraph": "२०२६ च्या दुग्ध व्यवसायासाठीचा हा वार्षिक कार्यक्रम ग्रीन अॅकर्स फार्मच्या विकासासाठी आखण्यात आला आहे. यामध्ये चारा उत्पादन, पशु आरोग्य, दुधाचे उत्पादन आणि विक्री यावर लक्ष केंद्रित केले आहे. उत्पादन वाढविण्यासाठी, खर्च कमी करण्यासाठी आणि स्थिरता राखण्यासाठी अनेक उपाययोजना यात समाविष्ट आहेत. पशुंच्या आरोग्यावर विशेष लक्ष दिले जाईल आणि बाजारपेठेच्या गरजेनुसार दुधाच्या विक्रीची रणनीती आखण्यात येईल.",
|
| 4 |
+
"main_recommendation": "दुधाचे उत्पादन आणि नफा वाढविण्यासाठी पशुंच्या आरोग्याची योग्य काळजी आणि संतुलित आहाराचे नियोजन हे सर्वात महत्त्वाचे आहे."
|
| 5 |
+
},
|
| 6 |
+
"annual_crop_calendar": [
|
| 7 |
+
{
|
| 8 |
+
"plot_name": "चाराक्षेत्र अ (सुमारे ०.३ हेक्टर)",
|
| 9 |
+
"crop": "लुसर्न/अल्फाल्फा",
|
| 10 |
+
"timeline": [
|
| 11 |
+
{
|
| 12 |
+
"stage": "पेरणी",
|
| 13 |
+
"start": "ऑक्टोबर २०२५",
|
| 14 |
+
"end": "१५ ऑक्टोबर २०२५"
|
| 15 |
+
},
|
| 16 |
+
{
|
| 17 |
+
"stage": "पिक काढणी १",
|
| 18 |
+
"start": "१ डिसेंबर २०२५",
|
| 19 |
+
"end": "१० डिसेंबर २०२५"
|
| 20 |
+
},
|
| 21 |
+
{
|
| 22 |
+
"stage": "पिक काढणी २",
|
| 23 |
+
"start": "१ फेब्रुवारी २०२६",
|
| 24 |
+
"end": "१० फेब्रुवारी २०२६"
|
| 25 |
+
},
|
| 26 |
+
{
|
| 27 |
+
"stage": "पिक काढणी ३",
|
| 28 |
+
"start": "१ एप्रिल २०२६",
|
| 29 |
+
"end": "१० एप्रिल २०२६"
|
| 30 |
+
},
|
| 31 |
+
{
|
| 32 |
+
"stage": "उन्हाळी चारा",
|
| 33 |
+
"start": "१ मे २०२६",
|
| 34 |
+
"end": "३० सप्टेंबर २०२६"
|
| 35 |
+
}
|
| 36 |
+
]
|
| 37 |
+
},
|
| 38 |
+
{
|
| 39 |
+
"plot_name": "चाराक्षेत्र ब (सुमारे ०.३ हेक्टर)",
|
| 40 |
+
"crop": "मका (चारा)",
|
| 41 |
+
"timeline": [
|
| 42 |
+
{
|
| 43 |
+
"stage": "पेरणी",
|
| 44 |
+
"start": "१५ जून २०२६",
|
| 45 |
+
"end": "३० जून २०२६"
|
| 46 |
+
},
|
| 47 |
+
{
|
| 48 |
+
"stage": "पिक काढणी",
|
| 49 |
+
"start": "१ सप्टेंबर २०२६",
|
| 50 |
+
"end": "१५ सप्टेंबर २०२६"
|
| 51 |
+
},
|
| 52 |
+
{
|
| 53 |
+
"stage": "रब्बी चारा",
|
| 54 |
+
"start": "१५ ऑक्टोबर २०२६",
|
| 55 |
+
"end": "३० मार्च २०२७"
|
| 56 |
+
}
|
| 57 |
+
]
|
| 58 |
+
}
|
| 59 |
+
],
|
| 60 |
+
"irrigation_schedule": [
|
| 61 |
+
{
|
| 62 |
+
"month": "जानेवारी २०२६",
|
| 63 |
+
"recommendation": "बहुवार्षिक चारा पिकांना (उदा. लुसर्न) आठवड्यातून एकदा पाणी द्या. चराउच्या भागातील मातीची आर्द्रता ६०% पेक्षा जास्त राहावी याची काळजी घ्या. प्राण्यांना पुरेसे पाणी मिळावे याची खात्री करा."
|
| 64 |
+
},
|
| 65 |
+
{
|
| 66 |
+
"month": "जुलै २०२६",
|
| 67 |
+
"recommendation": "मोसमी पावसाचे निरीक्षण करा. जर पावसाचा तुटवडा असेल तर अतिरिक्त पाणीपुरवठा करा. गोठ्याभोवतीच्या चिखलाच्या ठिकाणांचे व्यवस्थापन करा. शक्य असेल तर चराउचे परिवर्तन करा. दर्जेदार हिरव्या चाऱ्यावर लक्ष केंद्रित करा."
|
| 68 |
+
}
|
| 69 |
+
],
|
| 70 |
+
"nutrient_fertilizer_schedule": [
|
| 71 |
+
{
|
| 72 |
+
"crop_stage": "चारा लागवडीची तयारी",
|
| 73 |
+
"recommendation": "प्रति हेक्टर १०-१५ टन शेणखत/कम्पोस्टची म��ळात्मक वापर करा. पेरणीच्या वेळी सुरुवातीच्या वाढीसाठी प्रति हेक्टर ५० किलो NPK १९:१९:१९ वापरा. माती चाचणी आधारीत सूक्ष्म पोषक घटकांचा वापर करा. (NPK, युरिया, DAP ची स्थानिक उपलब्धता)."
|
| 74 |
+
},
|
| 75 |
+
{
|
| 76 |
+
"crop_stage": "पशु पोषण (वर्षभर)",
|
| 77 |
+
"recommendation": "दुधाच्या उत्पादनाच्या (१२.० लिटर/दिवस) आणि प्राण्याच्या वयाच्या आधारे संतुलित आहार अनुसूची तयार करा. खनिज मिश्रण आणि व्हिटॅमिन्स पुरवठा करा. कापूस बीज पिळण, तेल पिळण आणि तण/सिलॅजची स्थानिक उपलब्धता लक्षात घ्या."
|
| 78 |
+
}
|
| 79 |
+
],
|
| 80 |
+
"pest_disease_monitoring_plan": [
|
| 81 |
+
{
|
| 82 |
+
"month": "जानेवारी-मार्च २०२६",
|
| 83 |
+
"target": "मॅस्टायटीस (गायी), बाह्य परजीवी (टिक्स, डास)",
|
| 84 |
+
"monitoring": "रोज थनांची तपासणी, काळानुसार शरीराची तपासणी, डासांचे सापळे, कृमींच्या तपासणीसाठी शेण तपासणी.",
|
| 85 |
+
"IPM_action": "थनांची स्वच्छता राखा, नियमित कृमीनाशक औषधोपचार, स्वच्छ गोठे, योग्य वेंटिलेशन. लसीकरणाची वेळापत्रक अंमलात आणा.",
|
| 86 |
+
"pesticide_name": "अँटी-पॅरासायटिक पोर-ऑन (पशुवैद्य यांच्या सल्ल्यानुसार)"
|
| 87 |
+
},
|
| 88 |
+
{
|
| 89 |
+
"month": "जुलै-सप्टेंबर २०२६",
|
| 90 |
+
"target": "अंतर्गत परजीवी (कृमी), मोसमी आजार (उदा. ई.कोली, पाय फुटणे)",
|
| 91 |
+
"monitoring": "मल तपासणी, प्राण्यांच्या शेणांचे निरीक्षण करा, नियमितपणे नाखांची तपासणी करा.",
|
| 92 |
+
"IPM_action": "योग्य वेळी कृमीनाशक औषधोपचार, कोरडे कचरा राखा, पाण्याचा साठा टाळा, खाद्य ट्रफ उंचावर ठेवा.",
|
| 93 |
+
"pesticide_name": "अँटहेल्मिंटिक्स (पशुवैद्यांच्या सल्ल्यानुसार), जखमांसाठी स्थानिक अँटीसेप्टिक्स"
|
| 94 |
+
}
|
| 95 |
+
],
|
| 96 |
+
"labour_operations_calendar": [
|
| 97 |
+
{
|
| 98 |
+
"month": "जानेवारी २०२६",
|
| 99 |
+
"tasks": [
|
| 100 |
+
"चारा काढणे आणि खाद्य देणे (रोज)",
|
| 101 |
+
"रोज दुधाची काढणी आणि दुधाचे थंडीकरण",
|
| 102 |
+
"गोठे स्वच्छ करणे आणि कचरा बदलणे",
|
| 103 |
+
"पशु आरोग्य निरीक्षण"
|
| 104 |
+
],
|
| 105 |
+
"peak_demand": "सर्वकाळ"
|
| 106 |
+
},
|
| 107 |
+
{
|
| 108 |
+
"month": "ऑक्टोबर २०२६",
|
| 109 |
+
"tasks": [
|
| 110 |
+
"रब्बी चारा पेरणी",
|
| 111 |
+
"नवीन पशु खरेदी (योजना असल्यास)",
|
| 112 |
+
"दुधाची काढणी आणि कळप व्यवस्थापन"
|
| 113 |
+
],
|
| 114 |
+
"peak_demand": "उच्च"
|
| 115 |
+
}
|
| 116 |
+
],
|
| 117 |
+
"input_procurement_budget_timeline": [
|
| 118 |
+
{
|
| 119 |
+
"item": "चारा बियाणे (रब्बी)",
|
| 120 |
+
"quantity": "क्षेत्रफळानुसार बदलते (०.६८७१ हेक्टर)",
|
| 121 |
+
"estimated_cost": "₹२,००० - ₹५,०००",
|
| 122 |
+
"procurement_month": "सप्टेंबर-ऑक्टोबर २०२५"
|
| 123 |
+
},
|
| 124 |
+
{
|
| 125 |
+
"item": "पशु खाद्य केंद्रित",
|
| 126 |
+
"quantity": "१५० गायींसाठी महिन्याची गरज",
|
| 127 |
+
"estimated_cost": "₹१०,००० - ₹१५,०००/महिना",
|
| 128 |
+
"procurement_month": "सर्वकाळ, तिमाही बल्क खरेदी"
|
| 129 |
+
}
|
| 130 |
+
],
|
| 131 |
+
"market_sales_guidance": [
|
| 132 |
+
{
|
| 133 |
+
"crop_product": "दुधाचे दूध",
|
| 134 |
+
"guidance": "दुग्ध सहकारी संस्थेला (स्थानिक ग्राहक) रोज विक्री. ताजगी आणि गुणवत्तेवर लक्ष केंद्रित करून स्थानिक ग्राहकांना/मिठाईच्या दुकानांना १५-२०% जास्त किमतीत थेट विक्रीचा विचार करा. ग्रीन अॅकर्स फार्म दुधाचे छोटे, स्थानिक ब्रँड लाँच करण्याचा विचार करा."
|
| 135 |
+
},
|
| 136 |
+
{
|
| 137 |
+
"crop_product": "मूल्यवर्धित दुग्ध उत्पादने (पनीर, तूप)",
|
| 138 |
+
"guidance": "जर प्रक्रिया क्षमता असेल तर स्थानिक किराणा दुकाने आणि ऑनलाइन डिलिव्हरी प्लॅटफॉर्म लक्ष्य करा. ब्रँड वफादारी आणि २०-३०% नफा वाढविण्यासाठी उत्पादन गुणवत्ता, सतत पुरवठा आणि आकर्षक पॅकेजिंगवर लक्ष केंद्रित करा. हंगामातील मागणीच्या शिखराचा विचार करा."
|
| 139 |
+
}
|
| 140 |
+
],
|
| 141 |
+
"sensors_monitoring_plan": [
|
| 142 |
+
{
|
| 143 |
+
"sensor": "माती आर्द्रता सेन्सर",
|
| 144 |
+
"purpose": "सिंचनाचे उत्तम प्रकारे नियोजन",
|
| 145 |
+
"frequency": "रोज वाचना",
|
| 146 |
+
"alert_threshold": "क्षमतेच्या ५०% पेक्षा कमी",
|
| 147 |
+
"action": "ड्रिप सिंचन सुरू करा"
|
| 148 |
+
},
|
| 149 |
+
{
|
| 150 |
+
"sensor": "हवामान केंद्र (बेसिक)",
|
| 151 |
+
"purpose": "कीटक/रोग भाकीत, सिंचनाचा वेळ",
|
| 152 |
+
"frequency": "तासनिहाय डेटा",
|
| 153 |
+
"alert_threshold": "उच्च आर्द्रता + विशिष्ट तापमान",
|
| 154 |
+
"action": "पूर्विकाळी बुरशीनाशक फवारणी"
|
| 155 |
+
}
|
| 156 |
+
],
|
| 157 |
+
"risk_contingency_plan": [
|
| 158 |
+
{
|
| 159 |
+
"risk": "दुष्काळ/पाण्याचा तुटवडा",
|
| 160 |
+
"strategy": "कमी कालावधीच्या, दुष्काळ-सहिष्णू प्रजातींची (उदा. बाजरीऐवजी मका) पर्यायी पेरणी करा. फार्म तलाव/पावसाचे पाणी साठवण्याची क्षमता वाढवा. पाणी सामायिक सहकारी संस्थेशी संपर्क साधा. जर अत्यंत आवश्यक असेल तर टँकरद्वारे पाणी खरेदी करा."
|
| 161 |
+
},
|
| 162 |
+
{
|
| 163 |
+
"risk": "अधिक पाऊस/पूर",
|
| 164 |
+
"strategy": "योग्य क्षेत्र ड्रेनेज सुनिश्चित करा. बीजपलंग उंचावर करा. कमी भागातील पूर-सहिष्णू पिकाच्या प्रजाती निवडा. जोरदार पावसासाठी पीक विमा."
|
| 165 |
+
}
|
| 166 |
+
],
|
| 167 |
+
"tasks_reminders": [
|
| 168 |
+
{
|
| 169 |
+
"task_id": "T001",
|
| 170 |
+
"due_date": "२०२६-०६-०१",
|
| 171 |
+
"action": "खरीप जमीन तयारी / चारा पेरणी / पिल्लांचे ठेवणे",
|
| 172 |
+
"priority": "उच्च"
|
| 173 |
+
},
|
| 174 |
+
{
|
| 175 |
+
"task_id": "T002",
|
| 176 |
+
"due_date": "२०२६-१०-०५",
|
| 177 |
+
"action": "रब्बी जमीन तयारी / चारा पेरणी / पशु आरोग्य तपासणी",
|
| 178 |
+
"priority": "उच्च"
|
| 179 |
+
}
|
| 180 |
+
],
|
| 181 |
+
"metrics_evaluation": [
|
| 182 |
+
"उत्पादन लक्ष्य: प्राथमिक उत्पादनाचे उत्पादन १०-१५% ने वाढवा (उदा. दूध १४ लिटर/दिवस/गाय).",
|
| 183 |
+
"प्रति हेक्टर/प्राणी/पक्ष्याचा इनपुट खर्च: ऑप्टिमायझेशनद्वारे ५-१०% ने कमी करा.",
|
| 184 |
+
"प्रति उद्योग नफा: प्रमुख क्रियाकलापांसाठी किमान ३०% मार्जिन सुनिश्चित करा.",
|
| 185 |
+
"कार्य पूर्णता दर: वेळापत्रकानुसार नियोजित कार्यांचे ९०% पूर्ण होण्याचे लक्ष्य ठेवा."
|
| 186 |
+
],
|
| 187 |
+
"notes": "हा प्रकल्प एक गतिमान दस्तऐवज आहे. ���शस्वी अंमलबजावणीसाठी नियमित निरीक्षण, क्षेत्र निरीक्षणातून माहिती आणि बाजारपेठ आणि हवामान परिस्थितीशी जुळवून घेणे आवश्यक आहे. सविस्तर स्थानिक सल्ल्यासाठी कृषी तज्ञांशी (उदा. KVK) सल्लामसलत करा. सर्व आर्थिक आकडेवारी अंदाजित आहेत आणि बाजारपेठेतील बदलांमुळे बदलू शकतात."
|
| 188 |
+
}
|
requirements.txt
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Flask>=2.0
|
| 2 |
+
requests
|
| 3 |
+
APScheduler
|
| 4 |
+
google-generativeai
|
| 5 |
+
pytz
|
| 6 |
+
Pillow
|
| 7 |
+
gunicorn
|
| 8 |
+
Flask
|
| 9 |
+
Werkzeug
|
| 10 |
+
supabase
|
| 11 |
+
requests
|
| 12 |
+
python-dotenv
|
static/videos/AI_Farming_Tools_and_Video.mp4
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:729cf4007425a0160278043d4523907f4ad7fbf1eb78ae43b4671daeb8dafc0b
|
| 3 |
+
size 3583636
|
templates/bot.html
ADDED
|
@@ -0,0 +1,544 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Farmers Chatbot</title>
|
| 7 |
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">
|
| 8 |
+
<style>
|
| 9 |
+
/* Farming theme palette */
|
| 10 |
+
:root{
|
| 11 |
+
--farm-green: #2f7a3e;
|
| 12 |
+
--farm-light: #e9f5ec;
|
| 13 |
+
--farm-earth: #8b5e3c;
|
| 14 |
+
--farm-accent: #f6d365;
|
| 15 |
+
--muted: #6b6b6b;
|
| 16 |
+
}
|
| 17 |
+
body { background: linear-gradient(180deg, #f7fbf7 0%, #eef7ec 100%); color: #213; }
|
| 18 |
+
|
| 19 |
+
/* Chat box */
|
| 20 |
+
#chat-box {
|
| 21 |
+
height: 420px;
|
| 22 |
+
overflow-y: auto;
|
| 23 |
+
border-radius: 12px;
|
| 24 |
+
padding: 14px;
|
| 25 |
+
background: linear-gradient(180deg, rgba(255,255,255,0.8), rgba(240,250,240,0.9));
|
| 26 |
+
box-shadow: 0 6px 18px rgba(34, 60, 80, 0.08);
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
/* Message bubbles */
|
| 30 |
+
.bot-message {
|
| 31 |
+
display: inline-block;
|
| 32 |
+
max-width: 86%;
|
| 33 |
+
color: #08351b;
|
| 34 |
+
background: linear-gradient(90deg, rgba(47,122,62,0.06), rgba(47,122,62,0.12));
|
| 35 |
+
border-left: 4px solid var(--farm-green);
|
| 36 |
+
border-radius: 12px 12px 12px 3px;
|
| 37 |
+
padding: 8px 12px;
|
| 38 |
+
margin-bottom: 8px;
|
| 39 |
+
box-shadow: 0 2px 6px rgba(47,122,62,0.06);
|
| 40 |
+
}
|
| 41 |
+
.user-message {
|
| 42 |
+
display: inline-block;
|
| 43 |
+
max-width: 86%;
|
| 44 |
+
color: #2b3b3b;
|
| 45 |
+
background: linear-gradient(90deg, rgba(246,211,101,0.08), rgba(246,211,101,0.12));
|
| 46 |
+
border-right: 4px solid var(--farm-accent);
|
| 47 |
+
border-radius: 12px 12px 3px 12px;
|
| 48 |
+
padding: 8px 12px;
|
| 49 |
+
margin-bottom: 8px;
|
| 50 |
+
text-align: right;
|
| 51 |
+
align-self: flex-end;
|
| 52 |
+
box-shadow: 0 2px 6px rgba(139,94,60,0.06);
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
/* Sidebar styling */
|
| 56 |
+
#sidebar-card { border-radius: 12px; background: linear-gradient(180deg, #ffffff, #f4fbf4); }
|
| 57 |
+
#sidebar .btn { text-align: left; }
|
| 58 |
+
#sidebar .card-title { color: var(--farm-green); font-weight: 700; }
|
| 59 |
+
#sidebar .form-label { color: var(--muted); }
|
| 60 |
+
|
| 61 |
+
/* Cards */
|
| 62 |
+
.card { border: none; border-radius: 12px; }
|
| 63 |
+
.card .card-body { padding: 18px; }
|
| 64 |
+
|
| 65 |
+
/* Responsive tweaks */
|
| 66 |
+
@media (min-width: 768px) {
|
| 67 |
+
#sidebar-card { position: sticky; top: 20px; }
|
| 68 |
+
#chat-box { height: 520px; }
|
| 69 |
+
}
|
| 70 |
+
@media (max-width: 767.98px) {
|
| 71 |
+
#chat-box { height: 320px; }
|
| 72 |
+
#sidebar { display: none; }
|
| 73 |
+
#sidebar.show { display: block; position: relative; z-index: 50; }
|
| 74 |
+
#sidebar .card { box-shadow: 0 8px 30px rgba(34,60,80,0.08); }
|
| 75 |
+
}
|
| 76 |
+
|
| 77 |
+
/* Small helpers */
|
| 78 |
+
.bot-message small, .user-message small { display: block; color: #666; font-size: 11px; margin-top: 6px; }
|
| 79 |
+
</style>
|
| 80 |
+
</head>
|
| 81 |
+
<body>
|
| 82 |
+
<div class="container-fluid mt-4">
|
| 83 |
+
<!-- Back button for navigation -->
|
| 84 |
+
<div class="d-flex mb-2">
|
| 85 |
+
<button onclick="history.back()" class="btn btn-light btn-sm">◀ Back</button>
|
| 86 |
+
</div>
|
| 87 |
+
<div class="row">
|
| 88 |
+
<aside id="sidebar" class="col-12 col-md-3 mb-3 mb-md-0">
|
| 89 |
+
<div class="card" id="sidebar-card">
|
| 90 |
+
<div class="card-body">
|
| 91 |
+
<h4 class="card-title">Actions</h4>
|
| 92 |
+
<p class="text-muted small">Controls and quick actions</p>
|
| 93 |
+
<div class="d-grid gap-2">
|
| 94 |
+
<button id="mic-btn" class="btn btn-outline-secondary">🎤 Speak</button>
|
| 95 |
+
<button id="weather-btn" class="btn btn-outline-info">☁️ Check My Weather</button>
|
| 96 |
+
<button id="add-update-btn" class="btn btn-outline-warning">✍️ Add Farm Update</button>
|
| 97 |
+
<button id="get-tasks-btn" class="btn btn-outline-success">📋 Get My Daily Tasks</button>
|
| 98 |
+
<hr />
|
| 99 |
+
<label for="lang-select" class="form-label mb-1">Language</label>
|
| 100 |
+
<select id="lang-select" class="form-select mb-2">
|
| 101 |
+
<option value="en-US">English</option>
|
| 102 |
+
<option value="hi-IN">Hindi</option>
|
| 103 |
+
<option value="mr-IN">Marathi</option>
|
| 104 |
+
<option value="bn-IN">Bengali</option>
|
| 105 |
+
<option value="ta-IN">Tamil</option>
|
| 106 |
+
</select>
|
| 107 |
+
<div class="btn-group" role="group" aria-label="TTS Controls">
|
| 108 |
+
<button id="tts-play" class="btn btn-outline-primary">▶️ Play</button>
|
| 109 |
+
<button id="tts-pause" class="btn btn-outline-secondary">⏸️ Pause</button>
|
| 110 |
+
<button id="tts-stop" class="btn btn-outline-danger">⏹️ Stop</button>
|
| 111 |
+
</div>
|
| 112 |
+
<button id="play-summary" class="btn btn-outline-primary mt-2">🔊 Play Summary</button>
|
| 113 |
+
<div class="form-check form-switch mt-2">
|
| 114 |
+
<input class="form-check-input" type="checkbox" id="auto-tts" checked>
|
| 115 |
+
<label class="form-check-label" for="auto-tts">Auto TTS</label>
|
| 116 |
+
</div>
|
| 117 |
+
</div>
|
| 118 |
+
</div>
|
| 119 |
+
</div>
|
| 120 |
+
</aside>
|
| 121 |
+
|
| 122 |
+
<main class="col-12 col-md-9">
|
| 123 |
+
<h2>Farmers Chatbot</h2>
|
| 124 |
+
<div id="summary" class="alert alert-info">{{ summary }}</div>
|
| 125 |
+
|
| 126 |
+
<!-- Mobile: sidebar toggle -->
|
| 127 |
+
<div class="d-md-none mb-2">
|
| 128 |
+
<button id="sidebar-toggle" class="btn btn-outline-secondary btn-sm">☰ Actions</button>
|
| 129 |
+
</div>
|
| 130 |
+
|
| 131 |
+
<div id="chat-container" class="card">
|
| 132 |
+
<div class="card-body">
|
| 133 |
+
<div id="chat-box"></div>
|
| 134 |
+
<form id="chat-form" class="mt-3">
|
| 135 |
+
<div class="input-group">
|
| 136 |
+
<input type="text" id="user-input" class="form-control" placeholder="Type your message..." autocomplete="off" required>
|
| 137 |
+
<button class="btn btn-primary" type="submit">Send</button>
|
| 138 |
+
</div>
|
| 139 |
+
</form>
|
| 140 |
+
</div>
|
| 141 |
+
</div>
|
| 142 |
+
|
| 143 |
+
<div class="card mt-3">
|
| 144 |
+
<div class="card-body">
|
| 145 |
+
<h5 class="card-title">Upload file or image</h5>
|
| 146 |
+
<label for="file-input" class="form-label">Select file</label>
|
| 147 |
+
<input class="form-control" type="file" id="file-input">
|
| 148 |
+
<div class="form-text mb-2">Allowed: png, jpg, jpeg, gif, bmp, tif, csv, json, pdf, txt</div>
|
| 149 |
+
<button id="upload-btn" class="btn btn-sm btn-success">Upload & Analyze</button>
|
| 150 |
+
<div id="upload-result" class="mt-2"></div>
|
| 151 |
+
<div id="weather-result" class="mt-2"></div>
|
| 152 |
+
<div id="update-result" class="mt-2"></div>
|
| 153 |
+
</div>
|
| 154 |
+
</div>
|
| 155 |
+
</main>
|
| 156 |
+
</div>
|
| 157 |
+
</div>
|
| 158 |
+
|
| 159 |
+
<!-- Load Bootstrap JS bundle for modal support -->
|
| 160 |
+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
|
| 161 |
+
|
| 162 |
+
<!-- Update Modal -->
|
| 163 |
+
<div class="modal" tabindex="-1" id="updateModal">
|
| 164 |
+
<div class="modal-dialog">
|
| 165 |
+
<div class="modal-content">
|
| 166 |
+
<div class="modal-header">
|
| 167 |
+
<h5 class="modal-title">Add Farm Update</h5>
|
| 168 |
+
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
| 169 |
+
</div>
|
| 170 |
+
<div class="modal-body">
|
| 171 |
+
<div class="mb-2">
|
| 172 |
+
<label class="form-label">Select Farmer (optional)</label>
|
| 173 |
+
<select id="modal-farmer" class="form-select">
|
| 174 |
+
<option value="">(No selection)</option>
|
| 175 |
+
{% for f in farmers %}
|
| 176 |
+
<option value="{{ f.id }}">{{ f.farmer_name }}</option>
|
| 177 |
+
{% endfor %}
|
| 178 |
+
</select>
|
| 179 |
+
</div>
|
| 180 |
+
<div class="mb-2">
|
| 181 |
+
<label class="form-label">Category</label>
|
| 182 |
+
<input id="modal-category" class="form-control" placeholder="e.g., pest_issue, water_update" />
|
| 183 |
+
</div>
|
| 184 |
+
<div class="mb-2">
|
| 185 |
+
<label class="form-label">Update text</label>
|
| 186 |
+
<textarea id="modal-text" class="form-control" rows="4"></textarea>
|
| 187 |
+
</div>
|
| 188 |
+
</div>
|
| 189 |
+
<div class="modal-footer">
|
| 190 |
+
<button type="button" id="modal-submit" class="btn btn-primary">Submit Update & Generate Tasks</button>
|
| 191 |
+
<button type="button" id="modal-generate-only" class="btn btn-success">Generate Tasks Only</button>
|
| 192 |
+
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
|
| 193 |
+
</div>
|
| 194 |
+
</div>
|
| 195 |
+
</div>
|
| 196 |
+
</div>
|
| 197 |
+
|
| 198 |
+
<script>
|
| 199 |
+
// Bootstrap modal wiring
|
| 200 |
+
const updateModalEl = document.getElementById('updateModal');
|
| 201 |
+
let updateModal = null;
|
| 202 |
+
if (window.bootstrap) updateModal = new bootstrap.Modal(updateModalEl);
|
| 203 |
+
|
| 204 |
+
document.getElementById('add-update-btn').addEventListener('click', (e) => {
|
| 205 |
+
e.preventDefault();
|
| 206 |
+
if (window.bootstrap) updateModal.show();
|
| 207 |
+
else alert('Modal requires Bootstrap JS to be loaded in the page.');
|
| 208 |
+
});
|
| 209 |
+
|
| 210 |
+
document.getElementById('modal-submit').addEventListener('click', async (e) => {
|
| 211 |
+
const record_id = document.getElementById('modal-farmer').value || null;
|
| 212 |
+
const category = document.getElementById('modal-category').value || 'general_update';
|
| 213 |
+
const update_text = document.getElementById('modal-text').value || '';
|
| 214 |
+
if (!update_text.trim()) { alert('Please enter update text'); return; }
|
| 215 |
+
try {
|
| 216 |
+
const resp = await fetch('/submit_update', {
|
| 217 |
+
method: 'POST', headers: { 'Content-Type': 'application/json' },
|
| 218 |
+
body: JSON.stringify({ record_id, category, update_text })
|
| 219 |
+
});
|
| 220 |
+
const data = await resp.json();
|
| 221 |
+
if (data.error) { document.getElementById('update-result').innerText = 'Error: ' + data.error; return; }
|
| 222 |
+
document.getElementById('update-result').innerHTML = `<pre>${JSON.stringify(data.update, null, 2)}</pre>`;
|
| 223 |
+
if (data.tasks_preview) {
|
| 224 |
+
const tasks = data.tasks_preview;
|
| 225 |
+
if (tasks.error) appendMessage('bot', 'Task generation error: ' + tasks.error);
|
| 226 |
+
else if (Array.isArray(tasks)) {
|
| 227 |
+
appendMessage('bot', 'Generated daily tasks (preview):');
|
| 228 |
+
tasks.forEach(t => appendMessage('bot', `- ${t.action} (Priority: ${t.priority}) ${t.notes ? '\n Notes: ' + t.notes : ''}`));
|
| 229 |
+
} else {
|
| 230 |
+
appendMessage('bot', 'Generated tasks preview: ' + JSON.stringify(tasks));
|
| 231 |
+
}
|
| 232 |
+
}
|
| 233 |
+
if (window.bootstrap) updateModal.hide();
|
| 234 |
+
} catch (err) {
|
| 235 |
+
document.getElementById('update-result').innerText = 'Submit failed: ' + err;
|
| 236 |
+
}
|
| 237 |
+
});
|
| 238 |
+
|
| 239 |
+
// Get My Daily Tasks button handler (uses selected farmer if available)
|
| 240 |
+
document.getElementById('get-tasks-btn').addEventListener('click', async (e) => {
|
| 241 |
+
e.preventDefault();
|
| 242 |
+
// If user has chosen a farmer in modal, use it; otherwise prompt to open modal
|
| 243 |
+
const sel = document.getElementById('modal-farmer').value;
|
| 244 |
+
if (!sel) {
|
| 245 |
+
// show modal and ask user to pick a farmer
|
| 246 |
+
if (window.bootstrap && updateModal) {
|
| 247 |
+
updateModal.show();
|
| 248 |
+
alert('Please select a farmer in the modal, then click "Generate Tasks Only" or use "Submit Update & Generate Tasks".');
|
| 249 |
+
return;
|
| 250 |
+
} else {
|
| 251 |
+
appendMessage('bot', 'Please select a farmer to generate tasks for.');
|
| 252 |
+
return;
|
| 253 |
+
}
|
| 254 |
+
}
|
| 255 |
+
try {
|
| 256 |
+
appendMessage('user', 'Get my daily tasks');
|
| 257 |
+
const resp = await fetch('/generate_daily_tasks_preview', {
|
| 258 |
+
method: 'POST', headers: { 'Content-Type': 'application/json' },
|
| 259 |
+
body: JSON.stringify({ record_id: sel })
|
| 260 |
+
});
|
| 261 |
+
const data = await resp.json();
|
| 262 |
+
if (data.error) { appendMessage('bot', 'Error: ' + data.error); return; }
|
| 263 |
+
const tasks = data.tasks || [];
|
| 264 |
+
if (Array.isArray(tasks)) {
|
| 265 |
+
appendMessage('bot', 'Daily tasks for selected farmer:');
|
| 266 |
+
tasks.forEach(t => appendMessage('bot', `- ${t.action} (Priority: ${t.priority})${t.notes ? '\n Notes: ' + t.notes : ''}`));
|
| 267 |
+
} else {
|
| 268 |
+
appendMessage('bot', 'Tasks: ' + JSON.stringify(tasks));
|
| 269 |
+
}
|
| 270 |
+
} catch (err) {
|
| 271 |
+
appendMessage('bot', 'Failed to fetch tasks: ' + err);
|
| 272 |
+
}
|
| 273 |
+
});
|
| 274 |
+
|
| 275 |
+
// Generate tasks only (no update saved)
|
| 276 |
+
document.getElementById('modal-generate-only').addEventListener('click', async (e) => {
|
| 277 |
+
const record_id = document.getElementById('modal-farmer').value || null;
|
| 278 |
+
if (!record_id) { alert('Please select a farmer to generate tasks for'); return; }
|
| 279 |
+
try {
|
| 280 |
+
const resp = await fetch('/generate_daily_tasks_preview', {
|
| 281 |
+
method: 'POST', headers: { 'Content-Type': 'application/json' },
|
| 282 |
+
body: JSON.stringify({ record_id })
|
| 283 |
+
});
|
| 284 |
+
const data = await resp.json();
|
| 285 |
+
if (data.error) { appendMessage('bot', 'Error generating tasks: ' + data.error); return; }
|
| 286 |
+
const tasks = data.tasks || [];
|
| 287 |
+
if (Array.isArray(tasks)) {
|
| 288 |
+
appendMessage('bot', 'Generated daily tasks (preview):');
|
| 289 |
+
tasks.forEach(t => appendMessage('bot', `- ${t.action} (Priority: ${t.priority}) ${t.notes ? '\n Notes: ' + t.notes : ''}`));
|
| 290 |
+
} else {
|
| 291 |
+
appendMessage('bot', 'Tasks: ' + JSON.stringify(tasks));
|
| 292 |
+
}
|
| 293 |
+
if (window.bootstrap && updateModal) updateModal.hide();
|
| 294 |
+
} catch (err) {
|
| 295 |
+
appendMessage('bot', 'Task generation failed: ' + err);
|
| 296 |
+
}
|
| 297 |
+
});
|
| 298 |
+
const chatBox = document.getElementById('chat-box');
|
| 299 |
+
const chatForm = document.getElementById('chat-form');
|
| 300 |
+
const userInput = document.getElementById('user-input');
|
| 301 |
+
|
| 302 |
+
chatForm.addEventListener('submit', async function(e) {
|
| 303 |
+
e.preventDefault();
|
| 304 |
+
const message = userInput.value.trim();
|
| 305 |
+
if (!message) return;
|
| 306 |
+
appendMessage('user', message);
|
| 307 |
+
userInput.value = '';
|
| 308 |
+
const lang = document.getElementById('lang-select').value || 'en-US';
|
| 309 |
+
const response = await fetch('/chatbot', {
|
| 310 |
+
method: 'POST',
|
| 311 |
+
headers: { 'Content-Type': 'application/json' },
|
| 312 |
+
body: JSON.stringify({ message, lang })
|
| 313 |
+
});
|
| 314 |
+
const data = await response.json();
|
| 315 |
+
appendMessage('bot', data.reply);
|
| 316 |
+
// Play response via TTS if enabled
|
| 317 |
+
const autoTts = document.getElementById('auto-tts').checked;
|
| 318 |
+
if (autoTts) {
|
| 319 |
+
const which = document.getElementById('tts-select').value;
|
| 320 |
+
if (which === 'last' || which === 'both') speakText(data.reply, lang);
|
| 321 |
+
if (which === 'summary' || which === 'both') {
|
| 322 |
+
// Speak summary after a short delay if both
|
| 323 |
+
const summaryText = document.getElementById('summary').textContent || '';
|
| 324 |
+
if (which === 'both') setTimeout(() => speakText(summaryText, lang), 700);
|
| 325 |
+
else speakText(summaryText, lang);
|
| 326 |
+
}
|
| 327 |
+
}
|
| 328 |
+
});
|
| 329 |
+
|
| 330 |
+
function appendMessage(sender, text) {
|
| 331 |
+
const div = document.createElement('div');
|
| 332 |
+
div.className = sender === 'bot' ? 'bot-message' : 'user-message';
|
| 333 |
+
div.textContent = text;
|
| 334 |
+
chatBox.appendChild(div);
|
| 335 |
+
chatBox.scrollTop = chatBox.scrollHeight;
|
| 336 |
+
}
|
| 337 |
+
|
| 338 |
+
// --- Speech to Text (Web Speech API) ---
|
| 339 |
+
const micBtn = document.getElementById('mic-btn');
|
| 340 |
+
let recognition = null;
|
| 341 |
+
if ('webkitSpeechRecognition' in window || 'SpeechRecognition' in window) {
|
| 342 |
+
const SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition;
|
| 343 |
+
recognition = new SpeechRecognition();
|
| 344 |
+
recognition.interimResults = false;
|
| 345 |
+
recognition.onresult = (event) => {
|
| 346 |
+
const transcript = Array.from(event.results).map(r => r[0].transcript).join('');
|
| 347 |
+
userInput.value = transcript;
|
| 348 |
+
};
|
| 349 |
+
recognition.onerror = (e) => { console.warn('Speech recognition error', e); };
|
| 350 |
+
} else {
|
| 351 |
+
micBtn.disabled = true;
|
| 352 |
+
micBtn.title = 'Speech recognition not supported in this browser.';
|
| 353 |
+
}
|
| 354 |
+
|
| 355 |
+
micBtn.addEventListener('click', (e) => {
|
| 356 |
+
e.preventDefault();
|
| 357 |
+
if (!recognition) return;
|
| 358 |
+
try {
|
| 359 |
+
recognition.lang = document.getElementById('lang-select').value || 'en-US';
|
| 360 |
+
recognition.start();
|
| 361 |
+
} catch (err) {
|
| 362 |
+
console.warn('SpeechRecognition start failed', err);
|
| 363 |
+
}
|
| 364 |
+
});
|
| 365 |
+
|
| 366 |
+
// --- Text to Speech ---
|
| 367 |
+
let currentUtterance = null;
|
| 368 |
+
function speakText(text, lang) {
|
| 369 |
+
if (!('speechSynthesis' in window)) return;
|
| 370 |
+
window.speechSynthesis.cancel();
|
| 371 |
+
const utter = new SpeechSynthesisUtterance(text);
|
| 372 |
+
currentUtterance = utter;
|
| 373 |
+
utter.lang = lang || document.getElementById('lang-select').value || 'en-US';
|
| 374 |
+
// Optionally pick a voice that matches language
|
| 375 |
+
const voices = window.speechSynthesis.getVoices();
|
| 376 |
+
const matched = voices.find(v => v.lang && v.lang.startsWith(utter.lang.split('-')[0]));
|
| 377 |
+
if (matched) utter.voice = matched;
|
| 378 |
+
utter.onend = () => { currentUtterance = null; };
|
| 379 |
+
window.speechSynthesis.speak(utter);
|
| 380 |
+
}
|
| 381 |
+
|
| 382 |
+
// TTS control buttons
|
| 383 |
+
document.getElementById('tts-play').addEventListener('click', () => {
|
| 384 |
+
// Resume if paused
|
| 385 |
+
if (window.speechSynthesis.paused) {
|
| 386 |
+
window.speechSynthesis.resume();
|
| 387 |
+
return;
|
| 388 |
+
}
|
| 389 |
+
// Otherwise speak selected text
|
| 390 |
+
const which = document.getElementById('tts-select').value;
|
| 391 |
+
const lang = document.getElementById('lang-select').value || 'en-US';
|
| 392 |
+
if (which === 'summary') speakText(document.getElementById('summary').textContent || '', lang);
|
| 393 |
+
else if (which === 'last') {
|
| 394 |
+
// find last bot message
|
| 395 |
+
const botMsgs = document.querySelectorAll('.bot-message');
|
| 396 |
+
const last = botMsgs[botMsgs.length-1];
|
| 397 |
+
if (last) speakText(last.textContent || '', lang);
|
| 398 |
+
} else {
|
| 399 |
+
// both: read last bot then summary
|
| 400 |
+
const botMsgs = document.querySelectorAll('.bot-message');
|
| 401 |
+
const last = botMsgs[botMsgs.length-1];
|
| 402 |
+
if (last) {
|
| 403 |
+
speakText(last.textContent || '', lang);
|
| 404 |
+
setTimeout(() => speakText(document.getElementById('summary').textContent || '', lang), 700);
|
| 405 |
+
} else {
|
| 406 |
+
speakText(document.getElementById('summary').textContent || '', lang);
|
| 407 |
+
}
|
| 408 |
+
}
|
| 409 |
+
});
|
| 410 |
+
|
| 411 |
+
document.getElementById('tts-pause').addEventListener('click', () => {
|
| 412 |
+
if (window.speechSynthesis.speaking && !window.speechSynthesis.paused) window.speechSynthesis.pause();
|
| 413 |
+
else if (window.speechSynthesis.paused) window.speechSynthesis.resume();
|
| 414 |
+
});
|
| 415 |
+
|
| 416 |
+
document.getElementById('tts-stop').addEventListener('click', () => {
|
| 417 |
+
window.speechSynthesis.cancel();
|
| 418 |
+
currentUtterance = null;
|
| 419 |
+
});
|
| 420 |
+
|
| 421 |
+
// Selector to choose which text to speak
|
| 422 |
+
const selectorWrap = document.createElement('div');
|
| 423 |
+
selectorWrap.className = 'ms-2';
|
| 424 |
+
selectorWrap.innerHTML = `
|
| 425 |
+
<label for="tts-select" class="form-label mb-0">TTS Target</label>
|
| 426 |
+
<select id="tts-select" class="form-select form-select-sm">
|
| 427 |
+
<option value="last">Last bot reply</option>
|
| 428 |
+
<option value="summary">Summary</option>
|
| 429 |
+
<option value="both">Both (bot reply then summary)</option>
|
| 430 |
+
</select>
|
| 431 |
+
`;
|
| 432 |
+
// insert selector after the tts buttons
|
| 433 |
+
document.getElementById('mic-btn').parentNode.insertBefore(selectorWrap, document.getElementById('mic-btn').nextSibling);
|
| 434 |
+
|
| 435 |
+
// Play the summary via TTS when clicking the button
|
| 436 |
+
document.getElementById('play-summary').addEventListener('click', (e) => {
|
| 437 |
+
e.preventDefault();
|
| 438 |
+
const summaryText = document.getElementById('summary').textContent || '';
|
| 439 |
+
const lang = document.getElementById('lang-select').value || 'en-US';
|
| 440 |
+
speakText(summaryText, lang);
|
| 441 |
+
});
|
| 442 |
+
|
| 443 |
+
// --- File upload handling ---
|
| 444 |
+
const uploadBtn = document.getElementById('upload-btn');
|
| 445 |
+
const fileInput = document.getElementById('file-input');
|
| 446 |
+
const uploadResult = document.getElementById('upload-result');
|
| 447 |
+
|
| 448 |
+
uploadBtn.addEventListener('click', async (e) => {
|
| 449 |
+
e.preventDefault();
|
| 450 |
+
const file = fileInput.files[0];
|
| 451 |
+
if (!file) {
|
| 452 |
+
uploadResult.innerText = 'Please select a file to upload.';
|
| 453 |
+
return;
|
| 454 |
+
}
|
| 455 |
+
const formData = new FormData();
|
| 456 |
+
formData.append('file', file);
|
| 457 |
+
uploadResult.innerText = 'Uploading...';
|
| 458 |
+
try {
|
| 459 |
+
const resp = await fetch('/upload', { method: 'POST', body: formData });
|
| 460 |
+
const data = await resp.json();
|
| 461 |
+
if (data.error) {
|
| 462 |
+
uploadResult.innerText = 'Error: ' + data.error;
|
| 463 |
+
return;
|
| 464 |
+
}
|
| 465 |
+
uploadResult.innerHTML = `<pre>${JSON.stringify(data.analysis, null, 2)}</pre>`;
|
| 466 |
+
} catch (err) {
|
| 467 |
+
uploadResult.innerText = 'Upload failed: ' + err;
|
| 468 |
+
}
|
| 469 |
+
});
|
| 470 |
+
|
| 471 |
+
// --- Weather lookup handling ---
|
| 472 |
+
const weatherBtn = document.getElementById('weather-btn');
|
| 473 |
+
const weatherResult = document.getElementById('weather-result');
|
| 474 |
+
weatherBtn.addEventListener('click', async (e) => {
|
| 475 |
+
e.preventDefault();
|
| 476 |
+
// Add a user message in chat
|
| 477 |
+
appendMessage('user', 'Check my weather');
|
| 478 |
+
weatherResult.innerText = 'Fetching location...';
|
| 479 |
+
// Use browser geolocation if available
|
| 480 |
+
if (navigator.geolocation) {
|
| 481 |
+
navigator.geolocation.getCurrentPosition(async (pos) => {
|
| 482 |
+
const lat = pos.coords.latitude;
|
| 483 |
+
const lon = pos.coords.longitude;
|
| 484 |
+
weatherResult.innerText = `Fetching weather for ${lat.toFixed(4)}, ${lon.toFixed(4)}...`;
|
| 485 |
+
try {
|
| 486 |
+
const resp = await fetch('/api/weather', {
|
| 487 |
+
method: 'POST',
|
| 488 |
+
headers: { 'Content-Type': 'application/json' },
|
| 489 |
+
body: JSON.stringify({ lat, lon })
|
| 490 |
+
});
|
| 491 |
+
const data = await resp.json();
|
| 492 |
+
if (data.error) {
|
| 493 |
+
weatherResult.innerText = 'Weather error: ' + data.error;
|
| 494 |
+
appendMessage('bot', 'Unable to fetch weather: ' + data.error);
|
| 495 |
+
return;
|
| 496 |
+
}
|
| 497 |
+
// Build a short human-friendly message
|
| 498 |
+
const cur = data.current || {};
|
| 499 |
+
const daily = data.daily || [];
|
| 500 |
+
let msg = `Weather for (${data.lat.toFixed(2)}, ${data.lon.toFixed(2)}): ${cur.icon || ''} `;
|
| 501 |
+
msg += `${cur.temperature != null ? cur.temperature + '°C' : ''} - ${cur.desc || ''}`;
|
| 502 |
+
if (daily && daily.length) {
|
| 503 |
+
msg += '\nForecast:';
|
| 504 |
+
for (let i=0; i<Math.min(3,daily.length); i++) {
|
| 505 |
+
const d = daily[i];
|
| 506 |
+
const date = d.date || '';
|
| 507 |
+
msg += `\n${date}: ${d.icon || ''} ${d.tmin || '-'}°C to ${d.tmax || '-'}°C - ${d.desc || ''}`;
|
| 508 |
+
}
|
| 509 |
+
}
|
| 510 |
+
weatherResult.innerHTML = `<pre>${msg}</pre>`;
|
| 511 |
+
appendMessage('bot', msg);
|
| 512 |
+
// Optionally TTS the result if auto-tts is enabled
|
| 513 |
+
const autoTts = document.getElementById('auto-tts').checked;
|
| 514 |
+
if (autoTts) speakText(msg, document.getElementById('lang-select').value || 'en-US');
|
| 515 |
+
} catch (err) {
|
| 516 |
+
weatherResult.innerText = 'Weather request failed: ' + err;
|
| 517 |
+
appendMessage('bot', 'Weather request failed.');
|
| 518 |
+
}
|
| 519 |
+
}, (err) => {
|
| 520 |
+
weatherResult.innerText = 'Geolocation error: ' + (err.message || err.code);
|
| 521 |
+
appendMessage('bot', 'Unable to get location — please allow location access or enter coordinates.');
|
| 522 |
+
}, { timeout: 10000 });
|
| 523 |
+
} else {
|
| 524 |
+
weatherResult.innerText = 'Geolocation not supported by this browser.';
|
| 525 |
+
appendMessage('bot', 'Geolocation not supported by your browser.');
|
| 526 |
+
}
|
| 527 |
+
});
|
| 528 |
+
</script>
|
| 529 |
+
<script>
|
| 530 |
+
// Sidebar toggle for small screens
|
| 531 |
+
const sidebar = document.getElementById('sidebar');
|
| 532 |
+
const sidebarToggle = document.getElementById('sidebar-toggle');
|
| 533 |
+
if (sidebarToggle) {
|
| 534 |
+
sidebarToggle.addEventListener('click', (e) => {
|
| 535 |
+
e.preventDefault();
|
| 536 |
+
if (sidebar.classList.contains('show')) sidebar.classList.remove('show');
|
| 537 |
+
else sidebar.classList.add('show');
|
| 538 |
+
// scroll to top to show sidebar
|
| 539 |
+
window.scrollTo({ top: 0, behavior: 'smooth' });
|
| 540 |
+
});
|
| 541 |
+
}
|
| 542 |
+
</script>
|
| 543 |
+
</body>
|
| 544 |
+
</html>
|
templates/form.html
ADDED
|
@@ -0,0 +1,1526 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8" />
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 6 |
+
<title>Farm Data Entry</title>
|
| 7 |
+
<style>
|
| 8 |
+
.admin-link { position: absolute; right: 18px; top: 14px; z-index: 9999; }
|
| 9 |
+
</style>
|
| 10 |
+
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" />
|
| 11 |
+
<link href="https://cdn.jsdelivr.net/npm/toastify-js/src/toastify.min.css" rel="stylesheet" />
|
| 12 |
+
<link href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css" rel="stylesheet">
|
| 13 |
+
<style>
|
| 14 |
+
:root {
|
| 15 |
+
--green: #2e7d32;
|
| 16 |
+
--green-dark: #1b5e20;
|
| 17 |
+
--light-green: #c8e6c9;
|
| 18 |
+
--mint: #e8f5e9;
|
| 19 |
+
--cream: #fff9f0;
|
| 20 |
+
--accent: #fff3e0;
|
| 21 |
+
--muted: #6c757d;
|
| 22 |
+
--surface: #ffffff;
|
| 23 |
+
/* Section specific colors */
|
| 24 |
+
--color-crop: #8bc34a; /* light green */
|
| 25 |
+
--color-dairy: #00897b; /* teal */
|
| 26 |
+
--color-poultry: #ffb74d; /* amber */
|
| 27 |
+
--color-horti: #7cb342; /* horti green */
|
| 28 |
+
--color-plantation: #2e7d32; /* deep green */
|
| 29 |
+
--color-soil: #0288d1; /* soil/water blue */
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
/* Base */
|
| 33 |
+
body {
|
| 34 |
+
font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
|
| 35 |
+
background: linear-gradient(180deg, var(--cream), #f7fff6);
|
| 36 |
+
color: #15321f;
|
| 37 |
+
margin: 0;
|
| 38 |
+
padding: 0;
|
| 39 |
+
min-height: 100vh;
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
/* Page container adjustments - responsive padding */
|
| 43 |
+
.container-fluid {
|
| 44 |
+
padding: 12px;
|
| 45 |
+
max-width: 100%;
|
| 46 |
+
box-sizing: border-box;
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
/* Card container - responsive width and spacing */
|
| 50 |
+
.row > .col-12 > .card {
|
| 51 |
+
width: 100%;
|
| 52 |
+
max-width: none;
|
| 53 |
+
margin: 0;
|
| 54 |
+
border-radius: 12px;
|
| 55 |
+
overflow: visible;
|
| 56 |
+
box-sizing: border-box;
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
/* Map sizing - responsive heights */
|
| 60 |
+
#map, #modalMap {
|
| 61 |
+
height: 45vh;
|
| 62 |
+
width: 100%;
|
| 63 |
+
border-radius: 12px;
|
| 64 |
+
min-height: 250px;
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
/* Card surface */
|
| 68 |
+
.card {
|
| 69 |
+
background: linear-gradient(180deg, rgba(255,255,255,0.98), #fbfff9);
|
| 70 |
+
border: 3px solid rgba(30,90,40,0.12);
|
| 71 |
+
box-shadow: 0 4px 16px rgba(46,125,50,0.06);
|
| 72 |
+
border-radius: 12px;
|
| 73 |
+
margin-bottom: 16px;
|
| 74 |
+
}
|
| 75 |
+
|
| 76 |
+
/* Per-section border & header accents */
|
| 77 |
+
.card.section-portal { border-color: var(--color-plantation); }
|
| 78 |
+
.card.section-farmer { border-color: var(--color-plantation); }
|
| 79 |
+
.card.section-location { border-color: var(--color-soil); }
|
| 80 |
+
.card.section-crop { border-color: var(--color-crop); }
|
| 81 |
+
.card.section-dairy { border-color: var(--color-dairy); }
|
| 82 |
+
.card.section-poultry { border-color: var(--color-poultry); }
|
| 83 |
+
.card.section-horti { border-color: var(--color-horti); }
|
| 84 |
+
.card.section-plantation { border-color: var(--color-plantation); }
|
| 85 |
+
.card.section-soil { border-color: var(--color-soil); }
|
| 86 |
+
|
| 87 |
+
/* Header accents per section */
|
| 88 |
+
.card.section-crop .card-header { background: linear-gradient(90deg, rgba(139,195,74,0.12), var(--light-green)); }
|
| 89 |
+
.card.section-dairy .card-header { background: linear-gradient(90deg, rgba(0,137,123,0.08), #e6f7f4); }
|
| 90 |
+
.card.section-poultry .card-header { background: linear-gradient(90deg, rgba(255,183,77,0.08), #fff6ea); }
|
| 91 |
+
.card.section-horti .card-header { background: linear-gradient(90deg, rgba(124,179,66,0.08), #f3fff4); }
|
| 92 |
+
.card.section-plantation .card-header { background: linear-gradient(90deg, rgba(46,125,50,0.08), var(--mint)); }
|
| 93 |
+
.card.section-soil .card-header { background: linear-gradient(90deg, rgba(2,136,209,0.08), #eaf6ff); }
|
| 94 |
+
.card.section-location .card-header { background: linear-gradient(90deg, rgba(2,136,209,0.06), #f3fbff); }
|
| 95 |
+
|
| 96 |
+
.card-body {
|
| 97 |
+
padding: 1rem;
|
| 98 |
+
}
|
| 99 |
+
|
| 100 |
+
.card-title {
|
| 101 |
+
color: var(--green-dark);
|
| 102 |
+
font-weight: 700;
|
| 103 |
+
letter-spacing: 0.2px;
|
| 104 |
+
font-size: 1.1rem;
|
| 105 |
+
}
|
| 106 |
+
|
| 107 |
+
/* Card header */
|
| 108 |
+
.card-header {
|
| 109 |
+
font-weight: 600;
|
| 110 |
+
background: linear-gradient(90deg, var(--light-green), var(--mint));
|
| 111 |
+
color: #0b3a2a;
|
| 112 |
+
border-bottom: none;
|
| 113 |
+
padding: 0.75rem 1rem;
|
| 114 |
+
border-radius: 10px 10px 0 0;
|
| 115 |
+
}
|
| 116 |
+
|
| 117 |
+
/* Form controls - mobile-optimized */
|
| 118 |
+
.form-label {
|
| 119 |
+
font-weight: 600;
|
| 120 |
+
color: #15421f;
|
| 121 |
+
font-size: 0.95rem;
|
| 122 |
+
margin-bottom: 0.5rem;
|
| 123 |
+
}
|
| 124 |
+
|
| 125 |
+
/* Field icons */
|
| 126 |
+
.field-icon {
|
| 127 |
+
color: var(--green-dark);
|
| 128 |
+
font-size: 1rem;
|
| 129 |
+
vertical-align: -0.12em;
|
| 130 |
+
margin-right: 6px;
|
| 131 |
+
}
|
| 132 |
+
|
| 133 |
+
input.form-control, select.form-select, textarea.form-control {
|
| 134 |
+
border-radius: 8px;
|
| 135 |
+
border: 1px solid #e0efe1;
|
| 136 |
+
background: #fff;
|
| 137 |
+
padding: 0.65rem 0.75rem;
|
| 138 |
+
box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
|
| 139 |
+
font-size: 16px; /* Prevents zoom on iOS */
|
| 140 |
+
width: 100%;
|
| 141 |
+
box-sizing: border-box;
|
| 142 |
+
}
|
| 143 |
+
|
| 144 |
+
input.form-control:focus, select.form-select:focus, textarea.form-control:focus {
|
| 145 |
+
outline: none;
|
| 146 |
+
border-color: var(--green);
|
| 147 |
+
box-shadow: 0 0 0 0.15rem rgba(46,125,50,0.12);
|
| 148 |
+
}
|
| 149 |
+
|
| 150 |
+
/* Buttons - touch-friendly sizing */
|
| 151 |
+
.btn-primary {
|
| 152 |
+
background: linear-gradient(90deg, var(--green), #388e3c);
|
| 153 |
+
border: none;
|
| 154 |
+
box-shadow: 0 4px 12px rgba(46,125,50,0.12);
|
| 155 |
+
padding: 0.75rem 1.5rem;
|
| 156 |
+
border-radius: 8px;
|
| 157 |
+
font-weight: 600;
|
| 158 |
+
min-height: 44px;
|
| 159 |
+
}
|
| 160 |
+
|
| 161 |
+
.btn-primary:hover {
|
| 162 |
+
background: linear-gradient(90deg, var(--green-dark), #2e7d32);
|
| 163 |
+
transform: translateY(-1px);
|
| 164 |
+
transition: all 0.2s ease;
|
| 165 |
+
}
|
| 166 |
+
|
| 167 |
+
.btn-outline-primary {
|
| 168 |
+
color: var(--green);
|
| 169 |
+
border-color: rgba(46,125,50,0.12);
|
| 170 |
+
min-height: 44px;
|
| 171 |
+
}
|
| 172 |
+
|
| 173 |
+
.btn-outline-primary:hover {
|
| 174 |
+
background: rgba(46,125,50,0.05);
|
| 175 |
+
}
|
| 176 |
+
|
| 177 |
+
.btn-outline-danger {
|
| 178 |
+
border-color: rgba(220,53,69,0.08);
|
| 179 |
+
min-height: 44px;
|
| 180 |
+
}
|
| 181 |
+
|
| 182 |
+
/* Small hint and muted text */
|
| 183 |
+
.small-hint {
|
| 184 |
+
font-size: 0.85rem;
|
| 185 |
+
color: var(--muted);
|
| 186 |
+
}
|
| 187 |
+
|
| 188 |
+
/* Required-field icon indicator */
|
| 189 |
+
.form-label .text-danger::after {
|
| 190 |
+
content: ' ✓';
|
| 191 |
+
color: var(--green-dark);
|
| 192 |
+
font-size: 0.85rem;
|
| 193 |
+
margin-left: 6px;
|
| 194 |
+
}
|
| 195 |
+
|
| 196 |
+
/* Multi-selects */
|
| 197 |
+
select[multiple] {
|
| 198 |
+
height: auto;
|
| 199 |
+
min-height: 120px;
|
| 200 |
+
}
|
| 201 |
+
|
| 202 |
+
/* Grid and utility classes */
|
| 203 |
+
.d-grid .btn-lg {
|
| 204 |
+
padding: 0.85rem 1rem;
|
| 205 |
+
}
|
| 206 |
+
|
| 207 |
+
/* Modal styling - responsive */
|
| 208 |
+
.modal-content {
|
| 209 |
+
border-radius: 12px;
|
| 210 |
+
overflow: hidden;
|
| 211 |
+
border: 1px solid rgba(30,90,40,0.06);
|
| 212 |
+
margin: 10px;
|
| 213 |
+
}
|
| 214 |
+
|
| 215 |
+
.modal-header {
|
| 216 |
+
background: linear-gradient(90deg, var(--light-green), var(--mint));
|
| 217 |
+
border-bottom: none;
|
| 218 |
+
padding: 1rem;
|
| 219 |
+
}
|
| 220 |
+
|
| 221 |
+
.modal-title {
|
| 222 |
+
color: #0b3a2a;
|
| 223 |
+
font-weight: 700;
|
| 224 |
+
}
|
| 225 |
+
|
| 226 |
+
.modal-body {
|
| 227 |
+
padding: 1rem;
|
| 228 |
+
}
|
| 229 |
+
|
| 230 |
+
/* Form groups and spacing */
|
| 231 |
+
.form-group, .mb-3 {
|
| 232 |
+
margin-bottom: 1rem;
|
| 233 |
+
}
|
| 234 |
+
|
| 235 |
+
.row {
|
| 236 |
+
margin: 0;
|
| 237 |
+
}
|
| 238 |
+
|
| 239 |
+
.col, .col-md-6, .col-lg-4, .col-12 {
|
| 240 |
+
padding-left: 8px;
|
| 241 |
+
padding-right: 8px;
|
| 242 |
+
}
|
| 243 |
+
|
| 244 |
+
/* ===== MOBILE FIRST - UP TO 576px ===== */
|
| 245 |
+
@media (max-width: 575.98px) {
|
| 246 |
+
.container-fluid {
|
| 247 |
+
padding: 8px;
|
| 248 |
+
}
|
| 249 |
+
|
| 250 |
+
.card {
|
| 251 |
+
border-width: 2px;
|
| 252 |
+
border-radius: 8px;
|
| 253 |
+
margin-bottom: 12px;
|
| 254 |
+
}
|
| 255 |
+
|
| 256 |
+
.card-header {
|
| 257 |
+
padding: 0.6rem 0.8rem;
|
| 258 |
+
border-radius: 6px 6px 0 0;
|
| 259 |
+
}
|
| 260 |
+
|
| 261 |
+
.card-body {
|
| 262 |
+
padding: 0.8rem;
|
| 263 |
+
}
|
| 264 |
+
|
| 265 |
+
.card-title {
|
| 266 |
+
font-size: 1rem;
|
| 267 |
+
}
|
| 268 |
+
|
| 269 |
+
#map, #modalMap {
|
| 270 |
+
height: 40vh;
|
| 271 |
+
border-radius: 8px;
|
| 272 |
+
min-height: 220px;
|
| 273 |
+
}
|
| 274 |
+
|
| 275 |
+
.form-label {
|
| 276 |
+
font-size: 0.9rem;
|
| 277 |
+
}
|
| 278 |
+
|
| 279 |
+
input.form-control, select.form-select, textarea.form-control {
|
| 280 |
+
padding: 0.7rem 0.75rem;
|
| 281 |
+
border-radius: 6px;
|
| 282 |
+
}
|
| 283 |
+
|
| 284 |
+
.btn-primary, .btn-outline-primary, .btn-outline-danger {
|
| 285 |
+
padding: 0.8rem 1.2rem;
|
| 286 |
+
border-radius: 6px;
|
| 287 |
+
width: 100%;
|
| 288 |
+
margin-bottom: 0.5rem;
|
| 289 |
+
}
|
| 290 |
+
|
| 291 |
+
.modal-content {
|
| 292 |
+
margin: 5px;
|
| 293 |
+
border-radius: 8px;
|
| 294 |
+
}
|
| 295 |
+
|
| 296 |
+
.modal-header, .modal-body {
|
| 297 |
+
padding: 0.8rem;
|
| 298 |
+
}
|
| 299 |
+
|
| 300 |
+
select[multiple] {
|
| 301 |
+
min-height: 100px;
|
| 302 |
+
}
|
| 303 |
+
|
| 304 |
+
.col, .col-md-6, .col-lg-4, .col-12 {
|
| 305 |
+
padding-left: 4px;
|
| 306 |
+
padding-right: 4px;
|
| 307 |
+
}
|
| 308 |
+
}
|
| 309 |
+
|
| 310 |
+
/* ===== TABLET - 576px to 991.98px ===== */
|
| 311 |
+
@media (min-width: 576px) and (max-width: 991.98px) {
|
| 312 |
+
.container-fluid {
|
| 313 |
+
padding: 16px;
|
| 314 |
+
max-width: 100%;
|
| 315 |
+
}
|
| 316 |
+
|
| 317 |
+
.row > .col-12 > .card {
|
| 318 |
+
max-width: 720px;
|
| 319 |
+
margin: 0 auto;
|
| 320 |
+
}
|
| 321 |
+
|
| 322 |
+
#map, #modalMap {
|
| 323 |
+
height: 50vh;
|
| 324 |
+
border-radius: 12px;
|
| 325 |
+
}
|
| 326 |
+
|
| 327 |
+
.card {
|
| 328 |
+
border-width: 4px;
|
| 329 |
+
}
|
| 330 |
+
|
| 331 |
+
.card-body {
|
| 332 |
+
padding: 1.1rem;
|
| 333 |
+
}
|
| 334 |
+
|
| 335 |
+
.card-header {
|
| 336 |
+
padding: 0.8rem 1.1rem;
|
| 337 |
+
}
|
| 338 |
+
|
| 339 |
+
.btn-primary, .btn-outline-primary, .btn-outline-danger {
|
| 340 |
+
display: inline-block;
|
| 341 |
+
width: auto;
|
| 342 |
+
margin-right: 0.5rem;
|
| 343 |
+
margin-bottom: 0.5rem;
|
| 344 |
+
}
|
| 345 |
+
|
| 346 |
+
.modal-content {
|
| 347 |
+
margin: 15px;
|
| 348 |
+
}
|
| 349 |
+
|
| 350 |
+
select[multiple] {
|
| 351 |
+
min-height: 110px;
|
| 352 |
+
}
|
| 353 |
+
}
|
| 354 |
+
|
| 355 |
+
/* ===== LAPTOP/DESKTOP - 992px to 1199.98px ===== */
|
| 356 |
+
@media (min-width: 992px) and (max-width: 1199.98px) {
|
| 357 |
+
.container-fluid {
|
| 358 |
+
padding: 24px;
|
| 359 |
+
}
|
| 360 |
+
|
| 361 |
+
.row > .col-12 > .card {
|
| 362 |
+
max-width: 960px;
|
| 363 |
+
margin: 0 auto;
|
| 364 |
+
}
|
| 365 |
+
|
| 366 |
+
#map, #modalMap {
|
| 367 |
+
height: 55vh;
|
| 368 |
+
border-radius: 16px;
|
| 369 |
+
}
|
| 370 |
+
|
| 371 |
+
.card {
|
| 372 |
+
border-width: 4px;
|
| 373 |
+
}
|
| 374 |
+
|
| 375 |
+
.card-body {
|
| 376 |
+
padding: 1.2rem;
|
| 377 |
+
}
|
| 378 |
+
|
| 379 |
+
.card-header {
|
| 380 |
+
padding: 0.9rem 1.2rem;
|
| 381 |
+
}
|
| 382 |
+
|
| 383 |
+
.modal-content {
|
| 384 |
+
margin: 20px auto;
|
| 385 |
+
max-width: 90%;
|
| 386 |
+
}
|
| 387 |
+
}
|
| 388 |
+
|
| 389 |
+
/* ===== LARGE DESKTOP - 1200px and up ===== */
|
| 390 |
+
@media (min-width: 1200px) {
|
| 391 |
+
.container-fluid {
|
| 392 |
+
padding: 32px;
|
| 393 |
+
max-width: 1400px;
|
| 394 |
+
margin: 0 auto;
|
| 395 |
+
}
|
| 396 |
+
|
| 397 |
+
.row > .col-12 > .card {
|
| 398 |
+
max-width: 1100px;
|
| 399 |
+
margin: 0 auto;
|
| 400 |
+
}
|
| 401 |
+
|
| 402 |
+
#map, #modalMap {
|
| 403 |
+
height: 60vh;
|
| 404 |
+
border-radius: 20px;
|
| 405 |
+
}
|
| 406 |
+
|
| 407 |
+
.card {
|
| 408 |
+
border-width: 5px;
|
| 409 |
+
box-shadow: 0 8px 24px rgba(46,125,50,0.06);
|
| 410 |
+
}
|
| 411 |
+
|
| 412 |
+
.card-body {
|
| 413 |
+
padding: 1.25rem;
|
| 414 |
+
}
|
| 415 |
+
|
| 416 |
+
.card-header {
|
| 417 |
+
padding: 0.85rem 1.25rem;
|
| 418 |
+
}
|
| 419 |
+
|
| 420 |
+
.card-title {
|
| 421 |
+
font-size: 1.2rem;
|
| 422 |
+
}
|
| 423 |
+
|
| 424 |
+
.modal-content {
|
| 425 |
+
margin: 30px auto;
|
| 426 |
+
max-width: 80%;
|
| 427 |
+
}
|
| 428 |
+
|
| 429 |
+
select[multiple] {
|
| 430 |
+
min-height: 130px;
|
| 431 |
+
}
|
| 432 |
+
}
|
| 433 |
+
|
| 434 |
+
/* ===== EXTRA LARGE DESKTOP - 1400px and up ===== */
|
| 435 |
+
@media (min-width: 1400px) {
|
| 436 |
+
.container-fluid {
|
| 437 |
+
max-width: 1600px;
|
| 438 |
+
}
|
| 439 |
+
|
| 440 |
+
.row > .col-12 > .card {
|
| 441 |
+
max-width: 1200px;
|
| 442 |
+
}
|
| 443 |
+
|
| 444 |
+
#map, #modalMap {
|
| 445 |
+
height: 65vh;
|
| 446 |
+
}
|
| 447 |
+
}
|
| 448 |
+
|
| 449 |
+
/* ===== ACCESSIBILITY AND TOUCH IMPROVEMENTS ===== */
|
| 450 |
+
@media (hover: none) and (pointer: coarse) {
|
| 451 |
+
/* Touch device optimizations */
|
| 452 |
+
.btn-primary:hover {
|
| 453 |
+
transform: none;
|
| 454 |
+
}
|
| 455 |
+
|
| 456 |
+
input.form-control, select.form-select, textarea.form-control {
|
| 457 |
+
min-height: 44px;
|
| 458 |
+
}
|
| 459 |
+
|
| 460 |
+
.card-header {
|
| 461 |
+
-webkit-tap-highlight-color: transparent;
|
| 462 |
+
}
|
| 463 |
+
}
|
| 464 |
+
|
| 465 |
+
/* High contrast mode support */
|
| 466 |
+
@media (prefers-contrast: high) {
|
| 467 |
+
.card {
|
| 468 |
+
border-width: 3px;
|
| 469 |
+
border-color: var(--green-dark);
|
| 470 |
+
}
|
| 471 |
+
|
| 472 |
+
input.form-control, select.form-select, textarea.form-control {
|
| 473 |
+
border-width: 2px;
|
| 474 |
+
border-color: var(--green);
|
| 475 |
+
}
|
| 476 |
+
}
|
| 477 |
+
|
| 478 |
+
/* Reduced motion support */
|
| 479 |
+
@media (prefers-reduced-motion: reduce) {
|
| 480 |
+
.btn-primary:hover {
|
| 481 |
+
transform: none;
|
| 482 |
+
transition: none;
|
| 483 |
+
}
|
| 484 |
+
|
| 485 |
+
* {
|
| 486 |
+
animation-duration: 0.01ms !important;
|
| 487 |
+
animation-iteration-count: 1 !important;
|
| 488 |
+
transition-duration: 0.01ms !important;
|
| 489 |
+
}
|
| 490 |
+
}
|
| 491 |
+
/* Hero Section */
|
| 492 |
+
.hero {
|
| 493 |
+
position: relative;
|
| 494 |
+
height: 100vh; /* Full screen */
|
| 495 |
+
width: 100%;
|
| 496 |
+
overflow: hidden;
|
| 497 |
+
display: flex;
|
| 498 |
+
align-items: center;
|
| 499 |
+
justify-content: center;
|
| 500 |
+
text-align: center;
|
| 501 |
+
color: white;
|
| 502 |
+
}
|
| 503 |
+
|
| 504 |
+
/* Video Styling */
|
| 505 |
+
.hero-video {
|
| 506 |
+
position: absolute;
|
| 507 |
+
top: 0;
|
| 508 |
+
left: 0;
|
| 509 |
+
width: 100%;
|
| 510 |
+
height: 100%;
|
| 511 |
+
object-fit: cover;
|
| 512 |
+
z-index: -2;
|
| 513 |
+
}
|
| 514 |
+
|
| 515 |
+
/* Dark Overlay for Readability */
|
| 516 |
+
.hero-overlay {
|
| 517 |
+
position: absolute;
|
| 518 |
+
top: 0;
|
| 519 |
+
left: 0;
|
| 520 |
+
width: 100%;
|
| 521 |
+
height: 100%;
|
| 522 |
+
background: rgba(0, 0, 0, 0.5); /* Dark transparent overlay */
|
| 523 |
+
z-index: -1;
|
| 524 |
+
}
|
| 525 |
+
|
| 526 |
+
/* Content Styling */
|
| 527 |
+
.hero-content {
|
| 528 |
+
z-index: 1;
|
| 529 |
+
}
|
| 530 |
+
|
| 531 |
+
.hero-title {
|
| 532 |
+
font-size: 3rem;
|
| 533 |
+
font-weight: bold;
|
| 534 |
+
margin-bottom: 1rem;
|
| 535 |
+
}
|
| 536 |
+
|
| 537 |
+
.hero-subtitle {
|
| 538 |
+
font-size: 1.5rem;
|
| 539 |
+
margin-bottom: 2rem;
|
| 540 |
+
}
|
| 541 |
+
|
| 542 |
+
|
| 543 |
+
/* Hero/video banner styles */
|
| 544 |
+
.hero { display: flex; gap: 18px; align-items: stretch; width: 100%; height: 46vh; min-height: 320px; overflow: hidden; border-radius: 12px; margin-bottom: 18px; }
|
| 545 |
+
.hero .hero-left { flex: 1 1 55%; padding: 26px; display: flex; flex-direction: column; justify-content: center; }
|
| 546 |
+
.hero .hero-right { flex: 1 1 45%; position: relative; overflow: hidden; border-radius: 10px; }
|
| 547 |
+
.hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
|
| 548 |
+
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(6,45,19,0.06), rgba(255,255,255,0.06)); z-index:2; }
|
| 549 |
+
.hero-content { z-index: 3; color: #08321b; }
|
| 550 |
+
.hero-title { font-size: 2rem; font-weight: 800; margin: 0 0 6px 0; color: var(--green-dark); text-shadow: 0 2px 8px rgba(0,0,0,0.06); }
|
| 551 |
+
.hero-subtitle { font-size: 1.05rem; margin: 0 0 12px 0; color: rgba(3,46,20,0.86); }
|
| 552 |
+
.hero .btn { box-shadow: 0 8px 20px rgba(0,0,0,0.08); }
|
| 553 |
+
.hero-play-btn { position: absolute; right: 18px; bottom: 18px; z-index: 5; background: rgba(0,0,0,0.38); border: none; color: white; width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
|
| 554 |
+
.hero-play-btn:hover { background: rgba(0,0,0,0.5); }
|
| 555 |
+
|
| 556 |
+
@media (max-width: 900px) {
|
| 557 |
+
.hero { flex-direction: column; height: auto; }
|
| 558 |
+
.hero .hero-right { order: -1; height: 40vh; }
|
| 559 |
+
}
|
| 560 |
+
|
| 561 |
+
</style>
|
| 562 |
+
</head>
|
| 563 |
+
<body class="bg-light">
|
| 564 |
+
<a class="btn btn-outline-primary admin-link" href="/bot/" role="button">Admin Panel</a>
|
| 565 |
+
<div class="container-fluid py-3">
|
| 566 |
+
|
| 567 |
+
<!-- Hero video banner -->
|
| 568 |
+
<section class="hero" aria-label="Smart Farming Portal Video Banner">
|
| 569 |
+
<div class="hero-left">
|
| 570 |
+
<div class="hero-content">
|
| 571 |
+
<h1 class="hero-title">Smart Farming Portal</h1>
|
| 572 |
+
<p class="hero-subtitle">Empowering Farmers with AI-Powered Insights</p>
|
| 573 |
+
<button class="btn btn-primary btn-lg">Get Started</button>
|
| 574 |
+
</div>
|
| 575 |
+
</div>
|
| 576 |
+
<div class="hero-right">
|
| 577 |
+
<video id="heroVideo" autoplay muted loop playsinline class="hero-video">
|
| 578 |
+
<source src="{{ url_for('static', filename='videos/AI_Farming_Tools_and_Video.mp4') }}" type="video/mp4">
|
| 579 |
+
Your browser does not support the video tag.
|
| 580 |
+
</video>
|
| 581 |
+
<div class="hero-overlay"></div>
|
| 582 |
+
<button id="heroPlayBtn" class="hero-play-btn" title="Play video"><i class="bi bi-play-fill"></i></button>
|
| 583 |
+
</div>
|
| 584 |
+
</section>
|
| 585 |
+
<div class="d-flex justify-content-end mb-2">
|
| 586 |
+
<button id="resetDataBtn" class="btn btn-outline-danger">Reset Data</button>
|
| 587 |
+
</div>
|
| 588 |
+
|
| 589 |
+
|
| 590 |
+
<div class="row">
|
| 591 |
+
<div class="col-12">
|
| 592 |
+
<div class="card mb-3 shadow-sm">
|
| 593 |
+
<div class="card-body">
|
| 594 |
+
<h4 class="card-title text-center mb-4 text-primary"><i class="bi bi-leaf-fill me-2" style="color:var(--green-dark); font-size:1.1em;"></i>Farm Data Entry</h4>
|
| 595 |
+
<form method="post" id="farmForm">
|
| 596 |
+
|
| 597 |
+
<!-- Farmer & Farm Details Section -->
|
| 598 |
+
<div class="card mb-3 section-farmer">
|
| 599 |
+
<div class="card-header"><i class="bi bi-leaf-fill me-2" style="color:var(--green-dark)"></i>Farmer & Farm Details</div>
|
| 600 |
+
<div class="card-body">
|
| 601 |
+
<div class="mb-3">
|
| 602 |
+
<label for="farmerName" class="form-label"><i class="bi bi-person-fill field-icon" aria-hidden="true"></i>Farmer Name <span class="text-danger">*</span></label>
|
| 603 |
+
<input name="farmer_name" id="farmerName" class="form-control" required />
|
| 604 |
+
</div>
|
| 605 |
+
<div class="row mb-3">
|
| 606 |
+
<div class="col-md-6">
|
| 607 |
+
<label for="phone" class="form-label"><i class="bi bi-telephone-fill field-icon" aria-hidden="true"></i>Phone</label>
|
| 608 |
+
<input name="phone" id="phone" class="form-control" placeholder="+1234567890" />
|
| 609 |
+
</div>
|
| 610 |
+
<div class="col-md-6">
|
| 611 |
+
<label for="preferredLangTime" class="form-label"><i class="bi bi-chat-left-text-fill field-icon" aria-hidden="true"></i>Preferred Language / Time</label>
|
| 612 |
+
<input name="preferred_lang_time" id="preferredLangTime" class="form-control" placeholder="e.g. English / Morning" />
|
| 613 |
+
</div>
|
| 614 |
+
</div>
|
| 615 |
+
<div class="mb-3">
|
| 616 |
+
<label for="farmName" class="form-label"><i class="bi bi-house-fill field-icon" aria-hidden="true"></i>Farm Name</label>
|
| 617 |
+
<input name="farm_name" id="farmName" class="form-control" />
|
| 618 |
+
</div>
|
| 619 |
+
<div class="mb-3">
|
| 620 |
+
<label for="farmingType" class="form-label"><i class="bi bi-grid-1x2-fill field-icon" aria-hidden="true"></i>Type of Farming <span class="text-danger">*</span></label>
|
| 621 |
+
<select name="farming_type" id="farmingType" class="form-select" required onchange="toggleFarmingSections()">
|
| 622 |
+
<option value="">Select Farming Type</option>
|
| 623 |
+
<option value="Crop Farming">Crop Farming (Cereals, Pulses, Oilseeds, Cash Crops)</option>
|
| 624 |
+
<option value="Dairy Farming">Dairy Farming (Milk & Milk Products)</option>
|
| 625 |
+
<option value="Poultry Farming">Poultry Farming (Chicken, Eggs, Ducks, etc.)</option>
|
| 626 |
+
<option value="Horticulture Farming">Horticulture Farming (Fruits, Vegetables, Flowers, Spices)</option>
|
| 627 |
+
<option value="Plantation Farming">Plantation Farming (Tea, Coffee, Rubber, Coconut, Arecanut)</option>
|
| 628 |
+
</select>
|
| 629 |
+
</div>
|
| 630 |
+
</div>
|
| 631 |
+
</div>
|
| 632 |
+
|
| 633 |
+
<!-- Location Section -->
|
| 634 |
+
<div class="card mb-3 section-location">
|
| 635 |
+
<div class="card-header"><i class="bi bi-geo-alt-fill me-2" style="color:var(--green-dark)"></i>Farm Location</div>
|
| 636 |
+
<div class="card-body">
|
| 637 |
+
<div class="row mb-3">
|
| 638 |
+
<div class="col-md-6">
|
| 639 |
+
<label for="latitudeInput" class="form-label">Latitude</label>
|
| 640 |
+
<input name="latitude" id="latitudeInput" class="form-control" step="any" readonly />
|
| 641 |
+
</div>
|
| 642 |
+
<div class="col-md-6">
|
| 643 |
+
<label for="longitudeInput" class="form-label">Longitude</label>
|
| 644 |
+
<input name="longitude" id="longitudeInput" class="form-control" step="any" readonly />
|
| 645 |
+
</div>
|
| 646 |
+
</div>
|
| 647 |
+
<div class="mb-3">
|
| 648 |
+
<label for="areaInput" class="form-label">Area</label>
|
| 649 |
+
<input name="area" id="areaInput" class="form-control" placeholder="e.g. 1.5 ha or 1500 sqm" readonly />
|
| 650 |
+
<div class="small-hint mt-1">Draw a polygon on the map — center and area will auto-fill. You can edit values before saving.</div>
|
| 651 |
+
</div>
|
| 652 |
+
|
| 653 |
+
<!-- Button to open map modal for drawing -->
|
| 654 |
+
<div class="mb-3">
|
| 655 |
+
<button type="button" id="openMapModalBtn" class="btn btn-outline-primary">Open Map (Popup)</button>
|
| 656 |
+
<div class="small-hint mt-1">Opens a popup map where you can draw or drop a polygon. When finished, polygon coordinates, center and area will be copied back to the form.</div>
|
| 657 |
+
</div>
|
| 658 |
+
</div>
|
| 659 |
+
</div>
|
| 660 |
+
|
| 661 |
+
<!-- Crop Farming Specific Section -->
|
| 662 |
+
<div id="cropFarmingSection" class="farming-type-section" style="display: none;">
|
| 663 |
+
<div class="card mb-3 section-crop">
|
| 664 |
+
<div class="card-header"><i class="bi bi-seedling-fill me-2" style="color:var(--green-dark)"></i>Crop Information Entry</div>
|
| 665 |
+
<div class="card-body">
|
| 666 |
+
<div class="mb-3">
|
| 667 |
+
<label for="numCrops" class="form-label">Number of Crops to Enter</label>
|
| 668 |
+
<div class="input-group">
|
| 669 |
+
<input type="number" id="numCrops" class="form-control" min="1" />
|
| 670 |
+
<button type="button" id="generateCropsBtn" class="btn btn-primary">Generate Crop Sections</button>
|
| 671 |
+
</div>
|
| 672 |
+
<div class="small-hint mt-1">Specify how many crop entries you want to add.</div>
|
| 673 |
+
</div>
|
| 674 |
+
</div>
|
| 675 |
+
</div>
|
| 676 |
+
<div id="cropInfoContainer">
|
| 677 |
+
<!-- Crop sections will be dynamically added here -->
|
| 678 |
+
</div>
|
| 679 |
+
</div>
|
| 680 |
+
|
| 681 |
+
<!-- Dairy Farming Specific Section -->
|
| 682 |
+
<div id="dairyFarmingSection" class="farming-type-section" style="display: none;">
|
| 683 |
+
<div class="card mb-3 section-dairy">
|
| 684 |
+
<div class="card-header"><i class="bi bi-bag-heart-fill me-2" style="color:var(--green-dark)"></i>Dairy Farming Details</div>
|
| 685 |
+
<div class="card-body">
|
| 686 |
+
<div class="mb-3">
|
| 687 |
+
<label for="dairy_num_animals_cows" class="form-label">Number of Cows</label>
|
| 688 |
+
<input type="number" name="dairy_num_animals_cows" id="dairy_num_animals_cows" class="form-control" min="0" placeholder="e.g. 10" />
|
| 689 |
+
</div>
|
| 690 |
+
<div class="mb-3">
|
| 691 |
+
<label for="dairy_num_animals_buffaloes" class="form-label">Number of Buffaloes</label>
|
| 692 |
+
<input type="number" name="dairy_num_animals_buffaloes" id="dairy_num_animals_buffaloes" class="form-control" min="0" placeholder="e.g. 5" />
|
| 693 |
+
</div>
|
| 694 |
+
<div class="mb-3">
|
| 695 |
+
<label for="dairy_num_animals_goats" class="form-label">Number of Goats</label>
|
| 696 |
+
<input type="number" name="dairy_num_animals_goats" id="dairy_num_animals_goats" class="form-control" min="0" placeholder="e.g. 20" />
|
| 697 |
+
</div>
|
| 698 |
+
<div class="mb-3">
|
| 699 |
+
<label for="dairy_breeds" class="form-label">Breed(s)</label>
|
| 700 |
+
<input type="text" name="dairy_breeds" id="dairy_breeds" class="form-control" placeholder="e.g. Holstein Friesian, Sahiwal" />
|
| 701 |
+
</div>
|
| 702 |
+
<div class="mb-3">
|
| 703 |
+
<label for="dairy_avg_milk_production" class="form-label">Average Milk Production per animal (L/day)</label>
|
| 704 |
+
<input type="number" name="dairy_avg_milk_production" id="dairy_avg_milk_production" class="form-control" step="0.1" placeholder="e.g. 15" />
|
| 705 |
+
</div>
|
| 706 |
+
<div class="mb-3">
|
| 707 |
+
<label for="dairy_fodder_source" class="form-label">Fodder Source (select all that apply)</label>
|
| 708 |
+
<select name="dairy_fodder_source[]" id="dairy_fodder_source" class="form-select" multiple>
|
| 709 |
+
<option value="Own cultivated">Own cultivated</option>
|
| 710 |
+
<option value="Purchased feed">Purchased feed</option>
|
| 711 |
+
<option value="Grazing">Grazing</option>
|
| 712 |
+
<option value="Silage">Silage</option>
|
| 713 |
+
<option value="Other">Other</option>
|
| 714 |
+
</select>
|
| 715 |
+
</div>
|
| 716 |
+
<div class="mb-3">
|
| 717 |
+
<label for="dairy_veterinary_access" class="form-label">Veterinary Access</label>
|
| 718 |
+
<select name="dairy_veterinary_access" id="dairy_veterinary_access" class="form-select">
|
| 719 |
+
<option value="">Select option</option>
|
| 720 |
+
<option value="Regular vet visits">Regular vet visits</option>
|
| 721 |
+
<option value="On-call vet">On-call vet</option>
|
| 722 |
+
<option value="Local remedies">Local remedies</option>
|
| 723 |
+
<option value="None">None</option>
|
| 724 |
+
</select>
|
| 725 |
+
</div>
|
| 726 |
+
<div class="mb-3">
|
| 727 |
+
<label for="dairy_milk_storage" class="form-label">Milk Chilling/Storage Facilities</label>
|
| 728 |
+
<select name="dairy_milk_storage" id="dairy_milk_storage" class="form-select">
|
| 729 |
+
<option value="">Select option</option>
|
| 730 |
+
<option value="Chilling unit">Chilling unit</option>
|
| 731 |
+
<option value="Local collection center">Local collection center</option>
|
| 732 |
+
<option value="Direct sale">Direct sale</option>
|
| 733 |
+
<option value="None">None</option>
|
| 734 |
+
</select>
|
| 735 |
+
</div>
|
| 736 |
+
<div class="mb-3">
|
| 737 |
+
<label for="dairy_market_access" class="form-label">Market for Milk/Products</label>
|
| 738 |
+
<select name="dairy_market_access" id="dairy_market_access" class="form-select">
|
| 739 |
+
<option value="">Select option</option>
|
| 740 |
+
<option value="Local consumers">Local consumers</option>
|
| 741 |
+
<option value="Milk cooperative">Milk cooperative</option>
|
| 742 |
+
<option value="Private processor">Private processor</option>
|
| 743 |
+
<option value="Sweet shops">Sweet shops</option>
|
| 744 |
+
</select>
|
| 745 |
+
</div>
|
| 746 |
+
<div class="mb-3">
|
| 747 |
+
<label for="dairy_product_diversification" class="form-label">Dairy Product Diversification (select all that apply)</label>
|
| 748 |
+
<select name="dairy_product_diversification[]" id="dairy_product_diversification" class="form-select" multiple>
|
| 749 |
+
<option value="Milk">Milk</option>
|
| 750 |
+
<option value="Ghee">Ghee</option>
|
| 751 |
+
<option value="Paneer">Paneer</option>
|
| 752 |
+
<option value="Curd">Curd</option>
|
| 753 |
+
<option value="Other">Other</option>
|
| 754 |
+
</select>
|
| 755 |
+
</div>
|
| 756 |
+
</div>
|
| 757 |
+
</div>
|
| 758 |
+
</div>
|
| 759 |
+
|
| 760 |
+
<!-- Poultry Farming Specific Section -->
|
| 761 |
+
<div id="poultryFarmingSection" class="farming-type-section" style="display: none;">
|
| 762 |
+
<div class="card mb-3 section-poultry">
|
| 763 |
+
<div class="card-header"><i class="bi bi-piggy-bank-fill me-2" style="color:var(--green-dark)"></i>Poultry Farming Details</div>
|
| 764 |
+
<div class="card-body">
|
| 765 |
+
<div class="mb-3">
|
| 766 |
+
<label for="poultry_type" class="form-label">Type of Poultry (select all that apply)</label>
|
| 767 |
+
<select name="poultry_type[]" id="poultry_type" class="form-select" multiple>
|
| 768 |
+
<option value="Broiler">Broiler</option>
|
| 769 |
+
<option value="Layer">Layer</option>
|
| 770 |
+
<option value="Duck">Duck</option>
|
| 771 |
+
<option value="Quail">Quail</option>
|
| 772 |
+
<option value="Other">Other</option>
|
| 773 |
+
</select>
|
| 774 |
+
</div>
|
| 775 |
+
<div class="mb-3">
|
| 776 |
+
<label for="poultry_num_birds" class="form-label">Number of Birds</label>
|
| 777 |
+
<input type="number" name="poultry_num_birds" id="poultry_num_birds" class="form-control" min="0" placeholder="e.g. 500" />
|
| 778 |
+
</div>
|
| 779 |
+
<div class="mb-3">
|
| 780 |
+
<label for="poultry_housing_type" class="form-label">Housing Type</label>
|
| 781 |
+
<select name="poultry_housing_type" id="poultry_housing_type" class="form-select">
|
| 782 |
+
<option value="">Select option</option>
|
| 783 |
+
<option value="Deep litter">Deep litter</option>
|
| 784 |
+
<option value="Cage system">Cage system</option>
|
| 785 |
+
<option value="Free-range">Free-range</option>
|
| 786 |
+
<option value="Semi-intensive">Semi-intensive</option>
|
| 787 |
+
</select>
|
| 788 |
+
</div>
|
| 789 |
+
<div class="mb-3">
|
| 790 |
+
<label for="poultry_feed_source" class="form-label">Feed Source</label>
|
| 791 |
+
<select name="poultry_feed_source" id="poultry_feed_source" class="form-select">
|
| 792 |
+
<option value="">Select option</option>
|
| 793 |
+
<option value="Own mixed">Own mixed</option>
|
| 794 |
+
<option value="Purchased commercial feed">Purchased commercial feed</option>
|
| 795 |
+
<option value="Scraps/Grains">Scraps/Grains</option>
|
| 796 |
+
</select>
|
| 797 |
+
</div>
|
| 798 |
+
<div class="mb-3">
|
| 799 |
+
<label for="poultry_health_mgmt" class="form-label">Health Management</label>
|
| 800 |
+
<select name="poultry_health_mgmt" id="poultry_health_mgmt" class="form-select">
|
| 801 |
+
<option value="">Select option</option>
|
| 802 |
+
<option value="Regular vaccination">Regular vaccination</option>
|
| 803 |
+
<option value="Preventive medicines">Preventive medicines</option>
|
| 804 |
+
<option value="Reactive treatment">Reactive treatment</option>
|
| 805 |
+
<option value="None">None</option>
|
| 806 |
+
</select>
|
| 807 |
+
</div>
|
| 808 |
+
<div class="mb-3">
|
| 809 |
+
<label for="poultry_production_capacity" class="form-label">Production Capacity</label>
|
| 810 |
+
<input type="text" name="poultry_production_capacity" id="poultry_production_capacity" class="form-control" placeholder="e.g. 5000 eggs/day, 2000 broilers/batch" />
|
| 811 |
+
</div>
|
| 812 |
+
<div class="mb-3">
|
| 813 |
+
<label for="poultry_market_access" class="form-label">Market for Produce</label>
|
| 814 |
+
<select name="poultry_market_access" id="poultry_market_access" class="form-select">
|
| 815 |
+
<option value="">Select option</option>
|
| 816 |
+
<option value="Local retail">Local retail</option>
|
| 817 |
+
<option value="Wholesale dealer">Wholesale dealer</option>
|
| 818 |
+
<option value="Restaurant supply">Restaurant supply</option>
|
| 819 |
+
<option value="Direct to consumer">Direct to consumer</option>
|
| 820 |
+
</select>
|
| 821 |
+
</div>
|
| 822 |
+
</div>
|
| 823 |
+
</div>
|
| 824 |
+
</div>
|
| 825 |
+
|
| 826 |
+
<!-- Horticulture Farming Specific Section -->
|
| 827 |
+
<div id="horticultureFarmingSection" class="farming-type-section" style="display: none;">
|
| 828 |
+
<div class="card mb-3 section-horti">
|
| 829 |
+
<div class="card-header"><i class="bi bi-flower1 me-2" style="color:var(--green-dark)"></i>Horticulture Farming Details</div>
|
| 830 |
+
<div class="card-body">
|
| 831 |
+
<div class="mb-3">
|
| 832 |
+
<label for="horti_type" class="form-label">Type of Horticulture (select all that apply)</label>
|
| 833 |
+
<select name="horti_type[]" id="horti_type" class="form-select" multiple>
|
| 834 |
+
<option value="Fruits">Fruits</option>
|
| 835 |
+
<option value="Vegetables">Vegetables</option>
|
| 836 |
+
<option value="Flowers">Flowers</option>
|
| 837 |
+
<option value="Spices">Spices</option>
|
| 838 |
+
<option value="Medicinal plants">Medicinal plants</option>
|
| 839 |
+
</select>
|
| 840 |
+
</div>
|
| 841 |
+
<div class="mb-3">
|
| 842 |
+
<label for="numHortiCrops" class="form-label">Number of Horticulture Crops to Enter</label>
|
| 843 |
+
<div class="input-group">
|
| 844 |
+
<input type="number" id="numHortiCrops" class="form-control" min="1" />
|
| 845 |
+
<button type="button" id="generateHortiCropsBtn" class="btn btn-primary">Generate Crop Sections</button>
|
| 846 |
+
</div>
|
| 847 |
+
<div class="small-hint mt-1">Specify how many horticulture crop entries you want to add.</div>
|
| 848 |
+
</div>
|
| 849 |
+
<div id="hortiCropInfoContainer">
|
| 850 |
+
<!-- Horticulture crop sections will be dynamically added here -->
|
| 851 |
+
</div>
|
| 852 |
+
<div class="mb-3">
|
| 853 |
+
<label for="horti_protection_type" class="form-label">Protection Type (select all that apply)</label>
|
| 854 |
+
<select name="horti_protection_type[]" id="horti_protection_type" class="form-select" multiple>
|
| 855 |
+
<option value="Open field">Open field</option>
|
| 856 |
+
<option value="Polyhouse/Greenhouse">Polyhouse/Greenhouse</option>
|
| 857 |
+
<option value="Net house">Net house</option>
|
| 858 |
+
<option value="Shade net">Shade net</option>
|
| 859 |
+
</select>
|
| 860 |
+
</div>
|
| 861 |
+
<div class="mb-3">
|
| 862 |
+
<label for="horti_post_harvest_handling" class="form-label">Post-Harvest Handling (select all that apply)</label>
|
| 863 |
+
<select name="horti_post_harvest_handling[]" id="horti_post_harvest_handling" class="form-select" multiple>
|
| 864 |
+
<option value="Sorting">Sorting</option>
|
| 865 |
+
<option value="Grading">Grading</option>
|
| 866 |
+
<option value="Packing">Packing</option>
|
| 867 |
+
<option value="Pre-cooling">Pre-cooling</option>
|
| 868 |
+
<option value="Cold storage">Cold storage</option>
|
| 869 |
+
<option value="Value addition">Value addition (e.g., jam, pickles)</option>
|
| 870 |
+
</select>
|
| 871 |
+
</div>
|
| 872 |
+
<div class="mb-3">
|
| 873 |
+
<label for="horti_market_access" class="form-label">Market for Produce</label>
|
| 874 |
+
<select name="horti_market_access" id="horti_market_access" class="form-select">
|
| 875 |
+
<option value="">Select option</option>
|
| 876 |
+
<option value="Local markets">Local markets</option>
|
| 877 |
+
<option value="Retail chains">Retail chains</option>
|
| 878 |
+
<option value="Export">Export</option>
|
| 879 |
+
<option value="Processing units">Processing units</option>
|
| 880 |
+
<option value="Direct sales">Direct sales</option>
|
| 881 |
+
</select>
|
| 882 |
+
</div>
|
| 883 |
+
</div>
|
| 884 |
+
</div>
|
| 885 |
+
</div>
|
| 886 |
+
|
| 887 |
+
<!-- Plantation Farming Specific Section -->
|
| 888 |
+
<div id="plantationFarmingSection" class="farming-type-section" style="display: none;">
|
| 889 |
+
<div class="card mb-3 section-plantation">
|
| 890 |
+
<div class="card-header"><i class="bi bi-eco me-2" style="color:var(--green-dark)"></i>Plantation Farming Details</div>
|
| 891 |
+
<div class="card-body">
|
| 892 |
+
<div class="mb-3">
|
| 893 |
+
<label for="plantation_type" class="form-label">Type of Plantation (select all that apply)</label>
|
| 894 |
+
<select name="plantation_type[]" id="plantation_type" class="form-select" multiple>
|
| 895 |
+
<option value="Tea">Tea</option>
|
| 896 |
+
<option value="Coffee">Coffee</option>
|
| 897 |
+
<option value="Rubber">Rubber</option>
|
| 898 |
+
<option value="Coconut">Coconut</option>
|
| 899 |
+
<option value="Arecanut">Arecanut</option>
|
| 900 |
+
<option value="Cardamom">Cardamom</option>
|
| 901 |
+
<option value="Pepper">Pepper</option>
|
| 902 |
+
<option value="Cashew">Cashew</option>
|
| 903 |
+
<option value="Oil Palm">Oil Palm</option>
|
| 904 |
+
<option value="Other">Other</option>
|
| 905 |
+
</select>
|
| 906 |
+
</div>
|
| 907 |
+
<div class="mb-3">
|
| 908 |
+
<label for="plantation_area_each" class="form-label">Area under each Plantation Type</label>
|
| 909 |
+
<textarea name="plantation_area_each" id="plantation_area_each" class="form-control" rows="2" placeholder="e.g. Tea: 5 acres, Coffee: 3 acres"></textarea>
|
| 910 |
+
<div class="small-hint mt-1">Specify area for each plantation crop.</div>
|
| 911 |
+
</div>
|
| 912 |
+
<div class="mb-3">
|
| 913 |
+
<label for="plantation_age_plants" class="form-label">Age of Plants/Trees</label>
|
| 914 |
+
<input type="text" name="plantation_age_plants" id="plantation_age_plants" class="form-control" placeholder="e.g. Tea: 10-15 years, Coffee: 5-8 years" />
|
| 915 |
+
</div>
|
| 916 |
+
<div class="mb-3">
|
| 917 |
+
<label for="plantation_processing_facilities" class="form-label">Processing Facilities</label>
|
| 918 |
+
<select name="plantation_processing_facilities" id="plantation_processing_facilities" class="form-select">
|
| 919 |
+
<option value="">Select option</option>
|
| 920 |
+
<option value="On-farm processing">On-farm processing</option>
|
| 921 |
+
<option value="Local processing unit">Local processing unit</option>
|
| 922 |
+
<option value="Sold raw to factory">Sold raw to factory</option>
|
| 923 |
+
<option value="None">None</option>
|
| 924 |
+
</select>
|
| 925 |
+
</div>
|
| 926 |
+
<div class="mb-3">
|
| 927 |
+
<label for="plantation_yield_per_unit" class="form-label">Yield per Unit</label>
|
| 928 |
+
<input type="text" name="plantation_yield_per_unit" id="plantation_yield_per_unit" class="form-control" placeholder="e.g. Tea: 2000 kg/acre/year, Coconut: 80 nuts/tree/year" />
|
| 929 |
+
</div>
|
| 930 |
+
<div class="mb-3">
|
| 931 |
+
<label for="plantation_market_access" class="form-label">Market/Buyer</label>
|
| 932 |
+
<select name="plantation_market_access" id="plantation_market_access" class="form-select">
|
| 933 |
+
<option value="">Select option</option>
|
| 934 |
+
<option value="Auction center">Auction center</option>
|
| 935 |
+
<option value="Direct contract with buyer">Direct contract with buyer</option>
|
| 936 |
+
<option value="Cooperative">Cooperative</option>
|
| 937 |
+
<option value="Processing unit">Processing unit</option>
|
| 938 |
+
</select>
|
| 939 |
+
</div>
|
| 940 |
+
<div class="mb-3">
|
| 941 |
+
<label for="plantation_shade_management" class="form-label">Shade Management</label>
|
| 942 |
+
<select name="plantation_shade_management" id="plantation_shade_management" class="form-select">
|
| 943 |
+
<option value="">Select option</option>
|
| 944 |
+
<option value="Dedicated shade trees">Dedicated shade trees</option>
|
| 945 |
+
<option value="Natural forest cover">Natural forest cover</option>
|
| 946 |
+
<option value="Artificial shade nets">Artificial shade nets</option>
|
| 947 |
+
<option value="None">None</option>
|
| 948 |
+
</select>
|
| 949 |
+
</div>
|
| 950 |
+
</div>
|
| 951 |
+
</div>
|
| 952 |
+
</div>
|
| 953 |
+
|
| 954 |
+
<!-- Soil & Water Section -->
|
| 955 |
+
<div class="card mb-3 section-soil">
|
| 956 |
+
<div class="card-header"><i class="bi bi-droplet-half me-2" style="color:var(--green-dark)"></i>Soil & Water Details</div>
|
| 957 |
+
<div class="card-body">
|
| 958 |
+
<div class="mb-3">
|
| 959 |
+
<label for="soilType" class="form-label">Soil Type (Texture)</label>
|
| 960 |
+
<select name="soil_type" id="soilType" class="form-select">
|
| 961 |
+
<option value="">Select soil texture</option>
|
| 962 |
+
<option value="Sand">Sand</option><option value="Sandy loam">Sandy loam</option><option value="Loam" selected>Loam</option><option value="Silt loam">Silt loam</option><option value="Silt">Silt</option><option value="Clay loam">Clay loam</option><option value="Clay">Clay</option><option value="Silty clay">Silty clay</option><option value="Silty clay loam">Silty clay loam</option><option value="Peaty">Peaty</option><option value="Chalky">Chalky</option><option value="Stony / gravelly">Stony / gravelly</option><option value="Heavy clay">Heavy clay</option><option value="Light sandy">Light sandy</option>
|
| 963 |
+
</select>
|
| 964 |
+
</div>
|
| 965 |
+
<div class="mb-3">
|
| 966 |
+
<label for="soilDepth" class="form-label">Soil Depth (Rooting Depth)</label>
|
| 967 |
+
<select name="soil_depth" id="soilDepth" class="form-select">
|
| 968 |
+
<option value="">Select depth</option>
|
| 969 |
+
<option value="Very shallow (<10 cm)">Very shallow (<10 cm)</option><option value="Shallow (10–20 cm)">Shallow (10–20 cm)</option><option value="Medium (20–60 cm)" selected>Medium (20–60 cm)</option><option value="Deep (60–100 cm)">Deep (60–100 cm)</option><option value="Very deep (>100 cm)">Very deep (>100 cm)</option><option value="Unknown">Unknown</option>
|
| 970 |
+
</select>
|
| 971 |
+
</div>
|
| 972 |
+
<div class="row mb-3">
|
| 973 |
+
|
| 974 |
+
<div class="col-md-12"> <!-- Adjusted to full width since pH numeric is removed -->
|
| 975 |
+
<label for="phCategory" class="form-label">pH Category</label>
|
| 976 |
+
<select name="ph_category" id="phCategory" class="form-select">
|
| 977 |
+
<option value="">Select pH category</option>
|
| 978 |
+
<option value="Very acidic (<5.5)">Very acidic (<5.5)</option><option value="Acidic (5.5–6.5)">Acidic (5.5–6.5)</option><option value="Slightly acidic (6.0–6.5)">Slightly acidic (6.0–6.5)</option><option value="Neutral (6.5–7.5)" selected>Neutral (6.5–7.5)</option><option value="Slightly alkaline (7.5–8.5)">Slightly alkaline (7.5–8.5)</option><option value="Alkaline (>8.5)">Alkaline (>8.5)</option><option value="Unknown / Not tested">Unknown / Not tested</option>
|
| 979 |
+
</select>
|
| 980 |
+
</div>
|
| 981 |
+
</div>
|
| 982 |
+
<div class="row mb-3">
|
| 983 |
+
|
| 984 |
+
<div class="col-md-12"> <!-- Adjusted to full width since Organic matter numeric is removed -->
|
| 985 |
+
<label for="organicMatterLevel" class="form-label">Organic Matter Level</label>
|
| 986 |
+
<select name="organic_matter_level" id="organicMatterLevel" class="form-select">
|
| 987 |
+
<option value="">Select level</option>
|
| 988 |
+
<option value="Very low (<1%)">Very low (<1%)</option><option value="Low (1–2%)">Low (1–2%)</option><option value="Medium (2–4%)" selected>Medium (2–4%)</option><option value="High (>4%)">High (>4%)</option><option value="Unknown / Not tested">Unknown / Not tested</option>
|
| 989 |
+
</select>
|
| 990 |
+
</div>
|
| 991 |
+
</div>
|
| 992 |
+
|
| 993 |
+
<div class="mb-3">
|
| 994 |
+
<label for="irrigationSource" class="form-label">Irrigation Source</label>
|
| 995 |
+
<select name="irrigation_source" id="irrigationSource" class="form-select">
|
| 996 |
+
<option value="">Select source</option>
|
| 997 |
+
<option value="Rainfed only">Rainfed only</option><option value="Canal water">Canal water</option><option value="Borewell / Tube well (electric)" selected>Borewell / Tube well (electric)</option><option value="Borewell / Tube well (diesel)">Borewell / Tube well (diesel)</option><option value="Dug well">Dug well</option><option value="Pond/Reservoir">Pond/Reservoir</option><option value="River/Stream">River/Stream</option><option value="Municipal/treated water">Municipal/treated water</option><option value="Drip system (private)">Drip system (private)</option><option value="Sprinkler system">Sprinkler system</option><option value="Tanker-supplied water">Tanker-supplied water</option><option value="Shared community well">Shared community well</option><option value="Lift irrigation (pump)">Lift irrigation (pump)</option><option value="Solar pump supply">Solar pump supply</option><option value="Rainwater harvesting tanks">Rainwater harvesting tanks</option>
|
| 998 |
+
</select>
|
| 999 |
+
</div>
|
| 1000 |
+
<div class="mb-3">
|
| 1001 |
+
<label for="waterQuality" class="form-label">Water Quality for Irrigation</label>
|
| 1002 |
+
<select name="water_quality" id="waterQuality" class="form-select">
|
| 1003 |
+
<option value="">Select quality</option>
|
| 1004 |
+
<option value="Good (suitable)" selected>Good (suitable)</option><option value="Marginal (monitor)">Marginal (monitor)</option><option value="High salts / problematic">High salts / problematic</option><option value="High bicarbonate">High bicarbonate</option><option value="High sodium (alkali)">High sodium (alkali)</option><option value="Contaminated (industrial)">Contaminated (industrial)</option><option value="Not tested">Not tested</option>
|
| 1005 |
+
</select>
|
| 1006 |
+
</div>
|
| 1007 |
+
|
| 1008 |
+
<div class="mb-3">
|
| 1009 |
+
<label for="irrigationInfrastructure" class="form-label">Irrigation Infrastructure (select all that apply)</label>
|
| 1010 |
+
<select name="irrigation_infrastructure[]" id="irrigationInfrastructure" class="form-select" multiple>
|
| 1011 |
+
<option value="Private borewell">Private borewell</option><option value="Shared borewell">Shared borewell</option><option value="Canal connection">Canal connection</option><option value="Pond / farm reservoir">Pond / farm reservoir</option><option value="Rainwater harvesting tank">Rainwater harvesting tank</option><option value="Drip lines installed">Drip lines installed</option><option value="Sprinkler installed">Sprinkler installed</option><option value="Open channel distribution">Open channel distribution</option><option value="Pumped lift irrigation">Pumped lift irrigation</option><option value="Tanker delivery arrangement">Tanker delivery arrangement</option><option value="Water storage tanks (above ground)">Water storage tanks (above ground)</option><option value="Water storage tanks (underground)">Water storage tanks (underground)</option><option value="Pumping station">Pumping station</option><option value="Filtration / sand filter unit">Filtration / sand filter unit</option>
|
| 1012 |
+
</select>
|
| 1013 |
+
</div>
|
| 1014 |
+
</div>
|
| 1015 |
+
</div>
|
| 1016 |
+
|
| 1017 |
+
<!-- Hidden field to store polygon WKT or raw coords if needed -->
|
| 1018 |
+
<input type="hidden" name="polygon_coords" id="polygonCoords">
|
| 1019 |
+
|
| 1020 |
+
<div class="d-grid gap-2">
|
| 1021 |
+
<button type="submit" class="btn btn-primary btn-lg mt-3">Save Record</button>
|
| 1022 |
+
<button type="button" id="clearBtn" class="btn btn-outline-danger">Clear Drawing & Form Fields</button>
|
| 1023 |
+
</div>
|
| 1024 |
+
</form>
|
| 1025 |
+
</div>
|
| 1026 |
+
</div>
|
| 1027 |
+
</div>
|
| 1028 |
+
|
| 1029 |
+
|
| 1030 |
+
|
| 1031 |
+
<!-- Modal for popup map -->
|
| 1032 |
+
<div class="modal fade" id="mapModal" tabindex="-1" aria-labelledby="mapModalLabel" aria-hidden="true">
|
| 1033 |
+
<div class="modal-dialog modal-xl modal-dialog-centered">
|
| 1034 |
+
<div class="modal-content">
|
| 1035 |
+
<div class="modal-header">
|
| 1036 |
+
<h5 class="modal-title" id="mapModalLabel">Draw Farm on Map</h5>
|
| 1037 |
+
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
| 1038 |
+
</div>
|
| 1039 |
+
<div class="modal-body" style="height:70vh;">
|
| 1040 |
+
<div id="modalMap" style="height:100%; width:100%;"></div>
|
| 1041 |
+
</div>
|
| 1042 |
+
<div class="modal-footer">
|
| 1043 |
+
<button type="button" id="modalClearBtn" class="btn btn-secondary">Clear Drawing</button>
|
| 1044 |
+
<button type="button" id="modalSaveBtn" class="btn btn-primary" data-bs-dismiss="modal">Save to Form</button>
|
| 1045 |
+
</div>
|
| 1046 |
+
</div>
|
| 1047 |
+
</div>
|
| 1048 |
+
</div>
|
| 1049 |
+
</div>
|
| 1050 |
+
</div>
|
| 1051 |
+
|
| 1052 |
+
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
| 1053 |
+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
|
| 1054 |
+
<script src="https://cdn.jsdelivr.net/npm/toastify-js"></script>
|
| 1055 |
+
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBvVLjWmCja331H8SuIZ4UlJdZytuYkC6Y&libraries=drawing,places,geometry"></script>
|
| 1056 |
+
<script>
|
| 1057 |
+
// Hero video autoplay attempt and fallback for browsers that block autoplay
|
| 1058 |
+
(function() {
|
| 1059 |
+
const vid = document.getElementById('heroVideo');
|
| 1060 |
+
const btn = document.getElementById('heroPlayBtn');
|
| 1061 |
+
if (!vid || !btn) return;
|
| 1062 |
+
|
| 1063 |
+
// Try to play; many browsers allow muted autoplay
|
| 1064 |
+
const tryPlay = () => {
|
| 1065 |
+
const p = vid.play();
|
| 1066 |
+
if (p !== undefined) {
|
| 1067 |
+
p.then(() => {
|
| 1068 |
+
// playing
|
| 1069 |
+
btn.style.display = 'none';
|
| 1070 |
+
}).catch(() => {
|
| 1071 |
+
// autoplay blocked — show play button
|
| 1072 |
+
btn.style.display = 'flex';
|
| 1073 |
+
});
|
| 1074 |
+
}
|
| 1075 |
+
};
|
| 1076 |
+
|
| 1077 |
+
tryPlay();
|
| 1078 |
+
|
| 1079 |
+
// Keep play button state synced with video playback
|
| 1080 |
+
vid.addEventListener('play', function() { btn.style.display = 'none'; });
|
| 1081 |
+
vid.addEventListener('pause', function() { btn.style.display = 'flex'; });
|
| 1082 |
+
vid.addEventListener('ended', function() { vid.currentTime = 0; vid.play(); });
|
| 1083 |
+
|
| 1084 |
+
btn.addEventListener('click', function() {
|
| 1085 |
+
if (vid.paused) {
|
| 1086 |
+
vid.muted = false; // allow sound after user gesture
|
| 1087 |
+
vid.play();
|
| 1088 |
+
} else {
|
| 1089 |
+
vid.pause();
|
| 1090 |
+
}
|
| 1091 |
+
});
|
| 1092 |
+
})();
|
| 1093 |
+
</script>
|
| 1094 |
+
<script>
|
| 1095 |
+
let map, drawingManager, polygon = null, centerMarker = null;
|
| 1096 |
+
|
| 1097 |
+
// --- Common Crop Options ---
|
| 1098 |
+
const primaryCropOptions = `
|
| 1099 |
+
<option value="">Select primary crop</option>
|
| 1100 |
+
<option value="Wheat">Wheat</option><option value="Rice">Rice</option><option value="Maize (Corn)">Maize (Corn)</option><option value="Sorghum">Sorghum</option><option value="Bajra (Pearl Millet)">Bajra (Pearl Millet)</option><option value="Ragi (Finger Millet)">Ragi (Finger Millet)</option><option value="Barley">Barley</option><option value="Soybean">Soybean</option><option value="Cotton">Cotton</option><option value="Groundnut (Peanut)">Groundnut (Peanut)</option><option value="Sunflower">Sunflower</option><option value="Sesamum (Sesame)">Sesamum (Sesame)</option><option value="Mustard/Rapeseed">Mustard/Rapeseed</option><option value="Chickpea (Gram)">Chickpea (Gram)</option><option value="Pigeon Pea (Tur/Arhar)">Pigeon Pea (Tur/Arhar)</option><option value="Green Gram (Moong)">Green Gram (Moong)</option><option value="Black Gram (Urad)">Black Gram (Urad)</option><option value="Potato">Potato</option><option value="Tomato">Tomato</option><option value="Onion">Onion</option><option value="Garlic">Garlic</option><option value="Chilli/Chilli Pepper">Chilli/Chilli Pepper</option><option value="Okra (Ladyfinger)">Okra (Ladyfinger)</option><option value="Brinjal (Eggplant)">Brinjal (Eggplant)</option><option value="Cabbage">Cabbage</option><option value="Cauliflower">Cauliflower</option><option value="Spinach/Leafy Greens">Spinach/Leafy Greens</option><option value="Carrot">Carrot</option><option value="Cucumber">Cucumber</option><option value="Bitter Gourd">Bitter Gourd</option><option value="Bottle Gourd">Bottle Gourd</option><option value="Pumpkin">Pumpkin</option><option value="Watermelon">Watermelon</option><option value="Muskmelon">Muskmelon</option><option value="Banana">Banana</option><option value="Mango">Mango</option><option value="Guava">Guava</option><option value="Papaya">Papaya</option><option value="Pineapple">Pineapple</option><option value="Jackfruit">Jackfruit</option><option value="Grapes">Grapes</option><option value="Pomegranate">Pomegranate</option><option value="Apple">Apple</option><option value="Pear">Pear</option><option value="Citrus (Orange/Lemon/Lime)">Citrus (Orange/Lemon/Lime)</option><option value="Sugarcane">Sugarcane</option><option value="Tea">Tea</option><option value="Coffee">Coffee</option><option value="Rubber">Rubber</option><option value="Tobacco">Tobacco</option><option value="Medicinal Herbs">Medicinal Herbs</option><option value="Flower (Cut Flowers)">Flower (Cut Flowers)</option><option value="Fodder (Napier/Bajra Hybrid)">Fodder (Napier/Bajra Hybrid)</option><option value="Forage grasses">Forage grasses</option><option value="Seedlings / Nursery">Seedlings / Nursery</option><option value="Mulberry">Mulberry</option><option value="Sisal">Sisal</option><option value="Industrial Crops">Industrial Crops</option><option value="Horticulture Mixed">Horticulture Mixed</option><option value="Vegetable Mixed">Vegetable Mixed</option><option value="Fruit Mixed">Fruit Mixed</option>
|
| 1101 |
+
`;
|
| 1102 |
+
|
| 1103 |
+
const varietyCultivarOptions = `
|
| 1104 |
+
<option value="">Select variety type</option>
|
| 1105 |
+
<option value="Certified hybrid">Certified hybrid</option><option value="Open-pollinated / improved">Open-pollinated / improved</option><option value="Local landrace">Local landrace</option><option value="Indigenous traditional variety">Indigenous traditional variety</option><option value="High-yielding variety (HYV)">High-yielding variety (HYV)</option><option value="Short-duration variety">Short-duration variety</option><option value="Long-duration variety">Long-duration variety</option><option value="Drought-tolerant variety">Drought-tolerant variety</option><option value="Flood-tolerant variety">Flood-tolerant variety</option><option value="Salinity-tolerant variety">Salinity-tolerant variety</option><option value="Pest-resistant variety">Pest-resistant variety</option><option value="Disease-resistant variety">Disease-resistant variety</option><option value="Seedling/Nursery-specific variety">Seedling/Nursery-specific variety</option><option value="Unknown/Not tested">Unknown/Not tested</option>
|
| 1106 |
+
`;
|
| 1107 |
+
|
| 1108 |
+
const croppingSystemOptions = `
|
| 1109 |
+
<option value="Monocrop">Monocrop</option><option value="Intercrop">Intercrop</option><option value="Relay cropping">Relay cropping</option><option value="Mixed cropping">Mixed cropping</option><option value="Crop rotation">Crop rotation</option><option value="Agroforestry">Agroforestry</option><option value="Sequential cropping">Sequential cropping</option><option value="Fallow / resting period">Fallow / resting period</option><option value="Continuous cropping">Continuous cropping</option>
|
| 1110 |
+
`;
|
| 1111 |
+
|
| 1112 |
+
const plantingSeasonWindowOptions = `
|
| 1113 |
+
<option value="">Select season</option>
|
| 1114 |
+
<option value="Kharif (monsoon)">Kharif (monsoon)</option><option value="Rabi (winter)">Rabi (winter)</option><option value="Zaid (summer)">Zaid (summer)</option><option value="Summer">Summer</option><option value="Winter">Winter</option><option value="Spring">Spring</option><option value="Autumn">Autumn</option><option value="Year-round / greenhouse">Year-round / greenhouse</option><option value="Season-specific (custom)">Season-specific (custom)</option>
|
| 1115 |
+
`;
|
| 1116 |
+
|
| 1117 |
+
const seedSourceOptions = `
|
| 1118 |
+
<option value="">Select source</option>
|
| 1119 |
+
<option value="Certified seed supplier">Certified seed supplier</option><option value="Government seed distribution">Government seed distribution</option><option value="Cooperative / farmer group">Cooperative / farmer group</option><option value="Local saved seed (own)">Local saved seed (own)</option><option value="Local market purchase">Local market purchase</option><option value="Private agro-dealer">Private agro-dealer</option><option value="Contract seed supplier">Contract seed supplier</option><option value="NGO distribution">NGO distribution</option><option value="Seed bank">Seed bank</option>
|
| 1120 |
+
`;
|
| 1121 |
+
|
| 1122 |
+
function initMap() {
|
| 1123 |
+
map = new google.maps.Map(document.getElementById('map'), {
|
| 1124 |
+
center: { lat: 20.5937, lng: 78.9629 }, // Default to India's center
|
| 1125 |
+
zoom: 5
|
| 1126 |
+
});
|
| 1127 |
+
|
| 1128 |
+
drawingManager = new google.maps.drawing.DrawingManager({
|
| 1129 |
+
drawingMode: null, // Initially no drawing mode
|
| 1130 |
+
drawingControl: false, // Hide default drawing controls
|
| 1131 |
+
polygonOptions: { fillColor: '#4CAF50', fillOpacity: 0.35, strokeWeight: 2, strokeColor: '#4CAF50', editable: true, draggable: true }
|
| 1132 |
+
});
|
| 1133 |
+
drawingManager.setMap(map);
|
| 1134 |
+
|
| 1135 |
+
google.maps.event.addListener(drawingManager, 'polygoncomplete', function(poly) {
|
| 1136 |
+
if (polygon) polygon.setMap(null); // Clear previous polygon if any
|
| 1137 |
+
polygon = poly;
|
| 1138 |
+
|
| 1139 |
+
// Make polygon editable for adjustment
|
| 1140 |
+
polygon.setEditable(true);
|
| 1141 |
+
polygon.setDraggable(true);
|
| 1142 |
+
|
| 1143 |
+
// Update fields on polygon change
|
| 1144 |
+
google.maps.event.addListener(polygon.getPath(), 'set_at', updateFarmDetails);
|
| 1145 |
+
google.maps.event.addListener(polygon.getPath(), 'insert_at', updateFarmDetails);
|
| 1146 |
+
google.maps.event.addListener(polygon, 'dragend', updateFarmDetails);
|
| 1147 |
+
updateFarmDetails();
|
| 1148 |
+
|
| 1149 |
+
// Stop drawing mode and update button label
|
| 1150 |
+
drawingManager.setDrawingMode(null);
|
| 1151 |
+
document.getElementById('startDrawingBtn').textContent = 'Start Drawing';
|
| 1152 |
+
});
|
| 1153 |
+
|
| 1154 |
+
// map click to update lat/lng when not drawing
|
| 1155 |
+
map.addListener('click', function(e) {
|
| 1156 |
+
if (!drawingManager.getDrawingMode()) {
|
| 1157 |
+
const lat = e.latLng.lat().toFixed(6);
|
| 1158 |
+
const lng = e.latLng.lng().toFixed(6);
|
| 1159 |
+
document.getElementById('latitudeInput').value = lat;
|
| 1160 |
+
document.getElementById('longitudeInput').value = lng;
|
| 1161 |
+
if (centerMarker) centerMarker.setPosition(e.latLng);
|
| 1162 |
+
else centerMarker = new google.maps.Marker({ position: e.latLng, map: map, title: "Farm Center" });
|
| 1163 |
+
Toastify({ text: `Map Clicked: ${lat}, ${lng}`, duration: 2000, gravity: "bottom", position: "right", className: "bg-info" }).showToast();
|
| 1164 |
+
}
|
| 1165 |
+
});
|
| 1166 |
+
|
| 1167 |
+
document.getElementById('startDrawingBtn').addEventListener('click', function() {
|
| 1168 |
+
// Defensive: ensure drawingManager is available (maps API loaded and initMap ran)
|
| 1169 |
+
if (!drawingManager || !google || !google.maps || !google.maps.drawing) {
|
| 1170 |
+
Toastify({ text: "Map drawing is not ready yet. Please wait a moment and try again.", duration: 3000, gravity: "bottom", position: "left", className: "bg-warning" }).showToast();
|
| 1171 |
+
return;
|
| 1172 |
+
}
|
| 1173 |
+
|
| 1174 |
+
if (drawingManager.getDrawingMode() === google.maps.drawing.OverlayType.POLYGON) {
|
| 1175 |
+
drawingManager.setDrawingMode(null);
|
| 1176 |
+
this.textContent = 'Start Drawing';
|
| 1177 |
+
} else {
|
| 1178 |
+
if (polygon) { // If a polygon already exists, clear it before starting new drawing
|
| 1179 |
+
clearDrawing();
|
| 1180 |
+
}
|
| 1181 |
+
drawingManager.setDrawingMode(google.maps.drawing.OverlayType.POLYGON);
|
| 1182 |
+
this.textContent = 'Stop Drawing';
|
| 1183 |
+
Toastify({ text: "Click to add points, double-click or click first point to finish.", duration: 3000, gravity: "bottom", position: "left", className: "bg-primary" }).showToast();
|
| 1184 |
+
}
|
| 1185 |
+
});
|
| 1186 |
+
|
| 1187 |
+
document.getElementById('clearDrawingBtn').addEventListener('click', clearDrawing);
|
| 1188 |
+
document.getElementById('clearBtn').addEventListener('click', clearAll);
|
| 1189 |
+
|
| 1190 |
+
document.getElementById('generateCropsBtn').addEventListener('click', function() {
|
| 1191 |
+
generateCropSections('cropInfoContainer', 'crops', 'numCrops');
|
| 1192 |
+
});
|
| 1193 |
+
document.getElementById('generateHortiCropsBtn').addEventListener('click', function() {
|
| 1194 |
+
generateCropSections('hortiCropInfoContainer', 'horti_crops', 'numHortiCrops');
|
| 1195 |
+
});
|
| 1196 |
+
|
| 1197 |
+
// Attach change listener to farming type if present
|
| 1198 |
+
const _farmingTypeEl = document.getElementById('farmingType');
|
| 1199 |
+
if (_farmingTypeEl) {
|
| 1200 |
+
_farmingTypeEl.addEventListener('change', toggleFarmingSections);
|
| 1201 |
+
}
|
| 1202 |
+
|
| 1203 |
+
// Initial setup on load to hide all sections and then show the default one.
|
| 1204 |
+
// No default crop section generation here; it will happen when a farming type is chosen.
|
| 1205 |
+
toggleFarmingSections();
|
| 1206 |
+
|
| 1207 |
+
// --- Set default values for multi-selects and dynamic sections after initial load ---
|
| 1208 |
+
setDefaultFormValues();
|
| 1209 |
+
}
|
| 1210 |
+
|
| 1211 |
+
function setDefaultFormValues() {
|
| 1212 |
+
// Intentionally left blank to avoid populating test defaults.
|
| 1213 |
+
return;
|
| 1214 |
+
}
|
| 1215 |
+
|
| 1216 |
+
|
| 1217 |
+
function updateFarmDetails() {
|
| 1218 |
+
if (!polygon) return;
|
| 1219 |
+
|
| 1220 |
+
const path = polygon.getPath();
|
| 1221 |
+
if (path.getLength() === 0) return;
|
| 1222 |
+
|
| 1223 |
+
// Compute bounds for center calculation
|
| 1224 |
+
const bounds = new google.maps.LatLngBounds();
|
| 1225 |
+
path.forEach(p => bounds.extend(p));
|
| 1226 |
+
const center = bounds.getCenter();
|
| 1227 |
+
|
| 1228 |
+
// Compute area
|
| 1229 |
+
const areaSqm = google.maps.geometry.spherical.computeArea(path);
|
| 1230 |
+
const areaHa = areaSqm / 10000.0;
|
| 1231 |
+
|
| 1232 |
+
// Set inputs
|
| 1233 |
+
document.getElementById('latitudeInput').value = center.lat().toFixed(6);
|
| 1234 |
+
document.getElementById('longitudeInput').value = center.lng().toFixed(6);
|
| 1235 |
+
|
| 1236 |
+
const areaStr = areaHa >= 0.01 ? areaHa.toFixed(4) + ' ha' : Math.round(areaSqm) + ' sqm';
|
| 1237 |
+
document.getElementById('areaInput').value = areaStr;
|
| 1238 |
+
|
| 1239 |
+
// Store polygon coords as JSON array of [lat,lng]
|
| 1240 |
+
const coords = [];
|
| 1241 |
+
path.forEach(p => coords.push([p.lat(), p.lng()]));
|
| 1242 |
+
document.getElementById('polygonCoords').value = JSON.stringify(coords);
|
| 1243 |
+
|
| 1244 |
+
// Place or move center marker
|
| 1245 |
+
if (centerMarker) centerMarker.setPosition(center);
|
| 1246 |
+
else centerMarker = new google.maps.Marker({ position: center, map: map, title: "Farm Center" });
|
| 1247 |
+
}
|
| 1248 |
+
|
| 1249 |
+
function clearDrawing() {
|
| 1250 |
+
if (polygon) { polygon.setMap(null); polygon = null; }
|
| 1251 |
+
if (centerMarker) { centerMarker.setMap(null); centerMarker = null; }
|
| 1252 |
+
document.getElementById('polygonCoords').value = '';
|
| 1253 |
+
document.getElementById('areaInput').value = '';
|
| 1254 |
+
document.getElementById('latitudeInput').value = '';
|
| 1255 |
+
document.getElementById('longitudeInput').value = '';
|
| 1256 |
+
drawingManager.setDrawingMode(null);
|
| 1257 |
+
document.getElementById('startDrawingBtn').textContent = 'Start Drawing';
|
| 1258 |
+
Toastify({ text: "Map drawing cleared.", duration: 2000, gravity: "bottom", position: "right", className: "bg-warning" }).showToast();
|
| 1259 |
+
}
|
| 1260 |
+
|
| 1261 |
+
function clearForm() {
|
| 1262 |
+
document.getElementById('farmForm').reset();
|
| 1263 |
+
// Clear multi-selects explicitly as reset() might not handle them well
|
| 1264 |
+
$('#irrigationInfrastructure').val([]).trigger('change');
|
| 1265 |
+
$('#dairy_fodder_source').val([]).trigger('change');
|
| 1266 |
+
$('#dairy_product_diversification').val([]).trigger('change');
|
| 1267 |
+
$('#poultry_type').val([]).trigger('change');
|
| 1268 |
+
$('#horti_type').val([]).trigger('change');
|
| 1269 |
+
$('#horti_protection_type').val([]).trigger('change');
|
| 1270 |
+
$('#horti_post_harvest_handling').val([]).trigger('change');
|
| 1271 |
+
$('#plantation_type').val([]).trigger('change');
|
| 1272 |
+
|
| 1273 |
+
// Clear dynamic crop sections and reset numCrops inputs
|
| 1274 |
+
$('#cropInfoContainer').empty();
|
| 1275 |
+
$('#numCrops').val(1);
|
| 1276 |
+
$('#hortiCropInfoContainer').empty();
|
| 1277 |
+
$('#numHortiCrops').val(1);
|
| 1278 |
+
|
| 1279 |
+
// Reset farming type selector and toggle sections
|
| 1280 |
+
const _ftEl2 = document.getElementById('farmingType');
|
| 1281 |
+
if (_ftEl2) { _ftEl2.value = ''; }
|
| 1282 |
+
toggleFarmingSections(); // Hide all specific sections
|
| 1283 |
+
Toastify({ text: "Form fields cleared.", duration: 2000, gravity: "bottom", position: "right", className: "bg-warning" }).showToast();
|
| 1284 |
+
}
|
| 1285 |
+
|
| 1286 |
+
function clearAll() {
|
| 1287 |
+
clearDrawing();
|
| 1288 |
+
clearForm();
|
| 1289 |
+
}
|
| 1290 |
+
|
| 1291 |
+
function generateCropSections(containerId, namePrefix, numCropsInputId, initialNum = null) {
|
| 1292 |
+
const numCropsInput = document.getElementById(numCropsInputId);
|
| 1293 |
+
const numCrops = initialNum !== null ? initialNum : parseInt(numCropsInput.value, 10);
|
| 1294 |
+
const container = document.getElementById(containerId);
|
| 1295 |
+
container.innerHTML = ''; // Clear existing sections
|
| 1296 |
+
|
| 1297 |
+
if (isNaN(numCrops) || numCrops < 1) {
|
| 1298 |
+
Toastify({ text: "Please enter a valid number of crops (at least 1).", duration: 3000, gravity: "bottom", position: "right", className: "bg-danger" }).showToast();
|
| 1299 |
+
numCropsInput.value = 1;
|
| 1300 |
+
return;
|
| 1301 |
+
}
|
| 1302 |
+
|
| 1303 |
+
for (let i = 0; i < numCrops; i++) {
|
| 1304 |
+
const cropCard = `
|
| 1305 |
+
<div class="card mb-3 crop-section section-crop" data-crop-index="${i}">
|
| 1306 |
+
<div class="card-header"><i class="bi bi-seedling-fill me-2" style="color:var(--green-dark)"></i>Crop ${i + 1} Information</div>
|
| 1307 |
+
<div class="card-body">
|
| 1308 |
+
<div class="mb-3">
|
| 1309 |
+
<label for="${namePrefix}_primaryCrop_${i}" class="form-label"><i class="bi bi-collection-fill field-icon" aria-hidden="true"></i>Primary Crop</label>
|
| 1310 |
+
<select name="${namePrefix}[${i}].primary_crop" id="${namePrefix}_primaryCrop_${i}" class="form-select">
|
| 1311 |
+
${primaryCropOptions}
|
| 1312 |
+
</select>
|
| 1313 |
+
</div>
|
| 1314 |
+
<div class="mb-3">
|
| 1315 |
+
<label for="${namePrefix}_varietyCultivar_${i}" class="form-label"><i class="bi bi-award-fill field-icon" aria-hidden="true"></i>Variety / Cultivar</label>
|
| 1316 |
+
<select name="${namePrefix}[${i}].variety_cultivar" id="${namePrefix}_varietyCultivar_${i}" class="form-select">
|
| 1317 |
+
${varietyCultivarOptions}
|
| 1318 |
+
</select>
|
| 1319 |
+
</div>
|
| 1320 |
+
<div class="mb-3">
|
| 1321 |
+
<label for="${namePrefix}_croppingSystem_${i}" class="form-label"><i class="bi bi-kanban-fill field-icon" aria-hidden="true"></i>Cropping System (select all that apply)</label>
|
| 1322 |
+
<select name="${namePrefix}[${i}].cropping_system[]" id="${namePrefix}_croppingSystem_${i}" class="form-select" multiple>
|
| 1323 |
+
${croppingSystemOptions}
|
| 1324 |
+
</select>
|
| 1325 |
+
</div>
|
| 1326 |
+
<div class="mb-3">
|
| 1327 |
+
<label for="${namePrefix}_plantingSeasonWindow_${i}" class="form-label"><i class="bi bi-sun-fill field-icon" aria-hidden="true"></i>Planting Season/Window</label>
|
| 1328 |
+
<select name="${namePrefix}[${i}].planting_season_window" id="${namePrefix}_plantingSeasonWindow_${i}" class="form-select">
|
| 1329 |
+
${plantingSeasonWindowOptions}
|
| 1330 |
+
</select>
|
| 1331 |
+
</div>
|
| 1332 |
+
<div class="mb-3">
|
| 1333 |
+
<label for="${namePrefix}_harvestWindow_${i}" class="form-label"><i class="bi bi-calendar2-range-fill field-icon" aria-hidden="true"></i>Harvest Window</label>
|
| 1334 |
+
<input name="${namePrefix}[${i}].harvest_window" id="${namePrefix}_harvestWindow_${i}" class="form-control" placeholder="e.g. Sep-Oct" />
|
| 1335 |
+
</div>
|
| 1336 |
+
<div class="mb-3">
|
| 1337 |
+
<label for="${namePrefix}_seedSource_${i}" class="form-label"><i class="bi bi-box-seam field-icon" aria-hidden="true"></i>Seed Source</label>
|
| 1338 |
+
<select name="${namePrefix}[${i}].seed_source" id="${namePrefix}_seedSource_${i}" class="form-select">
|
| 1339 |
+
${seedSourceOptions}
|
| 1340 |
+
</select>
|
| 1341 |
+
</div>
|
| 1342 |
+
<div class="mb-3">
|
| 1343 |
+
<label for="${namePrefix}_pastHistory_${i}" class="form-label"><i class="bi bi-journal-text field-icon" aria-hidden="true"></i>Past Cropping History for Crop ${i+1}</label>
|
| 1344 |
+
<textarea name="${namePrefix}[${i}].past_history" id="${namePrefix}_pastHistory_${i}" class="form-control" rows="2" placeholder="e.g. 2022: Maize; 2023: Wheat"></textarea>
|
| 1345 |
+
<div class="small-hint mt-1">History specific to this crop (if applicable).</div>
|
| 1346 |
+
</div>
|
| 1347 |
+
<div class="mb-3">
|
| 1348 |
+
<label for="${namePrefix}_constraints_${i}" class="form-label"><i class="bi bi-exclamation-triangle-fill field-icon" aria-hidden="true"></i>Constraints for Crop ${i+1}</label>
|
| 1349 |
+
<textarea name="${namePrefix}[${i}].constraints" id="${namePrefix}_constraints_${i}" class="form-control" rows="2" placeholder="e.g. Limited water for this crop, pest issues"></textarea>
|
| 1350 |
+
<div class="small-hint mt-1">Constraints specific to this crop (if applicable).</div>
|
| 1351 |
+
</div>
|
| 1352 |
+
</div>
|
| 1353 |
+
</div>
|
| 1354 |
+
`;
|
| 1355 |
+
container.insertAdjacentHTML('beforeend', cropCard);
|
| 1356 |
+
// Set default values for the newly generated crop section
|
| 1357 |
+
setDefaultCropSectionValues(i, namePrefix);
|
| 1358 |
+
}
|
| 1359 |
+
Toastify({ text: `${numCrops} ${namePrefix.replace('_', ' ')} section(s) generated.`, duration: 2000, gravity: "bottom", position: "right", className: "bg-success" }).showToast();
|
| 1360 |
+
}
|
| 1361 |
+
|
| 1362 |
+
function setDefaultCropSectionValues(index, namePrefix) {
|
| 1363 |
+
// No-op to prevent auto-filling crop/horti sections with test data.
|
| 1364 |
+
return;
|
| 1365 |
+
}
|
| 1366 |
+
|
| 1367 |
+
|
| 1368 |
+
function toggleFarmingSections() {
|
| 1369 |
+
const ftEl = document.getElementById('farmingType');
|
| 1370 |
+
const selectedType = ftEl ? ftEl.value : '';
|
| 1371 |
+
// map option values to actual section IDs in the DOM
|
| 1372 |
+
const sectionMap = {
|
| 1373 |
+
'Crop Farming': 'cropFarmingSection',
|
| 1374 |
+
'Dairy Farming': 'dairyFarmingSection',
|
| 1375 |
+
'Poultry Farming': 'poultryFarmingSection',
|
| 1376 |
+
'Horticulture Farming': 'horticultureFarmingSection',
|
| 1377 |
+
'Plantation Farming': 'plantationFarmingSection'
|
| 1378 |
+
};
|
| 1379 |
+
|
| 1380 |
+
const sections = document.querySelectorAll('.farming-type-section');
|
| 1381 |
+
sections.forEach(section => section.style.display = 'none');
|
| 1382 |
+
|
| 1383 |
+
if (selectedType) {
|
| 1384 |
+
const targetSectionId = sectionMap[selectedType] || (selectedType.replace(/\s/g, '') + 'Section');
|
| 1385 |
+
const targetSection = document.getElementById(targetSectionId);
|
| 1386 |
+
|
| 1387 |
+
if (targetSection) {
|
| 1388 |
+
targetSection.style.display = 'block';
|
| 1389 |
+
} else {
|
| 1390 |
+
console.warn('No section found for farming type:', selectedType, 'expected id:', targetSectionId);
|
| 1391 |
+
}
|
| 1392 |
+
|
| 1393 |
+
// Automatically generate a single crop section for relevant types if they are shown
|
| 1394 |
+
if (selectedType === 'Crop Farming') {
|
| 1395 |
+
generateCropSections('cropInfoContainer', 'crops', 'numCrops', 1);
|
| 1396 |
+
} else if (selectedType === 'Horticulture Farming') {
|
| 1397 |
+
generateCropSections('hortiCropInfoContainer', 'horti_crops', 'numHortiCrops', 1);
|
| 1398 |
+
}
|
| 1399 |
+
}
|
| 1400 |
+
}
|
| 1401 |
+
|
| 1402 |
+
window.onload = initMap;
|
| 1403 |
+
|
| 1404 |
+
// --- Modal map for popup drawing ---
|
| 1405 |
+
let modalMap, drawingManagerModal, polygonModal = null, modalCenterMarker = null;
|
| 1406 |
+
|
| 1407 |
+
function initModalMap() {
|
| 1408 |
+
if (modalMap) return; // already initialized
|
| 1409 |
+
modalMap = new google.maps.Map(document.getElementById('modalMap'), {
|
| 1410 |
+
center: { lat: 20.5937, lng: 78.9629 },
|
| 1411 |
+
zoom: 6
|
| 1412 |
+
});
|
| 1413 |
+
|
| 1414 |
+
drawingManagerModal = new google.maps.drawing.DrawingManager({
|
| 1415 |
+
drawingMode: google.maps.drawing.OverlayType.POLYGON,
|
| 1416 |
+
drawingControl: false,
|
| 1417 |
+
polygonOptions: { fillColor: '#2196F3', fillOpacity: 0.35, strokeWeight: 2, strokeColor: '#1976D2', editable: true, draggable: true }
|
| 1418 |
+
});
|
| 1419 |
+
drawingManagerModal.setMap(modalMap);
|
| 1420 |
+
|
| 1421 |
+
google.maps.event.addListener(drawingManagerModal, 'polygoncomplete', function(poly) {
|
| 1422 |
+
if (polygonModal) polygonModal.setMap(null);
|
| 1423 |
+
polygonModal = poly;
|
| 1424 |
+
polygonModal.setEditable(true);
|
| 1425 |
+
polygonModal.setDraggable(true);
|
| 1426 |
+
// place center marker and compute area
|
| 1427 |
+
updateModalDetails();
|
| 1428 |
+
// stop further drawing
|
| 1429 |
+
drawingManagerModal.setDrawingMode(null);
|
| 1430 |
+
});
|
| 1431 |
+
|
| 1432 |
+
// click map to set center when not drawing
|
| 1433 |
+
modalMap.addListener('click', function(e) {
|
| 1434 |
+
if (!drawingManagerModal.getDrawingMode()) {
|
| 1435 |
+
if (modalCenterMarker) modalCenterMarker.setPosition(e.latLng);
|
| 1436 |
+
else modalCenterMarker = new google.maps.Marker({ position: e.latLng, map: modalMap, title: 'Modal Center' });
|
| 1437 |
+
}
|
| 1438 |
+
});
|
| 1439 |
+
}
|
| 1440 |
+
|
| 1441 |
+
function updateModalDetails() {
|
| 1442 |
+
if (!polygonModal) return;
|
| 1443 |
+
const path = polygonModal.getPath();
|
| 1444 |
+
const bounds = new google.maps.LatLngBounds();
|
| 1445 |
+
path.forEach(p => bounds.extend(p));
|
| 1446 |
+
const center = bounds.getCenter();
|
| 1447 |
+
const areaSqm = google.maps.geometry.spherical.computeArea(path);
|
| 1448 |
+
const areaHa = areaSqm / 10000.0;
|
| 1449 |
+
// set or move modal center marker
|
| 1450 |
+
if (modalCenterMarker) modalCenterMarker.setPosition(center);
|
| 1451 |
+
else modalCenterMarker = new google.maps.Marker({ position: center, map: modalMap, title: 'Modal Center' });
|
| 1452 |
+
}
|
| 1453 |
+
|
| 1454 |
+
// Open modal and initialize modal map
|
| 1455 |
+
document.getElementById('openMapModalBtn').addEventListener('click', function() {
|
| 1456 |
+
// init when first opened
|
| 1457 |
+
if (!google || !google.maps) {
|
| 1458 |
+
Toastify({ text: 'Maps API not loaded yet. Try again in a moment.', duration: 2500, gravity: 'bottom', position: 'right', className: 'bg-danger' }).showToast();
|
| 1459 |
+
return;
|
| 1460 |
+
}
|
| 1461 |
+
initModalMap();
|
| 1462 |
+
// show bootstrap modal
|
| 1463 |
+
var mapModalEl = document.getElementById('mapModal');
|
| 1464 |
+
var modal = new bootstrap.Modal(mapModalEl);
|
| 1465 |
+
modal.show();
|
| 1466 |
+
// trigger resize so map renders correctly
|
| 1467 |
+
setTimeout(function() { google.maps.event.trigger(modalMap, 'resize'); modalMap.setCenter(modalMap.getCenter() || {lat:20.5937,lng:78.9629}); }, 250);
|
| 1468 |
+
});
|
| 1469 |
+
|
| 1470 |
+
// Reset data button: sends POST to /reset-data
|
| 1471 |
+
document.getElementById('resetDataBtn').addEventListener('click', function() {
|
| 1472 |
+
if (!confirm('This will permanently clear all records in farmers.json. Continue?')) return;
|
| 1473 |
+
fetch('/reset-data', { method: 'POST', headers: { 'Content-Type': 'application/json' } })
|
| 1474 |
+
.then(r => r.json())
|
| 1475 |
+
.then(resp => {
|
| 1476 |
+
if (resp && resp.status === 'ok') {
|
| 1477 |
+
Toastify({ text: resp.message || 'Data cleared', duration: 2500, gravity: 'bottom', position: 'right', className: 'bg-success' }).showToast();
|
| 1478 |
+
} else {
|
| 1479 |
+
Toastify({ text: (resp && resp.message) || 'Failed to clear data', duration: 3000, gravity: 'bottom', position: 'right', className: 'bg-danger' }).showToast();
|
| 1480 |
+
}
|
| 1481 |
+
})
|
| 1482 |
+
.catch(err => {
|
| 1483 |
+
Toastify({ text: 'Error: ' + err.message, duration: 3000, gravity: 'bottom', position: 'right', className: 'bg-danger' }).showToast();
|
| 1484 |
+
});
|
| 1485 |
+
});
|
| 1486 |
+
|
| 1487 |
+
// modal Clear and Save buttons
|
| 1488 |
+
document.getElementById('modalClearBtn').addEventListener('click', function() {
|
| 1489 |
+
if (polygonModal) { polygonModal.setMap(null); polygonModal = null; }
|
| 1490 |
+
if (modalCenterMarker) { modalCenterMarker.setMap(null); modalCenterMarker = null; }
|
| 1491 |
+
Toastify({ text: 'Modal drawing cleared.', duration: 2000, gravity: 'bottom', position: 'right', className: 'bg-warning' }).showToast();
|
| 1492 |
+
});
|
| 1493 |
+
|
| 1494 |
+
document.getElementById('modalSaveBtn').addEventListener('click', function() {
|
| 1495 |
+
if (!polygonModal) {
|
| 1496 |
+
Toastify({ text: 'No polygon drawn in the modal to save.', duration: 2000, gravity: 'bottom', position: 'right', className: 'bg-danger' }).showToast();
|
| 1497 |
+
return;
|
| 1498 |
+
}
|
| 1499 |
+
// copy coords, area and center into main form
|
| 1500 |
+
const path = polygonModal.getPath();
|
| 1501 |
+
const coords = [];
|
| 1502 |
+
const bounds = new google.maps.LatLngBounds();
|
| 1503 |
+
path.forEach(p => { coords.push([p.lat(), p.lng()]); bounds.extend(p); });
|
| 1504 |
+
const center = bounds.getCenter();
|
| 1505 |
+
const areaSqm = google.maps.geometry.spherical.computeArea(path);
|
| 1506 |
+
const areaHa = areaSqm / 10000.0;
|
| 1507 |
+
const areaStr = areaHa >= 0.01 ? areaHa.toFixed(4) + ' ha' : Math.round(areaSqm) + ' sqm';
|
| 1508 |
+
|
| 1509 |
+
document.getElementById('polygonCoords').value = JSON.stringify(coords);
|
| 1510 |
+
document.getElementById('latitudeInput').value = center.lat().toFixed(6);
|
| 1511 |
+
document.getElementById('longitudeInput').value = center.lng().toFixed(6);
|
| 1512 |
+
document.getElementById('areaInput').value = areaStr;
|
| 1513 |
+
|
| 1514 |
+
// reflect polygon on main map as preview
|
| 1515 |
+
if (polygon) polygon.setMap(null);
|
| 1516 |
+
polygon = new google.maps.Polygon({ paths: coords.map(c => ({lat: c[0], lng: c[1]})), fillColor: '#4CAF50', fillOpacity: 0.35, strokeWeight: 2, strokeColor: '#4CAF50', editable: true, draggable: true, map: map });
|
| 1517 |
+
// update listeners on the main polygon
|
| 1518 |
+
google.maps.event.addListener(polygon.getPath(), 'set_at', updateFarmDetails);
|
| 1519 |
+
google.maps.event.addListener(polygon.getPath(), 'insert_at', updateFarmDetails);
|
| 1520 |
+
google.maps.event.addListener(polygon, 'dragend', updateFarmDetails);
|
| 1521 |
+
|
| 1522 |
+
Toastify({ text: 'Polygon saved to form.', duration: 2000, gravity: 'bottom', position: 'right', className: 'bg-success' }).showToast();
|
| 1523 |
+
});
|
| 1524 |
+
</script>
|
| 1525 |
+
</body>
|
| 1526 |
+
</html>
|
templates/insights.html
ADDED
|
@@ -0,0 +1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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!doctype html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="utf-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
| 6 |
+
<title>AI Farm Insights - {{ record.farm_name or record.farmer_name or 'Farm Analysis' }}</title>
|
| 7 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.9.1/chart.min.js"></script>
|
| 8 |
+
<style>
|
| 9 |
+
* {
|
| 10 |
+
margin: 0;
|
| 11 |
+
padding: 0;
|
| 12 |
+
box-sizing: border-box;
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
body {
|
| 16 |
+
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
| 17 |
+
line-height: 1.6;
|
| 18 |
+
color: #333;
|
| 19 |
+
background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
|
| 20 |
+
min-height: 100vh;
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
.container {
|
| 24 |
+
max-width: 1200px;
|
| 25 |
+
margin: 0 auto;
|
| 26 |
+
padding: 20px;
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
.header {
|
| 30 |
+
background: linear-gradient(135deg, #2e7d32 0%, #4caf50 100%);
|
| 31 |
+
color: white;
|
| 32 |
+
padding: 2rem;
|
| 33 |
+
border-radius: 15px;
|
| 34 |
+
margin-bottom: 2rem;
|
| 35 |
+
box-shadow: 0 8px 25px rgba(46, 125, 50, 0.3);
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
.header h1 {
|
| 39 |
+
font-size: 2.5rem;
|
| 40 |
+
margin-bottom: 0.5rem;
|
| 41 |
+
text-align: center;
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
.header p {
|
| 45 |
+
text-align: center;
|
| 46 |
+
font-size: 1.1rem;
|
| 47 |
+
opacity: 0.9;
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
.summary-card {
|
| 51 |
+
background: white;
|
| 52 |
+
padding: 2rem;
|
| 53 |
+
border-radius: 15px;
|
| 54 |
+
margin-bottom: 2rem;
|
| 55 |
+
box-shadow: 0 5px 15px rgba(0,0,0,0.1);
|
| 56 |
+
border-left: 5px solid #4caf50;
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
.summary-card h2 {
|
| 60 |
+
color: #2e7d32;
|
| 61 |
+
margin-bottom: 1rem;
|
| 62 |
+
font-size: 1.8rem;
|
| 63 |
+
}
|
| 64 |
+
|
| 65 |
+
.summary-text {
|
| 66 |
+
font-size: 1.1rem;
|
| 67 |
+
color: #555;
|
| 68 |
+
line-height: 1.8;
|
| 69 |
+
}
|
| 70 |
+
|
| 71 |
+
.metrics-grid {
|
| 72 |
+
display: grid;
|
| 73 |
+
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
|
| 74 |
+
gap: 1.5rem;
|
| 75 |
+
margin-bottom: 2rem;
|
| 76 |
+
}
|
| 77 |
+
|
| 78 |
+
.metric-card {
|
| 79 |
+
background: white;
|
| 80 |
+
padding: 1.5rem;
|
| 81 |
+
border-radius: 12px;
|
| 82 |
+
box-shadow: 0 3px 10px rgba(0,0,0,0.1);
|
| 83 |
+
border-top: 4px solid #4caf50;
|
| 84 |
+
transition: transform 0.3s ease, box-shadow 0.3s ease;
|
| 85 |
+
}
|
| 86 |
+
|
| 87 |
+
.metric-card:hover {
|
| 88 |
+
transform: translateY(-5px);
|
| 89 |
+
box-shadow: 0 5px 20px rgba(0,0,0,0.15);
|
| 90 |
+
}
|
| 91 |
+
|
| 92 |
+
.metric-label {
|
| 93 |
+
font-weight: 600;
|
| 94 |
+
color: #2e7d32;
|
| 95 |
+
font-size: 0.9rem;
|
| 96 |
+
text-transform: uppercase;
|
| 97 |
+
letter-spacing: 0.5px;
|
| 98 |
+
margin-bottom: 0.5rem;
|
| 99 |
+
}
|
| 100 |
+
|
| 101 |
+
.metric-value {
|
| 102 |
+
font-size: 1.4rem;
|
| 103 |
+
font-weight: bold;
|
| 104 |
+
color: #333;
|
| 105 |
+
}
|
| 106 |
+
|
| 107 |
+
.section {
|
| 108 |
+
background: white;
|
| 109 |
+
margin-bottom: 2rem;
|
| 110 |
+
border-radius: 15px;
|
| 111 |
+
box-shadow: 0 5px 15px rgba(0,0,0,0.1);
|
| 112 |
+
overflow: hidden;
|
| 113 |
+
}
|
| 114 |
+
|
| 115 |
+
.section-header {
|
| 116 |
+
background: linear-gradient(135deg, #1b5e20 0%, #2e7d32 100%);
|
| 117 |
+
color: white;
|
| 118 |
+
padding: 1.5rem 2rem;
|
| 119 |
+
font-size: 1.3rem;
|
| 120 |
+
font-weight: 600;
|
| 121 |
+
}
|
| 122 |
+
|
| 123 |
+
.section-content {
|
| 124 |
+
padding: 2rem;
|
| 125 |
+
}
|
| 126 |
+
|
| 127 |
+
.recommendations-list,
|
| 128 |
+
.risks-list,
|
| 129 |
+
.opportunities-list {
|
| 130 |
+
list-style: none;
|
| 131 |
+
}
|
| 132 |
+
|
| 133 |
+
.recommendations-list li,
|
| 134 |
+
.opportunities-list li {
|
| 135 |
+
background: #e8f5e9;
|
| 136 |
+
margin-bottom: 1rem;
|
| 137 |
+
padding: 1rem;
|
| 138 |
+
border-radius: 8px;
|
| 139 |
+
border-left: 4px solid #4caf50;
|
| 140 |
+
}
|
| 141 |
+
|
| 142 |
+
.risks-list li {
|
| 143 |
+
background: #fff3e0;
|
| 144 |
+
margin-bottom: 1rem;
|
| 145 |
+
padding: 1rem;
|
| 146 |
+
border-radius: 8px;
|
| 147 |
+
border-left: 4px solid #ff9800;
|
| 148 |
+
}
|
| 149 |
+
|
| 150 |
+
.priority-high {
|
| 151 |
+
border-left-color: #f44336 !important;
|
| 152 |
+
background: #ffebee !important;
|
| 153 |
+
}
|
| 154 |
+
|
| 155 |
+
.priority-medium {
|
| 156 |
+
border-left-color: #ff9800 !important;
|
| 157 |
+
}
|
| 158 |
+
|
| 159 |
+
.priority-low {
|
| 160 |
+
border-left-color: #2196f3 !important;
|
| 161 |
+
background: #e3f2fd !important;
|
| 162 |
+
}
|
| 163 |
+
|
| 164 |
+
.financial-overview {
|
| 165 |
+
display: grid;
|
| 166 |
+
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
|
| 167 |
+
gap: 1.5rem;
|
| 168 |
+
margin-bottom: 1.5rem;
|
| 169 |
+
}
|
| 170 |
+
|
| 171 |
+
.financial-metric {
|
| 172 |
+
background: #f8f9fa;
|
| 173 |
+
padding: 1.5rem;
|
| 174 |
+
border-radius: 10px;
|
| 175 |
+
text-align: center;
|
| 176 |
+
border: 2px solid #e9ecef;
|
| 177 |
+
}
|
| 178 |
+
|
| 179 |
+
.financial-metric h4 {
|
| 180 |
+
color: #2e7d32;
|
| 181 |
+
margin-bottom: 0.5rem;
|
| 182 |
+
}
|
| 183 |
+
|
| 184 |
+
.financial-metric .value {
|
| 185 |
+
font-size: 1.3rem;
|
| 186 |
+
font-weight: bold;
|
| 187 |
+
color: #333;
|
| 188 |
+
}
|
| 189 |
+
|
| 190 |
+
.action-plan {
|
| 191 |
+
display: grid;
|
| 192 |
+
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
|
| 193 |
+
gap: 1.5rem;
|
| 194 |
+
}
|
| 195 |
+
|
| 196 |
+
.action-phase {
|
| 197 |
+
background: #f8f9fa;
|
| 198 |
+
padding: 1.5rem;
|
| 199 |
+
border-radius: 10px;
|
| 200 |
+
border-top: 3px solid #4caf50;
|
| 201 |
+
}
|
| 202 |
+
|
| 203 |
+
.action-phase h4 {
|
| 204 |
+
color: #2e7d32;
|
| 205 |
+
margin-bottom: 1rem;
|
| 206 |
+
}
|
| 207 |
+
|
| 208 |
+
.action-phase ul {
|
| 209 |
+
list-style: none;
|
| 210 |
+
}
|
| 211 |
+
|
| 212 |
+
.action-phase li {
|
| 213 |
+
background: white;
|
| 214 |
+
padding: 0.8rem;
|
| 215 |
+
margin-bottom: 0.5rem;
|
| 216 |
+
border-radius: 5px;
|
| 217 |
+
border-left: 3px solid #81c784;
|
| 218 |
+
}
|
| 219 |
+
|
| 220 |
+
.chart-container {
|
| 221 |
+
margin-bottom: 2rem;
|
| 222 |
+
}
|
| 223 |
+
|
| 224 |
+
.chart-wrapper {
|
| 225 |
+
position: relative;
|
| 226 |
+
height: 400px;
|
| 227 |
+
margin-bottom: 1rem;
|
| 228 |
+
}
|
| 229 |
+
|
| 230 |
+
.chart-description {
|
| 231 |
+
background: #f8f9fa;
|
| 232 |
+
padding: 1rem;
|
| 233 |
+
border-radius: 8px;
|
| 234 |
+
font-style: italic;
|
| 235 |
+
color: #666;
|
| 236 |
+
}
|
| 237 |
+
|
| 238 |
+
.btn {
|
| 239 |
+
display: inline-block;
|
| 240 |
+
padding: 12px 24px;
|
| 241 |
+
font-size: 1rem;
|
| 242 |
+
font-weight: 600;
|
| 243 |
+
text-align: center;
|
| 244 |
+
text-decoration: none;
|
| 245 |
+
border-radius: 8px;
|
| 246 |
+
cursor: pointer;
|
| 247 |
+
transition: all 0.3s ease;
|
| 248 |
+
margin: 0.5rem;
|
| 249 |
+
}
|
| 250 |
+
|
| 251 |
+
.btn-primary {
|
| 252 |
+
background: linear-gradient(135deg, #2e7d32 0%, #4caf50 100%);
|
| 253 |
+
color: white;
|
| 254 |
+
border: none;
|
| 255 |
+
}
|
| 256 |
+
|
| 257 |
+
.btn-primary:hover {
|
| 258 |
+
transform: translateY(-2px);
|
| 259 |
+
box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
|
| 260 |
+
}
|
| 261 |
+
|
| 262 |
+
.btn-secondary {
|
| 263 |
+
background: #6c757d;
|
| 264 |
+
color: white;
|
| 265 |
+
border: none;
|
| 266 |
+
}
|
| 267 |
+
|
| 268 |
+
.button-group {
|
| 269 |
+
text-align: center;
|
| 270 |
+
margin-top: 3rem;
|
| 271 |
+
padding: 2rem;
|
| 272 |
+
}
|
| 273 |
+
|
| 274 |
+
.tech-grid {
|
| 275 |
+
display: grid;
|
| 276 |
+
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
|
| 277 |
+
gap: 1rem;
|
| 278 |
+
}
|
| 279 |
+
|
| 280 |
+
.tech-item {
|
| 281 |
+
background: #e8f5e9;
|
| 282 |
+
padding: 1.2rem;
|
| 283 |
+
border-radius: 8px;
|
| 284 |
+
border-left: 4px solid #4caf50;
|
| 285 |
+
}
|
| 286 |
+
|
| 287 |
+
.benchmark-table {
|
| 288 |
+
width: 100%;
|
| 289 |
+
border-collapse: collapse;
|
| 290 |
+
margin-bottom: 1rem;
|
| 291 |
+
}
|
| 292 |
+
|
| 293 |
+
.benchmark-table th,
|
| 294 |
+
.benchmark-table td {
|
| 295 |
+
border: 1px solid #ddd;
|
| 296 |
+
padding: 12px;
|
| 297 |
+
text-align: left;
|
| 298 |
+
}
|
| 299 |
+
|
| 300 |
+
.benchmark-table th {
|
| 301 |
+
background: #2e7d32;
|
| 302 |
+
color: white;
|
| 303 |
+
font-weight: 600;
|
| 304 |
+
}
|
| 305 |
+
|
| 306 |
+
.benchmark-table tr:nth-child(even) {
|
| 307 |
+
background: #f8f9fa;
|
| 308 |
+
}
|
| 309 |
+
|
| 310 |
+
.expert-commentary {
|
| 311 |
+
background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
|
| 312 |
+
padding: 2rem;
|
| 313 |
+
border-radius: 10px;
|
| 314 |
+
border-left: 5px solid #2e7d32;
|
| 315 |
+
font-size: 1.1rem;
|
| 316 |
+
line-height: 1.8;
|
| 317 |
+
color: #444;
|
| 318 |
+
}
|
| 319 |
+
|
| 320 |
+
.status-indicator {
|
| 321 |
+
display: inline-block;
|
| 322 |
+
width: 12px;
|
| 323 |
+
height: 12px;
|
| 324 |
+
border-radius: 50%;
|
| 325 |
+
margin-right: 8px;
|
| 326 |
+
}
|
| 327 |
+
|
| 328 |
+
.status-good { background: #4caf50; }
|
| 329 |
+
.status-warning { background: #ff9800; }
|
| 330 |
+
.status-danger { background: #f44336; }
|
| 331 |
+
|
| 332 |
+
@media (max-width: 768px) {
|
| 333 |
+
.container {
|
| 334 |
+
padding: 10px;
|
| 335 |
+
}
|
| 336 |
+
|
| 337 |
+
.header h1 {
|
| 338 |
+
font-size: 2rem;
|
| 339 |
+
}
|
| 340 |
+
|
| 341 |
+
.metrics-grid,
|
| 342 |
+
.financial-overview,
|
| 343 |
+
.action-plan {
|
| 344 |
+
grid-template-columns: 1fr;
|
| 345 |
+
}
|
| 346 |
+
|
| 347 |
+
.chart-wrapper {
|
| 348 |
+
height: 300px;
|
| 349 |
+
}
|
| 350 |
+
}
|
| 351 |
+
</style>
|
| 352 |
+
</head>
|
| 353 |
+
<body>
|
| 354 |
+
<div class="container">
|
| 355 |
+
<!-- Back button -->
|
| 356 |
+
<div style="margin-bottom:12px;">
|
| 357 |
+
<button onclick="history.back()" class="btn btn-secondary">◀ Back</button>
|
| 358 |
+
</div>
|
| 359 |
+
<!-- Header Section -->
|
| 360 |
+
<div class="header">
|
| 361 |
+
<h1>🌾 AI Farm Intelligence Report</h1>
|
| 362 |
+
<p>{{ record.farm_name or record.farmer_name or 'Farm Analysis' }} | Record ID: {{ record.id }}</p>
|
| 363 |
+
</div>
|
| 364 |
+
|
| 365 |
+
<!-- Summary Section -->
|
| 366 |
+
<div class="summary-card">
|
| 367 |
+
<h2>📊 Executive Summary</h2>
|
| 368 |
+
<div class="summary-text">
|
| 369 |
+
{{ insights.summary or "Summary not available" }}
|
| 370 |
+
</div>
|
| 371 |
+
</div>
|
| 372 |
+
|
| 373 |
+
<!-- Key Metrics Section -->
|
| 374 |
+
{% if insights.key_metrics %}
|
| 375 |
+
<div class="section">
|
| 376 |
+
<div class="section-header">🎯 Key Performance Metrics</div>
|
| 377 |
+
<div class="section-content">
|
| 378 |
+
<div class="metrics-grid">
|
| 379 |
+
{% for key, value in insights.key_metrics.items() %}
|
| 380 |
+
{% if value and value != 'N/A' and value != '' and key != 'error' %}
|
| 381 |
+
<div class="metric-card">
|
| 382 |
+
<div class="metric-label">{{ key.replace('_', ' ') | title }}</div>
|
| 383 |
+
<div class="metric-value">{{ value }}</div>
|
| 384 |
+
</div>
|
| 385 |
+
{% endif %}
|
| 386 |
+
{% endfor %}
|
| 387 |
+
</div>
|
| 388 |
+
</div>
|
| 389 |
+
</div>
|
| 390 |
+
{% endif %}
|
| 391 |
+
|
| 392 |
+
<!-- Recommendations Section -->
|
| 393 |
+
{% if insights.recommendations %}
|
| 394 |
+
<div class="section">
|
| 395 |
+
<div class="section-header">💡 Actionable Recommendations</div>
|
| 396 |
+
<div class="section-content">
|
| 397 |
+
<ol class="recommendations-list">
|
| 398 |
+
{% for rec in insights.recommendations %}
|
| 399 |
+
<li class="{% if 'HIGH PRIORITY' in rec %}priority-high{% elif 'MEDIUM PRIORITY' in rec %}priority-medium{% else %}priority-low{% endif %}">
|
| 400 |
+
{{ rec }}
|
| 401 |
+
</li>
|
| 402 |
+
{% endfor %}
|
| 403 |
+
</ol>
|
| 404 |
+
</div>
|
| 405 |
+
</div>
|
| 406 |
+
{% endif %}
|
| 407 |
+
|
| 408 |
+
<!-- Risk Factors Section -->
|
| 409 |
+
{% if insights.risk_factors %}
|
| 410 |
+
<div class="section">
|
| 411 |
+
<div class="section-header">⚠️ Risk Assessment</div>
|
| 412 |
+
<div class="section-content">
|
| 413 |
+
<ul class="risks-list">
|
| 414 |
+
{% for risk in insights.risk_factors %}
|
| 415 |
+
<li class="{% if 'IMMEDIATE' in risk %}priority-high{% elif 'SEASONAL' in risk %}priority-medium{% else %}priority-low{% endif %}">
|
| 416 |
+
<span class="status-indicator {% if 'IMMEDIATE' in risk %}status-danger{% elif 'SEASONAL' in risk %}status-warning{% else %}status-good{% endif %}"></span>
|
| 417 |
+
{{ risk }}
|
| 418 |
+
</li>
|
| 419 |
+
{% endfor %}
|
| 420 |
+
</ul>
|
| 421 |
+
</div>
|
| 422 |
+
</div>
|
| 423 |
+
{% endif %}
|
| 424 |
+
|
| 425 |
+
<!-- Growth Opportunities Section -->
|
| 426 |
+
{% if insights.growth_opportunities or insights.opportunities %}
|
| 427 |
+
<div class="section">
|
| 428 |
+
<div class="section-header">🚀 Growth Opportunities</div>
|
| 429 |
+
<div class="section-content">
|
| 430 |
+
<ul class="opportunities-list">
|
| 431 |
+
{% for opp in (insights.growth_opportunities or insights.opportunities) %}
|
| 432 |
+
<li>{{ opp }}</li>
|
| 433 |
+
{% endfor %}
|
| 434 |
+
</ul>
|
| 435 |
+
</div>
|
| 436 |
+
</div>
|
| 437 |
+
{% endif %}
|
| 438 |
+
|
| 439 |
+
<!-- Financial Overview Section -->
|
| 440 |
+
{% if insights.financial_overview %}
|
| 441 |
+
<div class="section">
|
| 442 |
+
<div class="section-header">💰 Financial Analysis</div>
|
| 443 |
+
<div class="section-content">
|
| 444 |
+
<div class="financial-overview">
|
| 445 |
+
{% if insights.financial_overview.estimated_monthly_costs or insights.financial_overview.estimated_costs %}
|
| 446 |
+
<div class="financial-metric">
|
| 447 |
+
<h4>Monthly Costs</h4>
|
| 448 |
+
<div class="value">{{ insights.financial_overview.estimated_monthly_costs or insights.financial_overview.estimated_costs }}</div>
|
| 449 |
+
</div>
|
| 450 |
+
{% endif %}
|
| 451 |
+
|
| 452 |
+
{% if insights.financial_overview.potential_monthly_income or insights.financial_overview.estimated_income %}
|
| 453 |
+
<div class="financial-metric">
|
| 454 |
+
<h4>Potential Income</h4>
|
| 455 |
+
<div class="value">{{ insights.financial_overview.potential_monthly_income or insights.financial_overview.estimated_income }}</div>
|
| 456 |
+
</div>
|
| 457 |
+
{% endif %}
|
| 458 |
+
|
| 459 |
+
{% if insights.financial_overview.profit_margin_range or insights.financial_overview.profit_margin %}
|
| 460 |
+
<div class="financial-metric">
|
| 461 |
+
<h4>Profit Margin</h4>
|
| 462 |
+
<div class="value">{{ insights.financial_overview.profit_margin_range or insights.financial_overview.profit_margin }}</div>
|
| 463 |
+
</div>
|
| 464 |
+
{% endif %}
|
| 465 |
+
</div>
|
| 466 |
+
|
| 467 |
+
{% if insights.financial_overview.cost_optimization or insights.financial_overview.cost_saving_opportunities %}
|
| 468 |
+
<h3>💡 Cost Optimization</h3>
|
| 469 |
+
<ul>
|
| 470 |
+
{% for tip in (insights.financial_overview.cost_optimization or insights.financial_overview.cost_saving_opportunities) %}
|
| 471 |
+
<li>{{ tip }}</li>
|
| 472 |
+
{% endfor %}
|
| 473 |
+
</ul>
|
| 474 |
+
{% endif %}
|
| 475 |
+
|
| 476 |
+
{% if insights.financial_overview.revenue_enhancement %}
|
| 477 |
+
<h3>📈 Revenue Enhancement</h3>
|
| 478 |
+
<ul>
|
| 479 |
+
{% for tip in insights.financial_overview.revenue_enhancement %}
|
| 480 |
+
<li>{{ tip }}</li>
|
| 481 |
+
{% endfor %}
|
| 482 |
+
</ul>
|
| 483 |
+
{% endif %}
|
| 484 |
+
</div>
|
| 485 |
+
</div>
|
| 486 |
+
{% endif %}
|
| 487 |
+
|
| 488 |
+
<!-- Environmental Sustainability Section -->
|
| 489 |
+
{% if insights.environmental_sustainability or insights.environmental_insights %}
|
| 490 |
+
<div class="section">
|
| 491 |
+
<div class="section-header">🌱 Environmental & Sustainability</div>
|
| 492 |
+
<div class="section-content">
|
| 493 |
+
{% set env = insights.environmental_sustainability or insights.environmental_insights %}
|
| 494 |
+
|
| 495 |
+
{% if env.carbon_footprint_assessment or env.carbon_footprint %}
|
| 496 |
+
<h3>🌍 Carbon Footprint</h3>
|
| 497 |
+
<p>{{ env.carbon_footprint_assessment or env.carbon_footprint }}</p>
|
| 498 |
+
{% endif %}
|
| 499 |
+
|
| 500 |
+
{% if env.biodiversity_enhancement or env.sustainability_tips %}
|
| 501 |
+
<h3>🦋 Biodiversity Enhancement</h3>
|
| 502 |
+
<ul>
|
| 503 |
+
{% for tip in (env.biodiversity_enhancement or env.sustainability_tips) %}
|
| 504 |
+
<li>{{ tip }}</li>
|
| 505 |
+
{% endfor %}
|
| 506 |
+
</ul>
|
| 507 |
+
{% endif %}
|
| 508 |
+
|
| 509 |
+
{% if env.climate_resilience or env.climate_risks %}
|
| 510 |
+
<h3>🌡️ Climate Resilience</h3>
|
| 511 |
+
<ul>
|
| 512 |
+
{% for item in (env.climate_resilience or env.climate_risks) %}
|
| 513 |
+
<li>{{ item }}</li>
|
| 514 |
+
{% endfor %}
|
| 515 |
+
</ul>
|
| 516 |
+
{% endif %}
|
| 517 |
+
</div>
|
| 518 |
+
</div>
|
| 519 |
+
{% endif %}
|
| 520 |
+
|
| 521 |
+
<!-- Technology Integration Section -->
|
| 522 |
+
{% if insights.technology_integration or insights.technology_opportunities %}
|
| 523 |
+
<div class="section">
|
| 524 |
+
<div class="section-header">🔬 Technology Integration</div>
|
| 525 |
+
<div class="section-content">
|
| 526 |
+
<div class="tech-grid">
|
| 527 |
+
{% for tech in (insights.technology_integration or insights.technology_opportunities) %}
|
| 528 |
+
<div class="tech-item">{{ tech }}</div>
|
| 529 |
+
{% endfor %}
|
| 530 |
+
</div>
|
| 531 |
+
</div>
|
| 532 |
+
</div>
|
| 533 |
+
{% endif %}
|
| 534 |
+
|
| 535 |
+
<!-- Implementation Roadmap Section -->
|
| 536 |
+
{% if insights.implementation_roadmap or insights.action_plan %}
|
| 537 |
+
<div class="section">
|
| 538 |
+
<div class="section-header">📋 Implementation Roadmap</div>
|
| 539 |
+
<div class="section-content">
|
| 540 |
+
<div class="action-plan">
|
| 541 |
+
{% set roadmap = insights.implementation_roadmap or insights.action_plan %}
|
| 542 |
+
|
| 543 |
+
{% if roadmap['immediate_actions (0-3 months)'] or roadmap['short_term (0-6 months)'] %}
|
| 544 |
+
<div class="action-phase">
|
| 545 |
+
<h4>🔥 Immediate Actions (0-3 months)</h4>
|
| 546 |
+
<ul>
|
| 547 |
+
{% for action in (roadmap['immediate_actions (0-3 months)'] or roadmap['short_term (0-6 months)']) %}
|
| 548 |
+
<li>{{ action }}</li>
|
| 549 |
+
{% endfor %}
|
| 550 |
+
</ul>
|
| 551 |
+
</div>
|
| 552 |
+
{% endif %}
|
| 553 |
+
|
| 554 |
+
{% if roadmap['short_term_goals (3-12 months)'] or roadmap['medium_term (6-18 months)'] %}
|
| 555 |
+
<div class="action-phase">
|
| 556 |
+
<h4>⏳ Short-term Goals (3-12 months)</h4>
|
| 557 |
+
<ul>
|
| 558 |
+
{% for action in (roadmap['short_term_goals (3-12 months)'] or roadmap['medium_term (6-18 months)']) %}
|
| 559 |
+
<li>{{ action }}</li>
|
| 560 |
+
{% endfor %}
|
| 561 |
+
</ul>
|
| 562 |
+
</div>
|
| 563 |
+
{% endif %}
|
| 564 |
+
|
| 565 |
+
{% if roadmap['long_term_vision (3-5 years)'] or roadmap['long_term (2-5 years)'] %}
|
| 566 |
+
<div class="action-phase">
|
| 567 |
+
<h4>🎯 Long-term Vision (3-5 years)</h4>
|
| 568 |
+
<ul>
|
| 569 |
+
{% for action in (roadmap['long_term_vision (3-5 years)'] or roadmap['long_term (2-5 years)']) %}
|
| 570 |
+
<li>{{ action }}</li>
|
| 571 |
+
{% endfor %}
|
| 572 |
+
</ul>
|
| 573 |
+
</div>
|
| 574 |
+
{% endif %}
|
| 575 |
+
</div>
|
| 576 |
+
</div>
|
| 577 |
+
</div>
|
| 578 |
+
{% endif %}
|
| 579 |
+
|
| 580 |
+
<!-- Data Visualizations Section -->
|
| 581 |
+
{% if insights.data_visualizations or insights.data_for_visualizations %}
|
| 582 |
+
<div class="section">
|
| 583 |
+
<div class="section-header">📊 Performance Analytics</div>
|
| 584 |
+
<div class="section-content">
|
| 585 |
+
{% for chart_data in (insights.data_visualizations or insights.data_for_visualizations) %}
|
| 586 |
+
<div class="chart-container">
|
| 587 |
+
<h3>{{ chart_data.chart_title }}</h3>
|
| 588 |
+
<div class="chart-wrapper">
|
| 589 |
+
<canvas id="chart-{{ loop.index }}"></canvas>
|
| 590 |
+
</div>
|
| 591 |
+
<div class="chart-description">{{ chart_data.chart_description }}</div>
|
| 592 |
+
</div>
|
| 593 |
+
{% endfor %}
|
| 594 |
+
</div>
|
| 595 |
+
</div>
|
| 596 |
+
|
| 597 |
+
<script>
|
| 598 |
+
document.addEventListener('DOMContentLoaded', function() {
|
| 599 |
+
{% for chart_data in (insights.data_visualizations or insights.data_for_visualizations) %}
|
| 600 |
+
try {
|
| 601 |
+
// Ensure chart_data is correctly converted to a JavaScript object
|
| 602 |
+
const ctx{{ loop.index }} = document.getElementById('chart-{{ loop.index }}').getContext('2d');
|
| 603 |
+
const data{{ loop.index }} = JSON.parse('{{ chart_data | tojson | safe }}'); // Use JSON.parse with 'safe' filter for direct output
|
| 604 |
+
|
| 605 |
+
let chartConfig = {
|
| 606 |
+
type: data{{ loop.index }}.chart_type || 'bar',
|
| 607 |
+
data: {
|
| 608 |
+
labels: data{{ loop.index }}.data_labels || [],
|
| 609 |
+
datasets: [{
|
| 610 |
+
label: data{{ loop.index }}.chart_title || 'Data',
|
| 611 |
+
data: data{{ loop.index }}.data_values || data{{ loop.index }}.current_scores || [],
|
| 612 |
+
backgroundColor: [
|
| 613 |
+
'rgba(76, 175, 80, 0.8)', 'rgba(33, 150, 243, 0.8)',
|
| 614 |
+
'rgba(255, 152, 0, 0.8)', 'rgba(244, 67, 54, 0.8)',
|
| 615 |
+
'rgba(156, 39, 176, 0.8)', 'rgba(0, 188, 212, 0.8)'
|
| 616 |
+
],
|
| 617 |
+
borderColor: [
|
| 618 |
+
'rgba(76, 175, 80, 1)', 'rgba(33, 150, 243, 1)',
|
| 619 |
+
'rgba(255, 152, 0, 1)', 'rgba(244, 67, 54, 1)',
|
| 620 |
+
'rgba(156, 39, 176, 1)', 'rgba(0, 188, 212, 1)'
|
| 621 |
+
],
|
| 622 |
+
borderWidth: 2
|
| 623 |
+
}]
|
| 624 |
+
},
|
| 625 |
+
options: {
|
| 626 |
+
responsive: true,
|
| 627 |
+
maintainAspectRatio: false,
|
| 628 |
+
plugins: {
|
| 629 |
+
legend: {
|
| 630 |
+
display: true,
|
| 631 |
+
position: 'top'
|
| 632 |
+
}
|
| 633 |
+
},
|
| 634 |
+
scales: data{{ loop.index }}.chart_type === 'radar' ? {} : {
|
| 635 |
+
y: {
|
| 636 |
+
beginAtZero: true,
|
| 637 |
+
max: data{{ loop.index }}.max_score || data{{ loop.index }}.max_value || undefined
|
| 638 |
+
}
|
| 639 |
+
}
|
| 640 |
+
}
|
| 641 |
+
};
|
| 642 |
+
|
| 643 |
+
// Add target scores for radar chart
|
| 644 |
+
if (data{{ loop.index }}.target_scores && data{{ loop.index }}.chart_type === 'radar') {
|
| 645 |
+
chartConfig.data.datasets.push({
|
| 646 |
+
label: 'Target',
|
| 647 |
+
data: data{{ loop.index }}.target_scores,
|
| 648 |
+
backgroundColor: 'rgba(255, 193, 7, 0.2)',
|
| 649 |
+
borderColor: 'rgba(255, 193, 7, 1)',
|
| 650 |
+
borderWidth: 2,
|
| 651 |
+
fill: false
|
| 652 |
+
});
|
| 653 |
+
}
|
| 654 |
+
|
| 655 |
+
new Chart(ctx{{ loop.index }}, chartConfig);
|
| 656 |
+
} catch (error) {
|
| 657 |
+
console.error('Error creating chart {{ loop.index }}:', error);
|
| 658 |
+
// Provide a more visible fallback in the HTML
|
| 659 |
+
const chartWrapper = document.getElementById('chart-{{ loop.index }}').parentElement;
|
| 660 |
+
if (chartWrapper) {
|
| 661 |
+
chartWrapper.innerHTML = '<p style="text-align: center; padding: 2rem; color: #d32f2f; font-weight: bold;">Error loading chart: ' + error.message + '</p>';
|
| 662 |
+
}
|
| 663 |
+
}
|
| 664 |
+
{% endfor %}
|
| 665 |
+
});
|
| 666 |
+
</script>
|
| 667 |
+
{% endif %}
|
| 668 |
+
|
| 669 |
+
<!-- Expert Commentary Section -->
|
| 670 |
+
{% if insights.expert_commentary or insights.expert_notes %}
|
| 671 |
+
<div class="section">
|
| 672 |
+
<div class="section-header">👨🌾 Expert Commentary</div>
|
| 673 |
+
<div class="section-content">
|
| 674 |
+
<div class="expert-commentary">
|
| 675 |
+
{{ insights.expert_commentary or insights.expert_notes }}
|
| 676 |
+
</div>
|
| 677 |
+
</div>
|
| 678 |
+
</div>
|
| 679 |
+
{% endif %}
|
| 680 |
+
|
| 681 |
+
<!-- Action Buttons -->
|
| 682 |
+
<div class="button-group">
|
| 683 |
+
<a href="/generate-yearly-plan/{{ record.id }}" class="btn btn-primary">📅 Generate Yearly Plan</a>
|
| 684 |
+
<a href="/" class="btn btn-secondary">🏠 Back to Home</a>
|
| 685 |
+
<button onclick="window.print()" class="btn btn-secondary">🖨️ Print Report</button>
|
| 686 |
+
</div>
|
| 687 |
+
</div>
|
| 688 |
+
</body>
|
| 689 |
+
</html>
|
templates/success.html
ADDED
|
@@ -0,0 +1,600 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
<!DOCTYPE html>
|
| 3 |
+
<html lang="en">
|
| 4 |
+
<head>
|
| 5 |
+
<meta charset="utf-8" />
|
| 6 |
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
| 7 |
+
<title>Dashboard</title>
|
| 8 |
+
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet"/>
|
| 9 |
+
<style>
|
| 10 |
+
* {
|
| 11 |
+
margin: 0;
|
| 12 |
+
padding: 0;
|
| 13 |
+
box-sizing: border-box;
|
| 14 |
+
}
|
| 15 |
+
body {
|
| 16 |
+
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
| 17 |
+
background: linear-gradient(135deg,rgb(255, 251, 232));
|
| 18 |
+
min-height: 100vh;
|
| 19 |
+
padding: 0;
|
| 20 |
+
overflow-x: hidden;
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
.background-pattern {
|
| 24 |
+
position: fixed;
|
| 25 |
+
top: 0;
|
| 26 |
+
left: 0;
|
| 27 |
+
width: 100%;
|
| 28 |
+
height: 100%;
|
| 29 |
+
background: url('data:image/svg+xml,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="%23ffffff" fill-opacity="0.03"><circle cx="30" cy="30" r="4"/></g></svg>');
|
| 30 |
+
z-index: -1;
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
.top-nav {
|
| 34 |
+
background: rgba(255, 255, 255, 0.15);
|
| 35 |
+
backdrop-filter: blur(20px);
|
| 36 |
+
border-bottom: 1px solid rgba(255, 255, 255, 0.2);
|
| 37 |
+
padding: 1rem 2rem;
|
| 38 |
+
position: sticky;
|
| 39 |
+
top: 0;
|
| 40 |
+
z-index: 100;
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
.nav-content {
|
| 44 |
+
max-width: 1200px;
|
| 45 |
+
margin: 0 auto;
|
| 46 |
+
display: flex;
|
| 47 |
+
justify-content: space-between;
|
| 48 |
+
align-items: center;
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
.logo {
|
| 52 |
+
display: flex;
|
| 53 |
+
align-items: center;
|
| 54 |
+
gap: 0.5rem;
|
| 55 |
+
color: white;
|
| 56 |
+
font-weight: 700;
|
| 57 |
+
font-size: 1.5rem;
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
+
.logo i {
|
| 61 |
+
color: #4ade80;
|
| 62 |
+
font-size: 2rem;
|
| 63 |
+
}
|
| 64 |
+
|
| 65 |
+
.user-info {
|
| 66 |
+
display: flex;
|
| 67 |
+
align-items: center;
|
| 68 |
+
gap: 1rem;
|
| 69 |
+
color: white;
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
.avatar {
|
| 73 |
+
width: 40px;
|
| 74 |
+
height: 40px;
|
| 75 |
+
background: linear-gradient(135deg, #4ade80, #22c55e);
|
| 76 |
+
border-radius: 50%;
|
| 77 |
+
display: flex;
|
| 78 |
+
align-items: center;
|
| 79 |
+
justify-content: center;
|
| 80 |
+
color: white;
|
| 81 |
+
font-weight: 600;
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
.container {
|
| 85 |
+
max-width: 1200px;
|
| 86 |
+
margin: 0 auto;
|
| 87 |
+
padding: 2rem;
|
| 88 |
+
}
|
| 89 |
+
|
| 90 |
+
.welcome-section {
|
| 91 |
+
text-align: center;
|
| 92 |
+
margin-bottom: 3rem;
|
| 93 |
+
color: white;
|
| 94 |
+
}
|
| 95 |
+
|
| 96 |
+
.welcome-section h1 {
|
| 97 |
+
font-size: 3rem;
|
| 98 |
+
font-weight: 800;
|
| 99 |
+
margin-bottom: 0.5rem;
|
| 100 |
+
text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
|
| 101 |
+
}
|
| 102 |
+
|
| 103 |
+
.welcome-section p {
|
| 104 |
+
font-size: 1.2rem;
|
| 105 |
+
opacity: 0.9;
|
| 106 |
+
margin-bottom: 2rem;
|
| 107 |
+
}
|
| 108 |
+
|
| 109 |
+
.stats-grid {
|
| 110 |
+
display: grid;
|
| 111 |
+
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
| 112 |
+
gap: 1rem;
|
| 113 |
+
margin-bottom: 3rem;
|
| 114 |
+
}
|
| 115 |
+
|
| 116 |
+
.stat-card {
|
| 117 |
+
background: rgba(255, 255, 255, 0.15);
|
| 118 |
+
backdrop-filter: blur(20px);
|
| 119 |
+
border: 1px solid rgba(255, 255, 255, 0.2);
|
| 120 |
+
border-radius: 16px;
|
| 121 |
+
padding: 1.5rem;
|
| 122 |
+
text-align: center;
|
| 123 |
+
color: white;
|
| 124 |
+
}
|
| 125 |
+
|
| 126 |
+
.stat-value {
|
| 127 |
+
font-size: 2.5rem;
|
| 128 |
+
font-weight: 800;
|
| 129 |
+
margin-bottom: 0.5rem;
|
| 130 |
+
color: #4ade80;
|
| 131 |
+
}
|
| 132 |
+
|
| 133 |
+
.stat-label {
|
| 134 |
+
font-size: 0.9rem;
|
| 135 |
+
opacity: 0.8;
|
| 136 |
+
text-transform: uppercase;
|
| 137 |
+
letter-spacing: 0.5px;
|
| 138 |
+
}
|
| 139 |
+
|
| 140 |
+
.cards-grid {
|
| 141 |
+
display: grid;
|
| 142 |
+
grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
|
| 143 |
+
gap: 2rem;
|
| 144 |
+
}
|
| 145 |
+
|
| 146 |
+
.feature-card {
|
| 147 |
+
background: rgba(255, 255, 255, 0.95);
|
| 148 |
+
backdrop-filter: blur(20px);
|
| 149 |
+
border: 1px solid rgba(255, 255, 255, 0.3);
|
| 150 |
+
border-radius: 20px;
|
| 151 |
+
padding: 2rem;
|
| 152 |
+
text-align: center;
|
| 153 |
+
position: relative;
|
| 154 |
+
overflow: hidden;
|
| 155 |
+
transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
|
| 156 |
+
box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
|
| 157 |
+
}
|
| 158 |
+
|
| 159 |
+
.feature-card::before {
|
| 160 |
+
content: '';
|
| 161 |
+
position: absolute;
|
| 162 |
+
top: 0;
|
| 163 |
+
left: 0;
|
| 164 |
+
right: 0;
|
| 165 |
+
height: 4px;
|
| 166 |
+
background: linear-gradient(90deg, #4ade80, #22c55e, #16a34a);
|
| 167 |
+
transform: scaleX(0);
|
| 168 |
+
transition: transform 0.4s ease;
|
| 169 |
+
}
|
| 170 |
+
|
| 171 |
+
.feature-card:hover::before {
|
| 172 |
+
transform: scaleX(1);
|
| 173 |
+
}
|
| 174 |
+
|
| 175 |
+
.feature-card:hover {
|
| 176 |
+
transform: translateY(-10px);
|
| 177 |
+
box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2);
|
| 178 |
+
}
|
| 179 |
+
|
| 180 |
+
.card-icon {
|
| 181 |
+
width: 80px;
|
| 182 |
+
height: 80px;
|
| 183 |
+
margin: 0 auto 1.5rem;
|
| 184 |
+
border-radius: 20px;
|
| 185 |
+
display: flex;
|
| 186 |
+
align-items: center;
|
| 187 |
+
justify-content: center;
|
| 188 |
+
font-size: 2.5rem;
|
| 189 |
+
color: white;
|
| 190 |
+
position: relative;
|
| 191 |
+
overflow: hidden;
|
| 192 |
+
}
|
| 193 |
+
|
| 194 |
+
.card-icon::before {
|
| 195 |
+
content: '';
|
| 196 |
+
position: absolute;
|
| 197 |
+
inset: 0;
|
| 198 |
+
border-radius: inherit;
|
| 199 |
+
background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.2), transparent);
|
| 200 |
+
transform: translateX(-100%);
|
| 201 |
+
transition: transform 0.6s;
|
| 202 |
+
}
|
| 203 |
+
|
| 204 |
+
.feature-card:hover .card-icon::before {
|
| 205 |
+
transform: translateX(100%);
|
| 206 |
+
}
|
| 207 |
+
|
| 208 |
+
.icon-green { background: linear-gradient(135deg, #4ade80, #22c55e); }
|
| 209 |
+
.icon-blue { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
|
| 210 |
+
.icon-cyan { background: linear-gradient(135deg, #06b6d4, #0891b2); }
|
| 211 |
+
.icon-red { background: linear-gradient(135deg, #ef4444, #dc2626); }
|
| 212 |
+
.icon-purple { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
|
| 213 |
+
.icon-orange { background: linear-gradient(135deg, #f59e0b, #d97706); }
|
| 214 |
+
.icon-teal { background: linear-gradient(135deg, #1abc9c, #16a085); } /* New icon color for daily tasks */
|
| 215 |
+
|
| 216 |
+
.card-title {
|
| 217 |
+
font-size: 1.4rem;
|
| 218 |
+
font-weight: 700;
|
| 219 |
+
margin-bottom: 1rem;
|
| 220 |
+
color: #1f2937;
|
| 221 |
+
}
|
| 222 |
+
|
| 223 |
+
.card-description {
|
| 224 |
+
font-size: 0.95rem;
|
| 225 |
+
color: #6b7280;
|
| 226 |
+
margin-bottom: 2rem;
|
| 227 |
+
line-height: 1.6;
|
| 228 |
+
}
|
| 229 |
+
|
| 230 |
+
.card-button {
|
| 231 |
+
display: inline-flex;
|
| 232 |
+
align-items: center;
|
| 233 |
+
gap: 0.5rem;
|
| 234 |
+
padding: 1rem 2rem;
|
| 235 |
+
font-size: 1rem;
|
| 236 |
+
font-weight: 600;
|
| 237 |
+
border: none;
|
| 238 |
+
border-radius: 12px;
|
| 239 |
+
cursor: pointer;
|
| 240 |
+
transition: all 0.3s ease;
|
| 241 |
+
text-decoration: none;
|
| 242 |
+
color: white;
|
| 243 |
+
position: relative;
|
| 244 |
+
overflow: hidden;
|
| 245 |
+
}
|
| 246 |
+
|
| 247 |
+
.card-button::before {
|
| 248 |
+
content: '';
|
| 249 |
+
position: absolute;
|
| 250 |
+
inset: 0;
|
| 251 |
+
background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.2), transparent);
|
| 252 |
+
transform: translateX(-100%);
|
| 253 |
+
transition: transform 0.6s;
|
| 254 |
+
}
|
| 255 |
+
|
| 256 |
+
.card-button:hover::before {
|
| 257 |
+
transform: translateX(100%);
|
| 258 |
+
}
|
| 259 |
+
|
| 260 |
+
.btn-primary {
|
| 261 |
+
background: linear-gradient(135deg, #4ade80, #22c55e);
|
| 262 |
+
box-shadow: 0 4px 15px rgba(74, 222, 128, 0.4);
|
| 263 |
+
}
|
| 264 |
+
|
| 265 |
+
.btn-primary:hover {
|
| 266 |
+
transform: translateY(-2px);
|
| 267 |
+
box-shadow: 0 8px 25px rgba(74, 222, 128, 0.6);
|
| 268 |
+
}
|
| 269 |
+
|
| 270 |
+
.btn-secondary {
|
| 271 |
+
background: linear-gradient(135deg, #3b82f6, #1d4ed8);
|
| 272 |
+
box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
|
| 273 |
+
}
|
| 274 |
+
|
| 275 |
+
.btn-secondary:hover {
|
| 276 |
+
transform: translateY(-2px);
|
| 277 |
+
box-shadow: 0 8px 25px rgba(59, 130, 246, 0.6);
|
| 278 |
+
}
|
| 279 |
+
|
| 280 |
+
.btn-accent {
|
| 281 |
+
background: linear-gradient(135deg, #06b6d4, #0891b2);
|
| 282 |
+
box-shadow: 0 4px 15px rgba(6, 182, 212, 0.4);
|
| 283 |
+
}
|
| 284 |
+
|
| 285 |
+
.btn-accent:hover {
|
| 286 |
+
transform: translateY(-2px);
|
| 287 |
+
box-shadow: 0 8px 25px rgba(6, 182, 212, 0.6);
|
| 288 |
+
}
|
| 289 |
+
|
| 290 |
+
/* New button style for daily tasks */
|
| 291 |
+
.btn-teal {
|
| 292 |
+
background: linear-gradient(135deg, #1abc9c, #16a085);
|
| 293 |
+
box-shadow: 0 4px 15px rgba(26, 188, 156, 0.4);
|
| 294 |
+
}
|
| 295 |
+
|
| 296 |
+
.btn-teal:hover {
|
| 297 |
+
transform: translateY(-2px);
|
| 298 |
+
box-shadow: 0 8px 25px rgba(26, 188, 156, 0.6);
|
| 299 |
+
}
|
| 300 |
+
|
| 301 |
+
|
| 302 |
+
.quick-actions {
|
| 303 |
+
margin-top: 3rem;
|
| 304 |
+
text-align: center;
|
| 305 |
+
}
|
| 306 |
+
|
| 307 |
+
.quick-actions h3 {
|
| 308 |
+
color: white;
|
| 309 |
+
font-size: 1.5rem;
|
| 310 |
+
margin-bottom: 1rem;
|
| 311 |
+
opacity: 0.9;
|
| 312 |
+
}
|
| 313 |
+
|
| 314 |
+
.quick-links {
|
| 315 |
+
display: flex;
|
| 316 |
+
justify-content: center;
|
| 317 |
+
gap: 1rem;
|
| 318 |
+
flex-wrap: wrap;
|
| 319 |
+
}
|
| 320 |
+
|
| 321 |
+
.quick-link {
|
| 322 |
+
display: inline-flex;
|
| 323 |
+
align-items: center;
|
| 324 |
+
gap: 0.5rem;
|
| 325 |
+
padding: 0.75rem 1.5rem;
|
| 326 |
+
background: rgba(255, 255, 255, 0.1);
|
| 327 |
+
border: 1px solid rgba(255, 255, 255, 0.2);
|
| 328 |
+
border-radius: 30px;
|
| 329 |
+
color: white;
|
| 330 |
+
text-decoration: none;
|
| 331 |
+
font-weight: 500;
|
| 332 |
+
transition: all 0.3s ease;
|
| 333 |
+
backdrop-filter: blur(10px);
|
| 334 |
+
}
|
| 335 |
+
|
| 336 |
+
.quick-link:hover {
|
| 337 |
+
background: rgba(255, 255, 255, 0.2);
|
| 338 |
+
transform: translateY(-2px);
|
| 339 |
+
}
|
| 340 |
+
|
| 341 |
+
.loading-animation {
|
| 342 |
+
opacity: 0;
|
| 343 |
+
animation: fadeInUp 0.6s ease forwards;
|
| 344 |
+
}
|
| 345 |
+
|
| 346 |
+
.loading-animation:nth-child(1) { animation-delay: 0.1s; }
|
| 347 |
+
.loading-animation:nth-child(2) { animation-delay: 0.2s; }
|
| 348 |
+
.loading-animation:nth-child(3) { animation-delay: 0.3s; }
|
| 349 |
+
.loading-animation:nth-child(4) { animation-delay: 0.4s; }
|
| 350 |
+
.loading-animation:nth-child(5) { animation-delay: 0.5s; }
|
| 351 |
+
.loading-animation:nth-child(6) { animation-delay: 0.6s; }
|
| 352 |
+
|
| 353 |
+
@keyframes fadeInUp {
|
| 354 |
+
from {
|
| 355 |
+
opacity: 0;
|
| 356 |
+
transform: translateY(30px);
|
| 357 |
+
}
|
| 358 |
+
to {
|
| 359 |
+
opacity: 1;
|
| 360 |
+
transform: translateY(0);
|
| 361 |
+
}
|
| 362 |
+
}
|
| 363 |
+
|
| 364 |
+
@keyframes float {
|
| 365 |
+
0%, 100% { transform: translateY(0px); }
|
| 366 |
+
50% { transform: translateY(-10px); }
|
| 367 |
+
}
|
| 368 |
+
|
| 369 |
+
.floating {
|
| 370 |
+
animation: float 3s ease-in-out infinite;
|
| 371 |
+
}
|
| 372 |
+
|
| 373 |
+
@media (max-width: 768px) {
|
| 374 |
+
.container {
|
| 375 |
+
padding: 1rem;
|
| 376 |
+
}
|
| 377 |
+
|
| 378 |
+
.welcome-section h1 {
|
| 379 |
+
font-size: 2rem;
|
| 380 |
+
}
|
| 381 |
+
|
| 382 |
+
.cards-grid {
|
| 383 |
+
grid-template-columns: 1fr;
|
| 384 |
+
gap: 1.5rem;
|
| 385 |
+
}
|
| 386 |
+
|
| 387 |
+
.feature-card {
|
| 388 |
+
padding: 1.5rem;
|
| 389 |
+
}
|
| 390 |
+
|
| 391 |
+
.nav-content {
|
| 392 |
+
padding: 0 1rem;
|
| 393 |
+
}
|
| 394 |
+
|
| 395 |
+
.user-info span {
|
| 396 |
+
display: none;
|
| 397 |
+
}
|
| 398 |
+
}
|
| 399 |
+
|
| 400 |
+
.success-badge {
|
| 401 |
+
position: absolute;
|
| 402 |
+
top: -10px;
|
| 403 |
+
right: -10px;
|
| 404 |
+
background: linear-gradient(135deg, #10b981, #059669);
|
| 405 |
+
color: white;
|
| 406 |
+
border-radius: 50%;
|
| 407 |
+
width: 24px;
|
| 408 |
+
height: 24px;
|
| 409 |
+
display: flex;
|
| 410 |
+
align-items: center;
|
| 411 |
+
justify-content: center;
|
| 412 |
+
font-size: 0.8rem;
|
| 413 |
+
box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
|
| 414 |
+
}
|
| 415 |
+
</style>
|
| 416 |
+
</head>
|
| 417 |
+
<body>
|
| 418 |
+
<div class="background-pattern"></div>
|
| 419 |
+
<div class="container">
|
| 420 |
+
<!-- Back button (go to previous page) -->
|
| 421 |
+
<div style="position:relative; margin-bottom: 1rem;">
|
| 422 |
+
<button onclick="history.back()" class="card-button" style="padding:0.5rem 0.9rem; background: rgba(0,0,0,0.06); color:#102a0f; border-radius:8px; font-weight:600;">◀ Back</button>
|
| 423 |
+
</div>
|
| 424 |
+
<section class="welcome-section">
|
| 425 |
+
<h1 class="floating">Farm Management Hub</h1>
|
| 426 |
+
</section>
|
| 427 |
+
|
| 428 |
+
|
| 429 |
+
<div class="cards-grid">
|
| 430 |
+
|
| 431 |
+
|
| 432 |
+
<div class="feature-card loading-animation">
|
| 433 |
+
<div class="card-icon icon-orange">
|
| 434 |
+
<i class="fas fa-server"></i>
|
| 435 |
+
</div>
|
| 436 |
+
<h3 class="card-title">Admin Panel</h3>
|
| 437 |
+
<p class="card-description">Open the bot/admin UI to manage scheduled messages, suggested tasks and AI responses.</p>
|
| 438 |
+
<button class="card-button btn-secondary" onclick="window.location.href='/bot'">
|
| 439 |
+
<i class="fas fa-cogs"></i>
|
| 440 |
+
Open Admin Panel
|
| 441 |
+
</button>
|
| 442 |
+
</div>
|
| 443 |
+
<div class="feature-card loading-animation">
|
| 444 |
+
<div class="card-icon icon-blue">
|
| 445 |
+
<i class="fas fa-brain"></i>
|
| 446 |
+
</div>
|
| 447 |
+
<h3 class="card-title">AI-Powered Insights</h3>
|
| 448 |
+
<p class="card-description">Get intelligent recommendations and insights powered by advanced machine learning algorithms.</p>
|
| 449 |
+
<button class="card-button btn-secondary" onclick="window.location.href='/generate-insights/{{ record.id }}'">
|
| 450 |
+
<i class="fas fa-lightbulb"></i>
|
| 451 |
+
Generate Insights
|
| 452 |
+
</button>
|
| 453 |
+
</div>
|
| 454 |
+
|
| 455 |
+
<div class="feature-card loading-animation">
|
| 456 |
+
<div class="card-icon icon-cyan">
|
| 457 |
+
<i class="fas fa-calendar-check"></i>
|
| 458 |
+
</div>
|
| 459 |
+
<h3 class="card-title">Strategic Planning</h3>
|
| 460 |
+
<p class="card-description">Create comprehensive yearly plans with seasonal recommendations and crop rotation strategies.</p>
|
| 461 |
+
<button class="card-button btn-accent" onclick="window.location.href='/generate-yearly-plan/{{ record.id }}'">
|
| 462 |
+
<i class="fas fa-calendar-alt"></i>
|
| 463 |
+
Plan Your Year
|
| 464 |
+
</button>
|
| 465 |
+
</div>
|
| 466 |
+
|
| 467 |
+
<!-- NEW: Pest Outbreak Prediction Space -->
|
| 468 |
+
<div class="feature-card loading-animation">
|
| 469 |
+
<div class="card-icon icon-teal">
|
| 470 |
+
<i class="fas fa-bug"></i>
|
| 471 |
+
</div>
|
| 472 |
+
<h3 class="card-title">Pest Outbreak Prediction</h3>
|
| 473 |
+
<p class="card-description">Open the pest outbreak prediction tool to assess risk and get mitigation suggestions.</p>
|
| 474 |
+
<button class="card-button btn-primary" onclick="window.open('https://pranit144-pest-outbreak-prediction.hf.space', '_blank')">
|
| 475 |
+
<i class="fas fa-external-link-alt"></i>
|
| 476 |
+
Open Pest Prediction
|
| 477 |
+
</button>
|
| 478 |
+
</div>
|
| 479 |
+
|
| 480 |
+
<div class="feature-card loading-animation">
|
| 481 |
+
<div class="card-icon icon-green">
|
| 482 |
+
<i class="fas fa-cloud-sun-rain"></i>
|
| 483 |
+
</div>
|
| 484 |
+
<h3 class="card-title">Weather Intelligence</h3>
|
| 485 |
+
<p class="card-description">Advanced weather forecasting with agricultural-specific insights and recommendations.</p>
|
| 486 |
+
<button class="card-button btn-primary" onclick="window.open('https://pranit144-weather-forecast-farmers.hf.space', '_blank')">
|
| 487 |
+
<i class="fas fa-external-link-alt"></i>
|
| 488 |
+
Weather Center
|
| 489 |
+
</button>
|
| 490 |
+
</div>
|
| 491 |
+
|
| 492 |
+
<div class="feature-card loading-animation">
|
| 493 |
+
<div class="card-icon icon-blue">
|
| 494 |
+
<i class="fas fa-chart-line"></i>
|
| 495 |
+
</div>
|
| 496 |
+
<h3 class="card-title">Market Analytics</h3>
|
| 497 |
+
<p class="card-description">Real-time market trends, price forecasting, and commodity analysis for better decision making.</p>
|
| 498 |
+
<button class="card-button btn-secondary" onclick="window.open('https://agri-ai-rosy.vercel.app/cropMarketTrendAnalyzer', '_blank')">
|
| 499 |
+
<i class="fas fa-chart-bar"></i>
|
| 500 |
+
Market Trends
|
| 501 |
+
</button>
|
| 502 |
+
</div>
|
| 503 |
+
|
| 504 |
+
<div class="feature-card loading-animation">
|
| 505 |
+
<div class="card-icon icon-red">
|
| 506 |
+
<i class="fas fa-microscope"></i>
|
| 507 |
+
</div>
|
| 508 |
+
<h3 class="card-title">Disease Detection</h3>
|
| 509 |
+
<p class="card-description">AI-powered plant disease identification with treatment recommendations and prevention tips.</p>
|
| 510 |
+
<button class="card-button btn-accent" onclick="window.open('https://agri-ai-rosy.vercel.app/plant-disease-detector', '_blank')">
|
| 511 |
+
<i class="fas fa-search-plus"></i>
|
| 512 |
+
Scan & Detect
|
| 513 |
+
</button>
|
| 514 |
+
</div>
|
| 515 |
+
|
| 516 |
+
<!-- NEW BUTTON ADDED HERE -->
|
| 517 |
+
|
| 518 |
+
|
| 519 |
+
<div class="feature-card loading-animation" style="background: rgb(255, 255, 255);">
|
| 520 |
+
<div class="success-badge">
|
| 521 |
+
<i class="fas fa-check"></i>
|
| 522 |
+
</div>
|
| 523 |
+
<div class="card-icon icon-green">
|
| 524 |
+
<i class="fas fa-check-circle"></i>
|
| 525 |
+
</div>
|
| 526 |
+
<h3 class="card-title">Record Management</h3>
|
| 527 |
+
<p class="card-description">Track and manage your farm records with intelligent data organization and insights.</p>
|
| 528 |
+
<button class="card-button btn-primary" onclick="window.location.href='/'">
|
| 529 |
+
<i class="fas fa-plus"></i>
|
| 530 |
+
Add New Record
|
| 531 |
+
</button>
|
| 532 |
+
</div>
|
| 533 |
+
</div>
|
| 534 |
+
|
| 535 |
+
|
| 536 |
+
</div>
|
| 537 |
+
|
| 538 |
+
<script>
|
| 539 |
+
// Add some interactive animations
|
| 540 |
+
document.addEventListener('DOMContentLoaded', function() {
|
| 541 |
+
// Animate stats on scroll
|
| 542 |
+
const statValues = document.querySelectorAll('.stat-value');
|
| 543 |
+
statValues.forEach(stat => {
|
| 544 |
+
const finalValue = stat.textContent;
|
| 545 |
+
let currentValue = 0;
|
| 546 |
+
const increment = finalValue.match(/\d+/) / 50;
|
| 547 |
+
|
| 548 |
+
const timer = setInterval(() => {
|
| 549 |
+
currentValue += increment;
|
| 550 |
+
if (currentValue >= finalValue.match(/\d+/)) {
|
| 551 |
+
stat.textContent = finalValue;
|
| 552 |
+
clearInterval(timer);
|
| 553 |
+
} else {
|
| 554 |
+
stat.textContent = Math.floor(currentValue) + finalValue.replace(/\d+/, '');
|
| 555 |
+
}
|
| 556 |
+
}, 50);
|
| 557 |
+
});
|
| 558 |
+
|
| 559 |
+
// Add click ripple effect to buttons
|
| 560 |
+
const buttons = document.querySelectorAll('.card-button');
|
| 561 |
+
buttons.forEach(button => {
|
| 562 |
+
button.addEventListener('click', function(e) {
|
| 563 |
+
const ripple = document.createElement('span');
|
| 564 |
+
const rect = button.getBoundingClientRect();
|
| 565 |
+
const size = Math.max(rect.width, rect.height);
|
| 566 |
+
const x = e.clientX - rect.left - size / 2;
|
| 567 |
+
const y = e.clientY - rect.top - size / 2;
|
| 568 |
+
|
| 569 |
+
ripple.style.cssText = `
|
| 570 |
+
position: absolute;
|
| 571 |
+
border-radius: 50%;
|
| 572 |
+
background: rgba(255, 255, 255, 0.5);
|
| 573 |
+
transform: scale(0);
|
| 574 |
+
animation: ripple 0.6s linear;
|
| 575 |
+
left: ${x}px;
|
| 576 |
+
top: ${y}px;
|
| 577 |
+
width: ${size}px;
|
| 578 |
+
height: ${size}px;
|
| 579 |
+
`;
|
| 580 |
+
|
| 581 |
+
button.appendChild(ripple);
|
| 582 |
+
setTimeout(() => ripple.remove(), 600);
|
| 583 |
+
});
|
| 584 |
+
});
|
| 585 |
+
});
|
| 586 |
+
|
| 587 |
+
// Add ripple animation
|
| 588 |
+
const style = document.createElement('style');
|
| 589 |
+
style.textContent = `
|
| 590 |
+
@keyframes ripple {
|
| 591 |
+
to {
|
| 592 |
+
transform: scale(4);
|
| 593 |
+
opacity: 0;
|
| 594 |
+
}
|
| 595 |
+
}
|
| 596 |
+
`;
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href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
|
| 8 |
+
<style>
|
| 9 |
+
* {
|
| 10 |
+
margin: 0;
|
| 11 |
+
padding: 0;
|
| 12 |
+
box-sizing: border-box;
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
body {
|
| 16 |
+
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
| 17 |
+
line-height: 1.6;
|
| 18 |
+
color: #2d3748;
|
| 19 |
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
| 20 |
+
min-height: 100vh;
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
.container {
|
| 24 |
+
max-width: 1200px;
|
| 25 |
+
margin: 0 auto;
|
| 26 |
+
padding: 1rem;
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
.main-content {
|
| 30 |
+
background: white;
|
| 31 |
+
border-radius: 20px;
|
| 32 |
+
box-shadow: 0 20px 40px rgba(0,0,0,0.1);
|
| 33 |
+
overflow: hidden;
|
| 34 |
+
margin: 2rem auto;
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
.header {
|
| 38 |
+
background: linear-gradient(135deg, #2d5016 0%, #4a7c59 100%);
|
| 39 |
+
color: white;
|
| 40 |
+
padding: 2rem;
|
| 41 |
+
text-align: center;
|
| 42 |
+
position: relative;
|
| 43 |
+
overflow: hidden;
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
.header::before {
|
| 47 |
+
content: '';
|
| 48 |
+
position: absolute;
|
| 49 |
+
top: -50%;
|
| 50 |
+
left: -50%;
|
| 51 |
+
width: 200%;
|
| 52 |
+
height: 200%;
|
| 53 |
+
background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="50" r="1.5" fill="rgba(255,255,255,0.08)"/></svg>');
|
| 54 |
+
animation: float 20s ease-in-out infinite;
|
| 55 |
+
}
|
| 56 |
+
|
| 57 |
+
@keyframes float {
|
| 58 |
+
0%, 100% { transform: translate(0, 0) rotate(0deg); }
|
| 59 |
+
50% { transform: translate(-20px, -20px) rotate(180deg); }
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
.header h1 {
|
| 63 |
+
font-size: clamp(1.8rem, 4vw, 3rem);
|
| 64 |
+
margin-bottom: 0.5rem;
|
| 65 |
+
position: relative;
|
| 66 |
+
z-index: 1;
|
| 67 |
+
}
|
| 68 |
+
|
| 69 |
+
.header .farm-icon {
|
| 70 |
+
font-size: 3rem;
|
| 71 |
+
margin-bottom: 1rem;
|
| 72 |
+
opacity: 0.9;
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
+
.record-info {
|
| 76 |
+
background: #f7fafc;
|
| 77 |
+
padding: 1rem;
|
| 78 |
+
border-left: 4px solid #4a7c59;
|
| 79 |
+
margin: 1rem 2rem;
|
| 80 |
+
border-radius: 8px;
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
.content-wrapper {
|
| 84 |
+
padding: 2rem;
|
| 85 |
+
}
|
| 86 |
+
|
| 87 |
+
.section {
|
| 88 |
+
margin-bottom: 3rem;
|
| 89 |
+
background: #f8fafc;
|
| 90 |
+
border-radius: 15px;
|
| 91 |
+
overflow: hidden;
|
| 92 |
+
box-shadow: 0 4px 6px rgba(0,0,0,0.07);
|
| 93 |
+
transition: transform 0.2s ease;
|
| 94 |
+
}
|
| 95 |
+
|
| 96 |
+
.section:hover {
|
| 97 |
+
transform: translateY(-2px);
|
| 98 |
+
}
|
| 99 |
+
|
| 100 |
+
.section-header {
|
| 101 |
+
background: linear-gradient(90deg, #4a7c59, #5a8a68);
|
| 102 |
+
color: white;
|
| 103 |
+
padding: 1.5rem 2rem;
|
| 104 |
+
display: flex;
|
| 105 |
+
align-items: center;
|
| 106 |
+
gap: 1rem;
|
| 107 |
+
}
|
| 108 |
+
|
| 109 |
+
.section-header i {
|
| 110 |
+
font-size: 1.5rem;
|
| 111 |
+
}
|
| 112 |
+
|
| 113 |
+
.section-header h2 {
|
| 114 |
+
font-size: 1.4rem;
|
| 115 |
+
font-weight: 600;
|
| 116 |
+
}
|
| 117 |
+
|
| 118 |
+
.section-content {
|
| 119 |
+
padding: 2rem;
|
| 120 |
+
}
|
| 121 |
+
|
| 122 |
+
.executive-summary {
|
| 123 |
+
background: linear-gradient(135deg, #e6fffa 0%, #f0fff4 100%);
|
| 124 |
+
}
|
| 125 |
+
|
| 126 |
+
.executive-summary .section-header {
|
| 127 |
+
background: linear-gradient(90deg, #38a169, #48bb78);
|
| 128 |
+
}
|
| 129 |
+
|
| 130 |
+
.summary-text {
|
| 131 |
+
font-size: 1.1rem;
|
| 132 |
+
margin-bottom: 1.5rem;
|
| 133 |
+
color: #2d3748;
|
| 134 |
+
}
|
| 135 |
+
|
| 136 |
+
.recommendation {
|
| 137 |
+
background: linear-gradient(135deg, #bee3f8 0%, #e6fffa 100%);
|
| 138 |
+
padding: 1.5rem;
|
| 139 |
+
border-radius: 10px;
|
| 140 |
+
border-left: 5px solid #3182ce;
|
| 141 |
+
}
|
| 142 |
+
|
| 143 |
+
.recommendation strong {
|
| 144 |
+
color: #2c5282;
|
| 145 |
+
}
|
| 146 |
+
|
| 147 |
+
.plan-table {
|
| 148 |
+
width: 100%;
|
| 149 |
+
border-collapse: collapse;
|
| 150 |
+
margin: 1rem 0;
|
| 151 |
+
background: white;
|
| 152 |
+
border-radius: 10px;
|
| 153 |
+
overflow: hidden;
|
| 154 |
+
box-shadow: 0 4px 6px rgba(0,0,0,0.07);
|
| 155 |
+
}
|
| 156 |
+
|
| 157 |
+
.plan-table th {
|
| 158 |
+
background: linear-gradient(90deg, #2d5016, #4a7c59);
|
| 159 |
+
color: white;
|
| 160 |
+
padding: 1rem;
|
| 161 |
+
text-align: left;
|
| 162 |
+
font-weight: 600;
|
| 163 |
+
font-size: 0.95rem;
|
| 164 |
+
}
|
| 165 |
+
|
| 166 |
+
.plan-table td {
|
| 167 |
+
padding: 1rem;
|
| 168 |
+
border-bottom: 1px solid #e2e8f0;
|
| 169 |
+
vertical-align: top;
|
| 170 |
+
}
|
| 171 |
+
|
| 172 |
+
.plan-table tbody tr:hover {
|
| 173 |
+
background: #f7fafc;
|
| 174 |
+
}
|
| 175 |
+
|
| 176 |
+
.plot-section {
|
| 177 |
+
margin-bottom: 2rem;
|
| 178 |
+
border: 2px solid #e2e8f0;
|
| 179 |
+
border-radius: 12px;
|
| 180 |
+
overflow: hidden;
|
| 181 |
+
}
|
| 182 |
+
|
| 183 |
+
.plot-header {
|
| 184 |
+
background: linear-gradient(90deg, #805ad5, #9f7aea);
|
| 185 |
+
color: white;
|
| 186 |
+
padding: 1rem 1.5rem;
|
| 187 |
+
display: flex;
|
| 188 |
+
align-items: center;
|
| 189 |
+
gap: 0.8rem;
|
| 190 |
+
}
|
| 191 |
+
|
| 192 |
+
.gantt-stage {
|
| 193 |
+
background: linear-gradient(135deg, #48bb78, #38a169);
|
| 194 |
+
color: white;
|
| 195 |
+
padding: 0.4rem 1rem;
|
| 196 |
+
border-radius: 20px;
|
| 197 |
+
font-size: 0.85rem;
|
| 198 |
+
font-weight: 600;
|
| 199 |
+
display: inline-block;
|
| 200 |
+
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
| 201 |
+
}
|
| 202 |
+
|
| 203 |
+
.task-list {
|
| 204 |
+
list-style: none;
|
| 205 |
+
padding: 0;
|
| 206 |
+
}
|
| 207 |
+
|
| 208 |
+
.task-list li {
|
| 209 |
+
padding: 0.5rem 0;
|
| 210 |
+
border-bottom: 1px solid #e2e8f0;
|
| 211 |
+
display: flex;
|
| 212 |
+
align-items: center;
|
| 213 |
+
gap: 0.5rem;
|
| 214 |
+
}
|
| 215 |
+
|
| 216 |
+
.task-list li:last-child {
|
| 217 |
+
border-bottom: none;
|
| 218 |
+
}
|
| 219 |
+
|
| 220 |
+
.task-list li::before {
|
| 221 |
+
content: '\f00c';
|
| 222 |
+
font-family: 'Font Awesome 6 Free';
|
| 223 |
+
font-weight: 900;
|
| 224 |
+
color: #48bb78;
|
| 225 |
+
font-size: 0.8rem;
|
| 226 |
+
}
|
| 227 |
+
|
| 228 |
+
.metrics-list {
|
| 229 |
+
display: grid;
|
| 230 |
+
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
|
| 231 |
+
gap: 1rem;
|
| 232 |
+
}
|
| 233 |
+
|
| 234 |
+
.metric-card {
|
| 235 |
+
background: white;
|
| 236 |
+
padding: 1.5rem;
|
| 237 |
+
border-radius: 10px;
|
| 238 |
+
box-shadow: 0 4px 6px rgba(0,0,0,0.07);
|
| 239 |
+
border-left: 4px solid #4a7c59;
|
| 240 |
+
transition: transform 0.2s ease;
|
| 241 |
+
}
|
| 242 |
+
|
| 243 |
+
.metric-card:hover {
|
| 244 |
+
transform: translateY(-2px);
|
| 245 |
+
}
|
| 246 |
+
|
| 247 |
+
.priority-high {
|
| 248 |
+
background: linear-gradient(135deg, #fed7d7, #feb2b2);
|
| 249 |
+
border-left-color: #e53e3e;
|
| 250 |
+
}
|
| 251 |
+
|
| 252 |
+
.priority-medium {
|
| 253 |
+
background: linear-gradient(135deg, #feebc8, #fbd38d);
|
| 254 |
+
border-left-color: #dd6b20;
|
| 255 |
+
}
|
| 256 |
+
|
| 257 |
+
.priority-low {
|
| 258 |
+
background: linear-gradient(135deg, #c6f6d5, #9ae6b4);
|
| 259 |
+
border-left-color: #38a169;
|
| 260 |
+
}
|
| 261 |
+
|
| 262 |
+
.notes-section {
|
| 263 |
+
background: linear-gradient(135deg, #fff5d6, #fffbeb);
|
| 264 |
+
border: 2px solid #f6e05e;
|
| 265 |
+
border-radius: 15px;
|
| 266 |
+
padding: 2rem;
|
| 267 |
+
margin: 2rem 0;
|
| 268 |
+
}
|
| 269 |
+
|
| 270 |
+
.button-group {
|
| 271 |
+
text-align: center;
|
| 272 |
+
padding: 2rem;
|
| 273 |
+
background: #f8fafc;
|
| 274 |
+
border-top: 1px solid #e2e8f0;
|
| 275 |
+
}
|
| 276 |
+
|
| 277 |
+
.btn {
|
| 278 |
+
display: inline-flex;
|
| 279 |
+
align-items: center;
|
| 280 |
+
gap: 0.5rem;
|
| 281 |
+
padding: 1rem 2rem;
|
| 282 |
+
background: linear-gradient(135deg, #4a7c59, #2d5016);
|
| 283 |
+
color: white;
|
| 284 |
+
text-decoration: none;
|
| 285 |
+
border-radius: 50px;
|
| 286 |
+
font-weight: 600;
|
| 287 |
+
margin: 0.5rem;
|
| 288 |
+
transition: all 0.3s ease;
|
| 289 |
+
box-shadow: 0 4px 15px rgba(74, 124, 89, 0.3);
|
| 290 |
+
}
|
| 291 |
+
|
| 292 |
+
.btn:hover {
|
| 293 |
+
transform: translateY(-2px);
|
| 294 |
+
box-shadow: 0 8px 25px rgba(74, 124, 89, 0.4);
|
| 295 |
+
}
|
| 296 |
+
|
| 297 |
+
.print-button {
|
| 298 |
+
background: linear-gradient(135deg, #3182ce, #2c5282);
|
| 299 |
+
box-shadow: 0 4px 15px rgba(49, 130, 206, 0.3);
|
| 300 |
+
}
|
| 301 |
+
|
| 302 |
+
.print-button:hover {
|
| 303 |
+
box-shadow: 0 8px 25px rgba(49, 130, 206, 0.4);
|
| 304 |
+
}
|
| 305 |
+
|
| 306 |
+
.full-record-ref {
|
| 307 |
+
background: #2d3748;
|
| 308 |
+
color: #e2e8f0;
|
| 309 |
+
padding: 1.5rem;
|
| 310 |
+
border-radius: 10px;
|
| 311 |
+
font-family: 'Courier New', monospace;
|
| 312 |
+
font-size: 0.85rem;
|
| 313 |
+
overflow-x: auto;
|
| 314 |
+
margin: 2rem 0;
|
| 315 |
+
}
|
| 316 |
+
|
| 317 |
+
/* Responsive Design */
|
| 318 |
+
@media (max-width: 768px) {
|
| 319 |
+
.container {
|
| 320 |
+
padding: 0.5rem;
|
| 321 |
+
}
|
| 322 |
+
|
| 323 |
+
.main-content {
|
| 324 |
+
margin: 1rem auto;
|
| 325 |
+
border-radius: 15px;
|
| 326 |
+
}
|
| 327 |
+
|
| 328 |
+
.header {
|
| 329 |
+
padding: 1.5rem 1rem;
|
| 330 |
+
}
|
| 331 |
+
|
| 332 |
+
.content-wrapper {
|
| 333 |
+
padding: 1rem;
|
| 334 |
+
}
|
| 335 |
+
|
| 336 |
+
.section-header {
|
| 337 |
+
padding: 1rem;
|
| 338 |
+
flex-wrap: wrap;
|
| 339 |
+
}
|
| 340 |
+
|
| 341 |
+
.section-content {
|
| 342 |
+
padding: 1rem;
|
| 343 |
+
}
|
| 344 |
+
|
| 345 |
+
.plan-table {
|
| 346 |
+
font-size: 0.85rem;
|
| 347 |
+
}
|
| 348 |
+
|
| 349 |
+
.plan-table th,
|
| 350 |
+
.plan-table td {
|
| 351 |
+
padding: 0.5rem;
|
| 352 |
+
}
|
| 353 |
+
|
| 354 |
+
.btn {
|
| 355 |
+
padding: 0.8rem 1.5rem;
|
| 356 |
+
margin: 0.25rem;
|
| 357 |
+
font-size: 0.9rem;
|
| 358 |
+
}
|
| 359 |
+
|
| 360 |
+
.metrics-list {
|
| 361 |
+
grid-template-columns: 1fr;
|
| 362 |
+
}
|
| 363 |
+
}
|
| 364 |
+
|
| 365 |
+
@media (max-width: 480px) {
|
| 366 |
+
.section-header h2 {
|
| 367 |
+
font-size: 1.1rem;
|
| 368 |
+
}
|
| 369 |
+
|
| 370 |
+
.plan-table {
|
| 371 |
+
font-size: 0.75rem;
|
| 372 |
+
}
|
| 373 |
+
|
| 374 |
+
.plan-table th,
|
| 375 |
+
.plan-table td {
|
| 376 |
+
padding: 0.4rem;
|
| 377 |
+
}
|
| 378 |
+
|
| 379 |
+
.gantt-stage {
|
| 380 |
+
font-size: 0.7rem;
|
| 381 |
+
padding: 0.3rem 0.8rem;
|
| 382 |
+
}
|
| 383 |
+
}
|
| 384 |
+
|
| 385 |
+
@media print {
|
| 386 |
+
.button-group,
|
| 387 |
+
.full-record-ref {
|
| 388 |
+
display: none !important;
|
| 389 |
+
}
|
| 390 |
+
|
| 391 |
+
body {
|
| 392 |
+
background: white !important;
|
| 393 |
+
margin: 0;
|
| 394 |
+
font-size: 12pt;
|
| 395 |
+
}
|
| 396 |
+
|
| 397 |
+
.main-content {
|
| 398 |
+
box-shadow: none !important;
|
| 399 |
+
border-radius: 0 !important;
|
| 400 |
+
margin: 0 !important;
|
| 401 |
+
}
|
| 402 |
+
|
| 403 |
+
.section {
|
| 404 |
+
break-inside: avoid;
|
| 405 |
+
box-shadow: none !important;
|
| 406 |
+
}
|
| 407 |
+
|
| 408 |
+
.section-header {
|
| 409 |
+
background: #2d5016 !important;
|
| 410 |
+
-webkit-print-color-adjust: exact;
|
| 411 |
+
color-adjust: exact;
|
| 412 |
+
}
|
| 413 |
+
|
| 414 |
+
.plan-table th {
|
| 415 |
+
background: #2d5016 !important;
|
| 416 |
+
-webkit-print-color-adjust: exact;
|
| 417 |
+
color-adjust: exact;
|
| 418 |
+
}
|
| 419 |
+
}
|
| 420 |
+
</style>
|
| 421 |
+
</head>
|
| 422 |
+
<body>
|
| 423 |
+
<div class="container">
|
| 424 |
+
<div class="main-content">
|
| 425 |
+
<div class="header">
|
| 426 |
+
<!-- Back button -->
|
| 427 |
+
<div style="margin-top:12px; margin-bottom:12px;">
|
| 428 |
+
<button onclick="history.back()" class="btn" style="background: rgba(255,255,255,0.9); color: #2d3748;">◀ Back</button>
|
| 429 |
+
</div>
|
| 430 |
+
<div class="farm-icon">
|
| 431 |
+
<i class="fas fa-tractor"></i>
|
| 432 |
+
</div>
|
| 433 |
+
<h1>Yearly Farm Plan for {{ plan.executive_summary.farm_name | default(plan.farm_name) }} ({{ plan.executive_summary.year | default(plan.year) }})</h1>
|
| 434 |
+
</div>
|
| 435 |
+
|
| 436 |
+
<div class="record-info">
|
| 437 |
+
<i class="fas fa-file-alt"></i> <strong>Record ID:</strong> {{ record.id }}
|
| 438 |
+
</div>
|
| 439 |
+
|
| 440 |
+
<div class="content-wrapper">
|
| 441 |
+
{% if plan.executive_summary %}
|
| 442 |
+
<div class="section executive-summary">
|
| 443 |
+
<div class="section-header">
|
| 444 |
+
<i class="fas fa-chart-line"></i>
|
| 445 |
+
<h2>Executive Summary</h2>
|
| 446 |
+
</div>
|
| 447 |
+
<div class="section-content">
|
| 448 |
+
<p class="summary-text">{{ plan.executive_summary.summary_paragraph }}</p>
|
| 449 |
+
<div class="recommendation">
|
| 450 |
+
<strong><i class="fas fa-lightbulb"></i> Main Recommendation:</strong> {{ plan.executive_summary.main_recommendation }}
|
| 451 |
+
</div>
|
| 452 |
+
</div>
|
| 453 |
+
</div>
|
| 454 |
+
{% endif %}
|
| 455 |
+
|
| 456 |
+
{% if plan.annual_crop_calendar %}
|
| 457 |
+
<div class="section">
|
| 458 |
+
<div class="section-header">
|
| 459 |
+
<i class="fas fa-calendar-alt"></i>
|
| 460 |
+
<h2>Annual Crop Calendar</h2>
|
| 461 |
+
</div>
|
| 462 |
+
<div class="section-content">
|
| 463 |
+
{% for plot in plan.annual_crop_calendar %}
|
| 464 |
+
<div class="plot-section">
|
| 465 |
+
<div class="plot-header">
|
| 466 |
+
<i class="fas fa-seedling"></i>
|
| 467 |
+
<h3>{{ plot.plot_name | default('Unnamed Plot') }}: {{ plot.crop | default('N/A') }}</h3>
|
| 468 |
+
</div>
|
| 469 |
+
<table class="plan-table">
|
| 470 |
+
<thead>
|
| 471 |
+
<tr>
|
| 472 |
+
<th><i class="fas fa-tasks"></i> Stage</th>
|
| 473 |
+
<th><i class="fas fa-play"></i> Start Date</th>
|
| 474 |
+
<th><i class="fas fa-stop"></i> End Date</th>
|
| 475 |
+
</tr>
|
| 476 |
+
</thead>
|
| 477 |
+
<tbody>
|
| 478 |
+
{% for item in plot.timeline %}
|
| 479 |
+
<tr>
|
| 480 |
+
<td><span class="gantt-stage">{{ item.stage }}</span></td>
|
| 481 |
+
<td>{{ item.start }}</td>
|
| 482 |
+
<td>{{ item.end }}</td>
|
| 483 |
+
</tr>
|
| 484 |
+
{% endfor %}
|
| 485 |
+
</tbody>
|
| 486 |
+
</table>
|
| 487 |
+
</div>
|
| 488 |
+
{% endfor %}
|
| 489 |
+
</div>
|
| 490 |
+
</div>
|
| 491 |
+
{% endif %}
|
| 492 |
+
|
| 493 |
+
{% if plan.irrigation_schedule %}
|
| 494 |
+
<div class="section">
|
| 495 |
+
<div class="section-header">
|
| 496 |
+
<i class="fas fa-tint"></i>
|
| 497 |
+
<h2>Irrigation Schedule</h2>
|
| 498 |
+
</div>
|
| 499 |
+
<div class="section-content">
|
| 500 |
+
<table class="plan-table">
|
| 501 |
+
<thead>
|
| 502 |
+
<tr>
|
| 503 |
+
<th><i class="fas fa-calendar"></i> Month</th>
|
| 504 |
+
<th><i class="fas fa-water"></i> Recommendation</th>
|
| 505 |
+
</tr>
|
| 506 |
+
</thead>
|
| 507 |
+
<tbody>
|
| 508 |
+
{% for item in plan.irrigation_schedule %}
|
| 509 |
+
<tr>
|
| 510 |
+
<td><strong>{{ item.month }}</strong></td>
|
| 511 |
+
<td>{{ item.recommendation }}</td>
|
| 512 |
+
</tr>
|
| 513 |
+
{% endfor %}
|
| 514 |
+
</tbody>
|
| 515 |
+
</table>
|
| 516 |
+
</div>
|
| 517 |
+
</div>
|
| 518 |
+
{% endif %}
|
| 519 |
+
|
| 520 |
+
{% if plan.nutrient_fertilizer_schedule %}
|
| 521 |
+
<div class="section">
|
| 522 |
+
<div class="section-header">
|
| 523 |
+
<i class="fas fa-leaf"></i>
|
| 524 |
+
<h2>Nutrient & Fertilizer Schedule</h2>
|
| 525 |
+
</div>
|
| 526 |
+
<div class="section-content">
|
| 527 |
+
<table class="plan-table">
|
| 528 |
+
<thead>
|
| 529 |
+
<tr>
|
| 530 |
+
<th><i class="fas fa-grow"></i> Crop Stage</th>
|
| 531 |
+
<th><i class="fas fa-prescription-bottle"></i> Recommendation</th>
|
| 532 |
+
</tr>
|
| 533 |
+
</thead>
|
| 534 |
+
<tbody>
|
| 535 |
+
{% for item in plan.nutrient_fertilizer_schedule %}
|
| 536 |
+
<tr>
|
| 537 |
+
<td><strong>{{ item.crop_stage }}</strong></td>
|
| 538 |
+
<td>{{ item.recommendation }}</td>
|
| 539 |
+
</tr>
|
| 540 |
+
{% endfor %}
|
| 541 |
+
</tbody>
|
| 542 |
+
</table>
|
| 543 |
+
</div>
|
| 544 |
+
</div>
|
| 545 |
+
{% endif %}
|
| 546 |
+
|
| 547 |
+
{% if plan.pest_disease_monitoring_plan %}
|
| 548 |
+
<div class="section">
|
| 549 |
+
<div class="section-header">
|
| 550 |
+
<i class="fas fa-bug"></i>
|
| 551 |
+
<h2>Pest & Disease Monitoring Plan</h2>
|
| 552 |
+
</div>
|
| 553 |
+
<div class="section-content">
|
| 554 |
+
<table class="plan-table">
|
| 555 |
+
<thead>
|
| 556 |
+
<tr>
|
| 557 |
+
<th><i class="fas fa-calendar"></i> Month</th>
|
| 558 |
+
<th><i class="fas fa-crosshairs"></i> Target</th>
|
| 559 |
+
<th><i class="fas fa-search"></i> Monitoring</th>
|
| 560 |
+
<th><i class="fas fa-shield-alt"></i> IPM Action</th>
|
| 561 |
+
<th><i class="fas fa-spray-can"></i> Pesticide</th>
|
| 562 |
+
</tr>
|
| 563 |
+
</thead>
|
| 564 |
+
<tbody>
|
| 565 |
+
{% for item in plan.pest_disease_monitoring_plan %}
|
| 566 |
+
<tr>
|
| 567 |
+
<td><strong>{{ item.month }}</strong></td>
|
| 568 |
+
<td>{{ item.target }}</td>
|
| 569 |
+
<td>{{ item.monitoring }}</td>
|
| 570 |
+
<td>{{ item.IPM_action }}</td>
|
| 571 |
+
<td>{{ item.pesticide_name | default('N/A') }}</td>
|
| 572 |
+
</tr>
|
| 573 |
+
{% endfor %}
|
| 574 |
+
</tbody>
|
| 575 |
+
</table>
|
| 576 |
+
</div>
|
| 577 |
+
</div>
|
| 578 |
+
{% endif %}
|
| 579 |
+
|
| 580 |
+
{% if plan.labour_operations_calendar %}
|
| 581 |
+
<div class="section">
|
| 582 |
+
<div class="section-header">
|
| 583 |
+
<i class="fas fa-users"></i>
|
| 584 |
+
<h2>Labour & Operations Calendar</h2>
|
| 585 |
+
</div>
|
| 586 |
+
<div class="section-content">
|
| 587 |
+
<table class="plan-table">
|
| 588 |
+
<thead>
|
| 589 |
+
<tr>
|
| 590 |
+
<th><i class="fas fa-calendar"></i> Month</th>
|
| 591 |
+
<th><i class="fas fa-tasks"></i> Tasks</th>
|
| 592 |
+
<th><i class="fas fa-exclamation-triangle"></i> Peak Demand</th>
|
| 593 |
+
</tr>
|
| 594 |
+
</thead>
|
| 595 |
+
<tbody>
|
| 596 |
+
{% for item in plan.labour_operations_calendar %}
|
| 597 |
+
<tr>
|
| 598 |
+
<td><strong>{{ item.month }}</strong></td>
|
| 599 |
+
<td>
|
| 600 |
+
<ul class="task-list">
|
| 601 |
+
{% for task in item.tasks %}
|
| 602 |
+
<li>{{ task }}</li>
|
| 603 |
+
{% endfor %}
|
| 604 |
+
</ul>
|
| 605 |
+
</td>
|
| 606 |
+
<td>{{ item.peak_demand }}</td>
|
| 607 |
+
</tr>
|
| 608 |
+
{% endfor %}
|
| 609 |
+
</tbody>
|
| 610 |
+
</table>
|
| 611 |
+
</div>
|
| 612 |
+
</div>
|
| 613 |
+
{% endif %}
|
| 614 |
+
|
| 615 |
+
{% if plan.input_procurement_budget_timeline %}
|
| 616 |
+
<div class="section">
|
| 617 |
+
<div class="section-header">
|
| 618 |
+
<i class="fas fa-shopping-cart"></i>
|
| 619 |
+
<h2>Input Procurement & Budget Timeline</h2>
|
| 620 |
+
</div>
|
| 621 |
+
<div class="section-content">
|
| 622 |
+
<table class="plan-table">
|
| 623 |
+
<thead>
|
| 624 |
+
<tr>
|
| 625 |
+
<th><i class="fas fa-box"></i> Item</th>
|
| 626 |
+
<th><i class="fas fa-sort-numeric-up"></i> Quantity</th>
|
| 627 |
+
<th><i class="fas fa-dollar-sign"></i> Estimated Cost</th>
|
| 628 |
+
<th><i class="fas fa-calendar-plus"></i> Procurement Month</th>
|
| 629 |
+
</tr>
|
| 630 |
+
</thead>
|
| 631 |
+
<tbody>
|
| 632 |
+
{% for item in plan.input_procurement_budget_timeline %}
|
| 633 |
+
<tr>
|
| 634 |
+
<td><strong>{{ item.item }}</strong></td>
|
| 635 |
+
<td>{{ item.quantity }}</td>
|
| 636 |
+
<td>{{ item.estimated_cost }}</td>
|
| 637 |
+
<td>{{ item.procurement_month }}</td>
|
| 638 |
+
</tr>
|
| 639 |
+
{% endfor %}
|
| 640 |
+
</tbody>
|
| 641 |
+
</table>
|
| 642 |
+
</div>
|
| 643 |
+
</div>
|
| 644 |
+
{% endif %}
|
| 645 |
+
|
| 646 |
+
{% if plan.market_sales_guidance %}
|
| 647 |
+
<div class="section">
|
| 648 |
+
<div class="section-header">
|
| 649 |
+
<i class="fas fa-store"></i>
|
| 650 |
+
<h2>Market & Sales Guidance</h2>
|
| 651 |
+
</div>
|
| 652 |
+
<div class="section-content">
|
| 653 |
+
<table class="plan-table">
|
| 654 |
+
<thead>
|
| 655 |
+
<tr>
|
| 656 |
+
<th><i class="fas fa-apple-alt"></i> Crop/Product</th>
|
| 657 |
+
<th><i class="fas fa-compass"></i> Guidance</th>
|
| 658 |
+
</tr>
|
| 659 |
+
</thead>
|
| 660 |
+
<tbody>
|
| 661 |
+
{% for item in plan.market_sales_guidance %}
|
| 662 |
+
<tr>
|
| 663 |
+
<td><strong>{{ item.crop_product }}</strong></td>
|
| 664 |
+
<td>{{ item.guidance }}</td>
|
| 665 |
+
</tr>
|
| 666 |
+
{% endfor %}
|
| 667 |
+
</tbody>
|
| 668 |
+
</table>
|
| 669 |
+
</div>
|
| 670 |
+
</div>
|
| 671 |
+
{% endif %}
|
| 672 |
+
|
| 673 |
+
{% if plan.sensors_monitoring_plan %}
|
| 674 |
+
<div class="section">
|
| 675 |
+
<div class="section-header">
|
| 676 |
+
<i class="fas fa-satellite-dish"></i>
|
| 677 |
+
<h2>Sensors & Monitoring Plan</h2>
|
| 678 |
+
</div>
|
| 679 |
+
<div class="section-content">
|
| 680 |
+
<table class="plan-table">
|
| 681 |
+
<thead>
|
| 682 |
+
<tr>
|
| 683 |
+
<th><i class="fas fa-microchip"></i> Sensor</th>
|
| 684 |
+
<th><i class="fas fa-bullseye"></i> Purpose</th>
|
| 685 |
+
<th><i class="fas fa-clock"></i> Frequency</th>
|
| 686 |
+
<th><i class="fas fa-bell"></i> Alert Threshold</th>
|
| 687 |
+
<th><i class="fas fa-cogs"></i> Action</th>
|
| 688 |
+
</tr>
|
| 689 |
+
</thead>
|
| 690 |
+
<tbody>
|
| 691 |
+
{% for item in plan.sensors_monitoring_plan %}
|
| 692 |
+
<tr>
|
| 693 |
+
<td><strong>{{ item.sensor }}</strong></td>
|
| 694 |
+
<td>{{ item.purpose }}</td>
|
| 695 |
+
<td>{{ item.frequency }}</td>
|
| 696 |
+
<td>{{ item.alert_threshold }}</td>
|
| 697 |
+
<td>{{ item.action }}</td>
|
| 698 |
+
</tr>
|
| 699 |
+
{% endfor %}
|
| 700 |
+
</tbody>
|
| 701 |
+
</table>
|
| 702 |
+
</div>
|
| 703 |
+
</div>
|
| 704 |
+
{% endif %}
|
| 705 |
+
|
| 706 |
+
{% if plan.risk_contingency_plan %}
|
| 707 |
+
<div class="section">
|
| 708 |
+
<div class="section-header">
|
| 709 |
+
<i class="fas fa-shield-alt"></i>
|
| 710 |
+
<h2>Risk & Contingency Plan</h2>
|
| 711 |
+
</div>
|
| 712 |
+
<div class="section-content">
|
| 713 |
+
<table class="plan-table">
|
| 714 |
+
<thead>
|
| 715 |
+
<tr>
|
| 716 |
+
<th><i class="fas fa-exclamation-triangle"></i> Risk</th>
|
| 717 |
+
<th><i class="fas fa-chess"></i> Strategy</th>
|
| 718 |
+
</tr>
|
| 719 |
+
</thead>
|
| 720 |
+
<tbody>
|
| 721 |
+
{% for item in plan.risk_contingency_plan %}
|
| 722 |
+
<tr>
|
| 723 |
+
<td><strong>{{ item.risk }}</strong></td>
|
| 724 |
+
<td>{{ item.strategy }}</td>
|
| 725 |
+
</tr>
|
| 726 |
+
{% endfor %}
|
| 727 |
+
</tbody>
|
| 728 |
+
</table>
|
| 729 |
+
</div>
|
| 730 |
+
</div>
|
| 731 |
+
{% endif %}
|
| 732 |
+
|
| 733 |
+
{% if plan.tasks_reminders %}
|
| 734 |
+
<div class="section">
|
| 735 |
+
<div class="section-header">
|
| 736 |
+
<i class="fas fa-clipboard-list"></i>
|
| 737 |
+
<h2>Tasks & Reminders</h2>
|
| 738 |
+
</div>
|
| 739 |
+
<div class="section-content">
|
| 740 |
+
<table class="plan-table">
|
| 741 |
+
<thead>
|
| 742 |
+
<tr>
|
| 743 |
+
<th><i class="fas fa-hashtag"></i> Task ID</th>
|
| 744 |
+
<th><i class="fas fa-calendar-check"></i> Due Date</th>
|
| 745 |
+
<th><i class="fas fa-play"></i> Action</th>
|
| 746 |
+
<th><i class="fas fa-flag"></i> Priority</th>
|
| 747 |
+
</tr>
|
| 748 |
+
</thead>
|
| 749 |
+
<tbody>
|
| 750 |
+
{% for item in plan.tasks_reminders %}
|
| 751 |
+
<tr class="{% if item.priority == 'High' %}priority-high{% elif item.priority == 'Medium' %}priority-medium{% else %}priority-low{% endif %}">
|
| 752 |
+
<td>{{ item.task_id }}</td>
|
| 753 |
+
<td>{{ item.due_date }}</td>
|
| 754 |
+
<td>{{ item.action }}</td>
|
| 755 |
+
<td>
|
| 756 |
+
<span class="gantt-stage">
|
| 757 |
+
{% if item.priority == 'High' %}<i class="fas fa-exclamation"></i>{% elif item.priority == 'Medium' %}<i class="fas fa-minus"></i>{% else %}<i class="fas fa-arrow-down"></i>{% endif %}
|
| 758 |
+
{{ item.priority }}
|
| 759 |
+
</span>
|
| 760 |
+
</td>
|
| 761 |
+
</tr>
|
| 762 |
+
{% endfor %}
|
| 763 |
+
</tbody>
|
| 764 |
+
</table>
|
| 765 |
+
</div>
|
| 766 |
+
</div>
|
| 767 |
+
{% endif %}
|
| 768 |
+
|
| 769 |
+
{% if plan.metrics_evaluation %}
|
| 770 |
+
<div class="section">
|
| 771 |
+
<div class="section-header">
|
| 772 |
+
<i class="fas fa-chart-bar"></i>
|
| 773 |
+
<h2>Metrics & Evaluation (KPIs)</h2>
|
| 774 |
+
</div>
|
| 775 |
+
<div class="section-content">
|
| 776 |
+
<div class="metrics-list">
|
| 777 |
+
{% for item in plan.metrics_evaluation %}
|
| 778 |
+
<div class="metric-card">
|
| 779 |
+
<i class="fas fa-chart-pie"></i> {{ item }}
|
| 780 |
+
</div>
|
| 781 |
+
{% endfor %}
|
| 782 |
+
</div>
|
| 783 |
+
</div>
|
| 784 |
+
</div>
|
| 785 |
+
{% endif %}
|
| 786 |
+
|
| 787 |
+
{% if plan.notes %}
|
| 788 |
+
<div class="notes-section">
|
| 789 |
+
<h2><i class="fas fa-sticky-note"></i> Notes</h2>
|
| 790 |
+
<p>{{ plan.notes }}</p>
|
| 791 |
+
</div>
|
| 792 |
+
{% endif %}
|
| 793 |
+
|
| 794 |
+
<h3 class="full-record-ref"><i class="fas fa-code"></i> Full Record for Reference:</h3>
|
| 795 |
+
<pre class="full-record-ref">{{ record | tojson(indent=2) }}</pre>
|
| 796 |
+
</div>
|
| 797 |
+
|
| 798 |
+
<div class="button-group">
|
| 799 |
+
<a href="/" class="btn">
|
| 800 |
+
<i class="fas fa-plus"></i>
|
| 801 |
+
Add Another Record
|
| 802 |
+
</a>
|
| 803 |
+
<button class="btn print-button" onclick="window.print()">
|
| 804 |
+
<i class="fas fa-print"></i>
|
| 805 |
+
Print / Save as PDF
|
| 806 |
+
</button>
|
| 807 |
+
</div>
|
| 808 |
+
</div>
|
| 809 |
+
</div>
|
| 810 |
+
</body>
|
| 811 |
+
</html>
|