ADODBのページャ機能のカスタマイズ

Yahoo!ブックマークに登録 はてなにブックマーク このページをdel.icio.usに登録 この記事をLivedoorクリップ! このエントリをニフティクリップに登録 このエントリをBuzzurlにブックマーク このページを POOKMARK Airlines の行き先に登録する このエントリを BlogPeople Instant Bookmark に登録 PingKingポッケに追加

あるレコードセットを表示させたいときにつかえるページャ。
ADODBについてきているのでカスタマイズして使ってみる。

adodb-pager.inc.phpを開く。

function RenderGrid()
がメインのDBからのクエリー結果が表示される部分。
こうなってる。


function RenderGrid()
{
global $gSQLBlockRows; // used by rs2html to indicate how many rows to display
	include_once(ADODB_DIR.'/tohtml.inc.php');
	ob_start();
	$gSQLBlockRows = $this->rows;
	rs2html($this->rs,$this->gridAttributes,$this->gridHeader,$this->htmlSpecialChars);
	$s = ob_get_contents();
	ob_end_clean();
	return $s;
}

上記をこういう様に変更。


function RenderGrid()
{
global $gSQLBlockRows; // used by rs2html to indicate how many rows to display

	//include_once(ADODB_DIR.'/tohtml.inc.php');   //コメントアウト!
	ob_start();
	$gSQLBlockRows = $this->rows;
	//rs2html($this->rs,$this->gridAttributes,$this->gridHeader,$this->htmlSpecialChars);   //コメントアウト!

	while (!$this->rs->EOF) {
		$row = $this->rs->fields;

		//ここに表示したいフィールドやhtmlを書く

		echo $row["id"];
		echo $row["entry_date"];
		echo $row["entry_title"];

		//ここに処理を書く

		$this->rs->MoveNext();
	}

	$s = ob_get_contents();
	ob_end_clean();
	return $s;
}

簡単!!。

function RenderLayout()を修正すれば、外側のテーブルをはずしたりできるし。
何かの検索結果をページャで表示させたいのならば、

下記関数の

Render_First
render_next
render_last
render_prev

のリンク内容の部分を書き換えればいい。

めもでした。

  • Both comments and trackbacks are currently closed.
  • Trackback URI:
  • Comments RSS 2.0

Comments are closed.

Templates Browser
Pros And Cons Of Education Online For People of the World
Make Differences Through Education Education

Things to remember when getting an admission to the training school

Training schools and colleges worth a lot as they provide all the various kinds of training ns material that professional need in order to get ahead of their profession ad contribute at their best. In Australia, people can surely find lots of schools and colleges that offer high quality training options for the students as well as for the professional who looking to enhance their skill for better capabilities.

There are courses like Diploma of Community Services, Certificate III in Information Digital Media and Technology, Diploma of Work Health and Safety, Certificate II in Business and Retail Management Courses as well as the Advanced Diploma of Leadership and Management and Aged Care Training schools offering professional diplomas and courses that offer higher level training.

There are many things that you must be keeping mind in order to help yourself getting things better and get the training you need, but the most important things you should never forget are:

You should never enroll or opt to enroll in courses which are wide apart as you will be stuck nowhere and may have to manage things that you are not familiar with. In case if you are likely to get more courses you may consider to have enrolled in courses that you like the most, you should consider having the ones which are related or have similar content in them as well as same level and area of training.

As for example if you are going to attend the Business Management Courses, you should be aware that instead of aged care course you must be looking forward to get to the Diploma Of Business Management.

Further you should know that if you have to get to the top level courses you should not hesitate to enroll in the preliminary courses as they would help you learn things better.

Break up Area

Pros And Cons Of Education Online For People of the World

More and more young people choose non-traditional education to start and develop

Make Differences Through Education Education

Natural ability and talent can not be taken from anyone. Education, however, makes

Make Differences Through Education Education

Natural ability and talent can not be taken from anyone. Education, however, makes

Two Language Language Studies

According to the 2006 Parliamentary Committee of Parliament, Science and Education

Get in touch!

Contact Us

email us at radik.homichev@templatesbrowser.com

- or -

send us a mail at:

69 Chatsworth Road, EWINGAR, New South Wales, 2469, Australia