<?php include 'sesion.php';?>
<?php include 'concha.php';?>
<!DOCTYPE html>
<html lang="es">
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<!-- Required meta tags -->

	<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><?php echo $nombresitio ?> - Panel de Administracion</title>
<link href='http://fonts.googleapis.com/css?family=Oswald' rel='stylesheet' type='text/css'>

<link rel="shortcut icon" href="" type="image/x-icon">
	<link rel="apple-touch-icon" href="">

	<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
	<!-- Link to your css file -->
	<link rel="stylesheet" href="">
  <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>

  <style type="text/css">

      *{
          border-radius: 0!important;

      }

      body {
          background-image: url(../fondeux.jpg);
      }

      .navbar {
          position: relative;
      min-height: 50px;
      padding-bottom:  20px;
      /* border: 1px solid transparent; */

      }

    .btn-primary {
      color: #fff!important;
      background-color: #0066FF;
      border-color: #0066FF;
          }

      .page-header{
          margin: 0;
          padding: 1em;
          background-color: #0066FF;
          border: 0;
          text-align:center;
      }

      .page-header h2{

          color: #ffffff;
          font-weight: bold;
      }

      .bloqueAzul{
        /*  background-color: #0066FF;*/
        /* border: 1px solid #e4e4e4;*/
        /*  padding: 1em;*/
          text-align: center;
      }

      .bloqueAzul .div {
        border: 1px solid #e4e4e4;
          background-color: #fff;
      }

      ul{
          list-style: none;
          padding: 0;
      }

      .far{
          color:#0066FF;
      }
      .faso {
          color:#0066FF;
      }

      .colorAzul h3{
          color:#0066FF;

      }

  </style>

  <script language=javascript>
function ventanaSecundaria (URL){
   window.open(URL,"ventana1","width=550,height=450,scrollbars=NO")
}
  </script>


</head>

<body>


<div class="container" style="background-color:#F1F2ED;max-width:960px;">



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



</div>





<div role="main" style="background-color:#fff;max-width:960px;" class="container pt-3">

            <div class="page-header" style="text-align:center;">

                <h2><? echo $idioma_100759 ?></h2>

            </div>

            <div class="col-12 my-3 text-center">



<div class="col-12">




<?php
    $titulo = $_POST['titulo'];
    $bajada = $_POST['bajada'];
    $bajada = nl2br($bajada);
    $bajada = addslashes($bajada);
    $titulo = addslashes($titulo);
    $texto = $_POST['texto'];
    $d = date('d');
    $m = date('m');
    $a = date('Y');
    $hora = date('H');
    $minuto = date('i');  
    $cat = $_POST['cat'];
    $cat2 = $_POST['cat2'];
    $cat3 = $_POST['cat3'];
    $cat4 = $_POST['cat4'];
    $cat5 = $_POST['cat5'];
    $tag1 = $_POST['tag1'];
    $tag2 = $_POST['tag2'];
    $tag3 = $_POST['tag3'];
    $tag5 = $_POST['tag4'];
    $tag5 = $_POST['tag5'];
    $publicar = $_POST['publicar'];
    $button = $_POST['button'];
		$precio = $_POST['precio'];
		$stock = $_POST['stock'];
    echo $button;
    if ($publicar == 'ahora') {$fechapub = 0; $ver_1 = "si"; };
    if ($publicar == 'programada') {
    $ver_1 = "no";
    $D = $_POST['D'];
    $M = $_POST['M'];
    $A = $_POST['A'];
    $hora = $_POST['hora'];
    $minuto = $_POST['minuto'];
    $d = $D;
    $m = $M;
    $a = $A;
    $D = str_pad((int) $D,2,"0",STR_PAD_LEFT);
    $M = str_pad((int) $M,2,"0",STR_PAD_LEFT);
    $hora = str_pad((int) $hora,2,"0",STR_PAD_LEFT);
    $minuto = str_pad((int) $minuto,2,"0",STR_PAD_LEFT);
    $fechapub = strtotime("$D-$M-$A $hora:$minuto");
    echo "	ESTA NOTICIA SE PUBLICARA AUTOMATICAMENTE <br />
    EL DIA $D-$M-$A A LAS  $hora:$minuto HORAS";

    };
    $D = str_pad((int) $D,2,"0",STR_PAD_LEFT);
    $M = str_pad((int) $M,2,"0",STR_PAD_LEFT);
    $hora = str_pad((int) $hora,2,"0",STR_PAD_LEFT);
    $minuto = str_pad((int) $minuto,2,"0",STR_PAD_LEFT);
    $tiempo_php = "$a$m$d$hora$minuto";

    if ($titulo == NULL) { ?>

      <p><? echo $idioma_100760 ?></p>
      <a class="btn btn-primary" href='javascript:history.back()'><? echo $idioma_volver?></a>

      <? exit;}

    if ($bajada == NULL) { ?>

      <p><? echo $idioma_100761 ?></p>
      <a class="btn btn-primary" href='javascript:history.back()'><? echo $idioma_volver?></a>

      <? exit;}



	  $ver_1 = $_POST['button'];



 $sSQL = "INTO `$basedatos`.`tienda_articulos` (`ID`,`titulo`,`bajada`,`texto`,`d`,`m`,`a`,`ver`,`foto`,`cat`,`cat2`,`cat3`,`cat4`,`cat5`,`destacado`,`tag1`,`tag2`,`tag3`,`tag4`,`tag5`,`fechapub`,`horapub`,`youtube`,`audio`, `visitas`, `home`, `carpetafoto`, `impresiones`, `html`, `ejemplo_marca_de_agua`, `time`, `date`, `mktime`, `ext_img`, `editor`, `des_cat`, `pie_foto`, `user`, `altfoto`, `titulofoto`, `detaca_modulo`, `precio`, `stock`) VALUES
    (NULL ,'$titulo','$bajada','$texto','$d','$m','$a','$ver_1','','$cat', '$cat2', '$cat3', '$cat4', '$cat5','no','$tag1','$tag2','$tag3','$tag4','$tag5','$fechapub','$tiempo_php','','','0','si','','0','','','0','0','0','.jpg','0','0','','$user','','','0','$precio','$stock');";

$conn->query($sSQL);





    $hay_des_2 = 'no';

    

    $sql = "SELECT ID FROM notas ORDER BY ID DESC LIMIT 1";

    $consulta = $conn->query($sql);
    while ($row = $consulta->fetch_assoc())
    {
    $ID_notaiiiii = $row["ID"];
    }
   $consulta->free_result();


    $mktime = time();

   

    $sSQL="UPDATE `notas` SET `user` = '$user' WHERE `notas`.`ID` = '$ID_notaiiiii';";

    

    $sSQL="UPDATE `notas` SET `mktime` = '$mktime' WHERE `notas`.`ID` = '$ID_notaiiiii';";

    $conn->query($sSQL);




?>



          <h4 class=""><? echo $idioma_100762?></h4>

          <p class=""><? echo $idioma_100763?></p>

          <a class="btn btn-primary mb-3" href="index.php"><? echo $idioma_cargar?></a>



</div>




</div>

<!-- jQuery first, then Popper.js, then Bootstrap JS -->
	<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js" integrity="sha384-wHAiFfRlMFy6i5SRaxvfOCifBUQy1xHdJ/yoi7FRNXMRBu5WHdZYu1hA6ZOblgut" crossorigin="anonymous"></script>
	<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js" integrity="sha384-B0UglyR+jN6CkvvICOB2joaf5I4l3gm9GU6Hc1og6Ls7i6U/mkkaduKaBhlAXv9k" crossorigin="anonymous"></script>

<script src="https://unpkg.com/isotope-layout@3/dist/isotope.pkgd.js"></script>
<script type="text/javascript">
window.setInterval(function(){
  $('.grid').isotope({
  itemSelector: '.grid-item'
});
}, 500);
</script>
 <script defer src="https://use.fontawesome.com/releases/v5.8.1/js/all.js" integrity="sha384-g5uSoOSBd7KkhAMlnQILrecXvzst9TdC09/VM+pjDTCM+1il8RHz5fKANTFFb+gQ" crossorigin="anonymous"></script>
</body>
</html>
