<?php session_start(); if ($_SESSION[username]) { include "../includes/conndb.php"; include "../includes/config.inc.php"; $dm = date("d/m"); $d = date("d"); $m = date("m"); $yx = date("Y"); $y = date("Y"); $daysdatestr = "01/" . $m . "/" . $y; $daystart = $y . "-" . $m . "-01"; $daylast = $yx . "/" . $m; $daylast2 = lastday($daylast); $dayend = retDatetsxxxx($daylast2); $daysdatepick = $dm . "/" . $y; $daledcy = date("Y"); $imputday = $daysdatestr . " - " . $dayend; ?> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title><?php echo $titleweb; ?> </title> <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'> <!-- bootstrap 3.0.2 --> <link href="../css/bootstrap.min.css" rel="stylesheet" type="text/css" />
function days_of_year($jmonth, $jday, $jyear) { $year = ""; $month = ""; $year = ""; $result = ""; if ($jmonth == "01") { return $jday; } for ($i = 1; $i < $jmonth || $i == 12; $i++) { list($year, $month, $day) = jalali_to_gregorian($jyear, $i, "1"); $result += lastday($month, $day, $year); } return $result + $jday; }
exec_query("INSERT INTO `{$p}var` (`var`,`value`) VALUES('show_gabBreaks','0')"); exec_query("INSERT INTO `{$p}var` (`var`,`value`) VALUES('show_RecordAgain','1')"); exec_query("INSERT INTO `{$p}var` (`var`,`value`) VALUES('show_TrackingNr','1')"); exec_query("INSERT INTO `{$p}var` (`var`,`value`) VALUES('date_format_0','%d.%m.%Y')"); exec_query("INSERT INTO `{$p}var` (`var`,`value`) VALUES('date_format_1','%d.%m.')"); exec_query("INSERT INTO `{$p}var` (`var`,`value`) VALUES('date_format_2','%d.%m.%Y')"); exec_query("INSERT INTO `{$p}var` (`var`,`value`) VALUES('language','{$kga['language']}')"); exec_query("INSERT INTO `{$p}var` (`var`,`value`) VALUES('roundPrecision','0')"); exec_query("INSERT INTO `{$p}var` (`var`,`value`) VALUES('decimalSeparator',',')"); exec_query("INSERT INTO `{$p}var` (`var`,`value`) VALUES('durationWithSeconds','0')"); exec_query("INSERT INTO `{$p}var` (`var`,`value`) VALUES('defaultTimezone','" . mysql_real_escape_string($_REQUEST['timezone']) . "')"); exec_query("INSERT INTO `{$p}var` (`var`,`value`) VALUES('exactSums','0')"); exec_query("INSERT INTO `{$p}var` (`var`,`value`) VALUES('defaultVat','0')"); // init timespace for admin user to current month $mon = date("n"); $day = date("j"); $Y = date("Y"); save_timespace(mktime(0, 0, 0, $mon, 1, $Y), mktime(23, 59, 59, $mon, lastday($month = $mon, $year = $Y), $Y), $randomAdminID); if ($errors) { require_once '../libraries/smarty/Smarty.class.php'; $tpl = new Smarty(); $tpl->template_dir = '../templates/'; $tpl->compile_dir = '../compile/'; $tpl->assign('headline', $kga['lang']['errors'][1]['hdl']); $tpl->assign('message', $kga['lang']['errors'][1]['txt']); $tpl->display('misc/error.tpl'); logfile("-- showing install error --------------------------"); } else { logfile("-- installation finished without error ------------"); header("Location: ../index.php"); }
function jdate($type, $maket = 'now') { global $icmsConfig; icms_loadLanguageFile('core', 'calendar'); $result = ''; if ($maket == 'now') { $year = date('Y'); $month = date('m'); $day = date('d'); list($jyear, $jmonth, $jday) = gregorian_to_jalali($year, $month, $day); $maket = jmaketime(date('h'), date('i'), date('s'), $jmonth, $jday, $jyear); } else { $date = date('Y-m-d', $maket); list($year, $month, $day) = preg_split('/-/', $date); list($jyear, $jmonth, $jday) = gregorian_to_jalali($year, $month, $day); } $need = $maket; $year = date('Y', $need); $month = date('m', $need); $day = date('d', $need); $i = 0; while ($i < strlen($type)) { $subtype = substr($type, $i, 1); switch ($subtype) { case 'A': $result1 = date('a', $need); if ($result1 == 'pm') { $result .= _CAL_PM_LONG; } else { $result .= _CAL_AM_LONG; } break; case 'a': $result1 = date('a', $need); if ($result1 == 'pm') { $result .= _CAL_PM; } else { $result .= _CAL_AM; } break; case 'd': list($jyear, $jmonth, $jday) = gregorian_to_jalali($year, $month, $day); if ($jday < 10) { $result1 = '0' . $jday; } else { $result1 = $jday; } $result .= $result1; break; case 'D': $result1 = date('D', $need); if ($result1 == 'Sat') { $result1 = _CAL_SAT; } else { if ($result1 == 'Sun') { $result1 = _CAL_SUN; } else { if ($result1 == 'Mon') { $result1 = _CAL_MON; } else { if ($result1 == 'Tue') { $result1 = _CAL_TUE; } else { if ($result1 == 'Wed') { $result1 = _CAL_WED; } else { if ($result1 == 'Thu') { $result1 = _CAL_THU; } else { if ($result1 == 'Fri') { $result1 = _CAL_FRI; } } } } } } } $result .= $result1; break; case 'F': list($jyear, $jmonth, $jday) = gregorian_to_jalali($year, $month, $day); $result .= Icms_getMonthNameById($jmonth); break; case 'g': $result .= date('g', $need); break; case 'G': $result .= date('G', $need); break; case 'h': $result .= date('h', $need); break; case 'H': $result .= date('H', $need); break; case 'i': $result .= date('i', $need); break; case 'j': list($jyear, $jmonth, $jday) = gregorian_to_jalali($year, $month, $day); $result .= $jday; break; case 'l': $result1 = date('l', $need); if ($result1 == 'Saturday') { $result1 = _CAL_SATURDAY; } else { if ($result1 == 'Sunday') { $result1 = _CAL_SUNDAY; } else { if ($result1 == 'Monday') { $result1 = _CAL_MONDAY; } else { if ($result1 == 'Tuesday') { $result1 = _CAL_TUESDAY; } else { if ($result1 == 'Wednesday') { $result1 = _CAL_WEDNESDAY; } else { if ($result1 == 'Thursday') { $result1 = _CAL_THURSDAY; } else { if ($result1 == 'Friday') { $result1 = _CAL_FRIDAY; } } } } } } } $result .= $result1; break; case 'm': list($jyear, $jmonth, $jday) = gregorian_to_jalali($year, $month, $day); if ($jmonth < 10) { $result1 = '0' . $jmonth; } else { $result1 = $jmonth; } $result .= $result1; break; case 'M': list($jyear, $jmonth, $jday) = gregorian_to_jalali($year, $month, $day); $result .= Icms_getMonthNameById($jmonth); break; case 'n': list($jyear, $jmonth, $jday) = gregorian_to_jalali($year, $month, $day); $result .= $jmonth; break; case 's': $result .= date('s', $need); break; case 'S': $result .= _CAL_SUFFIX; break; case 't': $result .= lastday($month, $day, $year); break; case 'w': $result .= date('w', $need); break; case 'y': list($jyear, $jmonth, $jday) = gregorian_to_jalali($year, $month, $day); $result .= substr($jyear, 2, 4); break; case 'Y': list($jyear, $jmonth, $jday) = gregorian_to_jalali($year, $month, $day); $result .= $jyear; break; default: $result .= $subtype; } $i++; } return $result; }
/** * Find days in this year untile now */ function yearTotalDays($jmonth, $jday, $jyear) { $year = ""; $month = ""; $year = ""; $result = ""; if ($jmonth == "01") { return $jday; } for ($i = 1; $i < $jmonth || $i == 12; $i++) { list($year, $month, $day) = $this->toGregorian($jyear, $i, "1"); $result += lastday($month, $day, $year); } return $result + $jday; }
function jdate($type, $maket = "now") { global $_JDF_USE_PERSIANNUM; $result = ""; if ($maket == "now") { $year = date("Y"); $month = date("m"); $day = date("d"); list($jyear, $jmonth, $jday) = gregorian_to_jalali($year, $month, $day); $maket = jmaketime(date("h") + _JDF_TZhours, date("i") + _JDF_TZminute, date("s"), $jmonth, $jday, $jyear); } else { $maket += _JDF_TZhours * 3600 + _JDF_TZminute * 60; $date = date("Y-m-d", $maket); list($year, $month, $day) = preg_split('/-/', $date); list($jyear, $jmonth, $jday) = gregorian_to_jalali($year, $month, $day); } $need = $maket; $year = date("Y", $need); $month = date("m", $need); $day = date("d", $need); $i = 0; while ($i < strlen($type)) { $subtype = substr($type, $i, 1); switch ($subtype) { case "A": $result1 = date("a", $need); if ($result1 == "pm") { $result .= _JDF_PM_LONG; } else { $result .= _JDF_AM_LONG; } break; case "a": $result1 = date("a", $need); if ($result1 == "pm") { $result .= _JDF_PM_SHORT; } else { $result .= _JDF_AM_SHORT; } break; case "d": list($jyear, $jmonth, $jday) = gregorian_to_jalali($year, $month, $day); if ($jday < 10) { $result1 = "0" . $jday; } else { $result1 = $jday; } if ($_JDF_USE_PERSIANNUM) { $result .= Convertnumber2farsi($result1); } else { $result .= $result1; } break; case "D": $result1 = date("D", $need); if ($result1 == "Sat") { $result1 = _JDF_Sat_SHORT; } else { if ($result1 == "Sun") { $result1 = _JDF_Sun_SHORT; } else { if ($result1 == "Mon") { $result1 = _JDF_Mon_SHORT; } else { if ($result1 == "Tue") { $result1 = _JDF_Tue_SHORT; } else { if ($result1 == "Wed") { $result1 = _JDF_Wed_SHORT; } else { if ($result1 == "Thu") { $result1 = _JDF_Thu_SHORT; } else { if ($result1 == "Fri") { $result1 = _JDF_Fri_SHORT; } } } } } } } $result .= $result1; break; case "F": list($jyear, $jmonth, $jday) = gregorian_to_jalali($year, $month, $day); $result .= monthname($jmonth); break; case "g": $result1 = date("g", $need); if ($_JDF_USE_PERSIANNUM) { $result .= Convertnumber2farsi($result1); } else { $result .= $result1; } break; case "G": $result1 = date("G", $need); if ($_JDF_USE_PERSIANNUM) { $result .= Convertnumber2farsi($result1); } else { $result .= $result1; } break; case "h": $result1 = date("h", $need); if ($_JDF_USE_PERSIANNUM) { $result .= Convertnumber2farsi($result1); } else { $result .= $result1; } break; case "H": $result1 = date("H", $need); if ($_JDF_USE_PERSIANNUM) { $result .= Convertnumber2farsi($result1); } else { $result .= $result1; } break; case "i": $result1 = date("i", $need); if ($_JDF_USE_PERSIANNUM) { $result .= Convertnumber2farsi($result1); } else { $result .= $result1; } break; case "j": list($jyear, $jmonth, $jday) = gregorian_to_jalali($year, $month, $day); $result1 = $jday; if ($_JDF_USE_PERSIANNUM) { $result .= Convertnumber2farsi($result1); } else { $result .= $result1; } break; case "l": $result1 = date("l", $need); if ($result1 == "Saturday") { $result1 = _JDF_Sat_LONG; } else { if ($result1 == "Sunday") { $result1 = _JDF_Sun_LONG; } else { if ($result1 == "Monday") { $result1 = _JDF_Mon_LONG; } else { if ($result1 == "Tuesday") { $result1 = _JDF_Tue_LONG; } else { if ($result1 == "Wednesday") { $result1 = _JDF_Wed_LONG; } else { if ($result1 == "Thursday") { $result1 = _JDF_Thu_LONG; } else { if ($result1 == "Friday") { $result1 = _JDF_Fri_LONG; } } } } } } } $result .= $result1; break; case "m": list($jyear, $jmonth, $jday) = gregorian_to_jalali($year, $month, $day); if ($jmonth < 10) { $result1 = "0" . $jmonth; } else { $result1 = $jmonth; } if ($_JDF_USE_PERSIANNUM) { $result .= Convertnumber2farsi($result1); } else { $result .= $result1; } break; case "M": list($jyear, $jmonth, $jday) = gregorian_to_jalali($year, $month, $day); $result .= monthname($jmonth); break; case "n": list($jyear, $jmonth, $jday) = gregorian_to_jalali($year, $month, $day); $result1 = $jmonth; if ($_JDF_USE_PERSIANNUM) { $result .= Convertnumber2farsi($result1); } else { $result .= $result1; } break; case "s": $result1 = date("s", $need); if ($_JDF_USE_PERSIANNUM) { $result .= Convertnumber2farsi($result1); } else { $result .= $result1; } break; case "S": $result .= _JDF_Suffix; break; case "t": $result .= lastday($month, $day, $year); break; case "w": $result1 = date("w", $need); if ($_JDF_USE_PERSIANNUM) { $result .= Convertnumber2farsi($result1); } else { $result .= $result1; } break; case "y": list($jyear, $jmonth, $jday) = gregorian_to_jalali($year, $month, $day); $result1 = substr($jyear, 2, 4); if ($_JDF_USE_PERSIANNUM) { $result .= Convertnumber2farsi($result1); } else { $result .= $result1; } break; case "Y": list($jyear, $jmonth, $jday) = gregorian_to_jalali($year, $month, $day); $result1 = $jyear; if ($_JDF_USE_PERSIANNUM) { $result .= Convertnumber2farsi($result1); } else { $result .= $result1; } break; default: $result .= $subtype; } $i++; } return $result; }