Esempio n. 1
0
 public function send_mail($key)
 {
     ##发送邮件
     $activity = new Activity();
     $activity->set_activity($this->get_order_data('activity_id'));
     $user = User::instance();
     $user->set_user_data($activity->get_activity_data('user_id'));
     $activity_name = $activity->get_activity_data('name');
     $email = new Email($activity_name[$this->get_lang()]);
     $mail_data = array();
     $mail_data['contact_name'] = $this->get_order_data('contact_name');
     $mail_data['order_serial'] = $this->get_order_data('order_serial');
     $mail_data['certificate_number'] = $this->get_certificate_number();
     $company_name = json_decode($this->get_order_data('company_name'), true);
     $mail_data['company_name'] = $company_name[$this->get_order_data('language')];
     $order_url = 'http://' . $_SERVER['SERVER_NAME'] . '/?p=charge&activity=' . $activity->get_activity_data('activity_id') . '&order=' . $this->get_order_id() . '&lang=' . $this->get_lang() . '&certificate=' . $this->generate_url_code();
     //返回网站网址
     $res_url = array('zh' => "http://www.chatchina.com.cn/category/registration/?rel=", 'en' => 'http://en.chatchina.com.cn/category/registration/?rel=');
     $mail_data['order_url'] = $res_url[$this->get_order_data('language')] . urlencode($order_url);
     switch ($key) {
         //发送联系人
         case 'order_create_notify':
             $email->send_template_mail($activity->get_activity_data($key), $mail_data, $this->get_order_data('contact_email'));
             break;
             //发送联系人
         //发送联系人
         case 'order_wait_approve_notify':
             $email->send_template_mail($activity->get_activity_data($key), $mail_data, $this->get_order_data('contact_email'));
             break;
             //发送主办方
         //发送主办方
         case 'host_approve_notify':
             $email->send_template_mail($activity->get_activity_data($key), $mail_data, $user->get_user_data('email'));
             break;
             //发送联系人
         //发送联系人
         case 'order_approved_notify':
             $email->send_template_mail($activity->get_activity_data($key), $mail_data, $this->get_order_data('contact_email'));
             break;
             //发送联系人
         //发送联系人
         case 'order_success_notify_contact':
             $email->send_template_mail($activity->get_activity_data($key), $mail_data, $this->get_order_data('contact_email'));
             break;
             //发送参会者
         //发送参会者
         case 'order_success_notify_attendee':
             foreach ($this->attendees as $atd) {
                 $name = $atd->get_attendee_data('name');
                 $name = json_decode($name, true);
                 $name['en'] = json_decode($name['en'], true);
                 $mail_data['name_zh'] = $name['zh'];
                 $mail_data['name_en_firstname'] = $name['en']['firstname'];
                 $mail_data['name_en_lastname'] = $name['en']['lastname'];
                 $email->send_template_mail($activity->get_activity_data($key), $mail_data, $atd->get_attendee_data('email'));
             }
             break;
             //发送主办方
         //发送主办方
         case 'order_success_notify_host':
             $email->send_template_mail($activity->get_activity_data($key), $mail_data, $user->get_user_data('email'));
             break;
         default:
             break;
     }
 }
Esempio n. 2
0
<?php

session_start();
$activity = new Activity();
$activity->set_activity(1);
$_SESSION['activity'] = $activity;
$user = User::instance();
$login_ret = $user->login(array('username' => 'horwathhtl', 'password' => 'horwathhtl'));
if ($login_ret['r'] == 'ok') {
    $user = $login_ret['msg'];
    $_SESSION['manage_user'] = $user;
}
if (!isset($_SESSION['activity']) || !isset($_SESSION['manage_user'])) {
    die("page error.");
}
$activity = $_SESSION['activity'];
$activity_id = $activity->get_activity_data('activity_id');
$user = $_SESSION['user'];
Esempio n. 3
0
<?php

session_start();
$lang = isset($_GET['lang']) && $_GET['lang'] == 'en' ? $_GET['lang'] : 'zh';
$channel = isset($_GET['channel']) && $_GET['channel'] != '' ? $_GET['channel'] : 'usual';
$view_data['lang'] = $lang;
$view_data['channel'] = $channel;
if (!isset($_GET['activity'])) {
    die('Page error.');
}
if (!isset($booking_activity)) {
    $activity_id = $_GET['activity'];
    $view_data['activity_id'] = $activity_id;
    global $booking_activity;
    $booking_activity = new Activity();
    $booking_activity->set_activity($activity_id);
}
include_once "order_form_text.php";
Esempio n. 4
0
<?php

/*
 * payment_receive.php
 *
 * 接收支付消息
 *
 * @author lidongxu @2014-5-29
 */
if (isset($_GET['activity']) && isset($_POST)) {
    $activity = new Activity();
    $activity->set_activity($_GET['activity']);
    $activity->get_payment()->receive_result($_POST);
}