public static function emailProjectOwner($offer, $winner, $project, $projectOwner) { // Enviar correo a cliente $asunto = "Has adjudicado un proyecto. ¡Buen Trabajo!"; $params = array('site_url' => UrlHelper::getUrl(), 'logo_url' => UrlHelper::getUrl('images/logo_footer.png'), 'check_url' => UrlHelper::getUrl('images/check_green.gif'), 'client_name' => $projectOwner['full_name'], 'oferta_winner' => $offer->bid, 'proyecto_titulo' => $project->pro_tit, 'projecto_date' => DateHelper::getShortDate($project->pro_date), 'proyecto_url' => UrlHelper::getProjectUrl($project->pro_id), 'photograph_name' => $winner['full_name'], 'photograph_email' => $winner['email'], 'photograph_phone' => $winner['movil'], 'photograph_location' => $winner['ciudad'] . ', ' . $winner['direccion']); $mailer = new FMailer(); $body = $mailer->replaceParameters($params, file_get_contents(UrlHelper::getBasePath() . '/views/emails/adjudicarProyectosClienteEmail.html')); $receivers = array(array('email' => $projectOwner['email'])); $mailer->setReceivers($receivers); $mailer->setBCC(array(array('email' => FConfig::getValue('contacto_email')))); $mailer->sendEmail($asunto, $body); }
if ($_COOKIE['id'] == $rs_user_pro->user_id) { $completeName = $us_pro['full_name']; $to = $us_of['email']; $asunto = "Has recibido un comentario en una de tus ofertas"; $mailCont = '</strong> ha comentado en tu oferta, en el proyecto "<span style="color:#cc6600; font-weight:bold;">' . $rs_user_pro->pro_tit . '</span>". Para ver el comentario haz click <a href="' . FConfig::getUrl('proyecto') . '?id=' . $rs_user_pro->pro_id . '" target="_blank">aquí</a>.'; $not_user = Notification::create($us_of['id'], 'Has recibido un mensaje de ' . $completeName, Notification::TYPE_COMMENT, json_encode($notificationData)); } } //End notification $sender_us = getUserInfo($_COOKIE['id']); $params = array('site_url' => FConfig::getUrl('site_url'), 'logo_url' => FConfig::getUrl('images/logo_footer.png'), 'user_name' => $completeName, 'comment_name' => $sender_us['name'] . ' ' . $sender_us['lastname'], 'content' => $mailCont); $body = FMailer::replaceParameters($params, file_get_contents('../views/emails/comentarioOfertaEmail.html')); $mailer = new FMailer(); $receivers = array(array('email' => $to)); $mailer->setReceivers($receivers); $mailer->sendEmail($asunto, $body); $arreglo[] = array('resp' => "Se ha enviado la información"); echo json_encode($arreglo); } if ($act == "validarPago") { $pro_id = $_REQUEST['pro_id']; $oferta_id = $_REQUEST['oferta_id']; $oferta = listAll("pro_transactions", "WHERE t_oferta_id = '{$oferta_id}' AND t_pro_id = '{$pro_id}' AND t_status = 'L'"); $row = mysql_num_rows($oferta); if ($row > 0) { $arreglo[] = array('resp' => "true"); } else { $arreglo[] = array('resp' => "false"); } echo json_encode($arreglo); }
$user_id = $_COOKIE['id']; updateTable("mensajes_status", "ms_status='B'", "ms_m_id='{$m_id}' AND ms_user_id = '{$user_id}'"); $arreglo[] = array('resp' => "Se ha enviado la información"); echo json_encode($arreglo); } if ($act == "replayMensaje") { $m_id = $_REQUEST['m_id']; $from = $_REQUEST['m_from']; $to = $_REQUEST['m_to']; $txt = preg_replace("/\n/", "<br/>", $_REQUEST['mensaje']); //marcar como nuevo updateTable("mensajes_status", "ms_status='N'", "ms_m_id='{$m_id}' AND ms_user_id = '{$to}'"); //guardar mensaje insertTable("mensajes_det", "'','{$m_id}','{$to}','{$from}','{$txt}',NOW()"); $user = listAll("user", "WHERE id = '{$to}'"); $rs_mensaje = mysql_fetch_object($user); $to_m = $rs_mensaje->user; $toName = $rs_mensaje->name . ' ' . $rs_mensaje->lastname; $userFrom = listAll("user", "WHERE id = '{$from}'"); $rs_from = mysql_fetch_object($userFrom); $asunto = "Mensaje privado!"; $params = array('site_url' => FConfig::getUrl(), 'logo_url' => FConfig::getUrl('images/logo_footer.png'), 'nombre' => $toName, 'from_name' => $rs_from->name . ' ' . $rs_from->lastname); $body = FMailer::replaceParameters($params, file_get_contents('../views/emails/mensajeEmail.html')); $mailer = new FMailer(); $receivers = array(array('email' => $to_m, 'name' => $toName)); $mailer->setReceivers($receivers); $mailer->sendEmail($asunto, $text); $arreglo[] = array('resp' => "Se ha enviado la información"); echo json_encode($arreglo); } }