"; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; $i=$first; while ($row = mysql_fetch_array($result)) { echo " "; echo " "; echo " "; //title echo " "; echo ""; $i = $i+1; } echo "

 

PSU e-Thesis Database

"; if (!($query)){ switch ( $case ) { case 1: { /* $keyword = $_POST["keyword"]; $select_from = $_POST["select_from"]; $andor = $_POST["andor"]; $select_major = $_POST["select_major"]; */ $length = strlen($keyword); if ($length==0) { echo " No Keyword"; } else { $exp = explode(" ", $keyword); echo "ค้นหาจาก: ". $keyword." ตาม ".$select_from ."
"; // echo "major=".$select_major; $i = 0; $condition =""; // echo ("count exp= ".count($exp)); while ($i < count($exp)) { if ($i==0) { $condition = " (".$select_from." LIKE '%".$exp[$i]."%') "; } else { // if ($i < count($exp)-1) { $condition = $condition." ".$andor." (".$select_from." LIKE '%".$exp[$i]."%') "; } $i++; } $query = " SELECT bibno, title, pubyear, author, majorid, linkfull, linkabs FROM thesis WHERE ".$condition." ORDER BY pubyear, title " ; // echo "query=".$query; } }break; case 2: // เลือกปี { // $select_year = $_POST["select_year"]; echo "แสดงรายชื่อวิทยานิพนธ์ในปี ". $select_year."
"; $i = 0; $query = " SELECT bibno, title, pubyear, author, majorid, linkfull, linkabs FROM thesis WHERE pubyear = $select_year ORDER BY title " ; // echo "query=".$query; }break; default: // เลือกสาขาวิชา { echo "แสดงรายชื่อวิทยานิพนธ์ตามสาขาวิชา: ". $majorname."
"; $query = " SELECT bibno, title, pubyear, author, majorid, linkfull, linkabs FROM thesis WHERE majorid = '$majorid' ORDER BY pubyear DESC, title ASC "; // $query = 'SELECT bibno, title, pubyear, author, majorid, linkfull, linkabs FROM thesis WHERE majorid ="'.$majorid.'" ORDER BY pubyear DESC, title ASC'; }break; } } //get all result //echo "query...=".$query; //echo "
"; $result = mysql_query($query); //---------CODE for SPLIT PAGE------------------------------------ //-----------------------------math ------------------------------------------ $numrows= mysql_num_rows($result); if ($numrows == 0){ echo("No results found."); // bah, modify the "Not Found" error for your needs. exit();} $pages = intval($numrows/$limit); // Number of results pages. // $pages now contains int of pages, unless there is a remainder from division. if ($numrows % $limit) { $pages++;} // has remainder so add one page $current = ($page/$limit) + 1; // Current page number. if (($pages < 1) || ($pages == 0)) { $total = 1;} // If $pages is less than one or equal to 0, total pages is 1. else { $total = $pages;} // Else total pages is $pages value. $first = $page + 1; // The first result. if (!((($page + $limit) / $limit) >= $pages) && $pages != 1) { $last = $page + $limit;} //If not last results page, last result equals $page plus $limit. else{ $last = $numrows;} // If last results page, last result equals total number of results. //------------------------------------------------------------------------------ //escape from PHP mode. echo " พบจำนวน ".mysql_num_rows($result). " รายการ
"; $query1 = $query." LIMIT $page, $limit"; //echo "query...=".$query; $result = mysql_query($query1); ?>
Results - of Page of
 
"; ?> Results per-page: 5 | 10 | 20 | 50
"; echo "

No.
Year
Title
Author
Links
$i.
$row[2] "; //year echo "
$row[1]
 
$row[3] "; //author echo " "; if ($row[5] <> "") { echo " Fulltext
"; } if ($row[6] <> "") { echo " Abstract"; } echo "
"; ?>

back \n");} for ($i=1; $i <= $pages; $i++) // loop through each page and give link to it. { $ppage = $limit*($i - 1); if ($ppage == $page){ echo("$i\n");} // If current page don't give link, just text. else{ echo("$i \n");} //echo "query...=".$query."
"; } if (!((($page+$limit) / $limit) >= $pages) && $pages != 1) { // If last page don't give next link. $next_page = $page + $limit; echo(" next");} mysql_close(); ?>

กลับหน้าค้นหา