Newer
Older
ournorth2021 / admin / api / ficha_evento.php
LuisOlaya on 8 Apr 2021 4 KB primer
<?php        
	$hoy = date("Y-m-d H:i:s");
	$id = $_POST["id"];
	$urlRedirect = $_POST["url"];

	include("../models/connect.php");
	include("../models/arrays.php");
	$query = mysqli_query($connect,"SELECT * FROM Eventos WHERE id = '".$id."' ");
	$data = mysqli_fetch_array($query)
?>

<form action="" method="post" enctype="multipart/form-data">
                	<input type="hidden" name="id_evento" value="<?php echo $data["id"]; ?>" />
					<div class="row">
                        
                        <div class="col-md-6">
                          	<label class="ti_label">Título</label>
                            <input type="text" class="form-control" name="titulo" value="<?php echo $data["titulo"]; ?>" required>
                        </div>

                        <div class="col-md-6">
                          	<label class="ti_label">Estado</label>
                            <select class="form-control" name="estado">
                            	<?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">
                          	<label class="ti_label">Contenido</label>
							<textarea class="form-control" name="contenido" required rows="5"><?php echo $data["contenido"]; ?></textarea>
                        </div>
						
						<div class="col-md-6">
                          	<label class="ti_label">Código</label>
                            <input type="text" class="form-control" name="codigo" required value="<?php echo $data["codigo"]; ?>">
                        </div>
						
						<div class="col-md-6">
                          	<label class="ti_label">Palabra Clave</label>
                            <input type="text" class="form-control" name="palabra" required value="<?php echo $data["palabra"]; ?>">
                        </div>
						
						<div class="col-md-6">
                          	<label class="ti_label">Inicia el</label>
                            <input type="date" class="form-control" name="inicio" required value="<?php echo $data["inicio"]; ?>">
                        </div>
						
						<div class="col-md-6">
                          	<label class="ti_label">Finaliza el:</label>
                            <input type="date" class="form-control" name="finaliza" required value="<?php echo $data["finaliza"]; ?>">
                        </div>
                        
                        <div class="col-md-6">
                          	<label class="ti_label">Imagen</label>
                            <div id="image">
                            	<?php
									if($data["imagen"] != ""){
										echo '<img src="img/delete.png" width="30" onclick="Del_Imagen(this,1)" style="float: right; margin-bottom: -30px; position: relative;"/><img src="http://ganadeuna.com/recursos/'.$data["imagen"].'" style="width:100%">';
									}
									else{
										echo '<input type="file" class="form-control" name="image" required>';
									}
								?>
                            </div>
                        </div>
						
						<div class="col-md-6">
                          	<label class="ti_label">Banner</label>
                            <div id="image">
                            	<?php
									if($data["banner"] != ""){
										echo '<img src="img/delete.png" width="30" onclick="Del_Banner(this,1)" style="float: right; margin-bottom: -30px; position: relative;"/><img src="http://ganadeuna.com/recursos/'.$data["banner"].'" style="width:100%">';
									}
									else{
										echo '<input type="file" class="form-control" name="banner" required>';
									}
								?>
                            </div>
                        </div>
						
						

                        
                        <div class="col-md-12" style="margin-top:15px; text-align: right;">
                            <button type="submit" class="btn btn-success">Guardar</button>
                            <button type="button" class="btn btn-danger" data-dismiss="modal" aria-label="Close">Cerrar</button>
                        </div>
                        
					</div>
</form>