<div class="content-wrapper">

  <section class="content-header">

    <h1>

      Administrar contratos de Diplomados

    </h1>

    <ol class="breadcrumb">

      <li><a href="inicio"><i class="fa fa-dashboard"></i> Inicio</a></li>

      <li class="active">Administrar contratos de Diplomados</li>

    </ol>

  </section>

  <section class="content">

    <div class="box">

      <div class="box-header with-border">

        <a href="crear-contratos">

          <button class="btn btn-primary">

            Agregar inscrito

          </button>

        </a>

      </div>

      <div class="box-body">

       <table class="table table-bordered table-striped dt-responsive tablas">

        <thead>

         <tr>

           <th style="width:10px">#</th>
           <th>Código</th>
           <th>Alumno</th>
           <th>Matricula</th>
           <th>Diplomado</th>
           <th>Meses</th>
           <th>Fecha</th>
           <th>Estado</th>
           <th>Acciones</th>

         </tr>

        </thead>

        <tbody>

        <?php

        $item = null;
        $valor = null;

        $contratos = ControladorContratos::ctrMostrarContratos($item, $valor);
        //Parse error: syntax error, unexpected end of file in C:\xampp\htdocs\SisRecoleccion\vistas\modulos\contratos.php on line 111

       foreach ($contratos as $key => $value){

          echo ' <tr>
                  <td>'.($key+1).'</td>
                  <td>'.$value["codigo"].'</td>';

                 $itemPersona="idpersona";
                 $valorPersona=$value["idpersona"];
                 $respuestaPersona=ControladorPersonas::ctrMostrarPersonas($itemPersona, $valorPersona);

                echo '<td>'.$respuestaPersona["nombres"].'</td>';

                echo '<td>'.$respuestaPersona["documento"].'</td>';

                echo '<td>'.$respuestaPersona["direccion"].'</td>';

                echo '<td>'.$value["numromeses"].'</td>';


                echo '<td>'.$value["fecha"].'</td>';

                  if($value["estado"] == 0){

                        echo '<td><span class="badge bg-green btnActivarC" idservicios="'.$value["idservicios"].'" estadoServicio="3">Activo</span></td>';

                      }else if($value["estado"] == 1){

                        echo '<td><span class="badge bg-yellow" idservicios="'.$value["idservicios"].'" estadoPersona="0">Suspendido</span></td>';

                      }
                      else if($value["estado"] == 2){

                        echo '<td><span class="badge bg-black" idservicios="'.$value["idservicios"].'" estadoPersona="0">Finalizado</span></td>';

                      }
                      else if($value["estado"] == 3){
                        echo '<td><span class="badge bg-black btnActivarC" idservicios="'.$value["idservicios"].'" estadoServicio="0">Desactivado</span></td>';
                      } 
                      else if($value["estado"] == 5){
                        echo '<td><span class="badge bg-blue btnActivarC" idservicios="'.$value["idservicios"].'" estadoServicio="0">POR VALIDAR</span></td>';
                      }
                      else if($value["estado"] == 4){
                        echo '<td><span class="badge bg-black btnActivarC" idservicios="'.$value["idservicios"].'" estadoServicio="0">BAJA</span></td>';
                      }
                      
                      

                       echo '<td>

                      <div>
                      <button class="btn btn-info btnImprimirEstado" idservicios="'.$value["idservicios"].'">
                        <i class="fa fa-print"></i></button>

                        <button class="btn btn-warning btnDetalleContrato" idservicios="'.$value["idservicios"].'"><i class="fa fa-eye"></i></button>';

                      if($_SESSION["perfil"] == "Administrador"){

                          echo ' <button class="btn btn-danger btnEliminarContrato" idservicios="'.$value["idservicios"].'"><i class="fa fa-trash"></i></button>';

                      }
                      
                      if($_SESSION["perfil"] == "Administrador"){

                          echo ' <button class="btn btn-secondary btnBajausuario" idservicios="'.$value["idservicios"].'"><i class="fa fa-frown-o"></i></button>';

                      }
                      if($_SESSION["perfil"] == "Administrador"){

                          echo ' <button class="btn btn-success btnValidausuario" idservicios="'.$value["idservicios"].'"><i class="fa fa-handshake-o"></i></button>';

                      }


                      echo '</div>

                    </td>



                </tr>';
        }


        ?>

        </tbody>

       </table>

      </div>

    </div>

  </section>

</div>



<div id="modalEditarContrato" class="modal fade" role="dialog">

<div class="modal-dialog modal-lg">
    <div class="modal-content">

      <form role="form" method="post">

        <!--=====================================
        CABEZA DEL MODAL
        ======================================-->

        <div class="modal-header" style="background:#3c8dbc; color:white">

          <button type="button" class="close" data-dismiss="modal">&times;</button>

          <h4 class="modal-title">Cronograma de Pagos</h4>

        </div>

        <!--=====================================
        CUERPO DEL MODAL
        ======================================-->

        <div class="modal-body">

          <div class="box-body">

            <table class="table table-bordered table-striped dt-responsive tablas tablaContratos" width="100%">


        <thead>

         <tr>

           <th style="width:10px">#</th>
           <th>Fechas de pagos</th>
           <th>Monto</th>
           <th>Estado</th>

         </tr>

        </thead>

        <tbody id="tablebody1">


        </tbody>

       </table>


          </div>

        </div>



        <!--=====================================
        PIE DEL MODAL
        ======================================-->

        <div class="modal-footer">

          <button type="button" class="btn btn-danger pull-right" data-dismiss="modal">Close</button>


        </div>

      </form>

      </div>

  </div>

</div>
