<?php

class GestorForm extends CFormModel
{
	public $gestor1;
	public $gestor2;



	public function rules()
	{
		return array(
			array('gestor1', 'required',"message"=>"Seleccione el gestor actual"),
                        array('gestor2','required',"message"=>"Seleccione el nuevo gestor"),

		);
	}
        
	public function attributeLabels()
	{
		return array(

                        'gestor1'=>'ZONA',
                        'gestor2'=>'ASIGNAR GESTOR'
                    
		);
	}

        public static function nuevoGestor($gestor1,$gestor2){
            $update = Yii::app()->db->createCommand()->
                update("cliente", array(
                "id_gestor" => $gestor2,           
            ),"id_zona=$gestor1");
            return $update;
        }
        
        
        public static function nuevoGestorpres($gestor1,$gestor2){
            $update = Yii::app()->db->createCommand()->
                update("prestamo", array(
                "id_gestor" => $gestor2,           
            ),"id_cliente=$gestor1");
            return $update;
        }
        
   

        
        
        
        
}