Ejemplo n.º 1
0
    public  static  function updateNumberByType($type) {

        $gen = Generators::model()->findByAttributes(array(
           'Gen_Type'=>$type
        ));
        $gen->Gen_Next_Value++;
        $gen->save();

    }
Ejemplo n.º 2
0
    public static function getGetNextTempFedIDNumber($type) {
        $gen = Generators::model()->findByAttributes(array(
            'Gen_Type'=>$type
        ));

        if ($type==1) {$prefix = 'IN-';}
        if ($type==2) {$prefix = 'T0-';}

        return $prefix.str_pad($gen->Gen_Next_Value, 7, '0', STR_PAD_LEFT);
    }