<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/guest/models/GuestSmail.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/guest/models/GuestConst.php'; $guestSmail = new GuestSmail(); $data = array('email' => '*****@*****.**', 'type' => GuestConst::TYPE_VACANCY); $user = null; $code = 'jkndfvkbxnfvkxn'; $sent = $guestSmail->sendActivation($data['email'], $code, $user, $data['type']); print_r($sent); exit;
/** * Создание персонального заказа */ public function actionPersonalOrder() { $login = __paramInit('string', 'user', 'user', NULL); $freelancer = new freelancer(); $freelancer->GetUser($login); if ($freelancer->uid <= 0) { $this->missingAction(NULL); } $subform = new GuestNewOrderForm(); $subform->freelancer = $freelancer; $form = new NewDataForm($subform); if (isset($_POST) && sizeof($_POST) > 0 && $form->isValid($_POST)) { $userValidator = $form->getElement('email')->getValidator('NoUserExists'); $user = $userValidator->getUser(); $data = $form->getValues(); $data['user_id'] = $user->uid; $data['type'] = GuestConst::TYPE_PERSONAL_ORDER; $data['dataForm']['frl_id'] = intval($freelancer->uid); $code = GuestActivationModel::model()->newActivation($data); if ($code) { $guestSmail = new GuestSmail(); $guestSmail->sendActivation($data['email'], $code, $user, $data['type']); require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/Helpers/PopupAfterPageLoaded.php"; PopupAfterPageLoaded::getInstance()->showAfterLoad(GuestConst::getMessage($user->uid > 0 ? GuestConst::MSG_AL_EXIST : GuestConst::MSG_AL, $data['type'])); $ref_uri = empty($_SESSION['ref_uri']) ? sprintf('/users/%s/', $freelancer->login) : urldecode($_SESSION['ref_uri']); $this->redirect($ref_uri); } } //Выводим в сайдбар виджет индикатор статуса заказа require_once $_SERVER['DOCUMENT_ROOT'] . '/tu/widgets/OrderStatusIndicator.php'; $this->getClips()->add('sidebar', $this->widget('OrderStatusIndicator', array(), TRUE)); $this->render('index', array('title' => 'Новый заказ', 'form' => $form->render())); }