hjkhghopjkertteerterterterertertrtoirh
bnmbertsurhetertertertertertertertpdf'tdfg
/
srv
/
www
/
virtual
/
wccweb.jp
/
web
/
htdocs
/
golfex2023
/
admin
/
log
/
Upload FileeE
HOME
<?php require_once('../include/config.php'); require_once('../include/admin_function.php'); require_once('./inc.php'); $currentPath = '../'; //---------------------------------------------------------------------- // ログイン認証処理 (START) //---------------------------------------------------------------------- session_start(); authAdmin($userid,$password); //---------------------------------------------------------------------- // ログイン認証処理 (END) //---------------------------------------------------------------------- $id = !empty($_GET["id"]) ? $_GET["id"]:exit("パラメータがありません"); if(!is_num($id)) exit(); if(isset($_POST['del_submit'])){ //トークンチェック(CSRF対策) if(empty($_SESSION['token']) || ($_SESSION['token'] !== $_POST['token'])){ exit('ページ遷移エラー(トークン)'); } //トークン破棄 $_SESSION['token'] = ''; $query = "delete from $dataBaseTable where id = '$id'"; $res = mysqli_query($link,$query) or die(mysqli_error($link)); //画像削除 for($i=0;$i<21;$i++){ foreach($config['extensionList'] as $val){ //$upFilePath = $img_updir.'/'.$id.'.'.$val; $upFilePath = $img_updir.'/'.$id.'_'.$i.'.'.$val; //$upFilePathThumb = $img_updir.'/'.$id.'-'.$i.'s.'.$val; if(file_exists($upFilePath)){ unlink($upFilePath); } // if(file_exists($upFilePathThumb)){ // unlink($upFilePathThumb); // } } } }else{ $query = "select * from $dataBaseTable where id='$id'"; $res = mysqli_query($link,$query) or die(mysqli_error($link)); $dbResData = array(); while ($data = mysqli_fetch_assoc($res)) { foreach($data as $key => $val){ $dbResData[$key] = $val; } } if(empty($dbResData)) exit('データ無し(ページ遷移エラー)'); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja"> <head> <meta name="robots" content="noindex,nofollow" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>データ削除</title> <link rel="stylesheet" type="text/css" href="../css/style.css"> <?php require_once('../include/head.php');?> </head> <body> <div id="container"> <h1>データ削除</h1> <div id="logoutBtn" class="linkBtn"><a href="?logout=true">ログアウト</a></div> <div id="toTop" class="linkBtn"><a href="../">管理メニュートップへ</a></div> <div id="toPage" class="linkBtn"><a href="./">一覧へ</a></div> <div id="contents" class="clearfix"> <div id="leftContents"> <?php require_once('../include/gnav.php');?> </div> <div id="rightContents"> <?php if(isset($_POST['del_submit'])){ ?> <?php if(!empty($messe)) echo $messe; ?> <p class="col19 big taC">削除が完了しました。</p> <?php }else{ ?> <form method="post" action=""> <?php //トークンセット $token = sha1(uniqid(mt_rand(), true)); $_SESSION['token'] = $token; ?> <input type="hidden" name="token" value="<?php echo $token;//トークン発行?>" /> <p class="taC">このデータを削除するにはクリックしてください。</p> <p class="taC"> <input type="button" onclick="history.back()" value="キャンセル" class="submitBtn" /> <input type="submit" name="del_submit" value=" このデータを削除する" class="submitBtn" /></p> <table class="borderTable01"> <?php foreach($csv_arr as $key => $val){ ?> <tr> <th nowrap="nowrap"><?php echo $val;?></th> <td><?php echo nl2br($dbResData[$key]);?></td> </tr> <?php } ?> </table> </form> <?php } ?> </div> </div> <div id="footer"> <?php require_once('../include/footer.php');?> </div> </div> </body> </html>