|
<?
# **********************************************************
# SQL文字列作成用
# **********************************************************
function SetCond( &$Value ) {
if ( $Value == "" ) {
$Value .= " where ";
}
else {
$Value .= " and ";
}
}
# **********************************************************
# データベースデータの読出し
# **********************************************************
function GetData( &$SQL ) {
global $Target,$KeyField,$KeyName;
$Query = 'select * from ' . $Target;
$Cond = "";
# 最初の条件
if ( $_POST['In1001'] != "" ) {
SetCond( $Cond );
$Cond .= "名称 like '%{$_POST['In1001']}%'";
}
# 2つ目の条件
if ( $_POST['In1002'] != "" ) {
SetCond( $Cond );
$Cond .= "left(商品分類,1) = '{$_POST['In1002']}'";
}
$Column = $SQL->QueryEx( $Query . $Cond );
while ( $Column ) {
EditQueryData( $Column );
$Column = $SQL->QueryEx( );
}
}
# **********************************************************
# データベースデータの編集
# **********************************************************
function EditQueryData( &$Column ) {
global $OutData;
$OutData .= "<TR>\n";
$OutData .= "<TD>";
$OutData .= $Column['商品分類'];
$OutData .= "</TD>\n";
$OutData .= "<TD>{$Column['名称']}</TD>\n";
$OutData .= "</TR>\n";
}
# **********************************************************
# ヘッド部の編集
# **********************************************************
function EditDataHead( ) {
global $Target,$KeyField,$KeyName;
global $OptionList,$SQL;
$Query = 'select コード,名称 from コード名称マスタ';
$Query .= " where 区分 = 5 order by コード";
$OptionList = CreateOption( $SQL, "In1002", $Query );
}
# **********************************************************
# ボディ部の編集
# **********************************************************
function EditDataBody( ) {
global $Target,$KeyField,$KeyName;
}
# **********************************************************
# 更新処理
# **********************************************************
function UpdateData( &$SQL ) {
global $ErrMessage,$Message;
global $Target,$KeyField,$KeyName;
return TRUE;
}
# **********************************************************
# 削除処理
# **********************************************************
function DeleteData( &$SQL ){
global $ErrMessage,$Message;
global $Target,$KeyField,$KeyName;
return TRUE;
}
# **********************************************************
# ヘッド部のエラーチェック
# **********************************************************
function CheckDataHead( ) {
global $ErrMessage;
global $Target,$KeyField,$KeyName;
return TRUE;
}
# **********************************************************
# ボディ部のエラーチェック
# **********************************************************
function CheckDataBody( ) {
global $ErrMessage;
global $Target,$KeyField,$KeyName;
return TRUE;
}
?>
| |