PHP (1)


  Main SCRIPT (main.php)




  

<?
# **************************************************************************
# ƒXƒNƒŠƒvƒg‹¤’Ê•Ï”
# **************************************************************************
$Common_dir	= "\\localweb\\php\\require\\";
$Form_name	= "frmMain";

# **************************************************************************
# ŠO•”ƒtƒ@ƒCƒ‹
# **************************************************************************
require_once( $Common_dir . "std.php" );
require_once( "value.php" );
require_once( "action.php" );
?>	

<HTML>
<?
# **************************************************************************
# ƒXƒNƒŠƒvƒgŒÅ—L‚̉Šú‰»
# **************************************************************************
	$VAL = new PgValue();

# **************************************************************************
# HEADEBODYEFORM
# **************************************************************************
	LoadHead( "‚c‚aƒe[ƒuƒ‹ƒƒ“ƒeƒiƒ“ƒX", $Common_dir . "css.php" );
	LoadBody( "" );
	LoadForm( Dd( $Form_name ), "" );

# **************************************************************************
# DB ƒCƒ“ƒXƒ^ƒ“ƒX
# **************************************************************************
	$SQL = new DB( "LAYLA", "LBOX", "sa", "" );

# **************************************************************************
# ˆ—ƒRƒ“ƒgƒ[ƒ‹
# **************************************************************************
	if ( strtoupper( $HTTP_ENV_VARS["REQUEST_METHOD"] ) == "GET" ) {
		F_LoadDataInit( $SQL, $VAL );
	}
	else {
		switch( $cmd_send ) {
			case "Previous":		
					F_LoadDataPrev( $SQL, $VAL );
				break;	
			case "Next":		
					F_LoadDataNext( $SQL, $VAL );
				break;	
		}
	}	

# **************************************************************************
# ƒrƒ…[
# **************************************************************************
	require_once( "view.php" );	

# **************************************************************************
# Ú‘±‰ðœ
# **************************************************************************
	$SQL->Close();

?>
  

  •Ï”ƒNƒ‰ƒX (value.php)

  

<?	
OutCr( "<!--value.php-->" );	

# *****************************************************************************	
# •Ï”ƒNƒ‰ƒX	
# *****************************************************************************	
class PgValue {	

	var $LineMax;
	var $Cnt;

	var $dtDen;
	var $strTanto;
	var $nKin;
	var $nNai;
	var $nGai;
	var $dtSei;			
	var $strBiko;			

	var $StartKey;			
	var $EndKey;			

# *********************************************************				
# ƒRƒ“ƒXƒgƒ‰ƒNƒ^				
# *********************************************************				
	function PgValue( ) {			

		global $start_key;		
		global $end_key;		

		$this->LineMax		= 5;
		$this->Cnt		= 0;

		if ( isset( $start_key ) ) {			
			$this->StartKey		= $start_key;
			$this->EndKey		= $end_key;
		}			
		else {			
			$this->StartKey		= "";
			$this->EndKey		= "";
		}			
	}				

}					

?>					
  

  ƒT[ƒo[ƒTƒCƒhƒ‚ƒfƒ‹ (action.php)

  

<?
OutCr( "<!--action.php-->" );
# *****************************************************************************
# ƒf[ƒ^ƒZƒbƒg
# *****************************************************************************
function F_SetData( &$SQL, &$VAL ) {
	for ( $i = 0; $i < $VAL->LineMax; $i++ ) {
		if ( FALSE == $SQL->Fetch() ) {		
			break;	
		}		
		if ( $i == 0 ) {		
			$VAL->StartKey = $SQL->Field[7];	
		}		
		$VAL->dtDen[$i]		= $SQL->Field[0];
		$VAL->strTanto[$i]		= $SQL->Field[1];
		$VAL->nKin[$i]		= $SQL->Field[2];
		$VAL->nNai[$i]		= $SQL->Field[3];
		$VAL->nGai[$i]		= $SQL->Field[4];
		$VAL->dtSei[$i]		= $SQL->Field[5];
		$VAL->strBiko[$i]		= $SQL->Field[6];

		$VAL->EndKey = $SQL->Field[7];		
	}			
	return $i;			
}
# *****************************************************************************
# ‰Šúƒf[ƒ^EƒJƒŒƒ“ƒgƒf[ƒ^
# *****************************************************************************
function F_LoadDataInit( &$SQL, &$VAL ) {
	$SqlQuery = "select *,convert(char(10),‰ÁH’À“`•[“ú•t,111)+’S“–ŽÒƒR[ƒh";
	$SqlQuery .= " from T_SV‰ÁH’À“`•[";			
	$SqlQuery .= " where convert(char(10),‰ÁH’À“`•[“ú•t,111)+’S“–ŽÒƒR[ƒh >= '{$VAL->StartKey}'";
	$SqlQuery .= " order by ‰ÁH’À“`•[“ú•t,’S“–ŽÒƒR[ƒh";
	$SQL->Query( $SqlQuery );

	F_SetData( $SQL, $VAL );
	$SQL->Free();
}	
# *****************************************************************************	
# ŽŸƒf[ƒ^	
# *****************************************************************************	
function F_LoadDataNext( &$SQL, &$VAL ) {	
	$SqlQuery = "select *,convert(char(10),‰ÁH’À“`•[“ú•t,111)+’S“–ŽÒƒR[ƒh";
	$SqlQuery .= " from T_SV‰ÁH’À“`•[";
	$SqlQuery .= " where convert(char(10),‰ÁH’À“`•[“ú•t,111)+’S“–ŽÒƒR[ƒh > '{$VAL->EndKey}'";
	$SqlQuery .= " order by ‰ÁH’À“`•[“ú•t,’S“–ŽÒƒR[ƒh";
	$SQL->Query( $SqlQuery );

	$i = F_SetData( $SQL, $VAL );	
	$SQL->Free();	
	if ( $i == 0 ) {	
		F_LoadDataInit( $SQL, $VAL );
	}	
}		
# *****************************************************************************
# ‘Oƒf[ƒ^		
# *****************************************************************************
function F_LoadDataPrev( &$SQL, &$VAL ) {
	$SqlQuery = "select *,convert(char(10),‰ÁH’À“`•[“ú•t,111)+’S“–ŽÒƒR[ƒh";
	$SqlQuery .= " from T_SV‰ÁH’À“`•[";	
	$SqlQuery .= " where convert(char(10),‰ÁH’À“`•[“ú•t,111)+’S“–ŽÒƒR[ƒh < '{$VAL->StartKey}'";
	$SqlQuery .= " order by ‰ÁH’À“`•[“ú•t desc,’S“–ŽÒƒR[ƒh desc";	
	$SQL->Query( $SqlQuery );	

	// “Ç‚Ý”ò‚΂µ		
	for ( $i = 0; $i < $VAL->LineMax; $i++ ) {		
		if ( FALSE == $SQL->Fetch() ) {	
			break;
		}	
		if ( $i == 0 ) {	
			$VAL->EndKey = $SQL->Field[7];
		}	
		$VAL->StartKey = $SQL->Field[7];	
	}		
	$SQL->Free();		
	F_LoadDataInit( $SQL, $VAL );		
}			
?>			
  

  ƒf[ƒ^ƒx[ƒXƒNƒ‰ƒX (db.php)

  

<?
OutCr( "<!--db.php-->" );
# *****************************************************************************
# ƒf[ƒ^ƒx[ƒXƒNƒ‰ƒX
# *****************************************************************************
class DB {	

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

# *********************************************************	
# ƒRƒ“ƒXƒgƒ‰ƒNƒ^	
# *********************************************************	
	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;	
	}		
# *********************************************************
# ƒNƒGƒŠ[			
# *********************************************************
	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ŽÀs			
# *********************************************************
	function Execute( $Sql ) {		
		mssql_query( $Sql, $this->Connect );	
	}		
# *********************************************************
# ƒtƒFƒbƒ`			
# *********************************************************
	function Fetch( ) {		
		$this->Field = mssql_fetch_array( $this->Result );
		return $this->Field;
	}	
# *********************************************************
# ƒtƒB[ƒ‹ƒh–¼		
# *********************************************************
	function FieldName( $i ) {	
		return mssql_field_name( $this->Result, $i );
	}	
# *********************************************************
# ŠJ•ú		
# *********************************************************
	function Free( ) {	
		mssql_free_result( $this->Result );
	}	
# *********************************************************
# Ú‘±‰ðœ		
# *********************************************************
	function Close( ) {	
		mssql_close( $this->Connect );
	}	

}

?>
  

  ƒ^ƒOŠÖ” (loadblk.php)

  

<?
OutCr( "<!--loadblk.php-->" );

# ****************************************************************************************
# HEAD ’è‹`‚̃[ƒh
# ****************************************************************************************
function LoadHead( $Title, $Css ) {

	OutCr( "<HEAD>" );	

	OutCr( "<TITLE>{$Title}</TITLE>" );	
	if ( $Css != "" ) {	
		OutCr( "<style type=\"text/css\">" );
		require_once( $Css );
		OutCr( "</style>" );
	}	
	OutCr( "</HEAD>" );	

}		

# ****************************************************************************************
# BODY ’è‹`‚̃[ƒh
# ****************************************************************************************
function LoadBody( $Option ) {

	if ( $Option == "" ) {	
		OutCr( "<BODY>" );
	}	
	else {	
		OutCr( "<BODY $Option>" );
	}	

}	

# ****************************************************************************************
# FORM ’è‹`‚̃[ƒh	
# ****************************************************************************************
function LoadForm( $FormName, $Option ) {	

	global $HTTP_ENV_VARS;

	OutCr( "<FORM method=post action=\"{$HTTP_ENV_VARS["SCRIPT_NAME"]}\" name=$FormName $Option>" );

}	

?>	
  

  ƒXƒ^ƒCƒ‹ƒV[ƒg (css.php)

  

<?		
echo <<<CSS		
	body { background-color:#c0c0c0 }	
	h1 {color:#0000ff;font-size:26;font-family:Verdana,"‚l‚r ‚oƒSƒVƒbƒN";}	
	th {color:#ffffff;font-size:14;font-family:Verdana,"‚l‚r ‚oƒSƒVƒbƒN";	
		background-color:#0077cc;text-align:center;}
	td {color:#000000;font-size:12;font-family:Verdana,"‚l‚r ‚oƒSƒVƒbƒN";	
		background-color:#ffffff;}

CSS;		
?>		
  

  VIEW (view.php)

  

<?
#$Common_dir	= "\\localweb\\php\\require\\";	
#$Form_name	= "frmMain";	
#require( $Common_dir . "std.php" );
#LoadHead( "", $Common_dir . "css.php" );
#LoadBody( "" );
#LoadForm( Dd( $Form_name ), "" );
echo <<<MAIN
<center>
<h1>‰ÁH’À“`•[</h1>
<table border=1 cellpadding=5>
	<tr>	
		<th>“`•[“ú•t</th>
		<th>’S“–ŽÒ</th>
		<th>‹àŠzŒv</th>
		<th>“àÅŒv</th>
		<th>ŠOÅŒv</th>	
		<th>¿‹“ú</th>	
		<th>“E—v</th>	
	</tr>
	<!-- row:1 -->
	<tr>
		<td>{$VAL->dtDen[0]}	&nbsp;</td>
		<td>{$VAL->strTanto[0]}	&nbsp;</td>
		<td align=right>&nbsp;{$VAL->nKin[0]}</td>	
		<td align=right>&nbsp;{$VAL->nNai[0]}</td>	
		<td align=right>&nbsp;{$VAL->nGai[0]}</td>	
		<td>{$VAL->dtSei[0]}	&nbsp;</td>
		<td>{$VAL->strBiko[0]}	&nbsp;</td>
	</tr>
	<!-- row:2 -->
	<tr>
		<td>{$VAL->dtDen[1]}	&nbsp;</td>
		<td>{$VAL->strTanto[1]}	&nbsp;</td>
		<td align=right>&nbsp;{$VAL->nKin[1]}</td>	
		<td align=right>&nbsp;{$VAL->nNai[1]}</td>	
		<td align=right>&nbsp;{$VAL->nGai[1]}</td>	
		<td>{$VAL->dtSei[1]}	&nbsp;</td>
		<td>{$VAL->strBiko[1]}	&nbsp;</td>
	</tr>
	<!-- row:3 -->
	<tr>
		<td>{$VAL->dtDen[2]}	&nbsp;</td>
		<td>{$VAL->strTanto[2]}	&nbsp;</td>
		<td align=right>&nbsp;{$VAL->nKin[2]}</td>	
		<td align=right>&nbsp;{$VAL->nNai[2]}</td>	
		<td align=right>&nbsp;{$VAL->nGai[2]}</td>	
		<td>{$VAL->dtSei[2]}	&nbsp;</td>
		<td>{$VAL->strBiko[2]}	&nbsp;</td>
	</tr>
	<!-- row:4 -->
	<tr>
		<td>{$VAL->dtDen[3]}	&nbsp;</td>
		<td>{$VAL->strTanto[3]}	&nbsp;</td>
		<td align=right>&nbsp;{$VAL->nKin[3]}</td>	
		<td align=right>&nbsp;{$VAL->nNai[3]}</td>	
		<td align=right>&nbsp;{$VAL->nGai[3]}</td>	
		<td>{$VAL->dtSei[3]}	&nbsp;</td>
		<td>{$VAL->strBiko[3]}	&nbsp;</td>
	</tr>
	<!-- row:5 -->
	<tr>
		<td>{$VAL->dtDen[4]}	&nbsp;</td>
		<td>{$VAL->strTanto[4]}	&nbsp;</td>
		<td align=right>&nbsp;{$VAL->nKin[4]}</td>	
		<td align=right>&nbsp;{$VAL->nNai[4]}</td>	
		<td align=right>&nbsp;{$VAL->nGai[4]}</td>	
		<td>{$VAL->dtSei[4]}	&nbsp;</td>
		<td>{$VAL->strBiko[4]}	&nbsp;</td>
	</tr>
</table>	
<br>	
<table border=0>	
	<tr>
		<td>	
			<input type="submit" name="cmd_send" value="Previous" style="width:80px">
		</td>	
		<td>	
			<input type="submit" name="cmd_send" value="Next" style="width:80px">
		</td>	
	</tr>
</table>	
<br>	
StartKey <input type="text" name="start_key" value="$VAL->StartKey"><br>
EndKey <input type="text" name="end_key" value="$VAL->EndKey">
</FORM>	
</BODY>	
</HTML>	

MAIN;	
?>	
  




yahoo  google  MSDN  MSDN(us)  WinFAQ  Win Howto  tohoho  ie_DHTML  vector  wdic  Ž«‘  “V‹C 


[ProjectBoard]
CCBot/2.0 (https://commoncrawl.org/faq/)
24/10/05 15:42:35
InfoBoard Version 1.00 : Language=Perl

1 BatchHelper COMprog CommonSpec Cprog CprogBase CprogSAMPLE CprogSTD CprogSTD2 CprogWinsock Cygwin GameScript HTML HTMLcss InstallShield InstallShieldFunc JScript JScriptSAMPLE Jsfuncs LLINK OldProg OracleGold OracleSilver PRO PRObrowser PROc PROconePOINT PROcontrol PROftpclient PROjscript PROmailer PROperl PROperlCHAT PROphp PROphpLesson PROphpLesson2 PROphpLesson3 PROphpfunction PROphpfunctionArray PROphpfunctionMisc PROphpfunctionString PROsql PROvb PROvbFunction PROvbString PROvbdbmtn PROvbonepoint PROwebapp PROwin1POINT PROwinSYSTEM PROwinYOROZU PROwindows ProjectBoard RealPHP ScriptAPP ScriptMaster VBRealtime Vsfuncs a1root access accreq adsi ajax amazon argus asp aspSample aspVarious aspdotnet aw2kinst cappvariety centura ckeyword classStyle cmaterial cmbin cmdbapp cmenum cmlang cmlistbox cmstd cmstdseed cmtxt cs daz3d db dbCommon dbaccess dnettool dos download flex2 flex3 flex4 framemtn framereq freeWorld freesoft gimp ginpro giodownload google hdml home hta htmlDom ie9svg install java javaSwing javascript jetsql jquery jsp jspTest jspVarious lightbox listasp listmsapi listmsie listmsiis listmsnt listmspatch listmsscript listmsvb listmsvc memo ms msde mysql netbeans oraPlsql oracle oracleWiper oraclehelper orafunc other panoramio pear perl personal pgdojo pgdojo_cal pgdojo_holiday pgdojo_idx pgdojo_ref pgdojo_req php phpVarious phpguide plsql postgres ps r205 realC realwebapp regex rgaki ruby rule sboard sc scprint scquest sdb sdbquest seesaa setup sh_Imagick sh_canvas sh_dotnet sh_google sh_tool sh_web shadowbox shgm shjquery shvbs shweb sjscript skadai skywalker smalltech sperl sqlq src systemdoc tcpip tegaki three toolbox twitter typeface usb useXML vb vbdb vbsfunc vbsguide vbsrc vpc wcsignup webanymind webappgen webclass webparts webtool webwsh win8 winofsql wmi work wp youtube