". $user->Office. " ". $user->Name. " 殿

". $Init['Client']. " P.$page
 

ID : ". $user->ID. "

". date("Y年m月d日 H:i", time()). "

". $setupReport->group1->title. "

"; $Section['analysis'] = 0; if (!$_Report['non_basic_view']) { /* 基本情報 */ $file = "/360/$client/data/original.que"; $Que = get_crypt_file($_SERVER['DOCUMENT_ROOT']. "/$file", $System['cryptkey']); $que_cnt = count($Que); $dummy = array_values(preg_grep("/\tType=0\t/", $Que)); $select_cnt = count($dummy); $sql = "SELECT `F3`,COUNT(`F3`) as 'cnt' FROM `maindata` WHERE `F2`='". $user->Name. "' GROUP BY `F3`"; $rs = mysql_query($sql); $count = array(); while ($dummy = mysql_fetch_object($rs)) { $count[$dummy->F3] = $dummy->cnt; } $Section['analysis']++; $html .= "

". $Section['analysis']. ".基本情報

調査期間 設問 対象人数
選択 記入 合計 部下 同僚 上司 合計
". $Setup['startDate']. " ~ ". $Setup['endDate']. " $select_cnt ". ($que_cnt - $select_cnt). " $que_cnt ". $count['部下']. " ". $count['同僚']. " ". $count['上司']. " ". ($count['部下'] + $count['同僚'] + $count['上司']). "
"; } $Section['analysis']++; $html .= "

". $Section['analysis']. ".". $setupReport->section1->title. "

"; $col = -1; $categoryData = array(); foreach ($category as $key => $val) { $col++; $labels[] = $key; unset($calc, $cnt, $subcalc, $subcnt); $que = count($categoryQue[$key]); $sql = "SELECT *,"; $i = 1; foreach ($categoryQue[$key] as $line) { $i > 1 && $sql .= "+"; $sql .= "`$line`"; $i++; } $sql .= " as 'point' FROM `maindata` WHERE `F2`='". $user->Name. "'"; $rs = mysql_query($sql); if (mysql_num_rows($rs)) { while ($buff = mysql_fetch_object($rs)) { $calc[$buff->F3] += $buff->point; foreach ($categoryQue[$key] as $var) { $buff->$var > 0 && $cnt[$buff->F3]++; } } foreach ($calc as $k => $v) { if ($v) { $calc[$k] = sprintf("%01.2f", $v / $cnt[$k]); } } } /* グラフ用のデータを作成 */ $values[0][$col] = $calc['部下']; $values[1][$col] = $calc['同僚']; $values[2][$col] = $calc['上司']; $values[3][$col] = $calc['本人']; if ($subflag) { /* 前回分を集計 */ $sql = "SELECT *,"; $i = 1; foreach ($subcategoryQue[$key] as $line) { $i > 1 && $sql .= "+"; $sql .= "`$line`"; $i++; } $sql .= " as 'point' FROM `subdata` WHERE `F2`='". $user->Name. "'"; $rs = mysql_query($sql); if (mysql_num_rows($rs)) { while ($buff = mysql_fetch_object($rs)) { $subcalc[$buff->F3] += $buff->point; foreach ($subcategoryQue[$key] as $var) { $buff->$var > 0 && $subcnt[$buff->F3]++; } } foreach ($subcalc as $k => $v) { if ($v && $subcnt[$k]) { $subcalc[$k] = sprintf("%01.2f", $v / $subcnt[$k]); } } } } $categoryData[$key]['部下'] = $calc['部下']; (!isset($calc['部下']) || !$calc['部下']) && $calc['部下'] = "-"; $bg = getColor($calc['部下']); $html .= " "; $fc = ""; if ($subcalc['部下'] > 0) { $bg = getColor($subcalc['部下']); $sa = sprintf("%01.2f", $calc['部下'] - $subcalc['部下']); $sa < 0 && $fc = "c-f00"; } else { $bg = "white"; $subcalc['部下'] = "-"; $sa = "-"; } $html .= " "; $categoryData[$key]['同僚'] = $calc['同僚']; (!isset($calc['同僚']) || !$calc['同僚']) && $calc['同僚'] = "-"; $bg = getColor($calc['同僚']); $html .= " "; $fc = ""; if ($subcalc['同僚'] > 0) { $bg = getColor($subcalc['同僚']); $sa = sprintf("%01.2f", $calc['同僚'] - $subcalc['同僚']); $sa < 0 && $fc = "c-f00"; } else { $bg = "white"; $subcalc['同僚'] = "-"; $sa = "-"; } $html .= " "; $categoryData[$key]['上司'] = $calc['上司']; (!isset($calc['上司']) || !$calc['上司']) && $calc['上司'] = "-"; $bg = getColor($calc['上司']); $html .= " "; $fc = ""; if ($subcalc['上司'] > 0) { $bg = getColor($subcalc['上司']); $sa = sprintf("%01.2f", $calc['上司'] - $subcalc['上司']); $sa < 0 && $fc = "c-f00"; } else { $bg = "white"; $subcalc['上司'] = "-"; $sa = "-"; } $html .= " "; $categoryData[$key]['本人'] = $calc['本人']; (!isset($calc['本人']) || !$calc['本人']) && $calc['本人'] = "-"; $bg = getColor($calc['本人']); $html .= " "; $fc = ""; if ($subcalc['本人'] > 0) { $bg = getColor($subcalc['本人']); $sa = sprintf("%01.2f", $calc['本人'] - $subcalc['本人']); $sa < 0 && $fc = "c-f00"; } else { $bg = "white"; $subcalc['本人'] = "-"; $sa = "-"; } $html .= " "; } $html .= "
大項目名 部下 同僚 上司 本人
今回 前回 今回 前回 今回 前回 今回 前回
$key ". $calc['部下']. "". $subcalc['部下']. " $sa". $calc['同僚']. "". $subcalc['同僚']. " $sa". $calc['上司']. "". $subcalc['上司']. " $sa". $calc['本人']. "". $subcalc['本人']. " $sa
". hanrei(). "
". preg_replace("/(\r\n| |[\r\n])/", "
", $setupReport->section1->comment). "
"; /* レーダーチャートの処理 */ $path = "./reportfiles/graph/". $_REQUEST['id']. ".png"; saveImage($path); $colorcode = array('#44f', '#084', '#454', '#a00;'); $Section['analysis']++; $html .= "

". $Section['analysis']. ".". $setupReport->section2->title. "

". preg_replace("/(\r\n| |[\r\n])/", "
", $setupReport->section2->comment). "
"; /************************************************************************* 平均との比較 **************************************************************************/ if (!$Report['non_avg_view']) { // $categoryData // 全体平均を取得 $i = 1; $sql = "SELECT `F3`,"; foreach ($categoryQue as $key => $val) { foreach ($categoryQue[$key] as $que) { $i > 1 && $sql .= ","; $sql .= " CASE WHEN COUNT(`$que`>0 OR NULL)=0 THEN 0 ELSE SUM(`$que`)/COUNT(`$que`>0 OR NULL) END as '$que'"; $i++; } } $sql .= " FROM `maindata` GROUP BY `F3`"; $rss = mysql_query($sql); $categoryAll = array(); while ($buff = mysql_fetch_object($rss)) { foreach ($categoryQue as $key => $val) { $i = 0; foreach ($categoryQue[$key] as $que) { $categoryAll[$key][$buff->F3] += $buff->$que; $i++; } $categoryAll[$key][$buff->F3] = sprintf("%01.2f", $categoryAll[$key][$buff->F3] / $i); } } $Section['analysis']++; $page++; $html .= newpage($page). "

". $Section['analysis']. ".". $setupReport->avg->title. "

"; foreach ($categoryQue as $key => $val) { $html .= " "; } $html .= "
大項目名 部下 同僚 上司 本人
今回 平均 今回 平均 今回 平均 今回 平均
$key ". $categoryData[$key]['部下']. " ". $categoryAll[$key]['部下']. " ". saformat($categoryData[$key]['部下'], $categoryAll[$key]['部下']). " ". $categoryData[$key]['同僚']. " ". $categoryAll[$key]['同僚']. " ". saformat($categoryData[$key]['同僚'], $categoryAll[$key]['同僚']). " ". $categoryData[$key]['上司']. " ". $categoryAll[$key]['上司']. " ". saformat($categoryData[$key]['上司'], $categoryAll[$key]['上司']). " ". $categoryData[$key]['本人']. " ". $categoryAll[$key]['本人']. " ". saformat($categoryData[$key]['本人'], $categoryAll[$key]['本人']). "
". hanrei(). "
"; foreach($setupReport->avg->comment as $com) { $html .= "

". preg_replace("/(\r\n| |[\r\n])/", "
", $com). "

"; } $html .= "
"; /* 折れ線グラフの処理 */ $Section['analysis']++; $html .= "

". $Section['analysis']. ".". $setupReport->linechart->title. "

"; //値 unset($values0, $values1); foreach ($categoryQue as $key => $val) { $values0[] = $categoryData[$key]['部下']; $values1[] = $categoryAll[$key]['部下']; } $lines = array( array( 'name' => '今回', 'values' => $values0, 'color' => array(0, 0, 255) ), array( 'name' => '平均', 'values' => $values1, 'color' => array(255, 0, 0) ), ); $path = "./reportfiles/graph/linechart". $_REQUEST['id']. "-1.png"; linechart($path, "部下の評価", $lines); $html .= " "; unset($values0, $values1); foreach ($categoryQue as $key => $val) { $values0[] = $categoryData[$key]['同僚']; $values1[] = $categoryAll[$key]['同僚']; } $lines = array( array( 'name' => '今回', 'values' => $values0, 'color' => array(0, 0, 255) ), array( 'name' => '平均', 'values' => $values1, 'color' => array(255, 0, 0) ), ); $path = "./reportfiles/graph/linechart". $_REQUEST['id']. "-2.png"; linechart($path, "同僚の評価", $lines); $html .= "

"; unset($values0, $values1); foreach ($categoryQue as $key => $val) { $values0[] = $categoryData[$key]['上司']; $values1[] = $categoryAll[$key]['上司']; } $lines = array( array( 'name' => '今回', 'values' => $values0, 'color' => array(0, 0, 255) ), array( 'name' => '平均', 'values' => $values1, 'color' => array(255, 0, 0) ), ); $path = "./reportfiles/graph/linechart". $_REQUEST['id']. "-3.png"; linechart($path, "上司の評価", $lines); $html .= " "; unset($values0, $values1); foreach ($categoryQue as $key => $val) { $values0[] = $categoryData[$key]['本人']; $values1[] = $categoryAll[$key]['本人']; } $lines = array( array( 'name' => '今回', 'values' => $values0, 'color' => array(0, 0, 255) ), array( 'name' => '平均', 'values' => $values1, 'color' => array(255, 0, 0) ), ); $path = "./reportfiles/graph/linechart". $_REQUEST['id']. "-4.png"; linechart($path, "本人の評価", $lines); $html .= "

". preg_replace("/(\r\n| |[\r\n])/", "
", $setupReport->linechart->comment). "

"; } /************************************************************************* 中分類の集計 **************************************************************************/ $Section['analysis']++; $page++; $html .= newpage($page). "

". $Section['analysis']. ".". $setupReport->section3->title. "

"; $col = -1; foreach ($category as $key => $val) { $col++; $labels[] = $key; $rowspan = count($category[$key]); $html .= " "; $row = 1; foreach ($category[$key] as $subkey => $subval) { unset($calc, $cnt, $subcalc, $subcnt); $sql = "SELECT `ID`,`F1`,`F2`,`F3`,`F4`,`F5`,`F6`,`F7`"; $i = 1; $fields = ""; $plus = ""; foreach ($category[$key][$subkey] as $line) { if ($i > 1) { $plus .= "+"; } $fields .= ",`$line`"; $plus .= "`$line`"; $i++; } $sql .= "$fields, $plus as 'point' FROM `maindata` WHERE `F2`='". $user->Name. "'"; $rs = mysql_query($sql); $cnt[$buff->F3] = 0; if (mysql_num_rows($rs)) { while ($buff = mysql_fetch_object($rs)) { $calc[$buff->F3] += $buff->point; foreach ($category[$key][$subkey] as $var) { $buff->$var > 0 && $cnt[$buff->F3]++; } } foreach ($calc as $k => $v) { if ($v && $cnt[$k]) { $calc[$k] = sprintf("%01.2f", $v / $cnt[$k]); } } } $adviceVal[$subkey] = $calc['部下']; if ($subflag) { /* 前回分を集計 */ $sql = "SELECT `ID`,`F1`,`F2`,`F3`,`F4`,`F5`,`F6`,`F7`"; $i = 1; $fields = ""; $plus = ""; foreach ($subcategory[$key][$subkey] as $line) { if ($i > 1) { $plus .= "+"; } $fields .= ",`$line`"; $plus .= "`$line`"; $i++; } $sql .= "$fields, $plus as 'point' FROM `subdata` WHERE `F2`='". $user->Name. "'"; $rs = mysql_query($sql); if (mysql_num_rows($rs)) { while ($buff = mysql_fetch_object($rs)) { $subcalc[$buff->F3] += $buff->point; foreach ($subcategory[$key][$subkey] as $var) { $buff->$var > 0 && $subcnt[$buff->F3]++; } } foreach ($subcalc as $k => $v) { if ($v && $subcnt[$k]) { $subcalc[$k] = sprintf("%01.2f", $v / $subcnt[$k]); } } } } (!isset($calc['部下']) || !$calc['部下']) && $calc['部下'] = "-"; $bg = getColor($calc['部下']); $row > 1 && $html .= ""; $html .= " "; $fc = ""; if ($subcalc['部下'] > 0) { $bg = getColor($subcalc['部下']); $sa = sprintf("%01.2f", $calc['部下'] - $subcalc['部下']); $sa < 0 && $fc = "c-f00"; } else { $bg = "white"; $subcalc['部下'] = "-"; $sa = "-"; } $html .= " "; (!isset($calc['同僚']) || !$calc['同僚']) && $calc['同僚'] = "-"; $bg = getColor($calc['同僚']); $html .= " "; $fc = ""; if ($subcalc['同僚'] > 0) { $bg = getColor($subcalc['同僚']); $sa = sprintf("%01.2f", $calc['同僚'] - $subcalc['同僚']); $sa < 0 && $fc = "c-f00"; } else { $bg = "white"; $subcalc['同僚'] = "-"; $sa = "-"; } $html .= " "; (!isset($calc['上司']) || !$calc['上司']) && $calc['上司'] = "-"; $bg = getColor($calc['上司']); $html .= " "; $fc = ""; if ($subcalc['上司'] > 0) { $bg = getColor($subcalc['上司']); $sa = sprintf("%01.2f", $calc['上司'] - $subcalc['上司']); $sa < 0 && $fc = "c-f00"; } else { $bg = "white"; $subcalc['上司'] = "-"; $sa = "-"; } $html .= " "; (!isset($calc['本人']) || !$calc['本人']) && $calc['本人'] = "-"; $bg = getColor($calc['本人']); $html .= " "; $fc = ""; if ($subcalc['本人'] > 0) { $bg = getColor($subcalc['本人']); $sa = sprintf("%01.2f", $calc['本人'] - $subcalc['本人']); $sa < 0 && $fc = "c-f00"; } else { $bg = "white"; $subcalc['本人'] = "-"; $sa = "-"; } $html .= " "; $row++; } } $html .= "
大項目名 中項目名 部下 同僚 上司 本人
今回 前回 今回 前回 今回 前回 今回 前回
$key
$subkey ". $calc['部下']. "". $subcalc['部下']. " $sa". $calc['同僚']. "". $subcalc['同僚']. " $sa". $calc['上司']. "". $subcalc['上司']. " $sa". $calc['本人']. "". $subcalc['本人']. " $sa
". hanrei(). "
". preg_replace("/(\r\n| |[\r\n])/", "
", $setupReport->section3->comment). "
"; $Section['analysis']++; $html .= "

". $Section['analysis']. ".". $setupReport->section4->title. "

"; if ($setupReport->section4->comment) { $html .= "
". preg_replace("/(\r\n| |[\r\n])/", "
", $setupReport->section4->comment). "
"; } /* 高評価メッセージとアドバイスの自動挿入 */ $html .= "
"; /************************************************************************* .質問項目の結果 **************************************************************************/ $Section['analysis']++; $page++; $html .= newpage($page); $html .= "

". $Section['analysis']. ".". $setupReport->section5->title. "

"; $html .= anslisttitle(); $ct = 1; $gyo = 0; $max = 50; foreach ($category as $key => $val) { $row = count($categoryQue[$key]); if (($gyo + $row) > $max) { $page++; $gyo = 1; $html .= " ". newpage($page). anslisttitle(); } $html .= "

". tate($key). "

"; $sc = 1; foreach ($category[$key] as $subkey => $subval) { $row2 = count($category[$key][$subkey]); $sc > 1 && $html .= ""; $html .= " $subkey"; $n = 1; foreach ($category[$key][$subkey] as $que) { unset($calc, $cnt, $subcalc, $subcnt, $sa); $sql = "SELECT `ID`,`F1`,`F2`,`F3`,`F4`,`F5`,`F6`,`F7`,`$que` FROM `maindata` WHERE `F2`='". $user->Name. "'"; $rs = mysql_query($sql); if (mysql_num_rows($rs)) { while ($buff = mysql_fetch_object($rs)) { $calc[$buff->F3] += $buff->$que; $buff->$que > 0 && $cnt[$buff->F3]++; } foreach ($calc as $k => $v) { if ($v && $cnt[$k]) { $calc[$k] = sprintf("%01.2f", $v / $cnt[$k]); } } } /* ギャップ発見マトリクス */ if ($calc['本人'] < 4) { if ($calc['部下'] < 4) { $matrix['D']['部下'][] = $que; } else { $matrix['B']['部下'][] = $que; } if ($calc['上司'] < 4) { $matrix['D']['上司'][] = $que; } else { $matrix['B']['上司'][] = $que; } } else { if ($calc['部下'] < 4) { $matrix['C']['部下'][] = $que; } else { $matrix['A']['部下'][] = $que; } if ($calc['上司'] < 4) { $matrix['C']['上司'][] = $que; } else { $matrix['A']['上司'][] = $que; } } if ($subflag && $Report['compfields']) { /* 前回データが有れば、環境設定で指定したマッチングする設問のみ集計 */ $matching = split(",", $Report['compfields']); if (in_array($que, $matching)) { $sql = "SELECT `ID`,`F1`,`F2`,`F3`,`F4`,`F5`,`F6`,`F7`,`$que` FROM `subdata` WHERE `F2`='". $user->Name. "'"; $rs = mysql_query($sql); if (mysql_num_rows($rs)) { while ($buff = mysql_fetch_object($rs)) { $subcalc[$buff->F3] += $buff->$que; $buff->$que > 0 && $subcnt[$buff->F3]++; } foreach ($subcalc as $k => $v) { if ($v && $subcnt[$k]) { $subcalc[$k] = sprintf("%01.2f", $v / $subcnt[$k]); } } } } } (!isset($calc['部下']) || !$calc['部下']) && $calc['部下'] = "-"; $bg = getColor($calc['部下']); $n > 1 && $html .= ""; $html .= " $que ". $calc['部下']. ""; $fc = ""; if ($subcalc['部下'] > 0) { $bg = getColor($subcalc['部下']); $sa = sprintf("%01.2f", $calc['部下'] - $subcalc['部下']); $sa < 0 && $fc = "c-f00"; } else { $bg = "white"; $subcalc['部下'] = "-"; $sa = "-"; } $html .= " ". $subcalc['部下']. " $sa"; (!isset($calc['同僚']) || !$calc['同僚']) && $calc['同僚'] = "-"; $bg = getColor($calc['同僚']); $html .= " ". $calc['同僚']. ""; $fc = ""; if ($subcalc['同僚'] > 0) { $bg = getColor($subcalc['同僚']); $sa = sprintf("%01.2f", $calc['同僚'] - $subcalc['同僚']); $sa < 0 && $fc = "c-f00"; } else { $bg = "white"; $subcalc['同僚'] = "-"; $sa = "-"; } $html .= " ". $subcalc['同僚']. " $sa"; (!isset($calc['上司']) || !$calc['上司']) && $calc['上司'] = "-"; $bg = getColor($calc['上司']); $html .= " ". $calc['上司']. ""; $fc = ""; if ($subcalc['上司'] > 0) { $bg = getColor($subcalc['上司']); $sa = sprintf("%01.2f", $calc['上司'] - $subcalc['上司']); $sa < 0 && $fc = "c-f00"; } else { $bg = "white"; $subcalc['上司'] = "-"; $sa = "-"; } $html .= " ". $subcalc['上司']. " $sa"; (!isset($calc['本人']) || !$calc['本人']) && $calc['本人'] = "-"; $bg = getColor($calc['本人']); $html .= " ". $calc['本人']. ""; $fc = ""; if ($subcalc['本人'] > 0) { $bg = getColor($subcalc['本人']); $sa = sprintf("%01.2f", $calc['本人'] - $subcalc['本人']); $sa < 0 && $fc = "c-f00"; } else { $bg = "white"; $subcalc['本人'] = "-"; $sa = "-"; } $html .= " ". $subcalc['本人']. " $sa"; $n++; $gyo++; } $sc++; } $ct++; } $html .= " "; /************************************************************************* これ以降はページ数が変動する 評価のバラツキ **************************************************************************/ $Question = get_crypt_file("./data/original.que", $System['cryptkey']); $i = 1; foreach ($Question as $val) { $key = sprintf("Q%02d", $i); $Que[$key] = $val; $i++; } $Section['analysis']++; $page++; $html .= newpage($page). "

". $Section['analysis']. ".". $setupReport->section6->title. "

". anslisttitle2(); $ct = 1; $gyo = 0; $max = 25; $graph = array(); foreach ($category as $key => $val) { $row = count($categoryQue[$key]); if (($gyo + $row) > $max) { $page++; $gyo = 0; $html .= " ". newpage($page). anslisttitle2(); } $html .= "

". tate($key). "

"; $sc = 1; foreach ($category[$key] as $subkey => $subval) { $row2 = count($category[$key][$subkey]); $sc > 1 && $html .= ""; $html .= " $subkey"; $n = 1; foreach ($category[$key][$subkey] as $que) { $fields = dbfields($Que[$que]); unset($calc, $cnt, $me); $sql = "SELECT `ID`,`F1`,`F2`,`F3`,`F4`,`F5`,`F6`,`F7`,`$que` FROM `maindata` WHERE `F2`='". $user->Name. "'"; $rs = mysql_query($sql); if (mysql_num_rows($rs)) { while ($buff = mysql_fetch_object($rs)) { $calc[$buff->$que]++; $buff->F3 == "本人" && $me = $buff->$que; } } $n > 1 && $html .= ""; $html .= " $que ". $fields['Que']. ""; for ($i = 1; $i <= 5; $i++) { $val = $calc[$i]; $graph[$i] += $calc[$i]; $star = ""; if ($me == $i) { //$val .= ""; $star = "star"; } $html .= " $val"; } $html .= ""; $n++; $gyo++; } $sc++; } $ct++; } $html .= "

". preg_replace("/(\r\n| |[\r\n])/", "
", $setupReport->section6->comment[0]). "

"; if (!$Report['non_chart_view']) { /* 円グラフ ポイント割合は、配列 $graph に */ if ($max - $gyo < 12) { $page++; newpage($page); } $Section['analysis']++; $html .= "

". $Section['analysis']. ".". $setupReport->section6->subtitle. "

"; $path = "./reportfiles/graph/circlechart". $_REQUEST['id']. ".png"; $graph = array_values($graph); circlechart($path, $graph); $sum = array_sum($graph); $html .= "

". preg_replace("/(\r\n| |[\r\n])/", "
", $setupReport->section6->comment[1]). "

 
1を選択 ". sprintf("%01.2f", $graph[0] / $sum * 100). "%
2を選択 ". sprintf("%01.2f", $graph[1] / $sum * 100). "%
3を選択 ". sprintf("%01.2f", $graph[2] / $sum * 100). "%
4を選択 ". sprintf("%01.2f", $graph[3] / $sum * 100). "%
5を選択 ". sprintf("%01.2f", $graph[4] / $sum * 100). "%
"; } /************************************************************************* 自由記入コメント ゾーン振り分け **************************************************************************/ $Section['analysis']++; $page++; $html .= newpage($page); $commfield = split(",", $Report['commfields']); $html .= "

". $Section['analysis']. ".". $setupReport->section7->title. "

"; $rows = 0; $max = 40; foreach ($commfield as $que) { $fields = dbfields($Que[$que]); $sql = "SELECT `$que` FROM `maindata` WHERE `F2`='". $user->Name. "' AND `F3`!='本人' AND `$que`!='';"; $rs = mysql_query($sql); $row = mysql_num_rows($rs); if ($rows > ($max - 5)) { $rows = 1; $page++; $html .= newpage($page); } $html .= "

■". $fields['Que']. "

"; $rows = 1; $page++; $html .= newpage($page) ."
"; } $page++; $html .= newpage($page). "

". $setupReport->group2->title. "

". $setupReport->matrix->title. "

". $setupReport->matrix->preface. "

【他者】

". $setupReport->matrix->zone[1]. "". $setupReport->matrix->zone[0]. "
". matrixFormat($matrix[B]['部下'], "orange"). " ". matrixFormat($matrix[B]['上司'], "cyan"). "
". matrixFormat($matrix[A]['部下'], "orange"). " ". matrixFormat($matrix[A]['上司'], "cyan"). "
". $setupReport->matrix->zone[3]. "". $setupReport->matrix->zone[2]. "
". matrixFormat($matrix[D]['部下'], "orange"). " ". matrixFormat($matrix[D]['上司'], "cyan"). "
". matrixFormat($matrix[C]['部下'], "orange"). " ". matrixFormat($matrix[C]['上司'], "cyan"). "
4.0
  4.0

【本人】

". $setupReport->matrix->caution. "

". $setupReport->matrix->head. "

    "; foreach ($setupReport->matrix->comment as $line) { $html .= "
  • $line
  • "; } $html .= "
"; $page++; $html .= newpage($page). "

". $setupReport->merit->title. "

". $setupReport->merit->merit. "
". $DATA['weakness']. "
". $setupReport->merit->demerit. "
". $DATA['forte']. "

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

"; $page++; $html .= newpage($page). "

". $setupReport->plan->title. "

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

    "; foreach ($setupReport->plan->comment as $line) { $html .= "
  1. $line
  2. "; } $html .= "
■改善テーマ
". $DATA['improvement']. "
■改善後の姿
". $DATA['presence']. "
■改善の為の具体的行動 ■スケジュール
    "; !is_array($Behavior) && $Behavior = array(); foreach($Behavior as $line) { $html .= "
  1. $line
  2. "; } $html .= "
    "; !is_array($Schedule) && $Schedule = array(); foreach($Schedule as $line) { $html .= "
  1. $line
  2. "; } $html .= "
"; /* 進捗状況とアドバイス */ $page++; $html .= newpage($page). "

". $setupReport->progress->title. "

". $setupReport->progress->head. "

". $setupReport->progress->targettitle. " ". $setupReport->progress->bosstitle. "
"; !is_array($Underway) && $Underway = array(); rsort($Underway); foreach($Underway as $line) { @list($date, $underway) = split("\t", $line); $html .= " "; } $html .= "
・$date
 ". preg_replace("/(\r\n| |[\r\n])/", "
", $underway). "
 
"; $Buffer = data_read("./reportfiles/users/". $_REQUEST['id']. ".adv"); rsort($Buffer); foreach($Buffer as $line) { $advice = dbfields($line); $html .= " "; } $html .= "
・". $advice['date']. " (". $advice['name']. ")
 ". preg_replace("/(\r\n| |[\r\n])/", "
", $advice['advice']). "
 
"; if (!$Report['non_footer_view']) { $footer = $Init['Client']. " ". $Init['Caption']; if ($Setup['Post'] || $Setup['Person']) { $footer .= " ("; $Setup['Post'] && $footer .= " ". $Setup['Post']; $Setup['Person'] && $footer .= " 担当:". $Setup['Person']; $footer .= " )"; } $html .= "

$footer

"; } $html .= "
"; } if ($debug) { echo $html; } else { if ($updateflag) { htmltopdf($html, $pdfpath); } /* 非表示が指定されていなければ表示 */ !$_REQUEST['nonview'] && header("Location:$pdfurl"); } } function matrixFormat($array, $color) { $str = ""; if (isset($array) && count($array)) { $str = " "; $i = 1; $col = 1; foreach ($array as $line) { if ($col > 5) { $str .= "\n"; $col = 1; } $str .= ""; $i++; $col++; } $str .= "
$line
"; } return($str); } function tate($str) { $len = mb_strlen($str, "UTF-8"); $new = array(); for ($i = 0; $i < $len; $i++) { $m = mb_substr ($str, $i, 1, "UTF-8"); if ($m == "ー") $m = "|"; $new[] = $m; } return(join("
", $new)); } function newpage($page) { global $Init; $text = "


". $Init['Client']. " P.$page

"; return($text); } function anslisttitle2() { $text = " "; for ($i = 1; $i <= 5; $i++) { $text .= " "; } $text .= ""; return($text); } function anslisttitle() { global $subflag, $rowspan, $colspan; $text = "


中項目 No. 質問内容 回答者のバラツキ(は本人)
$i
"; return($text); } function getColor($val) { if ($val < 1) { $class = "white"; } elseif ($val < 2) { $class = "Eval1"; } elseif ($val < 3) { $class = "Eval2"; } elseif ($val == 3) { $class = "Eval0"; } elseif ($val < 4) { $class = "Eval3"; } elseif ($val < 5) { $class = "Eval4"; } elseif ($val == 5) { $class = "Eval5"; } else { $class = "white"; } return($class); } function saveImage($path) { /* レーダーチャートの画像を保存 データ数が5個の場合は5角形、6個なら6角形になる ラベルも設定することが必須 */ global $values, $labels; $max = 5; //上限 $step = 1; //目盛の間隔 $margin = 120; //グラフの余白 $text_margin = 25; //ラベルの余白 $size = 320; //サイズ(正方形) //フォント $font = "../common/meiryoKeGothic.ttc"; $font_size = 10; //拡大率 $expansion = 1; $size *= $expansion; $font_size *= $expansion; //画像 $image = imagecreatetruecolor( $size + $margin + 160, $size + $margin / 2); //アンチェリアスをOFF //imageantialias($image, true); //色 $bg = imagecolorallocate($image, 255, 255, 255); // 背景 //先の色 データ用配列($values)に連動 $line[] = imagecolorallocate($image, 68, 68, 255); // #44f $line[] = imagecolorallocate($image, 0, 136, 68); // #084 $line[] = imagecolorallocate($image, 68, 85, 68); // #454 $line[] = imagecolorallocate($image, 170, 0, 0); // #a00 $grid = imagecolorallocate($image, 160, 160, 160); // グリッドの色 $font_color = imagecolorallocate($image, 0, 0, 0); $center_x = round(($size + $margin) / 2); $center_y = round(($size + $margin / 2) / 2 + 15); $count = count($values[0]); $div = round(360 / $count); $length = round($size / 2); // 背景の描画 imagefill($image, 0, 0, $bg); for($i = 1;$i<=$max;$i++){ if($i%$step != 0) continue; $points = array(); for($j=0;$j<$count;$j++){ list($x, $y) = point_rotate($length * ($i / $max), $div * $j - 90); $point = array($x + $center_x, $y + $center_y); imageline($image, $center_x, $center_y, $point[0], $point[1], $grid); $points = array_merge($points, $point); } imagepolygon($image, $points, $count, $grid); } // 文字の描画 for($i = 0;$i<$count;$i++){ $box = imagettfbbox($font_size, 0, $font, $labels[$i]); $text_width = $box[2] - $box[6]; $text_height = $box[3] - $box[7]; list($x, $y) = point_rotate($length + $text_margin, $div * $i - 90); $text_x = (-1 * $text_width / 2) + $center_x + $x; $text_y = ($text_height / 2) + $center_y + $y; imagettftext($image, $font_size, 0, $text_x, $text_y, $font_color, $font, $labels[$i]); } // メモリ for($i=0;$i<=$max;$i=$i+$step){ $box = imagettfbbox($font_size, 0, $font, $i); $text_width = $box[2] - $box[6]; $text_height = $box[3] - $box[7]; $text_x = (-1 * $text_width) + $center_x - $font_size; $text_y = ($text_height / 2) + $center_y - ($length * ($i / $max)); imagettftext($image, $font_size, 0, $text_x, $text_y, $grid, $font, $i); } //凡例 $remarks = array('部下', '同僚', '上司', '本人'); $i = 0; $ch = imagesetthickness($image, 3); foreach ($remarks as $v) { $box = imagettfbbox($font_size, 0, $font, $v); $text_width = $box[2] - $box[6]; $text_height = $box[3] - $box[7]; $text_x = $size + 240; $text_y = $text_height * 1.5 * $i + 200; imagettftext($image, $font_size, 0, $text_x, $text_y, $font_color, $font, $v); imageline($image, $text_x - 60, $text_y - 5, $text_x - 10, $text_y - 5, $line[$i]); $i++; } // グラフの描画 $ch = imagesetthickness($image, 3); $c = 0; foreach ($values as $vl) { $points = array(); for($i = 0; $i < $count; $i++){ $value = $length * $vl[$i] / $max; list($x, $y) = point_rotate($value, $div * $i - 90); $point = array($x + $center_x, $y + $center_y); $points = array_merge($points, $point); } imagepolygon($image, $points, $count, $line[$c]); $c++; } imagepng($image, $path); imagedestroy($image); } function point_rotate($length, $angle){ $angle = deg2rad($angle); $x = round($length * cos($angle)); $y = round($length * sin($angle)); return array($x, $y); } function saformat($a, $b) { if ($a == '') { $val = "-"; } else { $val = sprintf("%01.2f", $a - $b); } $val < 0 && $val = "$val"; return($val); } function linechart($path, $title, $lines) { global $labels; $ct = count($labels); if ($ct > 5) { $len = 2; } elseif ($ct > 3) { $len = 3; } else { $len = 4; } foreach ($labels as &$str) { $str = mb_substr($str, 0, $len, "UTF-8"); } $max = 5; //上限 $step = 1; //目盛の刻み $label_rotate = false; $show_legend = true; //凡例の表示 $width = 265; $height = 180; $margin_top = 40; $margin_right = 70; $margin_bottom = 40; $margin_left = 20; //フォント $font = '../common/meiryoKeGothic.ttc'; $font_size = 9; $image = imagecreatetruecolor($width + $margin_left + $margin_right, $height + $margin_top + $margin_bottom); imageantialias($image, true); $org_x = $margin_left; $org_y = $height + $margin_top; //色 $bg_color = imagecolorallocate($image, 255, 255, 255); //背景 $text_color = imagecolorallocate($image, 0, 0, 0); //テキスト $grid_color = imagecolorallocate($image, 128, 128, 128); //グリッド $grid_spacing = $height / $max * $step; imagefill($image, 0, 0, $bg_color); for($i=0;$i<=floor($max / $step);$i++){ if($i !== 0) imageline($image, $org_x, $org_y - $grid_spacing * $i, $org_x + $width, $org_y - $grid_spacing * $i, $grid_color); $text = $i * $step; $box = imagettfbbox($font_size, 0, $font, $text); $text_width = $box[2] - $box[6]; $text_height = $box[3] - $box[7]; $text_x = $org_x - $font_size; $text_y = $org_y - $grid_spacing * $i; imagettftext($image, $font_size, 0, (-1 * $text_width) + $text_x, ($text_height / 2) + $text_y, $text_color, $font, $text); } $count = count($lines[0]['values']); $graph_spacing = floor( $width / $count); $legend_x = $org_x + $width + 20; $legend_y = $margin_top + 10; //各グラフの描画 // 最初の値が0ならグラフを描画しない $lineflag = $lines[0]['values'][0]; foreach($lines as $line){ $values = $line['values']; $graph_color = imagecolorallocate($image, $line['color'][0], $line['color'][1], $line['color'][2]); for($i=0;$i<$count;$i++){ $graph_x = $org_x + $graph_spacing * $i + round($graph_spacing / 2); $graph_y = $org_y - $height * $values[$i] / $max; if(isset($prev)){ $lineflag && imageline($image, $prev[0], $prev[1], $graph_x, $graph_y, $graph_color); $lineflag && imageline($image, $prev[0], $org_y, $prev[0], $org_y + 5, $text_color); } $lineflag && imagefilledrectangle($image, $graph_x - 2, $graph_y - 2, $graph_x + 2, $graph_y + 2, $graph_color); $prev = array($graph_x,$graph_y); } imageline($image, $prev[0], $org_y, $prev[0], $org_y + 5, $text_color); //凡例の描画 if($show_legend){ $text = $line['name']; $box = imagettfbbox($font_size, 0, $font, $text); $text_width = $box[2] - $box[6]; $text_height = $box[3] - $box[7]; imagettftext($image, $font_size, 0, $legend_x, $legend_y, $graph_color, $font, '■ ' . $text); $legend_y = $legend_y + ($text_height * 2); } unset($prev); } for($i=0;$i<$count;$i++){ $graph_x = $org_x + $graph_spacing * $i + round($graph_spacing / 2); $text = $labels[$i]; $box = imagettfbbox($font_size, 0, $font, $text); $text_width = $box[2] - $box[6]; $text_height = $box[3] - $box[7]; if($label_rotate){ $text_x = round($text_height / 2) + $graph_x; $text_y = $text_width + $org_y + $font_size; imagettftext($image, $font_size, 90, $text_x, $text_y, $text_color, $font, $text); } else { $text_x = round((-1 * $text_width / 2)) + $graph_x; $text_y = ($text_height / 2) + $org_y + $font_size * 2; imagettftext($image, $font_size, 0, $text_x, $text_y, $text_color, $font, $text); } } imageline($image, $org_x, $org_y, $org_x, $margin_top, $text_color); imageline($image, $org_x, $org_y, $org_x + $width, $org_y, $text_color); $box = imagettfbbox($font_size, 0, $font, $title); $text_width = $box[2] - $box[6]; $text_height = $box[3] - $box[7]; $text_x = $org_x + $width / 2 - ($text_width / 2); $text_y = $org_y - $height - $font_size * 2; imagettftext($image, $font_size, 0, $text_x, $text_y, $text_color, $font, $title); imagepng($image, $path); imagedestroy($image); } function circlechart($path, $values) { // 画像を作成する $width = 280; $height = 220; $henpei = 180; $image = imagecreatetruecolor($width, $height); $bg = imagecolorallocate( $image, 255, 255, 255 ); imagefill($image, 0, 0, $bg); imageantialias($image, true); $cx = $width / 2; $cy = $height / 2 - 15; // 色を割り当てる $white = imagecolorallocate($image, 0xFF, 0xFF, 0xFF); $color[0][0] = imagecolorallocate($image, 0xA0, 0xA0, 0xA0); $color[0][1] = imagecolorallocate($image, 0x70, 0x70, 0x70); $color[1][0] = imagecolorallocate($image, 0x44, 0x44, 0xFF); $color[1][1] = imagecolorallocate($image, 0x22, 0x22, 0xDD); $color[2][0] = imagecolorallocate($image, 0xEE, 0xEE, 0x00); $color[2][1] = imagecolorallocate($image, 0xCC, 0xCC, 0x00); $color[3][0] = imagecolorallocate($image, 0x00, 0xFF, 0x00); $color[3][1] = imagecolorallocate($image, 0x00, 0xCC, 0x50); $color[4][0] = imagecolorallocate($image, 0xFF, 0x00, 0x00); $color[4][1] = imagecolorallocate($image, 0xCC, 0x00, 0x00); /* 合計 */ $sum = array_sum($values); // 3D 効果を作成する $st = 0; for ($i = $cy + 30; $i > $cy; $i--) { foreach ($values as $key => $val) { $kaz = $val / $sum; $kakudo = 360 * $kaz; imagefilledarc($image, $cx, $i, $width, $henpei, $st - 90, $st + $kakudo - 90, $color[$key][1], IMG_ARC_PIE); $st += $kakudo; } } $st = 0; foreach ($values as $key => $val) { $kaz = $val / $sum; $kakudo = 360 * $kaz; imagefilledarc($image, $cx, $cy, $width, $henpei, $st - 90, $st + $kakudo - 90, $color[$key][0], IMG_ARC_PIE); $st += $kakudo; } // 画像を出力します imagepng($image, $path); imagedestroy($image); } function hanrei() { $text = "

セルの色      1.00~1.99    2.00~2.99    3.00    3.01~3.99    4.00~4.99    5.00

"; return($text); } ?>


中項目 No. 部下 同僚 上司 本人
今回 前回 今回 前回 今回 前回 今回 前回