Viewing file:      2553-02-23-1.0.06-reportDataRQCourseTe.php (13.21 KB)      -rw-r--r-- Select action/file-type:    (+) |   (+) |   (+) | Code (+) | Session (+) |   (+) | SDB (+) |   (+) |   (+) |   (+) |   (+) |   (+) |
 
<? 
 set_time_limit(0);
 include_once "../../class/clsDB.php";
 include_once "../../class/clsConnection.php";
 include_once "../global.php";
 include_once "../link/function.php";
 include_once "../class/clsReg_SysSemesterDes.php";
 include_once "../class/clsReg_Program.php";
 include_once "../class/clsRegistration.php";
 include_once "../class/clsCourseAssess.php";
 include_once "../class/clsHoldCourse.php";
 include_once "../class/clsClassAssess.php";
 include_once "../class/clsClassOpenForAssess.php";
 include_once "../class/clsClassInStructorAssess.php";
 include_once "../class/clsOfficerAssess.php";
 include_once "../class/clsDefineAssessment.php";
 include_once "../class/clsAssessForm.php";
 include_once "../class/clsDoAssessment.php";
 include_once "../class/clsResultRQ.php";
 include_once "../class/clsSectionAll.php";
 include_once "../class/clsHeaderQuestion.php";
 include_once "../class/clsHeaderScore.php";
 include_once "../class/clsDetailScore.php";
 include_once "../class/clsRadioQuestion.php";
 include_once "../class/clsSectionAll.php";
 include_once "../class/clsTimeTableAssess.php";
 include_once "../class/clsMainExternalPlace.php";
 include_once "../class/clsSubExternalPlace.php";
 
 $oCR = new clsConnection($GLOBALS['HOST'], $GLOBALS['DB_REG'], $GLOBALS['USER_REG'], $GLOBALS['PASSWORD_REG']);
 
 $oCA = new clsConnection($GLOBALS['HOST'], $GLOBALS['DB_EASS'], $GLOBALS['USER_EASS'], $GLOBALS['PASSWORD_EASS']);
 
 $oReg = new Registration($oCA);
 $oCourse = new CourseAssess($oCA);
 $oClass = new ClassAssess($oCA);
 $oClsOpen = new ClassOpenForAssess($oCA);
 $oCIS = new ClassInStructorAssess($oCA);
 $oOFA = new OfficerAssess($oCA);
 $oHC = new HoldCourse($oCA);
 $oAF = new AssessForm($oCA);
 $oDo = new DoAssessment($oCA);
 $oTTA=new TimeTableAssess($oCA);
 
 $oMep = new MainExternalPlace($oCA);
 $oSep = new SubExternalPlace($oCA);
 if(!isset($mepId)){
     $mepId='%';
     $sepId='%';
 }
 
 $oCourse->SearchByKey($courseId);
 $oCourse->GetRecord();
 $oClass->SearchByKey($classId);
 $oClass->GetRecord();        
 
 $oProg = new Program($oCR);
 $oProg->SearchByKey($programId);
 $oProg->GetRecord();
 
 
 
 $oAF->RSAssessFormByAssid($assid);
 $oAF->GetRecord();
 
 $oSse = new SysSemesterDes($oCR);
 $oSse->SearchByKey($semester);
 $oSse->GetRecord();
 
 $oDA = new DefineAssessment($oCA);
 $oDA->SearchByDefineid($defineid);
 $oDA->GetRecord();
 
 //ค้นหาคำถามปลายเปิดในแบบประเมินนี้ sectionTQid = 1
 $oSA = new SectionAll($oCA);
 $CntSRQid = $oSA->RSCountSectionRQid($assid);
 
 $oRRQ = new ResultRQ($oCA);
 ?>
 <title>รายงานผลประเมินข้อมูลดิบ (เฉพาะคำถามปลายปิด)</title>
 <meta http-equiv="Content-Type" content="text/html; charset=tis-620">
 <link href="../source/style.css" rel="stylesheet" type="text/css">
 <div id="tabmargin">
        <form name="pc" method="post" action="<?php echo $PHP_SELF;?>" enctype="multipart/form-data">
           <div align="center">
           </div><br>
           <table width="94%" align="center" cellpadding="1" cellspacing="1"  bgcolor="#0080C0">
             <tr bgcolor="#FFFFFF">
               <td width="99%">
               <table width="83%" align="center" border="0" cellpadding="0" cellspacing="1">
                   <tr> 
                     <td> <table border="0" align="center">
                         <tr> 
                           <td height="10"></td>
                         </tr>
                       </table>
                       <table width="100%" align="center"  cellpadding="1" cellspacing="1" bgcolor="<?php echo $GLOBALS['COLOR_BG_TD_6'];?>">
                         <tr> 
                           
                     <td height="22" align="center"><font size="2"><span class = "fontMark5">รายงานผลการประเมินข้อมูลดิบ</span></font></td>
                         </tr>
                         <tr> 
                     <td height="22" align="center"><font size="2"> <span class = "fontMark6"> 
                       เฉพาะคำถามปลายปิด : ส่วนของคำถามชนิดให้เลือกตอบอย่างใดอย่างหนึ่ง</span></font></td>
                         </tr>
                       </table>
                       <table width="100%" border="0" align="center">
                         <tr>
                           <td height="25"><hr></td>
                         </tr>
                       </table>
     <table width="100%" border="0" align="center">            
                   <tr> 
                     <td height="25" align="right"><font size="2"><span class = "fontMark5"><b>
                      <img src="../picture/ico_excel.gif" border="0"> รูปแบบ  Excel
                      <a href="reportDataRQCourseTe_excel1.php?defineid=<? echo $defineid ?>&assid=<? echo $assid ?>&classId=<? echo $classId ?>&courseId=<? echo $courseId ?>&officerId=<? echo $officerId?>&officerCode=<? echo $officerCode ?>&acadYear=<? echo  $acadYear ?>&semester=<? echo $semester ?>&programId=<?=$programId?>&ttId=<?=$ttId?>&mepId=<?=$mepId?>&sepId=<?=$sepId?>" target="_top"><b> [1] </b></a>
                     <a href="reportDataRQCourseTe_excel2.php?defineid=<? echo $defineid ?>&assid=<? echo $assid ?>&classId=<? echo $classId ?>&courseId=<? echo $courseId ?>&officerId=<? echo $officerId?>&officerCode=<? echo $officerCode ?>&acadYear=<? echo  $acadYear ?>&semester=<? echo $semester ?>&programId=<?=$programId?>&ttId=<?=$ttId?>&mepId=<?=$mepId?>&sepId=<?=$sepId?>" target="_top"><b> [2] </b></a></b></span></font></td>
                   </tr>
                 <br>
                 <?  // -- Show Head Report --
                               include_once "headReport.php"; 
                  ?>
                 <?
      if($CntSRQid  > 0){ 
                     /*------------------------หาจำนวนของส่วนว่ามีกี่ส่วน  และจำนวนของข้อคำถามที่มีตัวเลือก----------------------------*/
                     $numSection = 0;
                     $ocSA = new SectionAll($oCA);
                     //$numSection = $oSA->RSCountSectionRQid($assid);
                       $ocSA->RSByKeyAss($assid);
                     while($ocSA->GetRecord()){
                         if($ocSA->sectionRQid != '0'){    
                                 $ocRQ = new RadioQuestion($oCA);
                                 $ocRQ->RSRadioQByKey($assid,$ocSA->sectionRQid,1);
                                 while($ocRQ->GetRecord()){
                                     $ocCntRQ = new RadioQuestion($oCA);
                                     $cCntSubQ = $ocCntRQ->RSCountSubRQid($assid,$ocRQ->RQid,'2');
 
                                     if($cCntSubQ == 0){
                                         $mergeRQ[$numSection]++;
                                     } //end if CntSubQ
 
                                     $oscRQ = new RadioQuestion($oCA);
                                     $oscRQ->RSCheckLevel($assid,$ocRQ->RQid);
                                     while($oscRQ->GetRecord()){
                                         $mergeRQ[$numSection]++;
                                     } //end while oscRQ
                                 } // end while ocRQ
                             $numSection++;
                         } // end if ocSA
                     } // end while ocSA
                 
                     ?>
 <table width="100%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#666666">
                        
                         <tr>     
                     <td width="10%" rowspan="2" align="center" bgcolor="<?php echo $GLOBALS["COLOR_BG_TABLE_1"];?>"><font size="2"><b>ลำดับที่ประเมิน</b></font></td>
                           <? /*---------------------------  สร้างแต่ละส่วนของหัวตาราง -------------------------*/
                             $oSA1= new SectionAll($oCA);
                             $i = 0;
                             $indexSection_head = 1;
                             $oSA1->RSByKeyAss($assid);
                             while ($oSA1->GetRecord()){
                                 if($oSA1->sectionRQid != '0'){    
                             ?>
                             <td width="87%" height="25%" colspan="<? echo $mergeRQ[$i] ?>" align="center" bgcolor="<?php echo $GLOBALS["COLOR_BG_TABLE_1"];?>"><font size="2"><b>คะแนนรายข้อคำถาม  ส่วนที่ <? echo $indexSection_head; ?> </b></font></td>
                             <?
                                 $mergeAll += $mergeRQ[$i];
                                 $i++;
                                 } // end if oSA
                                 $indexSection_head++;
                             } //end while oSA 
 
                             ?>
                      </tr>
                         <tr bgcolor="<?php echo $GLOBALS["COLOR_BG_TD_7"];?>"> 
                 <? /*--------------------------------------- สร้างส่วนหัวของตาราง  ข้อคำถามของแบบประเมินที่มีตัวเลือก-------------------------------*/ 
                         $oSA = new SectionAll($oCA);
                        $oSA->RSByKeyAss($assid);
                         while($oSA->GetRecord()){
                             if($oSA->sectionRQid != '0'){    
                                 $index1=1;
                                 $oRQ = new RadioQuestion($oCA);
                                 $oRQ->RSRadioQByKey($assid,$oSA->sectionRQid,1);
                                 while($oRQ->GetRecord()){
                                         $oCntRQ = new RadioQuestion($oCA);
                                         $CntSubQ = $oCntRQ->RSCountSubRQid($assid,$oRQ->RQid,'2');
                                         if($CntSubQ == 0){
                      ?>
                           <td width="3%" height="22" align="center"><font size="2"><? echo $index1; ?></font></td>            
                     <?
                                         } //end if CntSubQ
                                         $index2=1;
                                         $osRQ = new RadioQuestion($oCA);
                                         $osRQ->RSCheckLevel($assid,$oRQ->RQid);
                                         while($osRQ->GetRecord()){
                     ?>
                                              <td width="3%" height="22" align="center"><font size="2"><? echo $index1.".".$index2; ?></font>                                            </td>
                     <?
                                             $index2++;
                                         } //end while osRQ
                                         $index1++; 
                                     } // end while oRQ        
                             }  //end while oSA    
                         } //end if sectionRQ
                 ?>
                         </tr>
                     <?
                     /*  --------------------------------------- สร้างตารางผลการประเมิน --------------------------------------------- */
                    $indexDoAss = 1;    
                     $oDo = new DoAssessment($oCA);
                     
                     if($ttId==0){
                         //$oDo->SearchDoidByDefineidOfficeridClassId($defineid,$officerId,$classId);
                         $oDo->SearchDoidByDeOfClCoTtMepSep($defineid,$officerId,$classId,$courseId,$ttId,$mepId,$sepId);
                     }else
                         $oDo->SearchDoidByDefineidOfficeridClassIdttId($defineid,$officerId,$classId,$ttId);
                     while($oDo->GetRecord()){ 
                 ?>
                         <tr bgcolor="<?php echo $GLOBALS['COLOR_BG_TD_5'];?>"> 
                             <td align="center"><font size="2"><? echo $indexDoAss; ?></font></td>
                 <?
                         $orSA = new SectionAll($oCA);
                         $orSA->RSByKeyAss($assid);
                         while($orSA->GetRecord()){
                             if($orSA->sectionRQid != '0'){    
                                 $oRRQ->SearchPointByDoidSectionRQid($oDo->doid,$orSA->sectionRQid);
                                 while($oRRQ->GetRecord()){
                                 ?>
                                   <td align="center"><font size="2"><? echo $oRRQ->point; ?></font></td>
                                 <?
                                 } // end while oRRQ
                             } // end if orSA
                         } // end while orSA 
                     ?> </tr>
                     <?    $indexDoAss++;
                     } // end while oDo  ?>
 
                     <?        if(($indexDoAss-1) == 0){  ?>
                           <tr bgcolor="<?php echo $GLOBALS['COLOR_BG_TD_5'];?>">
                                 <td colspan="<? echo $mergeAll+1 ?>" align="center">
                                     <font size="2" color="<?php echo $GLOBALS["COLOR_FONT_3"];?>">** ไม่พบข้อมูล **</font>                                </td>
                         </tr>
                     <?    }  ?>
                     </table>
 <br>
                 <table width="100%" border="0" align="center">
                   <tr> 
                     <td width="64"><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_5"];?>"><b>หมายเหตุ :</b></font></td>
                     <td><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_5"];?>"><? if($numSection > 1) {?> ข้อคำถามในแต่ละส่วน <? }else { echo "<u>ข้อคำถาม</u>";} ?></font></td>
                   </tr>
                   <tr> 
                     <td height="22"> </td>
                     <td> <font size="2" color="<?php echo $GLOBALS["COLOR_FONT_5"];?>">
                  <?
                         /*----------------------------------- สร้างหมายเหตุของข้อคำถาม -----------------------------------*/
                         $indexSection = 1; 
                         $numSubtract = 0;
                         $oSA = new SectionAll($oCA);
                         $oSA->RSByKeyAss($assid);
                         while($oSA->GetRecord()){
                             if($oSA->sectionRQid != '0'){    
                                     $index1=1;
                                     if($numSection > 1) {
                                         echo "<u> ส่วนที่ ".$indexSection."<br></u>";
                                     }
                                     $oRQ = new RadioQuestion($oCA);
                                     $oRQ->RSRadioQByKey($assid,$oSA->sectionRQid,1);
                                     while($oRQ->GetRecord()){
                                         echo $index1.". ".$oRQ->nameRQ;
                                         if($oRQ->subtract == -1) { ?> <font size="2" color="<?php echo $GLOBALS["COLOR_FONT_7"]; ?>"> * </font><? $numSubtract++; }
                                         echo "<br>"; 
                                         $index2=1;
                                         $osRQ = new RadioQuestion($oCA);
                                         $osRQ->RSCheckLevel($assid,$oRQ->RQid);
                                         while($osRQ->GetRecord()){
                                              echo "<img src = \"../picture/blank1.gif\">".$index1.".".$index2." ".$osRQ->nameRQ; 
                                             if($osRQ->subtract == -1) { ?><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_7"]; ?>"> * </font> <? $numSubtract++; }
                                             echo "<br>"; 
                                             $index2++;
                                         } //end while osRQ
                                         $index1++; 
                                     } // end while oRQ        
                             }  //end while oSA
                             $indexSection++;    
                         } //end if sectionRQ
                 ?></font>
                     </td>
                   </tr>
                     <tr>   
                       <td width="70" height="18"><font size="2"> </font></td>
                       <td width="674"><? if($numSubtract > 0) { ?><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_5"]; ?>">สัญลักษณ์</font> <font size="2" color="<?php echo $GLOBALS["COLOR_FONT_7"]; ?>">* </font><font size="2" color="<?php echo $GLOBALS["COLOR_FONT_5"];?>">    หมายถึง คำถามเชิงลบ โดยกรณีที่เป็นคำถามเชิงลบในข้อนั้นๆ คะแนนรายข้อคำถามจะแสดงข้อมูลที่กลับค่าให้แล้ว</font><? } ?></td>
                     </tr>
                 </table>
     <? } else { ?>
                     <table width="100%">
                           <tr bgcolor="<?php echo $GLOBALS['COLOR_BG_TD_5'];?>">     
                               <td align="center"> <font size="2" color="<?php echo $GLOBALS["COLOR_FONT_3"];?>">** ไม่พบข้อมูลเนื่องจากแบบประเมินที่สร้างไม่มีส่วนของคำถามปลายปิด **</font> 
                             </td>
                           </tr>
                     </table>
     <? } set_time_limit(30);?>
                     </td>
                   </tr>
                 </table></td>
             </tr>
           </table>
           </form><br>
 </div>
         </body>
  |