本文整理汇总了PHP中Helpers::logData方法的典型用法代码示例。如果您正苦于以下问题:PHP Helpers::logData方法的具体用法?PHP Helpers::logData怎么用?PHP Helpers::logData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Helpers
的用法示例。
在下文中一共展示了Helpers::logData方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: SaveCampaignSummary
public function SaveCampaignSummary()
{
$rules = array('listing_logo' => 'required', 'business_name' => 'required|between:1,50', 'business_summary' => 'required|between:2,140', 'min_investment' => 'required|numeric', 'money_valuation' => 'numeric', 'max_investment' => 'required|numeric', 'money_util' => 'required|between:2,300', 'categories' => 'required', 'website_address' => 'url', 'facebook_address' => 'url', 'twitter_address' => 'url', 'linkedin_address' => 'url');
$validator = Validator::make(Input::all(), $rules);
// check if the validator failed -----------------------
if ($validator->fails()) {
return Redirect::to(URL::previous())->withErrors($validator)->withInput()->with('activetab', Input::get('activetab'));
} else {
Helpers::logData("Saving Campaign Summary");
if (Helpers::isNewCampaign(Input::get('campaign'), 1)) {
DB::table('tbl_campaign_summary')->insert(array('campaign_id' => Input::get('campaign'), 'business_name' => Input::get('business_name'), 'business_summary' => Input::get('business_summary'), 'min_investment' => Input::get('min_investment'), 'percent_equity' => Input::get('min_inv_percent'), 'pre_money_valuation' => Input::get('money_valuation'), 'max_investment' => Input::get('max_investment'), 'max_percent_equity' => Input::get('max_inv_percent'), 'money_use' => Input::get('money_util'), 'categories' => Input::get('categories'), 'facebook' => Input::get('facebook_address'), 'twitter' => Input::get('twitter_address'), 'linkedin' => Input::get('linkedin_address'), 'website' => Input::get('website_address')));
} else {
DB::table('tbl_campaign_summary')->where('campaign_id', Input::get('campaign'))->update(array('business_name' => Input::get('business_name'), 'business_summary' => Input::get('business_summary'), 'min_investment' => Input::get('min_investment'), 'percent_equity' => Input::get('min_inv_percent'), 'pre_money_valuation' => Input::get('money_valuation'), 'max_investment' => Input::get('max_investment'), 'max_percent_equity' => Input::get('max_inv_percent'), 'money_use' => Input::get('money_util'), 'categories' => Input::get('categories'), 'facebook' => Input::get('facebook_address'), 'twitter' => Input::get('twitter_address'), 'linkedin' => Input::get('linkedin_address'), 'website' => Input::get('website_address')));
}
return Redirect::to(URL::route('campaign_info', array('campaign' => Input::get('campaign'))))->with('activetab', Input::get('activetab'));
}
}
示例2: SendChat
public function SendChat()
{
/*
* get the recipient
*/
if (Input::get('contact_list') == '') {
$target = DB::select("SELECT target_user_id,source_user_id from mradi_messages where message_hash = ?", array(Input::get('message_')));
$target = $target[0]->source_user_id == Session::get('account_id') ? $target[0]->target_user_id : $target[0]->source_user_id;
} else {
$target = Input::get('contact_list');
}
$source = Session::get('account_id');
DB::select("update mradi_messages set message_hash=? where (source_user_id = ? and target_user_id = ?) \n or (source_user_id = ? and target_user_id = ?)", array(Input::get('message_'), $source, $target, $target, $source));
$queries = DB::getQueryLog();
$last_query = end($queries);
Helpers::logData(print_r($last_query, true));
DB::table('mradi_messages')->insert(array('target_user_id' => $target, 'source_user_id' => Session::get('account_id'), 'message' => Input::get('message'), 'message_hash' => Input::get('message_')));
if (Input::get('contact_list') != '') {
return Redirect::to(URL::previous());
} else {
return Response::make('OK', 200);
}
}
示例3: validateUser
public function validateUser()
{
$email = Input::get('_username');
$password = hash('sha256', Input::get('_password'));
$account_type = Input::get('account_type') == 'other' ? 'Admin' : Input::get('account_type');
$results = DB::select("select * from accounts_dbx where email_address = ? and password = ? and account_type = ?", array($email, $password, $account_type));
if (empty($results)) {
Helpers::logAction($email . " attempted to login as " . $account_type, false);
Helpers::logData("select * from accounts_dbx where email_address = {$email} and password = {$password} and account_type = {$account_type}");
Session::flash('login_message', '<div class="alert alert-danger" style="width: 500px;">Error login! Please try again</div>');
return Redirect::route('login');
} else {
$status = '';
foreach ($results as $item) {
Session::put('email_address', $item->email_address);
Session::put('account_id', $item->account_id);
Session::put('username', $item->email_address);
Session::put('firstname', $item->firstname);
Session::put('fullnames', $item->firstname . " " . $item->lastname);
Session::put('membersince', date("M. Y", strtotime($item->date_created)));
Session::put('country', $item->country);
Session::put('gender', $item->gender);
Session::put('phone_no', $item->phone);
Session::put('account_type', $item->account_type);
Session::put('rec_per_page', Helpers::getGlobalValue('RECORDS_PER_PAGE'));
Session::put('template_price', Helpers::getGlobalValue('TEMPLATE_COST'));
$status = $item->account_status;
}
Helpers::logAction("Logged in successfully");
if ($status == 'ACTIVE') {
return Redirect::route('dashboard');
} else {
Session::flash('login_message', '<div class="alert alert-danger" style="width: 500px;">Error login! Account hasn\'t been activated yet</div>');
return Redirect::route('login');
}
}
}