雛形

  control.php



  
<?
# ************************************************
# 外部ファイル
# ************************************************
require_once( "global.php" );
require_once( "db.php" );
require_once( "model.php" );
require_once( "value.php" );

# ************************************************
# スクリプト固有の初期化
# ************************************************
	$VAL = new PgValue(10);

# ************************************************
# DB インスタンス
# ************************************************
	$SQL = new DB( "サーバ名", "データベース名", "sa", "" );

# ************************************************
# 処理コントロール
# ************************************************
	switch ( $_ENV["REQUEST_METHOD"] ) {
		case "GET":
			break;
		case "POST":
			break;
	}

# ************************************************
# ビュー
# ************************************************
	require_once( "view.php" );

# ************************************************
# 接続解除
# ************************************************
	$SQL->Close();

?>

  

  global.php



  
<?
# ************************************************
# HTTPヘッダの出力
# ************************************************
header( "Content-Type: text/html; Charset=shift_jis" );

?>

  

  db.php

  
<?	
# *************************************************
# データベースクラス
# *************************************************
class DB {

	var $Connect;
	var $Result;
	var $Field;
	var $Cols;
	var $Rows;

# *************************************************
# コンストラクタ
# *************************************************
	function DB( $Server, $DbName, $User, $Password ) {
		$this->Connect = mssql_connect( $Server, $User, $Password );
		mssql_select_db( $DbName, $this->Connect );
		$this->Cols = 0;
		$this->Rows = 0;
	}
# *************************************************
# クエリー
# *************************************************
	function Query( $SqlQuery ) {
		$this->Result = mssql_query( $SqlQuery, $this->Connect );
		if ( $this->Result == FALSE ) {
			$this->Cols = 0;
			$this->Rows = 0;
		}
		else {
			$this->Cols = mssql_num_fields( $this->Result );
			$this->Rows = mssql_num_rows( $this->Result );
		}
		return $this->Result;
	}
# *************************************************
# SQL実行
# *************************************************
	function Execute( $Sql ) {
		mssql_query( $Sql, $this->Connect );
	}
# *************************************************
# フェッチ			
# *************************************************
	function Fetch( ) {
		$this->Field = mssql_fetch_array( $this->Result );
		return $this->Field;
	}
# *************************************************
# フィールド名
# *************************************************
	function FieldName( $i ) {
		return mssql_field_name( $this->Result, $i );
	}
# *************************************************
# 開放
# *************************************************
	function Free( ) {
		mssql_free_result( $this->Result );
	}
# *************************************************
# 接続解除
# *************************************************
	function Close( ) {
		mssql_close( $this->Connect );
	}

}

?>

  

  model.php

  
<?
# ************************************************
# データセット
# ************************************************
function F_SetData( &$SQL, &$VAL ) {

}
# ************************************************
# 初期データ・カレントデータ
# ************************************************
function F_LoadDataInit( &$SQL, &$VAL ) {

}
# ************************************************
# 次データ
# ************************************************
function F_LoadDataNext( &$SQL, &$VAL ) {

}
# ************************************************
# 前データ
# ************************************************
function F_LoadDataPrev( &$SQL, &$VAL ) {

}
?>

  

  value.php

  
<?	
# ************************************************
# 変数クラス
# ************************************************
class PgValue {

	var $LineMax;

# ************************************************
# コンストラクタ
# ************************************************
	function PgValue( $nMax ) {

		$this->LineMax = $nMax;

	}

}
?>

  

  view.php

  
<HTML>
<HEAD>
<TITLE>
</TITLE>
<? require_once( "css.php" ) ?>
</HEAD>
<BODY>
</BODY>
</HTML>

  

  css.php

  
<STYLE type="text/css">

	body	{ 
		background-color:#c0c0c0;
	}

	h1	{ 
		color:#0000ff;
		font-size:26;
		font-family:Verdana,"MS Pゴシック";
	}

	th	{ 
		color:#ffffff;
		font-size:14;
		font-family:Verdana,"MS Pゴシック";
	}

	td	{ 
		color:#000000;
		font-size:12px;
		font-family:Verdana,"MS Pゴシック";
	}

</STYLE>

  











   SQLの窓    create:2003/02/03  update:2014/09/07   管理者用(要ログイン)





フリーフォントWEBサービス

SQLの窓WEBサービス

SQLの窓フリーソフト

写真素材

一般WEBツールリンク

SQLの窓

フリーソフト

JSライブラリ