<?php

require_once "../../../../app/model/db.class.php";

class Con1 extends database
{
    function proceso($perido,$grado,$curso,$asig)
    {
   
        $this->conectar();
        $resul=$this->consulta("select * from logros where  grado='".$grado."' and curso='".$curso."'and asignatura='".$asig."' and periodo='".$perido."' order by codigo;");
  
        if(mysql_num_rows($resul))
        {
            $f=0;
            while($row=$this->fetch_assoc($resul))
            {
                $c=0;


                $arr[$f][$c+1]= $this->name('grado',$row['grado']);
                $arr[$f][$c+2]= $this->name('cursos',$row['curso']);
                $arr[$f][$c+3]=$this->name('catalogo',$row['asignatura']);
                $arr[$f][$c+4]=$this->name('periodos',$row['periodo']);
                $arr[$f][$c+5]=$row['codigo'];
                $arr[$f][$c+6]=$row['descripcion'];
                $arr[$f][$c+7]=$row['orden'];
                $arr[$f][$c+8]=$row['orden1'];
                $f++;
            }

            return ($arr);
        }else{
            return ('no');
        }
    
    }
    
    function name($tabla,$cod){
         $result=$this->consulta("select * from ".$tabla." where codigo='".$cod."';");
         $rs=$this->fetch_assoc($result);
         return $rs['descripcion']; 
    }


}
/*
$obj=new Con1();
        $obj->proceso($_REQUEST['per'],$_REQUEST['grado'],$_REQUEST['curso'],$_REQUEST['asig']);
        $obj->disconnect();

//$arr=
//for($i=0;$i<count($arr);$i++)
//{
//    for($c=0;$c<7;$c++)
//    {
//       echo $arr[$i][$c]." -- ";
//
//    }
//    echo "<br><br>";
//}
//
*/

?>