Пример #1
0
 /**
  * @param null $start
  */
 protected function updateAlarm($start = null)
 {
     if (is_null($start)) {
         $start = $this->getNewDateTime();
     }
     if ((double) $this->stop->format('U.u') >= $start->format('U.u')) {
         $this->setAlarm($this->getNewDateTime($this->interval));
     } else {
         $this->finished();
     }
 }
Пример #2
0
 public function init()
 {
     $this->getHeader("date")->getCell()->addDecorator("callable", array("callable" => function ($context, $record) {
         $date = new \dateTime($record['date']);
         return "<a class='' href='" . $this->url()->fromRoute('front-raid-detail', array('key' => $this->get_key(), 'idRaid' => $record['idRaid'])) . "'><div style='height:100%;width:100%'> " . "{$date->format(' d/m/Y à h:i:s')}" . "</div></a>";
     }));
     $this->getHeader("note")->getCell()->addDecorator("callable", array("callable" => function ($context, $record) {
         //<a href=" $this->url('front-raid-detail', array('key' => $key, 'idRaid' => $aRaid['idRaid']));"><?php $this->escapeHtml($aRaid['note']); </a>
         return "<a class='' href='" . $this->url()->fromRoute('front-raid-detail', array('key' => $this->get_key(), 'idRaid' => $record['idRaid'])) . "'><div style='height:100%;width:100%'> " . "{$record['note']}" . "</div></a>";
     }));
 }
Пример #3
0
 /**
  * Returns all CourseMarkedEvents in the given time range for the given range_id.
  *
  * @param string $user_id Id of Stud.IP object from type user, course, inst
  * @param DateTime $start The start date time.
  * @param DateTime $end The end date time.
  * @return SimpleORMapCollection Collection of found CourseMarkedEvents.
  */
 public static function getEventsByInterval($user_id, DateTime $start, dateTime $end)
 {
     $stmt = DBManager::get()->prepare('SELECT DISTINCT termine.* FROM schedule_seminare ' . 'INNER JOIN termine ON schedule_seminare.seminar_id = range_id ' . 'LEFT JOIN seminar_user ON seminar_user.seminar_id = range_id AND seminar_user.user_id= :user_id ' . 'WHERE schedule_seminare.user_id = :user_id AND schedule_seminare.visible = 1 ' . 'AND seminar_user.seminar_id IS NULL AND date BETWEEN :start AND :end ' . 'ORDER BY date ASC');
     $stmt->execute(array(':user_id' => $user_id, ':start' => $start->getTimestamp(), ':end' => $end->getTimestamp()));
     $event_collection = array();
     foreach ($stmt->fetchAll(PDO::FETCH_ASSOC) as $row) {
         $event = new CourseMarkedEvent();
         $event->setData($row);
         $event->setNew(false);
         $event_collection[] = $event;
     }
     $event_collection = SimpleORMapCollection::createFromArray($event_collection, false);
     $event_collection->setClassName('Event');
     return $event_collection;
 }
Пример #4
0
 /**
  * Renvoi vrai ou faux selon que l'établissement est ouvert à date (jour) indiquée
  *
  * @param      dateTime $dt
  * @return boolean false/true
  */
 public static function isJourneeOuverte($dt)
 {
     $jour_semaine = EdtHelper::$semaine_declaration[$dt->format("w")];
     $horaire_tab = EdtHorairesEtablissementPeer::retrieveAllEdtHorairesEtablissementArrayCopy();
     if (!isset($horaire_tab[$jour_semaine])) {
         //etab fermé
         return false;
     }
     //est-ce une période ouverte
     $edt_periode_courante = EdtCalendrierPeriodePeer::retrieveEdtCalendrierPeriodeActuelle($dt);
     if ($edt_periode_courante != null && ($edt_periode_courante->getEtabfermeCalendrier() == 0 || $edt_periode_courante->getEtabvacancesCalendrier() == 1)) {
         //etab fermé
         return false;
     }
     return true;
 }
Пример #5
0
 /**
  * return formatted date
  *
  * @author Kjell-Inge Gustafsson, kigkonsult <*****@*****.**>
  * @since 2.21.7 - 2015-03-07
  * @param string $format
  * @uses iCaldateTime::$dateFormat
  * @return string
  */
 public function format($format = null)
 {
     if (empty($format) && isset($this->dateFormat)) {
         $format = $this->dateFormat;
     }
     return parent::format($format);
 }
Пример #6
0
function PO_NO_generate($type_po, $datePO, $grandtot, $conn)
{
    $newDatePO = new dateTime($datePO);
    $kdAwal = $newDatePO->format('md-');
    $kdAwal_thn = $newDatePO->format('y');
    $grandtot = floatval($grandtot);
    // }
    if ($type_po == 'NONVAT') {
        $emptyPOSQL = "SELECT MIN(PO_NO) FROM MST_PO WHERE PO_NO LIKE '{$kdAwal}%' AND PO_STAT = 'INACT' AND PO_TYPE='{$type_po}' " . "AND TO_NUMBER(SUBSTR(PO_NO,6,2)) > 50 AND TO_NUMBER(SUBSTR(PO_NO,6,2)) <= 70 AND SUBSTR(PO_NO,(length(PO_NO)-1),2) = '" . $kdAwal_thn . "' ";
        $cekPOIdSql = "SELECT MAX(PO_NO) FROM MST_PO WHERE PO_NO LIKE '{$kdAwal}%' AND PO_STAT = 'ACT' AND PO_TYPE='{$type_po}' " . "AND TO_NUMBER(SUBSTR(PO_NO,6,2)) > 50 AND TO_NUMBER(SUBSTR(PO_NO,6,2)) <= 70 AND SUBSTR(PO_NO,(length(PO_NO)-1),2) = '" . $kdAwal_thn . "' ";
        if ($grandtot > 3000000) {
            $emptyPOSQL = "SELECT MIN(PO_NO) FROM MST_PO WHERE PO_NO LIKE '{$kdAwal}%' AND PO_STAT = 'INACT' AND PO_TYPE='{$type_po}' " . "AND TO_NUMBER(SUBSTR(PO_NO,6,2)) > 70 AND SUBSTR(PO_NO,(length(PO_NO)-1),2) = '" . $kdAwal_thn . "' ";
            $cekPOIdSql = "SELECT MAX(PO_NO) FROM MST_PO WHERE PO_NO LIKE '{$kdAwal}%' AND PO_STAT = 'ACT' AND PO_TYPE='{$type_po}' " . "AND TO_NUMBER(SUBSTR(PO_NO,6,2)) > 70 AND SUBSTR(PO_NO,(length(PO_NO)-1),2) = '" . $kdAwal_thn . "' ";
        }
    } else {
        $emptyPOSQL = "SELECT MIN(PO_NO) FROM MST_PO WHERE PO_NO LIKE '{$kdAwal}%' AND PO_STAT = 'INACT' AND PO_TYPE='{$type_po}' " . "AND TO_NUMBER(SUBSTR(PO_NO,6,2)) <= 50 AND SUBSTR(PO_NO,(length(PO_NO)-1),2) = '" . $kdAwal_thn . "' ";
        $cekPOIdSql = "SELECT MAX(PO_NO) FROM MST_PO WHERE PO_NO LIKE '{$kdAwal}%' AND PO_STAT = 'ACT' AND PO_TYPE='{$type_po}' " . "AND TO_NUMBER(SUBSTR(PO_NO,6,2)) <= 50 AND SUBSTR(PO_NO,(length(PO_NO)-1),2) = '" . $kdAwal_thn . "' ";
    }
    $emptyPO = SingleQryFld($emptyPOSQL, $conn);
    if ($emptyPO != "") {
        return $emptyPO;
    } else {
        //     echo "$cekPOIdSql<br>";
        $cekPOIdParse = oci_parse($conn, $cekPOIdSql);
        //oci_bind_by_name($cekPOIdParse, ":PONOMAX", $poNo);
        oci_execute($cekPOIdParse);
        $cekPOId = oci_fetch_array($cekPOIdParse)[0];
        // echo "$cekPOId - $type_po";
        if ($cekPOId == "" and $type_po == "VAT") {
            $num = 1;
            $num = str_pad($num, 2, "0", STR_PAD_LEFT);
        } elseif ($cekPOId == "" and $type_po == "NONVAT") {
            if ($grandtot > 3000000) {
                $num = 71;
            } else {
                $num = 51;
            }
        } else {
            $num = substr($cekPOId, 5);
            $num = substr($num, 0, -7);
            $num++;
            $num = str_pad($num, 2, "0", STR_PAD_LEFT);
        }
        //echo "$num";
        return $kdAwal . $num . '/WEN/' . $kdAwal_thn;
    }
}
Пример #7
0
 /**
  * Returns all CourseEvents in the given time range for the given range_id.
  *
  * @param string $user_id Id of Stud.IP object from type user, course, inst
  * @param DateTime $start The start date time.
  * @param DateTime $end The end date time.
  * @return SimpleORMapCollection Collection of found CourseEvents.
  */
 public static function getEventsByInterval($user_id, DateTime $start, dateTime $end)
 {
     $stmt = DBManager::get()->prepare('SELECT termine.* FROM seminar_user ' . 'INNER JOIN termine ON seminar_id = range_id ' . 'WHERE user_id = :user_id ' . 'AND date BETWEEN :start AND :end ' . "AND (IFNULL(metadate_id, '') = '' " . 'OR metadate_id NOT IN ( ' . 'SELECT metadate_id FROM schedule_seminare ' . 'WHERE user_id = :user_id AND visible = 0) ) ' . 'ORDER BY date ASC');
     $stmt->execute(array(':user_id' => $user_id, ':start' => $start->getTimestamp(), ':end' => $end->getTimestamp()));
     $event_collection = array();
     foreach ($stmt->fetchAll(PDO::FETCH_ASSOC) as $row) {
         $event = new CourseEvent();
         $event->setData($row);
         $event->setNew(false);
         // related persons (dozenten) or groups
         if (self::checkRelated($event, $user_id)) {
             $event_collection[] = $event;
         }
     }
     $event_collection = SimpleORMapCollection::createFromArray($event_collection, false);
     $event_collection->setClassName('Event');
     return $event_collection;
 }
 /**
  * test grabbing a notification by invalid notificationDateTime
  **/
 public function testGetInvalidNotificationByNotificationDateTime()
 {
     // grab the data from mySQL and enforce the fields match our expectations
     $angularDate = $this->VALID_notificationDateTime->getTimestamp() * 1000;
     $response = $this->guzzle->get('http://bootcamp-coders.cnm.edu/~invtext/backend/php/api/notification/?date=' . $angularDate);
     $this->assertSame($response->getStatusCode(), 200);
     $body = $response->getBody();
     $notification = json_decode($body);
     $this->assertSame(200, $notification->status);
 }
Пример #9
0
	/**
	 * Filtre la requete sur les saisies qui chevauchent une plage de temps
	 *
	 * @param     dateTime $dt_debut
	 * @param     dateTime $dt_fin
	 *
	 * @return    AbsenceEleveSaisieQuery The current query, for fluid interface
	 */
        public function filterByPlageTemps($dt_debut = null, $dt_fin = null)
        {
	    if ($dt_debut != null && $dt_fin != null && $dt_debut->format('U') == $dt_fin->format('U')) {
		//on a pas une plage de temps mais deux fois le meme moment
		//on va renvoyer aussi les saisies qui debutent a ce momement
		$this->filterByFinAbs($dt_debut, Criteria::GREATER_THAN);
		$this->filterByDebutAbs($dt_fin, Criteria::LESS_EQUAL);
		return $this;
	    } else {
		if ($dt_debut != null) {
		    $this->filterByFinAbs($dt_debut, Criteria::GREATER_THAN);
		}
		if ($dt_fin != null) {
		    $this->filterByDebutAbs($dt_fin, Criteria::LESS_THAN);
		}
		return $this;
	    }
	    return $this;
        }
Пример #10
0
 /**
  * convert from current user format to iso datetime
  */
 protected function humandatetimeToIso($humandatetime)
 {
     $datetime = \dateTime::createFromFormat($this->format, $humandatetime);
     if (!$datetime) {
         return '';
     }
     $timestamp = $datetime->getTimestamp();
     if ($timestamp < 1) {
         return "";
     }
     $humandatetime = date($this->store_as, $timestamp);
     return $humandatetime;
 }
Пример #11
0
 function get_chart()
 {
     $tanggal = array();
     $num_data = array();
     for ($i = 7; $i > 0; $i--) {
         $d = new dateTime("{$i} days ago");
         $tanggal[] = $d->format('d M');
         $num_data_po[] = getAll('purchase_order', array('created_on' => 'where/' . $d->format('Y-m-d')))->num_rows();
         $num_data_so[] = getAll('sales_order', array('created_on' => 'where/' . $d->format('Y-m-d')))->num_rows();
         $num_data_penerimaan[] = getAll('stok_penerimaan', array('created_on' => 'where/' . $d->format('Y-m-d')))->num_rows();
         $num_data_pengeluaran[] = getAll('stok_pengeluaran', array('created_on' => 'where/' . $d->format('Y-m-d')))->num_rows();
         $num_data_pembelian[] = getAll('pembelian', array('created_on' => 'where/' . $d->format('Y-m-d')))->num_rows();
         $num_data_penjualan[] = getAll('penjualan', array('created_on' => 'where/' . $d->format('Y-m-d')))->num_rows();
     }
     echo json_encode(array('tanggal' => $tanggal, 'num_data_po' => $num_data_po, 'num_data_pembelian' => $num_data_pembelian, 'num_data_so' => $num_data_so, 'num_data_penjualan' => $num_data_penjualan, 'num_data_penerimaan' => $num_data_penerimaan, 'num_data_pengeluaran' => $num_data_pengeluaran));
 }
 public function index()
 {
     $this->language->load('payment/openpay_cards');
     $data['action'] = $this->url->link('payment/openpay_cards/confirm', '', 'SSL');
     $data['text_credit_card'] = $this->language->get('text_credit_card');
     $data['text_wait'] = $this->language->get('text_wait');
     $data['help_cvc_front'] = $this->language->get('help_cvc_front');
     $data['help_cvc_back'] = $this->language->get('help_cvc_back');
     $data['entry_cc_owner'] = $this->language->get('entry_cc_owner');
     $data['entry_cc_number'] = $this->language->get('entry_cc_number');
     $data['entry_cc_expire_date'] = $this->language->get('entry_cc_expire_date');
     $data['entry_cc_cvv2'] = $this->language->get('entry_cc_cvv2');
     $data['error_error'] = $this->language->get('error_error');
     $data['text_success_payment'] = $this->language->get('text_success_payment');
     $data['button_confirm'] = $this->language->get('button_confirm');
     $data['button_back'] = $this->language->get('button_back');
     $data['merchant_id'] = $this->getMerchantId();
     $data['public_key'] = $this->getPublicApiKey();
     $data['test_mode'] = $this->isTestMode();
     $data['months'] = array();
     $now = new dateTime('2000-01-01');
     for ($i = $now->format('n'), $interval = new DateInterval('P1M'); $i <= 12; $i++, $now->add($interval)) {
         $data['months'][] = array('text' => $now->format('m'), 'value' => $now->format('m'));
     }
     $data['year_expire'] = array();
     $now = new dateTime();
     for ($i = $now->format('y'), $interval = new DateInterval('P1Y'), $stop = $i + 10; $i <= $stop; $i++, $now->add($interval)) {
         $data['year_expire'][] = array('text' => $now->format('y'), 'value' => $now->format('y'));
     }
     if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/payment/openpay_cards.tpl')) {
         $this->template = $this->config->get('config_template') . '/template/payment/openpay_cards.tpl';
     } else {
         $this->template = 'default/template/payment/openpay_cards.tpl';
     }
     return $this->load->view($this->template, $data);
 }
Пример #13
0
 /**
  * * inserts this Notification into mySQL
  *
  * @param PDO $pdo pointer to PDO connection, by reference
  * @throws PDOException when mySQL related errors occur
  **/
 public function insert(PDO &$pdo)
 {
     // enforce the notificationId is null (i.e., don't insert a notification that already exists)
     if ($this->notificationId !== null) {
         throw new PDOException("not a new notification");
     }
     // create query template
     $query = "INSERT INTO notification(notificationId, alertId, emailStatus, notificationDateTime, notificationHandle, notificationContent)VALUES(:notificationId, :alertId, :emailStatus, :notificationDateTime, :notificationHandle, :notificationContent)";
     $statement = $pdo->prepare($query);
     // bind the member variables to the place holders in the template
     $formattedDate = $this->notificationDateTime->format("Y-m-d H:i:s");
     $parameters = array("notificationId" => $this->notificationId, "alertId" => $this->alertId, "emailStatus" => $this->emailStatus, "notificationDateTime" => $formattedDate, "notificationHandle" => $this->notificationHandle, "notificationContent" => $this->notificationContent);
     $statement->execute($parameters);
     // update the null notificationId with what mySQL just gave us
     $this->notificationId = intval($pdo->lastInsertId());
 }
Пример #14
0
 /**
  * Save data to XML File
  *
  * @param DateTime $date
  * @param string   $lang
  * @param string   $data
  *
  * @return bool
  * @throws BnmException
  */
 protected function save(dateTime $date, $lang, $data)
 {
     if (!$this->cacheDir) {
         return false;
     }
     $dir = $this->getCacheDirWithLang($lang);
     $file = $dir . '/' . $date->format('Y-m-d') . '.xml';
     if (!is_dir($dir)) {
         if (!mkdir($dir, 0755, true)) {
             throw new BnmException(sprintf('Can not create cache directory %s', $dir));
         }
     }
     if (false === file_put_contents($file, $data, LOCK_EX)) {
         throw new BnmException('Error saving data');
     }
     return true;
 }
Пример #15
0
     $null_end_date = false;
     if ($_POST['tyear'] == '' and $_POST['tmonth'] == '' and $_POST['tday'] == '' and $_POST['thour'] == '' and $_POST['tminute'] == '') {
         $null_end_date = true;
         $tmp_end_date = NULL;
     } else {
         $leap = is_leap($_POST['tyear']);
         if ($leap == true and $_POST['tmonth'] == '02' and ($_POST['tday'] == '30' or $_POST['tday'] == '31')) {
             $_POST['tday'] = '29';
         }
         if ($leap == false and $_POST['tmonth'] == '02' and ($_POST['tday'] == '29' or $_POST['tday'] == '30' or $_POST['tday'] == '31')) {
             $_POST['tday'] = '28';
         }
         if (($_POST['tmonth'] == '04' or $_POST['tmonth'] == '06' or $_POST['tmonth'] == '09' or $_POST['tmonth'] == '11') and $_POST['tday'] == '31') {
             $_POST['tday'] = '30';
         }
         $end_date = new dateTime($_POST['tyear'] . $_POST['tmonth'] . $_POST['tday'] . $_POST['thour'] . $_POST['tminute'], $target_timezone);
         $end_date->setTimezone($local_time);
         if ($_POST['timezone'] < 0) {
             $end_date->modify("+" . abs($_POST['timezone']) . " hour");
         } elseif ($_POST['timezone'] > 0) {
             $end_date->modify("-" . $_POST['timezone'] . " hour");
         }
         $properties->set_end_date($end_date->format('U'));
         $properties->set_raw_end_date($end_date->format('YmdHis'));
     }
 }
 $properties->set_timezone($_POST['timezone']);
 if (isset($_POST['calendar_year'])) {
     $calendar_year = $_POST['calendar_year'] == '' ? NULL : $_POST['calendar_year'];
     $properties->set_calendar_year($calendar_year);
 }
Пример #16
0
/**
* Utility function Compares two DateTime object, 
* Returns +1 if the first date is after, -1 if its before or 0 if they're the same
* Note: does not compare *times*. 
* Used to filter occurrances with udiff
*
* @access private
*  @ignore
* @since 1.0.0
* @see _eventorganiser_compare_datetime
*
* @param dateTime $date1 The first date to compare
* @param dateTime $date2 The second date to compare
* @return int 1 | 0 | -1
*/
function _eventorganiser_compare_dates($date1, $date2)
{
    //Don't wish to compare times
    if ($date1->format('Ymd') == $date2->format('Ymd')) {
        return 0;
    }
    return $date1 > $date2 ? 1 : -1;
}
       <p>INVALID usernames/passwords<p>
       <p><a href="/WeltesinformationCenter/index.html">LOGIN PAGE</a><p>
EOD;
    exit;
}
// GENERATE THE APPLICATION PAGE
$conn = oci_pconnect(ORA_CON_UN, ORA_CON_PW, ORA_CON_DB);
// 1. SET THE CLIENT IDENTIFIER AFTER EVERY CALL
// 2. USING UNIQUE VALUE FOR BACK END USER
oci_set_client_identifier($conn, $_SESSION['username']);
$username = htmlentities($_SESSION['username'], ENT_QUOTES);
$projName = $_GET['projName'];
$subcont = $_GET['subcont'];
$date1 = $_GET['date1'];
$time1 = strval($_GET['time1']) . ":00";
$dt1 = new dateTime($date1);
$PROJ_NO = SingleQryFld("SELECT PROJECT_NO FROM PROJECT WHERE PROJECT_NAME='{$projName}'", $conn);
$PROJ_DESC = SingleQryFld("SELECT PROJECT_DESC FROM PROJECT WHERE PROJECT_NAME='{$projName}'", $conn);
$CLIENT_NAME = SingleQryFld("SELECT CLIENT_NAME FROM MST_CLIENT WHERE CLIENT_ID in (SELECT CLIENT_ID FROM PROJECT WHERE PROJECT_NAME='{$projName}')", $conn);
$SPV_SQL = "SELECT DISTINCT(SPV_FAB) FROM MASTER_DRAWING_ASSIGNED WHERE PROJECT_NAME='{$projName}' AND SUBCONT_ID='{$subcont}' AND ASSIGNMENT_DATE >= TO_DATE('{$date1} {$time1}', 'MM/DD/YYYY hh24:mi:ss') AND ASSIGNMENT_DATE <= TO_DATE ('{$date1} 23:59:59', 'MM/DD/YYYY hh24:mi:ss')";
// echo "$SPV_SQL<hr>";
$SPV = SingleQryFld($SPV_SQL, $conn);
$QC_INSP_SQL = "SELECT DISTINCT(QC_INSP) FROM MASTER_DRAWING_ASSIGNED WHERE PROJECT_NAME='{$projName}' AND SUBCONT_ID='{$subcont}' AND ASSIGNMENT_DATE >= TO_DATE('{$date1} {$time1}', 'MM/DD/YYYY hh24:mi:ss') AND ASSIGNMENT_DATE <= TO_DATE ('{$date1} 23:59:59', 'MM/DD/YYYY hh24:mi:ss')";
// echo "$QC_INSP_SQL<hr>";
$QC_INSP = SingleQryFld($QC_INSP_SQL, $conn);
// echo "$projName -- $subcont -- $date1 -- $PROJ_NO -- $PROJ_DESC -- $CLIENT_NAME -- $SPV";
// exit();
?>

<!DOCTYPE html>
<html>
Пример #18
0
 public function modifyThisDateWithoutCloning(\dateTime $date)
 {
     $date->modify('+1 day');
 }
 /**
  * Converts dateTime from local TZ to UTC
  * Returns dateTime in format expected by the Outlook API
  * 
  * @param  dateTime $dateTime
  * @return dateTime
  */
 protected static function encodeDateTime($dateTime)
 {
     $utcDateTime = $dateTime->setTimeZone(new \DateTimeZone("UTC"));
     $dateFormat = "Y-m-d\\TH:i:s\\Z";
     return date_format($utcDateTime, $dateFormat);
 }
Пример #20
0
 public function getValue()
 {
     $value = parent::getValue();
     return $value instanceof \dateTime === false ? $value : $value->format(self::mysqlDateTimeFormat);
 }
Пример #21
0
    $start_date->setTimezone($UK_time);
    if (modulo($_POST['tyear'], 4) == 0 and modulo($_POST['tyear'], 100) != 0 or modulo($_POST['tyear'], 400) == 0) {
        $leap = true;
    } else {
        $leap = false;
    }
    if ($leap == true and $_POST['tmonth'] == '02' and ($_POST['tday'] == '30' or $_POST['tday'] == '31')) {
        $_POST['tday'] = '29';
    }
    if ($leap == false and $_POST['tmonth'] == '02' and ($_POST['tday'] == '29' or $_POST['tday'] == '30' or $_POST['tday'] == '31')) {
        $_POST['tday'] = '28';
    }
    if (($_POST['tmonth'] == '04' or $_POST['tmonth'] == '06' or $_POST['tmonth'] == '09' or $_POST['tmonth'] == '11') and $_POST['tday'] == '31') {
        $_POST['tday'] = '30';
    }
    $end_date = new dateTime($_POST['tyear'] . $_POST['tmonth'] . $_POST['tday'] . $_POST['ttime'], $target_timezone);
    $end_date->setTimezone($UK_time);
    if ($_POST['timezone'] < 0) {
        $start_date->modify("+" . abs($_POST['timezone']) . " hour");
        $end_date->modify("+" . abs($_POST['timezone']) . " hour");
    } elseif ($_POST['timezone'] > 0) {
        $start_date->modify("-" . $_POST['timezone'] . " hour");
        $end_date->modify("-" . $_POST['timezone'] . " hour");
    }
    $tmp_start_date = $start_date->format("YmdHis");
    $tmp_end_date = $end_date->format("YmdHis");
    $timezone = $_POST['timezone'];
}
// Process the posted modules
$modules = array();
$first = true;
Пример #22
0
<?php

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * 
 * @package: tutoriales2014/fechas_dinamicas_datepicker/
 * @author: Luis Fernando Cázares <*****@*****.**>
 * @version Id: index.php 2014-07-01 23:00 _CazaresLuis_ ;
 * 
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
session_name('tutorialesCazares2014');
session_start();
$root = '../';
// Incluimos la inicialización de la clase twig
include $root . 'includes/templateEngine.inc.php';
// creamos fechas inicial y final
$fechaInicio = new dateTime('NOW');
$fechaFinal = new dateTime('NOW +1 days');
// Realizamos el display de la plantilla
$twig->display('fechas_dinamicas_datepicker/layout.html', array("root" => $root, "fechaInicio" => $fechaInicio->format('d-m-Y'), "fechaFinal" => $fechaFinal->format('d-m-Y'), "title" => "Tutoriales cazaresluis.com", "footer" => 'cazaresluis.com | luis.f.cazares@gmail.com | Celular: 55 22 71 46 89 | <a href="http://www.cazaresluis.com" target="_blank">Blog</a> | <a href="https://www.youtube.com/user/luisfcazares/" target="_blank">Youtube Channel</a> | <a href="https://twitter.com/cazaresluis" target="_blank">Twitter</a> | <a href="https://plus.google.com/u/0/+LuisFernandoCázaresBulbarela/" target="_blank">Google +</a>'));
Пример #23
0
		

			<div class="col-md-9">
				<div class="horario table-responsive">
					<table class="table table-condensed table-bordered salida">
						<tr>
							<th>Nombre</th>
							<th>Hora de entrada</th>
							<th>Hora de salida</th>
							<th>Tiempo</th>
							<th>Hora de entrada</th>
							<th>Hora de salida</th>
							<th>Tiempo</th>
						</tr>
						<?php 
$dateTime = new dateTime("tomorrow");
$hoy = date("Y-m-d");
$tomorrow = $dateTime->format("Y-m-d");
include 'conexion.php';
$datos = "select idpersonal,nombre,apellidos,dia_entrada,hora_entrada,dia_salida,hora_salida,tiempo,despues_entrada,despues_salida,despues_tiempo from horario,personal where dia_entrada = '{$hoy}' and personal.idpersonal = horario.personal_idpersonal and (hora_salida or despues_salida) is not null order by hora_salida desc";
$horario = mysql_query($datos, $conexion) or die(mysql_error());
$totEmp = mysql_num_rows($horario);
while ($rows = mysql_fetch_assoc($horario)) {
    echo "<tr>";
    $nombre = $rows['nombre'] . " " . $rows['apellidos'];
    echo "<td>" . $nombre . "</td>";
    $hora_entrada = $rows['hora_entrada'];
    echo "<td>" . $hora_entrada . "</td>";
    $hora_salida = $rows['hora_salida'];
    echo "<td>" . $hora_salida . "</td>";
    $tiempo = $rows['tiempo'];
Пример #24
0
 public function payroll($year = null, $month = null)
 {
     if ($year == null) {
         $year = date('Y');
     }
     if ($month == null) {
         $month = date('m');
     }
     $this->view->year = $year;
     $date = new DateTime();
     $date->setDate($year, $month, 26);
     $date->setTime(0, 0, 0);
     $this->view->date = $date->format("F Y");
     $date->modify('+1 year');
     $this->view->nextYear = $date->format('Y');
     $date->modify('-2 year');
     $this->view->previousYear = $date->format('Y');
     $this->view->month = $date->format('m');
     $date->modify('-1 month');
     $this->view->previousMonth = $date->format('m');
     $date->modify('+2 month');
     $this->view->nextMonth = $date->format('m');
     $date2 = new DateTime();
     $date2->setDate($year, $month, 25);
     $date2->setTime(24, 0, 0);
     $interval = date_diff($date, $date2);
     $this->view->span = $interval->days;
     $reports = new reportModel($year, $month);
     $this->view->report = $reports->payroll($year, $month);
     $this->view->startDate = $date->format("F jS Y");
     $days = $interval->days - 1;
     $date->modify("+{$days} days");
     $this->view->endDate = $date->format("F jS Y");
     $date = new dateTime();
     $date->setDate($year, $month, 25);
     $this->view->currentDate = $date->format('Y-m-d');
     $this->view->previousDate = $date->modify('-1 month +1 day')->format('Y-m-d');
     $codes = new codeModel();
     $this->view->codes = $codes->allCodes();
 }
Пример #25
0
        //query from the town database
        $timestamp = mysql_result($proQuery, 0, "timestamp");
        $bc = "shoe";
        //default container is a shoe
        //retrieves container id from products
        $container = mysql_result($proNameQuery, 0, "containerID");
        //queries the container name from the container table
        $query = "SELECT Name FROM containers WHERE ID = {$container} ";
        $contNames = !is_null($query) ? mysql_query($query) : null;
        $containerName = mysql_result($contNames, 0, "Name");
        if (!($quantity == 1)) {
            $bc = $containerName . "s";
        } else {
            $bc = $containerName;
        }
        $dateOfInsertion = new dateTime();
        $dateOfInsertion->setTimestamp(strtotime($timestamp));
        echo "<tr style='vertical-align:top;text-align:center;height:1em;margin-right:auto;margin-left:auto;background-color:";
        if ($productCounter % 2) {
            echo "#b3d9ff";
        } else {
            echo "white";
        }
        //every even row is this color
        echo "'>\r\n\t\t\t\t\t<td>" . $dateOfInsertion->format('d M Y') . "</td>\r\n\t\t\t\t\t<td>" . $productName . "</td>\r\n\t\t\t\t\t<td>" . $quantity . " " . $bc . "(" . $volume . "oz)</td>\r\n\t\t\t\t\t<td>" . $quantity * $volume . " oz</td>\r\n\t\t\t\t\t<td>" . $abv . "%</td>\r\n\t\t\t\t\t<td>\$" . $price . "</td>\r\n\t\t\t\t\t<td>\$" . number_format($price / ($quantity * $volume), 3) . "</td>\r\n\t\t\t\t\t<td>\$" . number_format($price / ($abv / 100 * ($quantity * $volume)), 3) . "</td>\r\n\t\t\t\t\t</tr>";
    } elseif (mysql_num_rows($proNameQuery) == 0) {
    }
    //a price in this town belongs to a product that does not match the search results. no big deal.
}
echo "</tbody></table>";
//insert the failed search result method after the price table