Namespaces | Functions

calendar/includes/inc.list.php File Reference

Go to the source code of this file.

Namespaces

namespace  dateplaner
 

Database Class.


Functions

 setNavigation ($fromtime_ts, $totime_ts)
 void function setNavigation($fromtime_ts, $totime_ts) stet variables in the setNavigation of list
 getContent ($start_ts, $end_ts, $DB)
 function getContent($start_ts, $end_ts) get Content for the Week View from the sortdates functions
 printDateList ($fromtime_ts, $totime_ts, $DB)
 function print_viewDate_list() the second Main function of the list view , to print out the List result
 parseData ($fromtime_ts, $totime_ts, $Start_date, $End_date)
 void function parseData () parse the from / to date strings and retuns messages if they are not valid
 setDateList ($fromtime_ts, $totime_ts, $DB)
 void function setDateList() the first Main function of the list view , to list out the result

Function Documentation

getContent ( start_ts,
end_ts,
DB 
)

function getContent($start_ts, $end_ts) get Content for the Week View from the sortdates functions

Parameters:
int $start_ts
int $end_ts string $DP_UId ( actual User ID ) array $_SESSION --> Array DP_Keywords ( current Keywords)
Returns:
Array[][][] $DATE [0] Dates ( normel Dates ) [1] WholeDates ( one day Dates )

Definition at line 93 of file inc.list.php.

{
        global  $_SESSION, $DP_UId;
        $Dates                          = getDateList ($DP_UId, $start_ts, $end_ts, $_SESSION[DP_Keywords], $DB);
        $WholeDates                     = getWholeDayDateList ($DP_UId, $start_ts, $end_ts, $_SESSION[DP_Keywords], $DB);

        $DATE[0]=$Dates;
        $DATE[1]=$WholeDates;
        return $DATE;
} // end func

parseData ( fromtime_ts,
totime_ts,
Start_date,
End_date 
)

void function parseData () parse the from / to date strings and retuns messages if they are not valid

Parameters:
int $fromtime_ts
int $totime_ts
array $Start_date
array $End_date Array $DP_language ( include Languageproperties )
Returns:
array $Valid

Definition at line 240 of file inc.list.php.

                                                                        {
        global  $DP_language;

        if($fromtime_ts == "-1")                        $Valid[] = $DP_language[ERROR_STARTDATE];
        if($totime_ts == "-1")                          $Valid[] = $DP_language[ERROR_ENDDATE];
        if($fromtime_ts > $totime_ts)           $Valid[] = $DP_language[ERROR_END_START]; 

        if(     $Start_date[0] != date ("d", mktime(0,0,0,$Start_date[1],$Start_date[0],$Start_date[2])) or
                $Start_date[1] != date ("m", mktime(0,0,0,$Start_date[1],$Start_date[0],$Start_date[2])) or 
                $Start_date[2] != date ("Y", mktime(0,0,0,$Start_date[1],$Start_date[0],$Start_date[2]))) 
        {
                 $Valid[] = $DP_language[ERROR_STARTDATE];
        }
        if(     $End_date and ($End_date[0] != date ("d", mktime(0,0,0,$End_date[1],$End_date[0],$End_date[2])) or
                $End_date[1] != date ("m", mktime(0,0,0,$End_date[1],$End_date[0],$End_date[2])) or 
                $End_date[2] != date ("Y", mktime(0,0,0,$End_date[1],$End_date[0],$End_date[2])))) 
        {
                 $Valid[] = $DP_language[ERROR_ENDDATE];
        }

        $Valid[] = "TRUE";
        Return $Valid;

}// end func

printDateList ( fromtime_ts,
totime_ts,
DB 
)

function print_viewDate_list() the second Main function of the list view , to print out the List result

Parameters:
int $fromtime_ts
int $totime_ts array $DP_language ( include Languageproperties ) array $DP_CSS ( contains CSS Strings from the conf.gui file )
Returns:
string $list_print_float ( contains the output )

Definition at line 113 of file inc.list.php.

{
        global $DP_language, $DP_CSS ;


        $ttd                            = new TimestampToDate;
        $list_print_float       = "";
        

        if ($totime_ts == False) {
                $totime_ts = mktime(23,59,59);  
        }

        if($fromtime_ts == $totime_ts) 
        {
                $ttd->ttd($fromtime_ts);
                $totime_ts = mktime(23,59,59,$ttd->monthnumber,$ttd->day_of_month,$ttd->year_long); 
        }

        $DATE                           = getContent($fromtime_ts, $totime_ts, $DB);
        $Dates                          = $DATE[0];
        $WholeDates                     = $DATE[1];
        
        // 1st - one day dates , cause more important 
        $list_print_float = $list_print_float."
  <tr>
    <td width=\"100%\" colspan=\"4\" $DP_CSS[tblrow1] >".$DP_language[extra_dates]."</td>
  </tr>
        ";
        if ($WholeDates == False) 
        {
                $list_print_float = $list_print_float."
  <tr>
    <td width=\"100%\" colspan=\"4\" >".$DP_language[no_entry]."</td>
  </tr>
                ";
        }
        else 
        {
                for ($i=0;$i<count($WholeDates);$i++) 
                {
                        $list_print_float = $list_print_float."
                <tr>
                        <td width=\"10%\">
                        ";
                        $ttd->ttd($WholeDates[$i][1]);
                        $list_print_float = $list_print_float.$ttd->day_of_month.".".$ttd->monthname;
                        $list_print_float = $list_print_float."
                        </td><td width=\"10%\">
                        ";
                        $ttd->ttd($WholeDates[$i][2]);
                        $list_print_float = $list_print_float.$ttd->day_of_month.".".$ttd->monthname;
                        $list_print_float = $list_print_float."
                        </td><td width=\"10%\">
                        ";

                        $list_print_float = $list_print_float.$WholeDates[$i][5];
                        $list_print_float = $list_print_float."
                        </td><td width=\"10%\">
                        ";
                        $list_print_float = $list_print_float.$WholeDates[$i][6];
                        $list_print_float = $list_print_float."
                        </td>
                </tr>
                        ";
                }
        }
        // end onde day dates

        // 2nd - normal dates  
        $list_print_float = $list_print_float."
  <tr>
    <td width=\"100%\" colspan=\"4\" $DP_CSS[tblrow1] >".$DP_language[main_dates]."</td>
  </tr>
        ";

        if ($Dates == False) 
        {
                $list_print_float = $list_print_float."
  <tr>
    <td width=\"100%\" colspan=\"4\" >".$DP_language[no_entry]."</td>
  </tr>
                ";
        }
        else 
        {
                for ($i=0;$i<count($Dates);$i++) 
                {
                        $list_print_float = $list_print_float."
                <tr>
                        <td width=\"10%\">
                        ";
                        $ttd->ttd($Dates[$i][1]);
                        $list_print_float = $list_print_float.$ttd->day_of_month.".".$ttd->monthname." - ".$ttd->hour_long.":".$ttd->minutes ;
                        $list_print_float = $list_print_float."
                        </td><td width=\"10%\">
                        ";
                        $ttd->ttd($Dates[$i][2]);
                        $list_print_float = $list_print_float.$ttd->day_of_month.".".$ttd->monthname." - ".$ttd->hour_long.":".$ttd->minutes ;
                        $list_print_float = $list_print_float."
                        </td><td width=\"10%\">
                        ";
                        $list_print_float = $list_print_float.$Dates[$i][5];
                        $list_print_float = $list_print_float."
                        </td><td width=\"10%\">
                        ";
                        $list_print_float = $list_print_float.$Dates[$i][6];
                        $list_print_float = $list_print_float."
                        </td>
                </tr>
                        ";
                }
        }

        return $list_print_float;
} // end func

setDateList ( fromtime_ts,
totime_ts,
DB 
)

void function setDateList() the first Main function of the list view , to list out the result

Parameters:
int $fromtime_ts
int $totime_ts Array $DP_language ( include Languageproperties ) array $DP_CSS ( contains CSS Strings from the conf.gui file )
Returns:
Array $Return [0] $list_navigation ( contains the navigation output ) [1] $list_float ( contains the output )

Definition at line 277 of file inc.list.php.

{
        global   $DP_language, $DP_CSS;
        $ttd                            = new TimestampToDate;
        
        $list_navigation = setNavigation($fromtime_ts, $totime_ts);

        if($fromtime_ts == $totime_ts) 
        {
                $ttd->ttd($fromtime_ts);
                $totime_ts = mktime(23,59,59,$ttd->monthnumber,$ttd->day_of_month,$ttd->year_long); 
        }

        $list_float = "";
        $DATE = getContent($fromtime_ts, $totime_ts, $DB);
        $Dates          = $DATE[0];
        $WholeDates     = $DATE[1];

        // 1st - one day dates , cause more important 
        $list_float = $list_float."
  <tr ".$DP_CSS[tblrow1].">
    <td width=\"100%\" colspan=\"4\"  >".$DP_language[extra_dates]."</td>
  </tr>
        ";
        if ($WholeDates == False) 
        {
                $list_float = $list_float."
  <tr>
    <td width=\"100%\" colspan=\"4\" ".$DP_CSS[tblrow2]." >".$DP_language[no_entry]."</td>
  </tr>
                ";
        }
        else 
        {
                if (!$pointer) 
                {
                        $pointer =0;
                }
                for ($i=0;$i<count($WholeDates);$i++) 
                {
                        $list_float = $list_float."
                <tr ".$DP_CSS[tblrow2]." >
                        <td width=\"10%\" >
                        ";
                        $ttd->ttd($WholeDates[$i][1]);
                        $list_float = $list_float.$ttd->day_of_month.".".$ttd->monthname ;
                        $list_float = $list_float."
                        </td><td width=\"10%\">
                        ";
                        $ttd->ttd($WholeDates[$i][2]);
                        $list_float = $list_float.$ttd->day_of_month.".".$ttd->monthname ;
                        $list_float = $list_float."
                        </td><td width=\"10%\">
                        ";
                        $list_float = $list_float.$WholeDates[$i][5];
                        $list_float = $list_float."
                        </td><td width=\"10%\">
                        ";
                        $list_float = $list_float.$WholeDates[$i][6];
                        $list_float = $list_float."
                        </td>
                </tr>
                        ";
                        $pointer++;
                }
        }

        // end onde day dates

        // 2nd - normal dates  
        $list_float = $list_float."
  <tr>
    <td width=\"100%\" colspan=\"4\" $DP_CSS[tblrow1] >".$DP_language[main_dates]."</td>
  </tr>
        ";

        if ($Dates == False) 
        {
                $list_float = $list_float."
  <tr ".$DP_CSS[tblrow2]." >
    <td width=\"100%\" colspan=\"4\" >".$DP_language[no_entry]."</td>
  </tr>
                ";
        }
        else 
        {
                if (!$pointer) 
                {
                        $pointer =0;
                }

                for ($i=0;$i<count($Dates);$i++) 
                {

                        $list_float = $list_float."
                <tr ".$DP_CSS[tblrow2].">
                        <td width=\"10%\">
                        ";
                        $ttd->ttd($Dates[$i][1]);
                        $list_float = $list_float.$ttd->day_of_month.".".$ttd->monthname." - ".$ttd->hour_long.":".$ttd->minutes ;
                        $list_float = $list_float."
                        </td><td width=\"10%\">
                        ";
                        $ttd->ttd($Dates[$i][2]);
                        $list_float = $list_float.$ttd->day_of_month.".".$ttd->monthname." - ".$ttd->hour_long.":".$ttd->minutes ;
                        $list_float = $list_float."
                        </td><td width=\"10%\">
                        ";
                        $list_float = $list_float.$Dates[$i][5];
                        $list_float = $list_float."
                        </td><td width=\"10%\">
                        ";
                        $list_float = $list_float.$Dates[$i][6];
                        $list_float = $list_float."
                        </td>
                </tr>
                        ";
                        $pointer++;

                }
        }
        
        $Return[0] = $list_navigation;
        $Return[1] = $list_float;
        Return $Return;
} // end func

setNavigation ( fromtime_ts,
totime_ts 
)

void function setNavigation($fromtime_ts, $totime_ts) stet variables in the setNavigation of list

Parameters:
int $fromtime_ts
int $totime_ts string $actualtemplate ( name of actual skin ) string $templatefolder ( name of template folder ) Array $DP_language ( include Languageproperties )
Returns:
string $list_navigation ( contains the output for the setNavigation )

Definition at line 49 of file inc.list.php.

References $actualtemplate, $DP_language, $Gui, and $templatefolder.

Referenced by setMonthView(), and setWeekView().

        {
                global $templatefolder, $actualtemplate , $DP_language;
                $Gui            = new Gui();
                $ttd            = new TimestampToDate;
                $ttd->ttd($fromtime_ts);
                $date2          = $ttd->day_of_month."/".$ttd->monthnumber_long."/".$ttd->year_long ;
                $ttd->ttd($totime_ts);
                $date4          = $ttd->day_of_month."/".$ttd->monthnumber_long."/".$ttd->year_long ;
                $popupcall_1 = '
<script language=JavaScript>
                        var cal2 = new CalendarPopup();  
                        cal2.showYearNavigation(); cal2.setMonthNames(\''.$DP_language[long_01].'\',\''.$DP_language[long_02].'\',\''.$DP_language[long_03].'\',\''.$DP_language[long_04].'\',\''.$DP_language[long_05].'\',\''.$DP_language[long_06].'\',\''.$DP_language[long_07].'\',\''.$DP_language[long_08].'\',\''.$DP_language[long_09].'\',\''.$DP_language[long_10].'\',\''.$DP_language[long_11].'\',\''.$DP_language[long_12].'\'); 
                    cal2.setDayHeaders(\''.$DP_language[Su_short].'\',\''.$DP_language[Mo_short].'\',\''.$DP_language[Tu_short].'\',\''.$DP_language[We_short].'\',\''.$DP_language[Th_short].'\',\''.$DP_language[Fr_short].'\',\''.$DP_language[Sa_short].'\');
                        cal2.setWeekStartDay(1);
                        cal2.setTodayText("'.$DP_language[today].'");
</script>
                ';
                $popupcall_2 = '
<script language=JavaScript >
                        var cal4 = new CalendarPopup(); cal4.setMonthNames(\''.$DP_language[long_01].'\',\''.$DP_language[long_02].'\',\''.$DP_language[long_03].'\',\''.$DP_language[long_04].'\',\''.$DP_language[long_05].'\',\''.$DP_language[long_06].'\',\''.$DP_language[long_07].'\',\''.$DP_language[long_08].'\',\''.$DP_language[long_09].'\',\''.$DP_language[long_10].'\',\''.$DP_language[long_11].'\',\''.$DP_language[long_12].'\'); 
                    cal4.setDayHeaders(\''.$DP_language[Su_short].'\',\''.$DP_language[Mo_short].'\',\''.$DP_language[Tu_short].'\',\''.$DP_language[We_short].'\',\''.$DP_language[Th_short].'\',\''.$DP_language[Fr_short].'\',\''.$DP_language[Sa_short].'\');
                        cal4.setWeekStartDay(1);
                        cal4.setTodayText("'.$DP_language[today].'");                   
                        cal4.showYearNavigation(); 
</script>
                ';

                eval ("\$list_navigation = \"".$Gui->getTemplate("list_navigation")."\";");

                Return $list_navigation;
} // end func

Here is the caller graph for this function: