コード例 #1
0
ファイル: load_event_list.php プロジェクト: nchiapol/ecamp
 * eCamp is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * eCamp is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with eCamp.  If not, see <http://www.gnu.org/licenses/>.
 */
$event_list = array();
$event_date = new c_date();
$event_time = new c_time();
$query = "\tSELECT\n\t\t\t\t\tevent.id as event_id,\n\t\t\t\t\tevent.name,\n\t\t\t\t\tcategory.id as category_id,\n\t\t\t\t\tcategory.short_name,\n\t\t\t\t\tcategory.form_type,\n\t\t\t\t\tcategory.color,\n\t\t\t\t\tevent_instance.id,\n\t\t\t\t\tevent_instance.starttime,\n\t\t\t\t\tevent_instance.length,\n\t\t\t\t\t(subcamp.start + day.day_offset) as event_date,\n\t\t\t\t\tevent.progress,\n\t\t\t\t\tday.id as day_id,\n\t\t\t\t\t(day.day_offset + 1) as daynr,\n\t\t\t\t\t(\t\n\t\t\t\t\t\tSELECT\n\t\t\t\t\t\t\tcount(event_instance_down.id)\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\tevent_instance as event_instance_up,\n\t\t\t\t\t\t\tevent_instance as event_instance_down,\n\t\t\t\t\t\t\tevent,\n\t\t\t\t\t\t\tcategory\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\tevent_instance_up.id = event_instance.id AND\n\t\t\t\t\t\t\tevent_instance_up.day_id = event_instance_down.day_id AND\n\t\t\t\t\t\t\tevent_instance_down.event_id = event.id AND\n\t\t\t\t\t\t\tevent.category_id = category.id AND\n\t\t\t\t\t\t\tcategory.form_type > 0 AND\n\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\tevent_instance_down.starttime < event_instance_up.starttime OR\n\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\tevent_instance_down.starttime = event_instance_up.starttime AND\n\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\tevent_instance_down.dleft < event_instance_up.dleft OR\n\t\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t\tevent_instance_down.dleft = event_instance_up.dleft AND\n\t\t\t\t\t\t\t\t\t\t\tevent_instance_down.id <= event_instance_up.id\n\t\t\t\t\t\t\t)\t)\t)\t)\n\t\t\t\t\t) as eventnr\n\t\t\t\tFROM\n\t\t\t\t\tevent,\n\t\t\t\t\tevent_instance,\n\t\t\t\t\tcategory,\n\t\t\t\t\tday,\n\t\t\t\t\tsubcamp\n\t\t\t\tWHERE\n\t\t\t\t\tsubcamp.camp_id = {$_camp->id} AND\n\t\t\t\t\tday.id = {$day_id} AND\n\t\t\t\t\tday.subcamp_id = subcamp.id AND\n\t\t\t\t\tevent_instance.day_id = day.id AND\n\t\t\t\t\t\n\t\t\t\t\tevent.camp_id = {$_camp->id} AND\n\t\t\t\t\tevent.category_id = category.id AND\n\t\t\t\t\t\n\t\t\t\t\tevent.id = event_instance.event_id\n\t\t\t\tORDER BY\n\t\t\t\t\tevent_instance.starttime, eventnr";
$query = "\tSELECT\n\t\t\t\t\tevent.id as event_id,\n\t\t\t\t\tevent.name,\n\t\t\t\t\tcategory.id as category_id,\n\t\t\t\t\tcategory.short_name,\n\t\t\t\t\tcategory.form_type,\n\t\t\t\t\tcategory.color,\n\t\t\t\t\tevent_instance.id,\n\t\t\t\t\tevent_instance.starttime,\n\t\t\t\t\tevent_instance.length,\n\t\t\t\t\t(subcamp.start + day.day_offset) as event_date,\n\t\t\t\t\tevent.progress,\n\t\t\t\t\tday.id as day_id,\n\t\t\t\t\tv_event_nr.day_nr as daynr,\n\t\t\t\t\tv_event_nr.event_nr as eventnr\n\t\t\t\tFROM\n\t\t\t\t\tv_event_nr,\n\t\t\t\t\tevent,\n\t\t\t\t\tevent_instance,\n\t\t\t\t\tcategory,\n\t\t\t\t\tday,\n\t\t\t\t\tsubcamp\n\t\t\t\tWHERE\n\t\t\t\t\tv_event_nr.event_instance_id = event_instance.id AND\n\t\t\t\t\tsubcamp.camp_id = {$_camp->id} AND\n\t\t\t\t\tday.id = {$day_id} AND\n\t\t\t\t\tday.subcamp_id = subcamp.id AND\n\t\t\t\t\tevent_instance.day_id = day.id AND\n\t\t\t\t\t\n\t\t\t\t\tevent.camp_id = {$_camp->id} AND\n\t\t\t\t\tevent.category_id = category.id AND\n\t\t\t\t\t\n\t\t\t\t\tevent.id = event_instance.event_id\n\t\t\t\tORDER BY\n\t\t\t\t\tevent_instance.starttime, eventnr";
$result = mysql_query($query);
while ($event_instance = mysql_fetch_assoc($result)) {
    $event_instance['event_date_str'] = $event_date->setDay2000($event_instance['event_date'])->getString('d.m.Y');
    $event_instance['starttime_str'] = $event_time->setValue($event_instance['starttime'])->getString('H:i');
    $event_instance['endtime'] = $event_instance['starttime'] + $event_instance['length'];
    $event_instance['endtime_str'] = $event_time->setValue($event_instance['endtime'])->getString('H:i');
    if ($event_instance['length_str'] = $event_time->setValue($event_instance['length'])->getMin()) {
        $event_instance['length_str'] = $event_time->setValue($event_instance['length'])->getString('G\\h i\\m\\i\\n');
    } else {
        $event_instance['length_str'] = $event_time->setValue($event_instance['length'])->getString('G\\h');
    }
    if ($event_instance['short_name']) {
        $event_instance['short_name_str'] = $event_instance['short_name'] . ":";
コード例 #2
0
ファイル: main.php プロジェクト: nchiapol/ecamp
    while ($this_level1 = @mysql_fetch_assoc($result1)) {
        $query = "SELECT * FROM course_checklist WHERE pid=" . $this_level1[id] . " ORDER BY short_2";
        $result2 = mysql_query($query);
        $level2 = array();
        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]);
    }
}
コード例 #3
0
ファイル: build_day.php プロジェクト: nchiapol/ecamp
 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;
 }
コード例 #4
0
ファイル: load_dp_data.php プロジェクト: nchiapol/ecamp
$result = mysql_query($query);
$users = array();
$dp_header = array("users" => $users);
while ($row = mysql_fetch_assoc($result)) {
    if (!empty($row[scoutname])) {
        array_push($dp_header['users'], $row[scoutname]);
    } 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];
コード例 #5
0
ファイル: build_event.php プロジェクト: nchiapol/ecamp
 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;
 }
コード例 #6
0
ファイル: print_class.php プロジェクト: nchiapol/ecamp
 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]);
 }