本文整理汇总了PHP中Main::getPostData方法的典型用法代码示例。如果您正苦于以下问题:PHP Main::getPostData方法的具体用法?PHP Main::getPostData怎么用?PHP Main::getPostData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Main
的用法示例。
在下文中一共展示了Main::getPostData方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: parse
//.........这里部分代码省略.........
$page = 'MapData';
break;
case 'magazine':
$table = 'at_magazine';
$fields = array('name', 'annual_price', 'single_price', 'lifetime_price');
$req = array('name');
$page = 'MagazineData';
break;
case 'award':
$table = 'at_awards';
$fields = array('level', 'name', 'details', 'year');
$req = array('name', 'level');
$page = 'AwardsData';
break;
case 'disease':
$table = 'at_crop_disease';
$fields = array('name', 'control', 'details');
$req = array('name');
$page = 'DiseaseData';
break;
case 'location':
$table = 'at_location';
$fields = array('name', 'details', 'cli', 'soil', 'crops', 'landuse', 'geo_area', 'land_forest', 'land_sown', 'well_irrigated_area', 'tank_irrigated_area', 'other_irrigated_area', 'canal_irrigated_area', 'net_irrigated_area', 'gross_irrigated_area', 'type', 'district');
$image = TRUE;
$req = array('name', 'type');
$page = 'LocationData';
break;
case 'publication':
$table = 'at_publication';
$fields = array('title', 'year', 'author', 'publisher', 'price');
$req = array('title');
$page = 'PublicationData';
break;
case 'link':
$table = 'at_links';
$fields = array('name', 'url', 'details');
$req = array('name', 'url', 'details');
$page = 'LinksData';
break;
case 'biofert':
$table = 'at_bio_fert';
$fields = array('name', 'details', 'price');
$req = array('name', 'details', 'price');
$page = 'BioFertData';
break;
case 'insurance':
$table = 'at_crop_insurance';
$fields = array('crop', 'no', 'age', 'premium', 'compensation');
$req = array('crop', 'premium', 'compensation');
$page = 'CropInsuranceData';
break;
case 'prevactivity':
$table = 'at_prev_activity';
$fields = array('year', 'activity', 'location');
$req = array('year', 'activity', 'location');
$page = 'PrevActivityData';
break;
case 'patent':
$table = 'at_patents';
$fields = array('name', 'holders', 'year', 'no');
$req = array('name', 'holders', 'no');
$page = 'PatentsData';
break;
case 'message':
$table = 'at_message';
$fields = array('news', 'date', 'time');
$req = array('name', 'date', 'time');
$page = 'MessageData';
break;
default:
$table = '';
$fields = '';
$req = '';
$page = 'AdminHomeData';
break;
}
$this->image = $image;
$this->table = $table;
if (isset($_POST['action'])) {
$this->info = Main::getPostData($fields, $req);
if ($section == 'crop') {
$this->info['soil'] = str_replace(array('\\n', '\\r'), '<br />', $this->info['soil']);
$this->info['variaties'] = str_replace(array('\\n', '\\r'), '<br />', $this->info['variaties']);
$this->info['diseases'] = str_replace(array('\\n', '\\r'), '<br />', $this->info['diseases']);
}
if ($this->image) {
if (isset($_FILES['file'])) {
if ($_FILES['file']['error'] === UPLOAD_ERR_OK) {
//echo $_FILES['file']['error'];
Main::includeClass('UploadManager');
$file = Main::generateRandom();
$um = new UploadManager($file);
$this->info['image'] = $file;
}
}
}
} else {
$this->display($page);
}
}
示例2: handle
//.........这里部分代码省略.........
$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/");
}
Main::includeClass('Details');
$det = new Details();
if (isset($_POST['action']) && isset($_POST['update_name'])) {
$name = $_POST['update_name'];
$info = Main::getPostData($fields, $req);
/*
if($this->image)
{
if(isset($_FILES['file']))
{
if($_FILES['file']['error']===UPLOAD_ERR_OK)
{
echo $_FILES['file']['error'];
Main::includeClass('UploadManager');
$file=Main::generateRandom();
$um=new UploadManager($file);
$info['image']=$file;
}
}
}
*/
$cond = array($temp['cond'] => $name);
Main::includeClass('Update');
$update = new Update($info, $table, $cond);
echo header("Location:" . Settings::SITEURL . "{$this->section}/");
} else {
$name = $this->name;
$cond = array($temp['cond'] => $name);
$list = $det->getDetails($table, '*', $cond, FALSE);
if (!empty($list)) {
$list[0]['update'] = $name;
}
$i = 0;
//print_r($list);
foreach ($list as $data) {
//print_r($data);
//$keys=array_keys($data);
//print_r($keys);
foreach ($data as $key => $value) {
if (!isset($value)) {
$list[$i][$key] = '';
}
}
$i++;
}
//print_r($list);
if (!empty($list)) {
$list = $list[0];
}
$this->displayUpdate($page, $list);
}
//}
}