|
<?
# **********************************************************
# 行の削除
# **********************************************************
function DeleteRowData( &$SQL ) {
global $ErrMessage;
foreach( $_POST as $Key => $Value ) {
if ( substr( $Key, 0, 3 ) == "Del" ) {
if ( $Value == "1" ) {
$Query = "delete from 商品分類マスタ";
$Query .= " where 商品分類 = '";
$Query .= str_replace ( "Del", "", $Key );
$Query .= "'";
if ( !$SQL->Execute( $Query ) ) {
$ErrMessage = '更新に失敗しました';
return FALSE;
}
}
}
}
}
# **********************************************************
# 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']}%'";
}
$Cond .= " order by 商品分類";
$Column = $SQL->QueryEx( $Query . $Cond );
while ( $Column ) {
EditQueryData( $Column );
$Column = $SQL->QueryEx( );
}
}
# **********************************************************
# データベースデータの編集
# **********************************************************
function EditQueryData( &$Column ) {
global $OutData;
$OutData .= "<TR>";
$OutData .= "<TD style='background-color:white'>";
$OutData .= $Column['商品分類'];
$OutData .= "</TD>";
$OutData .= "<TD style='background-color:white'>";
$OutData .= $Column['名称'];
$OutData .= "</TD>";
$OutData .= "<TD style='background-color:white'>";
$OutData .= "<INPUT type=checkbox value=1 name=Del";
$OutData .= $Column['商品分類'];
if ( $_POST["Del" . $Column['商品分類']] == "1" ) {
$OutData .= " checked ";
}
$OutData .= ">";
$OutData .= "</TD>";
$OutData .= "</TR>\n";
}
# **********************************************************
# ヘッド部の編集
# **********************************************************
function EditDataHead( ) {
global $Target,$KeyField,$KeyName;
}
# **********************************************************
# ボディ部の編集
# **********************************************************
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;
}
?>
| |