Example #1
0
<?php

require_once '../common/defineUtil.php';
require_once '../common/scriptUtil.php';
require_once '../common/dbaccesUtil.php';
?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
      <title>削除確認画面</title>
</head>
  <body>
    <?php 
//delete.phpへの遷移をログに出力する処理を追加
log_access(DELETE);
//詳細画面から「削除」ボタンを押した場合のみ処理を行う条件分岐を追加
if (empty($_POST['mode'])) {
    echo 'アクセスルートが不正です。もう一度トップページからやり直してください<br>';
    //URLで直接アクセスした場合にエラーをログに出力する処理を追加
    log_error('アクセスルートが不正です。');
} elseif ($_POST['mode'] == "SAKUJYO") {
    $result = profile_detail($_GET['id']);
    //エラーが発生しなければ表示を行う
    if (is_array($result)) {
        ?>
            <h1>削除確認</h1>
            <!--改行を追加-->
            以下の内容を削除します。よろしいですか?<br>
            名前:<?php 
        echo $result[0]['name'];
Example #2
0
require_once '../common/defineUtil.php';
?>
<!--scriptUtil.phpのrequireの追加-->
<?php 
require_once '../common/scriptUtil.php';
?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
    <title>ユーザー情報管理トップ</title>
</head>
<body>
    <!--トップ画面への遷移をログに出力する処理を追加-->
    <?php 
log_access('トップ画面');
?>
    <h1>ユーザー情報管理トップ画面</h1><br>
    <h3>ここでは、ユーザー情報管理システムとしてユーザー情報の登録や検索、
        付随して修正や削除を行うことができます</h3><br>
    <a href="<?php 
echo INSERT;
?>
">新規登録</a><br>
    <a href="<?php 
echo SEARCH;
?>
" >検索(修正・削除)</a><br>
</body>
</html>
Example #3
0
<?php

require_once '../common/defineUtil.php';
require_once '../common/scriptUtil.php';
require_once '../common/dbaccesUtil.php';
?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
      <title>変更入力画面</title>
</head>
<body>
    <?php 
//update.phpへの遷移をログに出力する処理を追加
log_access(UPDATE);
//詳細画面から「変更」ボタンを押した場合のみ処理を行う条件分岐を追加
if (empty($_POST['mode'])) {
    echo 'アクセスルートが不正です。もう一度トップページからやり直してください<br>';
    //URLで直接アクセスした場合にエラーをログに出力する処理を追加
    log_error('アクセスルートが不正です。');
} elseif ($_POST['mode'] == "KOUSHIN") {
    $result = profile_detail($_GET['id']);
    ?>
        <!--update_result.phpのURLに該当するuserIDを追加する処理を追加-->
        <!--関数profile_detailの処理の後に移動-->
        <form action="<?php 
    echo UPDATE_RESULT;
    ?>
?id=<?php 
    echo $result[0]['userID'];
Example #4
0
<?php

require_once '../common/defineUtil.php';
require_once '../common/scriptUtil.php';
require_once '../common/dbaccesUtil.php';
?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
      <title>更新結果画面</title>
</head>
  <body>
    <?php 
//update_result.phpへの遷移をログに出力する処理を追加
log_access(UPDATE_RESULT);
//変更入力画面から「以上の内容で更新を行う」ボタンを押した場合のみ処理を行う条件分岐を追加
if (empty($_POST['mode'])) {
    echo 'アクセスルートが不正です。もう一度トップページからやり直してください<br>';
    //URLで直接アクセスした場合にエラーをログに出力する処理を追加
    log_error('アクセスルートが不正です。');
} elseif ($_POST['mode'] == "KOUSHIN_RESULT") {
    //入力項目が不足している場合にエラーが表示される処理の追加
    if (!empty($_POST['name']) && !empty($_POST['year']) && !empty($_POST['month']) && !empty($_POST['day']) && !empty($_POST['type']) && !empty($_POST['tell']) && !empty($_POST['comment'])) {
        //POSTの取得を追加
        $name = $_POST['name'];
        $type = $_POST['type'];
        $tell = $_POST['tell'];
        $comment = $_POST['comment'];
        //月日を2桁に変更して格納
        $birthday = $_POST['year'] . '-' . sprintf('%02d', $_POST['month']) . '-' . sprintf('%02d', $_POST['day']);
Example #5
0
require_once '../common/defineUtil.php';
require_once '../common/scriptUtil.php';
require_once '../common/dbaccesUtil.php';
?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
      <title>検索結果画面</title>
</head>
    <body>
        <h1>検索結果</h1>
        <?php 
//search_result.phpへの遷移をログに出力する処理を追加
log_access(SEARCH_RESULT);
//入力がない場合nullにする処理を追加
if (empty($_GET['name'])) {
    $_GET['name'] = null;
}
if (empty($_GET['year'])) {
    $_GET['year'] = null;
}
if (empty($_GET['type'])) {
    $_GET['type'] = null;
}
$result = null;
//全ての入力がない場合の関数、条件分岐を削除
$result = serch_profiles($_GET['name'], $_GET['year'], $_GET['type']);
//検索条件をログに出力する処理を追加
if (empty($_GET['name']) && empty($_GET['year']) && empty($_GET['type'])) {
function track_endpoint(&$dblinks, $app_id, $environment, $endpoint)
{
    # If we want to track our usage
    if (NQ_TRACKING_ENABLED) {
        # Connecting to our tracking database
        $dblink = mysqli_shared_connect(NQ_TRACKING_HOST, NQ_TRACKING_USERNAME, NQ_TRACKING_PASSWORD, $dblinks);
        # Logging our usage
        $query = "\tINSERT INTO\n\t\t\t\t\t\t" . NQ_TRACKING_TABLE . "\n\t\t\t\t\tSET\n\t\t\t\t\t\t`app_id`\t=" . (int) $app_id . ",\n\t\t\t\t\t\t`environment`\t='" . mysqli_escape_string($dblink, $environment) . "',\n\t\t\t\t\t\t`endpoint`\t='" . mysqli_escape_string($dblink, $endpoint) . "',\n\t\t\t\t\t\t`receive_size`\t=" . (defined('NQ_RECEIVE_SIZE') ? NQ_RECEIVE_SIZE : strlen($_SERVER['QUERY_STRING'])) . ",\n\t\t\t\t\t\t`send_size`\t=" . (defined('NQ_SEND_SIZE') ? NQ_SEND_SIZE : 0) . ",\n\t\t\t\t\t\t`send_time`\t=" . ((defined('NQ_SEND_TIME') ? NQ_SEND_TIME : microtime(true)) - NQ_TRACKING_START_TIME) . ",\n\t\t\t\t\t\t`complete_time`\t=" . (microtime(true) - NQ_TRACKING_START_TIME) . ",\n\t\t\t\t\t\t`created`\t=NOW()";
        mysqli_sub_query($dblink, $query);
    }
    # Logging our endpoint
    log_access($endpoint, true);
}
Example #7
0
require_once '../common/defineUtil.php';
require_once '../common/scriptUtil.php';
require_once '../common/dbaccesUtil.php';
?>
<!DOCTYPE html>
<html lang="ja">

<head>
<meta charset="UTF-8">
      <title>ユーザー情報詳細画面</title>
</head>
  <body>
    <?php 
//result_detail.phpへの遷移をログに出力する処理を追加
log_access(RESULT_DETAIL);
//userIDを指定せずURLで直接アクセスした場合にエラーが表示される処理を追加
if (!empty($_GET['id'])) {
    $result = profile_detail($_GET['id']);
    //URLで直接アクセスした時にデータが存在しない場合、エラーが表示される処理を追加
    if (!empty($result)) {
        //エラーが発生しなければ表示を行う
        if (is_array($result)) {
            ?>

                <h1>詳細情報</h1>
                名前:<?php 
            echo $result[0]['name'];
            ?>
<br>
                生年月日:<?php 
Example #8
0
 function DisplayRSS()
 {
     global $config;
     log_access($this->id, 'rss');
     // Create XML document
     $feed = new DomDocument('1.0', 'UTF-8');
     $rss = $feed->createElement('rss');
     $rss->setAttribute('version', '2.0');
     $rss->setAttribute('xmlns:media', 'http://search.yahoo.com/mrss/');
     $rss = $feed->appendChild($rss);
     // channel
     $channel = $feed->createElement('channel');
     $channel = $rss->appendChild($channel);
     $title = $channel->appendChild($feed->createElement('title'));
     $title->appendChild($feed->createTextNode($this->GetTitle()));
     $description = $channel->appendChild($feed->createElement('description'));
     $description->appendChild($feed->createTextNode("Page images from " . $this->GetTitle()));
     $link = $channel->appendChild($feed->createElement('link'));
     $link->appendChild($feed->createTextNode($config['web_server'] . 'reference/' . $this->id));
     $pages = bhl_retrieve_reference_pages($this->id);
     foreach ($pages as $page) {
         $image = bhl_fetch_page_image($page->PageID);
         $item = $channel->appendChild($feed->createElement('item'));
         $title = $item->appendChild($feed->createElement('title'));
         $title->appendChild($feed->createTextNode('Page ' . $page->PageID));
         $link = $item->appendChild($feed->createElement('link'));
         $link->appendChild($feed->createTextNode($image->url));
         $thumbnail = $item->appendChild($feed->createElement('media:thumbnail'));
         $thumbnail->setAttribute('url', $image->thumbnail->url);
         $content = $item->appendChild($feed->createElement('media:content'));
         $content->setAttribute('url', $image->url);
     }
     // Dump XML
     header("Content-type: text/xml; charset=utf-8\n\n");
     echo $feed->saveXML();
 }
Example #9
0
<?php

require_once '../common/defineUtil.php';
require_once '../common/scriptUtil.php';
?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
      <title>登録画面</title>
</head>
<body>
    <!--insert.phpへの遷移をログに出力する処理を追加-->
    <?php 
log_access(INSERT);
?>
    <?php 
session_start();
//再入力時用
?>
    <form action="<?php 
echo INSERT_CONFIRM;
?>
" method="POST">

        名前:
        <input type="text" name="name" value="<?php 
echo form_value('name');
?>
">
        <br><br>
Example #10
0
require_once '../common/scriptUtil.php';
require_once '../common/dbaccesUtil.php';
?>

<!DOCTYPE html>
<html lang="ja">

<head>
<meta charset="UTF-8">
      <title>登録結果画面</title>
</head>
    <body>
    <?php 
//insert_result.phpへの遷移をログに出力する処理を追加
log_access(INSERT_RESULT);
//PHPのエラーが表示されないように条件分岐を変更
if (empty($_POST['mode'])) {
    echo 'アクセスルートが不正です。もう一度トップページからやり直してください<br>';
    //URLで直接アクセスした場合にエラーをログに出力する処理を追加
    log_error('アクセスルートが不正です。');
} elseif ($_POST['mode'] == "RESULT") {
    session_start();
    $name = $_SESSION['name'];
    //date型にするために1桁の月日を2桁にフォーマットしてから格納
    $birthday = $_SESSION['year'] . '-' . sprintf('%02d', $_SESSION['month']) . '-' . sprintf('%02d', $_SESSION['day']);
    $type = $_SESSION['type'];
    $tell = $_SESSION['tell'];
    $comment = $_SESSION['comment'];
    //データのDB挿入処理。エラーの場合のみエラー文がセットされる。成功すればnull
    $result = insert_profiles($name, $birthday, $type, $tell, $comment);
Example #11
0
<?php

require_once '../common/defineUtil.php';
require_once '../common/scriptUtil.php';
?>
<!DOCTYPE html>
<html lang="ja">

<head>
<meta charset="UTF-8">
      <title>登録確認画面</title>
</head>
  <body>
    <?php 
//insert_confirm.phpへの遷移をログに出力する処理を追加
log_access(INSERT_CONFIRM);
//入力画面から「確認画面へ」ボタンを押した場合のみ処理を行う
//PHPのエラーが表示されないように条件分岐を変更
if (empty($_POST['mode'])) {
    echo 'アクセスルートが不正です。もう一度トップページからやり直してください<br>';
    //URLで直接アクセスした場合にエラーをログに出力する処理を追加
    log_error('アクセスルートが不正です。');
} elseif ($_POST['mode'] == "CONFIRM") {
    session_start();
    //ポストの存在チェックとセッションに値を格納しつつ、連想配列にポストされた値を格納
    $confirm_values = array('name' => bind_p2s('name'), 'year' => bind_p2s('year'), 'month' => bind_p2s('month'), 'day' => bind_p2s('day'), 'type' => bind_p2s('type'), 'tell' => bind_p2s('tell'), 'comment' => bind_p2s('comment'));
    //1つでも未入力項目があったら表示しない
    if (!in_array(null, $confirm_values, true)) {
        ?>
            <h1>登録確認画面</h1><br>
            名前:<?php 
Example #12
0
?>
<!DOCTYPE html>
<html lang="ja">

<head>
<meta charset="UTF-8">
      <title>ユーザー情報検索画面</title>
</head>
  <body>
    <form action="<?php 
echo SEARCH_RESULT;
?>
" method="GET">
        <!--search.phpへの遷移をログに出力する処理を追加-->
        <?php 
log_access(SEARCH);
?>

        名前:
        <br>
        <input type="text" name="name">
        <br><br>

        生年:
        <br>
        <select name="year">
            <option value="">----</option>
            <?php 
for ($i = 1950; $i <= 2010; $i++) {
    ?>
              <option value="<?php 
Example #13
0
<?php

require_once '../common/defineUtil.php';
require_once '../common/scriptUtil.php';
require_once '../common/dbaccesUtil.php';
?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
      <title>削除結果画面</title>
</head>
<body>
    <?php 
//delete_result.phpへの遷移をログに出力する処理を追加
log_access(DELETE_RESULT);
//削除確認画面から「はい」ボタンを押した場合のみ処理を行う条件分岐を追加
if (empty($_POST['mode'])) {
    echo 'アクセスルートが不正です。もう一度トップページからやり直してください<br>';
    //URLで直接アクセスした場合にエラーをログに出力する処理を追加
    log_error('アクセスルートが不正です。');
} elseif ($_POST['mode'] == "SAKUJYO_RESULT") {
    $result = delete_profile($_GET['id']);
    //エラーが発生しなければ表示を行う
    if (!isset($result)) {
        //データを削除した場合にログに出力する処理を追加
        log_syori('データを削除しました。');
        ?>
            <h1>削除確認</h1>
            削除しました。<br>
            <?php