本文整理汇总了PHP中Event::get_from_id方法的典型用法代码示例。如果您正苦于以下问题:PHP Event::get_from_id方法的具体用法?PHP Event::get_from_id怎么用?PHP Event::get_from_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Event
的用法示例。
在下文中一共展示了Event::get_from_id方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: send
public function send()
{
debug("Action Send");
$this->set_status(ADVERTISEMENT_STATUS_SENT);
$event = Event::get_from_id($this->get_field("event_id")->value);
foreach ($event->get_guests() as $guest) {
$task = new Task();
$task->hydrate();
$task->id = create_id();
$task->set_value("start_t", time());
$task->set_value("description", "");
$task->set_value("command", "mail_advertisement");
$task->set_value("parameters", $event->id . "," . $guest->get_value("email") . "," . $this->id);
$task->set_value("status", TASK_STATUS_PENDING);
$task->set_value("error_msg", "");
$task->set_value("event_id", $_SESSION["event_id"]);
$task->store();
}
}
示例2: get_description
public function get_description()
{
$event_id = $this->get_bill()->event_id;
$event = Event::get_from_id($event_id);
$result = <<<EOF
({$event_id})
<a href="?action=retrieve&type=event&id={$event_id}">{$this->event_name}</a><br/>
{{Ticket}}: {$this->event_rate_name}
EOF;
if ($event->type == EVENT_TYPE_NOMINATIVE) {
$result .= <<<EOF
{{Attendee:}} {$this->attendee_title} {$this->attendee_firstname} {$this->attendee_lastname}
EOF;
} else {
$result .= <<<EOF
{{Unit Price}}: {$this->event_rate_amount}<br/>
EOF;
}
return $result;
}
示例3: get_event
public function get_event()
{
return Event::get_from_id($this->event_id);
}
示例4:
<?php
$event = Event::get_from_id($_SESSION["event_id"]);
?>
<a href="?action=retrieve&type=event&id=<?php
echo $_SESSION["event_id"];
?>
">Event title: <?php
echo $event->title;
?>
</a>
<br/><br/>
<div class="evt_sidebar">
<ul>
<li><a href="?action=promote_event&id=<?php
echo $event->id;
?>
">{{Help}}</a></li>
<li><a href="?action=manage&type=guest">Manage guests</a></li>
<li><a href="?action=manage&type=advertisement">Manage advertisements</a></li>
<li><a href="?action=manage&type=task">Manage tasks</a></li>
<li><a href="?action=run_tasks">Run tasks</a></li>
</ul>
</div>
示例5: list_all
public static function list_all($user_id = NULL)
{
global $g_pdo;
$events = array();
$where_clause = "";
if ($user_id != NULL) {
$where_clause = "WHERE `id_user`= :id";
}
if (!is_admin_logged()) {
if ($where_clause == "") {
$where_clause = "WHERE `status`!=" . EVENT_STATUS_INACTIVATED;
} else {
$where_clause .= " AND `status`!=" . EVENT_STATUS_INACTIVATED;
}
}
$request = <<<EOF
SELECT `id` FROM `event` {$where_clause} ORDER BY `happening_t`
EOF;
debug($request);
$pst = $g_pdo->prepare($request);
if ($user_id != NULL) {
$pst->execute(array(":id" => $user_id));
} else {
$pst->execute();
}
$event_record = $pst->fetch();
while (isset($event_record["id"])) {
$event = Event::get_from_id($event_record["id"]);
$events[] = $event;
$event_record = $pst->fetch();
}
return $events;
}
示例6: header
<?php
header("Content-Type: text/plain");
define("BASE_DIR", dirname(dirname(__FILE__)));
require_once BASE_DIR . "/include/constants.inc";
require_once BASE_DIR . "/include/globals.inc";
require_once BASE_DIR . "/include/misc.inc";
$result = array();
$result['sent_data'] = $_GET;
$event = Event::get_from_id($_GET['event_id']);
$discount = $event->get_discount($_GET['code'], time());
$result['is_valid'] = false;
if ($discount != null) {
$result['is_valid'] = true;
$result['discount'] = $discount;
}
echo json_encode($discount);
示例7: import
public static function import()
{
$event = Event::get_from_id($_SESSION["event_id"]);
$file = Form::get_file("guest_filename");
$guest_array = file($file, FILE_IGNORE_NEW_LINES);
debug('guest_array: ' . sprint_r($guest_array));
foreach ($guest_array as $line) {
if (!Guest::valid_line($line)) {
continue;
}
$guest = new Guest();
$guest->hydrate();
$guest->set_value("email", $line);
$guest->store();
$guest->link_to_event($event->id);
}
}
示例8: get_remaining
public function get_remaining()
{
global $g_pdo;
$event = Event::get_from_id($this->event_id);
if ($event->is_cancelled()) {
return 0;
}
$type = BILL_TYPE_QUOTATION;
if ($event->is_confirmed()) {
$type = BILL_TYPE_INVOICE;
}
$result = $this->max_quantity;
$request = <<<EOF
SELECT
SUM(quantity)
FROM
item i,
item_ticket it,
bill b
WHERE
i.id_bill = b.id
AND it.obj_id = i.id
AND b.type = :type
AND it.id_ticket = :id
EOF;
debug($request);
$q = $g_pdo->prepare($request);
$array = array(":type" => $type, ":id" => $this->id);
$q->execute($array);
$record = $q->fetch();
$count = $record[0];
$result = $result - $count;
return $result;
}
示例9: define
<?php
define("BASE_DIR", dirname(dirname(__FILE__)));
require_once BASE_DIR . "/include/constants.inc";
require_once BASE_DIR . "/include/globals.inc";
require_once BASE_DIR . "/include/misc.inc";
require_once BASE_DIR . "/include/deal.inc";
$event = Event::get_from_id(100022);
$report = deal_generate_report($event);
?>
<html>
<head>
<meta charset="utf-8"/>
<style>
table {
border-collapse: collapse;
border: 1px solid black;
}
td, th {
padding: 5px;
border: 1px solid black;
}
</style>
</head>
<body>
<table>
<tr>
<th>Ticket name</th>
<th>Ticket price</th>
<th>Total invoice</th>