routes.php

<?php
    $conn = mysqli_connect('localhost', '<USER>', '<PASSWORD>', '<DB>') or die(mysql_error());
    mysqli_query($conn, "SET NAMES 'utf8'");

    $query = "select * from croto_route  ;";
    $result = mysqli_query($conn, $query) or die(mysql_error());

    $routes = array();
    while($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
        $routes[] = $row;
    }

    echo 'var routes = ' . json_encode($routes);
?>
<script type="text/javascript" src="/json/routes.php"></script>
var $$ = Dom7;
var app = new Framework7({
    root: '#app',
    theme: 'md',
    routes: routes,
    panel: {
        leftBreakpoint: 768,
        rightBreakpoint: 768,
    },
    view: {
        animate: false,  
    },
});