$fname = $r['fname']; $lname = $r['lname']; $airline = $r['airline']; $flight_id = $r['flight_id']; $class = $r['class']; $from_str = $r['name']; $to_str = $r['name']; $iata_from = $r['from_city']; $iata_to = $r['to_city']; $tik = file_get_contents("ticket_template.html"); $tik = str_replace("#voucher_id#", $voucher_id, $tik); $tik = str_replace("#ticket_number#", $ticket_number, $tik); $tik = str_replace("#PRICE#", $total_price, $tik); $tik = str_replace("#BASE_PRICE#", $base_price, $tik); $tik = str_replace("#TAX#", $tax, $tik); $tik = str_replace("#SYSTEM_NAME#", 'رزواسیون سفر', $tik); $tik = str_replace("#TICKET_DATE#", jdate('Y-m-d'), $tik); $tik = str_replace("#FNAME#", $lname, $tik); $tik = str_replace("#LNAME#", $lname, $tik); $tik = str_replace("#FROM_STR#", $from_str, $tik); $tik = str_replace("#TO_STR#", $to_str, $tik); $tik = str_replace("#GENDER#", $tickets[0]['gender'] == 1 ? 'Mr' : 'Ms', $tik); } $tik = str_replace("#flight_detail#", $qq, $tik); echo $tik . "<hr><span class='break'>"; } else { echo "no data"; } } else { echo "db error"; }
function persianDate($date) { require_once LIB_DIR . DS . 'jdf.php'; $timestamp = strtotime($date); $persianDate = jdate('Y/n/j', $timestamp); return $persianDate; }
function loadParvazDets() { $out = array(); $no = date("Y-m-d H:i:s"); $my = new mysql_class(); if (!isset($_REQUEST['parvaz_det_id'])) { return $out; } $parvaz_det_id = (int) $_REQUEST['parvaz_det_id']; $parvaz_det = new parvaz_det_class((int) $parvaz_det_id); $parvaz = new parvaz_class($parvaz_det->parvaz_id); $maghsad_id = $parvaz->maghsad_id; $mabda_id = $parvaz->mabda_id; $my->ex_sql("select `id` from `parvaz` where `mabda_id`='{$maghsad_id}' and `maghsad_id`='{$mabda_id}' group by `id`", $q); $ids = array(); foreach ($q as $r) { $ids[] = $r['id']; } if (count($ids) > 0) { $q = array(); $ids = implode(',', $ids); $my->ex_sql("select `id`,`parvaz_id`,`tarikh` from `parvaz_det` where `parvaz_id` in ({$ids}) and `tarikh`>='{$no}' order by `tarikh` ", $q); foreach ($q as $r) { $par = new parvaz_class((int) $r['parvaz_id']); $tarikh = jdate('j / n / Y', strtotime($r['tarikh'])); $out[$r['id']] = 'پرواز شماره ' . $par->shomare . ' تاریخ ' . $tarikh; } } return $out; }
function visiting($pname, $db, $sitelang = 'fa') { $date = jdate('F Y'); $do = "p" . $pname; $query = mysql_query("SELECT date FROM visitbykk_" . $sitelang . " WHERE date='{$date}' ;", $db); if ($row = mysql_fetch_row($query)) { $query = mysql_query("SELECT " . $do . " FROM visitbykk_" . $sitelang . " WHERE date='{$date}' ;", $db); $row = mysql_fetch_row($query); $add = $row[0] + 1; $query = mysql_query("UPDATE visitbykk_" . $sitelang . " SET " . $do . " = '{$add}' WHERE date='{$date}' ;", $db); } else { $query = mysql_query("SELECT id FROM visitbykk_" . $sitelang . " ORDER BY id DESC ;", $db); if ($rows = mysql_fetch_row($query)) { $vid = $rows[0] + 1; } else { $vid = 1000; } $sql = "INSERT INTO visitbykk_" . $sitelang . " ( id , date ) VALUES ('{$vid}' , '{$date}' );"; $result = mysql_query($sql); $query = mysql_query("UPDATE visitbykk_" . $sitelang . " SET " . $do . " = '1' WHERE date='{$date}' ", $db); //echo "bigh"; if (!$query) { echo mysql_error(); } } }
public function get() { // sleep(2); $this->load->library('jdf'); $year = jdate("Y", time(), "", "Asia/Tehran", "en"); $month = jdate("m", time(), "", "Asia/Tehran", "en"); $day = jdate("d", time(), "", "Asia/Tehran", "en"); $this->showItems($year, $month, $day); }
function loadPDate($dt) { if ($dt != '0000-00-00 00:00:00') { $out = jdate("d / m / Y", strtotime($dt)); } else { $out = ''; } return $out; }
public function format($str = 'Y-m-d H:i:s', $farsi = false) { global $_JDF_USE_PERSIANNUM; if ($farsi) { $_JDF_USE_PERSIANNUM = 1; } $str = jdate($str, $this->time); $_JDF_USE_PERSIANNUM = 0; return $str; }
public function updateNotes($note_id, $note_content) { include_once "jdf.php"; $note_date = jdate('Y/n/j'); $note_content = mysql_real_escape_string($note_content); $note_subject = $this->createSubject($note_content, 0, 15); $note_subject = mysql_real_escape_string($note_subject); $result = mysql_query("UPDATE `tbl_notes` SET `note_subject`='{$note_subject}', `note_date`='{$note_date}', `note_content`='{$note_content}' WHERE `id` = '{$note_id}'") or die(mysql_error()); error_log("updateNotes >> result : " . $result . " >> at : " . $date_now . "\r\n", 3, "Log.log"); return $result; }
/** * Render the Date field */ public function render() { global $icmsConfigPersona; $ele_name = $this->getName(); $ele_value = $this->getValue(false); $jstime = formatTimestamp($ele_value, _SHORTDATESTRING); include_once ICMS_ROOT_PATH . '/include/calendar' . ($icmsConfigPersona['use_jsjalali'] == true ? 'jalali' : '') . 'js.php'; $result = "<input type='text' name='" . $ele_name . "' id='" . $ele_name . "' size='" . $this->getSize() . "' maxlength='" . $this->getMaxlength() . "' value='" . date(_SHORTDATESTRING, $ele_value) . "'" . $this->getExtra() . " /> <img src='" . ICMS_URL . "/images/calendar.png' alt='" . _CALENDAR . "' title='" . _CALENDAR . "' onclick='return showCalendar(\"" . $ele_name . "\");'>"; if ($icmsConfigPersona['use_jsjalali']) { include_once ICMS_ROOT_PATH . '/include/jalali.php'; $result = "<input id='tmp_" . $ele_name . "' readonly='readonly' size='" . $this->getSize() . "' maxlength='" . $this->getMaxlength() . "' value='" . (_CALENDAR_TYPE == 'jalali' ? icms_conv_nr2local(jdate(_SHORTDATESTRING, $ele_value)) : date(_SHORTDATESTRING, $ele_value)) . "' /><input type='hidden' name='" . $ele_name . "' id='" . $ele_name . "' value='" . date(_SHORTDATESTRING, $ele_value) . "' " . $this->getExtra() . " /> <img src='" . ICMS_URL . "/images/calendar.png' alt='" . _CALENDAR . "' title='" . _CALENDAR . "' id='btn_" . $ele_name . "'><script type='text/javascript'>\n\t\t\t\tCalendar.setup({\n\t\t\t\t\tinputField : 'tmp_" . $ele_name . "',\n\t\t \t\tifFormat : '%Y-%m-%d',\n\t\t \t\tbutton : 'btn_" . $ele_name . "',\n \t\t\tlangNumbers : true,\n \t\t\tdateType\t: '" . _CALENDAR_TYPE . "',\n\t\t\t\t\tonUpdate\t: function(cal){document.getElementById('" . $ele_name . "').value = cal.date.print('%Y-%m-%d');}\n\t\t\t\t});\n\t\t\t</script>"; } return $result; }
public function __construct($id = -1) { if ((int) $id > 0) { $mysql = new mysql_class(); $mysql->ex_sql("select * from `user` where `id` = {$id}", $q); if (isset($q[0])) { $r = $q[0]; foreach ($r as $k => $v) { $this->{$k} = $v; if ($k == "tarikh_tavalod") { $ptarikh = $this->inc_model->perToEnNums(jdate("Y-m-d", strtotime($v))); $tmp = explode("-", $ptarikh); $this->sal = (int) $tmp[0]; $this->mah = (int) $tmp[1]; $this->rooz = (int) $tmp[2]; } } } } }
public function request_pay($total, $invoice_id) { $total = (int) $total; $invoice_id = (int) $invoice_id; if (!$total || !$invoice_id) { return array("error" => 'خطای فاکتور و مبلغ'); } $orderId = $invoice_id; $amount = $total; $callBackUrl = get_pay_result_link("melat", $orderId); $parameters = array('terminalId' => $this->terminalId, 'userName' => $this->userName, 'userPassword' => $this->userPassword, 'orderId' => $orderId, 'amount' => $amount, 'localDate' => jdate('Ymd'), 'localTime' => jdate('His'), 'additionalData' => '', 'callBackUrl' => $callBackUrl, 'payerId' => 0); $client = new NuSOAP_Client('https://bpm.shaparak.ir/pgwchannel/services/pgw?wsdl'); if ($err = $client->getError() || $client->fault) { $json = array(); $json['error'] = "متاسفانه سامانه بانک ملت در حال به روزرسانی است. " . $err; return $json; } $res = $client->call('bpPayRequest', $parameters, $this->namespace); if (!$res) { $json = array(); $json['error'] = "متاسفانه سامانه بانک ملت در حال به روزرسانی است. "; $json['error2'] = $client->getError(); return $json; } $res = explode(",", $res); if (sizeof($res) == 1 || $res[0] != 0) { $json = array(); $json['error'] = "خطا شماره " . $res[0]; return $json; } $json = array(); $json['success'] = 1; $json['RefId'] = $res[1]; $this->session->set_userdata(array("melat_refId" => $res[1])); return $json; }
/** * Function to display formatted times in user timezone * * @param string $time String with time * @param string $format The time format based on PHP function format parameters * @param string $timeoffset The time offset string * @return string $usertimestamp The generated user timestamp * @todo Move to a static class method - Date or Calendar */ function formatTimestamp($time, $format = "l", $timeoffset = null) { global $icmsConfig; $format_copy = $format; $format = strtolower($format); if ($format == "rss" || $format == "r") { $TIME_ZONE = ""; if (!empty($GLOBALS['icmsConfig']['server_TZ'])) { $server_TZ = abs((int) ($GLOBALS['icmsConfig']['server_TZ'] * 3600.0)); $prefix = $GLOBALS['icmsConfig']['server_TZ'] < 0 ? " -" : " +"; $TIME_ZONE = $prefix . date("Hi", $server_TZ); } $date = gmdate("D, d M Y H:i:s", (int) $time) . $TIME_ZONE; return $date; } if (($format == "elapse" || $format == "e") && $time < time()) { $elapse = time() - $time; if ($days = floor($elapse / (24 * 3600))) { $num = $days > 1 ? sprintf(_DAYS, $days) : _DAY; } elseif ($hours = floor($elapse % (24 * 3600) / 3600)) { $num = $hours > 1 ? sprintf(_HOURS, $hours) : _HOUR; } elseif ($minutes = floor($elapse % 3600 / 60)) { $num = $minutes > 1 ? sprintf(_MINUTES, $minutes) : _MINUTE; } else { $seconds = $elapse % 60; $num = $seconds > 1 ? sprintf(_SECONDS, $seconds) : _SECOND; } $ret = sprintf(_ELAPSE, icms_conv_nr2local($num)); return $ret; } // disable user timezone calculation and use default timezone, // for cache consideration if ($timeoffset === null) { $timeoffset = $icmsConfig['default_TZ'] == '' ? '0.0' : $icmsConfig['default_TZ']; } $usertimestamp = xoops_getUserTimestamp($time, $timeoffset); switch ($format) { case 'daynumber': $datestring = 'd'; break; case 'D': $datestring = 'D'; break; case 'F': $datestring = 'F'; break; case 'hs': $datestring = 'h'; break; case 'H': $datestring = 'H'; break; case 'gg': $datestring = 'g'; break; case 'G': $datestring = 'G'; break; case 'i': $datestring = 'i'; break; case 'j': $datestring = 'j'; break; case 'l': $datestring = _DATESTRING; break; case 'm': $datestring = _MEDIUMDATESTRING; break; case 'monthnr': $datestring = 'm'; break; case 'mysql': $datestring = 'Y-m-d H:i:s'; break; case 'month': $datestring = 'M'; break; case 'n': $datestring = 'n'; break; case 's': $datestring = _SHORTDATESTRING; break; case 'seconds': $datestring = 's'; break; case 'suffix': $datestring = 'S'; break; case 't': $datestring = 't'; break; case 'w': $datestring = 'w'; break; case 'shortyear': $datestring = 'y'; break; case 'Y': $datestring = 'Y'; break; case 'c': case 'custom': static $current_timestamp, $today_timestamp, $monthy_timestamp; if (!isset($current_timestamp)) { $current_timestamp = xoops_getUserTimestamp(time(), $timeoffset); } if (!isset($today_timestamp)) { $today_timestamp = mktime(0, 0, 0, date("m", $current_timestamp), date("d", $current_timestamp), date("Y", $current_timestamp)); } if (abs($elapse_today = $usertimestamp - $today_timestamp) < 24 * 60 * 60) { $datestring = $elapse_today > 0 ? _TODAY : _YESTERDAY; } else { if (!isset($monthy_timestamp)) { $monthy_timestamp[0] = mktime(0, 0, 0, 0, 0, date("Y", $current_timestamp)); $monthy_timestamp[1] = mktime(0, 0, 0, 0, 0, date("Y", $current_timestamp) + 1); } if ($usertimestamp >= $monthy_timestamp[0] && $usertimestamp < $monthy_timestamp[1]) { $datestring = _MONTHDAY; } else { $datestring = _YEARMONTHDAY; } } break; default: if ($format != '') { $datestring = $format_copy; } else { $datestring = _DATESTRING; } break; } $basecheck = $icmsConfig['use_ext_date'] == true && defined('_CALENDAR_TYPE') && $format != 'mysql'; if ($basecheck && file_exists(ICMS_ROOT_PATH . '/language/' . $icmsConfig['language'] . '/local.date.php')) { include_once ICMS_ROOT_PATH . '/language/' . $icmsConfig['language'] . '/local.date.php'; return ucfirst(local_date($datestring, $usertimestamp)); } elseif ($basecheck && _CALENDAR_TYPE != "jalali" && $icmsConfig['language'] != 'english') { return ucfirst(icms_conv_nr2local(ext_date(date($datestring, $usertimestamp)))); } elseif ($basecheck && _CALENDAR_TYPE == "jalali") { include_once 'jalali.php'; return ucfirst(icms_conv_nr2local(jdate($datestring, $usertimestamp))); } else { return ucfirst(date($datestring, $usertimestamp)); } }
$adl = (int) $_SESSION['adl']; $chd = (int) $_SESSION['chd']; $inf = (int) $_SESSION['inf']; $price = $_SESSION['price']; $flight_info2 = NULL; $rookeshi2 = 0; $days = ''; $months = ''; $years = ''; for ($i = 1; $i <= 31; $i++) { $days .= "<option values='{$i}'>{$i}</option>"; } for ($i = 1; $i <= 12; $i++) { $months .= "<option values='{$i}'>{$i}</option>"; } $pyear = (int) $this->inc_model->perToEnNums(jdate("Y")); for ($i = 1300; $i <= $pyear; $i++) { $years .= "<option values='{$i}'>{$i}</option>"; } $flight_info = json_decode($data); //var_dump($flight_info);exit; $rookeshi = rookeshi_class::get($flight_info->source_id); if (isset($_SESSION['data2'])) { $data2 = $_SESSION['data2']; $flight_info2 = json_decode($data2); $rookeshi2 = rookeshi_class::get($flight_info2->source_id); } if (!isset($_SESSION['state'])) { redirect(""); } else { if ((int) $_SESSION['state'] == 2) {
/** * Format input date string * @param $time int same as returned from PHP time() * @return string formatted date according to saved options */ public function formatDate($time) { // This method gets executed in a loop. Cache some variable to avoid // repeated get_option calls to the database if (CF7DBPlugin::$checkForCustomDateFormat) { if ($this->getOption('UseCustomDateTimeFormat', 'true') == 'true') { CF7DBPlugin::$customDateFormat = $this->getOption('SubmitDateTimeFormat', 'Y-m-d H:i:s P'); } else { CF7DBPlugin::$dateFormat = get_option('date_format'); CF7DBPlugin::$timeFormat = get_option('time_format'); } // Convert time to local timezone date_default_timezone_set(get_option('timezone_string')); CF7DBPlugin::$checkForCustomDateFormat = false; } // Support Jalali dates but looking for wp-jalali plugin and // using its 'jdate' function if (!function_exists('is_plugin_active') && @file_exists(ABSPATH . 'wp-admin/includes/plugin.php')) { include_once ABSPATH . 'wp-admin/includes/plugin.php'; } if (function_exists('is_plugin_active') && is_plugin_active('wp-jalali/wp-jalali.php')) { $jDateFile = WP_PLUGIN_DIR . '/wp-jalali/inc/jalali-core.php'; if (@file_exists($jDateFile)) { include_once $jDateFile; if (function_exists('jdate')) { //return jdate('l, F j, Y'); if (CF7DBPlugin::$customDateFormat) { return jdate(CF7DBPlugin::$customDateFormat, $time); } else { return jdate(CF7DBPlugin::$dateFormat . ' ' . CF7DBPlugin::$timeFormat, $time); } } } } if (CF7DBPlugin::$customDateFormat) { return date(CF7DBPlugin::$customDateFormat, $time); } else { return date_i18n(CF7DBPlugin::$dateFormat . ' ' . CF7DBPlugin::$timeFormat, $time); } }
@section('content') <div class="row"> <div class="col-md-8"> <!-- Shopping History --> <div class="panel panel-default table-responsive"> <div class="panel-heading hidden-xs text-center">وضعیت سفارش ها <i class="fa fa-trash pull-left"></i> </div> <div class="list-group"> @if( $user->orders->count() > 0 ) @foreach( $user->orders as $order ) <?php $mydate = jdate()->forge($order->created_at); ?> @if( $order->status === 0 ) <a href="{{ route('order.destroy', ['order' => $order->id]) }}" class="btn btn-default btn-delOrder"> <i class="fa fa-remove fa-fw"></i> </a> <a href="{{ route('order.show', ['order' => $order->id]) }}" style="padding-right:30px;" class="list-group-item {{ 'd-' . $order->id }}"> در حال بررسی. تاریخ ثبت : {{ $mydate->ago() }} <span class="badge hidden-xs">{{ number_format($order->sum) . ' ريال' }}</span> </a> @elseif( $order->status === 1 ) <a href="{{ route('order.show', ['order' => $order->id]) }}" class="list-group-item list-group-item-success"> سفارش شما در تاریخ {{ $mydate->format('%d %B %Y') }}، ساعت {{ $mydate->format('time') }} ارسال شد. <span class="badge hidden-xs">{{ number_format($order->sum) . ' ريال' }}</span> </a>
/** * Format input date string * @param $time int same as returned from PHP time() * @return string formatted date according to saved options */ public function formatDate($time) { // This method gets executed in a loop. Cache some variable to avoid // repeated get_option calls to the database if (CF7DBPlugin::$checkForCustomDateFormat) { if ($this->getOption('UseCustomDateTimeFormat', 'true') == 'true') { CF7DBPlugin::$customDateFormat = $this->getOption('SubmitDateTimeFormat', 'Y-m-d H:i:s P'); } else { CF7DBPlugin::$dateFormat = get_option('date_format'); CF7DBPlugin::$timeFormat = get_option('time_format'); } $this->setTimezone(); CF7DBPlugin::$checkForCustomDateFormat = false; } // Support Shamsi(Jalali) dates by looking for a plugin that can produce the correct text for the date if (!function_exists('is_plugin_active') && @file_exists(ABSPATH . 'wp-admin/includes/plugin.php')) { include_once ABSPATH . 'wp-admin/includes/plugin.php'; } if (function_exists('is_plugin_active')) { // See if wp-parsidate is active and if so, have it convert the date // using its 'parsidate' function if (is_plugin_active('wp-parsidate/wp-parsidate.php')) { if (function_exists('parsidate')) { if (CF7DBPlugin::$customDateFormat) { return parsidate(CF7DBPlugin::$customDateFormat, $time); } else { return parsidate(CF7DBPlugin::$dateFormat . ' ' . CF7DBPlugin::$timeFormat, $time); } } } else { if (is_plugin_active('wp-jalali/wp-jalali.php')) { $jDateFile = WP_PLUGIN_DIR . '/wp-jalali/inc/jalali-core.php'; if (@file_exists($jDateFile)) { include_once $jDateFile; if (function_exists('jdate')) { //return jdate('l, F j, Y'); if (CF7DBPlugin::$customDateFormat) { return jdate(CF7DBPlugin::$customDateFormat, $time); } else { return jdate(CF7DBPlugin::$dateFormat . ' ' . CF7DBPlugin::$timeFormat, $time); } } } } } } if (CF7DBPlugin::$customDateFormat) { return date(CF7DBPlugin::$customDateFormat, $time); } else { return date_i18n(CF7DBPlugin::$dateFormat . ' ' . CF7DBPlugin::$timeFormat, $time); } }
$newDrill = array("name" => $name, "id" => $name, "data" => array()); foreach ($drills as $taskName => $studied) { $newDrill["data"][] = array($taskName, floatval($studied)); } return $newDrill; } for ($i = 0; $i < $numberOfDays; $i++) { $index = jdate("m/d", $minStart + 86400 * $i); $result[$index]["name"] = $index; $result[$index]["y"] = 0; if (hasDrilldown($type)) { $result[$index]["drilldown"] = $index; $result[$index]["drills"] = array(); } } for ($i = 0; $i < count($items); $i++) { $result[jdate("m/d", $items[$i]["start"])]["y"] += $items[$i]["length"] / (60 * 60); if (hasDrilldown($type)) { if (!isset($result[jdate("m/d", $items[$i]["start"])]["drills"][$items[$i]["task_name"]])) { $result[jdate("m/d", $items[$i]["start"])]["drills"][$items[$i]["task_name"]] = 0; } $result[jdate("m/d", $items[$i]["start"])]["drills"][$items[$i]["task_name"]] += $items[$i]["length"] / (60 * 60); } } if (hasDrilldown($type)) { foreach ($result as $key => $value) { $newDrill = makeNewDrilldown($key, $value["drills"]); $drillDownSeries[] = $newDrill; } } echo json_encode(array("xAxis" => array("type" => 'category'), "series" => array(array("data" => array_values($result))), "drilldown" => array("series" => $drillDownSeries), "tooltip" => array("pointFormat" => '<span style="color:{point.color}" dir="rtl" class="myFont"><p class="myFont">{point.y:.1f} ساعت</p></span>'), "legend" => array("enabled" => false)));
</div> </div> <div class="data-row hotel-name two-cols"> <div class="title">تاریخ ورود</div> <div class="value text-center first-value"> <?php $arr = explode('-', $invoce_data['date_in']); echo jdate('l', $invoce_data['date_in']) . ' '; echo gregorian_to_jalali($arr[0], $arr[1], $arr[2], '/'); ?> </div> <div class="title">تاریخ خروج</div> <div class="value text-center"> <?php $arr = explode('-', $invoce_data['date_out']); echo jdate('l', $invoce_data['date_out']) . ' '; echo gregorian_to_jalali($arr[0], $arr[1], $arr[2], '/'); ?> </div> </div> <div class="data-row description"> <div class="title">توضیحات</div> <div class="value"> <?php echo ''; ?> </div> </div> <?php } ?>
@extends('app') @section('content') <div class="row"> </div> <div class="col-md-3"> <?php include 'js/date_time.php'; $day_number = jdate('j'); $month_number = jdate('n'); $year_number = jdate('y'); $day_name = jdate('l'); ?> <div style="margin:0px auto; width:400px;padding:5px;border:1px solid #ccc;background:#FFF9F9;"> <div style="text-align:center; direction:rtl; font:bold 15px/22px tahoma; direction:rtl; color:#093;"><?php echo " امروز {$day_name} ۱۳{$year_number}/{$month_number}/{$day_number}"; ?> </div><br /> </div> <div class="row"> </div> @for ($i=0;$i<7;$i++) <div class="panel panel-default"> <div class="panel-heading"> <div class="panel-title">fdsfdsf</div> <div class="panel-body"> fsdfsdfdsf </div> </div>
function hamed_pdate($str) { $out = jdate('Y/n/j', strtotime($str)); return enToPerNums($out); }
echo "<option value='{$k}' selected='selected'>{$k}</option>"; } else { echo "<option value='{$k}'>{$k}</option>"; } } ?> </select> <select name="passenger[<?php echo $rmk; ?> ][birthyear][<?php echo $i; ?> ]" class="year-field"> <?php $cur = intval(jdate('Y')); for ($k = $cur; $k > $cur - 12; $k--) { if (isset($_SESSION['passenger']) && intval($_SESSION['passenger'][$rmk][$i]['birthyear']) == intval($k)) { echo "<option value='{$k}' selected='selected'>{$k}</option>"; } else { echo "<option value='{$k}'>{$k}</option>"; } } ?> </select> </td> </tr> <?php } ?> </table>
function hamed_pdate_day($str) { $out = jdate('l', strtotime($str)); return $out; }
function iranianConvertDate($date = null, $persian = false) { if (!isset($date)) { $date = time(); } else { $date = strtotime($date); } if (!$persian) { $date = jdate('j F Y', $date, null, null, 'en'); // must be placed inside <span dir="ltr"></span> if didn't work try dir="rtl" } else { $date = jdate('j F Y', $date); // must be placed inside <span dir="ltr"></span> } return $date; }
function jgetdate($timestamp = '', $none = '', $tz = 'Asia/Tehran', $tn = 'en') { $ts = $timestamp == '' ? time() : tr_num($timestamp); $jdate = explode('_', jdate('F_G_i_j_l_n_s_w_Y_z', $ts, '', $tz, $tn)); return array('seconds' => tr_num((int) tr_num($jdate[6]), $tn), 'minutes' => tr_num((int) tr_num($jdate[2]), $tn), 'hours' => $jdate[1], 'mday' => $jdate[3], 'wday' => $jdate[7], 'mon' => $jdate[5], 'year' => $jdate[8], 'yday' => $jdate[9], 'weekday' => $jdate[4], 'month' => $jdate[0], 0 => tr_num($ts, $tn)); }
function hamed_pdate($str) { $out = jdate('H:i:s d / m / Y ', strtotime($str)); $out .= "<br/>" . date('F d', strtotime($str)); return enToPerNums($out); }
<div style="margin-right:420px; margin-top:-10px;"> <img border="0" src="../img/admin/logoBig.png"> <div style="margin-right:-578px; margin-top:-70px;"> <div class="point2">امروز <b><?php echo jdate('l j F Y'); ?> </b> مي باشد .</div> <div class="point2"><?php if ($_SESSION['access'] == MULTIHUNTER) { echo '<b><font color="Blue">Multihunter</font></b>'; } elseif ($_SESSION['access'] == ADMIN) { echo '<b><font color="Red">Administrator</font></b>'; } ?> عزیز به مدیریت سیستم خوش آمدید ! خسته نباشید .</div> <div class="point2">آی پی : <?php echo $_SERVER['REMOTE_ADDR']; ?> </div> </div> </div>
*/ ?> <div class="post-meta"> <ul class="post-meta-list"> <li class="meta-date dt-published"> <i class="fa fa-calendar"></i> <?php if (is_singular()) { echo __('Published Date : ', 'naiau'); } ?> <?php if (function_exists('jdate')) { $date = sprintf('<a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a>', esc_url(get_permalink()), esc_attr(get_the_time()), esc_attr(jdate('c', strtotime($post->post_date))), esc_html(jdate(get_option('date_format'), strtotime($post->post_date)))); } else { $date = sprintf('<a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a>', esc_url(get_permalink()), esc_attr(get_the_time()), esc_attr(get_the_date('c')), esc_html(get_the_date())); } echo $date; ?> </li> <?php if ('news' == get_post_type() && is_singular()) { $cat_list = get_the_term_list(get_the_ID(), 'news_cat', '<span class="cats-title">' . __('News category :', 'naiau') . '</span> ', ', '); $tag_list = get_the_term_list(get_the_ID(), 'news_tag', '<span class="tags-title">' . __('News Tags :', 'naiau') . '</span> ', ', ');
function wp_record_ip_show() { global $myLDNavigationBarStyle; global $wpdb; $wpdb->hide_errors(); $table = $wpdb->prefix . "usermeta"; if (isset($_GET['pge'])) { $pageno = intval($_GET['pge']); } else { $pageno = 1; } $sql_query = "SELECT count(meta_key) FROM " . $table . " WHERE meta_key='wp_record_user_ip'"; $all_ips = $wpdb->get_var($sql_query); $rows_per_page = 30; $lastpage = @ceil($all_ips / $rows_per_page); $pageno = (int) $pageno; if ($pageno > $lastpage) { $pageno = $lastpage; } if ($pageno < 1) { $pageno = 1; } $limit = 'LIMIT ' . ($pageno - 1) * $rows_per_page . ',' . $rows_per_page; if (isset($_POST['search_status']) && $_POST['search_status'] != 'Y') { $sql_query = $wpdb->prepare(" SELECT * FROM " . $table . " WHERE meta_key='wp_record_user_ip' ORDER BY umeta_id DESC " . $limit); } else { //Here we build our search query to find and sort our list. if (empty($_POST['sort_by'])) { $cloumn = "ORDER BY umeta_id"; } else { $cloumn = "ORDER BY " . $_POST['sort_by']; } if (empty($_POST['sort_order'])) { $order = "DESC"; } else { $order = $_POST['sort_order']; } if (isset($_POST['s'])) { $_s = $_POST['s']; } else { $_s = ''; } $sql_query = " SELECT * FROM " . $table . " WHERE meta_key='wp_record_user_ip' AND meta_value LIKE '%" . $_s . "%' " . $cloumn . " " . $order . " " . $limit; } $ret_ips = $wpdb->get_results($sql_query, ARRAY_A); //Check posted order and direction to set corresponding listbox show selected one. $selected_ip = ""; $selected_date = ""; if (isset($_POST['sort_by'])) { switch ($_POST['sort_by']) { case "selected_ip": $selected_ip = 'selected="selected"'; break; case "selected_date": $selected_date = 'selected="selected"'; break; } } $selectd_order_asc = ""; $selectd_order_desc = ""; if (isset($_POST['sort_order'])) { switch ($_POST['sort_order']) { case "ASC": $selectd_order_asc = 'selected="selected"'; break; case "DESC": $selectd_order_desc = 'selected="selected"'; break; } } // ?> <?php if (isset($_POST['action2']) && $_POST['action2'] == 'delete') { foreach ($_POST['ips_group'] as $ip => $value) { $sql_query = "DELETE FROM {$table} WHERE umeta_id ='" . $value . "' LIMIT 1"; $wpdb->query($sql_query); } $up_url = "admin.php?page=wp-record-ip"; ?> <script type="text/javascript"> window.location.replace("<?php echo $up_url; ?> ") </script> <?php } ?> <div class="wrap"> <?php echo "<h2>" . __('List of IPs', 'wp-record-ip') . "</h2>"; ?> <form method="post" action="<?php echo "admin.php?page=wp-record-ip"; ?> " name="link_form"> <ul class="subsubsub"> <li><strong><?php echo __('Total IPs', 'wp-record-ip') . ": </strong>" . $all_ips; ?> </li> </ul> <p class="search-box"> <span><?php echo __('Sort by:', 'wp-record-ip'); ?> </span> <!--<select name="sort_by"> <option value="" ><?php echo __('Select Column', 'wp-record-ip'); ?> </option> <option value="selected_ip" <?php echo $selected_ip; ?> ><?php echo __('IP', 'wp-record-ip'); ?> </option> <option value="selected_date" <?php echo $selected_date; ?> ><?php echo __('Date', 'wp-record-ip'); ?> </option> </select>--> <select name="sort_order"> <option value=""><?php echo __('Select Direction', 'wp-record-ip'); ?> </option> <option value="ASC" <?php echo $selectd_order_asc; ?> ><?php echo __('Ascending', 'wp-record-ip'); ?> </option> <option value="DESC" <?php echo $selectd_order_desc; ?> ><?php echo __('Descending', 'wp-record-ip'); ?> </option> </select> <input id="post-search-input" class="search-input" type="text" value="" name="s"/> <input type="hidden" value="Y" name="search_status"/> <input class="button" type="submit" value="<?php echo _e('Search', 'wp-record-ip'); ?> "/> </p> <table class="widefat fixed" cellspacing="0"> <thead> <tr> <th id="cb" scope="col" class="manage-column column-cb check-column"> <input type="checkbox" name="checkAll" value=""/> </th> <th scope="col" class="manage-column column-name"><?php echo __('User Name', 'wp-record-ip'); ?> </th> <th scope="col" class="manage-column column-name"><?php echo __('IP', 'wp-record-ip'); ?> </th> <th scope="col" class="manage-column column-name" style="text-align:center"><?php echo __('Record Date and Time', 'wp-record-ip'); ?> </th> </tr> </thead> <tbody> <?php $a = 0; if (!empty($ret_ips)) { foreach ($ret_ips as $ip) { $a++; //if ($ldlink['approval'] == 0 ){ // $style = 'style="background-color: #FFFFD2"'; //}else{ $style = ''; //} if ($a % 2) { ?> <tr class="alternate" valign="middle" id="link-2" <?php echo $style; ?> > <?php } else { ?> <tr valign="middle" id="link-2" <?php echo $style; ?> > <?php } ?> <th class="check-column" scope="row"> <input type="checkbox" name="ips_group[]" value="<?php echo $ip['umeta_id']; ?> "/> </th> <td class="column-name"> <strong> <?php $pieces = explode("|", $ip['meta_value']); $current_user = get_userdata($ip['user_id']); ?> <a href="user-edit.php?user_id=<?php echo $ip['user_id']; ?> " title="<?php echo $current_user->user_login; ?> " target="_blank"> <?php echo $current_user->user_login; ?> </a> </strong> </td> <td class="column-name"> <p> <a href="http://whois.domaintools.com/<?php echo $pieces[0]; ?> " target="_blank"><?php echo $pieces[0]; ?> </a> </p> </td> <td class="column-name"> <?php if (function_exists('jdate')) { //Jalali Calendar specific styling. echo '<center><p style="direction:ltr;text-align:center">' . ($post_date = jdate(TimeDateFormat, $pieces[1]) . '</p></center>'); } else { echo '<center><p>' . ($post_date = date(TimeDateFormat, $pieces[1]) . '</p></center>'); } ?> </td> </tr> <?php //Flush sorting variables. $selected_ip = ''; $selected_user_id = ''; } } ?> </tbody> <tfoot> <tr> <th id="cb" scope="col" class="manage-column column-cb check-column"> <input type="checkbox" name="checkAll" value=""/> </th> <th scope="col" class="manage-column column-name"><?php echo __('User Name', 'wp-record-ip'); ?> </th> <th scope="col" class="manage-column column-name"><?php echo __('IP', 'wp-record-ip'); ?> </th> <th scope="col" class="manage-column column-name" style="text-align:center"><?php echo __('Record Date and Time', 'wp-record-ip'); ?> </th> </tr> </tfoot> </table> <div class="tablenav"> <div class="alignleft actions"> <select name="action2"> <option selected="selected" value="-1"><?php echo __('Bulk Actions', 'wp-record-ip'); ?> </option> <option value="delete"><?php echo __('Delete', 'wp-record-ip'); ?> </option> </select> <script type="text/javascript"> function warning(){ action = window.confirm("<?php echo __('Are you sure?', 'wp-record-ip'); ?> "); if (action){ document.link_form.submit(); }else{ return false; } } </script> <input type="submit" class="button-secondary action" id="doaction2" name="doaction2" value="<?php echo __('Apply', 'wp-record-ip'); ?> " onclick="return warning();"/> <br class="clear"/> </div> <br class="clear"/> </div> <br /> <table class="widefat"> <tr class="alternate"> <td colspan="2" align="center"> <div <?php echo $myLDNavigationBarStyle; ?> > <?php if ($pageno == 1) { echo " " . __('First', 'wp-record-ip') . " " . __('Prev', 'wp-record-ip') . " "; } else { echo " <a href=\"admin.php?page=wp-record-ip&pge=1\">" . __('First', 'wp-record-ip') . "</a>"; $prevpage = $pageno - 1; echo " <a href=\"admin.php?page=wp-record-ip&pge=" . $prevpage . "\">« " . __('Prev', 'wp-record-ip') . "</a> "; } echo " ( " . __('Page', 'wp-record-ip') . " {$pageno} " . __('of', 'wp-record-ip') . " {$lastpage} ) "; if ($pageno == $lastpage) { echo " " . __('Next', 'wp-record-ip') . " " . __('Last', 'wp-record-ip') . " "; } else { $nextpage = $pageno + 1; echo " <a href=\"admin.php?page=wp-record-ip&pge=" . $nextpage . "\">" . __('Next', 'wp-record-ip') . " »</a> "; echo " <a href=\"admin.php?page=wp-record-ip&pge=" . $lastpage . "\">" . __('Last', 'wp-record-ip') . "</a> "; } ?> </div> </td> </tr> </table> </form> <br /> </div> <div class="clear"/></div> <?php }
$new_height = $thumb_width / $original_aspect; $new_width = $thumb_width; } else { $new_height = $thumb_height; $new_width = $thumb_height * $original_aspect; } $thumb = imagecreatetruecolor($new_width, $new_height); // Resize and crop imagecopyresampled($thumb, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height); imagejpeg($thumb, $filename, 80); //unlink($ajaxDir.$address_picture); $original_picture = $address_picture; $date = date("F d Y"); $time = date("G:i"); $jdate = jdate("j F Y"); $jtime = jdate("G:i"); $sql = "INSERT INTO `gallerybykk_" . $sitelang . "` (`id`, `album`, `picture`, `picture_cover`, `picture_thumb`, `picture_title`,\n\t\t\t\t\t\t`showto`, `date`, `time`, `jdate`, `jtime`, `state`)\n\t\t\t\t\t\tVALUES ('{$id}', '{$album}', '{$original_picture}', '{$thumb_cover}', '{$thumb_name}', '{$picture_title}',\n\t\t\t\t\t\t'{$showto}', '{$date}', '{$time}', '{$jdate}', '{$jtime}', '1');"; $result = mysql_query($sql, $db); if ($result == false) { echo mysql_error(); } else { $id++; $donePictures++; $thumbCovers = $thumbCovers . "|" . $thumb_cover; } } } } } /*$result = mysql_query($sql, $db); if($result == false )
function hamed_pdate1($str) { $out = enToPerNums(jdate('d / m / Y', strtotime($str))); $out .= "<br/>" . date('F d', strtotime($str)); return $out; }