switch ($option['b_date']) { case 'nowday': $from = $now; $to = $now; break; case 'leftday': $from = date('Y-m-d', time() - 86400); $to = $from; break; case 'nowmonth': $from = date('Y-m') . "-01"; $to = $now; break; case 'nowweek': $from = date('Y-m-d', time() - 604800); $to = date('Y-m-d', time()); break; case 'leftmonth': $from = date('Y-m-d', mktime(0, 0, 0, date('m') - 1, 1, date('Y'))); $to = date('Y-m-t', mktime(0, 0, 0, date('m') - 1, 1, date('Y'))); break; } } if (!$quiet) { fwrite(STDOUT, "Pobieram biling od dnia : " . $from . " do " . $to . "\n"); } $HIPERUS->ImportBilling($from, $to, $option['b_success'], $option['b_type'], NULL, $quiet); } if ($option['config']) { $HIPERUS->GetConfigHiperus(); }