<?php

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

        $obj = new database();
        $obj->conectar(); $obj->consulta("set names 'utf8'");

        $grado='11';
        $curso='1';
        $asignatura='20.4';


          $reg = $obj->consulta("select * from  boletin where asignatura='".$asignatura."' and grado='".$grado."' and curso='".$curso."'");

          while($row = $obj->fetch_assoc($reg)){

                   $reg1 = $obj->consulta("select * from detalleboletin where boletin='".$row['numero']."'");

                   while($row1 = $obj->fetch_assoc($reg1)){
                      $obj->consulta("delete from indicadores where detalle_boletin='".$row1['secuencial']."'");                         
                   }
                   
                   $obj->consulta("delete from detalleboletin where secuencial='".$row1['secuencial']."'");
          }

         $obj->consulta("delete from boletin where asignatura='".$asignatura."' and grado='".$grado."' and curso='".$curso."'");

         $obj->disconnect();

         echo "PROCESO TERMINADO";
?>