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


PHP Cliente::save方法代码示例

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


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

示例1: saveCliente

 public function saveCliente()
 {
     $this->load->model(array('Cliente'));
     header("Content-type: application/json");
     $postdata = file_get_contents("php://input");
     $request = json_decode($postdata);
     $cliente = new Cliente();
     if (isset($request->id)) {
         $cliente->load($request->id);
     }
     $cliente->regimen = $request->regimen->id;
     $cliente->nombre = $request->nombre;
     $cliente->apellidoMaterno = isset($request->apellidoMaterno) ? $request->apellidoMaterno : "";
     $cliente->apellidoPaterno = isset($request->apellidoPaterno) ? $request->apellidoPaterno : "";
     $cliente->rfc = isset($request->rfc) ? $request->rfc : "";
     $cliente->telefono = isset($request->telefono) ? $request->telefono : "";
     $cliente->correo = isset($request->correo) ? $request->correo : "";
     $cliente->calle = isset($request->calle) ? $request->calle : "";
     $cliente->numero = isset($request->numero) ? $request->numero : "";
     $cliente->colonia = isset($request->colonia) ? $request->colonia : "";
     $cliente->municipio = isset($request->municipio) ? $request->municipio : "";
     $cliente->estado = isset($request->estado) ? $request->estado : "";
     $cliente->cp = isset($request->cp) ? $request->cp : "";
     if ($cliente->save()) {
         echo json_encode(array("success" => true));
     } else {
         echo json_encode(array("success" => true));
     }
 }
开发者ID:Caesaroh,项目名称:Revista,代码行数:29,代码来源:Clientes.php

示例2: doSave

 /**
  * Performs the work of inserting or updating the row in the database.
  *
  * If the object is new, it inserts it; otherwise an update is performed.
  * All related objects are also updated in this method.
  *
  * @param PropelPDO $con
  * @return int             The number of rows affected by this insert/update and any referring fk objects' save() operations.
  * @throws PropelException
  * @see        save()
  */
 protected function doSave(PropelPDO $con)
 {
     $affectedRows = 0;
     // initialize var to track total num of affected rows
     if (!$this->alreadyInSave) {
         $this->alreadyInSave = true;
         // We call the save method on the following object(s) if they
         // were passed to this object by their corresponding set
         // method.  This object relates to these object(s) by a
         // foreign key reference.
         if ($this->aCliente !== null) {
             if ($this->aCliente->isModified() || $this->aCliente->isNew()) {
                 $affectedRows += $this->aCliente->save($con);
             }
             $this->setCliente($this->aCliente);
         }
         if ($this->isNew() || $this->isModified()) {
             // persist changes
             if ($this->isNew()) {
                 $this->doInsert($con);
             } else {
                 $this->doUpdate($con);
             }
             $affectedRows += 1;
             $this->resetModified();
         }
         $this->alreadyInSave = false;
     }
     return $affectedRows;
 }
开发者ID:vicbaporu,项目名称:ITRADE,代码行数:41,代码来源:BaseClientearchivo.php

示例3: actionCreateClient

 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreateClient()
 {
     $hU = new HttpUtils();
     if ($hU->isAjaxRequest() == false) {
         Response::error("not allowed ;)");
     }
     if (isset($_POST["clientName"]) == false || isset($_POST["clientEmail"]) == false) {
         Response::ok(CJSON::encode(array("resultado" => Constants::RESULTADO_OPERACION_FALLA, "detalle" => "Faltan parámetros obligatorios")));
     }
     $cl = Cliente::model()->findAll("email=:email", array(':email' => $_POST["clientEmail"]));
     if (sizeof($cl) > 0) {
         Response::ok(CJSON::encode(array("resultado" => Constants::RESULTADO_OPERACION_FALLA, "detalle" => "Cliente {$_POST["clientEmail"]} ya registrado en el sistema")));
     }
     $cl = new Cliente();
     $cl->surname = "";
     $cl->comments = "";
     $cl->streetaddress = "";
     $cl->name = $_POST["clientName"];
     $cl->email = $_POST["clientEmail"];
     if ($cl->save()) {
         Response::ok(CJSON::encode(array("resultado" => Constants::RESULTADO_OPERACION_EXITO, "detalle" => "Cliente {$cl->email} registrado con éxito")));
     } else {
         Response::ok(CJSON::encode(array("resultado" => Constants::RESULTADO_OPERACION_FALLA, "detalle" => "Error registrando cliente {$cl->email} en el sistema")));
     }
 }
开发者ID:MRodriguez08,项目名称:yii-bundles-app,代码行数:29,代码来源:NotificationController.php

示例4: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  Request  $request
  * @return Response
  */
 public function store()
 {
     $Cliente = new Cliente();
     $Cliente->nit = Input::get('nit');
     $Cliente->nombre = Input::get('nombre');
     $Cliente->direccion = Input::get('direccion');
     $Cliente->telefono = Input::get('telefono');
     $Cliente->celular = Input::get('celular');
     $Cliente->correo = Input::get('correo');
     $Cliente->dias_plazo_pago = Input::get('dias_plazo_pago');
     $Cliente->estado = Input::get('estado');
     $Cliente->pais_id = Input::get('pais_id');
     $Cliente->departamento_id = Input::get('departamento_id');
     $Cliente->ciudad_id = Input::get('ciudad_id');
     $validar = Validator::make(Input::all(), $this->reglas);
     if ($validar->fails()) {
         $return['ok'] = false;
         $return['msg'] = $validar->messages();
         return $return;
     } else {
         if ($Cliente->save()) {
             $return['ok'] = true;
             $return['msg'] = 'El cliente ha sido guardado';
             return $return;
         } else {
             $return['ok'] = false;
             $return['msg'] = 'No se pudo crear el registro';
             return $return;
         }
     }
 }
开发者ID:crispaez,项目名称:arterisk,代码行数:37,代码来源:Clientes.php

示例5: post_nuevo

 public function post_nuevo()
 {
     $inputs = Input::all();
     $reglas = array('nombres' => 'required|min:4', 'apellido' => 'required', 'email' => 'email|unique:clients,email', 'localidad' => 'required');
     $mensajes = array('required' => 'Campo Obligatorio');
     $validar = Validator::make($inputs, $reglas);
     if ($validar->fails()) {
         Input::flash();
         return Redirect::back()->withInput()->withErrors($validar);
     } else {
         $cliente = new Cliente();
         $cliente->nombres = Input::get('nombres');
         $cliente->apellido = Input::get('apellido');
         $cliente->tipo_doc = Input::get('tipo_doc');
         $cliente->documento = Input::get('documento');
         $cliente->email = Input::get('email');
         $cliente->calle = Input::get('calle');
         $cliente->num = Input::get('num');
         $cliente->piso = Input::get('piso');
         $cliente->localidad = Input::get('localidad');
         $cliente->telefono = Input::get('telefono');
         $cliente->celular = Input::get('celular');
         $cliente->save();
         return Redirect::to('lista_clientes')->with('error', 'El Cliente ha sido registrado con Éxito')->withInput();
     }
 }
开发者ID:walheredia,项目名称:expo,代码行数:26,代码来源:ClientesController.php

示例6: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store()
 {
     $pelicula = new Cliente();
     $pelicula->nombre = Request::get('nombre');
     $pelicula->apellido = Request::get('apellido');
     $pelicula->correo = Request::get('correo');
     $pelicula->nombreUsuario = Request::get('nombreUsuario');
     $pelicula->save();
     return Response::json(array('error' => false, 'peliculas' => $pelicula->toArray()), 200);
 }
开发者ID:anam48,项目名称:tickets3,代码行数:15,代码来源:PeliculaController.php

示例7: createCliente

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request $request
  * @return \Illuminate\Http\Response
  */
 private function createCliente($cliente)
 {
     $usuario = $this->crearUsuarioPasajero($cliente['identificacion']);
     $cliente = new Cliente();
     $cliente->identificacion = $cliente['identificacion'];
     $cliente->nombres = $cliente['nombres'];
     $cliente->telefono = $cliente['telefono'];
     $cliente->direccion = $cliente['direccion'];
     $cliente->usuario_id = $cliente->id;
     return array('cliente' => $cliente->save(), 'usuario' => $usuario);
 }
开发者ID:andybolano,项目名称:viaja_seguro,代码行数:17,代码来源:GiroController.php

示例8: actionCreate

 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     $this->pageTitle = Yii::app()->name . ' - Cadastro de clientes';
     $model = new Cliente();
     if (isset($_POST['Cliente'])) {
         $model->attributes = $_POST['Cliente'];
         $model->data_cadastro = date('d/m/Y H:i:s');
         if ($model->save()) {
             $this->redirect(array('clienteCarro/create', 'clienteId' => $model->id));
         }
     }
     $this->render('create', array('model' => $model));
 }
开发者ID:bgstation,项目名称:erp,代码行数:17,代码来源:ClienteController.php

示例9: actionCreate

 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     $model = new Cliente();
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['Cliente'])) {
         $model->attributes = $_POST['Cliente'];
         if ($model->save()) {
             $this->redirect(array('view', 'id' => $model->id));
         }
     }
     $this->render('create', array('model' => $model));
 }
开发者ID:cfede10,项目名称:logisoft,代码行数:17,代码来源:ClienteController.php

示例10: store

 public function store()
 {
     $data = Input::all();
     $cliente = new Cliente();
     $cliente->fill($data['cliente']);
     if ($data['cliente']['persona'] == 'j') {
         $representante = new Cliente();
         $representante->fill($data['representante']);
         $representante->save();
         $representante->representados()->save($cliente);
     }
     $cliente->save();
     return Redirect::route('clientes.index');
 }
开发者ID:tusotec,项目名称:Artecol,代码行数:14,代码来源:ClientesController.php

示例11: run

 public function run()
 {
     // going 'Faker' :) on the polls table.
     $faker = Faker::create();
     for ($i = 1; $i <= 100; $i++) {
         $cliente = new Cliente();
         $cliente->direccion = $faker->address;
         $cliente->nombre = $faker->name;
         $cliente->email = $faker->email;
         $cliente->telefono = $faker->phoneNumber;
         $cliente->farmacia_id = $faker->numberBetween(1, 5);
         $cliente->save();
     }
 }
开发者ID:kailIII,项目名称:farmacia,代码行数:14,代码来源:ClientesTableSeeder.php

示例12: RegistrarCliente

 public function RegistrarCliente($nombres, $doc_ident, $atencion_a, $direccion, $telefono, $correo, $referencia)
 {
     $resultado = array('valor' => 1, 'message' => 'Servicio Registrado correctamente.');
     $cliente = new Cliente();
     $cliente->nombres = $nombres;
     $cliente->doc_ident = $doc_ident;
     $cliente->atencion_a = $atencion_a;
     $cliente->direccion = $direccion;
     $cliente->telefono = $telefono;
     $cliente->correo = $correo;
     $cliente->referencia = $referencia;
     if (!$cliente->save()) {
         $resultado = array('valor' => 0, 'message' => 'No hemos podido Registrar el servicio, intentelo nuevamente');
     }
     return $resultado;
 }
开发者ID:JLuisJ7,项目名称:sisfip,代码行数:16,代码来源:Cliente.php

示例13: actionCreate

 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     $model = new Cliente();
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     $id = $model->RUTCLIENTE;
     $persona2 = Yii::app()->db->createCommand("SELECT count(*) AS total FROM cliente WHERE RUTCLIENTE = '" . $id . "'")->queryRow();
     $cant = $persona2["total"];
     if (isset($_POST['Cliente'])) {
         $model->attributes = $_POST['Cliente'];
         if ($model->save()) {
             $this->redirect(array('view', 'id' => $model->RUTCLIENTE));
         }
     }
     $this->render('addCliente', array('model' => $model));
 }
开发者ID:AeTeDev,项目名称:sun,代码行数:20,代码来源:ClienteController.php

示例14: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store()
 {
     $nombre = Input::get('nombre');
     $email = Input::get('email');
     $telefonoR = Input::get('telefono_resi');
     $telefonoM = Input::get('telefono_movil');
     $direccion = Input::get('direccion');
     $cliente = new Cliente();
     $cliente->nombre = $nombre;
     $cliente->email = $email;
     $cliente->telefono_resi = $telefonoR;
     $cliente->telefono_movil = $telefonoM;
     $cliente->direccion_fisica = $direccion;
     $cliente->save();
     Session::flash('message', 'Registro guardado satisfactoriamente!');
     return Redirect::to('clientes');
 }
开发者ID:soatadomicilio,项目名称:GestionProyecto,代码行数:22,代码来源:ClienteController.php

示例15: actionCreate

 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     $model = new Cliente();
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['Cliente'])) {
         $model->attributes = $_POST['Cliente'];
         if (!Cliente::model()->find('RUTCLIENTE=:RUT', array(':RUT' => $model->RUTCLIENTE))) {
             if ($model->save()) {
                 $this->redirect('?r=propiedad/index');
             }
         } else {
             $this->render('addCliente', array('model' => $model));
         }
     } else {
         $this->render('addCliente', array('model' => $model));
     }
 }
开发者ID:aetexd,项目名称:sun,代码行数:22,代码来源:ClienteController.php


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