function data_convert($data) { //GET、POSTデータコンバート if (!is_array($data)) { $data = mce($data); $data = str_replace("\r\n", "\n", $data); $data = str_replace("\r", "\n", $data); $data = str_replace("<br>", "\n", $data); $data = str_replace("\n", "<br />", $data); $data = str_replace("'", "’", $data); $data = str_replace("\"", "”", $data); $data = str_replace(",", "、", $data); $data = strip_tags($data); $data = htmlspecialchars($data); } elseif (is_array($data)) { foreach ($data as $val) { $newval = mce($val); $newval = str_replace("\r\n", "\n", $newval); $newval = str_replace("\r", "\n", $newval); $newval = str_replace("<br>", "\n", $newval); $newval = str_replace("\n", "<br />", $newval); $newval = str_replace("'", "’", $newval); $newval = str_replace("\"", "”", $newval); $newval = str_replace(",", "、", $newval); $newval = strip_tags($newval); $newval = htmlspecialchars($newval); $newdata[] = $newval; } unset($val); $data = $newdata; } return $data; }
} //予定工数,実績工数のX軸線 for ($i = 40; $i < 4100; $i = $i + 20) { imageline($image, 320, $i, 400, $i, $black); } //表のタイトルを描画 imagettftext($image, 8, 0, 45, 55, $black, $font, mce("WBS\n番号")); imagettftext($image, 8, 0, 135, 65, $black, $font, mce('タスク名')); imagettftext($image, 8, 0, 245, 65, $black, $font, mce('作業人数(人)')); imagettftext($image, 8, 0, 322, 55, $black, $font, mce('予定工数(人日)')); imagettftext($image, 8, 0, 322, 75, $black, $font, mce('実績工数(人日)')); for ($i = 0; $i <= 99; $i++) { $taskno = $No[$i] + 1; //表の中身を描画 imagettftext($image, 8, 0, 50, $i * 40 + 105, $black, $font, $taskno); imagettftext($image, 8, 0, 90, $i * 40 + 105, $black, $font, mce($TaskName[$i])); imagettftext($image, 8, 0, 250, $i * 40 + 105, $black, $font, $ninzu[$i]); imagettftext($image, 8, 0, 355, $i * 40 + 95, $black, $font, $nissu[$i]); imagettftext($image, 8, 0, 355, $i * 40 + 115, $black, $font, $kikan[$i]); //計画値描画 imagefilledrectangle($image, graphStartX + graphX * $planStart[$i], graphStartY + $i * graphY, graphStartX + graphX * $planStart[$i] + graphX * $nissu[$i], graphEndY + $i * graphY, $red); //進捗率描画 imagefilledrectangle($image, graphStartX + graphX * $planStart[$i], graphStartY + $i * graphY + 3, $sintyokuBer[$i], graphEndY + $i * graphY - 3, $orange); //実績値描画 imagefilledrectangle($image, graphStartX + graphX * $actStart[$i], graphStartY + $i * graphY + 20, graphStartX + graphX * $actStart[$i] + graphX * $kikan[$i], graphEndY + $i * graphY + 20, $blue); //デバッグ用文字列描画 //imagettftext($image, 8, 0, 420, $i * 40 + 95, $black, $font, "No" . $No[$i] . ",pretask" . ($PreTask[$i] - 1) . ",planstart" . $planStart[$i] . ",planend" . $planEnd[$i]); //imagettftext($image, 8, 0, 420, $i * 40 + 115, $black, $font, "No" . $No[$i] . ",pretask" . ($PreTask[$i] - 1) . ",actstart" . $actStart[$i] . ",actend" . $actEnd[$i]); } //グラフ領域のY軸を描画 for ($i = 0; $i <= 202; $i++) {