
<?php include 'concha.php';?>

<!DOCTYPE html>
<html lang="es">

<head>
  <!-- Required meta tags -->
  <meta charset="utf-8">
  <meta name="description" content="Panel de Administracion">
  <meta name="author" content="<?php echo $nombresitio ?>">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <title>Panel de Socios <?php echo $nombresitio ?></title>
  <!-- plugins:css -->
  <link rel="stylesheet" href="/panel/socios/vendors/mdi/css/materialdesignicons.min.css">
  <link rel="stylesheet" href="/panel/socios/vendors/base/vendor.bundle.base.css">
  <!-- endinject -->
  <!-- plugin css for this page -->
  <link rel="stylesheet" href="/panel/socios/vendors/datatables.net-bs4/dataTables.bootstrap4.css">
  <!-- End plugin css for this page -->
  <!-- inject:css -->
  <link rel="stylesheet" href="/panel/socios/css/style.css">
  <!-- endinject -->
  <link rel="shortcut icon" href="<?php echo $dom ?>/icono.ico" />
    
    <style>

        .btn-primary {
          background-color:<?php echo $d_color_fondo_menu ?>;
          border:0;
          letter-spacing:1px;
          font-weight:600;
        }
    
        .mdi{
            color:<?php echo $d_color_fondo_menu ?>;
            
        }
       .svg path {
         
            fill: <?php echo $d_color_fondo_menu ?>;
              
                
            }
    
                .svg:hover path{
        
                fill: #FFFFFF;

                }
        
    </style>
    
</head>
<body>
  <div class="container-scroller">
    <!-- partial:partials/_navbar.html -->
     <nav class="navbar col-lg-12 col-12 p-0 fixed-top d-none flex-row">
            <div class="navbar-brand-wrapper d-flex justify-content-center">
        <div class="navbar-brand-inner-wrapper d-flex justify-content-between align-items-center w-100">  
          <a class="navbar-brand brand-logo" href="index.php"><img src="<?php echo $logo_C?>" alt="logo"/></a>
          <a class="navbar-brand brand-logo-mini" href="index.php"><img src="<?php echo $dom ?>/icono.ico" alt="logo"/></a>
          <button class="navbar-toggler navbar-toggler align-self-center" type="button" data-toggle="minimize">
            <span class="mdi mdi-sort-variant" style="color:#fff;"></span>
          </button>
        </div>  
      </div>
      <div class="navbar-menu-wrapper d-none align-items-center justify-content-end">
        <ul class="navbar-nav mr-lg-4 w-100">
          <li class="nav-item nav-search d-none d-lg-block w-100">
            <div class="input-group">
              <div class="input-group-prepend">
                <span class="input-group-text" id="search">
                  <i class="mdi mdi-magnify"></i>
                </span>
              </div>
              <input type="text" class="form-control" placeholder="Buscar Socio" aria-label="search" aria-describedby="search">
            </div>
          </li>
        </ul>
        <ul class="navbar-nav navbar-nav-right">
          <li class="nav-item dropdown mr-1">
            <a class="nav-link count-indicator dropdown-toggle d-flex justify-content-center align-items-center" id="messageDropdown" href="#" data-toggle="dropdown">
              <i class="mdi mdi-message-text mx-0"></i>
              <span class="count"></span>
            </a>
            <div class="dropdown-menu dropdown-menu-right navbar-dropdown" aria-labelledby="messageDropdown">
              <p class="mb-0 font-weight-normal float-left dropdown-header">Mensajes</p>
              <a class="dropdown-item">
                <div class="item-thumbnail">
                    <img src="images/faces/face4.jpg" alt="image" class="profile-pic">
                </div>
                <div class="item-content flex-grow">
                  <h6 class="ellipsis font-weight-normal">David Grey
                  </h6>
                  <p class="font-weight-light small-text text-muted mb-0">
                    The meeting is cancelled
                  </p>
                </div>
              </a>
              <a class="dropdown-item">
                <div class="item-thumbnail">
                    <img src="images/faces/face2.jpg" alt="image" class="profile-pic">
                </div>
                <div class="item-content flex-grow">
                  <h6 class="ellipsis font-weight-normal">Tim Cook
                  </h6>
                  <p class="font-weight-light small-text text-muted mb-0">
                    New product launch
                  </p>
                </div>
              </a>
              <a class="dropdown-item">
                <div class="item-thumbnail">
                    <img src="images/faces/face3.jpg" alt="image" class="profile-pic">
                </div>
                <div class="item-content flex-grow">
                  <h6 class="ellipsis font-weight-normal"> Johnson
                  </h6>
                  <p class="font-weight-light small-text text-muted mb-0">
                    Upcoming board meeting
                  </p>
                </div>
              </a>
            </div>
          </li>
          <li class="nav-item dropdown mr-4">
            <a class="nav-link count-indicator dropdown-toggle d-flex align-items-center justify-content-center notification-dropdown" id="notificationDropdown" href="#" data-toggle="dropdown">
              <i class="mdi mdi-bell mx-0"></i>
              <span class="count"></span>
            </a>
            <div class="dropdown-menu dropdown-menu-right navbar-dropdown" aria-labelledby="notificationDropdown">
              <p class="mb-0 font-weight-normal float-left dropdown-header">Notifications</p>
              <a class="dropdown-item">
                <div class="item-thumbnail">
                  <div class="item-icon bg-success">
                    <i class="mdi mdi-information mx-0"></i>
                  </div>
                </div>
                <div class="item-content">
                  <h6 class="font-weight-normal">Application Error</h6>
                  <p class="font-weight-light small-text mb-0 text-muted">
                    Just now
                  </p>
                </div>
              </a>
              <a class="dropdown-item">
                <div class="item-thumbnail">
                  <div class="item-icon bg-warning">
                    <i class="mdi mdi-settings mx-0"></i>
                  </div>
                </div>
                <div class="item-content">
                  <h6 class="font-weight-normal">Settings</h6>
                  <p class="font-weight-light small-text mb-0 text-muted">
                    Private message
                  </p>
                </div>
              </a>
              <a class="dropdown-item">
                <div class="item-thumbnail">
                  <div class="item-icon bg-info">
                    <i class="mdi mdi-account-box mx-0"></i>
                  </div>
                </div>
                <div class="item-content">
                  <h6 class="font-weight-normal">New user registration</h6>
                  <p class="font-weight-light small-text mb-0 text-muted">
                    2 days ago
                  </p>
                </div>
              </a>
            </div>
          </li>
          <li class="nav-item nav-profile dropdown" style="display:none!important;">
            <a class="nav-link dropdown-toggle" href="#" data-toggle="dropdown" id="profileDropdown">
              <img src="images/faces/face5.jpg" alt="profile"/>
              <span class="nav-profile-name">Louis Barnett</span>
            </a>
            <div class="dropdown-menu dropdown-menu-right navbar-dropdown" aria-labelledby="profileDropdown">
              <a class="dropdown-item">
                <i class="mdi mdi-settings text-primary"></i>
                Settings
              </a>
              <a class="dropdown-item">
                <i class="mdi mdi-logout text-primary"></i>
                Logout
              </a>
            </div>
          </li>
        </ul>
        <button class="navbar-toggler navbar-toggler-right d-lg-none align-self-center" type="button" data-toggle="offcanvas">
          <span class="mdi mdi-menu" ></span>
        </button>
      </div>
    </nav>
    <!-- partial -->
    <div class="container-fluid page-body-wrapper p-0" style="min-height:100vh;">
      <!-- partial:partials/_sidebar.html -->
      <nav class="sidebar sidebar-offcanvas d-none" id="sidebar">
        <ul class="nav">
            <li class="nav-item">
                <a class="nav-link" href="index.php">
                    <i class="mdi mdi-home menu-icon"></i>
                    <span class="menu-title">Inicio</span>
                </a>
            </li>
            
            <li class="nav-item">
                <a class="nav-link" href="socio.php">
                    <i class="mdi mdi-account menu-icon"></i>
                    <span class="menu-title">Socios</span>
                </a>
            </li>
          <!--li class="nav-item">
            <a class="nav-link" data-toggle="collapse" href="#ui-basic" aria-expanded="false" aria-controls="ui-basic">
              <i class="mdi mdi-circle-outline menu-icon"></i>
              <span class="menu-title">UI Elements</span>
              <i class="menu-arrow"></i>
            </a>
            <div class="collapse" id="ui-basic">
              <ul class="nav flex-column sub-menu">
                <li class="nav-item"> <a class="nav-link" href="pages/ui-features/buttons.html">Buttons</a></li>
                <li class="nav-item"> <a class="nav-link" href="pages/ui-features/typography.html">Typography</a></li>
              </ul>
            </div>
          </li-->
          <!--li class="nav-item">
            <a class="nav-link" href="pages/forms/basic_elements.html">
              <i class="mdi mdi-view-headline menu-icon"></i>
              <span class="menu-title">Form elements</span>
            </a>
          </li-->
          <!--li class="nav-item">
            <a class="nav-link" href="pages/charts/chartjs.html">
              <i class="mdi mdi-chart-pie menu-icon"></i>
              <span class="menu-title">Charts</span>
            </a>
          </li-->
          <!--li class="nav-item">
            <a class="nav-link" href="pages/tables/basic-table.html">
              <i class="mdi mdi-grid-large menu-icon"></i>
              <span class="menu-title">Tables</span>
            </a>
          </li-->
          <!--li class="nav-item">
            <a class="nav-link" href="pages/icons/mdi.html">
              <i class="mdi mdi-emoticon menu-icon"></i>
              <span class="menu-title">Icons</span>
            </a>
          </li-->
          <!--li class="nav-item">
            <a class="nav-link" data-toggle="collapse" href="#auth" aria-expanded="false" aria-controls="auth">
              <i class="mdi mdi-account menu-icon"></i>
              <span class="menu-title">User Pages</span>
              <i class="menu-arrow"></i>
            </a>
            <div class="collapse" id="auth">
              <ul class="nav flex-column sub-menu">
                <li class="nav-item"> <a class="nav-link" href="pages/samples/login.html"> Login </a></li>
                <li class="nav-item"> <a class="nav-link" href="pages/samples/login-2.html"> Login 2 </a></li>
                <li class="nav-item"> <a class="nav-link" href="pages/samples/register.html"> Register </a></li>
                <li class="nav-item"> <a class="nav-link" href="pages/samples/register-2.html"> Register 2 </a></li>
                <li class="nav-item"> <a class="nav-link" href="pages/samples/lock-screen.html"> Lockscreen </a></li>
              </ul>
            </div>
          </li-->
          <!--li class="nav-item">
            <a class="nav-link" href="documentation/documentation.html">
              <i class="mdi mdi-file-document-box-outline menu-icon"></i>
              <span class="menu-title">Documentation</span>
            </a>
          </li-->
        </ul>
      </nav>
      <!-- partial -->
      <div class="main-panel" style="width:100%!important;">
        <div class="content-wrapper p-0">
          <div class="row">

            <div class="col-md-12 grid-margin">
              <div class="d-flex justify-content-between flex-wrap">
                <div class="d-flex align-items-end flex-wrap">
                  
                  
                </div>
                <div class="d-none justify-content-between align-items-end flex-wrap">
                  <button type="button" class="btn btn-light bg-white btn-icon mr-3 d-none d-md-block ">
                    <i class="mdi mdi-download text-muted"></i>
                  </button>
                  <button type="button" class="btn btn-light bg-white btn-icon mr-3 mt-2 mt-xl-0">
                    <i class="mdi mdi-clock-outline text-muted"></i>
                  </button>
                  <button type="button" class="btn btn-light bg-white btn-icon mr-3 mt-2 mt-xl-0">
                    <i class="mdi mdi-plus text-muted"></i>
                  </button>
                  <button class="btn btn-primary mt-2 mt-xl-0">Download report</button>
                </div>
              </div>
            </div>

          </div>
            
            
         
            
          <div class="row">
              
            <div class="col-md-12 stretch-card">               
              <div class="card">
                <div class="card-body">
                    <h4 class="card-title">Socio</h4>
                    <p class="card-description">
                    Detalle completo del socio.
                    </p>
                    
                    <div class="container-fluid " >
                   
                        <!-- Card -->


                       

                          <?php
                          $ID = (int)$_GET['ID'];
                          $u = $_GET['u'];
                          //echo $u ;
                         
                          
                          if ($u == ''){ echo 'error';} else {
                            $sql ="SELECT * FROM `socios` WHERE `md5` = '$u' LIMIT 1";
                          }
                            
                          
        
                          $consulta = $conn->query($sql);
                          while ($row = $consulta->fetch_assoc()){
                          $ID = $row["ID"];
                          $nombre = $row["nombre"];
                          $apellido = $row["apellido"];
                          $email = $row["email"]; 
                          $foto = $row["foto"];                   
                          $telefono = $row["telefono"];
                          $direccion = $row["direccion"];
                          $valor_cuota = $row["valor_cuota"];
                          $baja = $row["baja"];
                          $foto_mal = '04-2019/male-user.svg';
						              $categoria_socio = $row["categoria_socio"];
						              $plan = $row["plan"];
                          $precios_especial = $row["precios_especial"];
                          $ID_cuota = $row["plan"];
                          
						                                                    
                          $sql4 ="SELECT * FROM `cuota` WHERE `ID` = '$ID_cuota' LIMIT 1";
                          $consulta44 = $conn->query($sql44);
                         while ($row4 = $consulta4->fetch_assoc()){
                          
						
                          $nombre_plan = $row4["nombre"];
                          $valor_cuota = $row4["valor_cuota"];
                        
						            }
                          $consulta4->free_result();
                                                  
						
                          ?>
    
                          <div class="row mb-3">  
                            
                          <div class="col-12 col-sm-12 col-lg-6">
                            <!-- Card -->
                            <div class="card testimonial-card">
                                <!-- Background color -->
                                <div class="card-up indigo lighten-1" 
                                  style="overflow: hidden;height: 120px;
                                  -webkit-border-top-left-radius: .25rem;border-top-left-radius: .25rem;
                                  -webkit-border-top-right-radius: .25rem;border-top-right-radius: .25rem;background-color: <?php echo $d_color_fondo_menu ?>;">
                                </div>
                                
                                <?php  ;?>

                                <!-- Avatar -->
                                 <div class="avatar mx-auto white" style="-webkit-border-radius: 50%;border-radius: 50%;width: 120px;margin-top: -60px;overflow: hidden;border: 5px solid #fff;}">
      
                                 <?php if ($foto == '') { ?>

                                      <img src="04-2019/male-user.svg" width="100%" alt="<?php echo $nombre ;?>" style="background-color:#fff;">

                                      <? } else { ?>


                                      <img src="<? echo $dom?><?php echo $foto ;?>" width="100%" alt="<?php echo $nombre ;?>">


                                      <? 

                                        }

                                  ?>


                                   
      
                                </div>
                                
                                
                                
                                
                                
                                
                                <div class="card-body">
                                  <div class="container-fluid"> 
                                    <div class="row">
                                      <div class="col-12 col-lg-8 p-0">
                                      <!-- Name -->
                                      <h4 class="card-title"><?php echo $nombre ;?></h4>
                                      </div>
                                      <div class="col-12 col-lg-4 p-0 fondoBarcode">
                                      <style>.fondoBarcode{
                                        background-image: url("barcode/barcode.php?s=code-128&d=<?php echo $ID ?>&f=svg");
                                        background-position:center center;
                                        background-repeat:no-repeat;
                                        background-size:cover;
                                        height: 30px;
                                      }</style>

                                      <!--img width="100%;" src="barcode/barcode.php?s=code-128&d=<?php echo $ID ?>&f=svg"-->
                                      </div>
                                    </div>
                                  </div> 
                                  <hr>
                                     <!-- Quotation -->
                                      <p><i class="mdi mdi-email-outline  "></i>  <?php echo $email ;?></p>
                                      <p><i class="mdi mdi-phone  "></i>  <?php echo $telefono ;?></p>
                                      <p><i class="mdi mdi-home  "></i>  <?php echo $direccion ;?></p>
                                      <p><i class="mdi mdi-check  "></i>  <?php if ($baja == 0){ echo 'Activo'; } else { echo 'Dado de baja'; } ?></p>
                                      <p><i class="mdi mdi-account"></i>  <?php echo  $categoria_socio ;?></p>
                                      <p><i class="mdi mdi-clipboard"></i>  <?php echo  $nombre_plan ;?></p>
                                                
                                                
                                    
                                </div>
                                
                                <div class="card-body d-none">
                                  <!-- Name -->
                                  
                                  
                                  <h3 class="card-title text-right" style="font-size: 2em;">$ <?php echo $valor_cuota ;?></h3>
                                   
                                      <div class="text-center" role="group" aria-label="Basic example">
                                        <a type="button" href="../../subir_foto_principal_socio.php?ID=<?php echo $ID ?>" class="btn btn-primary mb-1">Cargar Imagen</a>
                                        <a type="button" href="editar_info_socio.php?ID=<?php echo $ID ?>" class="btn btn-primary mb-1">Editar Datos</a>
                                        <a type="button" href="cargar_pago_socio.php?ID=<?php echo $ID ?>" class="btn btn-primary mb-1">Cargar Pago</a>

                                    </div>
                                
                                </div>
                                
                               
                               
                            </div sd>
                            <!-- Card -->
                    
                          </div>  


                            <div class="col-12 col-sm-12 col-lg-6">
                            
                                <div class="card-body card testimonial-card" style="max-height: 712px;overflow-y:scroll;">


                                      <div class="table-responsive">
                                                  
                                                  <table class="table table-striped">
                                                      <thead>
                                                          <tr>
                                                              <th>
                                                                  Fecha
                                                              </th>
                                                              <th>
                                                                  Detalle
                                                              </th>
                                                            
                                                              <th>
                                                                  Monto
                                                              </th>
                                                              
                                                          </tr>
                                                      </thead>
                                                      <tbody>
                                                                  
                                                                  <?
                                                                  //echo $ID;
                                        
                                                                    $sql2 ="SELECT * FROM `movimientos` WHERE `ID_socio` = '$ID'";
                                                                    $consulta2 = $conn->query($sql2);
                                                                 while ($row2 = $consulta2->fetch_assoc())
                                                                  {
                                                                      $ID = $row2["ID"];
                                                                      $ID_socio = $row2["ID_socio"];
                                                                      $detalle = $row2["detalle"];
                                                                      $monto = $row2["monto"];
                                                                      $fecha = $row2["fecha"]; 
                                                                  
                                                                  ?>
                                                                      <tr>
                                                              <td>
                                                                  <?php echo $fecha ?>
                                                              </td>
                                                              <td>
                                                                  <?php echo $detalle ?>
                                                              </td>
                                                              <td>
                                                                  $<?php echo $monto ?>
                                                              </td>
                                                                                    
                                                                  </tr>
                                                                <?
                                                                      }

                                                                      //echo $monto;
                                                                        $consulta2->free_result();

                                                                        ?>
                                                                        
                                                                        <?php

                                                                        $ID = (int)$_GET['ID'];

                                                                        $sql3 ="SELECT sum(monto) AS montosum FROM `movimientos` WHERE `ID_socio` = '$ID'";
                                                                        $consulta3 = $conn->query($sql3);
                                                                     v
                                                                      {
                                                                          
                                                                          
                                                                        $monto2 = $row3["montosum"];
                                                                        //echo $monto2;
                                                                          ?>
                                                                        <tr>
                                                                            
                                                                            <td>
                                                                                
                                                                            </td>
                                                                            <td>
                                                                                
                                                                            </td>
                                                                            <td>
                                                                            <b>$<?php echo $monto2 ?></b>
                                                                            </td>                      
                                                                        </tr>
                                                                          <?

                                                                          }

                                                                          
                                                                          //echo $ID_socio;


                                                                         $consulta3->free_result();
                                                                          
                                                                          ?>

                                                      </tbody>
                                                      
                                                  </table>

                                                <div class="text-center"><a type="button" href="#" class="btn btn-primary mb-1">Pagar Parcial</a>
                                                  <a type="button" href="#" class="btn btn-primary mb-1">Pagar Total $<?php echo $monto2 ;?></a></div>
                                              
                                                  
                                      </div>
                                        

                                </div>
                            
                            </div>

                          </div>            

                          <?}
                          $consulta->free_result();
                          ?>
                      
                       

                           <!-- Card -->            

                    </div>  
                </div>
              </div>
            </div>
              
          </div>
        </div>
        <!-- content-wrapper ends -->
        <!-- partial:partials/_footer.html -->
        <footer class="footer">
          <div class="d-sm-flex justify-content-center justify-content-sm-between">
            <span class="text-muted text-center text-sm-left d-block d-sm-inline-block">Copyright © 2019 <a href="https://www.radiosnet.com.ar/" target="_blank">RadiosNet</a>.</span>
            <span class="d-none float-none float-sm-right  mt-1 mt-sm-0 text-center">Hand-crafted & made with <i class="mdi mdi-heart text-danger"></i></span>
          </div>
        </footer>
        <!-- partial -->
      </div>
      <!-- main-panel ends -->
    </div>
    <!-- page-body-wrapper ends -->
  </div>
  <!-- container-scroller -->

  <!-- plugins:js -->
  <script src="/panel/socios/vendors/base/vendor.bundle.base.js"></script>
  <!-- endinject -->
  <!-- Plugin js for this page-->
  <script src="/panel/socios/vendors/chart.js/Chart.min.js"></script>
  <script src="/panel/socios/vendors/datatables.net/jquery.dataTables.js"></script>
  <script src="/panel/socios/vendors/datatables.net-bs4/dataTables.bootstrap4.js"></script>
  <!-- End plugin js for this page-->
  <!-- inject:js -->
  <script src="/panel/socios/js/off-canvas.js"></script>
  <script src="/panel/socios/js/hoverable-collapse.js"></script>
  <script src="/panel/socios/js/template.js"></script>
  <!-- endinject -->
  <!-- Custom js for this page-->
  <script src="/panel/socios/js/dashboard.js"></script>
  <script src="/panel/socios/js/data-table.js"></script>
  <script src="/panel/socios/js/jquery.dataTables.js"></script>
  <script src="/panel/socios/js/dataTables.bootstrap4.js"></script>
        <script>
    
    
         
         $(function(){
             
    jQuery('img.svg').each(function(){
        var $img = jQuery(this);
        var imgID = $img.attr('id');
        var imgClass = $img.attr('class');
        var imgURL = $img.attr('src');
    
        jQuery.get(imgURL, function(data) {
            
            // Get the SVG tag, ignore the rest
            var $svg = jQuery(data).find('svg');
    
            // Add replaced image's ID to the new SVG
            if(typeof imgID !== 'undefined') {
                $svg = $svg.attr('id', imgID);
            }
            // Add replaced image's classes to the new SVG
            if(typeof imgClass !== 'undefined') {
                $svg = $svg.attr('class', imgClass+' replaced-svg');
            }
    
            // Remove any invalid XML tags as per http://validator.w3.org
            $svg = $svg.removeAttr('xmlns:a');
            
            // Check if the viewport is set, else we gonna set it if we can.
            if(!$svg.attr('viewBox') && $svg.attr('height') && $svg.attr('width')) {
                $svg.attr('viewBox', '0 0 ' + $svg.attr('height') + ' ' + $svg.attr('width'))
            }
    
            // Replace image with new SVG
            $img.replaceWith($svg);
    
        }, 'xml');
    
    });
});
  
 

     
  
</script>
  <!-- End custom js for this page-->
</body>

</html>

