$row = safe_fetch($r); $ses = substr($row->AtTargetNo, 0, 1); $tar = substr($row->AtTargetNo, 1); } else { $ses = null; $tar = null; } } } } /* fine salvo */ $record = null; if ($id != 0) { $record = GetRows($id); $record = $record[0]; $record['dob'] = dateRenderer($record['dob'], get_text('DateFmt')); } else { $record = array('id' => 0, 'ioccode' => '', 'code' => '', 'status' => 0, 'session' => $ses !== null ? $ses : '', 'targetno' => $tar !== null ? $tar : '', 'firstname' => '', 'name' => '', 'sex_id' => 0, 'sex' => get_text('ShortMale', 'Tournament'), 'ctrl_code' => '', 'dob' => '', 'country_id' => 0, 'country_code' => '', 'country_name' => '', 'sub_team' => 0, 'country_id2' => 0, 'country_code2' => '', 'country_name2' => '', 'country_id3' => 0, 'country_code3' => '', 'country_name3' => '', 'division' => '--', 'class' => '--', 'ageclass' => '--', 'subclass' => '--', 'targetface' => 0, 'indcl' => 0, 'teamcl' => 0, 'indfin' => 0, 'teamfin' => 0, 'mixteamfin' => 0, 'wc' => 0, 'double' => 0); } $arrStatus = array(); foreach (array(1, 5, 6, 7, 8, 9) as $s) { $arrStatus[] = array('id' => $s, 'descr' => get_text('Status_' . $s)); } $comboStatus = ComboFromRs($arrStatus, 'id', 'descr', 1, null, array('0', ''), 'd_e_EnStatus_', 'd_e_EnStatus_'); $tmp = GetSessions('Q'); $sessions = array(); foreach ($tmp as $s) { $sessions[] = array('id' => $s->SesOrder, 'descr' => $s->Descr); } $comboSes = ComboFromRs($sessions, 'id', 'descr', 1, null, array('0', '--'), 'd_q_QuSession_', 'd_q_QuSession_', array('onblur' => 'SelectSession();')); $comboSex = ComboFromRs(array(array('id' => 0, 'descr' => get_text('ShortMale', 'Tournament')), array('id' => 1, 'descr' => get_text('ShortFemale', 'Tournament'))), 'id', 'descr', 1, 0, null, 'd_e_EnSex_', 'd_e_EnSex_', array('onchange' => 'CheckCtrlCode();'));
<tr> <td colspan="2"> </td> <td colspan="5"> <?php print $schedule->SchDescr; ?> : <?php print dateRenderer($schedule->SchDateStart); ?> (<?php print $schedule->SchOrder; ?> ) -> <?php print $schedule->SchDateEnd == '0000-00-00 00:00:00' ? '...' : dateRenderer($schedule->SchDateEnd); ?> </td> </tr> <tr class="divider"><td colspan="7"></td></tr> <?php } ?> <?php } ?> <?php } // fine butto fuori le sessioni ?> <?php
$pdf->SetLineStyle(array('width' => 0.5, 'color' => array(128))); $pdf->Line(10, $TopPos + RowH + $DistGap - 1, $pdf->getPageWidth() - 10, $TopPos + RowH + $DistGap - 1); $pdf->SetLineStyle(array('width' => 0.1, 'color' => array(0))); } $TopPos += RowH + $DistGap + 2; } $DistGap = 3; $pdf->SetTextColor(0); $pdf->SetXY(10, $TopPos - 1); $pdf->SetFont($pdf->FontStd, 'B', 14); $pdf->Cell(ColName, 3, isset($_REQUEST["HideTime"]) ? '' : $MyRow->SchTime, 0, 0, "C"); // data e ora $pdf->SetXY(10, $TopPos + ($MyRow->EvMatchArrowsNo == '--' ? 7 : 4)); $pdf->SetFont($pdf->FontStd, 'I', 8); //$pdf->Cell(ColName,5,date( get_text('DateFmt'), $MyRow->SchDate),0,0,"C"); $pdf->Cell(ColName, 5, dateRenderer($MyRow->FSScheduledDate, get_text('DateFmt')), 0, 0, "C"); if ($MyRow->EvMatchArrowsNo != '--') { // numero frecce $nARR = $MyRow->arrows . 'x' . $MyRow->ends; // Numero di frecce if ($MyRow->EvMaxTeamPerson > 1) { $nARR = "(" . $MyRow->EvMaxTeamPerson . 'x' . $MyRow->arrows / $MyRow->EvMaxTeamPerson . ")x" . $MyRow->ends; } $pdf->SetXY(10, $TopPos + 7); $pdf->SetFont($pdf->FontStd, 'I', 7); $pdf->Cell(ColName, 5, get_text('Arrows4End', 'Tournament', $nARR), 0, 0, "C"); } // arcieri per paglione $pdf->SetXY(10, $TopPos + 10.5); $pdf->SetTextColor(127); $pdf->Cell(ColName, 4, get_text('Ath4Target', 'Tournament'), 0, 0, "C", 0);
/** * trainingAndFinal() * Popola le righe che riguardano il warmup e le finali (se richieste) * * @return void */ protected function trainingAndFinal() { $queries = array(); /* * Se sono state richieste le righe di FinTraining e il filtro sul tipo di righe * è F oppure * allora le metto */ if (($this->opts['sessionType'] == '*' || $this->opts['sessionType'] == 'F') && $this->opts['training']) { $warmup = get_text('WarmUp', 'Tournament'); $caseTeam = "(CASE FteTeamEvent "; $caseTeam .= "WHEN 0 THEN '" . get_text('Individual') . "' "; $caseTeam .= "WHEN 1 THEN '" . get_text('Team') . "' "; $caseTeam .= "END) "; $queries[] = "\r\n\t\t\t\t(\r\n\t\t\t\t\tSELECT\r\n\t\t\t\t\t\t1 AS `schOrder`,CONCAT(FtScheduledDate,' ',FtScheduledTime) AS `dateStart`, ADDDATE(CONCAT(FtScheduledDate,' ',FtScheduledTime), INTERVAL FtScheduledLen MINUTE) AS `dateEnd`,\r\n\t\t\t\t\t\t'W' AS `sessionType`,\r\n\t\t\t\t\t\tCONCAT('{$warmup}',' ',CONCAT({$caseTeam},' ',group_concat(FteEvent separator '-'))) AS `descr`\r\n\t\t\t\t\tFROM\r\n\t\t\t\t\t\tFinTraining\r\n\t\t\t\t\t\tLEFT JOIN\r\n\t\t\t\t\t\t\tFinTrainingEvent\r\n\t\t\t\t\t\tON FteTournament=FtTournament and FteScheduledDate=FtScheduledDate and FteScheduledTime=FtScheduledTime and FteTargetFrom=FtTargetFrom\r\n\t\t\t\t\tWHERE\r\n\t\t\t\t\t\tFtTournament={$this->tourId} AND FtScheduledDate!='0000-00-00' \r\n\t\t\t\t\tGROUP BY \r\n\t\t\t\t\t\tFtTournament, FtScheduledDate, FtScheduledTime/*, FtTargetFrom*/ \r\n\t\t\t\t)\r\n\t\t\t\t/*ORDER BY \r\n\t\t\t\tFtScheduledDate ASC, FtScheduledTime ASC*/\r\n\t\t\t"; } /* * Se sono state richieste le righe di FinSchedule e il filtro sul tipo di righe * è F oppure * allora le metto */ if (($this->opts['sessionType'] == '*' || $this->opts['sessionType'] == 'F') && $this->opts['final']) { $phases = getPhasesId(-1); $casePhase = "(CASE GrPhase "; foreach ($phases as $p) { if (in_array($p, array(64, 32))) { $txt1 = get_text($p . '_Phase'); $txt2 = ''; if ($p == 64) { $txt2 = get_text('48_Phase'); } elseif ($p == 32) { $txt2 = get_text('24_Phase'); } if ($p == 64) { $casePhase .= " WHEN {$p} THEN IF( EvFinalFirstPhase=64,'{$txt1}','{$txt2}' ) "; } elseif ($p == 32) { $casePhase .= " WHEN {$p} THEN IF( EvFinalFirstPhase=32,'{$txt1}','{$txt2}' ) "; } } else { $txt = get_text($p . '_Phase'); $casePhase .= " WHEN {$p} THEN '{$txt}' "; } } $casePhase .= "END) "; //print '<br>'.$casePhase.'<br><br>'; $caseTeam = "(CASE FSTeamEvent "; $caseTeam .= "WHEN 0 THEN '" . get_text('Individual') . "' "; $caseTeam .= "WHEN 1 THEN '" . get_text('Team') . "' "; $caseTeam .= "END) "; $final = get_text('MenuLM_Final Rounds'); $queries[] = "\r\n\t\t\t\t(\r\n\t\t\t\t\tSELECT DISTINCT\r\n\t\t\t\t\t\t1 AS `schOrder`,CONCAT(FSScheduledDate,' ',FSScheduledTime) AS `dateStart`, ADDDATE(CONCAT(FSScheduledDate,' ',FSScheduledTime), INTERVAL FSScheduledLen MINUTE) AS `dateEnd`,\r\n\t\t\t\t\t\t'F' AS `sessionType`,\r\n\t\t\t\t\t\tCONCAT('{$final}',' ',group_concat(DISTINCT CONCAT({$caseTeam},' ',FSEvent,' (',{$casePhase},')' ) separator ' - ')) AS `descr`\r\n\t\t\t\t\tFROM\r\n\t\t\t\t\t\tFinSchedule\r\n\t\t\t\t\t\tINNER JOIN\r\n\t\t\t\t\t\t\tEvents\r\n\t\t\t\t\t\tON EvCode=FSEvent AND EvTeamEvent=FSTeamEvent AND EvTournament=FSTournament\r\n\t\t\t\t\t\tINNER JOIN\r\n\t\t\t\t\t\t\tGrids\r\n\t\t\t\t\t\tON FSMatchNo=GrMatchNo AND GrPhase<=(IF(EvFinalFirstPhase=24,32, IF(EvFinalFirstPhase=48,64,EvFinalFirstPhase )))\r\n\t\t\t\t\tWHERE\r\n\t\t\t\t\t\tFSTournament={$this->tourId} AND FSScheduledDate!='0000-00-00'\r\n\t\t\t\t\tGROUP BY\r\n\t\t\t\t\t\tschOrder,dateStart/*,FSMatchNo, GrPhase*/ \r\n\t\t\t\t)\r\n\t\t\t\t\r\n\t\t\t\t/*ORDER BY\r\n\t\t\t\t\tFSScheduledDate ASC, FSScheduledTime ASC*/\r\n\t\t\t"; } // se ho query parto se no termino if (count($queries) > 0) { $q = implode(' UNION ALL ', $queries) . " ORDER BY dateStart ASC "; //print $q;exit; $r = safe_r_sql($q); if ($r) { while ($row = safe_fetch_assoc($r)) { $row['timeLabel'] = dateRenderer($row['dateStart'], 'H:i'); if ($row['dateEnd'] != '0000-00-00 00:00:00' && $row['dateStart'] != $row['dateEnd']) { $row['timeLabel'] .= ' - ' . dateRenderer($row['dateEnd'], 'H:i'); } // cerco dove infilare la riga $day = substr($row['dateStart'], 0, 10); $found = false; // print '<pre>'; // print_r($this->data); // print '</pre>'; if (array_key_exists($day, $this->data['days'])) { foreach ($this->data['days'][$day]['items'] as &$v) { if ($v['sessionType'] == 'F') { if ($row['dateStart'] >= $v['dateStart'] && $row['dateStart'] < $v['dateEnd']) { $found = true; /* * ... e metto la riga nel giorno * Se il padre ha il Follow=0 * - la timeLabel è quella preparata prima * Se il padre ha il Follow=1 * - se il figlio precedente è di tipo diverso oppure non ci sono precedenti, * la timeLabel è quella preparata prima * - se il figlio precedente è dello stesso tipo * la timeLabel cambia */ if ($v['follow'] == 1) { if (count($v['children']) != 0 && $v['children'][count($v['children']) - 1]['sessionType'] == $row['sessionType']) { $row['timeLabel'] = get_text('ToFollow', 'Tournament'); } } $v['children'][] = $row; break; } } } } if (!$found && ($this->opts['trainingOrphans'] && $row['sessionType'] == 'W' || $this->opts['finalOrphans'] && $row['sessionType'] == 'F')) { //$day=substr($row['dateStart'],0,10); if (!array_key_exists($day, $this->data['days'])) { $this->data['days'][$day] = array('dateLabel' => dateRenderer($day, get_text('DateFmt')), 'items' => array()); } $this->data['days'][$day]['items'][] = $row; } $this->sortDayItems($day); } } } }
case '9': $img = 'status-noshoot.gif'; $title = get_text('Status_9'); break; } if ($r['status'] !== null) { echo '<img src="' . $CFG->ROOT_DIR . 'Common/Images/' . $img . '" title="' . $title . '"/>'; } echo '</td>'; echo '<td>' . $r['session'] . '</td>'; echo '<td>' . $r['targetno'] . '</td>'; echo '<td>' . $r['code'] . '</td>'; echo '<td onclick="insertInput(this,\'firstname\')">' . $r['firstname'] . '</td>'; echo '<td onclick="insertInput(this,\'name\')">' . $r['name'] . '</td>'; echo '<td onclick="insertInput(this,\'email\')">' . $r['email'] . '</td>'; echo '<td>' . dateRenderer($r['dob'], get_text('DateFmt')) . '</td>'; echo '<td>' . $r['sex'] . '</td>'; echo '<td>'; echo $r['country_code'] . ($r['country_id2'] != 0 ? ' <img src="' . $CFG->ROOT_DIR . 'Common/Images/info.gif" style="width:12px;height:12px;" title="' . get_text('Country') . ' (2): ' . $r['country_code2'] . ' - ' . $r['country_name2'] . '" />' : ''); echo $r['country_id3'] != 0 ? ' <img src="' . $CFG->ROOT_DIR . 'Common/Images/info.gif" style="width:12px;height:12px;" title="' . get_text('Country') . ' (3): ' . $r['country_code3'] . ' - ' . $r['country_name3'] . '" />' : ''; echo '</td>'; echo '<td>' . $r['country_name'] . '</td>'; echo '<td class="Center">' . ($r['wc'] ? 'x' : '') . '</td>'; echo '<td>' . $r['division'] . '</td>'; echo '<td>' . $r['ageclass'] . '</td>'; echo '<td>' . $r['class'] . '</td>'; echo '<td onclick="insertInput(this,\'subclass\')">' . $r['subclass'] . '</td>'; echo '<td>' . get_text($r['targetface_name'], 'Tournament', '', true) . '</td>'; echo '<td class="Center">' . ($r['id'] !== null ? '<img src="' . $CFG->ROOT_DIR . 'Common/Images/drop.png" onclick="deleteRow(' . $r['id'] . ',\'' . $OrderCrit . '\',\'' . $OrderDir . '\');"/>' : '') . '</td>'; echo '</tr>'; }