个人代码示例-Doctor.php
<div class="wrap" >
<h2>医院资料录入</h2>
<form method="post" enctype="multipart/form-data">
<input type="hidden" name="DO" value="Hospital" />
<?php settings_fields( 'myoption-group'); ?>
<table class="form-table">
<tr valign="top">
<th scope="row">医院名称:</th>
<td><input type="text" name="HospitalName" size="20" value="" /></td>
</tr>
<tr valign="top">
<th scope="row">医院图片:</th>
<td><input type="file" name="HospitalImagePath" size="20" value="" /></td>
</tr>
<tr valign="top">
<th scope="row">医院理念:</th>
<td><input type="text" name="HospitalPhilosophy" size="50" value="" /></td>
</tr>
<tr valign="top">
<th scope="row">医院资质:</th>
<td><input type="text" name="HospitalQualifications" size="50" value="" /></td>
</tr>
<tr valign="top">
<th scope="row">医院简介:</th>
<td>
<?php wp_editor( '', HospitalSynopsis, $settings = array(
tinymce=>1,
media_buttons=>0,
textarea_rows=>4,
editor_class=>"textareastyle") );
?>
</td>
</tr>
<tr valign="top">
<th scope="row">其他:</th>
<td><input type="text" name="Others" size="60" value="" /></td>
</tr>
</table>
<p class="submit">
<input type="submit" class="button-primary" value="<?php _e('插入') ?>" />
</p>
</form>
<h2>医生资料录入</h2>
<form method="post" enctype="multipart/form-data">
<?php settings_fields( 'myoption-group'); ?>
<?php
global $wpdb;
/*//医生资料资料
$sqlDoctors = "SELECT * FROM ps_DoctorsInfoEntry";
$myDoctorsInfo = $wpdb->get_results($sqlDoctors);
*/
//所属医院资料
$sqlHospitals = "SELECT HospitalID,HospitalName FROM ps_HospitalsInfoEntry";
$myHospitalsInfo = $wpdb->get_results($sqlHospitals);
//所属城市资料
$sqlCity = "SELECT * FROM ps_master WHERE TypeID = 'City'";
$myCityInfo = $wpdb->get_results($sqlCity);
?>
<input type="hidden" name="DO" value="Doctor" />
<table class="form-table">
<tr valign="top">
<th scope="row">医生姓名:</th>
<td><input type="text" name="DoctorName" size="20" value="" /></td>
</tr>
<tr valign="top">
<th scope="row">医生照片:</th>
<td><input type="file" name="DoctorImagePath" size="20" value="" /></td>
</tr>
<tr valign="top">
<th scope="row">医生职务:</th>
<td><input type="text" name="DoctorPost" size="50" value="" /></td>
</tr>
<tr valign="top">
<th scope="row">所属城市:</th>
<td>
<select id="TheCity" name="TheCity">
<?php
foreach($myCityInfo as $k=>$v){
?>
<option value="<?php echo $v->MasterID;?>"><?php echo $v->MasterName;?></option>
<?php
}
?>
</select>
</td>
</tr>
<tr valign="top">
<th scope="row">所属医院:</th>
<td>
<select id="TheHospital" name="TheHospital">
<?php
foreach($myHospitalsInfo as $k=>$v){
?>
<option value="<?php echo $v->HospitalID;?>|<?php echo $v->HospitalName;?>"><?php echo $v->HospitalName;?></option>
<?php
}
?>
</select>
</td>
</tr>
<tr valign="top">
<th scope="row">所属科室:</th>
<td><input type="text" name="TheDepartment" size="50" value="" /></td>
</tr>
<tr valign="top">
<th scope="row">医生介绍链接:</th>
<td><input type="text" name="ExpertsIntrolink" size="60" value="" /></td>
</tr>
<tr valign="top">
<th scope="row">所属医院介绍链接:</th>
<td><input type="text" name="TheHospitalsIntrolink" size="60" value="" /></td>
</tr>
<tr valign="top">
<th scope="row">是否推荐:</th>
<td>
<input type="radio" name="RecommendFlg" size="20"/>
</td>
</tr>
<tr valign="top">
<th scope="row">医生简介:</th>
<td>
<?php wp_editor( '', DoctorSynopsis, $settings = array(
tinymce=>1,
media_buttons=>0,
textarea_rows=>4,
editor_class=>"textareastyle") );
?>
</tr>
<tr valign="top">
<th scope="row">其他:</th>
<td><input type="text" name="Others" size="20" value="" /></td>
</tr>
</table>
<p class="submit">
<input type="submit" name="sub" class="button-primary" value="<?php _e('插入') ?>" />
</p>
</form>
<h2>特色医疗资料录入</h2>
<form method="post" enctype="multipart/form-data">
<input type="hidden" name="DO" value="Featured" />
<?php settings_fields( 'myoption-group'); ?>
<table class="form-table">
<tr valign="top">
<th scope="row">医院名称:</th>
<td>
<select id="HospitalName" name="HospitalName">
<?php
foreach($myHospitalsInfo as $k=>$v){
?>
<option value="<?php echo $v->HospitalID;?>|<?php echo $v->HospitalName;?>"><?php echo $v->HospitalName;?></option>
<?php
}
?>
</select>
</td>
</tr>
<tr valign="top">
<th scope="row">特色医疗图片:</th>
<td><input type="file" name="FeaturedImagePath" size="20" value="" /></td>
</tr>
<tr valign="top">
<th scope="row">特色医疗名称:</th>
<td><input type="text" name="FeaturedTreatmentsName" size="50" value="" /></td>
</tr>
<tr valign="top">
<th scope="row">特色理念:</th>
<td><input type="text" name="FeaturedPhilosophy" size="50" value="" /></td>
</tr>
<tr valign="top">
<th scope="row">特色资质:</th>
<td><input type="text" name="FeaturedQualifications" size="80" value="" /></td>
</tr>
<tr valign="top">
<th scope="row">特色简介:</th>
<td>
<?php wp_editor( '', FeaturedSynopsis, $settings = array(
tinymce=>1,
media_buttons=>0,
textarea_rows=>4,
editor_class=>"textareastyle") );
?>
</td>
</tr>
<tr valign="top">
<th scope="row">其他:</th>
<td><input type="text" name="Others" size="60" value="" /></td>
</tr>
</table>
<p class="submit">
<input type="submit" class="button-primary" value="<?php _e('插入') ?>" />
</p>
</form>
<h2>医生著作资料录入</h2>
<form method="post" enctype="multipart/form-data">
<input type="hidden" name="DO" value="DoctorWorks" />
<?php settings_fields( 'myoption-group'); ?>
<table class="form-table">
<!-- <tr valign="top">
<th scope="row">著作ID:</th>
<td><input type="text" name="WorksID" size="20" value="" /></td>
</tr> -->
<tr valign="top">
<th scope="row">著作名称:</th>
<td><input type="text" name="WorksName" size="30" value="" /></td>
<tr valign="top">
<th scope="row">著作图片:</th>
<td><input type="file" name="WorksImagePath" size="20" value="" /></td>
</tr>
<!-- <tr valign="top">
<th scope="row">医生ID:</th>
<td><input type="" name="DoctorID" size="20" value="" /></td>
</tr>
<tr valign="top">
<th scope="row">医生名称:</th>
<td><input type="text" name="DoctorName" size="50" value="" /></td>
</tr> -->
<tr valign="top">
<th scope="row">作者:</th>
<td><input type="text" name="Author" size="50" value="" /></td>
</tr>
<tr valign="top">
<th scope="row">作者单位:</th>
<td><input type="text" name="AuthorUnit" size="50" value="" /></td>
</tr>
<tr valign="top">
<th scope="row">出版年份:</th>
<td><input type="text" name="PublicationYear" size="50" value="" /></td>
</tr>
<tr valign="top">
<th scope="row">著作内容:</th>
<td>
<?php wp_editor( '', WorksContent, $settings = array(
tinymce=>1,
media_buttons=>0,
textarea_rows=>4,
editor_class=>"textareastyle") );
?>
</td>
</tr>
<tr valign="top">
<th scope="row">是否重点推荐:</th>
<td><input type="checkbox" name="RecommendFlg" size="20" value="" /></td>
</tr>
</table>
<p class="submit">
<input type="submit" class="button-primary" value="<?php _e('插入') ?>" />
</p>
</form>
</div>