//$host="203.121.182.153";
$host="localhost";
$username_db="rcopt_admin";
$password_db="AQHOF5dB";
$dbname="rcopt_db";
$link=mysql_connect($host,$username_db,$password_db);
mysql_select_db($dbname,$link);
mysql_query('SET CHARACTER SET tis620');
mysql_query("SET character_set_client = tis620");
mysql_query("SET character_set_connection = tis620");
//////////////////////////////////////////////////////////////////////////// ฟังชั่นแสดงข่าวหน้าแรก
// $no=ประเภทข่าว
// $start=เริ่มเร็กคอร์ดที่
// $end=จบเร็กคอร์ดที่
function addday($quantity){
$day = date(d) + $quantity;
return date("Y-m-d",mktime(0,0,0,date(m),$day,date(Y)));
}
function dmy($date_in){
global $year;
$date_temp = split("-",$date_in);
return $date_temp[2]."/".$date_temp[1]."/".($date_temp[0]+$year);
}
function Show_newpaper($no,$start,$end) {
$cur_date = date("Y-m-d") ;
$result = mysql_query("SELECT * FROM data WHERE View_status='Y' && Section='$no' && Date_start <= '$cur_date' && Date_end >= '$cur_date' ORDER BY ID DESC LIMIT $start,$end ") or die ("Can not SELECT table 'data' ") ;
echo " " ;
while($data=mysql_fetch_array($result)) {
$id=$data["ID"];
$section=$data["Section"];
$title=$data["Title"];
$sdetail=$data["Sdetail"];
$simage=$data["Simage"];
$post_by=$data["Post_by"];
$post_date=$data["Post_date"];
if (!$simage) {
$simage = "nopic.gif";
}
echo" ";
echo" ";
echo" $title | ";
echo" ";
echo"";
echo" $sdetail | ";
echo" ";
echo"";
echo"ผู้เขียน: $post_by วันที่ :$post_date อ่านเพิ่ม >>
| ";
echo" ";
echo" ";
} // จบ while
mysql_free_result($result);
}
//////////////////////////////// ฟังชั่นแสดงข่าวหน้าแรกแบบไม่ มีภาพ /////////////////////////////////////////
// $no=ประเภทข่าว
// $start=เริ่มเร็กคอร์ดที่
// $end=จบเร็กคอร์ดที่
function Show_newpaper_nonpic($no,$start,$end) {
$cur_date = date("Y-m-d") ;
$result = mysql_query("SELECT * FROM data
WHERE View_status='Y' && Section='$no' && Date_start <= '$cur_date' && Date_end >= '$cur_date' && ID!='24'
ORDER BY ID DESC LIMIT $start,$end ") or die ("Can not SELECT table 'data' ") ;
echo " " ;
while($data=mysql_fetch_array($result)) {
$id=$data["ID"];
$section=$data["Section"];
$title=$data["Title"];
$post_by=$data["Post_by"];
$post_date=$data["Post_date"];
echo " $title ";
} // จบ while
mysql_free_result($result);
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////// แสดง list box เรียกข้อมุลจากฐานข้อมูล
function List_box() {
$result = mysql_query("SELECT * FROM type_newpaper ") or die ("Can not SELECT Table 'type_newpaper' ");
$num_rows= mysql_num_rows($result);
if($num_rows != "") {
echo "";
}else {
echo "";
}
}
function List_num_province($pro,$no) {
for($i=0;$i<$no;$i++) {
$check_num = mysql_query("SELECT * FROM member_full WHERE work_pro='$pro[$i]' ") or die("Can not SELECT Table 'member_full' ");
$center= mysql_num_rows($check_num) ;
echo "$pro[$i] มีจำนวนแพทย์ทั้งหมด $center คน ";
}
}
?>
Fatal error: Call to undefined function Show_newpaper_nonpic() in /var/www/rcoptwww/2009/ophthalmology-journal/index.php on line 1367
|