Ejemplo n.º 1
0
 public function hydrate_from_form($i)
 {
     $this->code = $_GET['discount_code_a'][$i];
     $this->class = $_GET['discount_class_a'][$i];
     if (!is_null_or_empty($_GET['discount_date_a'][$i])) {
         $this->expiration_t = s2t($_GET['discount_date_a'][$i]);
     } else {
         $this->expiration_t = null;
     }
     if ($this->class == DISCOUNT_CLASS_FIXED) {
         $this->amount = $_GET['discount_value_a'][$i];
     } else {
         $this->percentage = $_GET['discount_value_a'][$i];
     }
 }
Ejemplo n.º 2
0
€</td>
			<td class="evt_curr"><?php 
    echo $remaining;
    ?>
</td>
		</tr>
<?php 
}
?>
</table>
<?php 
if ($event->can_be_administrated()) {
    ?>
<div id="evt_status" class="evt_shadowed">
<?php 
    if (time() >= s2t($event->happening_t, "%Y-%m-%d") + 86400) {
        ?>
				{{This event has already happened.}}
<?php 
    } else {
        if ($event->is_confirmed()) {
            ?>
				{{This event is confirmed. It will happen!}}
<?php 
        } else {
            if ($event->is_cancelled()) {
                ?>
				{{Unfortunately this event is cancelled.}}
<?php 
            } else {
                ?>
Ejemplo n.º 3
0
<?php

define("BASE_DIR", "..");
require_once BASE_DIR . "/include/misc.inc";
require_once BASE_DIR . "/include/layout.inc";
require_once BASE_DIR . "/include/globals.inc";
$date = "2013-09-22";
$timestamp = s2t($date, "%Y-%m-%d");
echo $date . " => " . $timestamp . "<br/>";
echo date('Y-m-d', $timestamp);
layout_trace();
Ejemplo n.º 4
0
 public function has_already_happened()
 {
     return s2t($this->happening_t) > time();
 }
Ejemplo n.º 5
0
 public function hydrate_from_form()
 {
     $this->created_t = time();
     $this->mod_t = $this->created_t;
     foreach (dd()->get_entity($this->type)->get_fields() as $field) {
         if ($field->is_in_create_form) {
             if ($field->type == "timestamp") {
                 $field->value = s2t($_GET[$field->name]);
             } else {
                 $field->value = $_GET[$field->name];
             }
         } else {
             switch ($field->type) {
                 case "int":
                 case "status":
                     $field->value = 0;
                     break;
                 default:
                     $field->value = null;
             }
         }
         $this->fields[] = $field;
     }
 }
Ejemplo n.º 6
0
{$typed_address}<br/>
EOF;
if (TEST_MODE) {
    $google_address = $address->google_address();
    $location .= <<<EOF
<br/>
<span class="gray">{$google_address}</span>
EOF;
}
$block = new Block();
$block->side = 'left';
$block->title = 'Location';
$block->content = $location;
$blocks[] = $block;
$happening = format_date($event->happening_t);
$happening_t = date("d-m-Y", s2t($event->happening_t));
$event_url = urlencode($event->get_url());
$date_content = <<<EOF
{$happening}<br/>
<br/>
<a href="{$event_url}" title="Add to Calendar" class="addthisevent">
    {{Add to Calendar}}
    <span class="_start">{$happening_t} 00:00:00</span>
    <span class="_end">{$happening_t} 23:59:59</span>
    <span class="_zonecode">40</span>
    <span class="_summary">{$event->title}</span>
    <span class="_description">{{More informations at}} {$event_url}</span>
    <span class="_location">{$event->location()}</span>
    <span class="_organizer">{$event->organizer_name}</span>
    <span class="_all_day_event">true</span>
    <span class="_date_format">DD/MM/YYYY</span>