Ejemplo n.º 1
0
 * 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'] . ":";
    } else {
        $event_instance['short_name_str'] = "";
    }
    $event_instance['color_str'] = "background-color: #" . $event_instance['color'];
    if ($event_instance['form_type']) {
        $event_instance['progress'] .= "%";
Ejemplo n.º 2
0
        $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]);
    }
}
// PHPTAL Variablen setzen
Ejemplo n.º 3
0
 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;
 }
Ejemplo n.º 4
0
 $result2 = mysql_query($query);
 $aim_str = "";
 while ($this_aim = mysql_fetch_assoc($result2)) {
     $aim_str = $aim_str . "- " . $this_aim[aim] . "\n";
 }
 ///////////////////////
 // format output
 ///////////////////////
 // name
 $worksheet->write($row, 0, $this_event[name] . " " . $checklist_str, $format_content);
 //echo $this_event[name]." ".$checklist_str."   ";
 // date
 $start = new c_time();
 $start->setValue($this_event[start]);
 $end = new c_time();
 $end->setValue($this_event[end]);
 $date = new c_date();
 $date->setDay2000($this_event[day]);
 $this_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";
 $worksheet->write($row, 1, $this_date, $format_content);
 //echo $this_date."   ";
 // aim
 $worksheet->write($row, 2, $aim_str, $format_content);
 //echo $aim_str."   ";
 // event-aim
 $worksheet->write($row, 3, $this_event[aim], $format_content);
 //echo $this_event[aim]."   ";
 // topics
 $worksheet->write($row, 4, $this_event[topics], $format_content);
 //echo $this_event[topics]."   ";
Ejemplo n.º 5
0
        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];
}
$_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);
Ejemplo n.º 6
0
 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]);
 }