| Zeile 1... |
Zeile 1... |
| 1 |
<?php
|
1 |
<?php
|
| 2 |
function generate_pagination2($base_url, $num_items, $per_page, $start_item, $add_prevnext_text = TRUE)
|
- |
|
| 3 |
{
|
- |
|
| 4 |
global $mode, $common;
|
- |
|
| 5 |
if (!$num_items)
|
- |
|
| 6 |
{
|
- |
|
| 7 |
return "";
|
- |
|
| 8 |
}
|
- |
|
| 9 |
|
- |
|
| 10 |
$total_pages = ceil($num_items/$per_page);
|
- |
|
| 11 |
|
- |
|
| 12 |
if ( $total_pages == 1 )
|
- |
|
| 13 |
{
|
- |
|
| 14 |
return '<table align="center" class="navig"><tr><th>'.$common["page"]." 1 ".$common["of"].' 1</th></tr></table><br><br>';
|
- |
|
| 15 |
}
|
- |
|
| 16 |
|
- |
|
| 17 |
$on_page = floor($start_item / $per_page) + 1;
|
- |
|
| 18 |
|
- |
|
| 19 |
$page_string = '<table align="center" class="navig"><tr><th colspan="5">'.$common["page"].' '.$on_page.' '.$common["of"].' '.$total_pages.'</th></tr><tr>';
|
- |
|
| 20 |
|
- |
|
| 21 |
if ( $add_prevnext_text )
|
- |
|
| 22 |
{
|
- |
|
| 23 |
if ( $on_page > 1 )
|
- |
|
| 24 |
{
|
- |
|
| 25 |
$page_string .= "<td><form name=\"nav\" action=$base_url method=\"post\"><input type=\"submit\" value=\"|<<\" title=\"${common["first_page"]}\" class=\"liteoption\"><input type=\"hidden\" name=\"start\" value=\"0\"><input type=\"hidden\" name=\"mode\" value=\"$mode\"></form></td>";
|
- |
|
| 26 |
$prev_v=($on_page - 2 ) * $per_page;
|
- |
|
| 27 |
$page_string .= "<td><form name=\"nav\" action=$base_url method=\"post\"><input type=\"submit\" value=\"|<\" title=\"${common["previous_page"]}\" class=\"liteoption\"><input type=\"hidden\" name=\"start\" value=\"$prev_v\"><input type=\"hidden\" name=\"mode\" value=\"$mode\"></form></td>";
|
- |
|
| 28 |
}
|
- |
|
| 29 |
else
|
- |
|
| 30 |
{
|
- |
|
| 31 |
$page_string .= "<td><form name=\"nav\" action=$base_url method=\"post\"><input type=\"submit\" value=\"|<<\" disabled class=\"liteoption\"><input type=\"hidden\" name=\"start\" value=\"0\"><input type=\"hidden\" name=\"mode\" value=\"$mode\"></form></td>";
|
- |
|
| 32 |
$page_string .= "<td><form name=\"nav\" action=$base_url method=\"post\"><input type=\"submit\" value=\"|<\" class=\"liteoption\" disabled><input type=\"hidden\" name=\"start\" value=\"0\"></form></td>";
|
- |
|
| 33 |
}
|
- |
|
| 34 |
}
|
- |
|
| 35 |
if($total_pages >1)
|
- |
|
| 36 |
{
|
- |
|
| 37 |
$page_opts="";
|
- |
|
| 38 |
for ($i=0;$i<$total_pages;$i++)
|
- |
|
| 39 |
{
|
- |
|
| 40 |
$selected="";
|
- |
|
| 41 |
$j=$i+1;
|
- |
|
| 42 |
if($j==$on_page)
|
- |
|
| 43 |
{
|
- |
|
| 44 |
$selected="selected=\"selected\"";
|
- |
|
| 45 |
}
|
- |
|
| 46 |
$start=($i*$per_page);
|
- |
|
| 47 |
$page_opts.="<option value=$start $selected>$j</option>";
|
- |
|
| 48 |
}
|
- |
|
| 49 |
$page_string.="<td width=\"100\"><form name=\"nav\" action=$base_url method=\"post\"><select name=\"start\">$page_opts</select> <input type=\"submit\" value=\"${common["go"]}\" class=\"liteoption\"><input type=\"hidden\" name=\"mode\" value=\"$mode\"></form></td>";
|
2 |
//Kalender generieren
|
| 50 |
}
|
- |
|
| 51 |
|
- |
|
| 52 |
if ( $add_prevnext_text )
|
- |
|
| 53 |
{
|
- |
|
| 54 |
if ( $on_page < $total_pages )
|
- |
|
| 55 |
{
|
- |
|
| 56 |
$next_v=($on_page * $per_page);
|
- |
|
| 57 |
$page_string .= "<td><form name=\"nav\" action=$base_url method=\"post\"><input type=\"submit\" value=\">|\" title=\"${common["next_page"]}\" class=\"liteoption\"><input type=\"hidden\" name=\"start\" value=\"$next_v\"><input type=\"hidden\" name=\"mode\" value=\"$mode\"></form></td>";
|
- |
|
| 58 |
$max_v=($total_pages -1)*$per_page;
|
- |
|
| 59 |
$page_string .= "<td><form name=\"nav\" action=$base_url method=\"post\"><input type=\"submit\" value=\">>|\" title=\"${common["last_page"]}\" class=\"liteoption\"><input type=\"hidden\" name=\"start\" value=\"$max_v\"><input type=\"hidden\" name=\"mode\" value=\"$mode\"></form></td>";
|
- |
|
| 60 |
}
|
- |
|
| 61 |
else
|
- |
|
| 62 |
{
|
- |
|
| 63 |
$page_string .= "<td><form name=\"nav\" action=$base_url method=\"post\"><input type=\"submit\" value=\">|\" class=\"liteoption\" disabled><input type=\"hidden\" name=\"start\" value=\"0\"><input type=\"hidden\" name=\"mode\" value=\"$mode\"></form></td>";
|
- |
|
| 64 |
$page_string .= "<td><form name=\"nav\" action=$base_url method=\"post\"><input type=\"submit\" value=\">>|\" disabled class=\"liteoption\" disabled><input type=\"hidden\" name=\"start\" value=\"0\"><input type=\"hidden\" name=\"mode\" value=\"$mode\"></form></td>";
|
- |
|
| 65 |
}
|
- |
|
| 66 |
|
- |
|
| 67 |
}
|
- |
|
| 68 |
$page_string.="</tr></table><br><br>";
|
- |
|
| 69 |
|
- |
|
| 70 |
return $page_string;
|
- |
|
| 71 |
}
|
- |
|
| 72 |
|
- |
|
| 73 |
function calendar($an_id, $f_id, $y=0, $m=0)
|
3 |
function calendar($an_id, $f_id, $y=0, $m=0)
|
| 74 |
{
|
4 |
{
|
| 75 |
if ($y===0)
|
5 |
if ($y===0)
|
| 76 |
{
|
6 |
{
|
| 77 |
$y=date("Y");
|
7 |
$y=date("Y");
|