本文整理汇总了PHP中SiteHelpers类的典型用法代码示例。如果您正苦于以下问题:PHP SiteHelpers类的具体用法?PHP SiteHelpers怎么用?PHP SiteHelpers使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SiteHelpers类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: postSave
function postSave($id = 0)
{
$trackUri = $this->data['trackUri'];
$rules = $this->validateForm();
$validator = Validator::make(Input::all(), $rules);
if ($validator->passes()) {
$data = $this->validatePost('tb_groups');
$ID = $this->model->insertRow($data, Input::get('group_id'));
// Input logs
if (Input::get('group_id') == '') {
$this->inputLogs("New Entry row with ID : {$ID} , Has Been Save Successfull");
$id = SiteHelpers::encryptID($ID);
} else {
$this->inputLogs(" ID : {$ID} , Has Been Changed Successfull");
}
// Redirect after save
$md = str_replace(" ", "+", Input::get('md'));
$redirect = !is_null(Input::get('apply')) ? 'groups/add/' . $id . '?md=' . $md . $trackUri : 'groups?md=' . $md . $trackUri;
return Redirect::to($redirect)->with('messagetext', Lang::get('core.note_success'))->with('msgstatus', 'success');
} else {
$md = str_replace(" ", "+", Input::get('md'));
return Redirect::to('groups/add/' . $id . '?md=' . $md)->with('messagetext', Lang::get('core.note_error'))->with('msgstatus', 'error')->withErrors($validator)->withInput();
}
}
开发者ID:buguelos,项目名称:make,代码行数:24,代码来源:GroupsController.php
示例2: getIndex
public function getIndex(Request $request)
{
$sort = !is_null($request->input('sort')) ? $request->input('sort') : '';
$order = !is_null($request->input('order')) ? $request->input('order') : 'asc';
// End Filter sort and order for query
// Filter Search for query
$filter = !is_null($request->input('search')) ? '' : '';
$page = $request->input('page', 1);
$params = array('page' => $page, 'limit' => !is_null($request->input('rows')) ? filter_var($request->input('rows'), FILTER_VALIDATE_INT) : static::$per_page, 'sort' => $sort, 'order' => $order, 'params' => $filter, 'global' => isset($this->access['is_global']) ? $this->access['is_global'] : 0);
// Get Query
$results = $this->model->getRows($params);
// Build pagination setting
$page = $page >= 1 && filter_var($page, FILTER_VALIDATE_INT) !== false ? $page : 1;
$pagination = new Paginator($results['rows'], $results['total'], $params['limit']);
$pagination->setPath('esireport');
$this->data['rowData'] = $results['rows'];
// Build Pagination
$this->data['pagination'] = $pagination;
// Build pager number and append current param GET
$this->data['pager'] = $this->injectPaginate();
// Row grid Number
$this->data['i'] = $page * $params['limit'] - $params['limit'];
// Grid Configuration
$this->data['tableGrid'] = $this->info['config']['grid'];
$this->data['tableForm'] = $this->info['config']['forms'];
$this->data['colspan'] = \SiteHelpers::viewColSpan($this->info['config']['grid']);
// Group users permission
$this->data['access'] = $this->access;
// Detail from master if any
// Master detail link if any
$this->data['subgrid'] = isset($this->info['config']['subgrid']) ? $this->info['config']['subgrid'] : array();
// Render into template
return view('esireport.index', $this->data);
}
开发者ID:vtvmd2015,项目名称:Base-App,代码行数:34,代码来源:EsireportController.php
示例3: dc_addition
public static function dc_addition($id)
{
//get the delivery object
$delivery_object = DB::table('tb_request_delivery')->where('id', $id)->first();
$user_id = \SiteHelpers::getUserIdFromCustomerId($delivery_object->cid);
DB::table('tb_request_delivery')->where('id', $id)->update(['parcel_delivery_code' => \SiteHelpers::delivery_code($user_id)]);
}
开发者ID:sonoftheweb,项目名称:yallatracking_app,代码行数:7,代码来源:Viewdeliveries.php
示例4: postSave
function postSave(Request $request, $id = 0)
{
$rules = array('menu_name' => 'required', 'active' => 'required', 'menu_type' => 'required', 'position' => 'required');
$validator = Validator::make($request->all(), $rules);
if ($validator->passes()) {
$pos = $request->input('position');
$data = $this->validatePost('tb_menu');
if (CNF_MULTILANG == 1) {
$lang = \SiteHelpers::langOption();
$language = array();
foreach ($lang as $l) {
if ($l['folder'] != 'en') {
$menu_lang = isset($_POST['language_title'][$l['folder']]) ? $_POST['language_title'][$l['folder']] : '';
$language['title'][$l['folder']] = $menu_lang;
}
}
$data['menu_lang'] = json_encode($language);
}
$arr = array();
$groups = \DB::table('tb_groups')->get();
foreach ($groups as $g) {
$arr[$g->group_id] = isset($_POST['groups'][$g->group_id]) ? "1" : "0";
}
$data['access_data'] = json_encode($arr);
$data['allow_guest'] = $request->input('allow_guest');
$this->model->insertRow($data, $request->input('menu_id'));
return Redirect::to('sximo/menu?pos=' . $pos)->with('messagetext', 'Data Has Been Save Successfull')->with('msgstatus', 'success');
} else {
return Redirect::to('sximo/menu?pos=' . $pos)->with('messagetext', 'The following errors occurred')->with('msgstatus', 'error')->withErrors($validator)->withInput();
}
}
开发者ID:alvarobfdev,项目名称:applog,代码行数:31,代码来源:MenuController.php
示例5: getIndex
public function getIndex()
{
if ($this->access['is_view'] == 0) {
return Redirect::to('')->with('message', SiteHelpers::alert('error', ' Your are not allowed to access the page '));
}
// Filter sort and order for query
$sort = !is_null(Input::get('sort')) ? Input::get('sort') : '';
$order = !is_null(Input::get('order')) ? Input::get('order') : 'asc';
// End Filter sort and order for query
// Filter Search for query
$filter = !is_null(Input::get('search')) ? $this->buildSearch() : '';
// End Filter Search for query
$page = Input::get('page', 1);
$params = array('page' => $page, 'limit' => !is_null(Input::get('rows')) ? filter_var(Input::get('rows'), FILTER_VALIDATE_INT) : static::$per_page, 'sort' => $sort, 'order' => $order, 'params' => $filter, 'global' => isset($this->access['is_global']) ? $this->access['is_global'] : 0);
// Get Query
$results = $this->model->getRows($params);
// Build pagination setting
$page = $page >= 1 && filter_var($page, FILTER_VALIDATE_INT) !== false ? $page : 1;
$pagination = Paginator::make($results['rows'], $results['total'], $params['limit']);
$this->data['rowData'] = $results['rows'];
// Build Pagination
$this->data['pagination'] = $pagination;
// Build pager number and append current param GET
$this->data['pager'] = $this->injectPaginate();
// Row grid Number
$this->data['i'] = $page * $params['limit'] - $params['limit'];
// Grid Configuration
$this->data['tableGrid'] = $this->info['config']['grid'];
$this->data['tableForm'] = $this->info['config']['forms'];
$this->data['colspan'] = SiteHelpers::viewColSpan($this->info['config']['grid']);
// Group users permission
$this->data['access'] = $this->access;
// Render into template
$this->layout->nest('content', 'rinvoices.index', $this->data)->with('menus', SiteHelpers::menus());
}
开发者ID:blackorwhite1233,项目名称:fakekinhdoanh,代码行数:35,代码来源:RinvoicesController.php
示例6: postData
public function postData()
{
if ($this->access['is_view'] == 0) {
echo SiteHelpers::alert('error', Lang::get('core.note_restric'));
die;
}
$sort = !is_null(Input::get('sort')) ? Input::get('sort') : $this->info['setting']['orderby'];
$order = !is_null(Input::get('order')) ? Input::get('order') : $this->info['setting']['ordertype'];
$filter = !is_null(Input::get('search')) ? $this->buildSearch() : '';
$page = Input::get('page', 1);
$params = array('page' => $page, 'limit' => !is_null(Input::get('rows')) ? filter_var(Input::get('rows'), FILTER_VALIDATE_INT) : $this->info['setting']['perpage'], 'sort' => $sort, 'order' => $order, 'params' => $filter, 'global' => isset($this->access['is_global']) ? $this->access['is_global'] : 0);
$results = $this->model->getRows($params);
$this->data['param'] = $params;
$this->data['rowData'] = $results['rows'];
$this->data['tableGrid'] = $this->info['config']['grid'];
$this->data['tableForm'] = $this->info['config']['forms'];
$this->data['access'] = $this->access;
$this->data['subgrid'] = isset($this->info['config']['subgrid']) ? $this->info['config']['subgrid'] : array();
$this->data['masterdetail'] = $this->masterDetailParam();
// Build pagination setting
$page = $page >= 1 && filter_var($page, FILTER_VALIDATE_INT) !== false ? $page : 1;
$pagination = Paginator::make($results['rows'], $results['total'], $params['limit']);
// Build Pagination
$this->data['pagination'] = $pagination;
// Build pager number and append current param GET
$this->data['pager'] = $this->injectPaginate();
// Row grid Number
$this->data['i'] = $page * $params['limit'] - $params['limit'];
return View::make('areportinvoices.table', $this->data);
}
开发者ID:blackorwhite1233,项目名称:fakekinhdoanh,代码行数:30,代码来源:AreportinvoicesController.php
示例7: getDelete
public function getDelete($id = null)
{
if (!is_null($id)) {
$id = SiteHelpers::encryptID($id, true);
PlotModel::where('id', $id)->delete();
return Redirect::to('plot')->with('message', SiteHelpers::alert('success', "Data deleted esuccessfully"));
}
}
开发者ID:alphatelradius,项目名称:histogram-tool,代码行数:8,代码来源:PlotController.php
示例8: getDelete
public function getDelete($id = null)
{
if (!is_null($id)) {
$id = SiteHelpers::encryptID($id, true);
$del = FileModel::where('id', $id)->first();
@unlink(public_path('uploads/' . $del->filename));
FileModel::where('id', $id)->delete();
return Redirect::to('files')->with('message', SiteHelpers::alert('success', "Data deleted successfully"));
}
}
开发者ID:alphatelradius,项目名称:histogram-tool,代码行数:10,代码来源:FilesController.php
示例9: getDestroy
public function getDestroy()
{
$ids = Input::get('del');
$i = 0;
foreach ($ids as $id) {
$del = FileModel::where('id', $id)->first();
@unlink(public_path('uploads/' . $del->filename));
FileModel::where('id', $id)->delete();
$i++;
}
return Redirect::to('files')->with('message', SiteHelpers::alert('success', $i . " Data deleted successfully"));
}
开发者ID:alphatelradius,项目名称:histogram-tool,代码行数:12,代码来源:FilesController.php
示例10: view
public static function view($class)
{
$id = Input::get('id');
$id = SiteHelpers::encryptID($id, true);
$results = $class::getRow($id);
if (count($results) >= 1) {
$config = $class::makeInfo($class);
$data['tableGrid'] = $config['config']['grid'];
$data['row'] = $results;
return View::make('public.view', $data);
} else {
return "NO PAGE FOUND !";
}
}
开发者ID:buguelos,项目名称:make,代码行数:14,代码来源:PublicHelpers.php
示例11: getShow
function getShow($id = null)
{
if ($this->access['is_detail'] == 0) {
return Redirect::to('')->with('message', SiteHelpers::alert('error', ' Your are not allowed to access the page '));
}
$ids = $id == null ? '' : SiteHelpers::encryptID($id, true);
$row = $this->model->getRow($ids);
if ($row) {
$this->data['row'] = $row;
} else {
$this->data['row'] = $this->model->getColumnTable('tb_users');
}
$this->data['id'] = $id;
$this->data['access'] = $this->access;
$this->layout->nest('content', 'users.view', $this->data)->with('menus', $this->menus);
}
开发者ID:buguelos,项目名称:make,代码行数:16,代码来源:UsersController.php
示例12: index
public function index(Request $request)
{
$check = self::authentication($request);
if (is_array($check)) {
return \Response::json($check);
} else {
$class = ucwords($request->input('module'));
$config = $this->model->makeInfo($class);
$tables = $config['config']['grid'];
$page = (!is_null($request->input('page')) or $request->input('page') != 0) ? $request->input('page') : 1;
$param = array('page' => $page, 'sort' => '', 'order' => 'asc', 'limit' => '');
if (!is_null($request->input('limit')) or $request->input('limit') != 0) {
$param['limit'] = $request->input('limit');
}
if (!is_null($request->input('order'))) {
$param['order'] = $request->input('order');
}
if (!is_null($request->input('sort'))) {
$param['sort'] = $request->input('sort');
}
$results = $this->model->getRows($param);
$json = array();
foreach ($results['rows'] as $row) {
$rows = array();
foreach ($tables as $table) {
$conn = isset($table['conn']) ? $table['conn'] : array();
$rows[$table['field']] = \SiteHelpers::gridDisplay($row->{$table}['field'], $table['field'], $conn);
//$rows[$table['field']] = '';
}
$json[] = $rows;
}
$jsonData = array('total' => $results['total'], 'rows' => $json, 'control' => $param, 'key' => $config['key']);
if (!is_null($request->input('option')) && $request->input('option') == 'true') {
$label = array();
foreach ($tables as $table) {
$label[] = $table['label'];
}
$field = array();
foreach ($tables as $table) {
$field[] = $table['field'];
}
$jsonData['option'] = array('label' => $label, 'field' => $field);
}
return \Response::json($jsonData, 200);
}
}
开发者ID:Gadurp1,项目名称:420windycity,代码行数:46,代码来源:SximoapiController.php
示例13: get_zip_content
public static function get_zip_content($name, $zip)
{
$contents = '';
if (file_exists($zip)) {
$fp = fopen('zip://' . $zip . '#' . $name, 'r');
if (!$fp) {
SiteHelpers::alert("error", "cannot open zip file: {$zip}n");
}
while (!feof($fp)) {
$contents .= fread($fp, 2);
}
} else {
SiteHelpers::alert("error", "cannot find zip file: {$zip}n");
}
fclose($fp);
return $contents;
}
开发者ID:blackorwhite1233,项目名称:fakekinhdoanh,代码行数:17,代码来源:SximoHelpers.php
示例14: delete_action
public static function delete_action($ids)
{
foreach ($ids as $id) {
//get the customer ID and User ID
$delivery_object = DB::table('tb_request_delivery')->where('id', $id)->first();
$customer_id = $delivery_object->cid;
$user_id = \SiteHelpers::getUserIdFromCustomerId($customer_id);
$bill = DB::table('tb_bills')->where('delivery_id', $id)->get();
if (count($bill) == 1) {
$bill_amount = $bill[0]->bill;
//refund now
if (\SiteHelpers::is_payg_customer()) {
DB::table('tb_payg_balance')->where('user_id', $user_id)->increment('balance', $bill_amount);
//remove the bill
self::remove_bills($id);
}
}
}
}
开发者ID:sonoftheweb,项目名称:yallatracking_app,代码行数:19,代码来源:Getdeliveries.php
示例15: makeInfo
static function makeInfo($id)
{
$row = \DB::table('tb_module')->where('module_name', $id)->get();
$data = array();
foreach ($row as $r) {
$data['id'] = $r->module_id;
$data['title'] = $r->module_title;
$data['note'] = $r->module_note;
$data['table'] = $r->module_db;
$data['key'] = $r->module_db_key;
$data['config'] = \SiteHelpers::CF_decode_json($r->module_config);
$field = array();
foreach ($data['config']['grid'] as $fs) {
foreach ($fs as $f) {
$field[] = $fs['field'];
}
}
$data['field'] = $field;
}
return $data;
}
开发者ID:vinodjoshi,项目名称:laravel,代码行数:21,代码来源:Sximo.php
示例16: submitcontact
function submitcontact()
{
$rules = array(array('field' => 'name', 'label' => ' Please Fill Name', 'rules' => 'required'), array('field' => 'email', 'label' => 'email ', 'rules' => 'required|email'), array('field' => 'message', 'label' => 'message', 'rules' => 'required'));
$this->form_validation->set_rules($rules);
if ($this->form_validation->run()) {
$data = array('name' => $this->input->post('name', true), 'email' => $this->input->post('email', true), 'subject' => 'New Form Submission', 'notes' => $this->input->post('message', true));
$message = $this->load->view('emails/contact', $data, true);
$to = CNF_EMAIL;
$subject = 'New Form Submission';
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: ' . $this->input->post('name', true) . ' <' . $this->input->post('sender', true) . '>' . "\r\n";
//mail($to, $subject, $message, $headers);
$message = "Thank You , Your message has been sent !";
$this->session->set_flashdata('message', SiteHelpers::alert('success', $message));
redirect('contact-us', 301);
} else {
$message = "The following errors occurred";
$this->session->set_flashdata(array('message' => SiteHelpers::alert('error', $message), 'errors' => validation_errors('<li>', '</li>')));
redirect('contact-us', 301);
}
}
开发者ID:HRVConsultores,项目名称:elearning,代码行数:22,代码来源:page.php
示例17: getIndex
public function getIndex(Request $request)
{
if ($this->access['is_view'] == 0) {
return Redirect::to('admin/dashboard')->with('messagetext', \Lang::get('core.note_restric'))->with('msgstatus', 'error');
}
$sort = !is_null($request->input('sort')) ? $request->input('sort') : 'id';
$order = !is_null($request->input('order')) ? $request->input('order') : 'asc';
// End Filter sort and order for query
// Filter Search for query
$filter = !is_null($request->input('search')) ? '' : '';
$filter .= " AND tb_users.group_id >= '" . \Session::get('gid') . "'";
$page = $request->input('page', 1);
$params = array('page' => $page, 'limit' => !is_null($request->input('rows')) ? filter_var($request->input('rows'), FILTER_VALIDATE_INT) : static::$per_page, 'sort' => $sort, 'order' => $order, 'params' => $filter, 'global' => isset($this->access['is_global']) ? $this->access['is_global'] : 0);
// Get Query
$results = $this->model->getRows($params);
// Build pagination setting
$page = $page >= 1 && filter_var($page, FILTER_VALIDATE_INT) !== false ? $page : 1;
$pagination = new Paginator($results['rows'], $results['total'], $params['limit']);
$pagination->setPath('users');
$this->data['rowData'] = $results['rows'];
// Build Pagination
$this->data['pagination'] = $pagination;
// Build pager number and append current param GET
$this->data['pager'] = $this->injectPaginate();
// Row grid Number
$this->data['i'] = $page * $params['limit'] - $params['limit'];
// Grid Configuration
$this->data['tableGrid'] = $this->info['config']['grid'];
$this->data['tableForm'] = $this->info['config']['forms'];
$this->data['colspan'] = \SiteHelpers::viewColSpan($this->info['config']['grid']);
// Group users permission
$this->data['access'] = $this->access;
// Detail from master if any
// Master detail link if any
$this->data['subgrid'] = isset($this->info['config']['subgrid']) ? $this->info['config']['subgrid'] : array();
// Render into template
return view('admin.core.users.index', $this->data);
}
开发者ID:Yashwanth1,项目名称:aregudam,代码行数:38,代码来源:UsersController.php
示例18: makeInfo
static function makeInfo($id)
{
$row = \DB::table('tb_module')->where('module_name', $id)->get();
$data = array();
foreach ($row as $r) {
$langs = json_decode($r->module_lang, true);
$data['id'] = $r->module_id;
$data['title'] = \SiteHelpers::infoLang($r->module_title, $langs, 'title');
$data['note'] = \SiteHelpers::infoLang($r->module_note, $langs, 'note');
$data['table'] = $r->module_db;
$data['key'] = $r->module_db_key;
$data['config'] = \SiteHelpers::CF_decode_json($r->module_config);
$field = array();
foreach ($data['config']['grid'] as $fs) {
foreach ($fs as $f) {
$field[] = $fs['field'];
}
}
$data['field'] = $field;
$data['setting'] = array('gridtype' => isset($data['config']['setting']['gridtype']) ? $data['config']['setting']['gridtype'] : 'native', 'orderby' => isset($data['config']['setting']['orderby']) ? $data['config']['setting']['orderby'] : $r->module_db_key, 'ordertype' => isset($data['config']['setting']['ordertype']) ? $data['config']['setting']['ordertype'] : 'asc', 'perpage' => isset($data['config']['setting']['perpage']) ? $data['config']['setting']['perpage'] : '10', 'frozen' => isset($data['config']['setting']['frozen']) ? $data['config']['setting']['frozen'] : 'false', 'form-method' => isset($data['config']['setting']['form-method']) ? $data['config']['setting']['form-method'] : 'native', 'view-method' => isset($data['config']['setting']['view-method']) ? $data['config']['setting']['view-method'] : 'native', 'inline' => isset($data['config']['setting']['inline']) ? $data['config']['setting']['inline'] : 'false');
}
return $data;
}
开发者ID:vtvmd2015,项目名称:symtec,代码行数:23,代码来源:Sximo.php
示例19: postDestroy
public function postDestroy()
{
if ($this->access['is_remove'] == 0) {
return Redirect::to('')->with('message', SiteHelpers::alert('error', Lang::get('core.note_restric')));
}
// delete multipe rows
//$this->model->destroy(Input::get('id'));
foreach (Input::get('id') as $idpro) {
$data_pro = $this->model->getRow($idpro);
@unlink(ROOT . '/uploads/advertise/' . $data_pro->image);
@unlink(ROOT . '/uploads/advertise/thumb/' . $data_pro->image);
}
$this->model->destroy(Input::get('id'));
$this->inputLogs("ID : " . implode(",", Input::get('id')) . " , Has Been Removed Successfull");
// redirect
Session::flash('message', SiteHelpers::alert('success', Lang::get('core.note_success_delete')));
return Redirect::to('advertise?md=' . Input::get('md'));
}
开发者ID:blackorwhite1233,项目名称:fakekinhdoanh,代码行数:18,代码来源:AdvertiseController.php
示例20: postDelete
public function postDelete(Request $request)
{
if ($this->access['is_remove'] == 0) {
return Redirect::to('dashboard')->with('messagetext', \Lang::get('core.note_restric'))->with('msgstatus', 'error');
}
// delete multipe rows
if (count($request->input('id')) >= 1) {
$this->model->destroy($request->input('id'));
\SiteHelpers::auditTrail($request, "ID : " . implode(",", $request->input('id')) . " , Has Been Removed Successfull");
// redirect
return Redirect::to('itemvariant')->with('messagetext', \Lang::get('core.note_success_delete'))->with('msgstatus', 'success');
} else {
return Redirect::to('itemvariant')->with('messagetext', 'No Item Deleted')->with('msgstatus', 'error');
}
}
开发者ID:KimTakBong,项目名称:L0133T,代码行数:15,代码来源:ItemvariantController.php
注:本文中的SiteHelpers类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论