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


PHP Cliente::model方法代码示例

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


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

示例1: 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

示例2: uniqueEmail

 public function uniqueEmail($attributes, $paramns)
 {
     $email = $this->email;
     $email_no_banco = Cliente::model()->find("email='{$email}'");
     if (count($email_no_banco) > 0) {
         $this->addError('email', utf8_encode('O e-mail já está sendo usado.'));
     }
 }
开发者ID:habibu,项目名称:YiiCommerce,代码行数:8,代码来源:Cliente.php

示例3: actionAjaxRegistrarCliente

 public function actionAjaxRegistrarCliente()
 {
     $nombres = $_POST['nombres'];
     $doc_ident = $_POST['doc_ident'];
     $atencion_a = $_POST['atencion_a'];
     $direccion = $_POST['direccion'];
     $telefono = $_POST['telefono'];
     $correo = $_POST['correo'];
     $referencia = $_POST['referencia'];
     $respuesta = Cliente::model()->RegistrarCliente($nombres, $doc_ident, $atencion_a, $direccion, $telefono, $correo, $referencia);
     header('Content-Type: application/json; charset="UTF-8"');
     Util::renderJSON(array('success' => $respuesta, 'idGenerado' => Yii::app()->db->getLastInsertID('Cliente')));
 }
开发者ID:JLuisJ7,项目名称:sisfip,代码行数:13,代码来源:ClienteController.php

示例4: actionIndex

 /**
  * This is the default 'index' action that is invoked
  * when an action is not explicitly requested by users.
  */
 public function actionIndex()
 {
     if (!Yii::app()->user->isAdmin()) {
         $this->redirect(array('../index.php/venda'));
     }
     $totalProdutos = Produto::model()->getTotal();
     $totalVendasHoje = Venda::model()->getTotalVendaHoje();
     $totalVendasPrazoHoje = Venda::model()->getTotalvendasPrazoHoje();
     $totalCliente = Cliente::model()->getTotal();
     $totalPagamentos = Pagamento::model()->getToalPagamentosDia();
     $totalFornecedores = Fornecedor::model()->getTotal();
     $totalVendasVista = $totalVendasHoje - $totalVendasPrazoHoje;
     $data = array('totalProdutos' => $totalProdutos, 'totalVendaHoje' => $totalVendasHoje, 'totalVendasPrazoHoje' => $totalVendasPrazoHoje, 'totalCliente' => $totalCliente, 'totalPagamentos' => $totalPagamentos, 'totalFornecedores' => $totalFornecedores, 'totalVendasVista' => $totalVendasVista, 'itensMaisVendidos' => Produto::model()->getItensMaisVendidos());
     $this->render('index', $data);
 }
开发者ID:jrandson,项目名称:JMV-Casual,代码行数:19,代码来源:SiteController.php

示例5: authenticate

 /**
  * Authenticates a user.
  * The example implementation makes sure if the username and password
  * are both 'demo'.
  * In practical applications, this should be changed to authenticate
  * against some persistent user identity storage (e.g. database).
  * @return boolean whether authentication succeeds.
  */
 public function authenticate()
 {
     $user = Cliente::model()->find('username=? AND delete_date IS NULL', array($this->username));
     if ($user === null) {
         $this->errorCode = self::ERROR_USERNAME_INVALID;
     } else {
         if ($this->password !== $user->password) {
             $this->errorCode = self::ERROR_PASSWORD_INVALID;
         } else {
             $this->_id = $user->getPrimaryKey();
             Yii::app()->getSession()->add('cliente', $user);
             $this->username = $user->username;
             $this->errorCode = self::ERROR_NONE;
         }
     }
     return !$this->errorCode;
 }
开发者ID:habibu,项目名称:YiiCommerce,代码行数:25,代码来源:UserIdentity.php

示例6: actionUpdate

 /**
  * Updates a particular model.
  * If update is successful, the browser will be redirected to the 'view' page.
  * @param integer $id the ID of the model to be updated
  */
 public function actionUpdate($id)
 {
     $model = $this->loadModel($id);
     $oMarcas = Marca::model()->naoExcluido()->ordenarTitulo()->findAll();
     $oCliente = Cliente::model()->findByPk($_GET['clienteId']);
     $oCores = Cor::model()->naoExcluido()->ordenarTitulo()->findAll();
     if (isset($_POST['ClienteCarro'])) {
         $model->attributes = $_POST['ClienteCarro'];
         if ($model->save()) {
             if ($_POST['abrir_os'] == "true") {
                 $this->redirect(array('ordemServico/create', 'clienteId' => $model->cliente_id, 'clienteCarroId' => $model->id));
             } else {
                 $this->redirect(array('cliente/view', 'id' => $model->cliente_id));
             }
         }
     }
     $this->render('update', array('model' => $model, 'oMarcas' => $oMarcas, 'oCliente' => $oCliente, 'oCores' => $oCores));
 }
开发者ID:bgstation,项目名称:erp,代码行数:23,代码来源:ClienteCarroController.php

示例7: actualizarCliente

 public function actualizarCliente($idCliente, $nombres, $doc_ident, $atencion_a, $direccion, $telefono, $correo, $referencia, $distrito, $provincia)
 {
     $resultado = array('valor' => 1, 'message' => 'Servicio actualizado correctamente.');
     $cliente = Cliente::model()->findByPk($idCliente);
     $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;
     $cliente->distrito = $distrito;
     $cliente->provincia = $provincia;
     if (!$cliente->save()) {
         $resultado = array('valor' => 0, 'message' => 'No hemos podido Actualizar el Servicio');
     }
     return $resultado;
 }
开发者ID:JLuisJ7,项目名称:sisfip,代码行数:18,代码来源:Cliente.php

示例8: actionClient

 public function actionClient()
 {
     $cliente = Cliente::model()->findByPk(Yii::app()->user->getId());
     $pedido = Pedido::open($cliente);
     $this->comandoExcluirItemPedido($pedido);
     if (isset($_POST['Produto'])) {
         $produto = Produto::model()->findByPk($_POST['Produto']['id']);
         if (count($produto) > 0) {
             $pedido->addItem($produto, $_POST['Produto']['qtd']);
         }
     }
     if (isset($_POST['refresh'])) {
         if ($pedido->batchItemUpdate($_POST)) {
             Yii::app()->user->setFlash('success', 'Pedido atualizado com sucesso!');
         } else {
             Yii::app()->user->setFlash('error', 'Falha ao atualizar o pedido. Alguns itens econtram-se com estoque limitado.');
         }
     }
     $this->render('show', array('pedido' => $pedido));
 }
开发者ID:habibu,项目名称:YiiCommerce,代码行数:20,代码来源:PedidoController.php

示例9: actionAjaxObtenerNroClientes

 public function actionAjaxObtenerNroClientes()
 {
     $cliente = Cliente::model()->ObtenerNroClientes();
     header('Content-Type: application/json; charset="UTF-8"');
     echo CJSON::encode(array('output' => $cliente[0]));
 }
开发者ID:JLuisJ7,项目名称:sisfip,代码行数:6,代码来源:ReportesController.php

示例10: array

<?php

/* @var $this ContactoclienteController */
/* @var $model Contactocliente */
$this->breadcrumbs = array('Contactoclientes' => array('index'), 'Administrar');
$this->menu = array(array('label' => 'Listar', 'url' => array('index')), array('label' => 'Crear', 'url' => array('create')), array('label' => 'MENU', 'url' => array('Menup/index')));
Yii::app()->clientScript->registerScript('search', "\n\$('.search-button').click(function(){\n\t\$('.search-form').toggle();\n\treturn false;\n});\n\$('.search-form form').submit(function(){\n\t\$('#contactocliente-grid').yiiGridView('update', {\n\t\tdata: \$(this).serialize()\n\t});\n\treturn false;\n});\n");
?>

<h1>Administrar Contactos de Clientes</h1>

<?php 
$this->widget('zii.widgets.grid.CGridView', array('id' => 'contactocliente-grid', 'itemsCssClass' => 'table table-striped', 'pager' => array('htmlOptions' => array('class' => 'pagination')), 'dataProvider' => $model->search(), 'filter' => $model, 'columns' => array(array('name' => 'id', 'htmlOptions' => array('width' => '30')), 'nombre', 'apellido', 'telefono', 'celular', 'email', array('name' => 'cliente_id', 'value' => '$data->cliente->razonsocial', 'filter' => CHtml::listData(Cliente::model()->findAll(), 'id', 'razonsocial')), array('class' => 'CButtonColumn'))));
开发者ID:cfede10,项目名称:logisoft,代码行数:13,代码来源:admin.php

示例11: isOwnerClient

 public function isOwnerClient($user_id, $cta_id)
 {
     $client_id = Cliente::model()->getId($user_id);
     $cuenta = CuentaCorriente::model()->findByPk($cta_id);
     return $cuenta->contrato->cliente_id == $client_id;
 }
开发者ID:crmoya,项目名称:inmobiliaria,代码行数:6,代码来源:CuentaCorriente.php

示例12: loadModel

 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  */
 public function loadModel()
 {
     print_r($this->_model);
     if ($this->_model === null) {
         if (isset($_GET['id'])) {
             $this->_model = Cliente::model()->findbyPk($_GET['id']);
         }
         if ($this->_model === null) {
             throw new CHttpException(404, 'The requested page does not exist.');
         }
     }
     return $this->_model;
 }
开发者ID:engrasadullahkhan,项目名称:stockcontrolweb,代码行数:17,代码来源:ClienteController.php

示例13: actionGetCliente

 public function actionGetCliente()
 {
     $telefone = $_POST['telefone'];
     $venda = Yii::app()->session['venda'];
     $cliente = Cliente::model()->buscaCliente($telefone);
     if ($cliente == null) {
         $debitos = array();
     } else {
         $debitos = $cliente->getDebitos();
     }
     $this->renderPartial('pagamento', array('cliente' => $cliente, 'debitos' => $debitos, 'venda' => $venda));
 }
开发者ID:jrandson,项目名称:JMV-Casual,代码行数:12,代码来源:VendaController.php

示例14: isOwner

 public function isOwner($user_id, $cta_id)
 {
     $client_id = Cliente::model()->getId($user_id);
     $response = CuentaCorrienteCliente::model()->exists(array('join' => 'JOIN contrato c ON t.contrato_id = c.id', 'condition' => 'c.cliente_id=:clientID AND t.cuenta_corriente_id = :ctaID', 'params' => array(':clientID' => $client_id, ':ctaID' => $cta_id)));
     return $response;
 }
开发者ID:crmoya,项目名称:inmobiliaria,代码行数:6,代码来源:CuentaCorrienteCliente.php

示例15: array

        </ol>
    </section>
    <section class="content">

        <div class="view">

            <?php 
/* @var $this PropiedadController */
/* @var $model Propiedad */
$this->breadcrumbs = array('Propiedads' => array('index'), $model->IDPROP);
$this->menu = array(array('label' => 'List Propiedad', 'url' => array('index')), array('label' => 'Create Propiedad', 'url' => array('create')), array('label' => 'Update Propiedad', 'url' => array('update', 'id' => $model->IDPROP)), array('label' => 'Delete Propiedad', 'url' => '#', 'linkOptions' => array('submit' => array('delete', 'id' => $model->IDPROP), 'confirm' => 'Are you sure you want to delete this item?')), array('label' => 'Manage Propiedad', 'url' => array('admin')));
?>

            <h1>Propiedad de
                <?php 
Cliente::model()->findByAttributes(array('NOMBRESCLIENTE' => $firstName, 'APELLIDOSCLIENTE' => $lastName), array('condition' => 'RUTCLIENTE=:status', 'params' => array(':status' => $model->RUTCLIENTE)));
echo $firstName . " " . $lastName;
?>
            </h1>

            <?php 
$this->widget('zii.widgets.CDetailView', array('data' => $model, 'attributes' => array('IDPROP', 'RUTCLIENTE', 'DIRECCION', 'CANTPIEZA', 'CANTBANO', 'TERRENO', 'TERRENOCONSTRUIDO', 'TIPO', 'SERVICIO', 'ESTADO', 'DESCRIPCION', 'COMUNAPROPIEDAD')));
?>
            <div class="box-footer">
                <div class="pull-right">
                    <div class="row buttons">
                        <?php 
$this->widget('application.ext.data.EBackButtonWidget');
?>
                    </div>
                </div>
开发者ID:aetexd,项目名称:sun,代码行数:31,代码来源:vista.php


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