}
}
- /**
- * Return all days by period
- *
- * @return array
- */
- function getAllDays() {
- $ret_array = array();
- if ($this->startDate->before($this->endDate)) {
- $d = $this->getBegin();
- while ($d->before($this->getEnd())) {
- array_push($ret_array, $d);
- $d = $d->nextDate();
- }
- array_push($ret_array, $d);
- } else {
- array_push($ret_array, $this->startDate);
- }
- return $ret_array;
- }
-
function setPeriod($b_date, $e_date) {
$this->startDate = $b_date;
$this->endDate = $e_date;
}
- // return date object
- function getBegin() {
- return $this->startDate;
- }
-
- // return date object
- function getEnd() {
- return $this->endDate;
- }
-
// return date string
- function getBeginDate($format="") {
+ function getStartDate($format="") {
return $this->startDate->toString($format);
}
function getEndDate($format="") {
return $this->endDate->toString($format);
}
-
- function getArray($format="") {
- $result = array();
- $d = $this->getBegin();
- while ($d->before($this->getEnd())) {
- $result[] = $d->toString($format);
- $d = $d->nextDate();
- }
- return $result;
- }
}
$q_period = '';
if ($period != null) {
- $q_period = " and date >= '".$period->getBeginDate(DB_DATEFORMAT)."' and date <= '".$period->getEndDate(DB_DATEFORMAT)."'";
+ $q_period = " and date >= '".$period->getStartDate(DB_DATEFORMAT)."' and date <= '".$period->getEndDate(DB_DATEFORMAT)."'";
}
if (CHART_PROJECTS == $chart_type) {
// Data for projects.
new DateAndTime($user->date_format, $bean->getAttribute('start_date')),
new DateAndTime($user->date_format, $bean->getAttribute('end_date')));
}
- $where = " where l.status = 1 and l.date >= '".$period->getBeginDate(DB_DATEFORMAT)."' and l.date <= '".$period->getEndDate(DB_DATEFORMAT)."'".
+ $where = " where l.status = 1 and l.date >= '".$period->getStartDate(DB_DATEFORMAT)."' and l.date <= '".$period->getEndDate(DB_DATEFORMAT)."'".
" $user_list_part $dropdown_parts";
return $where;
}
new DateAndTime($user->date_format, $report['period_start']),
new DateAndTime($user->date_format, $report['period_end']));
}
- $where = " where l.status = 1 and l.date >= '".$period->getBeginDate(DB_DATEFORMAT)."' and l.date <= '".$period->getEndDate(DB_DATEFORMAT)."'".
+ $where = " where l.status = 1 and l.date >= '".$period->getStartDate(DB_DATEFORMAT)."' and l.date <= '".$period->getEndDate(DB_DATEFORMAT)."'".
" $user_list_part $dropdown_parts";
return $where;
}
new DateAndTime($user->date_format, $bean->getAttribute('start_date')),
new DateAndTime($user->date_format, $bean->getAttribute('end_date')));
}
- $where = " where ei.status = 1 and ei.date >= '".$period->getBeginDate(DB_DATEFORMAT)."' and ei.date <= '".$period->getEndDate(DB_DATEFORMAT)."'".
+ $where = " where ei.status = 1 and ei.date >= '".$period->getStartDate(DB_DATEFORMAT)."' and ei.date <= '".$period->getEndDate(DB_DATEFORMAT)."'".
" $user_list_part $dropdown_parts";
return $where;
}
new DateAndTime($user->date_format, $report['period_start']),
new DateAndTime($user->date_format, $report['period_end']));
}
- $where = " where ei.status = 1 and ei.date >= '".$period->getBeginDate(DB_DATEFORMAT)."' and ei.date <= '".$period->getEndDate(DB_DATEFORMAT)."'".
+ $where = " where ei.status = 1 and ei.date >= '".$period->getStartDate(DB_DATEFORMAT)."' and ei.date <= '".$period->getEndDate(DB_DATEFORMAT)."'".
" $user_list_part $dropdown_parts";
return $where;
}
new DateAndTime($user->date_format, $bean->getAttribute('end_date')));
}
- $totals['start_date'] = $period->getBeginDate();
+ $totals['start_date'] = $period->getStartDate();
$totals['end_date'] = $period->getEndDate();
$totals['time'] = $total_time;
$totals['cost'] = $total_cost;
new DateAndTime($user->date_format, $report['period_end']));
}
- $totals['start_date'] = $period->getBeginDate();
+ $totals['start_date'] = $period->getStartDate();
$totals['end_date'] = $period->getEndDate();
$totals['time'] = $total_time;
$totals['cost'] = $total_cost;
$mdb2 = getConnection();
$period = new Period(INTERVAL_THIS_WEEK, $date);
- $sql = "select sum(time_to_sec(duration)) as sm from tt_log where user_id = $user_id and date >= '".$period->getBeginDate(DB_DATEFORMAT)."' and date <= '".$period->getEndDate(DB_DATEFORMAT)."' and status = 1";
+ $sql = "select sum(time_to_sec(duration)) as sm from tt_log where user_id = $user_id and date >= '".$period->getStartDate(DB_DATEFORMAT)."' and date <= '".$period->getEndDate(DB_DATEFORMAT)."' and status = 1";
$res = $mdb2->query($sql);
if (!is_a($res, 'PEAR_Error')) {
$val = $res->fetchRow();
$mdb2 = getConnection();
$period = new Period(INTERVAL_THIS_MONTH, $date);
- $sql = "select sum(time_to_sec(duration)) as sm from tt_log where user_id = $user_id and date >= '".$period->getBeginDate(DB_DATEFORMAT)."' and date <= '".$period->getEndDate(DB_DATEFORMAT)."' and status = 1";
+ $sql = "select sum(time_to_sec(duration)) as sm from tt_log where user_id = $user_id and date >= '".$period->getStartDate(DB_DATEFORMAT)."' and date <= '".$period->getEndDate(DB_DATEFORMAT)."' and status = 1";
$res = $mdb2->query($sql);
if (!is_a($res, 'PEAR_Error')) {
$val = $res->fetchRow();
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.12.2.3682 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.12.2.3683 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
<a href="https://www.anuko.com/lp/tt_4.htm" target="_blank">{$i18n.footer.credits}</a> |
<a href="https://www.anuko.com/lp/tt_5.htm" target="_blank">{$i18n.footer.license}</a> |
<a href="https://www.anuko.com/lp/tt_7.htm" target="_blank">{$i18n.footer.improve}</a>
// No previous form data were found in session. Use the following default values.
$form->setValueByElement('users', array_keys($user_list));
$period = new Period(INTERVAL_THIS_MONTH, new DateAndTime($user->date_format));
- $form->setValueByElement('start_date', $period->getBeginDate());
+ $form->setValueByElement('start_date', $period->getStartDate());
$form->setValueByElement('end_date', $period->getEndDate());
$form->setValueByElement('chclient', '1');
$form->setValueByElement('chinvoice', '0');