本文整理汇总了PHP中SiteHelpers::encryptID方法的典型用法代码示例。如果您正苦于以下问题:PHP SiteHelpers::encryptID方法的具体用法?PHP SiteHelpers::encryptID怎么用?PHP SiteHelpers::encryptID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SiteHelpers
的用法示例。
在下文中一共展示了SiteHelpers::encryptID方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
}
示例2: 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"));
}
}
示例3: 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"));
}
}
示例4: 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 !";
}
}
示例5: getShow
function getShow($id = null)
{
if ($this->access['is_detail'] == 0) {
return Redirect::to('')->with('message', SiteHelpers::alert('error', Lang::get('core.note_restric')));
}
$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_groups');
}
$this->data['id'] = $id;
$this->data['access'] = $this->access;
$this->layout->nest('content', 'groups.view', $this->data)->with('menus', $this->menus);
}
示例6: 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);
}
示例7: postSave
function postSave($id = 0)
{
//$trackUri = $this->data['trackUri'];
$rules = $this->validateForm();
$validator = Validator::make(Input::all(), $rules);
if ($validator->passes()) {
$data = $this->getDataPost('orders');
unset($data['lang']);
$ID = $this->model->insertRow($data, Input::get('OrderID'));
// Input logs
if (Input::get('OrderID') == '') {
$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')) ? 'order/add/' . $id . '?md=' . $md : 'order?md=';
return Redirect::to($redirect)->with('message', SiteHelpers::alert('success', Lang::get('core.note_success')));
} else {
return Redirect::to('order/add/' . $id . '?md=' . $md)->with('message', SiteHelpers::alert('error', Lang::get('core.note_error')))->withErrors($validator)->withInput();
}
}
示例8: postSave
function postSave($id = 0)
{
$trackUri = $this->data['trackUri'];
//$rules = $this->validateForm();
$validator = Validator::make(Input::all(), Ncategories::$rules);
SiteHelpers::globalXssClean();
if ($validator->passes()) {
if (!is_null(Input::file('file'))) {
$file = Input::file('file');
$destinationPath = ROOT . '/uploads/categories/';
$filename = $file->getClientOriginalName();
$extension = $file->getClientOriginalExtension();
//if you need extension of the file
$newfilename = Input::get('CategoryName') . '_' . time() . '.' . $extension;
$uploadSuccess = Input::file('file')->move($destinationPath, $newfilename);
if ($uploadSuccess) {
$data['Picture'] = $newfilename;
$orgFile = $destinationPath . '/' . $newfilename;
$thumbFile = $destinationPath . '/thumb/' . $newfilename;
//SiteHelpers::cropImage($this->img_width , $this->img_height , $orgFile , $extension, $thumbFile);
SiteHelpers::resizewidth("180", $orgFile, $thumbFile);
if (Input::get('action') != "") {
$data_old = $this->model->getRow(Input::get('action'));
@unlink(ROOT . '/uploads/categories/' . $data_old->Picture);
@unlink(ROOT . '/uploads/categories/thumb/' . $data_old->Picture);
}
}
}
$data['postion'] = Input::get('postion');
$data['CategoryName'] = Input::get('CategoryName');
$data['Description'] = Input::get('Description');
$data['lang'] = $this->lang;
$data['created'] = time();
$data['status'] = Input::get('status');
$data['alias'] = SiteHelpers::seoUrl(trim($data['CategoryName']));
$data['keywords'] = Input::get('keywords');
$data['seo_meta'] = Input::get('seo_meta');
//$data = $this->validatePost('categories');
$ID = $this->model->insertRow($data, Input::get('CategoryID'));
// Input logs
if (Input::get('CategoryID') == '') {
$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')) ? 'Ncategories/add/' . $id : 'Ncategories?md=';
return Redirect::to($redirect)->with('message', SiteHelpers::alert('success', Lang::get('core.note_success')));
} else {
return Redirect::to('Ncategories/add/' . $id)->with('message', SiteHelpers::alert('error', Lang::get('core.note_error')))->withErrors($validator)->withInput();
}
}
示例9: postSave
function postSave($id = 0)
{
$trackUri = $this->data['trackUri'];
$rules = array();
$validator = Validator::make(Input::all(), $rules);
if ($validator->passes()) {
$data['post_note'] = Input::get('post_note');
$ID = Input::get('post_id');
$data_post = DB::table('post')->where('post_id', '=', $ID)->first();
if (Input::get('active') != '') {
$data['status'] = '1';
$data['active'] = Input::get('active');
$this->cus = Customer::where('customer_id', '=', $data_post->customer_id)->first();
$link = URL::to('') . "/tin/" . $data_post->post_slug . '-' . $data_post->post_id . ".html";
$data_mail = array('link' => $link);
Mail::send('emails.successpost', $data_mail, function ($message) {
$message->from(CNF_EMAIL, 'Admin');
$message->to($this->cus->email, $this->cus->name)->subject('Xác nhận tin đã đăng');
});
} else {
$data['status'] = Input::get('status');
}
DB::table('post')->where('post_id', '=', $ID)->update($data);
// Input logs
if (Input::get('post_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')) ? 'post/add/' . $id . '?md=' . $md : 'post?md=' . $md . $trackUri;
return Redirect::to($redirect)->with('message', SiteHelpers::alert('success', Lang::get('core.note_success')));
} else {
return Redirect::to('post/add/' . $id)->with('message', SiteHelpers::alert('error', Lang::get('core.note_error')))->withErrors($validator)->withInput();
}
}
示例10: postSave
function postSave($id = 0)
{
$trackUri = $this->data['trackUri'];
$rules = Nproducts::$rules;
//print_r(Input::all());die;
$validator = Validator::make(Input::all(), $rules);
//SiteHelpers::globalXssClean();
if ($validator->passes()) {
$data = $this->getDataPost('products');
if (!is_null(Input::file('file'))) {
$file = Input::file('file');
$destinationPath = './uploads/products/';
$filename = $file->getClientOriginalName();
$extension = $file->getClientOriginalExtension();
//if you need extension of the file
$newfilename = Input::get('ProductName') . '_' . time() . '.' . $extension;
$uploadSuccess = Input::file('file')->move($destinationPath, $newfilename);
if ($uploadSuccess) {
$data['image'] = $newfilename;
$orgFile = $destinationPath . '/' . $newfilename;
$thumbFile = $destinationPath . '/thumb/' . $newfilename;
SiteHelpers::resizewidth("152", $orgFile, $thumbFile);
if (Input::get('action') != "") {
$data_old = $this->model->getRow(Input::get('action'));
@unlink(ROOT . '/uploads/products/' . $data_old->Picture);
@unlink(ROOT . '/uploads/products/thumb/' . $data_old->Picture);
}
}
}
$data['SupplierID'] = "1";
$data['created'] = time();
$data['slug'] = SiteHelpers::seoUrl(trim($data['ProductName']));
$data['created'] = time();
$ID = $this->model->insertRow($data, Input::get('ProductID'));
if (Input::file('multi_file')[0] != "") {
$model_img_pro = new Imagesproduct();
$rm_image = Input::get('remove_image');
$arr_img_rm = $rm_image != "" ? $rm_image : array();
foreach ($_FILES['multi_file']['tmp_name'] as $key => $tmp_name) {
$file_name = $_FILES['multi_file']['name'][$key];
if (!in_array($file_name, $arr_img_rm)) {
$file_size = $_FILES['multi_file']['size'][$key];
$file_tmp = $_FILES['multi_file']['tmp_name'][$key];
$file_type = $_FILES['multi_file']['type'][$key];
$explode_name = explode(".", $file_name);
$path_image = './uploads/images_product/';
$newname = "image_" . $key . time() . '.' . $explode_name[1];
if (move_uploaded_file($file_tmp, $path_image . $newname)) {
$model_img_pro->insertRow(array("name" => $newname, "id_product" => $ID), "");
SiteHelpers::resizewidth("300", $path_image . $newname, $path_image . "thumb/" . $newname);
}
}
}
}
// Input logs
if (Input::get('ProductID') == '') {
$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')) ? 'Nproducts/add/' . $id . $trackUri : 'Nproducts' . $trackUri;
return Redirect::to($redirect)->with('message', SiteHelpers::alert('success', Lang::get('core.note_success')));
} else {
return Redirect::to('Nproducts/add/' . $id)->with('message', SiteHelpers::alert('error', Lang::get('core.note_error')))->withErrors($validator)->withInput();
}
}
示例11: postSave
function postSave($id = 0)
{
$trackUri = $this->data['trackUri'];
$rules = Promotion::$rules;
//$rules = $this->validateForm();
$validator = Validator::make(Input::all(), $rules);
if ($validator->passes()) {
$data = $this->getDataPost('promotion');
$data['created'] = time();
unset($data['lang']);
$ID = $this->model->insertRow($data, Input::get('id_promotion'));
if ($data['status'] == 0) {
DB::table('products')->where('id_promotion', '=', $ID)->update(array('id_promotion' => '0'));
}
// Input logs
if (Input::get('id_promotion') == '') {
$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')) ? 'Promotion/add/' . $id . '?md=' : 'Promotion?md=';
return Redirect::to($redirect)->with('message', SiteHelpers::alert('success', Lang::get('core.note_success')));
} else {
return Redirect::to('Promotion/add/' . $id . '?md=')->with('message', SiteHelpers::alert('error', Lang::get('core.note_error')))->withErrors($validator)->withInput();
}
}
示例12: 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_restapi');
if (Input::get('id') == '') {
$x = SiteHelpers::encryptID(rand(10000, 10000000));
$x .= "-" . SiteHelpers::encryptID(rand(10000, 10000000));
$data['apikey'] = $x;
$data['created'] = date("Y-m-d");
}
$ID = $this->model->insertRow($data, Input::get('id'));
// Input logs
if (Input::get('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')) ? 'restapi/add/' . $id . '?md=' . $md . $trackUri : 'restapi?md=' . $md . $trackUri;
return Redirect::to($redirect)->with('message', SiteHelpers::alert('success', Lang::get('core.note_success')));
} else {
$md = str_replace(" ", "+", Input::get('md'));
return Redirect::to('restapi/add/' . $id . '?md=' . $md)->with('message', SiteHelpers::alert('error', Lang::get('core.note_error')))->withErrors($validator)->withInput();
}
}
示例13: postSave
function postSave(Request $request)
{
$rules = $this->validateForm();
$validator = Validator::make($request->all(), $rules);
if ($validator->passes()) {
$data = $this->validatePost('tb_restapi');
if ($request->input('id') == '') {
$x = \SiteHelpers::encryptID(rand(10000, 10000000));
$x .= "-" . \SiteHelpers::encryptID(rand(10000, 10000000));
$data['apikey'] = $x;
$data['created'] = date("Y-m-d");
}
$id = $this->model->insertRow($data, $request->input('id'));
if (!is_null($request->input('apply'))) {
$return = 'restapi/update/' . $id . '?return=' . self::returnUrl();
} else {
$return = 'restapi?return=' . self::returnUrl();
}
// Insert logs into database
if ($request->input('id') == '') {
\SiteHelpers::auditTrail($request, 'New Data with ID ' . $id . ' Has been Inserted !');
} else {
\SiteHelpers::auditTrail($request, 'Data with ID ' . $id . ' Has been Updated !');
}
return Redirect::to($return)->with('messagetext', \Lang::get('core.note_success'))->with('msgstatus', 'success');
} else {
return Redirect::to('restapi/update/' . $id)->with('messagetext', \Lang::get('core.note_error'))->with('msgstatus', 'error')->withErrors($validator)->withInput();
}
}
示例14: postSave
function postSave($id = 0)
{
$trackUri = $this->data['trackUri'];
$data['status'] = Input::get('status');
$money_more = Input::get('money_more');
$money_loss = Input::get('money_loss');
$cus = $this->model->find($id);
$money = $cus['money'] + $money_more;
$money = $money < $money_loss ? 0 : $money - $money_loss;
$data['money'] = $money;
$ID = $this->model->insertRow($data, Input::get('customer_id'));
// Input logs
if (Input::get('customer_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')) ? 'Customer/add/' . $id . '?md=' : 'Customer?md=' . $md;
return Redirect::to($redirect)->with('message', SiteHelpers::alert('success', Lang::get('core.note_success')));
}
示例15: getShow
function getShow($id = null)
{
if ($this->access['is_detail'] == 0) {
echo SiteHelpers::alert('error', Lang::get('core.note_restric'));
die;
}
$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('orderdetails');
}
$this->data['subgrid'] = isset($this->info['config']['subgrid']) ? $this->info['config']['subgrid'] : array();
$this->data['id'] = $id;
$this->data['access'] = $this->access;
return View::make('aorderdetails.view', $this->data);
}