当前位置: 首页>>代码示例>>PHP>>正文


PHP Sample::update方法代码示例

本文整理汇总了PHP中Sample::update方法的典型用法代码示例。如果您正苦于以下问题:PHP Sample::update方法的具体用法?PHP Sample::update怎么用?PHP Sample::update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Sample的用法示例。


在下文中一共展示了Sample::update方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: postStore

 public function postStore()
 {
     $postData = Input::all();
     $rules = array('userName' => 'required|min:5', 'userEmail' => 'required|email', 'userMobile' => 'required|min:10|numeric', 'userAddress1' => 'required', 'userAddress2' => 'required', 'userPincode' => 'required|min:6|numeric', 'userCity' => 'required', 'userState' => 'required', 'userId' => 'required|alphanum');
     $validator = Validator::make($postData, $rules);
     if ($validator->fails()) {
         return Redirect::to('admin/profile')->withInput()->withErrors($validator);
     } else {
         if (Input::has('userKey')) {
             $rulespass = array('userKey' => 'required|min:6|alphanum', 'cpass' => 'required|min:6|same:userKey');
             $validator1 = Validator::make($postData, $rulespass);
             if ($validator1->fails()) {
                 return Redirect::to('admin/profile')->withInput()->withErrors($validator1);
             } else {
                 $input = json_encode(Input::except('_token', 'cpass'));
                 $update = Sample::update($input);
                 //print_r($update);exit;
                 if ($update && $update->status == "success") {
                     return Redirect::to('admin/profile')->with('success', $update->message);
                 } else {
                     return Redirect::to('admin/profile')->with('failure', "something went wrong");
                 }
             }
         } else {
             $input = json_encode(Input::except('_token', 'userKey', 'cpass'));
             $update = Sample::update($input);
             //print_r($update);exit;
             if ($update && $update->status == "success") {
                 return Redirect::to('admin/profile')->with('success', $update->message);
             } else {
                 return Redirect::to('admin/profile')->with('failure', "something went wrong");
             }
         }
     }
 }
开发者ID:arctic-dev,项目名称:appandukan-php,代码行数:35,代码来源:AdminController.php

示例2: postStore

 public function postStore()
 {
     $postData = Input::all();
     $rules = array('userName' => 'required|min:5', 'userEmail' => 'required|email', 'userMobile' => 'required|min:10|numeric', 'userAddress1' => 'required', 'userAddress2' => 'required', 'userPincode' => 'required|min:6|numeric', 'userCity' => 'required', 'userState' => 'required', 'userId' => 'required|alphanum', 'prodCode' => 'required');
     $validator = Validator::make($postData, $rules);
     if ($validator->fails()) {
         return Redirect::to('admin/subretailer/show/' . Input::get('userIdPk'))->withInput()->withErrors($validator);
     } else {
         if (Input::has('userKey')) {
             $rulespass = array('userKey' => 'required|min:6|alphanum', 'cpass' => 'required|min:6|same:userKey');
             $validator1 = Validator::make($postData, $rulespass);
             if ($validator1->fails()) {
                 return Redirect::to('admin/subretailer/show/' . Input::get('userIdPk'))->withInput()->withErrors($validator1);
             } else {
                 $input = json_encode(Input::except('_token', 'cpass'));
                 $data = Input::get('prodCode');
                 //print_r($data);
                 foreach ($data as $prodcode) {
                     $products[] = array('prodCode' => $prodcode, 'prodStatus' => '1');
                 }
                 $prodCodes = array('products' => $products);
                 //print_r(json_encode($prodCodes));
                 //
                 $input = json_encode(Input::except('prodCode', 'check-all', 'cpass'));
                 $finaloutput = array_merge(Input::except('_token', 'prodCode', 'check-all', 'cpass'), $prodCodes);
                 $op1 = json_encode($finaloutput);
                 //echo $op1;
                 $update = Sample::update($op1);
                 //print_r($update);exit;
                 if ($update && $update->status == "success") {
                     return Redirect::to('admin/subretailer/manageview')->with('success', $update->message);
                 } else {
                     return Redirect::to('admin/subretailer/show/' . Input::get('userIdPk'))->with('failure', "something went wrong");
                 }
             }
         } else {
             $input = json_encode(Input::except('_token', 'userKey', 'cpass'));
             //print_r($input);
             $data = Input::get('prodCode');
             //print_r($data);
             foreach ($data as $prodcode) {
                 $products[] = array('prodCode' => $prodcode, 'prodStatus' => '1');
             }
             $prodCodes = array('products' => $products);
             //print_r(json_encode($prodCodes));
             //
             $input = json_encode(Input::except('prodCode', 'check-all', 'cpass'));
             $finaloutput = array_merge(Input::except('_token', 'prodCode', 'userKey', 'check-all', 'cpass'), $prodCodes);
             $op1 = json_encode($finaloutput);
             //echo $op1;
             $update = Sample::update($op1);
             //print_r($update);exit;
             if ($update && $update->status == "success") {
                 return Redirect::to('admin/subretailer/manageview')->with('success', $update->message);
             } else {
                 return Redirect::to('admin/subretailer/show/' . Input::get('userIdPk'))->with('failure', "something went wrong");
             }
         }
     }
 }
开发者ID:arctic-dev,项目名称:appandukan-php,代码行数:60,代码来源:AdminsubretailerController.php


注:本文中的Sample::update方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。