当前位置: 首页>>代码示例>>PHP>>正文


PHP Event::get_from_id方法代码示例

本文整理汇总了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();
     }
 }
开发者ID:centaurustech,项目名称:truc,代码行数:19,代码来源:Advertisement.class.php

示例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&amp;type=event&amp;id={$event_id}">{$this->event_name}</a><br/>
{{Ticket}}: {$this->event_rate_name}&nbsp;&nbsp;&nbsp;
EOF;
        if ($event->type == EVENT_TYPE_NOMINATIVE) {
            $result .= <<<EOF
{{Attendee:}} {$this->attendee_title}&nbsp;{$this->attendee_firstname}&nbsp;{$this->attendee_lastname}
EOF;
        } else {
            $result .= <<<EOF
{{Unit Price}}: {$this->event_rate_amount}<br/>
EOF;
        }
        return $result;
    }
开发者ID:centaurustech,项目名称:truc,代码行数:20,代码来源:ItemTicket.class.php

示例3: get_event

 public function get_event()
 {
     return Event::get_from_id($this->event_id);
 }
开发者ID:centaurustech,项目名称:truc,代码行数:4,代码来源:Bill.class.php

示例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&amp;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>
开发者ID:centaurustech,项目名称:truc,代码行数:24,代码来源:sidebar_promote.php

示例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;
    }
开发者ID:centaurustech,项目名称:truc,代码行数:33,代码来源:Event.class.php

示例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);
开发者ID:centaurustech,项目名称:truc,代码行数:17,代码来源:check_discount_code.php

示例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);
     }
 }
开发者ID:centaurustech,项目名称:truc,代码行数:17,代码来源:Guest.class.php

示例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;
    }
开发者ID:centaurustech,项目名称:truc,代码行数:34,代码来源:Ticket.class.php

示例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>
开发者ID:centaurustech,项目名称:truc,代码行数:31,代码来源:recap_payement.php


注:本文中的Event::get_from_id方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。