function tep_periodenddate($period = null)
{
    if ($period == null) {
        $period = tep_datetoperiod();
    }
    $year = (int) substr($period, 0, 4);
    $month = (int) substr($period, 5, 2);
    return strftime('%Y-%m-%d', mktime(0, 0, 0, $month + 1, 0, $year));
}
Exemple #2
0
 * Date        : 03 july 2009
 * Description : Default (starting)page
 *
 *               Framework: osCommerce, Open Source E-Commerce Solutions
 *               http://www.oscommerce.com
 */
// application_top //
require 'includes/application_top.php';
// Check if user is logged in. If not, redirect to login page
if (!tep_not_null($_SESSION['employee_login'])) {
    tep_redirect(tep_href_link(FILENAME_LOGIN));
}
// header //
require DIR_WS_INCLUDES . 'header.php';
if (!tep_not_null($_POST['period'])) {
    $_POST['period'] = tep_datetoperiod();
}
?>
<!-- body //-->
  <table border="0" width="100%" cellspacing="3" cellpadding="3">
    <tr>
      <td width="<?php 
echo BOX_WIDTH;
?>
" valign="top">
        <table border="0" width="<?php 
echo BOX_WIDTH;
?>
" cellspacing="0" cellpadding="2">
          <!-- left_navigation //-->
          <?php 
 public function get_oldest_unconfirmed_period()
 {
     $database = $_SESSION['database'];
     $oldest_unconfirmed_period_query = $database->query("select timesheets_start_date from " . TABLE_TIMESHEETS . " where employees_id = '" . (int) $this->employees_id . "'" . " and timesheets_locked = '0'" . " and timesheets_end_date < '" . strftime('%Y-%m-%d') . "'" . " order by timesheets_start_date");
     $oldest_unconfirmed_period_result = $database->fetch_array($oldest_unconfirmed_period_query);
     if (tep_not_null($oldest_unconfirmed_period_result)) {
         return tep_datetoperiod(DATE_FORMAT_DATABASE, $oldest_unconfirmed_period_result['timesheets_start_date']);
     } else {
         return null;
     }
 }