<?php $id = $_GET["id"]; $stand = $_GET["s"]; $hoy = date("Y-m-d H:i:s"); //CONSULTA PARA NUEVO CLIENTE //CONSULTA PARA NUEVO CLIENTE if($_POST["titulo"] != ""){ if($_POST["id_registro"] != ""){ mysqli_query($connect,"UPDATE Stand_Videos SET titulo = '".$_POST["titulo"]."', video = '".$_POST["video"]."', estado = '".$_POST["estado"]."' WHERE id = '".$_POST["id_registro"]."' "); } else{ mysqli_query($connect,"INSERT INTO Stand_Videos (id_evento, id_stand, titulo, video, estado, created_at ) VALUES ( '1', '".$stand."', '".$_POST["titulo"]."', '".$_POST["video"]."', '".$_POST["estado"]."', '".$hoy."' ) "); } echo '<script>window.location = "?pg=stand/detalle&id='.$stand.'";</script>';//para evitar reinsersion } // $query = mysqli_query($connect,"SELECT * FROM Stand_Videos WHERE id = '".$id."' "); $data = mysqli_fetch_array($query); $queryStand = mysqli_query($connect,"SELECT * FROM Stands WHERE id = '".$stand."' "); $dataStand = mysqli_fetch_array($queryStand); ?> <?php echo $respuesta; ?> <div class="container-fluid"> <nav aria-label="breadcrumb" style=" margin-top: 10px; margin-bottom: 10px" > <ol class="breadcrumb" style="background-color: rgba(0,0,0,0); margin-bottom:0px"> <li class="breadcrumb-item"><a href="?pg=home">Home</a></li> <li class="breadcrumb-item active" aria-current="page"><a href="?pg=stands">Stands</a></li> <li class="breadcrumb-item active" aria-current="page"><a href="?pg=stand/detalle&id=<?php echo $stand; ?>">Stand Detalle</a></li> <li class="breadcrumb-item active" aria-current="page">Videos</li> </ol> </nav> <div class="card" style="margin-bottom: 15px"> <div class="card-header" align="center"><b><?php echo $dataStand["nombre"]; ?></b></div> <div class="card-body"> <form action="" method="post" enctype="multipart/form-data"> <div class="row"> <input type="hidden" name="id_registro" value="<?php echo $id; ?>"> <div class="col-md-6 item_input"> <label class="ti_label">Título</label> <input type="text" class="form-control" name="titulo" required value="<?php echo $data["titulo"]; ?>"> </div> <div class="col-md-6 item_input"> <label class="ti_label">Link</label> <input type="text" class="form-control" name="video" required value="<?php echo $data["video"]; ?>"> </div> <div class="col-md-6 item_input"> <label class="ti_label">Estado</label> <select class="form-control" name="estado" required> <option value="">Selecciona...</option> <?php foreach($Array_Estado as $estado){ if($estado[0] == $data["estado"]){ echo '<option value="'.$estado[0].'" selected="selected">'.$estado[1].'</option>'; } else{ echo '<option value="'.$estado[0].'">'.$estado[1].'</option>'; } } ?> </select> </div> <div class="col-md-12" style="margin-top: 15px; text-align: left;"> <button type="submit" class="btn btn-success btn-block" style="border-radius: 30px;">Guardar</button> </div> </div> </form> </div> </div> </div> <style> .item_input{ margin-bottom:15px; } </style> <script> $( document ).ready(function() { $("#bt_sala").addClass( "btn-primary" ); }); var api = '<?php echo $api; ?>'; var activar = false; function Eliminar(id){ if(activar == false){ $("#modal_body").html('Estas a punto de eliminar un expositor de esta actividad, esta acción es irreversible ¿Estás seguro?<br><br>'); $("#modal_body").append('<button type="button" class="btn btn-danger" style="margin-right: 10px;" onclick="activar = true; Eliminar('+id+')">Eliminar</button>'); $("#modal_general").modal('show'); } else{ jQuery.ajax({ url: api+"quitar_speaker_lista.php", type:'post', data: {id: <?php echo $id; ?>, conferencista:id, url:"?pg=agenda/detalle&id=<?php echo $id; ?>"}, }).done(function (resp){ $("#xscript").html(resp); }) .fail(function(resp) { console.log(resp); }) .always(function(resp){ } ); } } </script>