function _createTable($a, $b) { global $rtf, $sect, $project_id, $ps_id; $table =& $sect->addTable('center'); $table->addRows(2, 0.4); $total_posisi = 3; $arr_cols[] = 5; // width "kompetensi name" for ($i = 0; $i < $total_posisi * 3; $i++) { $arr_cols[] = 0.99; } $table->addColumnsList($arr_cols); $font = new PHPRtfLite_Font(8, 'Tahoma'); $table->mergeCellRange(1, 1, 2, 1); for ($i = 0; $i < $total_posisi; $i++) { $table->mergeCellRange(1, 2 + 3 * $i, 1, 4 + 3 * $i); } $table->writeToCell(1, 1, '<b>Kompetensi</b>', $font, new PHPRtfLite_ParFormat('center')); $cell =& $table->getCell(1, 1); $cell->setVerticalAlignment('center'); $qup = mysql_query("select posisi_id,pp_standar from t_project_posisi where project_id = {$project_id} group by posisi_id limit {$a},{$b}"); for ($i = 0; $i < $total_posisi; $i++) { $rup = mysql_fetch_object($qup); $table->writeToCell(1, 2 + 3 * $i, '<b>' . getPosisiName($rup->posisi_id) . '</b>', $font, new PHPRtfLite_ParFormat('center')); $table->writeToCell(2, 2 + 3 * $i, '<b>Stdr</b>', $font, new PHPRtfLite_ParFormat('center')); $table->writeToCell(2, 3 + 3 * $i, '<b>Lvl</b>', $font, new PHPRtfLite_ParFormat('center')); $table->writeToCell(2, 4 + 3 * $i, '<b>Gap</b>', $font, new PHPRtfLite_ParFormat('center')); } $border = new PHPRtfLite_Border_Format("1px", "#000000", "solid", null); $border1 = new PHPRtfLite_Border_Format("1px", "#0000ff", "dash", null); $table->setBordersOfCells($border, 1, 1, 2, 1 + $total_posisi * 3, true, true, true, true); $table->setBackgroundForCellRange('#CCCCCC', 1, 1, 2, 1 + $total_posisi * 3); /* table kompetensi */ $qup = mysql_query("select * from t_project_kompetensi where project_id = {$project_id}"); $totalkomp = mysql_num_rows($qup); $brs = 0; for ($i = 0; $i < mysql_num_rows($qup); $i++) { $rup = mysql_fetch_object($qup); $table->addRows(1, 0.4); $table->writeToCell(3 + $i, 1, getKompetensiName($rup->kompetensi_id), $font, new PHPRtfLite_ParFormat('left')); $qup2 = mysql_query("select posisi_id,pp_standar from t_project_posisi where project_id = {$project_id} group by posisi_id limit {$a},{$b}"); for ($j = 0; $j < mysql_num_rows($qup2); $j++) { $rup2 = mysql_fetch_object($qup2); $rek_komp[$j] = getRekKompetensi($project_id, $rup2->posisi_id, $ps_id); $rek_study[$j] = getKesesuaianStudi($rup2->posisi_id, $ps_id); $rek_akhir[$j] = getRekAkhir($project_id, $rup2->posisi_id, $ps_id); if (checkPosisiExist($project_id, $rup->pk_id, $rup2->posisi_id)) { $level = getLevelPeserta($ps_id, $rup->kompetensi_id); $table->setBackgroundForCellRange('#CCCCCC', 3 + $i, 2 + 3 * $j, 3 + $i, 2 + 3 * $j); $table->writeToCell(3 + $i, 2 + 3 * $j, $rup2->pp_standar, $font, new PHPRtfLite_ParFormat('center')); $table->setBackgroundForCellRange('#C5EFFD', 3 + $i, 3 + 3 * $j, 3 + $i, 3 + 3 * $j); $table->writeToCell(3 + $i, 3 + 3 * $j, $level, $font, new PHPRtfLite_ParFormat('center')); $table->setBackgroundForCellRange('#FFFFFF', 3 + $i, 4 + 3 * $j, 3 + $i, 4 + 3 * $j); if ($level - $rup2->pp_standar < 0) { $table->writeToCell(3 + $i, 4 + 3 * $j, '<b>' . ($level - $rup2->pp_standar) . '</b>', new PHPRtfLite_Font(8, 'Tahoma', '#FF0000'), new PHPRtfLite_ParFormat('center')); } else { $table->writeToCell(3 + $i, 4 + 3 * $j, $level - $rup2->pp_standar, $font, new PHPRtfLite_ParFormat('center')); } } else { $table->setBackgroundForCellRange('#A8B1B8', 3 + $i, 2 + 3 * $j, 3 + $i, 4 + 3 * $j); } } $brs++; } $table->addRows(1, 0.4); $table->writeToCell(3 + $brs, 1, 'Rekomendasi Berdasarkan Kompetensi', $font, new PHPRtfLite_ParFormat('right')); for ($i = 0; $i < $total_posisi; $i++) { $table->mergeCellRange(3 + $brs, 2 + 3 * $i, 3 + $brs, 4 + 3 * $i); } for ($i = 0; $i < $total_posisi; $i++) { $table->writeToCell(3 + $brs, 2 + 3 * $i, $rek_komp[$i], $font, new PHPRtfLite_ParFormat('center')); } $table->setBordersOfCells($border, 3, 1, $totalkomp + 3, 1 + $total_posisi * 3, true, true, true, true); $table->addRows(1, 0.4); $table->writeToCell(4 + $brs, 1, 'Kesesuaian Bidang Studi', $font, new PHPRtfLite_ParFormat('right')); for ($i = 0; $i < $total_posisi; $i++) { $table->writeToCell(4 + $brs, 3 + 3 * $i, $rek_study[$i], $font, new PHPRtfLite_ParFormat('center')); } $table->setBordersOfCells($border, $brs + 4, 1, $brs + 4, 1, true, true, true, true); $table->setBordersOfCells($border, $brs + 4, 4, $brs + 4, 4, false, false, true, false); $table->setBordersOfCells($border, $brs + 4, 7, $brs + 4, 7, false, false, true, false); $table->setBordersOfCells($border, $brs + 4, 10, $brs + 4, 10, false, false, true, false); $table->addRows(1, 0.4); $table->writeToCell(5 + $brs, 1, 'REKOMENDASI AKHIR', $font, new PHPRtfLite_ParFormat('right')); for ($i = 0; $i < $total_posisi; $i++) { $table->mergeCellRange(5 + $brs, 2 + 3 * $i, 5 + $brs, 4 + 3 * $i); } for ($i = 0; $i < $total_posisi; $i++) { $table->writeToCell(5 + $brs, 2 + 3 * $i, $rek_akhir[$i], $font, new PHPRtfLite_ParFormat('center')); } $table->mergeCellRange(1, 1, 2, 1); $table->setBordersOfCells($border, $brs + 5, 1, $brs + 5, 1 + $total_posisi * 3, true, true, true, true); $sect->writeText("<b>Keterangan:</b><br/><b>Stdr:</b> Standar penilaian kompetensi<br/><b>Lvl:</b> Level aktual kompetensi<br/><b>Gap:</b> Selisih level aktual dengan standar penilaian kompetensi", new PHPRtfLite_Font(8, 'Arial'), new PHPRtfLite_ParFormat('left')); }
echo $bln; ?> <?php echo $thn; ?> </td> <td ><?php echo $rup['ps_test_kota']; ?> </td> <td ><?php echo $rup['ps_assesor_nama']; ?> </td> <td ><?php echo getPosisiName($rup['ps_proyeksi_jabatan']); ?> </td> <td ><?php echo $rup['ps_bidang_studi']; ?> </td> <td ><?php echo $mf_value[0]; ?> </td> <td ><?php echo $mf_value[1]; ?> </td> <td ><?php