Example #1
0
 public static function format_timestamp($mysql_timestamp)
 {
     $mysql_date = explode(" ", $mysql_timestamp);
     $date = DateUtils::format_date($mysql_date[0]);
     $hour = $mysql_date[1];
     return $date . ' - ' . $hour;
 }
Example #2
0
function get_menu_midi_content()
{
    global $mysql;
    global $locale;
    $content = '';
    $sql = "SELECT * FROM t_output_menu_midi WHERE type = 3 OR type = 4 ORDER BY 'id' ASC";
    $query = $mysql->sql_query($sql);
    $ul_open = false;
    $current_type = '';
    $cpt = 0;
    if ($query && mysqli_num_rows($query) > 0) {
        $content .= '<div id="menu" class="entryscreen">';
        $content .= '  <img src="medias/interface/backgrounds/menu.jpg" alt="Restaurant L\'Échaudé - Menu" />';
        $content .= '  <div class="circle blue">';
        $content .= '    <div id="menu-midi" class="blue">';
        $content .= '      <h2>' . $locale->pt('HOME_MENU_MIDI_TITLE') . ' <span>' . DateUtils::format_date(date('Y-m-d'), $locale->current_language) . '</span></h2>';
        while ($result = mysqli_fetch_assoc($query)) {
            switch ($result['type']) {
                case 4:
                    // item du jour
                    $cpt++;
                    if ($ul_open == false) {
                        $content .= '<ul>';
                        $ul_open = true;
                    }
                    if ($result['price'] != '') {
                        $price = '<span class="price">' . $result['price'] . '</span>';
                    }
                    $content .= '<li><span class="label">' . $result['txt_fr'] . '</span>' . $price . '</li>';
                    $current_type = $result['type'];
                    break;
                case 3:
                    // titres
                    if ($ul_open == true) {
                        $content .= '</ul>';
                        $ul_open = false;
                    }
                    $content .= '<br />';
                    $current_type = $result['type'];
                    break;
            }
            $price = '';
        }
        if ($ul_open == true) {
            $content .= '</ul>';
        }
        $content .= '				<a id="btn-menu-complet" href="menus#menu-midi">' . $locale->pt('HOME_MENU_MIDI_COMPLET') . '</a>';
        $content .= '    </div>';
        $content .= '  </div>';
        $content .= '</div>';
        if ($cpt == 0) {
            $content = '';
        }
    }
    return $content;
}