本文整理汇总了PHP中Helpers::getCampaignID方法的典型用法代码示例。如果您正苦于以下问题:PHP Helpers::getCampaignID方法的具体用法?PHP Helpers::getCampaignID怎么用?PHP Helpers::getCampaignID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Helpers
的用法示例。
在下文中一共展示了Helpers::getCampaignID方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: PublishCampaign
public function PublishCampaign()
{
$campaign_id = Request::segment(3);
if (Helpers::isCampaignComplete(Helpers::getCampaignID($campaign_id))) {
$rs = DB::select("select id,campaigname from tbl_campaigns where campaignstatus = 'draft' and approvalstatus = 'Pending' \n and uniqueid = ?", array($campaign_id));
if (count($rs[0]) > 0 && strtoupper(Session::get('account_type')) == 'ENTREPRENEUR') {
DB::table('tbl_campaigns')->where('uniqueid', $campaign_id)->update(array('campaignstatus' => 'published'));
Session::flash('_response', '<div style="width: 98%"><div class="alert alert-success alert-dismissable">
<i class="fa fa-check"></i>
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<b>' . $rs[0]->campaigname . '!</b> campaign has been published successfully.
</div></div>');
} else {
Session::flash('_response', '<div style="width: 98%"><div class="alert alert-danger alert-dismissable">
<i class="fa fa-ban"></i>
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<b>Alert!</b> campaign publishing failed. Please try again later.
</div></div>');
}
} else {
Session::flash('_response', '<div style="width: 98%"><div class="alert alert-danger alert-dismissable">
<i class="fa fa-ban"></i>
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<b>Alert!</b> campaign publishing failed. Please try again later.
</div></div>');
}
return Redirect::to(URL::previous());
}
示例2: progressCampaign
public static function progressCampaign($campaignID, $tab)
{
$campaignID = Helpers::getCampaignID($campaignID);
$rs = DB::select("Select ID from mradi_campaign_progress where campaign_id = ? and tab_id = ?", array($campaignID, $tab));
if (count($rs) <= 0) {
DB::table('mradi_campaign_progress')->insert(array('campaign_id' => $campaignID, 'tab_id' => $tab));
}
}
示例3: store
/**
* Store a newly created resource in storage.
*
* @return Response
*/
public function store()
{
//save bid
//log to file
$file = fopen(storage_path() . "/logs/trans_bids.txt", "a");
foreach (Input::all() as $k => $val) {
fwrite($file, $k . " --- " . $val . "\n");
}
fwrite($file, "\n\n *********************************** \n\n\n");
fclose($file);
//end log to file
$rules = array('bid_amt' => 'required|numeric|min:1');
$validator = Validator::make(Input::all(), $rules);
if ($validator->fails()) {
return Redirect::back()->withErrors($validator)->withInput(Input::except('password'));
} else {
// get params n process bid
$user_id = Session::get('account_id');
$min_amt = e(Input::get('min_investment'));
$max_amt = e(Input::get('max_investment'));
$total_bidded = e(Input::get('total_bidded'));
$bid_balance = e(Input::get('amt_remaining'));
$bid_amt = e(Input::get('bid_amt'));
$investor_balance = e(Input::get('investor_balance'));
$campaign_id = Helpers::getCampaignID(e(Input::get('campaign_id')));
$campaign_name = strtoupper(Helpers::getCampaignID(e(Input::get('campaign_id')), true));
$order_id = mt_rand(1010101, 9010901);
if ($investor_balance < $bid_amt) {
Session::flash('_response', '<div style="width: 98%"><div class="alert alert-danger alert-dismissable">
<i class="fa fa-check"></i>
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<b> Bidding Failed!! You do no have sufficient balance in your wallet. </b>
</div></div>');
} elseif ($bid_amt < $min_amt || $bid_amt > $max_amt) {
Session::flash('_response', '<div style="width: 98%"><div class="alert alert-danger alert-dismissable">
<i class="fa fa-check"></i>
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<b> Bidding Failed!! You must bid within the limits provided ' . $min_amt . ' <= Your Bid <= ' . $max_amt . ' </b>
</div></div>');
} elseif ($bid_amt > $bid_balance) {
Session::flash('_response', '<div style="width: 98%"><div class="alert alert-danger alert-dismissable">
<i class="fa fa-check"></i>
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<b> Bidding Failed!! Your bid is beyond maximum limit, you can only bid a max of $bid_balance. </b>
</div></div>');
} else {
//process bid
$details = Helpers::getCampaignID(e(Input::get('campaign_id')), '', true);
$entrepreneur_id = $details->user_id;
$bidTrans = new Mradicampaignbid();
$bidTrans->investor_id = Session::get('account_id');
$bidTrans->entrepreneur_id = $entrepreneur_id;
$bidTrans->campaign_id = e(Input::get('campaign_id'));
$bidTrans->order_id = $order_id;
$bidTrans->mraditransactiontype_id = 2;
$bidTrans->amount = $bid_amt;
$bidTrans->total_bidded = $total_bidded + $bid_amt;
$bidTrans->save();
//debit investor
$investor_balance = Helpers::investorBalance($user_id);
$mybid = new Mradiwallettransaction();
$mybid->user_id = Session::get('account_id');
$mybid->order_id = $order_id;
$mybid->mradicampaignbid_id = $bidTrans->id;
$mybid->campaign_id = $campaign_id;
$mybid->mraditransactiontype_id = 2;
$mybid->debit = $bid_amt;
$mybid->balance = $investor_balance - $bid_amt;
$mybid->save();
//credit entrepreneur
$entrepreneur_balance = Helpers::investorBalance($entrepreneur_id, false, $campaign_id);
$mybid = new Mradiwallettransaction();
$mybid->user_id = $entrepreneur_id;
$mybid->order_id = $order_id;
$mybid->mradicampaignbid_id = $bidTrans->id;
$mybid->campaign_id = $campaign_id;
$mybid->mraditransactiontype_id = 2;
$mybid->credit = $bid_amt;
$mybid->balance = $entrepreneur_balance + $bid_amt;
$mybid->save();
Session::flash('_response', '<div style="width: 98%"><div class="alert alert-success alert-dismissable">
<i class="fa fa-check"></i>
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<b> Transaction Successful!! Your have successfully bidded <i>' . $campaign_name . '</i> with <i>KShs. ' . number_format($bid_amt, 2) . '</i> <br /> New A/c Balance <i>KShs. ' . number_format($investor_balance - $bid_amt, 2) . '</i> </b>
</div></div>');
}
return Redirect::to('bid/' . Input::get('campaign_id'));
}
return Redirect::back();
}
示例4: array
@section('content')
<section class="content-header">
</section>
<!-- Main content -->
<section class="content">
{{ Session::get('_response') }}
<?php
if (is_null(Input::get('sid')) && is_null(Input::get('JP_PASSWORD'))) {
$transaction = array();
$transaction['user_id'] = Session::get('account_id');
$transaction['order_id'] = mt_rand(11111111, 99999999);
$transaction['amount'] = Session::get('template_price');
$transaction['campaign_id'] = e(Helpers::getCampaignID(Input::get('campaign')));
$transaction['item_name'] = "Mradi Purchase";
$res = Helpers::getTemplate($transaction);
//var_dump($res);exit;
$email = session::get('email_address');
//exit;
?>
<div class="col-md-6" id="jambo" name="jambo">
<form method="post" action="https://www.jambopay.com/JPExpress.aspx" target="_blank">
<input type="hidden" name="jp_item_type" value="cart"/>
<input type="hidden" name="jp_item_name" value="{{ $transaction['item_name'] }}"/>
<input type="hidden" name="order_id" value="{{ $transaction['order_id'] }}"/>
<input type="hidden" name="jp_business" value="demo@webtribe.co.ke"/>
<input type="hidden" name="jp_amount_1" value="{{ $transaction['amount'] }}"/>
<input type="hidden" name="jp_amount_2" value="0"/>
示例5: strtoupper
@extends('admin.layouts.default')
@section('content')
@if(Session::has('_response'))
<!-- Main content -->
<section class="content">
{{ Session::get('_response') }}
@else
<section class="content-header">
<h1>
<?php
$campaign_name = Helpers::getCampaignID($campaign_id, true);
?>
{{ "<h2>Campaign Bids for : " . strtoupper($campaign_name) . "</h2>" }}
</h1>
<div class="row" style="background-color:#DBE6E0;">
<div class="col-md-3">
<h4>
No Of Investors : {{ $investorCount }}
</h4>
</div>
<div class="col-md-5">
<h4>
Total Amount Bidded : {{ "KShs." . number_format($totalBid, 2)}}
</h4>
</div>
<div class="col-md-4">
<h4>
Balance : {{ "KShs." . number_format(($campaignValue - $totalBid),2) }}
</h4>