while ($this_level2 = @mysql_fetch_assoc($result2)) { // Events suchen, die die Checkliste erfüllen $events = array(); $query = "SELECT \r\n\t\t\t\t\t\t\t i.id\r\n\t\t\t\t\t\t\tFROM\r\n\t\t\t\t\t\t\t event_checklist ch,\r\n\t\t\t\t\t\t\t event e,\r\n\t\t\t\t\t\t\t event_instance i\r\n\t\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\t ch.checklist_id = {$this_level2['id']}\r\n\t\t\t\t\t\t\tAND e.camp_id={$_camp->id}\r\n\t\t\t\t\t\t\tAND e.id = ch.event_id\r\n\t\t\t\t\t\t\tAND i.event_id = e.id\r\n\t\t\t\t\t\t\tORDER BY i.day_id, i.starttime"; $result3 = mysql_query($query); $no_events = true; while ($this_level3_instance = @mysql_fetch_assoc($result3)) { $this_level3 = $campevents[$this_level3_instance["id"]]; $no_events = false; $start = new c_time(); $start->setValue($this_level3[start]); $end = new c_time(); $end->setValue($this_level3[end]); $date = new c_date(); $date->setDay2000($this_level3[day]); $this_level3[date] = $GLOBALS[en_to_de][$date->getString("D")] . ", " . $date->getString("j.n.") . " " . $start->getString("G:i") . "-" . $end->getString("G:i"); //"Fr, 5.10. 17:15-18:00"; if ($this_level3['short_name']) { $this_level3['short_name'] .= ": "; } $events[] = $this_level3; } $level2[] = array("short" => $this_level2[short], "name" => $this_level2[name], "no_events" => $no_events, "events" => $events); } $list[$i][] = array("level2" => $level2, "short" => $this_level1[short], "name" => $this_level1[name]); } } // PHPTAL Variablen setzen $_page->html->set("pbs_list", $list[0]); $_page->html->set("js_list", $list[1]); /* Wechsel zu neuen Checklisten zulassen */
function event_list($pdf, $day) { // Tabellenkopf: // =============== $pdf->SetFont('', 'B', 8); $pdf->SetXY(12, $this->y); $pdf->drawTextBox('Zeit:', 38, 4, 'L', 'T', 0); $pdf->SetXY(52, $this->y); $pdf->drawTextBox('Blockbezeichnung:', 68, 4, 'L', 'T', 0); $pdf->SetXY(132, $this->y); $pdf->drawTextBox('Verantwortliche/r', 68, 4, 'L', 'T', 0); $this->y += 4; $pdf->Line(10, $this->y, 190, $this->y); $this->y += 2; // Tablleninhalt: // ================ $s_time = new c_time(); $e_time = new c_time(); $day->gen_event_nr(); foreach ($day->get_sorted_event_instance() as $event_instance) { if ($event_instance->event->category->form_type) { $pdf->SetFont('', 'B', 8); } else { $pdf->SetFont('', '', 8); } $s_time->setValue($event_instance->starttime); $e_time->setValue($event_instance->starttime + $event_instance->length); $time = $s_time->getString('H:i') . " - " . $e_time->getString('H:i'); $name = ""; if ($event_instance->event->category->form_type) { $name .= "(" . $day->day_nr . "." . $event_instance->event_nr . ") "; } if ($event_instance->event->category->short_name != "") { $name .= $event_instance->event->category->short_name . ": "; } $name .= $event_instance->event->name; $resp = ""; foreach ($event_instance->event->event_responsible as $event_responsible) { $resp .= $event_responsible->scoutname . ", "; } $resp = substr($resp, 0, -2); $pdf->SetXY(12, $this->y); $pdf->Cell(38, 4, $time, 0, 0, 'L', 0, $event_instance->get_linker($pdf)); //$pdf->drawTextBox( $time, 38, 4, 'L', 'T', 0 ); $pdf->SetXY(52, $this->y); $pdf->Cell(68, 4, $name, 0, 0, 'L', 0, $event_instance->get_linker($pdf)); //$pdf->drawTextBox( $name, 68, 4, 'L', 'T', 0 ); $pdf->SetXY(132, $this->y); $pdf->Cell(68, 4, $resp, 0, 0, 'L', 0, $event_instance->get_linker($pdf)); //$pdf->drawTextBox( $resp, 68, 4, 'L', 'T', 0 ); $this->y += 4; } $this->y += 10; }
} else { array_push($dp_header['users'], $row[firstname] . " " . $row[surname]); } } $dp_header['place'] = array("value" => $event_place, "event_id" => $event_id, "script" => "action_change_place"); $query = "\tSELECT\n\t\t\t\t\tevent_instance.starttime,\n\t\t\t\t\tevent_instance.length,\n\t\t\t\t\tday.day_offset + subcamp.start as startdate\n\t\t\t\tFROM\n\t\t\t\t\tevent_instance,\n\t\t\t\t\tday,\n\t\t\t\t\tsubcamp\n\t\t\t\tWHERE\n\t\t\t\t\tevent_instance.event_id = {$event_id} AND\n\t\t\t\t\tevent_instance.day_id = day.id AND\n\t\t\t\t\tday.subcamp_id = subcamp.id"; $result = mysql_query($query); $date = new c_date(); $start = new c_time(); $end = new c_time(); $dp_header['event_instance'] = array(); while ($row = mysql_fetch_assoc($result)) { $date->setDay2000($row['startdate']); $start->setValue($row['starttime']); $end->setValue($row['starttime'] + $row['length']); $dp_header['event_instance'][] = array('startdate' => date("d.m.Y", $date->getUnix()), 'starttime' => $start->getString("H:i") . " - " . $end->getString("H:i")); } $_page->html->set('dp_header', $dp_header); // HEAD: // ======= $dp_head_show = array(); $query = "\tSELECT\n\t\t\t\t\tdropdown.value as form,\n\t\t\t\t\t(dropdown.value = category.form_type) as show_form\n\t\t\t\tFROM\n\t\t\t\t\tevent,\n\t\t\t\t\tcategory,\n\t\t\t\t\tdropdown\n\t\t\t\tWHERE\n\t\t\t\t\tevent.id = {$event_id} AND\n\t\t\t\t\tevent.category_id = category.id AND\n\t\t\t\t\tdropdown.list = 'form'"; $result = mysql_query($query); while ($row = mysql_fetch_assoc($result)) { $dp_head_show[$row[form]] = $row[show_form]; } $_page->html->set('dp_head_show', $dp_head_show); $query = "\tSELECT\n\t\t\t\t\tevent.aim as aim,\n\t\t\t\t\tevent.story as story,\n\t\t\t\t\tevent.method as method,\n\t\t\t\t\t'true' as visible\n\t\t\t\tFROM\n\t\t\t\t\tevent\n\t\t\t\tWHERE\n\t\t\t\t\tevent.id = {$event_id}"; $result = mysql_query($query); $replace = mysql_fetch_assoc($result); $dp_head = array();
function title($pdf, $event_instance) { $pdf->SetLink($event_instance->get_linker($pdf), $this->y); $color = $this->color($event_instance->event->category->color); $pdf->SetLineWidth(0.5); $pdf->SetFillColor($color['r'], $color['g'], $color['b']); $pdf->RoundedRect(10, $this->y, 190, 17, 5, '1001', 'DF'); $pdf->SetLineWidth(0.2); $pdf->SetXY(15, $this->y + 1); $pdf->SetFont('', 'B', 30); $name = "(" . $event_instance->day->day_nr . "." . $event_instance->event_nr . ") "; $name .= $event_instance->event->category->short_name . ": "; $name .= $event_instance->event->name; $name_width = $pdf->GetStringWidth($name); if ($name_width > 120) { $name_font_size = max(15, 30 * 120 / $name_width); $pdf->SetFont('', 'B', $name_font_size); //$name_dy = ( 30 - $name_font_size ) / 4; //$pdf->SetXY( 15, $this->y + $name_dy ); } $pdf->MultiCell(130, 30, $name, '', 'L'); $pdf->SetFont('', 'B', 10); $date = new c_date(); $date->SetDay2000($event_instance->day->subcamp->start + $event_instance->day->day_nr - 1); $time = new c_time(); $time->SetValue($event_instance->starttime); $pdf->SetXY(155, $this->y + 1); $pdf->drawTextBox('Datum:', 15, 5, 'L', 'M', 0); $pdf->SetXY(170, $this->y + 1); $pdf->drawTextBox(strtr($date->getString('D d.m.Y'), $GLOBALS[en_to_de]), 30, 5, 'L', 'M', 0); $pdf->Link(170, $this->y + 1, 30, 5, $event_instance->day->get_linker($pdf)); $pdf->SetXY(155, $this->y + 6); $pdf->drawTextBox('Zeit:', 15, 5, 'L', 'M', 0); $pdf->SetXY(170, $this->y + 6); $pdf->drawTextBox($time->getString('H:i') . " Uhr", 30, 5, 'L', 'M', 0); $pdf->SetXY(155, $this->y + 11); $pdf->drawTextBox('Ort:', 15, 5, 'L', 'M', 0); $pdf->SetXY(170, $this->y + 11); $pdf->drawTextBox($event_instance->event->place, 30, 5, 'L', 'M', 0); $pdf->Bookmark($name, 2, $this->y); //$this->y += 22; $this->y += 17; }
} $dp_header['place'] = array("value" => $event_place, "event_id" => $event_id, "script" => "action_change_place"); $query = "\tSELECT\r\n\t\t\t\t\tevent_instance.starttime,\r\n\t\t\t\t\tevent_instance.length,\r\n\t\t\t\t\tday.day_offset + subcamp.start as startdate,\r\n\t\t\t\t\t(\tSELECT\r\n\t\t\t\t\t\t\tcount(event_instance_down.id)\r\n\t\t\t\t\t\tFROM\r\n\t\t\t\t\t\t\tevent_instance as event_instance_up,\r\n\t\t\t\t\t\t\tevent_instance as event_instance_down,\r\n\t\t\t\t\t\t\tevent,\r\n\t\t\t\t\t\t\tcategory\r\n\t\t\t\t\t\tWHERE\r\n\t\t\t\t\t\t\tevent_instance_up.id = event_instance.id AND\r\n\t\t\t\t\t\t\tevent_instance_up.day_id = event_instance_down.day_id AND\r\n\t\t\t\t\t\t\tevent_instance_down.event_id = event.id AND\r\n\t\t\t\t\t\t\tevent.category_id = category.id AND\r\n\t\t\t\t\t\t\tcategory.form_type > 0 AND\r\n\t\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\tevent_instance_down.starttime < event_instance_up.starttime OR\r\n\t\t\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\t\tevent_instance_down.starttime = event_instance_up.starttime AND\r\n\t\t\t\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\t\t\tevent_instance_down.dleft < event_instance_up.dleft OR\r\n\t\t\t\t\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\t\t\t\tevent_instance_down.dleft = event_instance_up.dleft AND\r\n\t\t\t\t\t\t\t\t\t\t\tevent_instance_down.id <= event_instance_up.id\r\n\t\t\t\t\t\t\t)\t)\t)\t)\r\n\t\t\t\t\t) as event_nr,\r\n\t\t\t\t\tday.day_offset + 1 as day_nr\r\n\t\t\t\tFROM\r\n\t\t\t\t\tevent_instance,\r\n\t\t\t\t\tday,\r\n\t\t\t\t\tsubcamp\r\n\t\t\t\tWHERE\r\n\t\t\t\t\tevent_instance.event_id = {$event_id} AND\r\n\t\t\t\t\tevent_instance.day_id = day.id AND\r\n\t\t\t\t\tday.subcamp_id = subcamp.id\r\n\t\t\t\tORDER BY\r\n\t\t\t\t\tstartdate, event_nr"; $query = "\tSELECT\r\n\t\t\t\t\tevent_instance.starttime,\r\n\t\t\t\t\tevent_instance.length,\r\n\t\t\t\t\tday.day_offset + subcamp.start as startdate,\r\n\t\t\t\t\tv_event_nr.event_nr,\r\n\t\t\t\t\tv_event_nr.day_nr\r\n\t\t\t\tFROM\r\n\t\t\t\t\tv_event_nr,\r\n\t\t\t\t\tevent_instance,\r\n\t\t\t\t\tday,\r\n\t\t\t\t\tsubcamp\r\n\t\t\t\tWHERE\r\n\t\t\t\t\tv_event_nr.event_instance_id = event_instance.id AND\r\n\t\t\t\t\tevent_instance.event_id = {$event_id} AND\r\n\t\t\t\t\tevent_instance.day_id = day.id AND\r\n\t\t\t\t\tday.subcamp_id = subcamp.id\r\n\t\t\t\tORDER BY\r\n\t\t\t\t\tstartdate, event_nr"; $result = mysql_query($query); $date = new c_date(); $start = new c_time(); $end = new c_time(); $dp_header['event_instance'] = array(); $row = mysql_fetch_assoc($result); $_page->html->set('event_nr', "(" . $row['day_nr'] . "." . $row['event_nr'] . ")"); do { $date->setDay2000($row['startdate']); $start->setValue($row['starttime']); $end->setValue($row['starttime'] + $row['length']); $dp_header['event_instance'][] = array('event_nr' => "(" . $row['day_nr'] . "." . $row['event_nr'] . ")", 'startdate' => date("d.m.Y", $date->getUnix()), 'starttime' => $start->getString("H:i") . " - " . $end->getString("H:i")); } while ($row = mysql_fetch_assoc($result)); $_page->html->set('dp_header', $dp_header); //echo "dp_header=>"; //print_r( $dp_header ); // HEAD: // ======= $dp_head_show = array(); $query = "\tSELECT\r\n\t\t\t\t\tdropdown.value as form,\r\n\t\t\t\t\t(dropdown.value = category.form_type) as show_form\r\n\t\t\t\tFROM\r\n\t\t\t\t\tevent,\r\n\t\t\t\t\tcategory,\r\n\t\t\t\t\tdropdown\r\n\t\t\t\tWHERE\r\n\t\t\t\t\tevent.id = {$event_id} AND\r\n\t\t\t\t\tevent.category_id = category.id AND\r\n\t\t\t\t\tdropdown.list = 'form'"; $result = mysql_query($query); while ($row = mysql_fetch_assoc($result)) { $dp_head_show[$row[form]] = $row[show_form]; } $_page->html->set('dp_head_show', $dp_head_show); $query = "\tSELECT\r\n\t\t\t\t\tevent.aim as aim,\r\n\t\t\t\t\tevent.story as story,\r\n\t\t\t\t\tevent.method as method,\r\n\t\t\t\t\tevent.topics as topics,\r\n\t\t\t\t\t'true' as visible\r\n\t\t\t\tFROM\r\n\t\t\t\t\tevent\r\n\t\t\t\tWHERE\r\n\t\t\t\t\tevent.id = {$event_id}"; $result = mysql_query($query);
function EventInstance($event_instance_id) { $Data = EventInstanceData($event_instance_id); // Reicht der Platz aus, um den Block zu drucken... $y = $this->GetY(); $head = $Data[head]; $this->pdf->SetFillColor(hexdec(substr($head[color], 0, 2)), hexdec(substr($head[color], 2, 2)), hexdec(substr($head[color], 4, 2))); $this->pdf->RoundedRect(10, $y, 190, 18, $this->R, 'DF', '1234'); $display = "(" . $head[day_nr] . "." . $head[event_nr] . ") " . $head[short_name] . ": " . $head[name]; $this->pdf->setFontSize(20); $this->pdf->SetFontStyle('B'); $this->SetXY(15, $y); $this->pdf->Cell(120, 18, $display, 0, 1, 'L', 0); $this->pdf->setFontSize(10); $this->pdf->SetFontStyle('B'); $this->SetXY(140, $y + 1); $this->pdf->Write(5, "Datum:"); $this->SetXY(140, $y + 6.5); $this->pdf->Write(5, "Zeit:"); $this->SetXY(140, $y + 12); $this->pdf->Write(5, "Ort:"); $start_date = new c_date(); $start_date->setDay2000($head[start]); $this->SetXY(160, $y + 1); $this->pdf->Write(5, strtr($start_date->getString("D d.m.Y"), $GLOBALS[en_to_de])); $start_time = new c_time(); $start_time->setValue($head[starttime]); $end_time = new c_time(); $end_time->setValue($head[starttime] + $head[length]); $this->SetXY(160, $y + 6.5); $this->pdf->Write(5, $start_time->getString("H:i") . " - " . $end_time->getString("H:i")); $this->SetXY(160, $y + 12); $this->pdf->Write(5, $head[place]); $this->SetXY(10, $y + 18); $this->Space(4); $this->LabeldTable(190, $Data[info]); $this->Space(4); $this->LabeldCols(190, $Data[detail]); }