<?php
include 'lib/remote.php';

$data = get_or_create($dom);

?>

<!DOCTYPE html>
<html lang="es-AR" dir="ltr">
<head>
    <meta charset="UTF-8">
    <title>Radios Net - Crea tu app</title>
    <base href="http://alexis.x7.com.ar/cdn/webrica/" target="_blank">

    <meta name="viewport" content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta name="format-detection" content="telephone=no">
    <meta name="msapplication-tap-highlight" content="no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">

    <link rel="apple-touch-icon" sizes="180x180" href="assets/icon/apple-touch-icon.png">
    <link rel="icon" type="image/png" sizes="32x32" href="assets/icon/favicon-32x32.png">
    <link rel="icon" type="image/png" sizes="16x16" href="assets/icon/favicon-16x16.png">
    <link rel="manifest" href="assets/icon/site.webmanifest">
    <link rel="mask-icon" href="assets/icon/safari-pinned-tab.svg" color="#5bbad5">
    <link rel="shortcut icon" href="assets/icon/favicon.ico">
    <meta name="apple-mobile-web-app-title" content="RadiosNet App Factory">
    <meta name="application-name" content="RadiosNet App Factory">
    <meta name="msapplication-TileColor" content="#ffffff">
    <meta name="msapplication-config" content="assets/icon/browserconfig.xml">
    <meta name="theme-color" content="#ffffff">

    <script src="cordova.js"></script>
    <link href="build/main.css" rel="stylesheet">
</head>
<body>
<?php

$finished = false;

if (isset($data['nosql'])) {
    $blob = json_decode($data['nosql'], True); // stdclass object to array
    if ($blob && $blob['finished']) {
        $finished = true
        ?>
            <div style="width: 100%; margin-top: 20px; text-align: center">
                
                <h1>¡Su aplicación está en proceso de producción!</h1>
                <h3>Relájese y espere a que la app esté terminada...</h3>
                <img src="assets/imgs/finished.gif" alt="&nbsp;">
                <br>
                <br>
                <br>
                <p>Ya no puede seguir personalizando el contenido de la aplicación móvil.</p>
                <p>Si considera que esto es un error, póngase en contacto con un representante.</p>
            </div>
        <?
    }
}

if (!$finished) {
    ?>
        <ion-app></ion-app>
        <script src="build/polyfills.js"></script>
        <script src="build/vendor.js"></script>
        <script src="build/main.js"></script>
    <?
}
?>

</body>
</html>
