Exemple #1
0
 function display($tpl = null)
 {
     $app = JFactory::getApplication();
     $layout = $app->input->get('layout', 'inbox', 'string');
     $model = $this->getModel();
     $user = JFactory::getUser();
     JblanceHelper::isAuthenticated($user->id, $layout);
     if ($layout == 'inbox') {
         $return = $model->getInbox();
         $msgs = $return[0];
         $out_msgs = $return[1];
         $newMsg = $return[2];
         $newOutMsg = $return[3];
         $this->assignRef('msgs', $msgs);
         $this->assignRef('out_msgs', $out_msgs);
         $this->assignRef('newMsg', $newMsg);
         $this->assignRef('newOutMsg', $newOutMsg);
     }
     if ($layout == 'read') {
         $return = $model->getMessageRead();
         $parent = $return[0];
         $rows = $return[1];
         $this->assignRef('parent', $parent);
         $this->assignRef('rows', $rows);
     }
     if ($layout == 'compose') {
         /* $return = $model->getMessageRead();
         			$parent = $return[0];
         			$rows = $return[1];
         			
         			$this->assignRef('parent', $parent);
         			$this->assignRef('rows', $rows); */
     }
     parent::display($tpl);
 }
Exemple #2
0
 public static function getLatestProjects($total_row, $limit_title)
 {
     $db = JFactory::getDbo();
     $user = JFactory::getUser();
     $now = JFactory::getDate();
     $query = "SELECT p.*,(TO_DAYS(p.start_date) - TO_DAYS(NOW())) AS daydiff FROM #__jblance_project p " . "WHERE p.status=" . $db->quote('COM_JBLANCE_OPEN') . " AND p.approved=1  AND " . $db->quote($now) . " > p.start_date " . "ORDER BY p.is_featured DESC, p.id DESC " . "LIMIT 0," . (int) $total_row;
     $db->setQuery($query);
     $db->execute();
     $total = $db->getNumRows();
     $db->setQuery($query);
     $rows2 = $db->loadObjectList();
     $rows = null;
     if (count($rows2)) {
         $i = 0;
         foreach ($rows2 as $row) {
             $rows[$i] = new stdClass();
             $row->project_title = self::limitTitle($row->project_title, $limit_title);
             $rows[$i] = $row;
             $rows[$i]->categories = JblanceHelper::getCategoryNames($row->id_category);
             $rows[$i]->bids = self::countBids($row->id);
             $i++;
         }
     }
     return $rows;
 }
Exemple #3
0
/**
 * @param	array	A named array
 * @return	array
 */
function JblanceBuildRoute(&$query)
{
    $segments = array();
    $db = JFactory::getDbo();
    $task = null;
    //$segments[0] would either be view or task only. Both are not set at once.
    if (isset($query['view'])) {
        $segments[] = $query['view'];
        unset($query['view']);
    } else {
        if (isset($query['task'])) {
            $segments[] = $query['task'];
            $task = $query['task'];
            unset($query['task']);
        }
    }
    $layout = '';
    //$segments[1] would be layout
    if (isset($query['layout'])) {
        $segments[] = $query['layout'];
        $layout = $query['layout'];
        unset($query['layout']);
    }
    //$segments[2] would be id
    if (isset($query['id'])) {
        $id = $query['id'];
        $q = null;
        switch ($layout) {
            case 'detailproject':
            case 'editproject':
            case 'placebid':
            case 'pickuser':
            case 'inviteuser':
                $q = "SELECT project_title FROM #__jblance_project WHERE id=" . $db->quote($id);
                break;
            case 'viewprofile':
                $q = "SELECT username FROM #__users WHERE id=" . $db->quote($id);
                break;
            case 'viewservice':
            case 'editservice':
                $q = "SELECT service_title from #__jblance_service where id=" . $db->quote($id);
                break;
        }
        if (!empty($q)) {
            $db->setQuery($q);
            $title = $db->loadResult();
            if (!empty($title)) {
                $title = JblanceHelper::parseTitle($title);
                $segments[] = !empty($title) ? $id . '-' . $title : $id;
            } else {
                $segments[] = $query['id'];
            }
        } else {
            $segments[] = $query['id'];
        }
        unset($query['id']);
    }
    return $segments;
}
Exemple #4
0
 public static function getListJobCateg()
 {
     $select = JblanceHelper::get('helper.select');
     // create an instance of the class selectHelper
     $attribs = "class='form-control'";
     $lists = $select->getSelectCategoryTree('id_categ', 0, 'MOD_JBLANCE_SEARCH_ALL', $attribs, '', true);
     return $lists;
 }
Exemple #5
0
 public static function getFeeds($total_row, $show_unread)
 {
     if ($show_unread) {
         $rows = JblanceHelper::getFeeds($total_row, 'notify');
     } else {
         $rows = JblanceHelper::getFeeds($total_row);
     }
     return $rows;
 }
Exemple #6
0
 function display($tpl = null)
 {
     $app = JFactory::getApplication();
     $layout = $app->input->get('layout', 'myservice', 'string');
     $model = $this->getModel();
     $user = JFactory::getUser();
     JblanceHelper::isAuthenticated($user->id, $layout);
     if ($layout == 'myservice') {
         $return = $model->getMyService();
         $rows = $return[0];
         $pageNav = $return[1];
         $this->assignRef('rows', $rows);
         $this->assignRef('pageNav', $pageNav);
     } elseif ($layout == 'listservice') {
         $return = $model->getListService();
         $rows = $return[0];
         $pageNav = $return[1];
         $this->assignRef('rows', $rows);
         $this->assignRef('pageNav', $pageNav);
     } elseif ($layout == 'servicebought') {
         $return = $model->getServiceBought();
         $rows = $return[0];
         $pageNav = $return[1];
         $this->assignRef('rows', $rows);
         $this->assignRef('pageNav', $pageNav);
     } elseif ($layout == 'serviceprogress') {
         $return = $model->getServiceProgress();
         $row = $return[0];
         $messages = $return[1];
         $this->assignRef('row', $row);
         $this->assignRef('messages', $messages);
     } elseif ($layout == 'servicesold') {
         $return = $model->getServiceSold();
         $rows = $return[0];
         $pageNav = $return[1];
         $this->assignRef('rows', $rows);
         $this->assignRef('pageNav', $pageNav);
     } elseif ($layout == 'editservice') {
         $return = $model->getEditService();
         $row = $return[0];
         $this->assignRef('row', $row);
     } elseif ($layout == 'viewservice') {
         $return = $model->getViewService();
         $row = $return[0];
         $ratings = $return[1];
         $this->assignRef('row', $row);
         $this->assignRef('ratings', $ratings);
     } elseif ($layout == 'rateservice') {
         $return = $model->getRateService();
         $row = $return[0];
         $this->assignRef('row', $row);
     }
     parent::display($tpl);
 }
Exemple #7
0
 function getSelectReportCategory()
 {
     $config = JblanceHelper::getConfig();
     $categories = $config->reportCategory;
     $values = explode(";", $categories);
     $put[] = JHtml::_('select.option', '', '- ' . JText::_('COM_JBLANCE_PLEASE_SELECT') . ' -');
     foreach ($values as $value) {
         if ($value) {
             $put[] = JHtml::_('select.option', $value, JText::_($value), 'value', 'text');
         }
     }
     $lists = JHtml::_('select.genericlist', $put, 'category', "class='form-control required' size='1'", 'value', 'text', '');
     return $lists;
 }
 public function load($cid)
 {
     static $instances = array();
     $config = JblanceHelper::getConfig();
     if (!isset($instances[$cid])) {
         JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_jblance/tables');
         $project = JTable::getInstance('Project', 'Table');
         $state = $project->load($cid);
         if (!$state) {
             return $this->onLoadArticleError($cid);
         }
         $instances[$cid] = $project;
     }
     $this->_item = $instances[$cid];
     return $this;
 }
Exemple #9
0
 function display($tpl = null)
 {
     // parameters
     $app = JFactory::getApplication();
     $db = JFactory::getDbo();
     $document = JFactory::getDocument();
     $params = $app->getParams();
     $feedEmail = @$app->get('feed_email') ? $app->get('feed_email') : 'author';
     $siteEmail = $app->get('mailfrom');
     $document->link = JRoute::_('index.php?option=com_jblance&view=project&layout=listproject');
     $now = JFactory::getDate();
     $config = JblanceHelper::getConfig();
     $limit = (int) $config->rssLimit;
     // Get some data from the model
     $app->input->set('limit', $app->get('feed_limit'));
     $rows = $this->get('Items');
     $query = "SELECT p.*,(TO_DAYS(p.start_date) - TO_DAYS(NOW())) AS daydiff FROM #__jblance_project p " . "WHERE p.status=" . $db->quote('COM_JBLANCE_OPEN') . " AND p.approved=1 AND p.start_date < " . $db->quote($now) . " " . "ORDER BY p.is_featured DESC, p.id DESC " . "LIMIT " . $limit;
     $db->setQuery($query);
     $rows = $db->loadObjectList();
     foreach ($rows as $row) {
         // strip html from feed item title
         $title = $this->escape($row->project_title);
         $title = html_entity_decode($title, ENT_COMPAT, 'UTF-8');
         // url link to article
         $link = JRoute::_('index.php?option=com_jblance&view=project&layout=detailproject&id=' . $row->id);
         // strip html from feed item description text
         $description = strip_tags($row->description);
         //get the publisher info
         $publisherInfo = JFactory::getUser($row->publisher_userid);
         $author = $publisherInfo->username;
         // load individual item creator class
         $item = new JFeedItem();
         $item->title = $title;
         $item->link = $link;
         $item->description = $description;
         $item->date = $row->start_date;
         $item->category = JblanceHelper::getCategoryNames($row->id_category);
         $item->author = $author;
         if ($feedEmail == 'site') {
             $item->authorEmail = $siteEmail;
         } else {
             $item->authorEmail = $row->author_email;
         }
         // loads item info into rss array
         $document->addItem($item);
     }
 }
Exemple #10
0
 function getUserGroupField($userid = null)
 {
     $app = JFactory::getApplication();
     $db = JFactory::getDbo();
     $session = JFactory::getSession();
     $ugid = $session->get('ugid', 0, 'register');
     //user group id during the registration
     if (empty($ugid)) {
         if (empty($userid)) {
             // get the current userid if not passed
             $user = JFactory::getUser();
             $userid = $user->id;
         }
         $jbuser = JblanceHelper::get('helper.user');
         $ugroup = $jbuser->getUserGroupInfo($userid, null);
         $ugid = $ugroup->id;
     }
     $jbfields = JblanceHelper::get('helper.fields');
     // create an instance of the class FieldsHelper
     $fields = $jbfields->getUserGroupTypeFields($ugid);
     return $fields;
 }
Exemple #11
0
/**
 * @company		:	BriTech Solutions
 * @created by	:	JoomBri Team
 * @contact		:	www.joombri.in, support@joombri.in
 * @created on	:	29 March 2012
 * @file name	:	modules/mod_jblancesearch/tmpl/default.php
 * @copyright   :	Copyright (C) 2012 - 2015 BriTech Solutions. All rights reserved.
 * @license     :	GNU General Public License version 2 or later
 * @author      :	Faisel
 * @description	: 	Entry point for the component (jblance)
 */
// no direct access
defined('_JEXEC') or die('Restricted access');
$document = JFactory::getDocument();
$direction = $document->getDirection();
$config = JblanceHelper::getConfig();
if ($config->loadBootstrap) {
    JHtml::_('bootstrap.loadCss', true, $direction);
}
$document->addStyleSheet("modules/mod_jblancesearch/css/style.css");
$currencysym = $config->currencySymbol;
$set_Itemid = intval($params->get('set_itemid', 0));
$Itemid = $set_Itemid > 0 ? '&Itemid=' . $set_Itemid : '';
$sh_category = $params->get('category', 1);
$sh_status = $params->get('status', 1);
$sh_budget = $params->get('budget', 1);
//check of all other three fields are hidden
$isOnlyKeywords = false;
if ($sh_category == 0 && $sh_status == 0 && $sh_budget == 0) {
    $isOnlyKeywords = true;
}
Exemple #12
0
            ?>
                            </h5>
                            <p><?php 
            echo $bid->details ? $bid->details : JText::_('COM_JBLANCE_DETAILS_NOT_PROVIDED');
            ?>
</p>
                            <?php 
            $rate = JblanceHelper::getAvarageRate($bid->user_id, true);
            ?>

                        </div>

                        <div class="col-sm-4 col-md-4">
                            <div class="text-center">
                                <span class="font20"><?php 
            echo JblanceHelper::formatCurrency($bid->amount, true, false, 0);
            ?>
</span><?php 
            echo $row->project_type == 'COM_JBLANCE_HOURLY' ? ' / ' . JText::_('COM_JBLANCE_HR') : '';
            ?>
<br>
                                <span class="font12">
                                    <?php 
            if ($row->project_type == 'COM_JBLANCE_FIXED') {
                ?>
                                        <?php 
                echo $bid->delivery;
                ?>
 <?php 
                echo JText::_('COM_JBLANCE_BID_DAYS');
                ?>
Exemple #13
0
 function updateProgress()
 {
     // Check for request forgeries
     JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
     $app = JFactory::getApplication();
     $post = $app->input->post->getArray();
     //print_r($post);exit;
     $now = JFactory::getDate();
     $order = JTable::getInstance('serviceorder', 'Table');
     $orderId = $app->input->get('id', 0, 'int');
     $status = $app->input->get('p_status', '', 'string');
     $statusInit = $app->input->get('status_initiated', 0, 'boolean');
     if ($statusInit) {
         $status = 'COM_JBLANCE_INITIATED';
     }
     $order->load($orderId);
     $order->p_status = $status;
     $order->p_percent = $post['p_percent'];
     $order->p_updated = $now->toSql();
     //set the started date only for the first time
     if ($status == 'COM_JBLANCE_INITIATED') {
         if ($order->p_started == '0000-00-00 00:00:00') {
             $order->p_started = $now->toSql();
         }
     } elseif ($status == 'COM_JBLANCE_COMPLETED') {
         if ($order->p_ended == '0000-00-00 00:00:00') {
             $order->p_ended = $now->toSql();
         }
     }
     if (!$order->store()) {
         JError::raiseError(500, $order->getError());
     }
     $order->checkin();
     //send service progress notification to buyer
     $jbmail = JblanceHelper::get('helper.email');
     // create an instance of the class EmailHelper
     if (!empty($status)) {
         $jbmail->sendServiceProgressNotification($orderId, $order->service_id);
     }
     $msg = JText::_('COM_JBLANCE_SERVICE_PROGRESS_UPDATED_SUCCESSFULLY');
     $return = JRoute::_('index.php?option=com_jblance&view=service&layout=serviceprogress&id=' . $orderId, false);
     $this->setRedirect($return, $msg, 'message');
 }
Exemple #14
0
    echo $model->getLabelProjectStatus($row->status);
    ?>
          <div class="status">
        <div class="bid_project_left text-center">
          <?php 
    if ($sealProjectBids || $row->is_sealed) {
        ?>
            <span class="label label-info"><?php 
        echo JText::_('COM_JBLANCE_SEALED');
        ?>
</span>
          <?php 
    } else {
        ?>
            <span class="font16 boldfont"><?php 
        echo JblanceHelper::formatCurrency($avg, true, false, 0);
        ?>
</span><?php 
        echo $row->project_type == 'COM_JBLANCE_HOURLY' ? ' / ' . JText::_('COM_JBLANCE_HR') : '';
        ?>
          <?php 
    }
    ?>
        </div>
        <div class="avg"><?php 
    echo JText::_('COM_JBLANCE_AVG_BID');
    ?>
</div>
        </div>
      </div>
    </div>
Exemple #15
0
 * @created on	:	11 September 2012
 * @file name	:	views/user/tmpl/notify.php
 * @copyright   :	Copyright (C) 2012 - 2015 BriTech Solutions. All rights reserved.
 * @license     :	GNU General Public License version 2 or later
 * @author      :	Faisel
 * @description	: 	Email Notification settings (jblance)
 */
defined('_JEXEC') or die('Restricted access');
JHtml::_('jquery.framework');
$doc = JFactory::getDocument();
$doc->addScript("components/com_jblance/js/btngroup.js");
$user = JFactory::getUser();
$model = $this->getModel();
$select = JblanceHelper::get('helper.select');
// create an instance of the class SelectHelper
$jbuser = JblanceHelper::get('helper.user');
$userGroup = $jbuser->getUserGroupInfo($user->id, null);
include_once JPATH_COMPONENT . '/views/profilemenu.php';
?>
<div class="jbl_h3title"><?php 
echo JText::_('COM_JBLANCE_EMAIL_SETTINGS');
?>
</div>
<form id="email-notification-form" action="<?php 
echo JRoute::_('index.php');
?>
" method="post" name="userFormNotify" class="form-validate form-horizontal" enctype="multipart/form-data ">
  
    <div id="email-notification" class="panel panel-default">
  <div class="panel-heading"><h4><i class="material-icons">notifications</i> <?php 
echo JText::_('COM_JBLANCE_RECEIVE_INDIVIDUAL_NOTIFICATIONS_WHEN');
Exemple #16
0
    echo JText::_('COM_JBLANCE_CURRENT_BALANCE');
    ?>
 : <span class="font16 boldfont"><?php 
    echo JblanceHelper::formatCurrency($totalFund);
    ?>
</span>
                                        </div>
                                        <div class="span4">
                                            <?php 
    if ($chargePerProject > 0 && $isNew) {
        ?>
                                                <?php 
        echo JText::_('COM_JBLANCE_CHARGE_PER_PROJECT');
        ?>
 : <span class="font16 boldfont"><?php 
        echo JblanceHelper::formatCurrency($chargePerProject);
        ?>
</span>
                                            <?php 
    }
    ?>
                                        </div>
                                        <div class="span4">
                                            <?php 
    echo JText::_('COM_JBLANCE_TOTAL');
    ?>
 : <span class="font16 boldfont"><?php 
    echo $currencysym;
    ?>
<span id="subtotal">0.00</span></span>
                                        </div>
Exemple #17
0
 public static function getTotalFund()
 {
     $user = JFactory::getUser();
     $total_fund = JblanceHelper::getTotalFund($user->id);
     return $total_fund;
 }
Exemple #18
0
$doc->addScript("components/com_jblance/js/btngroup.js");
$doc->addScript("components/com_jblance/js/autosize.js");
$doc->addStyleSheet("components/com_jblance/css/simplemodal.css");
$app = JFactory::getApplication();
$select = JblanceHelper::get('helper.select');
// create an instance of the class SelectHelper
$config = JblanceHelper::getConfig();
$user = JFactory::getUser();
//get the allowed portfolio for the user's plan
$plan = JblanceHelper::whichPlan($user->id);
$allowedPortfolio = $plan->portfolioCount;
$link_new = JRoute::_('index.php?option=com_jblance&view=user&layout=editportfolio&type=addnew');
$type = $app->input->get('type', '', 'string');
JText::script('COM_JBLANCE_CLOSE');
JText::script('COM_JBLANCE_YES');
JblanceHelper::setJoomBriToken();
?>
<script type="text/javascript">
<!--
    function validateForm(f) {

        //validate the video link
        p = /^(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/;
        var matches = jQuery("#video_link").val().match(p);
        if (jQuery("#video_link").val() != "") {
            if (!matches) {
                alert('<?php 
echo JText::_('COM_JBLANCE_ENTER_VALID_YOUTUBE_URL', true);
?>
');
                return false;
Exemple #19
0
</td></tr>
        <?php 
}
$k = 0;
for ($i = 0, $x = count($this->msgs); $i < $x; $i++) {
    $msg = $this->msgs[$i];
    $userFrom = JFactory::getUser($msg->idFrom);
    $userTo = JFactory::getUser($msg->idTo);
    //if the current user is different, then show that name
    if ($user->id == $msg->idFrom) {
        $userInfo = JFactory::getUser($msg->idTo);
    } else {
        $userInfo = JFactory::getUser($msg->idFrom);
    }
    $link_read = JRoute::_('index.php?option=com_jblance&view=message&layout=read&id=' . $msg->id);
    $newMsg = JblanceHelper::countUnreadMsg($msg->id);
    ?>
        <tr id="jbl_feed_item_<?php 
    echo $msg->id;
    ?>
">
          <td><a href="<?php 
    echo $link_read;
    ?>
"><?php 
    echo $userInfo->{$nameOrUsername};
    ?>
</a></td>
          <td><a href="<?php 
    echo $link_read;
    ?>
Exemple #20
0
      <div class="clearfix"></div>
      <h4><?php 
echo JText::_('COM_JBLANCE_DESCRIPTION');
?>
:</h4>
      <p><?php 
echo nl2br($row->description);
?>
</p>

      <h4><?php 
echo JText::_('COM_JBLANCE_SKILLS');
?>
:</h4>
      <p><?php 
echo JblanceHelper::getCategoryNames($row->id_category);
?>
</p>

      <h4><?php 
echo JText::_('COM_JBLANCE_WEB_ADDRESS');
?>
:</h4>
      <p><?php 
echo !empty($row->link) ? $row->link : '<span class="redfont">' . JText::_('COM_JBLANCE_NOT_MENTIONED') . '</span>';
?>
</p>

      <h4><?php 
echo JText::_('COM_JBLANCE_DURATION');
?>
Exemple #21
0
 function saveWithdrawFund()
 {
     // Check for request forgeries
     JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
     $app = JFactory::getApplication();
     $user = JFactory::getUser();
     $params = $app->input->get('params', null, 'array');
     $post = $app->input->post->getArray();
     $now = JFactory::getDate();
     $row = JTable::getInstance('withdraw', 'Table');
     $config = JblanceHelper::getConfig();
     $invoiceFormatWithdraw = $config->invoiceFormatWithdraw;
     //check if the user has enough fund to withdraw
     $totalFund = JblanceHelper::getTotalFund($user->id);
     if ($totalFund < $post['amount']) {
         $msg = JText::_('COM_JBLANCE_BALANCE_INSUFFICIENT_TO_MAKE_PAYMENT');
         $link = JRoute::_('index.php?option=com_jblance&view=membership&layout=withdrawfund&step=2&gateway=' . $post['gateway'], false);
         $this->setRedirect($link, $msg, 'error');
         return false;
     }
     $row->user_id = $user->id;
     $row->date_withdraw = $now->toSql();
     $row->finalAmount = $post['amount'] - $post['withdrawFee'];
     $registry = new JRegistry();
     $registry->loadArray($params);
     $row->params = $registry->toString();
     unset($post['params']);
     if (!$row->save($post)) {
         JError::raiseError(500, $row->getError());
     }
     $year = date("Y");
     $time = time();
     //replace the tags
     $tags = array("[ID]", "[USERID]", "[YYYY]", "[TIME]");
     $tagsValues = array("{$row->id}", "{$user->id}", "{$year}", "{$time}");
     $invoiceNo = str_replace($tags, $tagsValues, $invoiceFormatWithdraw);
     $row->invoiceNo = $invoiceNo;
     // save the changes after updating the invoice no
     if (!$row->store()) {
         JError::raiseError(500, $row->getError());
     }
     $row->checkin();
     //send withdraw request to admin
     $jbmail = JblanceHelper::get('helper.email');
     // create an instance of the class EmailHelper
     $jbmail->sendWithdrawFundRequest($row->id);
     $msg = JText::_('COM_JBLANCE_WITHDRAWAL_REQUEST_SENT_SUCCESSFULLY');
     $link = JRoute::_('index.php?option=com_jblance&view=membership&layout=managepay', false);
     $this->setRedirect($link, $msg);
     return false;
 }
Exemple #22
0
 function getViewProfile()
 {
     $app = JFactory::getApplication();
     $db = JFactory::getDbo();
     $user = JFactory::getUser();
     $userid = $app->input->get('id', $user->id, 'int');
     //get the user id from 'get' variable; else default is current user id
     $isUserBlocked = JFactory::getUser($userid)->block;
     //redirect the user to dashboard if the user is blocked.
     if ($isUserBlocked == 1) {
         $msg = JText::_('COM_JBLANCE_USER_ACCOUNT_BANNED_VIEWING_PROFILE_NOT_POSSIBLE');
         $link_dash = JRoute::_('index.php?option=com_jblance&view=user&layout=dashboard', false);
         $app->enqueueMessage($msg, 'error');
         $app->redirect($link_dash);
     }
     //redirect to the appropriate extension based on integration
     $profileInteg = JblanceHelper::getProfile();
     if (!$profileInteg instanceof JoombriProfileJoombri) {
         $url = LinkHelper::GetProfileURL($userid, false);
         if ($url) {
             $app->redirect($url);
         }
     }
     $jbuser = JblanceHelper::get('helper.user');
     // create an instance of the class UserHelper
     $userInfo = $jbuser->getUser($userid);
     $jbfields = JblanceHelper::get('helper.fields');
     // create an instance of the class FieldsHelper
     $fields = $jbfields->getUserGroupTypeFields($userInfo->ug_id);
     //freelancer projects
     $query = "SELECT p.*,r.comments FROM #__jblance_project p " . "LEFT JOIN #__jblance_rating r ON r.project_id=p.id " . "WHERE p.assigned_userid =" . $db->quote($userid) . " AND p.status='COM_JBLANCE_CLOSED' AND r.target=" . $db->quote($userid) . " " . "ORDER BY p.id DESC LIMIT 10";
     $db->setQuery($query);
     $fprojects = $db->loadObjectList();
     //freelancer rating
     $query = "SELECT AVG(quality_clarity) quality_clarity,AVG(communicate) communicate,AVG(expertise_payment) expertise_payment, " . "AVG(professional) professional,AVG(hire_work_again) hire_work_again FROM #__jblance_rating " . "WHERE target=" . $db->quote($userid) . " AND quality_clarity<>0 AND rate_type='COM_JBLANCE_FREELANCER'";
     $db->setQuery($query);
     $frating = $db->loadObject();
     //buyer projects
     $query = "SELECT p.*,r.comments FROM #__jblance_project p " . "LEFT JOIN #__jblance_rating r ON r.project_id=p.id " . "WHERE p.publisher_userid =" . $db->quote($userid) . " AND r.target=" . $db->quote($userid) . " " . "ORDER BY p.id DESC LIMIT 10";
     $db->setQuery($query);
     $bprojects = $db->loadObjectList();
     //buyer rating
     $query = "SELECT AVG(quality_clarity) quality_clarity,AVG(communicate) communicate,AVG(expertise_payment) expertise_payment, " . "AVG(professional) professional,AVG(hire_work_again) hire_work_again FROM #__jblance_rating " . "WHERE target=" . $db->quote($userid) . " AND quality_clarity <> 0 AND rate_type='COM_JBLANCE_BUYER'";
     $db->setQuery($query);
     $brating = $db->loadObject();
     $query = "SELECT * FROM #__jblance_portfolio WHERE user_id =" . $db->quote($userid) . " AND published=1";
     $db->setQuery($query);
     $portfolios = $db->loadObjectList();
     $return[0] = $userInfo;
     $return[1] = $fields;
     $return[2] = $fprojects;
     $return[3] = $frating;
     $return[4] = $bprojects;
     $return[5] = $brating;
     $return[6] = $portfolios;
     return $return;
 }
Exemple #23
0
<i class="material-icons">expand_more</i></a>
            </li>
            <div class="collapse" id="collapse1">
                <li class="list-group-item">
                    <a href="<?php 
echo $link_edit_profile;
?>
">
                        <i class="material-icons">mode_edit</i> <?php 
echo JText::_('COM_JBLANCE_EDIT_PROFILE');
?>
 </a>
                </li>
                <li class="list-group-item">
                    <?php 
$avatars = JblanceHelper::getAvatarIntegration();
$link_edit_picture = $avatars->getEditURL();
?>
                    <a href="<?php 
echo $link_edit_picture;
?>
"><i class="material-icons">insert_photo</i> <?php 
echo JText::_('COM_JBLANCE_EDIT_PICTURE');
?>
 </a>
                </li>
                <?php 
if ($this->dbElements['allowAddPortfolio']) {
    ?>
                    <li class="list-group-item">
                        <a href="<?php 
Exemple #24
0
$model = $this->getModel();
$config = JblanceHelper::getConfig();
$jbuser = JblanceHelper::get('helper.user');
// create an instance of the class UserHelper
$userInfo = $jbuser->getUser($this->row->user_id);
$upload_type = empty($userInfo->picture) ? 'NO_UPLOAD_CROP' : 'CROP_ONLY';
JblanceHelper::setJoomBriToken();
?>
<script type="text/javascript">
<!--
  jQuery(document).ready(function ($) {
    JoomBri.uploadCropPicture('user.uploadpicture', '<?php 
echo JblanceHelper::getLogoUrl($this->row->user_id, "");
?>
', '<?php 
echo JblanceHelper::getLogoUrl($this->row->user_id, "original");
?>
');
  });
//-->
</script>
<?php 
include_once JPATH_COMPONENT . '/views/profilemenu.php';
?>
<form action="<?php 
echo JRoute::_('index.php');
?>
" method="post" name="profilePicture" id="profilePicture" class="form-validate" enctype="multipart/form-data">
  <div class="jbl_h3title"><?php 
echo JText::_('COM_JBLANCE_PROFILE_PICTURE');
?>
Exemple #25
0
        ?>
</span>
	 		</td>
	 		<?php 
    }
    ?>
			<?php 
    if ($show_publisher == 1) {
        ?>
			<td  data-title="<?php 
        echo JText::_('MOD_JBLANCE_PUBLISHER');
        ?>
">
				<?php 
        $attrib = 'class="img-thumbnail" style="width: auto; height: 45px;"';
        echo JblanceHelper::getLogo($row->publisher_userid, $attrib);
        ?>
				<?php 
        echo LinkHelper::GetProfileLink($row->publisher_userid, $buyer->{$nameOrUsername});
        ?>
			 </td>
			 <?php 
    }
    ?>
	  </tr>
		<?php 
    $k = 1 - $k;
}
?>
	</tbody>
</table>
Exemple #26
0
 function buildPlanInfo($planId)
 {
     //initialize variables
     $jbuser = JblanceHelper::get('helper.user');
     // create an instance of the class userHelper
     $planInfo = $jbuser->getPlanInfo($planId);
     JHtml::_('bootstrap.tooltip');
     //get the plan details for the plan id passed
     $ugid = $planInfo->ug_id;
     //get the user group of the plan and thereby, get the usergroup info.
     $ugInfo = $jbuser->getUserGroupInfo(null, $ugid);
     $bidPostProjectAllowed = false;
     if ($ugInfo->allowBidProjects && $ugInfo->allowPostProjects) {
         $bidPostProjectAllowed = true;
     }
     $i = 0;
     $infos = '';
     //get the keys and values for the allowed functions.
     if ($ugInfo->allowBidProjects) {
         if ($bidPostProjectAllowed) {
             $infos[$i] = new stdClass();
             $infos[$i]->key = "<span class='lead grey'>" . JText::_('COM_JBLANCE_AS_FREELANCER') . "</span>";
             $infos[$i]->value = "<span class='lead grey'>&nbsp;</span>";
             $i++;
         }
         $infos[$i] = new stdClass();
         $infos[$i]->key = JText::_('COM_JBLANCE_PROJECT_COMMISSION');
         $infos[$i]->value = "<span class=hasTooltip title='" . JText::_('COM_JBLANCE_WHICHEVER_HIGHER') . "'>" . JblanceHelper::formatCurrency($planInfo->flFeeAmtPerProject) . ' ' . JText::_('COM_JBLANCE_OR') . ' ' . $planInfo->flFeePercentPerProject . '%' . "</span>";
         //$infos[$i]->value = JblanceHelper::formatCurrency($planInfo->flFeeAmtPerProject).' '.JText::_('COM_JBLANCE_OR').' '.$planInfo->flFeePercentPerProject.'%';
         $i++;
         $infos[$i] = new stdClass();
         $infos[$i]->key = JText::_('COM_JBLANCE_CHARGE_PER_BID');
         $infos[$i]->value = $planInfo->flChargePerBid == 0 ? JText::_('COM_JBLANCE_FREE') : JblanceHelper::formatCurrency($planInfo->flChargePerBid);
         $i++;
         $infos[$i] = new stdClass();
         $infos[$i]->key = JText::_('COM_JBLANCE_SERVICE_COMMISSION');
         $infos[$i]->value = $planInfo->flFeePercentPerService . '%';
         $i++;
         $infos[$i] = new stdClass();
         $infos[$i]->key = JText::_('COM_JBLANCE_CHARGE_PER_SERVICE');
         $infos[$i]->value = JblanceHelper::formatCurrency($planInfo->flChargePerService);
         $i++;
         $infos[$i] = new stdClass();
         $infos[$i]->key = JText::_('COM_JBLANCE_NUM_PORTFOLIOS_ALLOWED');
         $infos[$i]->value = $planInfo->portfolioCount == 0 ? "<img src=" . JURI::root() . "components/com_jblance/images/s0.png width=12 alt=No />" : $planInfo->portfolioCount;
         $i++;
         $infos[$i] = new stdClass();
         $infos[$i]->key = JText::_('COM_JBLANCE_NUM_BIDS_ALLOWED');
         $infos[$i]->value = $planInfo->flBidCount == 0 ? JText::_('COM_JBLANCE_UNLIMITED') : $planInfo->flBidCount;
         $i++;
     }
     if ($ugInfo->allowPostProjects) {
         if ($bidPostProjectAllowed) {
             $infos[$i] = new stdClass();
             $infos[$i]->key = "<span class='lead grey'>" . JText::_('COM_JBLANCE_AS_BUYER') . "</span>";
             $infos[$i]->value = "<span class='lead grey'>&nbsp;</span>";
             $i++;
         }
         $infos[$i] = new stdClass();
         $infos[$i]->key = JText::_('COM_JBLANCE_PROJECT_COMMISSION');
         $infos[$i]->value = "<span class=hasTooltip title='" . JText::_('COM_JBLANCE_WHICHEVER_HIGHER') . "'>" . JblanceHelper::formatCurrency($planInfo->buyFeeAmtPerProject) . ' ' . JText::_('COM_JBLANCE_OR') . ' ' . $planInfo->buyFeePercentPerProject . '%' . "</span>";
         //$infos[$i]->value = JblanceHelper::formatCurrency($planInfo->buyFeeAmtPerProject).' '.JText::_('COM_JBLANCE_OR').' '.$planInfo->buyFeePercentPerProject.'%';
         $i++;
         $infos[$i] = new stdClass();
         $infos[$i]->key = JText::_('COM_JBLANCE_CHARGE_PER_PROJECT');
         $infos[$i]->value = $planInfo->buyChargePerProject == 0 ? JText::_('COM_JBLANCE_FREE') : JblanceHelper::formatCurrency($planInfo->buyChargePerProject);
         $i++;
         $infos[$i] = new stdClass();
         $infos[$i]->key = JText::_('COM_JBLANCE_NUM_PROJECTS_ALLOWED');
         $infos[$i]->value = $planInfo->buyProjectCount == 0 ? JText::_('COM_JBLANCE_UNLIMITED') : $planInfo->buyProjectCount;
         $i++;
         $infos[$i] = new stdClass();
         $infos[$i]->key = JText::_('COM_JBLANCE_FEATURED_PROJECT');
         $infos[$i]->value = $planInfo->buyFeePerFeaturedProject == 0 ? JText::_('COM_JBLANCE_FREE') : JblanceHelper::formatCurrency($planInfo->buyFeePerFeaturedProject);
         $i++;
         $infos[$i] = new stdClass();
         $infos[$i]->key = JText::_('COM_JBLANCE_URGENT_PROJECT');
         $infos[$i]->value = $planInfo->buyFeePerUrgentProject == 0 ? JText::_('COM_JBLANCE_FREE') : JblanceHelper::formatCurrency($planInfo->buyFeePerUrgentProject);
         $i++;
         $infos[$i] = new stdClass();
         $infos[$i]->key = JText::_('COM_JBLANCE_PRIVATE_PROJECT');
         $infos[$i]->value = $planInfo->buyFeePerPrivateProject == 0 ? JText::_('COM_JBLANCE_FREE') : JblanceHelper::formatCurrency($planInfo->buyFeePerPrivateProject);
         $i++;
         $infos[$i] = new stdClass();
         $infos[$i]->key = JText::_('COM_JBLANCE_SEALED_PROJECT');
         $infos[$i]->value = $planInfo->buyFeePerSealedProject == 0 ? JText::_('COM_JBLANCE_FREE') : JblanceHelper::formatCurrency($planInfo->buyFeePerSealedProject);
         $i++;
         $infos[$i] = new stdClass();
         $infos[$i]->key = JText::_('COM_JBLANCE_NDA_PROJECT');
         $infos[$i]->value = $planInfo->buyFeePerNDAProject == 0 ? JText::_('COM_JBLANCE_FREE') : JblanceHelper::formatCurrency($planInfo->buyFeePerNDAProject);
         $i++;
     }
     return $infos;
 }
Exemple #27
0
    ?>

<div class="col-md-2 col-sm-4 col-xs-6">
  <div class="thumbnail">
    <a class="thumbnail" href= "<?php 
    echo $link_detail;
    ?>
">
    <?php 
    if ($show_logo) {
        $attrib = 'class="img-responsive"';
        echo JblanceHelper::getLogo($row->user_id, $attrib);
    }
    ?>
  </a>
	<div class="media-body">
		<h5 class="text-center">
      <?php 
    echo LinkHelper::GetProfileLink($row->user_id, $row->{$nameOrUsername});
    ?>
                </h5>
		<?php 
    if ($show_rating == 1) {
        JblanceHelper::getAvarageRate($row->user_id, 1);
    }
    ?>
	</div>
</div>
</div>
<?php 
}
Exemple #28
0
 function getEditService()
 {
     $app = JFactory::getApplication();
     $db = JFactory::getDbo();
     $id = $app->input->get('id', 0, 'int');
     $user = JFactory::getUser();
     $isNew = $id > 0 ? false : true;
     //check if the owner is editing the service
     $isOwnedOperation = JblanceHelper::checkOwnershipOfOperation($id, 'service');
     if ($id > 0 && !$isOwnedOperation) {
         $msg = JText::sprintf('COM_JBLANCE_NOT_AUTHORIZED_TO_ACCESS_THIS_PAGE');
         $app->enqueueMessage($msg, 'error');
         $link = JRoute::_('index.php?option=com_jblance&view=user&layout=dashboard', false);
         $app->redirect($link);
         return false;
     }
     //check if the user's plan is expired or not approved. If so, do not allow him to create service
     $planStatus = JblanceHelper::planStatus($user->id);
     if ($isNew && ($planStatus == 1 || $planStatus == 2)) {
         $msg = JText::sprintf('COM_JBLANCE_NOT_ALLOWED_TO_DO_OPERATION_NO_ACTIVE_SUBSCRIPTION');
         $app->enqueueMessage($msg, 'error');
         $link = JRoute::_('index.php?option=com_jblance&view=user&layout=dashboard', false);
         $app->redirect($link);
         return false;
     }
     //check if the user has enough fund to create new services. This should be checked for new services only
     $plan = JblanceHelper::whichPlan($user->id);
     $chargePerService = $plan->flChargePerService;
     if ($isNew && $chargePerService > 0) {
         $totalFund = JblanceHelper::getTotalFund($user->id);
         if ($totalFund < $chargePerService) {
             $msg = JText::sprintf('COM_JBLANCE_BALANCE_INSUFFICIENT_TO_POST_SERVICE', JblanceHelper::formatCurrency($chargePerService));
             $app->enqueueMessage($msg, 'error');
             $link = JRoute::_('index.php?option=com_jblance&view=membership&layout=depositfund', false);
             $app->redirect($link);
             return false;
         }
     }
     $row = JTable::getInstance('service', 'Table');
     $row->load($id);
     //show reason if service is not approved.
     if (!$isNew && !$row->approved) {
         $msg = empty($row->disapprove_reason) ? JText::_('COM_JBLANCE_SERVICE_PENDING_APPROVAL_FROM_ADMIN') : $row->disapprove_reason;
         $app->enqueueMessage(nl2br($msg), 'Error');
     }
     $return[0] = $row;
     return $return;
 }
Exemple #29
0
        echo !empty($avatar) ? LinkHelper::GetProfileLink($rating->actor, $avatar, '', '', ' pull-left') : '&nbsp;';
        ?>
   
                                </div>
                            
                                <div class="media-body">
                                    <span class="media-heading boldfont"><?php 
        echo LinkHelper::GetProfileLink($rating->actor);
        ?>
</span>
                                    <span class="dis-inl-blk"><?php 
        echo JblanceHelper::getRatingHTML($rate);
        ?>
</span>
                                    <span class="dis-inl-blk font12"><?php 
        echo JblanceHelper::showTimePastDHM($rateDate, 'SHORT');
        ?>
</span>
                                    <div><?php 
        echo $rating->comments;
        ?>
</div>
                                </div>
                            </div>
                            <div class="lineseparator"></div>
                            <?php 
    }
    ?>
                    </div>
<?php 
}
Exemple #30
0
        echo JblanceHelper::formatCurrency($row->rate, true, true, 0) . '/' . JText::_('COM_JBLANCE_HR');
        ?>
</span>
                    <?php 
    }
    ?>
                </div>
                <?php 
    if (!empty($row->id_category)) {
        ?>
                    <div class="boldfont font12">
                        <?php 
        echo JText::_('COM_JBLANCE_SKILLS');
        ?>
: <?php 
        echo JblanceHelper::getCategoryNames($row->id_category, 'tags-link', 'user');
        ?>
                    </div>
                <?php 
    }
    ?>
                <?php 
    if (!empty($row->biz_name) && $showBizName) {
        ?>
                    <span class="boldfont font12"><?php 
        echo JText::_('COM_JBLANCE_BUSINESS_NAME');
        ?>
: </span><?php 
        echo $row->biz_name;
        ?>
                <?php