Name; } } if ($loginflag) { if ($_REQUEST['action'] == "regist") { /* 編集内容を保存 */ $behaviors = ""; foreach ($_REQUEST['behavior'] as $line) { if ($line != "") { $behaviors && $behaviors .= "\n"; $behaviors .= $line; } } $schedules = ""; foreach ($_REQUEST['schedule'] as $line) { if ($line != "") { $schedules && $schedules .= "\n"; $schedules .= $line; } } $underways = ""; $i = 0; foreach ($_REQUEST['date'] as $line) { if ($line != "") { $_REQUEST['underway'][$i] = str_replace("\t", "", $_REQUEST['underway'][$i]); $var = "$line\t". $_REQUEST['underway'][$i]; $underways && $underways .= "\n"; $underways .= $var; } $i++; } $value = join("\n", array( "[DATA]", "weakness=". $_REQUEST['weakness'], "forte=". $_REQUEST['forte'], "improvement=". $_REQUEST['improvement'], "presence=". $_REQUEST['presence'], "[Behavior]", $behaviors, "[Schedule]", $schedules, "[Underway]", $underways )); file_put_contents("./reportfiles/users/". $_REQUEST['ID']. ".dat", $value); /* データファイルが更新されていればPDFも強制的に更新される */ $_REQUEST['action'] = "report"; } elseif ($_REQUEST['action'] == "advice_regist") { /* アドバイスの保存 */ $Buffer = data_read("./reportfiles/users/". $_REQUEST['uid']. ".adv"); $New = array(); foreach ($Buffer as $line) { /* 該当者のデータから編集者のデータを削除して、新たにまとめて追加する */ if (!preg_match("/\tfrom=". $_REQUEST['ID']. "\t/", $line)) { $New[] = $line; } } $i = 0; foreach ($_REQUEST['date'] as $line) { if ($line != "") { $val = join("\t", array( "date=". $_REQUEST['date'][$i], "from=". $_REQUEST['ID'], "name=". $user->Name, "advice=". $_REQUEST['advice'][$i], "\n" )); $New[] = $val; } $i++; } file_put_contents("./reportfiles/users/". $_REQUEST['uid']. ".adv", $New); /* 本人に通知 */ if ($Report['returnmail']) { $subject = $Report['adv_subject']; $sql = "SELECT * FROM `$client` WHERE `ID`='". $_REQUEST['uid']. "';"; $rs = mysql_query($sql); if (mysql_num_rows($rs)) { $buff = mysql_fetch_object($rs); /* メールアドレスをチェック */ if (preg_match("/\w+\@[\w\.\-]+/", $buff->Email)) { $name = $buff->Name; $upw = $buff->Pw; $url = $Init['Currenturl']. "/report.php?ID=". $buff->ID; $from = $user->Name; $mailbody = $Report['adv_body']; while (preg_match("/\%(\w+)\%/i", $mailbody, $m)) { $v = $m[1]; $mailbody = preg_replace("/\%$v\%/i", $$v, $mailbody); } $mailbody = preg_replace("/[\t]/", "", $mailbody); $mailbody = preg_replace("/( |\r\n|\r)/", "\n", $mailbody); mb_send_mail($buff->Email, $subject, $mailbody, "From:". $user->Email, "-f". $user->Email); } } } $_REQUEST['action'] = "memberlist"; } if ($_REQUEST['action'] == "report") { if ($_REQUEST['uid']) { /* uid が指定されている場合は、上司が部下のレポートを指定 */ $rs = mysql_query("SELECT `TargetID` FROM `sample-select` WHERE `TargetID`='". $_REQUEST['uid']. "' AND `SelectID`='". $_REQUEST['ID']. "' AND `Relation`='1'"); if (mysql_num_rows($rs)) { $_REQUEST['id'] = $_REQUEST['uid']; } else { /* 存在しないまたは、直属の上司ではない場合はエラーを出力 */ echo accesserror(); exit; } } else { /* レポートの表示 他人の調査票が閲覧できないようログイン情報が必要 */ $_REQUEST['id'] = $_REQUEST['ID']; // 必ずPDFを更新する //$_REQUEST['sub'] = "update"; } include_once "../common/inc/MPDF54/mpdf.php"; include_once "../common/inc/report.inc"; exit; } readini("./reportfiles/users/". $_REQUEST['ID']. ".dat"); $text = "
ホーム

$title ($name 様) ". date("Y-m-d", time()). "

"; if ($_REQUEST['action'] == "form") { $text .= "

自己分析と改善目標

強み・弱み(改善項目)把握表

". $setupReport->merit->merit. "
". $setupReport->merit->demerit. "

". $setupReport->merit->head. "

    "; foreach ($setupReport->merit->thinking as $line) { $text .= "
  • $line
  • "; } $text .= "

行動改善アクションプラン

". $setupReport->plan->head. "

    "; foreach ($setupReport->plan->comment as $line) { $text .= "
  1. $line
  2. "; } $text .= "
■改善テーマ
■改善後の姿
■改善の為の具体的行動
    "; $i = 1; !is_array($Behavior) && $Behavior = array(); foreach ($Behavior as $line) { $text .= "
  • $i:

  • "; $i++; } for ($nextbehavior = $i; $nextbehavior <= 5; $nextbehavior++) { $text .= "
  • $nextbehavior:

  • "; } $text .= "

※優先順位の高い順に設定してください。番号をドラッグして順序を変更できます。

■スケジュール
    "; $i = 1; !is_array($Schedule) && $Schedule = array(); foreach ($Schedule as $line) { $text .= "
  • $i:

  • "; $i++; } for ($nextschedule = $i; $nextschedule <= 5; $nextschedule++) { $text .= "
  • $nextschedule:

  • "; } $text .= "

※優先順位の高い順に設定してください。番号をドラッグして順序を変更できます。

行動改善アクションプランの進捗状況

本人の進捗状況
日付 内容
    "; $i = 1; !is_array($Underway) && $Underway = array(); foreach ($Underway as $line) { @list($date, $underway) = split("\t", $line); $text .= "
  • "; $i++; } for ($nextunderway = $i; $nextunderway <= 5; $nextunderway++) { $text .= "
  • "; } $text .= "

※日付の無い内容は無視されます。どのような順序で入力しても自動的に新着順になります。


"; $ready .= " $('.sortable').sortable({ placeholder: 'ui-state-highlight' });"; $javascript .= " var nextbehavior = $nextbehavior; function addbehavior() { field = '
  • \

    '+nextbehavior+':

    \ \

    \
  • '; $('#behaviorlist').append(field); nextbehavior++; } var nextschedule = $nextschedule; function addschedule() { field = '
  • \

    '+nextschedule+':

    \ \

    \
  • '; $('#schedulelist').append(field); nextschedule++; } var nextunderway = $nextunderway; function addunderway() { field = '
  • \ \ \

    \
  • '; $('#underwaylist').append(field); nextunderway++; }"; } elseif ($_REQUEST['action'] == "advice") { /* 励ましとアドバイスの投稿 */ $sql = "SELECT `sample-select`.*, `$client`.`Name`, `$client`.`Office`, `$client`.`Depart`, `$client`.`Class`, `$client`.`Email` FROM `sample-select` LEFT JOIN `$client` ON `$client-select`.`TargetID`=`$client`.`ID` WHERE `sample-select`.`TargetID`='". $_REQUEST['uid']. "' AND `sample-select`.`SelectID`='". $_REQUEST['ID']. "' AND `sample-select`.`Relation`='1'"; $rs = mysql_query($sql); if (mysql_num_rows($rs)) { $buff = mysql_fetch_object($rs); $Buffer = data_read("./reportfiles/users/". $_REQUEST['uid']. ".adv"); $Advice = array_values(preg_grep("/\tfrom=". $_REQUEST['ID']. "\t/", $Buffer)); /* 対象個人データを初期化 */ $DATA = array(); $Behavior = array(); $Schedule = array(); $Underway = array(); readini("./reportfiles/users/". $_REQUEST['uid']. ".dat"); $text .= "

    励ましとアドバイス

    ". $buff->Office. " ". $buff->Name. "
    ■改善の為の具体的行動 ■スケジュール
      "; foreach($Behavior as $line) { $text .= "
    1. $line
    2. "; } $text .= "
      "; foreach($Schedule as $line) { $text .= "
    1. $line
    2. "; } $text .= "
    ■進捗状況
      "; rsort($Underway); foreach($Underway as $line) { @list($date, $underway) = split("\t", $line); $text .= "
    • $date
      $underway
    • "; } $text .= "
    上司からの励ましとアドバイス記述
    日付 内容
      "; $i = 1; !is_array($Advice) && $Advice = array(); foreach ($Advice as $line) { $buff = dbfields($line); $text .= "
    • "; $i++; } for ($nextadvice = $i; $nextadvice <= 5; $nextadvice++) { $text .= "
    • "; } $text .= "

    ※日付の無い内容は無視されます。どのような順序で入力しても自動的に新着順になります。

    Name. "さんのアドバイスに書き込みます。\\nレポート(PDF)には書き込まれませんので、保存後に再表示が必要です。\\n\\n同時に、ご本人にもメールで通知されます。\\n保存しても宜しいですか?')) { this.form.submit(); }\" style=\"width:100px;\" />
    "; $ready .= " $('.sortable').sortable({ placeholder: 'ui-state-highlight' });"; $javascript .= " var nextadvice = $nextadvice; function addadvice() { field = '
  • \ \ \

    \
  • '; $('#advicelist').append(field); nextadvice++; }"; } else { /* 呼び出したユーザが直属の部下ではない場合 */ $ready .= " alert('指定のメンバー見つからないまたは、対象外です。'); history.back();"; } } elseif ($_REQUEST['action'] == "memberlist") { /* 部下一覧 */ $sql = "SELECT `sample-select`.*, `$client`.`Name`, `$client`.`Office`, `$client`.`Depart`, `$client`.`Class`, `$client`.`Email` FROM `sample-select` LEFT JOIN `$client` ON `$client-select`.`TargetID`=`$client`.`ID` WHERE `sample-select`.`SelectID`='". $_REQUEST['ID']. "' AND `sample-select`.`Relation`='1'"; $rs = mysql_query($sql); $i = 1; $text .= "

    対象者一覧

    ※被評価者をクリックしてレポートを表示します。
    (被評価者が表示/更新していない場合や、アドバイス投稿後は、この場でPDFを更新する為、長い時間が必要です。)

    "; while ($buff = mysql_fetch_object($rs)) { $text .= " TargetID. "')\"> "; $i++; } $text .= "
    No. ". $Field[0]. " ". $Field[1]. " ". $Field[2]. " 氏名 Email  
    $i ". $buff->Office. " ". $buff->Depart. " ". $buff->Class. " ". $buff->Name. " ". $buff->Email. " TargetID. "'; \" style=\"width:100%;height:28px;\" />
    "; $javascript = " function reportview(id) { pdfwin = window.open('progress.php?script=report.php&ID=". $_REQUEST['ID']. "&action=report&uid='+id, 'pdfwin'); pdfwin.focus(); }"; } else { /* スタート画面 メインメニュー */ !is_dir("./reportfiles/users") && mkdir("./reportfiles/users"); $text .= "
    "; if ($user->Target) { $DATA = array(); if (is_file("./reportfiles/users/". $_REQUEST['ID']. ".dat")) { readini("./reportfiles/users/". $_REQUEST['ID']. ".dat"); @$data_time = date("Ymd H:i", filemtime("./reportfiles/users/". $_REQUEST['ID']. ".dat")); } if (!$DATA['weakness'] || !$DATA['forte']) { $text .= "

    ※自己分析または、改善目標が未記入です。
    「レポートの出力(PDFの更新)」を押し、分析結果をご参考にご記入ください。

    "; } if (is_file("./reportfiles/users/". $_REQUEST['ID']. ".adv")) { @$adv_time = date("Ymd H:i", filemtime("./reportfiles/users/". $_REQUEST['ID']. ".adv")); } if (is_file("./reportfiles/pdf/". $_REQUEST['ID']. ".pdf")) { @$pdf_time = date("Ymd H:i", filemtime("./reportfiles/pdf/". $_REQUEST['ID']. ".pdf")); } if (!isset($pdf_time) || (isset($adv_time) && $adv_time > $pdf_time)) { $text .= "

    ※レポートPDFが未作成または、新しいアドバイスが投稿されているため更新が必要です。 「レポートの出力(PDFの更新)」を押して更新してください。

    "; } $text .= "

    ". $setupReport->mainmenu->update->title. "

    ". $setupReport->mainmenu->update->comment. "


    ". $setupReport->mainmenu->weakness->title. "

    ". $setupReport->mainmenu->weakness->comment. "

    "; } $rs = mysql_query("SELECT `sample-select`.*, `$client`.`Name`, `$client`.`Target` FROM `sample-select` LEFT JOIN `$client` ON `$client-select`.`TargetID`=`$client`.`ID` WHERE `sample-select`.`SelectID`='". $_REQUEST['ID']. "' AND `sample-select`.`Relation`='1'"); if (mysql_num_rows($rs)) { /* 上司の場合 */ $text .= "

    ". $setupReport->mainmenu->advice->title. "

    ". $setupReport->mainmenu->advice->comment. "

    "; } $text .= "
    \ 再度アクセスする場合はパスワードでログインする必要があります。
    \
    \ ログオフしても宜しいですか?'); $('#systemDialog').dialog({ title: 'ログオフ', resizable: false, width: 480, height:240, modal:true, show:'blind', hide:'blind', buttons: { 'ログオフ': function() { $(this).dialog('close'); location.href='report.php?ID=". $_REQUEST['ID']. "&action=logoff'; }, 'キャンセル': function() { $(this).dialog('close'); } } });\">

    ログオフ

    次回アクセス時にパスワードを要求する場合は、必ずログオフしてください。(PC共有の場合必須)

    "; } $text .= " "; } else { /* ログインページを表示 */ $text .= "

    ". $Init['Caption']. "

    (分析結果/自己学習ツール)

    ". $_SERVER['SERVER_NAME']. current_Dir(). "/report/は、パスワードで保護されています。 案内メールで通知された専用のパスワードを指定してログインしてください。

    パスワード

    ※パスワードを紛失された方は、管理者までお問い合わせください。

    "; $ready = " $('#logindialog').dialog({ title: 'ログイン', resizable: false, width: 480, height:400, modal:true, show:'blind', hide:'blind', buttons: { 'ログイン': function() { $(this).dialog('close'); $('#loginform').submit(); }, 'キャンセル': function() { location.href='report.php'; } } }); $('#upw').focus();"; } } else { /* IDの無い不正なURLの場合はエラーを出力 */ echo accesserror(); exit; } function accesserror() { $text =<<<_ 401 Authorization Required

    Authorization Required

    _; $text .= "

    The requested URL ". $_SERVER['REQUEST_URI']. " could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required.

    "; return($text); } ?>