<!-- 6-3 クラスのクラスを作ってみよう(クラスの継承) --> <!-- 派生クラスを使ってみよう --> <?php require_once 'DBGoods.php'; $dbGoods = new DBGoods(); // 新規登録の処理 if (isset($_POST['insert'])) { $dbGoods->InsertGoods(); } // 全レコードを表示する処理 $recordlist = $dbGoods->SelectGoodsAll(); ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>クラスの活用</title> </head> <body> <h1>goodsマスターテーブル</h1> <form action="" method="post"> <label>GoodsID<input type="text" name='GoodsID' size="8" required ></label> <label>GoodsName<input type="text" name='GoodsName' size="30" required ></label> <label>Price<input type="text" name='Price' size="8" required ></label> <input type='submit' name='insert' value=' 登録 '> </form> <hr /> <?php echo $recordlist; ?> <td></td>
$entryCss = "class='hideArea'"; $updateCss = ""; } else { $entryCss = ""; $updateCss = "class='hideArea'"; } // 削除処理 if (isset($_POST['delete'])) { $dbGoods->DeleteGoods($_POST['id']); } // 新規登録処理 if (isset($_POST['submitEntry'])) { $dbGoods->InsertGoods(); } // テーブルデータの一覧表示 $data = $dbGoods->SelectGoodsAll(); ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>売上管理システム</title> <link rel="stylesheet" type="text/css" href="../Chapter7/css/style.css" /> <script type="text/javascript"> function CheckDelete(){ return confirm("削除してもよろしいですか?"); } </script> </head> <body> <div id="menu">