function __construct() { //Create a new PHPMailer instance $mail = new PHPMailer(); //Tell PHPMailer to use SMTP $mail->isSMTP(); //Set the hostname of the mail server $mail->Host = FConfig::getValue('email_smtp_url'); //Whether to use SMTP authentication $mail->SMTPAuth = true; //Username to use for SMTP authentication - use full email address for gmail $mail->Username = FConfig::getValue('email_smtp_user'); //Password to use for SMTP authentication $mail->Password = FConfig::getValue('email_smtp_pass'); //Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission $mail->Port = FConfig::getValue('email_smtp_port'); //Set the encryption system to use - ssl (deprecated) or tls $mail->SMTPSecure = 'tls'; // Set encoding $mail->CharSet = 'UTF-8'; // Set email format to HTML $mail->isHTML(true); //Set who the message is to be sent from $mail->setFrom(FConfig::getValue('email_sender_email'), FConfig::getValue('email_sender_name')); $this->phpMailer = $mail; }
/** * Call this method to get singleton * * @return FAnalytics */ public static function getInstance() { static $inst = null; if ($inst === null) { $inst = new Analytics(FConfig::getValue('trackingID'), FConfig::getValue('analytics_site_url')); } return $inst; }
public static function checkAvailableReferral($userId) { $sql = "SELECT id FROM " . self::REFERRALS_TABLE . " WHERE referring_user = "******" AND exchange_date IS NULL AND exchanged = false LIMIT " . FConfig::getValue('creditsByAlbum'); $availableReferrals = mysql_query($sql); $qty = mysql_num_rows($availableReferrals); if ($qty == FConfig::getValue('creditsByAlbum')) { $ids = array(); while ($referral = mysql_fetch_object($availableReferrals)) { $ids[] = $referral->id; } return $ids; } else { return false; } }
<!-- END MENSAJES DE IMAGEN --> <!-- CONTENIDO DEL PERFIL --> <div class="content-container"> <div class="content"> <?php if ($user_info['act'] == User::USER_STATUS_ACTIVE) { if (file_exists('views/include/' . $current_tab . '.php')) { include 'views/include/' . $current_tab . '.php'; } else { die('redirect home here'); } } else { die('redirect home here'); } ?> </div> </div> <!-- CONTENIDO DE PERFIL --> <!-- CROP PROFILE --> <?php include_once 'perfiles/cropProfile.php'; ?> <script src="<?php echo FConfig::getUrl('js/perfil.js'); ?> "></script> <!-- END CROP PROFILE -->
function getUserInfo($id) { $usr_info = mysql_fetch_object(listAll("user", "WHERE id = '{$id}'")); $descripcion = getUserData($id, "2"); $user_img = getUserData($id, "1"); $direccion = getUserData($id, "3"); $ciudad = getUserData($id, "10"); $cp = getUserData($id, "4"); $pais = getUserData($id, "5"); $telefono = getUserData($id, "6"); $movil = getUserData($id, "7"); $exp = getUserData($id, "14"); $cam = getUserData($id, "11"); $lentes = getUserData($id, "12"); $equip = getUserData($id, "13"); $cover = getUserData($id, "16"); $user_pago = getUserData($id, "17"); $escuelaFotografia = getUserData($id, "18"); $masEducacion = getUserData($id, "19"); $experienciaLaboral = getRecentUserData($id, "20"); $idiomas = getUserData($id, "22"); $habilidades = getUserData($id, "21"); $rut = getUserData($id, "23"); if ($usr_info->gender == "H") { $gender = "Hombre"; } else { $gender = "Mujer"; } $paisf = listAll("paises", "WHERE iso = '{$pais->description}'"); $rs_paisf = mysql_fetch_object($paisf); $user['id'] = $usr_info->id; $user['user_type'] = $usr_info->user_type; $user['email'] = $usr_info->user; $user['new_email'] = $usr_info->new_email; $user['new_email_code'] = $usr_info->new_email_code; $user['descripcion'] = $descripcion->description; $user['user_img'] = $user_img->description; $user["name"] = $usr_info->name; $user['lastname'] = $usr_info->lastname; $user['dob'] = DateHelper::getLongDate($usr_info->dob); $user['user_dob'] = DateHelper::getShortDate($usr_info->dob, 'd/m/Y'); $user['sex'] = $gender; $user['act'] = $usr_info->act; $dob = explode("-", $usr_info->dob); $user['ano'] = $dob[0]; $user['mes'] = $dob[1]; $user['dia'] = $dob[2]; $user['direccion'] = $direccion->description; $user['ciudad'] = $ciudad->description; $user['cp'] = $cp->description; $user['pais'] = utf8_encode($rs_paisf->nombre); $user['pais_ab'] = utf8_encode($rs_paisf->iso); $user['telefono'] = $telefono->description; $user['movil'] = $movil->description; $user['exp'] = $exp->description; $user['escuela-fotografia'] = $escuelaFotografia->description; $user['mas-educacion'] = $masEducacion->description; $user['experiencia-laboral'] = json_decode($experienciaLaboral->description); $user['idiomas'] = json_decode($idiomas->description); $user['habilidades'] = json_decode($habilidades->description); $user['rut'] = $rut->description; $user['cam'] = json_decode($cam->description); $user['lentes'] = json_decode($lentes->description); $user['equip'] = json_decode($equip->description); $user["act_code"] = $usr_info->act_code; $user["profile_completed"] = $usr_info->profile_completed; $user["wizard_completed"] = $usr_info->wizard_completed; $user["wizard_contact_creative_completed"] = $usr_info->wizard_contact_creative_completed; $user['user_cover'] = $cover->description; $user['user_pago'] = $user_pago->description; $user['full_name'] = ucwords($user["name"] . " " . $user['lastname']); //TODO make it an external function //TODO set a default image if file does not exists if (file_exists(FConfig::getBasePath() . "/profiles/" . sha1($usr_info->id) . "/profile.jpg")) { $user['profile_image_url'] = "profiles/" . sha1($usr_info->id) . "/profile.jpg"; } else { if ($user['user_type'] == User::USER_TYPE_PHOTOGRAPHER) { $user['profile_image_url'] = "images/profile_default_photographer.jpg"; } else { $user['profile_image_url'] = "images/profile_default_client.jpg"; } } if (file_exists(FConfig::getBasePath() . "/profiles/" . sha1($usr_info->id) . "/cover.jpg")) { $user['cover_image_url'] = "profiles/" . sha1($usr_info->id) . "/cover.jpg"; } else { $user['cover_image_url'] = "images/cover_default.jpg"; } return $user; }
<?php /** * Created by PhpStorm. * User: Jose Troconis * Date: 3/30/14 * Time: 11:28 PM */ use Fototea\Config\FConfig; ?> <div class="footer-container"> <div class="footer"> <a href="home"><img class="footer-logo" alt="Fototea" src="<?php echo FConfig::getUrl('images/logo_fototea.png'); ?> " title="Fototea"></a> <ul class="footer-links"> <li><a href="contratar">Contratar</a></li> <li><a href="trabajar">Trabajar</a></li> <li><a href="registro">Regístrate</a></li> <li><a href="contactanos">Contáctanos</a></li> <li><a href="terminos">Términos y Condiciones</a></li> <li><a href="politicas">Políticas de privacidad</a></li> </ul> <ul> <li class="facebook"><a href="http://www.facebook.com/Fototea" target="_blank"></a></li> <li class="twitter"><a href="http://twitter.com/fototeaweb" target="_blank"></a></li> <li class="instagram"><a href="http://instagram.com/fototeaweb" target="_blank"></a></li> </ul> <br/>
<?php use Fototea\Config\FConfig; ORM::configure('mysql:host=' . FConfig::getValue('db_hostname') . ';dbname=' . FConfig::getValue('db_name')); ORM::configure('username', FConfig::getValue('db_user')); ORM::configure('password', FConfig::getValue('db_password')); ORM::configure('logging', FConfig::getValue('db_query_log')); //Date and locale function
} else { $isReferred = false; } // Create user $user = $app->getModel('User')->create($user_name, $user_lastname, $user_email, $user_pass, $user_type); if (isset($user->id)) { // Initialize user detail UserDetail::init($user->id, $user->user_type); $to = $user_email; $toName = $user_name . ' ' . $user_lastname; $confirmUrl = FConfig::getUrl('confirmacion') . '?c=' . $user->act_code; if ($isReferred) { $confirmUrl .= '&ru=' . $ru . '&rm=' . $rm; } $asunto = "Confirmación de registro"; $params = array('site_url' => FConfig::getUrl(), 'logo_url' => FConfig::getUrl('images/logo_footer.png'), 'nombre' => $toName, 'confirmacion_url' => $confirmUrl); $body = FMailer::replaceParameters($params, file_get_contents('../views/emails/registroEmail.html')); $mailer = new FMailer(); $receivers = array(array('email' => $to, 'name' => $toName)); $mailer->setReceivers($receivers); $mailer->sendEmail($asunto, $body); // Event: Creación de perfil $events = FAnalytics::getInstance(); if ($user_type == User::USER_TYPE_PHOTOGRAPHER) { $events->trackEvent('Usuario - Creaciones de perfil', 'Creación de fotógrafo', $user->id); } elseif ($user_type == User::USER_TYPE_CLIENT) { $events->trackEvent('Usuario - Creaciones de perfil', 'Creación de cliente', $user->id); } if ($isReferred) { if ($user_type == User::USER_TYPE_PHOTOGRAPHER) { $events->trackEvent('Referidos - Creaciones de perfil', 'Creación de fotógrafo referido desde ' . $rm, $ru);
// // } // // } // // header("location:../subirImagen?a=".$_REQUEST['album']); // // } if ($act == "addFoto") { $file = $_FILES['file']; if ($file['size'] > 0) { $albumId = $_REQUEST['album']; // Validar cantidad maxima de fotos $fotos = listAll("albumes_det", "WHERE ad_a_id = '" . $albumId . "' AND ad_status='S'"); $rows_fotos = mysql_num_rows($fotos); if ($rows_fotos >= FConfig::getValue('maxFilesByAlbum')) { return "error"; } $fileNameComplete = $file['name']; $fileNameArray = explode(".", $fileNameComplete); $fileName = $fileNameArray[0]; $extension = end($fileNameArray); // if (file_exists($pathFile)){ // return 'error'; // } $user = getCurrentUser(); $perfilSha1 = sha1($user->id); $albumSha1 = sha1($albumId); updateTable("albumes", "a_status = 'S'", "a_id = '" . $albumId . "'"); $photo_id = insertTable("albumes_det", "'','" . $albumId . "','" . $fileNameComplete . "','" . $user->id . "','','S',NOW(),0"); $fileNameUnique = $fileName . "_" . $photo_id . "." . $extension;
} /* Set the preview image */ crop.displayConfirm = function(imgUrl) { jQuery(crop.previewImageId).attr('src', imgUrl); }; /* Set the cropped image as the final image (final step) */ crop.confirmImage = function(callback) { //ajax request to move the final image //json to decide to close de modal //TODO LOADING HERE jQuery.getJSON('<?php echo FConfig::getUrl('actions/perfilAction.php?act=confirmImage&type='); ?> ' + crop.imageType, null, function(data){ if (data.status == "success") { /* reload image */ crop.reloadTargetImage(data.img_url); callback() //TODO CLOSE MODAL HERE USING A CALLBACK } else { alert(data.message); } }); }; crop.uploadLoading = function(message) { if ((message != undefined) && (message != '')) {
<?php use Fototea\Config\FConfig; use Fototea\Util\FMailer; require '../vendor/autoload.php'; include_once '../scripts/libSM.php'; $user_email = $_REQUEST['user']; $act_code = $_REQUEST['act-code']; //action recover password if ($_REQUEST['act'] == "recuperar") { $rs_user = mysql_fetch_object(listAll("user", "WHERE user = '******'")); $to = $rs_user->user; $toName = $rs_user->name . ' ' . $rs_user->lastname; $asunto = "Recuperar contraseña"; $params = array('site_url' => FConfig::getUrl(), 'logo_url' => FConfig::getUrl('images/logo_footer.png'), 'nombre' => $toName, 'recuperar_url' => FConfig::getUrl('reinicia-contrasena') . '?c=' . $rs_user->act_code); $body = FMailer::replaceParameters($params, file_get_contents('../views/emails/recuperarContrasenaEmail.html')); $mailer = new FMailer(); $receivers = array(array('email' => $to, 'name' => $toName)); $mailer->setReceivers($receivers); $mailer->sendEmail($asunto, $body); $arreglo[] = array('resp' => "Se ha enviado la información"); echo json_encode($arreglo); } //action rest password if ($_REQUEST['act'] == "reset") { $pass = sha1($_REQUEST['pass']); $rs_user2 = mysql_fetch_object(listAll("user", "WHERE act_code = '{$act_code}'")); $salt = $rs_user2->salt; $newPass = sha1($salt . $pass); updateTable("user", "password = '******'", "act_code = '{$act_code}'"); $arreglo[] = array('resp' => "Se ha enviado la información");
</div> <div class="col-xs-12 list-container"> <div class="list-content"> <?php foreach ($comments as $rs_com) { ?> <div class="list-item"> <div class="col-xs-1"> <a href="perfil?us=<?php echo $rs_com->user['act_code']; ?> "> <img alt="<?php echo $rs_com->user['full_name']; ?> " src="<?php echo FConfig::getThumbUrl($rs_com->user['profile_image_url'], 60, 60); ?> " width="60" height="60" border="0" class="img-circle"></a> </div> <div class="col-xs-2"> <p><a href="perfil?us=<?php echo $rs_com->user['act_code']; ?> " class=" fontW400"><?php echo $rs_com->user['full_name']; ?> </a> <br><?php echo $rs_com->reviewO['stars']; ?> <!-- <br><span class="font12">--><?php
<!-- <div class="col-xs-3 debug">1</div>--> <!-- <div class="col-xs-3 debug">2</div>--> <!-- <div class="col-xs-3 debug">3</div>--> <!-- <div class="col-xs-3 debug">4</div>--> <!-- </div>--> </div> <script type="text/javascript"> // Eliminar album function deleteAlbum(album){ var conf = confirm("¿Está seguro que desea eliminar el álbum?"); if(conf == true){ window.location = '<?php echo FConfig::getUrl(); ?> actions/albumAction.php?a=' + album + '&act=deleteAlbum'; } } /* The androb way */ (function(jQuery){ jQuery('.trigger-share').colorbox({ inline:true, href:'#referrals_modal', width:'50%', onOpen: function(){ jQuery('#referrals_modal').show(); }, onClosed: function() {
$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); } }
}); // Eliminar album function deleteAlbum(){ var conf = confirm("¿Está seguro que desea eliminar el álbum?"); if(conf == true){ document.getElementById('deleteAlbumForm').submit(); } } function checkAddAble(){ var currentQtyFiles = jQuery('.dropzone .dz-preview.dz-image-preview').length; if (currentQtyFiles < <?php echo FConfig::getValue('maxFilesByAlbum'); ?> ){ myDropzone.enable(); jQuery('.dropzone .dz-message').show(); } else { myDropzone.disable(); jQuery('.dropzone .dz-message').hide(); } } jQuery(document).ready(function(){ // Fill license field var license="<?php echo $rs_album->a_license; ?>
public static function getRealAvailableCredits($userId, $qtyAlbums) { if ($userId == null || $qtyAlbums === null) { return false; } $originalCredit = self::getOriginalCredit($userId); $creditAvailable = max(0, FConfig::getValue('defaultAlbumsByPhotographer') + $originalCredit - $qtyAlbums); return $creditAvailable; }
$comision = $rs_oferta->bid * 0.15; //enviar correo al administrador notificandole los datos de transferencia del fotografo. $to = "*****@*****.**"; //$to = "*****@*****.**"; $asunto = "Nuevo pago recibido"; $params = array('site_url' => FConfig::getUrl(), 'logo_url' => FConfig::getUrl('images/logo_footer.png'), 'project_title' => $rs_proyecto->pro_tit, 'project_user_name' => $user_pro['name'] . ' ' . $user_pro['lastname'], 'amount' => number_format($rs_oferta->bid, 2, ',', '.'), 'comission' => number_format($comision, 2, ',', '.'), 'total' => number_format($monto, 2, ',', '.'), 'transaction_id' => $txn_id, 'oferta_username' => $user_oferta['name'] . ' ' . $user_oferta['lastname'], 'user_paypal' => $user_oferta['user_pago'], 'user_phone' => $user_oferta['telefono'] . ' / ' . $user_oferta['movil'], 'user_email' => $user_oferta['email'], 'amount_to_transfer' => number_format($rs_oferta->bid, 2, ',', '.')); $body = FMailer::replaceParameters($params, file_get_contents('../views/emails/nuevoPagoRecibidoEmail.html')); $mailer = new FMailer(); $receivers = array(array('email' => $to)); $mailer->setReceivers($receivers); $mailer->sendEmail($asunto, $body); //enviar correo de confirmacion al cliente que realizao el pago. $to = $user_pro['email']; $asunto = "Tu pago se ha realizado con éxito"; $params = array('site_url' => FConfig::getUrl(), 'logo_url' => FConfig::getUrl('images/logo_footer.png'), 'user_name' => $user_pro['name'] . ' ' . $user_pro['lastname'], 'project_title' => $rs_proyecto->pro_tit, 'oferta_username' => $user_oferta['name'] . ' ' . $user_oferta['lastname'], 'amount' => number_format($rs_oferta->bid, 2, ',', '.'), 'comission' => number_format($comision, 2, ',', '.'), 'total' => number_format($monto, 2, ',', '.'), 'transaction_id' => $txn_id); $body = FMailer::replaceParameters($params, file_get_contents('../views/emails/pagoRealizadoExitoEmail.html')); $mailer = new FMailer(); $receivers = array(array('email' => $to)); $mailer->setReceivers($receivers); $mailer->sendEmail($asunto, $body); //enviar correo de notificacion al fotografo de procesamiento de pago. $not_user = insertTable("notificaciones", "'','{$user_oferta['id']}','Has recibido un pago por el proyecto " . $rs_proyecto->pro_tit . "','cuentaEstado',NOW(),'N'"); $to = $user_oferta['email']; $asunto = "Hemos recibido un pago para ti!"; $params = array('site_url' => FConfig::getUrl(), 'logo_url' => FConfig::getUrl('images/logo_footer.png'), 'user_name' => $user_oferta['name'] . ' ' . $user_oferta['lastname'], 'project_title' => $rs_proyecto->pro_tit, 'project_username' => $user_pro['name'] . ' ' . $user_pro['lastname'], 'amount' => number_format($rs_oferta->bid, 2, ',', '.')); $body = FMailer::replaceParameters($params, file_get_contents('../views/emails/recibidoPagoEmail.html')); $mailer = new FMailer(); $receivers = array(array('email' => $to)); $mailer->setReceivers($receivers); $mailer->sendEmail($asunto, $body); }
public static function getUserProfilePath($userId) { return FConfig::getBasePath('/profiles/' . sha1($userId) . "/"); }
</div> <?php } ?> <?php } else { ?> <div class="list-item empty"> <h3>No se encontraron proyectos</h3> <?php if ($filter == 'activos') { ?> <p>Publica un proyecto ahora en fototea y contrata a los mejores fotógrafos</p> <p> <a class="btn btn-primary" href="<?php echo FConfig::getUrl('agregarProyecto'); ?> ">Publicar un proyecto</a> </p> <?php } ?> </div> <?php } ?> </div> </div> </div> <!-- TODO feo feo --> <script type="text/javascript">
$fileUrl = $baseProfileUrl . $fileName; // $cropWidth = min(ceil($tmpImageWidth * 0.7), ceil($tmpImageHeight * 0.7)); // $cropHeight = ceil($cropWidth / $aspectRatio); // // $x1Crop = 0; // $y1Crop = 0; // $x2Crop = $cropWidth; // $y2Crop = $cropHeight; //75,336,775,528 //Center it //Save as jpeg $resultSave = ImageHelper::saveImageAsJPG($file['tmp_name'], $file['type'], $filePath); //error_get_last() if ($resultSave) { $response->status = 'success'; $response->img_url = FConfig::getUrl($fileUrl, true); $response->width = $tmpImageWidth; $response->height = $tmpImageHeight; } else { $response->status = 'error'; $response->message = "crop image could not be created"; } echo json_encode($response); die; } /** * Mark wizard completed to the current user after the first login in the site */ if ($action == 'wizardCompleted') { $actCode = $_REQUEST['act-code']; $result = mysql_query("UPDATE user SET wizard_completed = true WHERE act_code = '" . $actCode . "'");
public static function getUserInfo($id, $fields = array()) { $usr_info = ORM::for_table(self::$table)->find_one($id); if ($usr_info == null) { return false; } $user = array(); //User table fields $user['id'] = $usr_info->id; $user['user_type'] = $usr_info->user_type; $user['email'] = $usr_info->user; $user['new_email'] = $usr_info->new_email; $user['new_email_code'] = $usr_info->new_email_code; $user["name"] = $usr_info->name; $user['lastname'] = $usr_info->lastname; $user['user_dob'] = DateHelper::getShortDate($usr_info->dob, 'd/m/Y'); $user['act'] = $usr_info->act; $user["act_code"] = $usr_info->act_code; $user["profile_completed"] = $usr_info->profile_completed; $user["wizard_completed"] = $usr_info->wizard_completed; $user["wizard_contact_creative_completed"] = $usr_info->wizard_contact_creative_completed; $user['full_name'] = ucwords($user["name"] . " " . $user['lastname']); //Gender if ($usr_info->gender == "H") { $gender = "Hombre"; } else { $gender = "Mujer"; } $user['sex'] = $gender; // $user['dob']= DateHelper::getLongDate($usr_info->dob); //Process only desired fields if (in_array('*', $fields) || in_array('descripcion', $fields)) { $descripcion = self::getUserData($id, "2"); $user['descripcion'] = $descripcion->description; } if (in_array('*', $fields) || in_array('user_img', $fields)) { $user_img = self::getUserData($id, "1"); $user['user_img'] = $user_img->description; } if (in_array('*', $fields) || in_array('direccion', $fields)) { $direccion = self::getUserData($id, "3"); $user['direccion'] = $direccion->description; } if (in_array('*', $fields) || in_array('ciudad', $fields)) { $ciudad = self::getUserData($id, "10"); $user['ciudad'] = $ciudad->description; } if (in_array('*', $fields) || in_array('cp', $fields)) { $cp = self::getUserData($id, "4"); $user['cp'] = $cp->description; } if (in_array('*', $fields) || in_array('pais', $fields)) { $pais = self::getUserData($id, "5"); $rs_paisf = Country::loadCountriesByIso($pais->description); $user['pais'] = utf8_encode($rs_paisf->nombre); $user['pais_ab'] = utf8_encode($rs_paisf->iso); } if (in_array('*', $fields) || in_array('telefono', $fields)) { $telefono = self::getUserData($id, "6"); $user['telefono'] = $telefono->description; } if (in_array('*', $fields) || in_array('movil', $fields)) { $movil = self::getUserData($id, "7"); $user['movil'] = $movil->description; } //Todocheck if in use // if (in_array('*', $fields) || in_array('exp', $fields)) { // $exp = self::getUserData($id, "14"); // $user['exp'] = $exp->description; // } if (in_array('*', $fields) || in_array('cam', $fields)) { $cam = self::getUserData($id, "11"); $user['cam'] = json_decode($cam->description); } if (in_array('*', $fields) || in_array('rut', $fields)) { $rut = self::getUserData($id, "23"); $user['rut'] = $rut->description; } if (in_array('*', $fields) || in_array('lentes', $fields)) { $lentes = self::getUserData($id, "12"); $user['lentes'] = json_decode($lentes->description); } if (in_array('*', $fields) || in_array('', $fields)) { $equip = self::getUserData($id, "13"); $user['equip'] = json_decode($equip->description); } //Deprecated // if (in_array('*', $fields) || in_array('user_cover', $fields)) { // $cover = self::getUserData($id, "16"); // $user['user_cover'] = $cover->description; // } //TODO Used for paypal account, check if needed if (in_array('*', $fields) || in_array('user_pago', $fields)) { $user_pago = self::getUserData($id, "17"); $user['user_pago'] = $user_pago->description; } if (in_array('*', $fields) || in_array('escuela-fotografia', $fields)) { $escuelaFotografia = self::getUserData($id, "18"); $user['escuela-fotografia'] = $escuelaFotografia->description; } if (in_array('*', $fields) || in_array('mas-educacion', $fields)) { $masEducacion = self::getUserData($id, "19"); $user['mas-educacion'] = $masEducacion->description; } if (in_array('*', $fields) || in_array('experiencia-laboral', $fields)) { $experienciaLaboral = self::getRecentUserData($id, "20"); $user['experiencia-laboral'] = json_decode($experienciaLaboral->description); } if (in_array('*', $fields) || in_array('idiomas', $fields)) { $idiomas = self::getUserData($id, "22"); $user['idiomas'] = json_decode($idiomas->description); } if (in_array('*', $fields) || in_array('habilidades', $fields)) { $habilidades = self::getUserData($id, "21"); $user['habilidades'] = json_decode($habilidades->description); } //Cover and profile image fields if (file_exists(FConfig::getBasePath() . "/profiles/" . sha1($usr_info->id) . "/profile.jpg")) { $user['profile_image_url'] = "profiles/" . sha1($usr_info->id) . "/profile.jpg"; } else { if ($user['user_type'] == User::USER_TYPE_PHOTOGRAPHER) { $user['profile_image_url'] = "images/profile_default_photographer.jpg"; } else { $user['profile_image_url'] = "images/profile_default_client.jpg"; } } if (file_exists(FConfig::getBasePath() . "/profiles/" . sha1($usr_info->id) . "/cover.jpg")) { $user['cover_image_url'] = "profiles/" . sha1($usr_info->id) . "/cover.jpg"; } else { $user['cover_image_url'] = "images/cover_default.jpg"; } return $user; }
<?php use Fototea\Config\FConfig; use Fototea\Util\FMailer; require '../vendor/autoload.php'; $name = $_REQUEST['name']; $mensaje = $_REQUEST['mensaje']; $email = $_REQUEST['email']; $asunto = $_REQUEST['asunto']; $params = array('site_url' => FConfig::getUrl(), 'logo_url' => FConfig::getUrl('images/logo_footer.png'), 'nombre' => $name, 'email' => $email, 'asunto' => $asunto, 'mensaje' => $mensaje); $body = FMailer::replaceParameters($params, file_get_contents('../views/emails/contactoEmail.html')); $mailer = new FMailer(); $receivers = array(array('email' => FConfig::getValue('contacto_email'), 'name' => FConfig::getValue('contacto_name'))); $mailer->setReceivers($receivers); $mailer->sendEmail($asunto, $body); $arreglo[] = array('resp' => "Se ha enviado la información"); echo json_encode($arreglo);
$user_name = utf8_decode($data['first_name']); $user_lastname = utf8_decode($data['last_name']); $user_gender = $gender; $user_email = $data['email']; $user_pass = sha1($data['password']); $user_dob = $bday[2] . "-" . $bday[0] . "-" . $bday[1]; $user_type = $data['user_type']; $user_salt = salt(); // TODO: ESTA FUNCION SE MIGRO AL MODELO DE USER $user_act = "N"; $user_act_code = StringHelper::generateRandomString(); $passEnc = sha1($user_salt . $user_pass); $reg = listAll("user", "WHERE user = '******'"); $reg_num = mysql_num_rows($reg); if ($reg_num < 1) { $user_insert = insertTable("user", "'','{$user_name}','{$user_lastname}','{$user_dob}','{$user_gender}','{$user_email}','{$passEnc}','{$user_salt}','{$user_type}',NOW(),'0000-00-00 00:00:00','{$user_act}','{$user_act_code}', false, false"); if ($user_insert > 0) { $to = $user_email; $toName = $user_name . ' ' . $user_lastname; $asunto = "Confirmación de registro"; $params = array('site_url' => FConfig::getUrl(), 'logo_url' => FConfig::getUrl('images/logo_footer.png'), 'nombre' => $toName, 'confirmacion_url' => FConfig::getUrl('confirmacion') . '?c=' . $user_act_code . '&e=' . $user_email); $body = FMailer::replaceParameters($params, file_get_contents('../views/emails/registroEmail.html')); $mailer = new FMailer(); $receivers = array(array('email' => $to, 'name' => $toName)); $mailer->setReceivers($receivers); $mailer->sendEmail($asunto, $body); header("location:../confirmacionRegistro"); } } else { header("location:../confirmacionRegistro?e=error"); }
?> </ul> <!-- TODO limit here --> </div> <?php } ?> </div> <!-- End Notificaciones --> </li> <li> <span class="link-separator">|</span> </li> <li> <a href="<?php echo FConfig::getUrl('signOut'); ?> ">Salir</a> </li> </ul> <!-- Init Notification form--> <div class="notification-form" style="display: none;"> <form id="notification-form" class="notification-form" method="post" action="actions/perfilAction.php"> <input type="hidden" name="act" value="notificationAct"> <input type="hidden" name="id"> <input type="hidden" name="url"> </form> </div> <!-- End Notification form--> </div> <?php
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); }
$to = $us_pro['email']; $asunto = "Has recibido un comentario en una oferta"; $mailCont = '</strong> ha comentado en su 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_pro['id'], 'Has recibido un mensaje de ' . $completeName, Notification::TYPE_COMMENT, json_encode($notificationData)); } else { 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");
}, addLink: function(elem, msg){ msg += '<a class="wizard-step-link" onclick="jQuery(\''+ elem.selector +'\').popModal(\'hide\')">Entendido</a>'; return msg; }, wizardCompleted: function(){ jQuery('.profile-edit-options').removeClass('visible'); jQuery('.profile-image-options').removeClass('visible'); jQuery.ajax({ type: 'get', dataType: 'json', url: "<?php echo FConfig::getUrl('actions/perfilAction.php?act=wizardCompleted&act-code='); ?> ", data: {'act-code':'<?php echo $loggedUser->act_code; ?> ', act:"wizardCompleted"}, success: function(json){ if (json.status == 'success'){ console.log('success'); } else { console.log('error'); } } }); },