function mr_horaire_fr($o1, $f1, $o2, $f2)
{
    $mondialrelay = new mondialrelay();
    if ($o1 == '' || $o1 == null) {
        $o1 = '0000';
    }
    if ($f1 == '' || $f1 == null) {
        $f1 = '0000';
    }
    if ($o2 == '' || $o2 == null) {
        $o2 = '0000';
    }
    if ($f2 == '' || $f2 == null) {
        $f2 = '0000';
    }
    $o1 = substr($o1, 0, 2) . ':' . substr($o1, 2, 2);
    $f1 = substr($f1, 0, 2) . ':' . substr($f1, 2, 2);
    $o2 = substr($o2, 0, 2) . ':' . substr($o2, 2, 2);
    $f2 = substr($f2, 0, 2) . ':' . substr($f2, 2, 2);
    if ($o1 == '00:00' && $f1 == '00:00') {
        $p1 = $mondialrelay->getL('Closed');
    } else {
        $p1 = $o1 . ' - ' . $f1;
    }
    if ($o2 == '00:00' && $f2 == '00:00') {
        $p2 = $mondialrelay->getL('Closed');
    } else {
        $p2 = $o2 . ' - ' . $f2;
    }
    if ($p1 == 'Fermé' && $p2 == 'Fermé') {
        $p = $mondialrelay->getL('Closed');
    } else {
        $p = $p1 . '  ' . $p2;
    }
    return utf8_encode($p);
}
Esempio n. 2
0
function mondialrelay_setup()
{
    global $wpsc_shipping_modules;
    $mondialrelay = new mondialrelay();
    $wpsc_shipping_modules[$mondialrelay->getInternalName()] = $mondialrelay;
}