  <?php
session_start();
require_once('../conexion.php');
require_once('../include/sesiones.php');

$nameimagen = $_FILES['imagen_ico']['name'];
        $tmpimagen = $_FILES['imagen_ico']['tmp_name'];
        $extimagen = pathinfo($nameimagen);
        $ext = array("","ico");
        $urlnueva = "../img/logos_vicpos/favicon.ico";
        if(is_uploaded_file($tmpimagen))
        {
           if(array_search($extimagen['extension'],$ext))
            {
                copy($tmpimagen, $urlnueva);
                 echo '<div class="alert alert-info alert-dismissable">
                      <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
                      <strong>Imagen! guardada correctamente </strong>
                    </div>';
            }
            else 
            {
               echo '<div class="alert alert-danger alert-dismissable">
                      <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
                      <strong>La imagen no se guardo! </strong> Solo se permiten imágenes con formato .ico
                    </div>';
            }
        }

    ?>