<?php include('meta.php') ?>
<?php $bg_header = "bg_sala"; include('header.php') ?>

<script type="text/javascript" language="javascript">
    $(document).ready(function() {
    $('#datetimepicker').datetimepicker();
    });
</script>
<script type='text/javascript'>
function confirm_del_event(ab){
        if (confirm("Esta seguro de eliminar esta Cita?") == true) { 
           location.href='del_event.php?id='+a;
          } else {
          location.href='view_event.php?id='+a;
          }
      } 

</script>
	<div id="box_body"><!-- body center -->
<?php
// Values received via ajax
  $id = $_GET['id'];
  $result = mysqli_query($con,"SELECT * FROM se_evenement WHERE id = '$id'");  
  $row = mysqli_fetch_assoc($result);          
?>
  <br /><form action="update_event.php" method="POST"> 
    <p>
    <input type="hidden" name="id" value="<?php echo $row['id'] ?>"> 
    Nombre: <input type="text" name="name" value="<?php echo $row['name'] ?>"> 
    &nbsp;Cédula: <input type="text" name="title" value="<?php echo $row['title'] ?>" style="width:150px">
    Tipo <input type="text" name="tipo_cc" value="<?php echo $row['tipo_cc'] ?>"> 
    &nbsp;Pago: <?php 
        if ( $row['pay'] == "No"){
          echo "<input type='radio' name='pay' value='Si'/>Si &nbsp <input type='radio' name='pay' value='No' checked='checked' />No";
        } else {
          echo "<input type='radio' name='pay' value='Si' checked='checked' />Si &nbsp; <input type='radio' name='pay' value='No' />No";
        }
        ?>  
    </p>
    <p>
    Fecha/hora&nbsp;  <input type="text" name="start" value="<?php echo $row['start'] ?>" id="datetimepicker" style="width:150px" />
    &nbsp;Teléfono: <input type="text" name="cell" value="<?php echo $row['cell'] ?>" style="width:180px">
    &nbsp; <?php if($row['status'] == "Finalizada"){
	     echo "Continua: <input type='text' style='width:120px' name='continua' value='".$row['continua']."'>";
	   }
	   ?>
  &nbsp; Como se entero: <input type="text" name="como_entero" value="<?php echo $row['como_entero'] ?>" style="width:100px">&nbsp; &nbsp; &nbsp; 
    <?php 
  if ($_SESSION['type_user_live'] == "Admin") {
    echo "<a class='btn btn-danger btn-xs hidden-print' href='#' onclick='confirm_del_event($id)'><span class='glyphicon glyphicon-trash'> Eliminar Cita</span></a>";
        }
  ?>
	</p>
  <p>Atendido por:<input type="text" name="atendido" value="<?php echo $row['atendido'] ?>" style="width:220px">
<input type="hidden" name="t_servicio" value="<?php echo $row['t_servicio'] ?>" style="width:220px"> 
<input type="hidden" name="comments" value="<?php echo $row['comments'] ?>" style="width:220px"> 
  <br /><br />
    <div class="row">
      <div class="col-xs-6">
        <div class="well">
            <strong>Servicio(s)</strong><br />
            <?php 
                if ( $row['SCH'] == '0'){ echo "<input type='checkbox' name='SCH' value='0' checked='checked' /> SCH - Camara Hiperbarica<br />";} else { echo "<input type='checkbox' name='SCH' value='0'/> SCH - Camara Hiperbarica<br />"; };
                if ( $row['ST'] == '0'){echo "<input type='checkbox' name='ST' value='0' checked='checked'/> ST -Terapia<br />";} else { echo "<input type='checkbox' name='ST' value='0'/> ST -Terapia
<br />"; };
                if ( $row['CMF'] == '0'){echo "<input type='checkbox' name='CMF' value='0'  checked='checked'/> CMF - Consulta Medico<br />";} else { echo "<input type='checkbox' name='CMF'/> CMF - Consulta Medico
<br />"; };
                if ( $row['CEL'] == '0'){echo "<input type='checkbox' name='CEL' value='0' checked='checked'/> CEL - Exámenes Médicos<br /> ";} else { echo "<input type='checkbox' name='CEL'/> CEL - Exámenes Médicos<br />"; };
                if ( $row['CM'] == '0'){echo "<input type='checkbox' name='CM' value='0' checked='checked'/> CM - Consulta Control<br />";} else { echo "<input type='checkbox' name='CM'/> CM - Control Médico<br />"; };
                if ( $row['SEF'] == '0'){echo "<input type='checkbox' name='SEF' value='0' checked='checked'/> SEF - Facial<br />";} else { echo "<input type='checkbox' name='SEF'/> SEF - Facial<br />"; };
                if ( $row['SEV'] == '0'){echo "<input type='checkbox' name='SEV' value='0' checked='checked'/> SEV - V-shape<br />";} else { echo "<input type='checkbox' name='SEV'/> SEV - V-shape<br />"; };
                if ( $row['SEH'] == '0'){echo "<input type='checkbox' name='SEH' value='0' checked='checked'/> SEH - Hidro terapia<br />";} else { echo "<input type='checkbox' name='SEH'/> SEH - Hidro terapia<br />"; };
                if ( $row['SETT'] == '0'){echo "<input type='checkbox' name='SETT' value='0' checked='checked'/> SET - Tonificación<br />";} else { echo "<input type='checkbox' name='SETT'/> SET - Tonificación<br />"; };
                if ( $row['SEG'] == '0'){echo "<input type='checkbox' name='SEG' value='0' checked='checked'/> SEG - Gluteos<br />";} else { echo "<input type='checkbox' name='SEG'/> SEG - Gluteos<br />"; };
                if ( $row['SEP'] == '0'){echo "<input type='checkbox' name='SEP' value='0' checked='checked'/> SEP - Post-Operatorios<br />";} else { echo "<input type='checkbox' name='SEP'/> SEP - Post-Operatorios<br />"; };
                if ( $row['SEC'] == '0'){echo "<input type='checkbox' name='SEC' value='0' checked='checked'/> SEC - Celulitis<br />";} else { echo "<input type='checkbox' name='SEC' /> SEC - Celulitis<br />"; };
                if ( $row['SEL'] == '0'){echo "<input type='checkbox' name='SEL' value='0' checked='checked'/> SEL - Liposoft<br />";} else { echo "<input type='checkbox' name='SEL'/> SEL - Liposoft<br />"; };
                if ( $row['CHC'] == '0'){echo "<input type='checkbox' name='CHC' value='0' checked='checked'/> CHC - Historía Clinica <br />";} else { echo "<input type='checkbox' name='CHC' /> CHC - Historía Clinica<br />"; };
                if ( $row['CMD'] == '0'){echo "<input type='checkbox' name='CMD' value='0' checked='checked'/> CMD - Medidas<br />";} else { echo "<input type='checkbox' name='CMD' /> CMD - Medidas<br />"; };
                if ( $row['CMT'] == '0'){echo "<input type='checkbox' name='CMT' value='0' checked='checked'/> CMT- Manta<br />";} else { echo "<input type='checkbox' name='CMT'/> CMT- Manta<br />"; };
                if ( $row['CTO'] == '0'){echo "<input type='checkbox' name='CTO' value='0' checked='checked'/> CTO - Terapia Ortomolecular<br />";} else { echo "<input type='checkbox' name='CTO' /> CTO - Terapia Ortomolecular<br />"; };
                if ( $row['CAT'] == '0'){echo "<input type='checkbox' name='CAT' value='0' checked='checked'/> CAT - Auriculoterapia<br />";} else { echo "<input type='checkbox' name='CAT'/> CAT - Auriculoterapia<br />"; };
                if ( $row['CPA'] == '0'){echo "<input type='checkbox' name='CPA' value='0' checked='checked'/> CPA - Plan de Alimentación<br />";} else { echo "<input type='checkbox' name='CPA'/> CPA - Plan de Alimentación<br />"; };
                if ( $row['CAF'] == '0'){echo "<input type='checkbox' name='CAF' value='0' checked='checked'/> CAF - Actividad Física<br />";} else { echo "<input type='checkbox' name='CAF' /> CAF - Actividad Física<br />"; };
                if ( $row['CMA'] == '0'){echo "<input type='checkbox' name='CMA' value='0' checked='checked'/> CMA - Médico Alimentación<br />";} else { echo "<input type='checkbox' name='CMA' /> CMA - Médico Alimentación<br />"; };
                if ( $row['LAB'] == '0'){echo "<input type='checkbox' name='LAB' value='0' checked='checked'/> LAB - Laboratorio<br />";} else { echo "<input type='checkbox' name='LAB' /> LAB - Laboratorio<br />"; };
                if ( $row['CMG'] == '0'){echo "<input type='checkbox' name='CMG' value='0' checked='checked'/> CMG - Consulta Medico General<br />";} else { echo "<input type='checkbox' name='CMG' /> CMG - Consulta Medico General<br />"; };
                if ( $row['MG'] == '0'){echo "<input type='checkbox' name='MG' value='0' checked='checked'/> MG - Control Medico General<br />";} else { echo "<input type='checkbox' name='MG' /> MG - Control Medico General<br />"; };
             ?>
		 <?php 
                if ( $row['SCH'] == '2'){ echo "<input type='hidden' name='SCH' value='2'/>SCH - Camara Hiperbarica<br />" ;};
                if ( $row['ST'] == '2'){ echo "<input type='hidden' name='ST' value='2'/>ST - Terapia<br />";};
                if ( $row['CMF'] == '2'){ echo "<input type='hidden' name='CMF' value='2'/>CMF - Consulta Medico<br />";};
                if ( $row['CEL'] == '2'){ echo "<input type='hidden' name='CEL' value='2'/>CEL - Exámenes Médicos<br /> ";};
                if ( $row['CM'] == '2'){ echo "<input type='hidden' name='CM' value='2'/>CM - Control Médico<br />";};
                if ( $row['SEF'] == '2'){ echo "<input type='hidden' name='SEF' value='2'/>SEF - Facial<br />";};
                if ( $row['SEV'] == '2'){ echo "<input type='hidden' name='SEV' value='2'/>SEV - V-shape<br />";};
                if ( $row['SEH'] == '2'){ echo "<input type='hidden' name='SEH' value='2'/>SEH - Hidro terapia<br />";};
                if ( $row['SETT'] == '2'){ echo "<input type='hidden' name='SETT' value='2'/>SETT - Tonificación<br />";};
                if ( $row['SEG'] == '2'){ echo "<input type='hidden' name='SEG' value='2'/>SEG - Gluteos<br />";};
                if ( $row['SEP'] == '2'){ echo "<input type='hidden' name='SEP' value='2'/>SEP - Post-Operatorios<br />";};
                if ( $row['SEC'] == '2'){echo "<input type='hidden' name='SEC' value='2'/>SEC - Celulitis<br />";};
                if ( $row['SEL'] == '2'){echo "<input type='hidden' name='SEL' value='2'/>SEL - Liposoft<br />";};
                if ( $row['CHC'] == '2'){ echo "<input type='hidden' name='CHC' value='2'/>CHC - Historía Clinica <br />";};
                if ( $row['CMD'] == '2'){ echo "<input type='hidden' name='CMD' value='2'/>CMD - Medidas<br />";};
                if ( $row['CMT'] == '2'){ echo "<input type='hidden' name='CMT' value='2'/>CMT - Manta<br />";};
                if ( $row['CTO'] == '2'){ echo "<input type='hidden' name='CTO' value='2'/>CTO - Terapia Ortomolecular <br />";};
                if ( $row['CAT'] == '2'){ echo "<input type='hidden' name='CAT' value='2'/>CAT - Auriculoterapia<br />";};
                if ( $row['CPA'] == '2'){ echo "<input type='hidden' name='CPA' value='2'/>CPA - Plan de Alimentación<br />";};
                if ( $row['CAF'] == '2'){ echo "<input type='hidden' name='CAF' value='2'/>CAF - Actividad Física<br />";};
                if ( $row['CMA'] == '2'){ echo "<input type='hidden' name='CMA' value='2'/>CMA - Médico Alimentación<br />";};
                if ( $row['LAB'] == '2'){ echo "<input type='hidden' name='LAB' value='2'/>LAB - Laboratorio<br />";};
                if ( $row['CMG'] == '2'){echo "<input type='hidden' name='CMG' value='2'/> CMG - Consulta Medico General<br />";} ;
                if ( $row['MG'] == '2'){echo "<input type='hidden' name='MG' value='2'/> MG - Control Medico General<br />";} ;
		?><br />
        </div>
      </div>
      <div class="col-xs-6"> 	
      Descripción:<br><textarea rows="8" cols="40" name="description"><?php echo $row['description'] ?></textarea>
      </div>
    </div>
    Estado :
    <select name="status">
      <option value="<?php echo $row['status'] ?>"><?php echo $row['status'] ?></option>
      <option value="Sala de espera">Sala de espera</option>
	    <option value="Reagendado">Reagendado</option>
      <option value="Confirmada">Confirmada</option>
      <option value="Cancelada">Cancelada</option>
      <option value="No contesta">No contesta</option>
    </select>
    &nbsp;&nbsp;<input type="submit" value="Continuar" class="btn btn-success btn-md">
  </form>
	</div><!-- END body center -->
<?php include('../footer.php') ?>
