Example #1
0
 public static function getUserNotifications($userId, $includeRead = false)
 {
     $list = ORM::for_table(self::$table)->select('*');
     $list->where('user_id', $userId);
     if ($includeRead == false) {
         $list->where('leido', self::STATUS_UNREAD);
     }
     $list = $list->find_many();
     foreach ($list as $item) {
         $item->smart_url = UrlHelper::getNotificationUrl($item->type, $item->data);
     }
     return $list;
 }
Example #2
0
, <?php 
    echo utf8_encode($rs_proN->pro_country_name);
    ?>
                </div>
                <div class="col-xs-1 text-center">
                    <?php 
    echo DateHelper::getHoursLeft($rs_proN->pro_date_end);
    ?>
                </div>
                <div class="col-xs-1">

                    <?php 
    if (!isset($offers[$rs_proN->pro_id])) {
        ?>
                        <a class="btn btn-primary" href="<?php 
        echo UrlHelper::getProjectUrl($rs_proN->pro_id);
        ?>
">Oferta ya</a>
                    <?php 
    } else {
        ?>
                        <!-- TODO kill font18, fontW400, txtNaranja -->
                        <div class="alignCenter">Tu oferta <br><span class="font18 fontW400 txtNaranja">$ <?php 
        echo $offers[$rs_proN->pro_id]->bid;
        ?>
</span></div>
                    <?php 
    }
    ?>
                </div>
            </div>
Example #3
0
 }
 // New email confirmation
 if ($action == 'new_email_confirmation') {
     $actCode = $app->getRequest()->get('act_code');
     $newEmailCode = $app->getRequest()->get('new_email_code');
     $user = User::getUserToConfirmNewEmail($actCode, $newEmailCode);
     if (!$user) {
         $app->addError("Ha ocurrido un error intentando confirmar un cambio de correo electrónico.");
     } else {
         $user->user = $user->new_email;
         $user->new_email = null;
         $user->new_email_code = null;
         $user->save();
         $app->addMessage("Tu correo electrónico ha sido cambiado exitosamente. Tu nueva cuenta de correo electrónico es <b>" . $user->user . "</b>");
     }
     $app->redirect(UrlHelper::getUrl('editarPerfil'));
     return;
 }
 //marcar notificaciones como leidas
 if ($action == "notificationAct") {
     $id = intval($_REQUEST['id']);
     //Update nice version
     //        $notificacion = \ORM::for_table('notificaciones')->find_one($id);
     //        $notificacion->set('leido', 'S');
     //        $notificacion->save();
     //Update old version
     updateTable("notificaciones", "leido='S'", "id = {$id}");
     $redirectUrl = $_REQUEST['url'];
     //        $redirectUrl = FConfig::getUrl($redirectUrl);
     header('Location: ' . $redirectUrl);
     die;
Example #4
0
/**
 * Created by PhpStorm.
 * User: Jose Troconis
 * Date: 6/13/14
 * Time: 1:44 AM
 */
use Fototea\Util\UrlHelper;
$file = 'pagoerror.txt';
$content = "-----------------------------------------------------------------------------------------";
$content .= "\nGET\n";
$content .= json_encode($_GET);
$content .= "\n\nPOST\n";
$content .= json_encode($_POST);
$content .= "\n\n";
//file_put_contents($file, $content, FILE_APPEND);
?>

<div class="content-container">
    <div class="content form-page" id="metodo-pago-container">
        <h2>Lo sentimos, su pago no ha podido ser procesado</h2>
        <form action="actions/paymentAction.php" method="post" id="metodo-pago-form" class="metodo-pago-form">
            <p>Lamentable su pago no ha podido ser procesado, si desea mas información contactenos a traves de la sección
            de contacto o intente nuevamente</p>

            <p><a href="<?php 
echo UrlHelper::getProfileUrl();
?>
">Volver a mi perfil</a></p>
</form>
</div>
</div>
Example #5
0
}
?>
        </div>
        <!-- END TABS -->
    </div>

    <?php 
if ($same_user) {
    ?>
        <?php 
    if ($current_user->user_type == User::USER_TYPE_PHOTOGRAPHER) {
        ?>
            <div class="user-balance-options">
                <span class="arrow-left"></span>
                <a class="show-my-balance" href="<?php 
        echo UrlHelper::getUrl('perfil?act=finanzas');
        ?>
"><span class="balance-amount">$ <?php 
        echo number_format($user_balance, 2, ",", ".");
        ?>
</span> por cobrar</a>
            </div>
        <?php 
    }
    ?>

        <?php 
    if ($current_user->user_type == User::USER_TYPE_CLIENT) {
        ?>
            <div class="user-balance-options">
                <span class="arrow-left"></span>
Example #6
0
 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);
 }
Example #7
0
                                <?php 
            if ($rs_proj->pro_status == Project::PROJECT_STATUS_DRAFT) {
                ?>
                                    <a class="btn btn-primary" href="agregarProyecto?id=<?php 
                echo $rs_proj->pro_id;
                ?>
">Editar proyecto</a>
                                <?php 
            }
            ?>

                                <?php 
            if (Project::canBeQualified($rs_proj, $currentUser)) {
                ?>
                                    <a class="btn btn-primary" href="<?php 
                echo UrlHelper::getUrl("proyectoFinalizar?id=" . $rs_proj->pro_id);
                ?>
">Calificar proyecto</a>
                                <?php 
            }
            ?>
                            </div>
                        </div>
                    <?php 
        }
        ?>
                <?php 
    } else {
        ?>
                    <div class="list-item empty">
                        <h3>No se encontraron proyectos</h3>
Example #8
0
//file_put_contents($file, $content, FILE_APPEND);
$token = $app->getRequest()->get('token');
$paymentMethod = new PaymentManager($app, PuntoPagos::PAYMENT_METHOD_TYPE);
$paymentMethod->loadByGatewayId($token);
if ($paymentMethod->getStatus() === Payment::PAYMENT_STATUS_APPROVED) {
    $products = OrderProduct::getProductsByOrderId($paymentMethod->getOrderId());
    if (empty($products)) {
        //TODO correo aqui
        //TODO log
        $processResult = 99;
    }
    foreach ($products as $product) {
        //Aplicar cambios segun cada producto
        if ($product->id == Product::PRODUCT_ADJUDICAR_ID) {
            $productData = json_decode($product->data);
            $msg = 'El proyecto ha sido adjudicado de forma exitosa. <a href="' . UrlHelper::getProjectUrl($productData->project_id) . '">Ir al proyecto</a>';
        }
    }
}
?>

<div class="content-container">
    <div class="content form-page" id="metodo-pago-container">

        <h2>Confirmación del pago</h2>
        <form action="actions/paymentAction.php" method="post" id="metodo-pago-form" class="metodo-pago-form">
            <p><b>¡Hemos recibido tu pago!</b></p>

            <p>Mas instrucciones aqui</p>

            <p><?php 
Example #9
0
$album_condition = "WHERE a_user_id = '" . $user_info['id'] . "'";
//}
$album = listAll("albumes", $album_condition);
$albums = array();
while ($rs_album = mysql_fetch_object($album)) {
    $fotos = listAll("albumes_det", "WHERE ad_a_id = '{$rs_album->a_id}'AND ad_status = 'S' ORDER BY ad_is_principal, ad_id");
    $rs_album->fotos = array();
    $rs_album->base_url = 'profiles/' . sha1($user_info['id']) . "/" . sha1($rs_album->a_id) . "/";
    $rs_album->total_fotos = 0;
    while ($rs_foto = mysql_fetch_object($fotos)) {
        //Prepare urls
        $rs_foto->base_url = $rs_album->base_url . $rs_foto->ad_url;
        //TODO fix magic numbers here
        $rs_foto->full_size_url = FConfig::getThumbUrl($rs_foto->base_url, 1440, 900);
        $rs_foto->album_cover_thumb = UrlHelper::getAlbumThumbUrl($rs_foto->base_url, 440, 300, true);
        $rs_foto->album_thumb = UrlHelper::getAlbumThumbUrl($rs_foto->base_url, 223, 150, true);
        if ($rs_foto->ad_is_principal) {
            $rs_album->principal = $rs_foto;
        } else {
            $rs_album->fotos[] = $rs_foto;
        }
        $rs_album->total_fotos++;
    }
    //Si no hay principal , coloco a la primera
    if ($rs_album->principal == null) {
        $rs_album->principal = array_shift($rs_album->fotos);
    }
    $albums[] = $rs_album;
}
// Check available credit
$creditAvailable = Credit::getRealAvailableCredits($currentUser->id, count($albums));
Example #10
0
<?php

use Fototea\Models\User;
use Fototea\Util\UrlHelper;
$session = validaSession();
if ($session == true) {
    $userInfo = getUserInfo($_COOKIE['id']);
    if ($userType == User::USER_TYPE_PHOTOGRAPHER) {
        include_once 'perfiles/editarFotografo.php';
    } elseif ($userType == User::USER_TYPE_CLIENT) {
        include_once 'perfiles/editarCliente.php';
    }
} else {
    $app->redirect(UrlHelper::getUrl('home'));
}
?>

<script type="text/javascript">
    function cancelNewEmail(userId){
        jQuery.ajax({
            type: 'get',
            dataType: 'json',
            url: 'actions/perfilAction.php',
            data: { user_id: userId ,act:"cancel_new_email"},
            success: function(response){
                if (response.status == 'success'){
                    jQuery('.new-email-alert').remove();
                }
            }
        });
    }
Example #11
0
             <?php 
if ($currentUser->id == $rs_pro->user_id) {
    // si el usuario actual es dueño del proyecto
    ?>
                 <?php 
    if ($rs_pro->oferta_adjudicada_id) {
        // si el proyecto ha sido adjudicado
        ?>
                     <div class="col-xs-6">
                         <h3>Adjudicaste este proyecto a:</h3>
                         <hr/>
                         <h4>Creativo:</h4>
                         <p>
                             <a href="<?php 
        echo UrlHelper::getProfileUrl($winnerOfferOwner['act_code']);
        ?>
"><?php 
        echo $winnerOfferOwner['full_name'];
        ?>
</a>
                         </p>

                         <?php 
        if ($winnerOfferOwner['email']) {
            ?>
                             <h4>Correo electr&oacute;nico:</h4>
                             <p>
                                 <?php 
            echo $winnerOfferOwner['email'];
            ?>