当前位置: 首页>>代码示例>>PHP>>正文


PHP Main::includeClass方法代码示例

本文整理汇总了PHP中Main::includeClass方法的典型用法代码示例。如果您正苦于以下问题:PHP Main::includeClass方法的具体用法?PHP Main::includeClass怎么用?PHP Main::includeClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Main的用法示例。


在下文中一共展示了Main::includeClass方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: data

    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();
    }
开发者ID:amigozgovi,项目名称:agrotech,代码行数:28,代码来源:Select.php

示例2: handle

 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;
     }
 }
开发者ID:amigozgovi,项目名称:agrotech,代码行数:58,代码来源:AdminHandler.php

示例3: data

    function data()
    {
        Main::includeClass('AdminPageData');
        $apd = new AdminPageData();
        $apd->header('Publication', "{$this->section} Message");
        ?>
		<?php 
        $apd->content();
    }
开发者ID:amigozgovi,项目名称:agrotech,代码行数:9,代码来源:MessageData.php

示例4: display

 function display()
 {
     Main::includeClass('HomePageData');
     $hpd = new HomePageData();
     $hpd->header();
     $hpd->banner();
     $hpd->content();
     $hpd->footer();
 }
开发者ID:amigozgovi,项目名称:agrotech,代码行数:9,代码来源:Copy+of+HomeHandler.php

示例5: display

 function display($page, $details = NULL, $list = FALSE)
 {
     Main::includeClass($page);
     $page = new $page($details);
     if ($list) {
         $page->printList();
     } else {
         $page->details();
     }
 }
开发者ID:amigozgovi,项目名称:agrotech,代码行数:10,代码来源:DetailsHandler_OLD.php

示例6: __construct

 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);
 }
开发者ID:amigozgovi,项目名称:agrotech,代码行数:13,代码来源:index.php

示例7: openConnection

 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());
         }
     }
 }
开发者ID:amigozgovi,项目名称:agrotech,代码行数:13,代码来源:Main.php

示例8: parse

 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);
     }
 }
开发者ID:amigozgovi,项目名称:agrotech,代码行数:16,代码来源:SeasonCalculator.php

示例9: content

    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)) {
//.........这里部分代码省略.........
开发者ID:amigozgovi,项目名称:agrotech,代码行数:101,代码来源:CropData.php

示例10: handle


//.........这里部分代码省略.........
             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}/");
     }
 }
开发者ID:amigozgovi,项目名称:agrotech,代码行数:101,代码来源:RemoveHandler.php

示例11: __construct

 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;
     }
 }
开发者ID:amigozgovi,项目名称:agrotech,代码行数:87,代码来源:DetailsHandler.php

示例12: display

 function display($form)
 {
     Main::includeClass($form);
     $obj = new $form();
     Main::includeClass('TemplateData');
     $td = new TemplateData($obj);
 }
开发者ID:amigozgovi,项目名称:agrotech,代码行数:7,代码来源:AddHandler.php

示例13: content

    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 
    }
开发者ID:amigozgovi,项目名称:agrotech,代码行数:70,代码来源:CropInsuranceData.php

示例14: printList

    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();
    }
开发者ID:amigozgovi,项目名称:agrotech,代码行数:39,代码来源:CropDetails.php

示例15: parse

    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'];
//.........这里部分代码省略.........
开发者ID:amigozgovi,项目名称:agrotech,代码行数:101,代码来源:SinglePage(OLD).php


注:本文中的Main::includeClass方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。