Example #1
0
 /**
  * Get the unique name suffix containig the date stamp
  * @return String
  */
 protected function getUniqueFileNameSuffix()
 {
     $dateMarker = getYMDdate(time());
     return $dateMarker . "_" . $this->tName . "_" . generatePassword(5);
 }
Example #2
0
 protected function getDatesByWeek($week, $year)
 {
     global $locale_info;
     $startweekday = 0;
     if ($locale_info["LOCALE_IFIRSTDAYOFWEEK"] > 0) {
         $startweekday = 7 - $locale_info["LOCALE_IFIRSTDAYOFWEEK"];
     }
     $L = isleapyear($year) ? 1 : 0;
     $months = array(31, 28 + $L, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
     $total_days = ($week - 1) * 7;
     $i = 0;
     $sum = 0;
     while ($sum <= $total_days) {
         $sum += $months[$i++];
     }
     $sum -= $months[$i - 1];
     $month = $i;
     $day = $total_days - $sum;
     $day_of_week = getdayofweek(array($year, $month, $day));
     if ($day_of_week == 0) {
         $day_of_week = 7;
     }
     $day = $day - ($day_of_week - 1) - $startweekday;
     $dates = array();
     $dates[0] = getYMDdate(mktime(0, 0, 0, $month, $day, $year));
     $dates[1] = getYMDdate(mktime(1, 1, 1, $month, $day + 6, $year));
     return $dates;
 }