Пример #1
0
    function data($list)
    {
        Main::includeClass('AdminPageData');
        $apd = new AdminPageData();
        $apd->header();
        ?>
				<form name="selectForm" action="" method="post">
						<legend>Select Name</legend>
						<select name="update">
						<?php 
        if (empty($list)) {
            echo "<option value=''>None</option>";
        } else {
            if (is_array($list)) {
                foreach ($list as $value) {
                    echo "<option value='{$value}'>{$value}</option>";
                }
            } else {
                echo "<option value='{$list}'>{$list}</option>";
            }
        }
        ?>
						</select><br />
						<input type="submit" name="select_action" value="Update" />
				</form>
	<?php 
        $apd->content();
    }
Пример #2
0
 function handle()
 {
     if (key_exists('CATEGORY', $this->comp)) {
         $cat = strtolower($this->comp["CATEGORY"]);
     } else {
         $cat = 'home';
     }
     if (!isset($_SESSION)) {
         session_start();
     }
     if (!isset($_SESSION['admin'])) {
         $cat = 'login';
     } else {
         if ($cat == 'login') {
             $cat = 'home';
         }
     }
     switch ($cat) {
         case 'add':
             Main::includeClass('AddHandler');
             $ah = new AddHandler($this->comp);
             break;
         case 'remove':
             Main::includeClass('RemoveHandler');
             $rh = new RemoveHandler($this->comp);
             break;
         case 'update':
             Main::includeClass('UpdateHandler');
             $uh = new UpdateHandler($this->comp);
             break;
         case 'login':
             Main::includeClass('LoginHandler');
             $lh = new LoginHandler();
             Main::includeClass('TemplateData');
             $td = new TemplateData($lh);
         case 'logout':
             if (Main::isAdminLoggedIn()) {
                 if (!isset($_SESSION)) {
                     @session_start();
                 }
                 $_SESSION['admin'] = NULL;
                 unset($_SESSION['admin']);
                 echo header("Location: " . Settings::SITEURL . "admin/");
             }
             break;
         case 'details':
             Main::includeClass('DetailsHandler');
             $dh = new DetailsHandler($this->comp);
             break;
         case 'home':
         default:
             Main::includeClass('AdminHomeData');
             $adh = new AdminHomeData();
             Main::includeClass('TemplateData');
             $td = new TemplateData($adh);
             break;
     }
 }
Пример #3
0
    function data()
    {
        Main::includeClass('AdminPageData');
        $apd = new AdminPageData();
        $apd->header('Publication', "{$this->section} Message");
        ?>
		<?php 
        $apd->content();
    }
Пример #4
0
 function display()
 {
     Main::includeClass('HomePageData');
     $hpd = new HomePageData();
     $hpd->header();
     $hpd->banner();
     $hpd->content();
     $hpd->footer();
 }
Пример #5
0
 function display($page, $details = NULL, $list = FALSE)
 {
     Main::includeClass($page);
     $page = new $page($details);
     if ($list) {
         $page->printList();
     } else {
         $page->details();
     }
 }
Пример #6
0
 function __construct()
 {
     $uri = $_SERVER['REQUEST_URI'];
     if (!class_exists('Main')) {
         if (file_exists('Main.php')) {
             include 'Main.php';
         } else {
             throw new Exception('File Not Found');
         }
     }
     Main::includeClass('RequestHandler');
     $reqHandler = new RequestHandler($uri);
 }
Пример #7
0
 function openConnection()
 {
     Main::includeClass('Settings');
     if (self::$con == FALSE) {
         self::$con = mysql_connect(Settings::HOST, Settings::USER, Settings::PASS);
         if (self::$con) {
             mysql_select_db(Settings::DB, self::$con) or self::throwException('Internal Error Occured', 0, 'Database Not Found' . " " . mysql_error());
             return TRUE;
         } else {
             self::throwException('Internal Error Occured', 0, 'Failed To Connect To MySql Server' . " " . mysql_error());
         }
     }
 }
Пример #8
0
 function parse()
 {
     if (!empty($this->season)) {
         Main::includeClass('Details');
         $details = Details::getDetailsContains('at_crop', array('name', 'details'), array('climate' => $this->season));
         Main::includeClass('SeasonCalculatorData');
         Main::includeClass('TemplateData');
         $scd = new SeasonCalculatorData($details, $this->season);
         $td = new TemplateData($scd);
     } else {
         Main::includeClass('SeasonCalculatorForm');
         Main::includeClass('TemplateData');
         $scf = new SeasonCalculatorForm($details);
         $td = new TemplateData($scf);
     }
 }
Пример #9
0
    function content()
    {
        ?>
		<div id='conctactleft'>
				<h4><?php 
        echo "{$this->section} Crop";
        ?>
</h4>
		<div class='success-message'>
			<?php 
        echo "Crop {$this->section}ed Successfully";
        ?>
		</div>
		<div id='maincontactform'>
			<form name='<?php 
        echo $this->formName;
        ?>
' id='cropForm' method='post' action='' enctype="multipart/form-data">
				<div>
					<label for='name'>Name</label>
					<input type='text' name='name' id='name' class='textfield' value='<?php 
        echo $this->info['name'];
        ?>
' />
					<span class="require"> *</span>
					<label for="sci_name">Scientific Name</label>
					<input type="text" name="sci_name" id="sci_name" class='textfield' value='<?php 
        echo $this->info['sci_name'];
        ?>
' />
					<span class="require"> *</span>
					<label for="climate">Climate</label>
					<select name='climate[]' id='climate' class='selectfield' multiple='multiple'>
						<option value='summer'>Summer</option>
						<option value='winter'>Winter</option>
						<option value='spring'>Spring</option>
						<option value='autumn'>Autumn</option>
					</select>
					<label for='soil'>Soil Types</label>
					<textarea name='soil' id='soil' class='textarea'><?php 
        echo $this->info['soil'];
        ?>
</textarea>
					<span class="require"> *</span>
					<label for='variaties'>Variaties</label>
					<textarea name='variaties' id='variaties' class='textarea'><?php 
        echo $this->info['variaties'];
        ?>
</textarea>
					<span class="require"> *</span>
					<label for='dur'>Duration</label>
					<input type='text' name='dur' id='dur' class='textfield' value='<?php 
        echo $this->info['dur'];
        ?>
' />
					<label for='diseases'>Diseases</label>
					<textarea name='diseases' id='diseases' class='textarea'><?php 
        echo $this->info['diseases'];
        ?>
</textarea>
					<span class="require"> *</span>
					<label for='bio_fert'>Bio Fertilizers</label>
					<?php 
        Main::includeClass('Details');
        $det = Details::getDetails('at_bio_fert', 'name', NULL, TRUE);
        if (empty($det) || !is_array($det)) {
            echo "<select name='bio_fert' id='bio_fert' class='selectfield'>";
            echo '<option value="">None</option>';
        } else {
            echo "<select multiple='multiple' name='bio_fert[]' id='bio_fert' class='selectfield'>";
            foreach ($det as $val) {
                if (in_array($val, $this->info['bio_fert'])) {
                    echo "<option value='{$val}' selected='true'>{$val}</option>";
                } else {
                    echo "<option value='{$val}'>{$val}</option>";
                }
            }
        }
        ?>
					</select>
					<label for='market_price'>Market Price</label>
					<input type='text' name='market_price' id='market_price' class='textfield' value='<?php 
        echo $this->info['market_price'];
        ?>
' />
					<span class="require"> *</span>
					<label for="details">Details</label>
					<textarea name='details' id='details' class='textarea'><?php 
        echo $this->info['details'];
        ?>
</textarea>
					<span class="require"> *</span>
					<label for="type">Crop Type</label>
					<select name='type' id='type' class='selectfield'>
					<?php 
        $det = Details::getDetails('at_crop_types', 'name', NULL, TRUE);
        if (empty($det)) {
            echo '<option value="">None</option>';
        } else {
            if (is_array($det)) {
                foreach ($det as $val) {
                    if ($this->type == $val) {
                        echo "<option value='{$val}' selected='selected'>{$val}</option>";
                    } else {
                        echo "<option value='{$val}'>{$val}</option>";
                    }
                }
            } else {
                if ($this->type == $det) {
                    echo "<option value='{$det}' selected='selected'>{$det}</option>";
                } else {
                    echo "<option value='{$det}'>{$det}</option>";
                }
            }
        }
        ?>
					</select>
					<span class="require"> *</span>
					<label for='pests'>Pests</label>
					<?php 
        $det = Details::getDetails('at_crop_pests', 'name', NULL, TRUE);
        if (empty($det) || !is_array($det)) {
            echo "<select name='pests' id='pests' class='selectfield'>";
            echo '<option value="">None</option>';
        } else {
            echo "<select multiple='multiple' name='pests[]' id='pest' class='selectfield'>";
            foreach ($det as $val) {
                if (in_array($val, $this->info['pests'])) {
                    echo "<option value='{$val}' selected='true'>{$val}</option>";
                } else {
                    echo "<option value='{$val}'>{$val}</option>";
                }
            }
        }
        ?>
					<label for="file">Crop Image</label>
					<input type="file" name="file" id="file" />
					<input type="hidden" name="image" id='image' value='' />
					<div class='clear'></div>
					<?php 
        //echo '<a href="#" class="button" id="cropsend"><span>'.$this->section.'</span></a> <span class="loading" style="display: none;">Please wait..</span>';
        if ($this->section == 'Update') {
            echo "<input type='hidden' name='update_name' id='update_name' value='{$this->info['update']}' />";
        }
        ?>
					<input type="submit" name="action" class='button' value='Add Crop' />
				</div>
			</form>
		</div>
	</div>
	<?php 
    }
Пример #10
0
 function handle($section)
 {
     switch ($section) {
         case 'crop':
             $table = 'at_crop';
             $fields = array('name', 'sci_name', 'climate', 'soil', 'variaties', 'dur', 'diseases', 'bio_fert', 'market_price', 'details', 'type');
             $req = array('name', 'type');
             $page = 'CropData';
             $temp['cond'] = 'name';
             break;
         case 'contact':
             $table = 'at_contact_info';
             $fields = array('name', 'type', 'code', 'number', 'district', 'location');
             $req = array('number', 'name', 'district');
             $page = 'ContactData';
             $temp['cond'] = 'name';
             break;
         case 'croptype':
             $table = 'at_crop';
             $fields = array('name', 'details');
             $req = array('name');
             $page = 'CropTypeData';
             $temp['cond'] = 'name';
             break;
         case 'news':
             $table = 'at_news';
             $fields = array('news', 'date', 'time');
             $req = array('news', 'date', 'time');
             $page = 'NewsData';
             $temp['cond'] = 'date';
             break;
         case 'map':
             $table = 'at_map';
             $fields = array('news', 'date', 'time');
             $req = array('news', 'date', 'time');
             $page = 'MapData';
             break;
         case 'magazine':
             $table = 'at_magazine';
             $fields = array('name', 'type', 'annual_price', 'single_price', 'lifetime_price');
             $req = array('name', 'type');
             $page = 'MagazineData';
             $temp['cond'] = 'name';
             break;
         case 'award':
             $table = 'at_awards';
             $fields = array('level', 'name', 'details', 'year');
             $req = array('name', 'level');
             $page = 'AwardsData';
             $temp['cond'] = 'name';
             break;
         case 'disease':
             $table = 'at_crop_disease';
             $fields = array('name', 'control');
             $req = array('name');
             $page = 'DiseaseData';
             $temp['cond'] = 'name';
             break;
         case 'location':
             $table = 'at_location';
             $fields = array('name', 'desc', 'cli', 'soil', 'crops', 'landuse', 'geo_area', 'land_forest', 'land_sown', 'wells_irrigated_area', 'tanks_irrigated_area', 'other_irrigated_area', 'canals_irrigated_area', 'net_irrigated_area', 'gross_irrigated_area', 'type');
             $req = array('name', 'type');
             $page = 'LocationData';
             $temp['cond'] = 'name';
             break;
         case 'publication':
             $table = 'at_publication';
             $fields = array('title', 'year', 'author', 'publisher', 'price');
             $req = array('title');
             $page = 'PublicationData';
             $temp['cond'] = 'title';
             break;
         case 'link':
             $table = 'at_links';
             $fields = array('name', 'url', 'details');
             $req = array('name', 'url', 'details');
             $page = 'LinksData';
             $temp['cond'] = 'name';
             break;
         case 'biofert':
             $table = 'at_bio_fert';
             $fields = array('name', 'details', 'price');
             $req = array('name', 'details', 'price');
             $page = 'BioFertData';
             $temp['cond'] = 'name';
             break;
         case 'insurance':
             $table = 'at_crop_insurance';
             $fields = array('crop', 'no', 'age', 'premium', 'compensation');
             $req = array('crop', 'premium', 'compensation');
             $page = 'CropInsuranceData';
             $temp['cond'] = 'crop';
             break;
         case 'prevactivity':
             $table = 'at_prev_activity';
             $fields = array('year', 'activity', 'location');
             $req = array('year', 'activity', 'location');
             $page = 'PrevActivityData';
             $temp['cond'] = 'year';
             break;
         case 'patent':
             $table = 'at_patents';
             $fields = array('name', 'holders', 'year', 'no');
             $req = array('name', 'holders', 'no');
             $page = 'PatentsData';
             $temp['cond'] = 'name';
         case 'default':
             echo header("Location: " . Settings::SITEURL . "admin/");
     }
     if (isset($table) && isset($temp['cond'])) {
         $cond = array($temp['cond'] => $this->name);
         Main::includeClass('Remove');
         $remove = new Remove('*', $table, $cond);
         echo header("Location: " . Settings::SITEURL . "{$this->section}/");
     }
 }
Пример #11
0
 function __construct($comp)
 {
     switch (strtolower($comp['SECTION'])) {
         case 'crop':
         case 'awards':
         case 'biofert':
         case 'disease':
         case 'insurance':
         case 'croptype':
         case 'links':
         case 'magazine':
         case 'news':
         case 'patents':
         case 'publication':
             if (key_exists('CATEGORY', $comp)) {
                 $comp['CATEGORY'] = str_replace('%20', ' ', $comp['CATEGORY']);
                 Main::includeClass('SinglePage');
                 $sp = new SinglePage($comp);
                 Main::includeClass('TemplateData');
                 $td = new TemplateData($sp);
             } else {
                 Main::includeClass('ListPage');
                 $lp = new ListPage($comp);
                 Main::includeClass('TemplateData');
                 $td = new TemplateData($lp);
             }
             break;
         case 'office':
             if (key_exists('QUERY', $comp)) {
                 Main::includeClass('SinglePage');
                 $sp = new SinglePage($comp);
                 Main::includeClass('TemplateData');
                 $td = new TemplateData($sp);
             } else {
                 Main::includeClass('ListPage');
                 $lp = new ListPage($comp);
                 Main::includeClass('TemplateData');
                 $td = new TemplateData($lp);
             }
             break;
         case 'location':
             if (key_exists('CATEGORY', $comp)) {
                 Main::includeClass('SinglePage');
                 $sp = new SinglePage($comp);
                 Main::includeClass('TemplateData');
                 $td = new TemplateData($sp);
             } else {
                 Main::includeClass('ListPage');
                 $lp = new ListPage($comp);
                 Main::includeClass('TemplateData');
                 $td = new TemplateData($lp);
             }
             break;
         case 'map':
             if (key_exists('QUERY', $comp)) {
                 Main::includeClass('SinglePage');
                 $lp = new SinglePage($comp);
                 Main::includeClass('TemplateData');
                 $td = new TemplateData($lp);
             } else {
                 Main::includeClass('ListPage');
                 $lp = new ListPage($comp);
                 Main::includeClass('TemplateData');
                 $td = new TemplateData($lp);
             }
             break;
         case 'prevactivity':
             if (key_exists('SUBCATEGORY', $comp)) {
                 Main::includeClass('SinglePage');
                 $sp = new SinglePage($comp);
                 Main::includeClass('TemplateData');
                 $td = new TemplateData($sp);
             } else {
                 Main::includeClass('ListPage');
                 $lp = new ListPage($comp);
                 Main::includeClass('TemplateData');
                 $td = new TemplateData($lp);
             }
             break;
         default:
             Main::includeClass('HomeData');
             $hpd = new HomeData();
             Main::includeClass('TemplateData');
             $td = new TemplateData($hpd);
             break;
     }
 }
Пример #12
0
 function display($form)
 {
     Main::includeClass($form);
     $obj = new $form();
     Main::includeClass('TemplateData');
     $td = new TemplateData($obj);
 }
Пример #13
0
    function content()
    {
        ?>
			<div id='conctactleft'>
				<h4><?php 
        echo "{$this->section} Insurance";
        ?>
</h4>
		<div class='success-message'>
			<?php 
        echo "Insurance {$this->section}ed Successfully";
        ?>
		</div>
		<div id='maincontactform'>
			<form name='<?php 
        echo $this->formName;
        ?>
' id='insuranceForm' method='post' action=''>
				<div>
					<label for='crop'>Crop</label>
					<select name='crop' id='crop' class='selectfield'>
						<?php 
        Main::includeClass('Details');
        $det = Details::getDetails('at_crop', 'name', NULL, TRUE);
        if (is_array($det) && !empty($det)) {
            foreach ($det as $data) {
                echo "<option value={$data}>{$data}</option>";
            }
        } else {
            echo "<option value=''>None</option>";
        }
        ?>
					</select>
					<span class="require"> *</span>
					<label for="no">Number</label>
					<input type="text" name="no" id="no" class='textfield' value='<?php 
        echo $this->info['no'];
        ?>
' />
					<span class="require"> *</span>
					<label for="age">Age</label>
					<input type="text" name="age" id="age" class='textfield' value='<?php 
        echo $this->info['age'];
        ?>
' />
					<label for='premium'>Premium</label>
					<input type="text" name='premium' id='premium' class='textfield'value='<?php 
        echo $this->info['premium'];
        ?>
' />
					<span class="require"> *</span>
					<label for='compensation'>Compensation</label>
					<input type='text' name='compensation' id='compensation' class='textfield' value='<?php 
        echo $this->info['compensation'];
        ?>
' />
					<span class="require"> *</span>
					<div class='clear'></div>
					<?php 
        if ($this->section == 'Update') {
            echo "<input type='hidden' name='update_name' id='update_name' value='{$this->info['update']}' />";
        }
        ?>
					<input type="submit" name="action" value="Add Insurance" class='button' />
				</div>
			</form>
		</div>
	</div>
		<?php 
    }
Пример #14
0
    function printList()
    {
        Main::includeClass('DetailsData');
        $dd = new DetailsData();
        $dd->header();
        if (!is_array($this->details) || empty($this->details)) {
            echo '<h3> No Data Found</h3>';
        } else {
            ?>
		<ul id="listlatestnews">

		<?php 
            foreach ($this->details as $value) {
                ?>
				<li>
				<div class="boximg-blog">
				<div class="blogimage"> <img alt="" class="boximg-pad" /></div>
				</div>
				<div class="postbox class="post-176 post type-post status-publish format-standard hentry category-blog"">

				<h3><a href="http://localhost/details/crop/<?php 
                echo $value;
                ?>
"><?php 
                echo $value;
                ?>
</a></h3>
				</div>
				<div class="clear"></div>
				</li>
			<?php 
            }
            ?>
		</ul>
		<div class="clear"></div>
		<?php 
        }
        $dd->content();
    }
Пример #15
0
    function parse()
    {
        Main::includeClass('Details');
        switch (strtolower($this->section)) {
            case 'crop':
                Main::includeClass('Details');
                $details = Details::getDetails('at_crop', '*', array('name' => $this->name));
                //print_r($details);
                if (empty($details)) {
                    $this->content = array('Error' => 'No Data Found');
                } else {
                    foreach ($details as $det) {
                        $this->content['Name'] = $det['name'];
                        $this->content['Scientific_Name'] = $det['sci_name'];
                        $this->content['Climate'] = str_replace('=:=', '<br />', $det['climate']);
                        $this->content['Soil'] = $det['soil'];
                        $this->content['Varieties'] = $det['variaties'];
                        $this->content['Duration'] = $det['dur'];
                        $this->content['Diseases'] = $det['diseases'];
                        $this->content['Bio_Fertilizer'] = $det['bio_fert'];
                        $this->content['Market_Price'] = $det['market_price'];
                        $this->content['Crop_Details'] = $det['details'];
                        $this->content['Crop_Type'] = $det['type'];
                        $this->content['image'] = $det['image'];
                        $this->content['Pests'] = $det['pests'];
                    }
                    //$this->content['Name']=$details[0]['name'];/
                    //$this->content['Scientific_Name']=$details[0]['sci_name'];
                    //$this->content['Climate']=$details[0]['climate'];
                    //$this->content['Soil']=$details[0]['soil'];
                    //$this->content['Variaties']=$details[0]['variaties'];
                    //$this->content['Duration']=$details[0]['dur'];
                    //$this->content['Diseases']=$details[0]['diseases'];
                    //$this->content['Bio_Fertilizer']=$details[0]['bio_fert'];
                    //$this->content['Market_Price']=$details[0]['market_price'];
                    //$this->content['Crop_Details']=$details[0]['details'];
                    //$this->content['Crop_Type']=$details[0]['type'];
                    //$this->content['image']=$details[0]['image'];
                    //$this->content['Pests']=$details[0]['pests'];
                }
                $this->banner = '<div id="page-heading"> <img src="http://localhost/images/page-heading1.jpg" alt="" />

		<div class="heading-text">

		<h3>Crop</h3>
		<p>' . ucfirst($this->name) . '  Details</p>

		</div>
		</div>';
                break;
            case 'awards':
                Main::includeClass('Details');
                $details = Details::getDetails('at_awards', '*', array('name' => $name));
                if (empty($details)) {
                    $this->content = array('Error' => 'No Data Found');
                } else {
                    foreach ($details as $det) {
                        $this->content['Level'] = $det['level'];
                        $this->content['Name'] = $det['name'];
                        $this->content['Details'] = $det['details'];
                        $this->content['Year'] = $det['year'];
                    }
                }
                break;
            case 'bio-fert':
                Main::includeClass('Details');
                $details = Details::getDetails('at_bio_fert', '*', array('name' => $name));
                if (empty($details)) {
                    $this->content = array('Error' => 'No Data Found');
                } else {
                    foreach ($details as $det) {
                        $this->content['Name'] = $det['name'];
                        $this->content['Details'] = $det['details'];
                        $this->content['Price'] = $det['price'];
                    }
                }
                break;
            case 'contact':
                Main::includeClass('Details');
                $details = Details::getDetails('at_contact_info', '*', array('name' => $name, 'location' => $loc, 'district' => $district));
                if (empty($details)) {
                    $this->content = array('Error' => 'No Data Found');
                } else {
                    foreach ($details as $det) {
                        $this->content['Name'] = $det['name'];
                        $this->content['Code'] = $det['code'];
                        $this->content['Number'] = $det['number'];
                        $this->content['District'] = $det['district'];
                        $this->content['Location'] = $det['location'];
                        $this->content['image'] = $det['image'];
                    }
                }
                break;
            case 'disease':
                $details = Details::getDetails('at_crop_disease', '*', array('name' => $name));
                if (empty($details)) {
                    $this->content = array('Error' => 'No Data Found');
                } else {
                    foreach ($details as $det) {
                        $this->content['Name'] = $det['name'];
                        $this->content['Control'] = $det['control'];
                        $this->content['Details'] = $det['details'];
                    }
                }
                break;
            case 'insurance':
                $details = Details::getDetails('at_crop_insurance', '*', array('crop' => $name));
                if (empty($details)) {
                    $this->content = array('Error' => 'No Data Found');
                } else {
                    foreach ($details as $det) {
                        $this->content['Crop'] = $det['crop'];
                        $this->content['Number/Quantity Required '] = $det['no'];
                        $this->content['Age Of Crop'] = $det['age'];
                        $this->content['Premium'] = $det['premium'];
                        $this->content['Compensation'] = $det['compensation'];
                    }
                }
                break;
            case 'croptypes':
                $details = Details::getDetails('at_crop_types', '*', array('crop' => $name));
                if (empty($details)) {
                    $this->content = array('Error' => 'No Data Found');
                } else {
                    foreach ($details as $det) {
                        $this->content['Name'] = $det['name'];
                        $this->content['Details'] = $det['details'];
                    }
                }
                break;
            case 'links':
                $details = Details::getDetails('at_crop_links', '*', array('crop' => $name));
                if (empty($details)) {
                    $this->content = array('Error' => 'No Data Found');
                } else {
                    foreach ($details as $det) {
                        $this->content['Name'] = $det['name'];
                        $this->content['Link'] = $det['link'];
                        $this->content['Details'] = $det['details'];
                    }
                }
                break;
            case 'location':
                $details = Details::getDetails('at_location', '*', array('name' => $name));
                if (empty($details)) {
                    $this->content = array('Error' => 'No Data Found');
                } else {
                    foreach ($details as $det) {
                        $this->content['Name'] = $det['name'];
                        $this->content['Details'] = $det['details'];
                        $this->content['Soil'] = $det['soil'];
                        $this->content['Crops'] = $det['crops'];
                        $this->content['Land_Use'] = $det['landuse'];
                        $this->content['Geographical_Area'] = $det['geo_area'];
                        $this->content['Land_Forest'] = $det['land_forest'];
                        $this->content['Land_Sown'] = $det['land_sown'];
                        $this->content['Well_Irrigated_Area'] = $det['well_irrigated_area'];
                        $this->content['Canal_Irrigated_Area'] = $det['canal_irrigated_area'];
                        $this->content['Other_Irrigated_Area'] = $det['other_irrigated_area'];
                        $this->content['Net_Irrigated_Area'] = $det['net_irrigated_area'];
                        $this->content['Gross_Irrigated_Area'] = $det['gross_irrigated_area'];
                        $this->content['image'] = $det['image'];
                        $this->content['District'] = $det['district'];
                    }
                }
                break;
            case 'magazine':
                $details = Details::getDetails('at_magazine', '*', array('name' => $name));
                if (empty($details)) {
                    $this->content = array('Error' => 'No Data Found');
                } else {
                    foreach ($details as $det) {
                        $this->content['Name'] = $det['name'];
                        $this->content['Annual_Price'] = $det['annual_price'];
                        $this->content['Single_Price'] = $det['single_price'];
                        $this->content['LifeTime_Price'] = $det['lifetime_price'];
                    }
                }
                break;
            case 'map':
                $details = Details::getDetails('at_map', '*', array('type' => $type, 'name' => $this->name, 'LOCID' => $locID));
                if (empty($details)) {
                    $this->content = array("Error" => "No Data Found");
                } else {
                    foreach ($details as $det) {
                        $this->content['Map'] = $det['type'];
                        $this->content['Name'] = $det['name'];
                        $this->content['image'] = $det['image'];
                        $location = Details::getDetails('at_location', 'name', array('ID' => $det['LOCID']));
                        $this->content['Location'] = $location[0]['name'];
                        $this->content['Details'] = $det['details'];
                    }
                }
                break;
            case 'news':
                $details = Details::getDetails('at_news', '*', array('title' => $title));
                if (empty($details)) {
                    $this->content = array("Error" => "No Data Found");
                } else {
                    foreach ($details as $det) {
                        $this->content['title'] = $det['title'];
                        $this->content['news'] = $det['news'];
                        $this->content['date'] = $det['date'];
                        $this->content['time'] = $det['time'];
                    }
                }
                break;
            case 'patents':
                $details = Details::getDetails('at_patents', '*', array('name' => $name));
                if (empty($details)) {
                    $this->content = array("Error" => "No Data Found");
                } else {
                    foreach ($details as $det) {
                        $this->content['Name'] = $det['name'];
                        $this->content['Year'] = $det['year'];
                        $this->content['Holders'] = $det['holders'];
                        $this->content['Patent Number'] = $det['no'];
                        $this->content['Details'] = $det['details'];
                    }
                }
                break;
            case 'prev-activity':
                $details = Details::getDetails('at_prev_activity', '*', array('year' => $year, 'LOCID' => $id));
                if (empty($details)) {
                    $this->content = array("Error" => "No Data Found");
                } else {
                    foreach ($details as $det) {
                        $this->content['Year'] = $det['year'];
                        $this->content['Activity'] = $det['activity'];
                        $location = Details::getDetails('at_location', 'name', array('ID' => $det['LOCID']));
                        $this->content['Location'] = $location;
                    }
                }
                break;
            case 'publication':
                $details = Details::getDetails('at_publication', '*', array('title' => $title));
                if (empty($details)) {
                    $this->content = array("Error" => "No Data Found");
                } else {
                    foreach ($details as $det) {
                        $this->content['Title'] = $det['title'];
                        $this->content['Year'] = $det['year'];
                        $this->content['Author'] = $det['author'];
                        $this->content['Publisher'] = $det['publisher'];
                        $this->content['Price'] = $det['price'];
                    }
                }
                break;
        }
    }
Пример #16
0
    function data()
    {
        Main::includeClass('AdminPageData');
        $apd = new AdminPageData();
        $apd->header('Publication', "{$this->section} Publication");
        ?>
		<div id='conctactleft'>
				<h4><?php 
        echo "{$this->section} Publication";
        ?>
</h4>
		<div class='success-message'>
			<?php 
        echo "Publication {$this->section}ed Successfully";
        ?>
		</div>
		<div id='maincontactform'>
			<form name='<?php 
        echo $this->formName;
        ?>
' id='publicationForm' method='post' action=''>
				<div>
					<label for='title'>Title</label>
					<input type='text' name='title' id='title' class='textfield' value='<?php 
        echo $this->info['title'];
        ?>
' />
					<span class='require'> *</span>
					<label for='year'>Year</label>
					<input type='text' name='year' id='year' class='textfield' value='<?php 
        echo $this->info['year'];
        ?>
' />
					<label for="author">Author</label>
					<input name='author' id='author' class='textfield' value='<?php 
        echo $this->info['author'];
        ?>
' />
					<label for="publisher">Publisher</label>
					<input name='publisher' id='publisher' class='textfield' value='<?php 
        echo $this->info['publisher'];
        ?>
' />
					<label for="price">Price</label>
					<input name='price' id='price' class='textfield' value='<?php 
        echo $this->info['price'];
        ?>
' />
					<div class='clear'></div>
					<?php 
        //echo '<a href="#" class="button" id="cropsend"><span>'.$this->section.'</span></a> <span class="loading" style="display: none;">Please wait...</span>';
        if ($this->section == 'Update') {
            echo "<input type='hidden' name='update_name' id='update_name' value='{$this->info['update']}' />";
        }
        ?>
					<input type="submit" name="action" value="Add Publication" />
				</div>
			</form>
		</div>
	</div>
		<?php 
        $apd->content();
    }
Пример #17
0
 function displaySelect($list)
 {
     Main::includeClass('Select');
     $select = new Select($list);
 }
Пример #18
0
    function parse()
    {
        Main::includeClass('Details');
        $this->section = $this->comp['SECTION'];
        switch (strtolower($this->section)) {
            case 'crop':
                Main::includeClass('Details');
                $details = Details::getDetails('at_crop', array('name', 'details', 'image'), NULL, FALSE);
                if (empty($details)) {
                    $this->content = array("Error" => "No Data Found");
                } else {
                    $this->content = $details;
                }
                $this->banner = '<div id="page-heading"> <img src="' . Settings::SITEURL . 'images/page-heading1.jpg" alt="" />
		<div class="heading-text">

		<h3>Crops</h3>
		<p>Crop List</p>

		</div>
		</div>';
                break;
            case 'croptype':
                Main::includeClass('Details');
                $details = Details::getDetails('at_crop_types', array('name', 'details'), NULL, FALSE);
                if (empty($details)) {
                    $this->content = array("Error" => "No Data Found");
                } else {
                    $this->content = $details;
                }
                $this->banner = '<div id="page-heading"> <img src="' . Settings::SITEURL . 'images/page-heading1.jpg" alt="" />

		<div class="heading-text">

		<h3>Crops</h3>
		<p>Crop List</p>

		</div>
		</div>';
                break;
            case 'map':
                if (key_exists('SUBCATEGORY', $this->comp)) {
                    $district = $this->comp['CATEGORY'];
                    $location = $this->comp['SUBCATEGORY'];
                    $details = Details::getDetails('at_map', array('name', 'details'), array('district' => $district, 'location' => $location));
                } else {
                    if (key_exists('CATEGORY', $this->comp)) {
                        $district = $this->comp['CATEGORY'];
                        $details = Details::getDetails('at_map', array('location'), array('location' => $location));
                        if (empty($details)) {
                            $this->content = array("Error" => "No Data Found");
                        } else {
                            $info = array();
                            $i = 0;
                            foreach ($details as $det) {
                                $info['name'] = $det['location'];
                            }
                            $this->content = $info;
                        }
                    } else {
                        $details = Details::getDetails('at_map', array('district'));
                        if (empty($details)) {
                            $this->content = array("Error" => "No Data Found");
                        } else {
                            $info = array();
                            $i = 0;
                            foreach ($details as $det) {
                                $info['name'] = $det['district'];
                            }
                            $this->content = $info;
                        }
                    }
                }
                $this->banner = '<div id="page-heading"> <img src="' . Settings::SITEURL . 'images/page-heading1.jpg" alt="" />

		<div class="heading-text">

		<h3>Maps</h3>
		<p>Map List</p>

		</div>
		</div>';
                break;
            case 'office':
                //Main::includeClass('Contact');
                if (key_exists('SUBCATEGORY', $this->comp)) {
                    $location = $this->comp['SUBCATEGORY'];
                    $district = $this->comp['CATEGORY'];
                    $details = Details::getDetails('at_contact_info', array('name'), array('location' => $location, 'district' => $district));
                    if (empty($details)) {
                        $this->content = array("Error" => "No Data Found");
                    } else {
                        $this->content = $details;
                    }
                    break;
                } else {
                    if (key_exists('CATEGORY', $this->comp)) {
                        $district = $this->comp['CATEGORY'];
                        $details = Details::getDetails('at_contact_info', array('location'), array('district' => $district));
                        if (empty($details)) {
                            $this->content = array("Error" => "No Data Found");
                        } else {
                            $info = array();
                            $i = 0;
                            foreach ($details as $det) {
                                $info[$i]['name'] = $det['location'];
                            }
                            $this->content = $info;
                        }
                    } else {
                        $details = Details::getDetails('at_contact_info', 'district');
                        if (empty($details)) {
                            $this->content = array("Error" => "No Data Found");
                        } else {
                            $info = array();
                            $i = 0;
                            foreach ($details as $det) {
                                $info[$i]['name'] = $det['district'];
                            }
                            $this->content = $info;
                        }
                    }
                }
                $this->banner = '<div id="page-heading"> <img src="' . Settings::SITEURL . 'images/page-heading1.jpg" alt="" />

		<div class="heading-text">

		<h3>Offices</h3>
		<p>Office List</p>

		</div>
		</div>';
                break;
            case 'prevactivity':
                Main::includeClass('Details');
                if (!key_exists('CATEGORY', $this->comp)) {
                    $details = Details::getDetails('at_prev_activity', 'location', NULL, FALSE);
                    if (empty($details)) {
                        $this->content = array('Error' => "No Data Found");
                    } else {
                        $info = array();
                        $i = 0;
                        foreach ($details as $det) {
                            $info[$i]['name'] = $det['location'];
                            if (isset($det['activity'])) {
                                $info[$i]['details'] = $det['activity'];
                            }
                            $i++;
                        }
                        $this->content = $info;
                    }
                } else {
                    $location = $this->comp['CATEGORY'];
                    $details = Details::getDetails('at_prev_activity', 'year', NULL, FALSE);
                    if (empty($details)) {
                        $this->content = array("Error" => "No Data Found");
                    } else {
                        $info = array();
                        $i = 0;
                        foreach ($details as $det) {
                            $info[$i]['name'] = $det['year'];
                            $i++;
                        }
                        $this->content = $info;
                    }
                }
                $this->banner = '<div id="page-heading"> <img src="' . Settings::SITEURL . 'images/page-heading1.jpg" alt="" />

		<div class="heading-text">

		<h3>Previous Year Activity</h3>
		<p></p>

		</div>
		</div>';
                break;
            case 'awards':
                Main::includeClass('Details');
                $details = Details::getDetails('at_awards', array('name', 'details'), NULL, FALSE);
                if (empty($details)) {
                    $this->content = array("Error" => "No Data Found");
                } else {
                    $this->content = $details;
                }
                $this->banner = '<div id="page-heading"> <img src="' . Settings::SITEURL . 'images/page-heading1.jpg" alt="" />

		<div class="heading-text">

		<h3>Awards</h3>
		<p>Awards List</p>

		</div>
		</div>';
                break;
            case 'biofert':
                Main::includeClass('Details');
                $details = Details::getDetails('at_bio_fert', array('name', 'details'), NULL, FALSE);
                if (empty($details)) {
                    $this->content = array("Error" => "No Data Found");
                } else {
                    $this->content = $details;
                }
                $this->banner = '<div id="page-heading"> <img src="' . Settings::SITEURL . 'images/page-heading1.jpg" alt="" />

		<div class="heading-text">

		<h3>Bio Fertilizer</h3>
		<p>Bio Fertilizer List</p>

		</div>
		</div>';
                break;
            case 'disease':
                Main::includeClass('Details');
                $details = Details::getDetails('at_crop_disease', array('name', 'details'), NULL, FALSE);
                if (empty($details)) {
                    $this->content = array("Error" => "No Data Found");
                } else {
                    $this->content = $details;
                }
                $this->banner = '<div id="page-heading"> <img src="' . Settings::SITEURL . 'images/page-heading1.jpg" alt="" />

		<div class="heading-text">

		<h3>Disease</h3>
		<p>Disease List</p>

		</div>
		</div>';
                break;
            case 'insurance':
                Main::includeClass('Details');
                $details = Details::getDetails('at_crop_insurance', array('crop'), NULL, FALSE);
                if (empty($details)) {
                    $this->content = array("Error" => "No Data Found");
                } else {
                    $this->content = $details;
                }
                $this->banner = '<div id="page-heading"> <img src="' . Settings::SITEURL . 'images/page-heading1.jpg" alt="" />

		<div class="heading-text">

		<h3>Crops Insurance</h3>
		<p>Insured Crops List</p>

		</div>
		</div>';
                break;
            case 'links':
                Main::includeClass('Details');
                $details = Details::getDetails('at_links', array('name', 'details'), NULL, FALSE);
                if (empty($details)) {
                    $this->content = array("Error" => "No Data Found");
                } else {
                    $this->content = $details;
                }
                $this->banner = '<div id="page-heading"> <img src="' . Settings::SITEURL . 'images/page-heading1.jpg" alt="" />

		<div class="heading-text">

		<h3>UseFull Links</h3>
		<p>Links List</p>

		</div>
		</div>';
                break;
            case 'location':
                Main::includeClass('Details');
                $details = Details::getDetails('at_location', array('name', 'details', 'image'), NULL, FALSE);
                if (empty($details)) {
                    $this->content = array("Error" => "No Data Found");
                } else {
                    $this->content = $details;
                }
                $this->banner = '<div id="page-heading"> <img src="' . Settings::SITEURL . 'images/page-heading1.jpg" alt="" />

		<div class="heading-text">

		<h3>Location</h3>
		<p>Location List</p>

		</div>
		</div>';
                break;
            case 'magazine':
                Main::includeClass('Details');
                $details = Details::getDetails('at_magazine', array('name'), NULL, FALSE);
                if (empty($details)) {
                    $this->content = array("Error" => "No Data Found");
                } else {
                    $this->content = $details;
                }
                $this->banner = '<div id="page-heading"> <img src="' . Settings::SITEURL . 'images/page-heading1.jpg" alt="" />

		<div class="heading-text">

		<h3>Magazine</h3>
		<p>Magazine List</p>

		</div>
		</div>';
                break;
            case 'news':
                Main::includeClass('Details');
                $details = Details::getDetails('at_news', array('title', 'news'), NULL, FALSE);
                if (empty($details)) {
                    $this->content = array("Error" => "No Data Found");
                } else {
                    foreach ($details as $data) {
                        $info = $data;
                    }
                    $this->content[0] = array('name' => $info['title'], 'details' => $info['news']);
                }
                $this->banner = '<div id="page-heading"> <img src="' . Settings::SITEURL . 'images/page-heading1.jpg" alt="" />

		<div class="heading-text">

		<h3>News</h3>
		<p>News</p>

		</div>
		</div>';
                break;
            case 'patents':
                Main::includeClass('Details');
                $details = Details::getDetails('at_patents', array('name'), NULL, FALSE);
                if (empty($details)) {
                    $this->content = array("Error" => "No Data Found");
                } else {
                    $this->content = $details;
                }
                $this->banner = '<div id="page-heading"> <img src="' . Settings::SITEURL . 'images/page-heading1.jpg" alt="" />

		<div class="heading-text">

		<h3>Patents</h3>
		<p>Patents List</p>

		</div>
		</div>';
                break;
            case 'publication':
                Main::includeClass('Details');
                $details = Details::getDetails('at_publication', array('title'), NULL, FALSE);
                if (empty($details)) {
                    $this->content = array("Error" => "No Data Found");
                } else {
                    if (isset($details['title'])) {
                        $this->content[0]['name'] = $details['title'];
                    }
                }
                $this->banner = '<div id="page-heading"> <img src="' . Settings::SITEURL . 'images/page-heading1.jpg" alt="" />

		<div class="heading-text">

		<h3>Publications</h3>
		<p>Publication List</p>

		</div>
		</div>';
                break;
        }
    }
Пример #19
0
 function parse()
 {
     Main::includeClass('Details');
     $section = $this->comp['SECTION'];
     $this->section = $section;
     switch (strtolower($section)) {
         case 'crop':
             $name = $this->comp['CATEGORY'];
             $details = Details::getDetails('at_crop', '*', array('name' => $name));
             $this->banner = '<div id="page-heading"> <img src="http://localhost/images/page-heading1.jpg" alt="" /><div class="heading-text"><h3>Crop</h3><p>' . ucfirst($this->name) . '  Details</p><</div></div>';
             if (empty($details)) {
                 $this->setContentEmpty();
             } else {
                 foreach ($details as $det) {
                     $this->content['Name'] = $det['name'];
                     $this->content['Scientific_Name'] = $det['sci_name'];
                     $this->content['Climate'] = str_replace('=:=', '<br />', $det['climate']);
                     $this->content['Soil'] = $det['soil'];
                     $this->content['Varieties'] = $det['variaties'];
                     $this->content['Duration'] = $det['dur'];
                     $this->content['Diseases'] = $det['diseases'];
                     $this->content['Bio_Fertilizer'] = $det['bio_fert'];
                     $this->content['Market_Price'] = $det['market_price'];
                     $this->content['Crop_Details'] = $det['details'];
                     $this->content['Crop_Type'] = $det['type'];
                     $this->content['image'] = $det['image'];
                     $this->content['Pests'] = $det['pests'];
                 }
                 /*
                 $name=$det['name'];
                 $type=$det['type'];
                 $side=Details::getDetails('at_crop','name',array('type'=>$type));
                 if(!empty($side))
                 {
                 	$count=0;
                 	foreach($side as $n)
                 	{
                 		if($n!==$name)
                 		{
                 			$this->sideBar[]="<li class='cat-item cat-item-1'><a href='".Settings::SITEURL."crop\\$n' title='$n'>$n</a></li>";
                 		}
                 	}
                 }
                 */
             }
             break;
         case 'awards':
             $name = $this->comp['CATEGORY'];
             $details = Details::getDetails('at_awards', '*', array('name' => $name));
             if (empty($details)) {
                 $this->setContentEmpty();
             } else {
                 foreach ($details as $det) {
                     $this->content['Level'] = $det['level'];
                     $this->content['Name'] = $det['name'];
                     $this->content['Details'] = $det['details'];
                     $this->content['Year'] = $det['year'];
                 }
                 /*
                 $name=$det['name'];
                 $level=$det['level'];
                 $side=Details::getDetails('at_crop','name',array('level'=>$type));
                 if(!empty($side))
                 {
                 	$count=0;
                 	foreach($side as $n)
                 	{
                 		if($n!==$name)
                 		{
                 			$this->sideBar[]="<li class='cat-item cat-item-1'><a href='".Settings::SITEURL."awards\\$n' title='$n'>$n</a></li>";
                 		}
                 	}
                 }
                 else
                 {
                 
                 }
                 */
             }
             break;
         case 'biofert':
             $name = $this->comp['CATEGORY'];
             $details = Details::getDetails('at_bio_fert', '*', array('name' => $name));
             if (empty($details)) {
                 $this->content = array('Error' => 'No Data Found');
             } else {
                 foreach ($details as $det) {
                     $this->content['Name'] = $det['name'];
                     $this->content['Details'] = $det['details'];
                     $this->content['Price'] = $det['price'];
                 }
             }
             break;
         case 'office':
             $district = $this->comp['CATEGORY'];
             $location = $this->comp['SUBCATEGORY'];
             $name = str_replace("%20", " ", $this->comp['QUERY']);
             $details = Details::getDetails('at_contact_info', '*', array('name' => $name, 'location' => $location, 'district' => $district));
             if (empty($details)) {
                 $this->content = array('Error' => 'No Data Found');
             } else {
                 foreach ($details as $det) {
                     $this->content['Name'] = $det['name'];
                     $this->content['Code'] = $det['code'];
                     $this->content['Number'] = $det['number'];
                     $this->content['District'] = $det['district'];
                     $this->content['Location'] = $det['location'];
                     $this->content['image'] = $det['image'];
                 }
             }
             break;
         case 'disease':
             $name = $this->comp['CATEGORY'];
             $details = Details::getDetails('at_crop_disease', '*', array('name' => $name));
             if (empty($details)) {
                 $this->content = array('Error' => 'No Data Found');
             } else {
                 foreach ($details as $det) {
                     $this->content['Name'] = $det['name'];
                     $this->content['Control'] = $det['control'];
                     $this->content['Details'] = $det['details'];
                 }
             }
             break;
         case 'insurance':
             $name = $this->comp['CATEGORY'];
             $details = Details::getDetails('at_crop_insurance', '*', array('crop' => $name));
             if (empty($details)) {
                 $this->content = array('Error' => 'No Data Found');
             } else {
                 foreach ($details as $det) {
                     $this->content['Crop'] = $det['crop'];
                     $this->content['Number/Quantity Required '] = $det['no'];
                     $this->content['Age Of Crop'] = $det['age'];
                     $this->content['Premium'] = $det['premium'];
                     $this->content['Compensation'] = $det['compensation'];
                 }
             }
             break;
         case 'croptype':
             $name = $this->comp['CATEGORY'];
             $details = Details::getDetails('at_crop_types', '*', array('name' => $name));
             if (empty($details)) {
                 $this->content = array('Error' => 'No Data Found');
             } else {
                 foreach ($details as $det) {
                     $this->content['Name'] = $det['name'];
                     $this->content['Details'] = $det['details'];
                 }
             }
             break;
         case 'links':
             $name = $this->comp['CATEGORY'];
             $details = Details::getDetails('at_links', '*', array('name' => $name));
             if (empty($details)) {
                 $this->content = array('Error' => 'No Data Found');
             } else {
                 foreach ($details as $det) {
                     $this->content['Name'] = $det['name'];
                     $this->content['Link'] = $det['link'];
                     $this->content['Details'] = $det['details'];
                 }
             }
             break;
         case 'location':
             if (key_exists('SUBCATEGORY', $this->comp)) {
                 $district = $this->comp['CATEGORY'];
                 $location = $this->comp['SUBCATEGORY'];
                 $details = Details::getDetails('at_location', '*', array('name' => $location, 'district' => $district));
             } else {
                 if (key_exists('CATEGORY', $this->comp)) {
                     $district = $this->comp['CATEGORY'];
                     $details = Details::getDetails('at_location', '*', array('name' => $district, 'type' => 'district'));
                 }
             }
             if (empty($details)) {
                 $this->content = array('Error' => 'No Data Found');
             } else {
                 foreach ($details as $det) {
                     $this->content['Name'] = $det['name'];
                     $this->content['Details'] = $det['details'];
                     $this->content['Soil'] = $det['soil'];
                     $this->content['Crops'] = $det['crops'];
                     $this->content['Land_Use'] = $det['landuse'];
                     $this->content['Geographical_Area'] = $det['geo_area'];
                     $this->content['Land_Forest'] = $det['land_forest'];
                     $this->content['Land_Sown'] = $det['land_sown'];
                     $this->content['Well_Irrigated_Area'] = $det['well_irrigated_area'];
                     $this->content['Canal_Irrigated_Area'] = $det['canal_irrigated_area'];
                     $this->content['Other_Irrigated_Area'] = $det['other_irrigated_area'];
                     $this->content['Net_Irrigated_Area'] = $det['net_irrigated_area'];
                     $this->content['Gross_Irrigated_Area'] = $det['gross_irrigated_area'];
                     $this->content['image'] = $det['image'];
                     $this->content['District'] = $det['district'];
                 }
             }
             break;
         case 'magazine':
             $name = $this->comp['CATEGORY'];
             $details = Details::getDetails('at_magazine', '*', array('name' => $name));
             if (empty($details)) {
                 $this->content = array('Error' => 'No Data Found');
             } else {
                 foreach ($details as $det) {
                     $this->content['Name'] = $det['name'];
                     $this->content['Annual_Price'] = $det['annual_price'];
                     $this->content['Single_Price'] = $det['single_price'];
                     $this->content['LifeTime_Price'] = $det['lifetime_price'];
                 }
             }
             break;
         case 'map':
             $details = Details::getDetails('at_map', '*', array('type' => $type, 'name' => $this->name, 'LOCID' => $locID));
             if (empty($details)) {
                 $this->content = array("Error" => "No Data Found");
             } else {
                 foreach ($details as $det) {
                     $this->content['Map'] = $det['type'];
                     $this->content['Name'] = $det['name'];
                     $this->content['image'] = $det['image'];
                     $location = Details::getDetails('at_location', 'name', array('ID' => $det['LOCID']));
                     $this->content['Location'] = $location[0]['name'];
                     $this->content['Details'] = $det['details'];
                 }
             }
             break;
         case 'news':
             $title = $this->comp['CATEGORY'];
             $details = Details::getDetails('at_news', '*', array('title' => $title));
             if (empty($details)) {
                 $this->content = array("Error" => "No Data Found");
             } else {
                 foreach ($details as $det) {
                     $this->content['title'] = $det['title'];
                     $this->content['news'] = $det['news'];
                     $this->content['date'] = $det['date'];
                     $this->content['time'] = $det['time'];
                 }
             }
             break;
         case 'patents':
             $name = $this->comp['CATEGORY'];
             $details = Details::getDetails('at_patents', '*', array('name' => $name));
             if (empty($details)) {
                 $this->content = array("Error" => "No Data Found");
             } else {
                 foreach ($details as $det) {
                     $this->content['Name'] = $det['name'];
                     $this->content['Year'] = $det['year'];
                     $this->content['Holders'] = $det['holders'];
                     $this->content['Patent Number'] = $det['no'];
                     $this->content['Details'] = $det['details'];
                 }
             }
             break;
         case 'prevactivity':
             $year = $this->comp['SUBCATEGORY'];
             $location = $this->comp['CATEGORY'];
             $details = Details::getDetails('at_prev_activity', '*', array('year' => $year, 'location' => $location));
             if (empty($details)) {
                 $this->content = array("Error" => "No Data Found");
             } else {
                 foreach ($details as $det) {
                     $this->content['Year'] = $det['year'];
                     $this->content['Activity'] = $det['activity'];
                     $this->content['Location'] = $det['location'];
                 }
             }
             break;
         case 'publication':
             $title = $this->comp['CATEGORY'];
             $details = Details::getDetails('at_publication', '*', array('title' => $title));
             if (empty($details)) {
                 $this->content = array("Error" => "No Data Found");
             } else {
                 foreach ($details as $det) {
                     $this->content['Title'] = $det['title'];
                     $this->content['Year'] = $det['year'];
                     $this->content['Author'] = $det['author'];
                     $this->content['Publisher'] = $det['publisher'];
                     $this->content['Price'] = $det['price'];
                 }
             }
             break;
     }
 }
Пример #20
0
 function display($details)
 {
     $info = array();
     if (empty($details)) {
         $info = array('Error' => 'Oops, Some Thing Went Wrong With Query? Try Again With Another Term');
     } else {
         $i = 0;
         foreach ($details as $data) {
             $j = 0;
             foreach ($data as $cont) {
                 if ($j == 0) {
                     $info[]['name'] = $cont;
                 } else {
                     $info[$i]['details'] = $cont;
                 }
                 $j++;
             }
             $i++;
         }
     }
     Main::includeClass('SearchData');
     $sd = new SearchData($info, $this->section);
     Main::includeClass('TemplateData');
     $td = new TemplateData($sd);
 }
Пример #21
0
<?php

Main::includeClass('MainTemplate');
class Ecology extends MainTemplate
{
    function content()
    {
        ?>
		<h3>What Is Agroecology?</h3>
<p>
Agroecology is a scientific discipline that uses ecological theory to study, design, manage and evaluate agricultural systems that are productive but also resource conserving. Agroecological research considers interactions of all important biophysical, technical and socioeconomic components of farming systems and regards these systems as the fundamental units of study, where mineral cycles, energy transformations, biological processes and socioeconomic relationships are analyzed as a whole in an interdisciplinary fashion.</p>
<p>
Agroecology is concerned with the maintenance of a productive agriculture that sustains yields and optimizes the use of local resources while minimizing the negative environmental and socio-economic impacts of modern technologies. In industrial countries, modern agriculture with its yield maximizing high-input technologies generates environmental and health problems that often do not serve the needs of producers and consumers. In developing countries, in addition to promoting environmental degradation, modern agricultural technologies have bypassed the circumstances and socio-economic needs of large numbers of resource-poor farmers.</p>
<p>
The contemporary challenges of agriculture have evolved from the merely technical to also include social, cultural, economic and particularly environmental concerns. Agricultural production issues cannot be considered separately from environmental issues. In this light, a new technological and development approach is needed to provide for the agricultural needs of present and future generations without depleting our natural resource base. The agroecological approach does just this because it is more sensitive to the complexities of local agriculture, and has a broad performance criteria which includes properties of ecological sustainability, food security, economic viability, resource conservation and social equity, as well as increased production.</p>
<p>
To put agroecological technologies into practice requires technological innovations, agriculture policy changes, socio-economic changes, but mostly a deeper understanding of the complex long-term interactions among resources, people and their environment. To attain this understanding agriculture must be conceived of as an ecological system as well as a human dominated socio-economic system. A new interdisciplinary framework to integrate the biophysical sciences, ecology and other social sciences is indispensable. Agroecology provides a framework by applying ecological theory to the management of agroecosystems according to specific resource and socio-economic realities, and by providing a methodology to make the required interdisciplinary connections.</p>
	<?php 
    }
}
Пример #22
0
 function __construct($comp)
 {
     switch (strtolower($comp['SECTION'])) {
         case 'crop':
         case 'awards':
         case 'bio-fert':
         case 'disease':
         case 'insurance':
         case 'crop-types':
         case 'links':
         case 'location':
         case 'magazine':
         case 'map':
         case 'news':
         case 'patents':
         case 'publication':
             if (key_exists('CATEGORY', $comp)) {
                 Main::includeClass('SinglePage');
                 $sp = new SinglePage($comp);
                 Main::includeClass('TemplateData');
                 $td = new TemplateData($sp);
             } else {
                 Main::includeClass('ListPage');
                 $lp = new ListPage($comp['SECTION']);
                 Main::includeClass('TemplateData');
                 $td = new TemplateData($lp);
             }
             //Main::includeClass('Details');
             //Main::includeClass('DetailsData');
             //if(key_exists('CATEGORY',$comp))
             //{
             //	$det=Details::getDetails('at_crop','*',array('name'=>$comp['CATEGORY']));
             //	$dd=new DetailsData($det,'crop');
             //	$dd->single();
             //	}
             //	else
             //	{
             //		$det=Details::getDetails('at_crop',array('URL','name','details','image'));
             ////		$dd=new DetailsData($det,'crop');
             //		$dd->printList();
             //	}
             //	if(empty($det))
             ///	{
             //		$det=array('No Data Found');
             //	}
             break;
         case 'contact':
             break;
         case 'location':
             break;
         case 'map':
             break;
         case 'prevactivity':
             break;
             /*
             case 'awards':
             	if(key_exists('CATEGORY',$comp))
             	{
             		Main::includeClass('SinglePage');
             		$sp=new SinglePage('awards',$comp['CATEGORY']);
             		Main::includeClass('TemplateData');
             		$td=new TemplateData($sp);
             	}
             	else
             	{
             		Main::includeClass('ListPage');
             		$lp=new ListPage('awards');
             		Main::includeClass('TemplateData');
             		$td=new TemplateData($lp);
             	}
             break;
             
             case 'bio-fert':
             	if(key_exists('CATEGORY',$comp))
             	{
             		Main::includeClass('SinglePage');
             		$sp=new SinglePage('bio-fert',$comp['CATEGORY']);
             		Main::includeClass('TemplateData');
             		$td=new TemplateData($lp);
             	}
             	else
             	{
             		Main::includeClass('ListPage');
             		$lp=new ListPage('bio-fert');
             		Main::includeClass('TemplateData');
             		$td=new TemplateData($lp);
             	}
             break;
             
             case 'contact':
             	if(key_exists('CATEGORY',$comp))
             	{
             		Main::includeClass('SinglePage');
             		$sp=new SinglePage('contact',$comp['CATEGORY']);
             		Main::includeClass('TemplateData');
             		$td=new TemplateData($lp);
             	}
             	else
             	{
             		Main::includeClass('ListPage');
             		$lp=new ListPage('contact');
             		Main::includeClass('contact');
             		$td=new TemplateData($lp);
             	}
             	break;
             
             case 'disease':
             	if(key_exists('CATEGORY',$comp))
             	{
             		Main::includeClass('SinglePage');
             		$sp=new SinglePage('disease',$comp['CATEGORY']);
             		Main::includeClass('TemplateData');
             		$td=new TemplateData($lp);
             	}
             else
             {
             	Main::includeClass('ListPage');
             	$lp=new ListPage('disease');
             	Main::includeClass('TemplateData');
             	$td=new TemplateData($lp);
             }
             break;
             
             case 'insurance':
             	if(key_exists('CATEGORY',$comp))
             	{
             		Main::includeClass('SinglePage');
             		$sp=new SinglePage('insurance',$comp['CATEGORY']);
             		Main::includeClass('TemplateData');
             		$td=new TemplateData($lp);
             	}
             	else
             	{
             		Main::includeClass('ListPage');
             		$lp=new ListPage('insurance');
             		Main::includeClass('TemplateData');
             		$td=new TemplateData($lp);
             	}
             break;
             */
     }
 }
Пример #23
0
    function content()
    {
        ?>
		<div id='conctactleft'>
				<h4><?php 
        echo "{$this->section} Contact";
        ?>
</h4>
		<div class='success-message'>
			<?php 
        echo "Contact {$this->section}ed Successfully";
        ?>
		</div>
		<div id='maincontactform'>
		<form name='<?php 
        echo $this->formName;
        ?>
' id='contactForm' method='post' action='' enctype="multipart/form-data" >
				<div>
					<label for='name'>Name</label>
					<input type='text' name='name' id='name' class='textfield' value='<?php 
        echo $this->info['name'];
        ?>
' />
					<span class="require"> *</span>
					<label for='Type'>Select Type</label>
					<select name='type' id='type' class='selectfield'>
					<option value='mobile'
					<?php 
        if ($this->info['type'] == 'mobile') {
            echo ' selected="TRUE"';
        }
        ?>
					>Mobile</option>
					<option value='office'
					<?php 
        if ($this->info['type'] == 'office') {
            echo ' selected="TRUE"';
        }
        ?>
					>Office</option>
					</select>
					<span class="require"> *</span>

					<label for='code'>Area Code</label>
					<input type="text" name='code' id='code' class='textfield' value='<?php 
        echo $this->info['code'];
        ?>
' />
					<span class="require"> *</span>
					<label for='number'>Number</label>
					<input type='text' name='number' id='number' class='textfield' value='<?php 
        echo $this->info['number'];
        ?>
' />
					<span class="require"> *</span>
					<label for='district'>District</label>
					<select name='district' id='district' class='selectfield'>
					<?php 
        Main::includeClass('Details');
        $det = Details::getDetails('at_location', 'name', array('type' => 'district'), TRUE);
        if (is_array($det) && !empty($det)) {
            foreach ($det as $value) {
                if ($this->info['district'] == $value) {
                    echo "<option value='{$value}' selected='selected'>{$value}</option>";
                } else {
                    echo "<option value='{$value}'>{$value}</option>";
                }
            }
        } else {
            echo "<option value=''>None</option>";
        }
        ?>
					</select>
					<span class="require"> *</span>
					<label for='location'>Location</label>
					<select name='location' id='location' class='selectfield'>
					<?php 
        Main::includeClass('Details');
        $det = Details::getDetails('at_location', 'name', array('type' => 'village'), TRUE);
        if (is_array($det) && !empty($det)) {
            foreach ($det as $value) {
                if ($this->info['location'] == $value) {
                    echo "<option value='{$value}' selected='selected'>{$value}</option>";
                } else {
                    echo "<option value='{$value}'>{$value}</option>";
                }
            }
        } else {
            echo "<option value=''>None</option>";
        }
        ?>
					</select>
					<span class="require"> *</span>
					<label for='imageAdd'>Add Image</label>
					<input type="file" name='file' id='file'/>
					<div class='clear'></div>
					<?php 
        //echo '<a href="#" class="button" id="contactSend"><span>'.$this->section.'</span></a> <span class="loading" style="display: none;">Please wait..</span>';
        if ($this->section == 'Update') {
            echo "<input type='hidden' name='update_name' value='{$this->info['update']}' />";
        }
        ?>
					<input type="submit" name="action" value='Add Contact' class='button'/>
				</div>
			</form>
		</div>
	</div>
		<?php 
    }
Пример #24
0
 function handle($components)
 {
     switch (strtolower($components['SECTION'])) {
         case 'admin':
             Main::includeClass('AdminHandler');
             $ah = new AdminHandler($components);
             break;
         case 'crop':
         case 'croptype':
         case 'biofert':
         case 'awards':
         case 'office':
         case 'disease':
         case 'insurance':
         case 'links':
         case 'location':
         case 'magazine':
         case 'map':
         case 'message':
         case 'news':
         case 'patents':
         case 'prevactivity':
         case 'publication':
         case 'pests':
         case 'books':
             Main::includeClass('DetailsHandler');
             $dh = new DetailsHandler($components);
             break;
         case 'about':
             Main::includeClass('About');
             $ab = new About();
             Main::includeClass('TemplateData');
             $td = new TemplateData($ab);
             break;
         case 'ecology':
             Main::includeClass('Ecology');
             $ec = new Ecology();
             Main::includeClass('TemplateData');
             $td = new TemplateData($ec);
             break;
         case 'forestry':
             Main::includeClass('Forestry');
             $fo = new Forestry();
             Main::includeClass('TemplateData');
             $td = new TemplateData($fo);
             break;
         case 'seasoncalc':
             Main::includeClass('SeasonCalculator');
             $sc = new SeasonCalculator();
             break;
         case 'contact':
             include 'Contact.php';
             break;
         case 'search':
             Main::includeClass('Search');
             if (isset($_GET['s'])) {
                 $query = $_GET['s'];
             } else {
                 $query = '';
             }
             if (isset($_GET['section'])) {
                 $sec = $_GET['section'];
             } else {
                 $sec = 'crop';
             }
             $dh = new Search($query, $sec);
             break;
         case 'faq':
             Main::includeClass('FAQ');
             $faq = new FAQ();
             Main::includeClass('TemplateData');
             $td = new TemplateData($faq);
             break;
         case 'index':
         case 'home':
         default:
             Main::includeClass('HomeData');
             $hpd = new HomeData();
             Main::includeClass('TemplateData');
             $td = new TemplateData($hpd);
             break;
     }
 }