Esempio n. 1
0
$MySql .= "ORDER BY FrqId";*/
$MySql = "SELECT FrqId, FrqStatus, FrqQuestion, FrqTip, FrqType, FrqOptions, ToCategory AS TtCategory " . "FROM FinalReportQ " . "INNER JOIN Tournament ON ToId=" . StrSafe_DB($_SESSION['TourId']) . " ";
if ($AllQuestions) {
    $MySql .= "WHERE FrqStatus > 0 ";
} else {
    $MySql .= "WHERE (FrqStatus & ToCategory) > 0 ";
}
$MySql .= "ORDER BY FrqId";
$Rs = safe_r_sql($MySql);
if (safe_num_rows($Rs) > 0) {
    while ($MyRow = safe_fetch($Rs)) {
        if ($MyRow->FrqType == -1) {
            $pdf->SetFont($pdf->FontStd, 'B', 10);
            $pdf->Cell(190, 7, $MyRow->FrqId . ' - ' . $MyRow->FrqQuestion, 1, 1, 'L', 1);
        } else {
            $hLine = $pdf->GetNumChars(str_replace("|", " / ", $MyRow->FrqOptions)) > 85 ? 2 : 1;
            $pdf->SetFont($pdf->FontStd, '', 8);
            $pdf->Cell(10, 5 * $hLine + ($MyRow->FrqTip || $AllQuestions ? 4 : 0), $MyRow->FrqId . ".", 'LTB', 0, 'L', 0);
            $pdf->Cell(60, 5 * $hLine, $MyRow->FrqQuestion, 'T' . ($MyRow->FrqTip || $AllQuestions ? '' : 'B'), 0, 'L', 0);
            switch ($MyRow->FrqType) {
                case 0:
                    $pdf->Cell(120, 5 * $hLine, get_text('jrTextBox', 'Common', $MyRow->FrqOptions > 0 ? $MyRow->FrqOptions : 255), 'RT' . ($MyRow->FrqTip || $AllQuestions ? '' : 'B'), 1, 'L', 0);
                    break;
                case 1:
                    $pdf->Cell(120, 5 * $hLine, get_text('jrTextArea', 'Common', explode('|', $MyRow->FrqOptions)), 'RT' . ($MyRow->FrqTip || $AllQuestions ? '' : 'B'), 1, 'L', 0);
                    break;
                case 2:
                    $pdf->Cell(120, 5 * $hLine, get_text('jrYesNo', 'Common'), 'RT' . ($MyRow->FrqTip || $AllQuestions ? '' : 'B'), 1, 'L', 0);
                    break;
                case 3:
                    if ($hLine != 1) {