Exemple #1
0
<?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);
Exemple #2
0
        ?>
                                        </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 
Exemple #3
0
     $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 . "'");
Exemple #4
0
        }

        /* 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 != '')) {
Exemple #5
0
 /**
  * Get full url to path
  *
  * @param null $path
  * @param bool $refreshCache
  * @return string
  */
 public static function getUrl($path = null, $refreshCache = false)
 {
     return FConfig::getUrl($path, $refreshCache);
 }
Exemple #6
0
<?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");
Exemple #7
0
            },

            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');
                        }
                    }
                });
            },
Exemple #8
0
    myDropzone.on("complete", function (file) {
        if (this.getUploadingFiles().length === 0 && this.getQueuedFiles().length === 0) {
            jQuery('.dropzone .dz-message').hide();
            checkAddAble();
            location.reload();
        }
    });

    jQuery('.dz-principal').click(function(){
        var elem = jQuery(this);
        var album = elem.attr('dz-principal-album');
        var photo = elem.attr('dz-principal-photo');

        var url = '<?php 
echo FConfig::getUrl('actions/albumAction.php?act=principalFoto');
?>
';
        url += '&album=' + album + '&ad_id=' + photo;

        jQuery.ajax({
            url: url,
            success: function(result) {
                refreshPrincipal(photo);
            },
            error: function(result) {
                console.log('Error deleting file');
            }
        });
    });
Exemple #9
0
                        </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">
Exemple #10
0
$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");
}
Exemple #11
0
<!-- 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 -->

Exemple #12
0
<!--        <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() {
Exemple #13
0
        $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);
    }
}
Exemple #14
0
} 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);
Exemple #15
0
<?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&aacute;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/>
Exemple #16
0
        $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");
Exemple #17
0
    $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);
}