示例#1
0
                <label class="label" for="amount"><?php 
echo JText::_('COM_JBLANCE_AMOUNT');
?>
 :</label>

                <div class="input-group">
                    <span class="input-group-addon"><?php 
echo $currencysym;
?>
</span>
                    <input type="text" name="amount" id="amount" class="form-control required validate-numeric" value="" />
                    <input type="hidden" name="bid_amount" id="bid_amount" value="" />
                </div>
                <span class="help-inline">
                    <em>(<?php 
echo JText::_('COM_JBLANCE_YOUR_BALANCE') . ' : ' . JblanceHelper::formatCurrency($totalFund);
?>
)</em>
                </span>
            </div>
            <div class="form-group">
                <label class="label" for="note"><?php 
echo JText::_('COM_JBLANCE_NOTES');
?>
 :</label>
                <div class="controls">
                    <input type="text" name="note" id="note" placeholder="<?php 
echo JText::_('COM_JBLANCE_NOTES');
?>
" class="form-control" />
                </div>
示例#2
0
 function placeOrder()
 {
     // Check for request forgeries
     JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
     $app = JFactory::getApplication();
     $post = $app->input->post->getArray();
     $row = JTable::getInstance('serviceorder', 'Table');
     $now = JFactory::getDate();
     $user = JFactory::getUser();
     $service_id = $app->input->get('service_id', 0, 'int');
     // id of service
     $svcHelper = JblanceHelper::get('helper.service');
     // create an instance of the class ServiceHelper
     $service = JTable::getInstance('service', 'Table');
     $userType = JblanceHelper::getUserType($user->id);
     //get the current user type
     $escrow = JTable::getInstance('escrow', 'Table');
     $service->load($service_id);
     $isMine = $service->user_id == $user->id;
     // check if the user is guest
     if ($user->guest) {
         //return to same page after login
         $returnUrl = JRoute::_('index.php?option=com_jblance&view=service&layout=viewservice&id=' . $service_id, false);
         $msg = JText::_('COM_JBLANCE_MUST_BE_LOGGED_IN_TO_ACCESS_THIS_PAGE');
         $link_login = JRoute::_('index.php?option=com_users&view=login&return=' . base64_encode($returnUrl), false);
         $this->setRedirect($link_login, $msg, 'warning');
     }
     // check if the user doesn't have JoomBri Profile - or he is just a Joomla user
     if ($userType->joomlauser) {
         $msg = JText::_('COM_JBLANCE_NOT_AUTHORIZED_TO_ACCESS_THIS_PAGE_CHOOSE_YOUR_ROLE');
         $link = JRoute::_('index.php?option=com_jblance&view=guest&layout=showfront', false);
         $this->setRedirect($link, $msg, 'error');
         return false;
     }
     // check if the user is a freelancer or service owner
     if ($isMine || !$userType->buyer) {
         $msg = JText::_('COM_JBLANCE_NOT_ALLOWED_TO_ORDER_SERVICE');
         $link = JRoute::_('index.php?option=com_jblance&view=service&layout=viewservice&id=' . $service_id, false);
         $this->setRedirect($link, $msg, 'error');
         return false;
     }
     //check if the user's plan is expired or not approved. If so, do not allow him to order service
     $planStatus = JblanceHelper::planStatus($user->id);
     if ($planStatus == 1 || $planStatus == 2) {
         $msg = JText::sprintf('COM_JBLANCE_NOT_ALLOWED_TO_DO_OPERATION_NO_ACTIVE_SUBSCRIPTION');
         $link = JRoute::_('index.php?option=com_jblance&view=user&layout=dashboard', false);
         $this->setRedirect($link, $msg, 'error');
         return false;
     }
     $post['user_id'] = $user->id;
     $post['status'] = 'COM_JBLANCE_ACCEPTED';
     $post['order_date'] = $now->toSql();
     //process extra add-ons
     $extras = $app->input->get('extras', null, 'array');
     $registry = new JRegistry();
     $registry->loadArray($extras);
     $post['extras'] = $registry->toString();
     //calculate the total amount and duration as they could have been tampered
     $return = $svcHelper->calculateServiceTotalPrice($service_id, $extras);
     $post['price'] = $return['totalPrice'];
     $post['duration'] = $return['totalDuration'];
     //check if the buyer has enough money to buy the service
     $totalFund = JblanceHelper::getTotalFund($user->id);
     if ($totalFund < $return['totalPrice']) {
         $msg = JText::sprintf('COM_JBLANCE_BALANCE_INSUFFICIENT_TO_BUY_SERVICE', JblanceHelper::formatCurrency($return['totalPrice']));
         $link = JRoute::_('index.php?option=com_jblance&view=membership&layout=depositfund', false);
         $this->setRedirect($link, $msg, 'error');
         return false;
     }
     if (!$row->save($post)) {
         throw new Exception($row->getError(), 500);
     }
     //deduct the amount from buyer and credit the seller after less service fee
     $plan = JblanceHelper::whichPlan($service->user_id);
     //get the plan details of the seller to get the service fee
     $serviceFee = $plan->flFeePercentPerService;
     //service fee in percent
     //deduct buyer
     $transDtl = JText::_('COM_JBLANCE_SERVICE_ORDER') . ' - ' . $service->service_title;
     $trans_buyer = JblanceHelper::updateTransaction($user->id, $transDtl, $return['totalPrice'], -1);
     $msg_debit = JText::sprintf('COM_JBLANCE_YOUR_ACCOUNT_DEBITED_WITH_CURRENCY_FOR_BUYING_SERVICE', JblanceHelper::formatCurrency($return['totalPrice']));
     $app->enqueueMessage($msg_debit);
     $app->enqueueMessage(JText::_('COM_JBLANCE_RELEASE_PAYMENT_WHEN_SATISFIED'));
     //calculate the escrow amount (less service fee)
     $amountToCredit = $return['totalPrice'] - round($serviceFee / 100 * $return['totalPrice'], 2);
     //save to escrow table
     $escrow->from_id = $user->id;
     $escrow->to_id = $service->user_id;
     $escrow->date_transfer = $now->toSql();
     $escrow->note = '';
     $escrow->amount = $amountToCredit;
     $escrow->project_id = $row->id;
     //this has to be service order id instead of service id. Changed since v1.7
     $escrow->type = 'COM_JBLANCE_SERVICE';
     $escrow->from_trans_id = $trans_buyer->id;
     if (!$escrow->store()) {
         JError::raiseError(500, $escrow->getError());
     }
     $escrow->checkin();
     //send service order notification to seller
     $jbmail = JblanceHelper::get('helper.email');
     // create an instance of the class EmailHelper
     $jbmail->sendServiceOrderNotification($row->id, $service_id);
     $msg = JText::_('COM_JBLANCE_SERVICE_ORDER_PLACED_SUCCESSFULLY') . ' : ' . $service->service_title;
     $return = JRoute::_('index.php?option=com_jblance&view=service&layout=servicebought', false);
     $this->setRedirect($return, $msg, 'message');
 }
示例#3
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>
示例#4
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;
 }
示例#5
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>
示例#6
0
 function getPlaceBid()
 {
     $app = JFactory::getApplication();
     $db = JFactory::getDbo();
     $user = JFactory::getUser();
     $id = $app->input->get('id', 0, 'int');
     //id is the "project id"
     $finance = JblanceHelper::get('helper.finance');
     // create an instance of the class FinanceHelper
     $project = JTable::getInstance('project', 'Table');
     $project->load($id);
     // Project author is allowed to bid on his own project
     if ($project->publisher_userid == $user->id) {
         $msg = JText::sprintf('COM_JBLANCE_NOT_ALLOWED_TO_BID_ON_YOUR_OWN_PROJECT');
         $link = JRoute::_('index.php?option=com_jblance&view=user&layout=dashboard', false);
         $app->enqueueMessage($msg, 'error');
         $app->redirect($link);
         return false;
     }
     //project in Frozen/Closed should not be allowed to bid
     if ($project->status != 'COM_JBLANCE_OPEN') {
         $link = JRoute::_('index.php?option=com_jblance&view=project&layout=listproject', false);
         $app->redirect($link);
         return;
     }
     //redirect to dashboard if this is private invite project
     if ($project->is_private_invite) {
         $invite_ids = explode(',', $project->invite_user_id);
         if (!in_array($user->id, $invite_ids)) {
             $msg = JText::_('COM_JBLANCE_THIS_IS_A_PRIVATE_INVITE_PROJECT_VISIBLE_TO_OWNER_INVITEES');
             $link_dash = JRoute::_('index.php?option=com_jblance&view=user&layout=dashboard', false);
             $app->enqueueMessage($msg, 'error');
             $app->redirect($link_dash);
         }
     }
     //get the bid id
     $query = "SELECT id FROM #__jblance_bid WHERE project_id=" . $db->quote($id) . " AND user_id=" . $db->quote($user->id);
     $db->setQuery($query);
     $bid_id = $db->loadResult();
     $bid = JTable::getInstance('bid', 'Table');
     $bid->load($bid_id);
     //check if the user's plan is expired or not approved. If so, do not allow him to bid new on project
     $planStatus = JblanceHelper::planStatus($user->id);
     if (empty($bid_id) && ($planStatus == 1 || $planStatus == 2)) {
         $msg = JText::sprintf('COM_JBLANCE_NOT_ALLOWED_TO_DO_OPERATION_NO_ACTIVE_SUBSCRIPTION');
         $link = JRoute::_('index.php?option=com_jblance&view=user&layout=dashboard', false);
         $app->enqueueMessage($msg, 'error');
         $app->redirect($link);
         return false;
     }
     //check if the user has enough fund to bid new on projects. This should be checked for new bids only
     $plan = JblanceHelper::whichPlan($user->id);
     $chargePerBid = $plan->flChargePerBid;
     if ($chargePerBid > 0 && empty($bid_id)) {
         // bid_id will be empty for new bids
         $totalFund = JblanceHelper::getTotalFund($user->id);
         if ($totalFund < $chargePerBid) {
             $msg = JText::sprintf('COM_JBLANCE_BALANCE_INSUFFICIENT_TO_BID_PROJECT', JblanceHelper::formatCurrency($chargePerBid));
             $link = JRoute::_('index.php?option=com_jblance&view=membership&layout=depositfund', false);
             $app->enqueueMessage($msg, 'error');
             $app->redirect($link);
             return false;
         }
     }
     //check if the user has any bid limit. If any and exceeds, then disallow him
     $lastSubscr = $finance->getLastSubscription($user->id);
     if (empty($bid_id) && ($lastSubscr->bids_allowed > 0 && $lastSubscr->bids_left <= 0)) {
         $msg = JText::sprintf('COM_JBLANCE_NOT_ALLOWED_TO_BID_PROJECT_LIMIT_EXCEEDED');
         $link = JRoute::_('index.php?option=com_jblance&view=membership&layout=planadd', false);
         $app->enqueueMessage($msg, 'error');
         $app->redirect($link);
         return false;
     }
     $return[0] = $project;
     $return[1] = $bid;
     return $return;
 }
示例#7
0
        ?>
</a>
                        <?php 
    }
    ?>
                    </span>
                </h4>
                <div>
                    <?php 
    $rate = JblanceHelper::getAvarageRate($row->user_id, true);
    ?>
                    <?php 
    if ($row->rate > 0) {
        ?>
                        <span class="font14"><?php 
        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');
示例#8
0
            ?>
					<a rel="{handler: 'iframe', size: {x: 650, y: 500}}" href="<?php 
            echo $link_invoice;
            ?>
" class="jb-modal btn btn-success btn-small"><?php 
            echo JText::_('COM_JBLANCE_PRINT_INVOICE');
            ?>
</a>
				<?php 
        }
        ?>
			</p>
		</div>
		<div class="col-md-4 text-center">
			<span class="font20"><?php 
        echo JblanceHelper::formatCurrency($row->totalprice, true, false, 0);
        ?>
</span> 
			<?php 
        echo JText::_('COM_JBLANCE_IN');
        ?>
 <span class="font16"><?php 
        echo JText::plural('COM_JBLANCE_N_DAYS', $row->totalduration);
        ?>
</span>
			<div class="small">
				<span class="label label-success"><?php 
        echo !empty($row->p_status) ? JText::_($row->p_status) : JText::_('COM_JBLANCE_NOT_YET_STARTED');
        ?>
</span>
			</div>
示例#9
0
		</div>
	</div>
</fieldset>
<fieldset class="form-horizontal">
	<legend><?php 
echo JText::_('COM_JBLANCE_FUND_INFO');
?>
</legend>
	<div class="control-group">
		<label class="control-label nopadding"><?php 
echo JText::_('COM_JBLANCE_BONUS_FUND');
?>
: </label>
		<div class="controls">
			<?php 
echo JblanceHelper::formatCurrency($this->row->fund);
?>
		</div>
	</div>
		<?php 
$ugroup = $jbuser->getUserGroupInfo($this->row->user_id, null);
if ($ugroup->allowPostProjects) {
    ?>
	<div class="control-group">
		<label class="control-label nopadding"><?php 
    echo JText::_('COM_JBLANCE_PROJECTS_LEFT');
    ?>
: </label>
		<div class="controls">
		<?php 
    if ($this->row->projects_allowed > 0) {
示例#10
0
        ?>
                                            </td>
                                            <td data-title="<?php 
        echo JText::_('COM_JBLANCE_AMOUNT');
        ?>
" class="text-right">
                                                <?php 
        echo JblanceHelper::formatCurrency($deposit->amount, false);
        ?>
                                            </td>
                                            <td data-title="<?php 
        echo JText::_('COM_JBLANCE_DEPOSIT_FEE');
        ?>
" class="text-right">
                                                <?php 
        echo JblanceHelper::formatCurrency($deposit->total - $deposit->amount, false);
        ?>
                                            </td>
                                            <td data-title="<?php 
        echo JText::_('COM_JBLANCE_STATUS');
        ?>
">
                                                <?php 
        echo JblanceHelper::getApproveStatus($deposit->approved);
        ?>
                                            </td>
                                            <td class="text-center">
                                                <a class="btn btn-mini jb-modal" title="<?php 
        echo JText::_('COM_JBLANCE_PRINT_INVOICE');
        ?>
" href="<?php 
示例#11
0
" />
				<span class="input-group-addon"><?php 
echo $currencycode;
echo $project->project_type == 'COM_JBLANCE_HOURLY' ? ' / ' . JText::_('COM_JBLANCE_HR') : '';
?>
</span>
			</div>
			<span class="help-inline font12">
				<?php 
echo JText::_('COM_JBLANCE_BUDGET_RANGE');
?>
 : <?php 
echo JblanceHelper::formatCurrency($project->budgetmin, true, false, 0);
?>
 - <?php 
echo JblanceHelper::formatCurrency($project->budgetmax, true, false, 0) . ' ' . $currencycode;
echo $project->project_type == 'COM_JBLANCE_HOURLY' ? ' / ' . JText::_('COM_JBLANCE_HR') : '';
?>
			</span>
	</div>
	<?php 
if ($project->project_type == 'COM_JBLANCE_HOURLY') {
    $commitment = new JRegistry();
    $commitment->loadString($project->commitment);
    ?>
	<div class="form-group">
		<label class="control-label" for="delivery"><?php 
    echo JText::_('COM_JBLANCE_WORK_FOR');
    ?>
:</label>
			<div class="input-group">
示例#12
0
 function repostProject()
 {
     // Check for request forgeries
     JSession::checkToken('request') or jexit(JText::_('JINVALID_TOKEN'));
     $app = JFactory::getApplication();
     $id = $app->input->get('id', 0, 'int');
     $user = JFactory::getUser();
     $now = JFactory::getDate();
     //update status project
     $project = JTable::getInstance('project', 'Table');
     $project->load($id);
     $project->status = 'COM_JBLANCE_OPEN';
     $project->start_date = $now->toSql();
     if (!$project->check()) {
         JError::raiseError(500, $project->getError());
     }
     if (!$project->store()) {
         JError::raiseError(500, $project->getError());
     }
     $project->checkin();
     // deduce `charge per project` if amount is > 0
     $plan = JblanceHelper::whichPlan($user->id);
     $chargePerProject = $plan->buyChargePerProject;
     if ($chargePerProject > 0) {
         $transDtl = JText::_('COM_JBLANCE_REPOST') . ' - ' . $project->project_title;
         JblanceHelper::updateTransaction($user->id, $transDtl, $chargePerProject, -1);
         $msg_debit = JText::sprintf('COM_JBLANCE_YOUR_ACCOUNT_DEBITED_WITH_CURRENCY_FOR_POSTING_PROJECT', JblanceHelper::formatCurrency($chargePerProject));
         $app->enqueueMessage($msg_debit);
     }
     /* //send send hourly project payment complete notification
     		$jbmail = JblanceHelper::get('helper.email');		// create an instance of the class EmailHelper
     		$jbmail->sendProjectPaymentCompleteNotification($id, $user->id); */
     $msg = JText::_('COM_JBLANCE_PROJECT_REPOSTED_SUCCESSFULLY');
     $return = JRoute::_('index.php?option=com_jblance&view=project&layout=showmyproject', false);
     $this->setRedirect($return, $msg);
     return false;
 }
示例#13
0
        ?>
</li>
                                <?php 
        foreach ($infos as $info) {
            ?>
                                    <li><?php 
            echo $info->value;
            ?>
</li>
                                <?php 
        }
        ?>
                                <li class="lead grey">
                                    <h4>
                                        <?php 
        echo $nprice ? '<span style="float:left; color:red; text-decoration:line-through">' . ' ' . JblanceHelper::formatCurrency($row->price, true, false, 0) . '</span><span>' . $nprice . '</span>' : JblanceHelper::formatCurrency($row->price, true, false, 0);
        ?>
 <span class="divider">/</span> 
                                        <?php 
        if ($row->days > 100 && $row->days_type == 'years') {
            echo JText::_('COM_JBLANCE_LIFETIME');
        } else {
            ?>
                                            <span class=""><?php 
            echo $row->days . ' ';
            ?>
 </span>
                                            <?php 
            echo getDaysType($row->days_type);
        }
        ?>
示例#14
0
    ?>
		<div class="form-group">
			<label class="control-label nopadding"><?php 
    echo JText::_('COM_JBLANCE_TOTAL_AMOUNT');
    ?>
: </label>
			<div class="controls">
				<?php 
    $totalamt = $planChosen['price' . $sub_id];
    if ($taxpercent > 0) {
        $taxamt = $totalamt * ($taxpercent / 100);
        $totalamt = $taxamt + $totalamt;
    }
    echo JblanceHelper::formatCurrency($totalamt);
    if ($taxpercent > 0 && $totalamt > 0) {
        echo ' (' . JblanceHelper::formatCurrency($planChosen['price' . $sub_id]) . ' + ' . JblanceHelper::formatCurrency($taxamt) . ')';
    }
    ?>
			</div>
		</div>
	</fieldset>
	<?php 
}
?>
	
<fieldset class="col-md-8">
	<legend><?php 
echo JText::_('COM_JBLANCE_USER_INFORMATION');
?>
</legend>
            <?php 
示例#15
0
    ?>
</span>
					</li>
				<?php 
}
?>
				</ul>
				
				<div class="control-group">
					<label class="control-label nopadding"><?php 
echo JText::_('COM_JBLANCE_TOTAL_PRICE');
?>
 :</label>
					<div class="controls">
						<?php 
echo JblanceHelper::formatCurrency($service->totalprice);
?>
					</div>
				</div>
				<div class="control-group">
					<label class="control-label nopadding"><?php 
echo JText::_('COM_JBLANCE_TOTAL_DURATION');
?>
 :</label>
					<div class="controls">
						<?php 
echo JText::plural('COM_JBLANCE_N_DAYS', $service->totalduration);
?>
					</div>
				</div>
			</fieldset>
示例#16
0
                                        <li data-promotion="nda"><?php 
            echo JText::_('COM_JBLANCE_NDA');
            ?>
</li>
                                    <?php 
        }
        ?>
                                </ul>
                            </h5>
                             <div class="actions">
                                <?php 
        if ($row->status == 'COM_JBLANCE_OPEN' || $row->status == 'COM_JBLANCE_EXPIRED') {
            $expiredate = JFactory::getDate();
            $expiredate->modify("+{$row->expires} days");
            $expiredate = JHtml::_('date', $expiredate, $dformat, false);
            $repostConfirmMessage = JText::sprintf('COM_JBLANCE_CONFIRM_REPOST_PROJECT', JblanceHelper::formatCurrency($chargePerProject), $expiredate, true);
            ?>
                                    <a href="<?php 
            echo $link_edit;
            ?>
" class="btn btn-primary btn-block btn-sm"><?php 
            echo JText::_('COM_JBLANCE_EDIT');
            ?>
</a>
                                    <a href="javascript:void(0);" class="btn btn-danger btn-block btn-sm" onclick="javascript:modalConfirm('<?php 
            echo JText::_('COM_JBLANCE_DELETE', true);
            ?>
', '<?php 
            echo JText::_('COM_JBLANCE_CONFIRM_DELETE_PROJECT', true);
            ?>
', '<?php 
示例#17
0
                            </td>
                            <td data-title="<?php 
        echo JText::_('COM_JBLANCE_DAYS_LEFT');
        ?>
" class="center">
                                <?php 
        echo $row->daysleft >= 0 ? $row->daysleft : '0';
        ?>
                            </td>
                            <td data-title="<?php 
        echo JText::_('COM_JBLANCE_PRICE') . " ({$currencysym})";
        ?>
" class="text-right">
                                <?php 
        echo JblanceHelper::formatCurrency($row->price, false);
        ?>
                            </td>
                            <td class="text-center">
                                <div class="btn-group">
                                    <?php 
        if (!$row->approved) {
            ?>
                                        <a class="btn btn-small" title="<?php 
            echo JText::_('COM_JBLANCE_CHECKOUT');
            ?>
" href="<?php 
            echo $link_checkout;
            ?>
"><i class="material-icons">shopping_cart</i> </a>
                                        <a class="btn btn-small" title="<?php 
示例#18
0
                <?php 
if ($chargePerService > 0 || $serviceFee > 0) {
    ?>
                    <div class="alert alert-info">
                        <h4><?php 
    echo JText::_('COM_JBLANCE_CHARGES');
    ?>
</h4>
                        <ul>
                            <?php 
    if ($chargePerService > 0) {
        ?>
                                <li>
                                    <?php 
        echo JText::sprintf('COM_JBLANCE_CHARGE_PER_SERVICE_INFO', JblanceHelper::formatCurrency($chargePerService));
        ?>
                                </li>
                            <?php 
    }
    ?>
                            <?php 
    if ($serviceFee > 0) {
        ?>
                                <li>
                                    <?php 
        echo JText::sprintf('COM_JBLANCE_SERVICE_FEE_INFO', $serviceFee);
        ?>
                                </li>
                            <?php 
    }
示例#19
0
echo $subtotalName;
?>
:</td>
			<td colspan="1" align="right">
				<?php 
echo JblanceHelper::formatCurrency($subtotalAmt);
?>
			</td>
		</tr>
		<tr>
			<td colspan="3" align="right"> </td>
			<td colspan="1" align="right"><hr></td>
		</tr>
		<tr>
			<td colspan="3" align="right"><?php 
echo JText::_('COM_JBLANCE_TOTAL');
?>
 :</td>
			<td colspan="1" align="right">
				<?php 
echo '<b>' . JblanceHelper::formatCurrency($total, true, true) . '</b>';
?>
			</td>
		</tr>
		<tr>
			<td colspan="3"><?php 
echo JText::_('COM_JBLANCE_WE_THANK_YOU_FOR_YOUR_BUSINESS');
?>
</td>
		</tr>
	</table>
示例#20
0
?>
 :</label>
					<div class="controls">
						<?php 
echo $freelancerInfo->{$nameOrUsername};
?>
					</div>
				</div>
				<div class="control-group">
					<label class="control-label nopadding"><?php 
echo JText::_('COM_JBLANCE_BID_AMOUNT');
?>
 :</label>
					<div class="controls">
						<?php 
echo JblanceHelper::formatCurrency($project->amount);
?>
					</div>
				</div>
				<div class="control-group">
					<label class="control-label nopadding"><?php 
echo JText::_('COM_JBLANCE_DELIVERY_IN');
?>
 :</label>
					<div class="controls">
						<?php 
echo JText::plural('COM_JBLANCE_N_DAYS', $project->delivery);
?>
					</div>
				</div>
			</fieldset>
示例#21
0
 function saveEscrow()
 {
     // Check for request forgeries
     JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
     // Initialize variables
     $app = JFactory::getApplication();
     $db = JFactory::getDbo();
     $user = JFactory::getUser();
     $projHelp = JblanceHelper::get('helper.project');
     // create an instance of the class ProjectHelper
     $financeHelp = JblanceHelper::get('helper.finance');
     // create an instance of the class FinanceHelper
     $row = JTable::getInstance('escrow', 'Table');
     $post = $app->input->post->getArray();
     $amount = $app->input->get('amount', 0, 'float');
     $balance = $app->input->get('proj_balance', 0, 'float');
     $recipient = $app->input->get('recipient', '', 'string');
     $recipientInfo = JFactory::getUser($recipient);
     //get the recipient info from the recipient's username
     $project_id = $app->input->get('project_id', 0, 'int');
     $reason = $post['reason'];
     $project = JTable::getInstance('project', 'Table');
     $project->load($project_id);
     //check if the recipient info is valid/username exists
     if (empty($recipientInfo)) {
         $msg = JText::_('COM_JBLANCE_INVALID_USERNAME');
         $link = JRoute::_('index.php?option=com_jblance&view=membership&layout=escrow', false);
         $this->setRedirect($link, $msg, 'error');
         return false;
     }
     //check if the user has enough fund to transfer
     $totalFund = JblanceHelper::getTotalFund($user->id);
     if ($totalFund < $amount) {
         $msg = JText::_('COM_JBLANCE_BALANCE_INSUFFICIENT_TO_MAKE_PAYMENT');
         $link = JRoute::_('index.php?option=com_jblance&view=membership&layout=escrow', false);
         $this->setRedirect($link, $msg);
         return false;
     }
     //redirect the user if he is trying to pay more than the bid amount (check this for fixed projects only)
     if (($reason == 'full_payment' || $reason == 'partial_payment') && $project_id) {
         if ($project->project_type == 'COM_JBLANCE_FIXED') {
             if ($amount > $balance) {
                 $msg = JText::_('COM_JBLANCE_PAYMENT_OVER_THE_PROJECT_BALANCE');
                 $link = JRoute::_('index.php?option=com_jblance&view=membership&layout=escrow', false);
                 $this->setRedirect($link, $msg, 'error');
                 return false;
             }
             //compare the bid amount and total amount paid through escrow. If more, redirect.
             $bidAmount = $projHelp->getBidAmt($project_id);
             //get the bid amount of the project
             $escrowAmount = $financeHelp->getTotalAmountPaid($project_id, 'COM_JBLANCE_PROJECT');
             //total amount paid by buyer
             if ($escrowAmount + $amount > $bidAmount) {
                 $msg = JText::sprintf('COM_JBLANCE_PAYMENT_OVER_THE_PROJECT_BID_AMOUNT', JblanceHelper::formatCurrency($escrowAmount));
                 $link = JRoute::_('index.php?option=com_jblance&view=membership&layout=escrow', false);
                 $this->setRedirect($link, $msg, 'error');
                 return false;
             }
         }
     }
     //save the escrow
     $post['from_id'] = $user->id;
     $post['to_id'] = $recipientInfo->id;
     $now = JFactory::getDate();
     $post['date_transfer'] = $now->toSql();
     if (($reason == 'full_payment' || $reason == 'partial_payment') && $project_id) {
         $post['type'] = 'COM_JBLANCE_PROJECT';
         $transDtl_sender = JText::sprintf('COM_JBLANCE_ESCROW_PAYMENT_TO_FOR_PROJECT', $recipient, $project->project_title);
     } elseif ($reason == 'other') {
         $post['type'] = 'COM_JBLANCE_OTHER';
         $transDtl_sender = JText::sprintf('COM_JBLANCE_ESCROW_PAYMENT_TO', $recipient);
     }
     if (!$row->save($post)) {
         JError::raiseError(500, $row->getError());
     }
     //debit the sender
     $row_trans = JblanceHelper::updateTransaction($user->id, $transDtl_sender, $amount, -1);
     //save the tras id to the escrow table
     $row->from_trans_id = $row_trans->id;
     if (!$row->store()) {
         JError::raiseError(500, $row->getError());
     }
     $row->checkin();
     $msg = JText::_('COM_JBLANCE_ESCROW_PAYMENT_COMPLETED_SUCCESSFULLY');
     $link = JRoute::_('index.php?option=com_jblance&view=membership&layout=managepay', false);
     $this->setRedirect($link, $msg);
     return false;
 }
示例#22
0
                    <?php 
}
?>

                    <!-- Skills and hourly rate should be visible only to users who can work/bid -->
                    <?php 
if ($userInfo->allowBidProjects) {
    ?>
                        <div class="form-group">
                            <label class="control-label nopadding"><?php 
    echo JText::_('COM_JBLANCE_HOURLY_RATE');
    ?>
: </label>
                            <div class="input-group">
                                <?php 
    echo JblanceHelper::formatCurrency($this->userInfo->rate, true, true) . ' / ' . JText::_('COM_JBLANCE_HOUR');
    ?>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label nopadding"><?php 
    echo JText::_('COM_JBLANCE_SKILLS');
    ?>
: </label>
                            <div class="input-group">
                                <?php 
    echo JblanceHelper::getCategoryNames($this->userInfo->id_category);
    ?>
                            </div>
                        </div>
                    <?php 
示例#23
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;
 }
示例#24
0
    ?>
)</em><br>
					<em>(<?php 
    echo JText::_('COM_JBLANCE_MIN_AMOUNT') . ' : ' . JblanceHelper::formatCurrency($minWithdraw);
    ?>
)</em><br>
				</span>
			</div>
		<div class="form-group">
			<label class="control-label"><?php 
    echo JText::_('COM_JBLANCE_WITHDRAWAL_FEE');
    ?>
:</label>
			<div class="controls">
				<?php 
    echo JblanceHelper::formatCurrency($gwInfo->withdrawFee);
    ?>
	
				<input type="hidden" name=withdrawFee value="<?php 
    echo $gwInfo->withdrawFee;
    ?>
" />
			</div>
		</div>
		<?php 
    // Iterate through the fields and display them.
    foreach ($this->form->getFieldset('withdraw') as $field) {
        // If the field is hidden, only use the input.
        if ($field->hidden) {
            echo $field->input;
        } else {
示例#25
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');
                ?>
示例#26
0
文件: default.php 项目: Ovi1/modules
 * @created on	:	04 March 2013
 * @file name	:	modules/mod_jblancebalance/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);
}
$user = JFactory::getUser();
$hasJBProfile = JblanceHelper::hasJBProfile($user->id);
if ($hasJBProfile) {
    ?>
<ul class="list-inline">
	<li><?php 
    echo JText::_('MOD_JBLANCE_CURRENT_BALANCE');
    ?>
:</li>
	<li><strong><?php 
    echo JblanceHelper::formatCurrency($total_fund);
    ?>
</strong></li>
</ul>
<?php 
}
示例#27
0
文件: default.php 项目: Ovi1/modules
        ?>
</td><?php 
    }
    ?>
	 		<?php 
    if ($show_budget == 1) {
        ?>
	 		<td  data-title="<?php 
        echo JText::_('MOD_JBLANCE_BUDGET') . ' (' . $currencycod . ')';
        ?>
" class="text-center">
	 			<?php 
        echo JblanceHelper::formatCurrency($row->budgetmin, true, false, 0);
        ?>
 - <?php 
        echo JblanceHelper::formatCurrency($row->budgetmax, true, false, 0);
        ?>
<span class="font12"><?php 
        echo $row->project_type == 'COM_JBLANCE_HOURLY' ? ' / ' . JText::_('COM_JBLANCE_HR') : '';
        ?>
</span>
	 		</td>
	 		<?php 
    }
    ?>
			<?php 
    if ($show_publisher == 1) {
        ?>
			<td  data-title="<?php 
        echo JText::_('MOD_JBLANCE_PUBLISHER');
        ?>
示例#28
0
                                </td>
                                <td data-title="<?php 
    echo JText::_('COM_JBLANCE_MINUS');
    ?>
" class="text-right">
                                    <?php 
    echo $row->fund_minus > 0 ? JblanceHelper::formatCurrency($row->fund_minus, false) : '-';
    ?>
 
                                </td>
                                <td data-title="<?php 
    echo JText::_('COM_JBLANCE_PLUS');
    ?>
" class="text-right">
                                    <?php 
    echo $row->fund_plus > 0 ? JblanceHelper::formatCurrency($row->fund_plus, false) : '-';
    ?>
 
                                </td>
                            </tr>
                            <?php 
    $k = 1 - $k;
}
?>
                    </tbody>
                    <tfoot>
                        <tr>
                            <td colspan="5">
                                <div class="pull-right">
                                    <div class="display-limit">
                                        <?php 
示例#29
0
                echo "<span class='label label-warning'>" . JText::_('COM_JBLANCE_FAST_DELIVERY') . " </span> " . JText::sprintf('COM_JBLANCE_FAST_DELIVER_ORDER_JUST_DAYS', $value->duration);
                ?>
                                                <?php 
            } else {
                ?>
                                                    <?php 
                echo $value->description . ' (+' . JText::plural('COM_JBLANCE_N_DAYS', $value->duration) . ')';
                ?>
            <?php 
            }
            ?>
                                            </label>
                                        </div>
                                        <div class="span2">
                                            <span class="boldfont">+ <?php 
            echo JblanceHelper::formatCurrency($value->price);
            ?>
</span>
                                        </div>
                                    </div>
                                </div>
                                <?php 
        }
    }
}
?>

                        <?php 
if (!empty($row->instruction)) {
    ?>
                        <div class="alert alert-info">
示例#30
0
?>
:</label>

                    <?php 
$list_paymode = $model->getSelectPaymode('gateway', '', '');
echo $list_paymode;
?>
	
       
            </div>
            <div class="form-group">
            <div class="input-group">
                <input type="submit" value="<?php 
echo JText::_('COM_JBLANCE_CONTINUE');
?>
" class="btn btn-success" />
            </div>
            </div>
        <p class="help-block">
                        <?php 
echo JText::sprintf('COM_JBLANCE_MINIMUM_DEPOSIT_AMOUNT_IS', JblanceHelper::formatCurrency($minFund));
?>
                </p>
            <input type="hidden" name="option" value="com_jblance" />			
            <input type="hidden" name="task" value="membership.savedepositfund" />	
            <?php 
echo JHtml::_('form.token');
?>
        </form>
    </div>
</div>