Example #1
0
 public function checkcontacto($attribute, $params)
 {
     $modeloprueba = Contactos::model()->find(" id=:identidad and  c_hcod= :prove ", array(":identidad" => $this->idcontacto, ":prove" => $this->codpro));
     if ($modeloprueba === NULL) {
         $this->adderror('idcontacto', 'Este contacto no pertenece al cliente');
     }
 }
Example #2
0
 documento */
   public function getListMailContacto($idcontacto, $codocu)
   {
       $modelocontacto = Contactos::model()->findByPk($idcontacto);
       $registroshijos = $modelocontacto->contactos_mail;
       $listacorreos = $modelocontacto->c_mail . ",";
       foreach ($registroshijos as $fila) {
           $listacorreos .= $fila->mail . ",";
       }
       // $listacorreos=substr($listacorreos,1).""; //quitar el primer slash
       $listacorreos = str_replace(",,", ",", $listacorreos);
       //quitamos los slashes
       if (substr($listacorreos, strlen($listacorreos) - 1, 1) == ",") {
           $listacorreos = substr($listacorreos, 0, strlen($listacorreos) - 1);
       }
       //quitar el tultimo slash si lo tuviera
       return $listacorreos;
Example #3
0




	<div class="row">
		<?php 
//if(!$model->isnewRecord) {
?>
		<?php 
echo $form->labelEx($model, 'idcontacto');
?>
		<?php 
$criterio = new CDbCriteria();
$criterio->addcondition("c_hcod='" . $model->codpro . "'");
$datos1 = CHtml::listData(Contactos::model()->findAll($criterio), 'id', 'c_nombre');
echo Chtml::ajaxLink(Chtml::image(Yii::app()->getTheme()->baseUrl . Yii::app()->params["rutatemaimagenes"] . "filter.png"), CController::createUrl('Contactos/Contactosporprove'), array('type' => 'POST', 'url' => CController::createUrl('Contactos/Contactosporprove'), 'update' => '#Ocompra_idcontacto', 'data' => array('codigoprov' => 'js:Ocompra_codpro.value')));
echo $form->DropDownList($model, 'idcontacto', $datos1, array('empty' => '--Seleccione Contacto--'));
?>
		<?php 
echo $form->error($model, 'idcontacto');
?>
		<?php 
//}
?>
	</div>




	<?php 
Example #4
0
 public function chkcontacto($attribute, $params)
 {
     $matriz = Contactos::model()->findAll("id=:idx and c_hcod=:vcdf", array(":vcdf" => $this->codpro, ":idx" => $this->idcontacto));
     if (count($matriz) == 0) {
         // if(!$this->codpro==$fila->c_hcod)
         $this->adderror('idcontacto', 'Este contacto no pertenece a la empresa ' . $this->codpro . ' o no existe ');
     }
 }
Example #5
0
 /**
  * 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.
  * @param integer the ID of the model to be loaded
  */
 public function loadModel($id)
 {
     $model = Contactos::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'El enlace o direccion solicitado no existe');
     }
     return $model;
 }