Пример #1
0
 function getFrequency($item)
 {
     $now = time('now');
     $last_update = $item['updated'];
     // a precaution due to server timezone differences
     if ($last_update >= $now) {
         $now = $last_update;
     }
     $diff = get_time_difference($last_update, $now);
     if ($diff['days'] > 365) {
         $frequency = 'yearly';
     } elseif ($diff['days'] > 30) {
         $frequency = 'monthly';
     } elseif ($diff['days'] > 7) {
         $frequency = 'weekly';
     } elseif ($diff['days'] > 0) {
         $frequency = 'daily';
     } elseif ($diff['days'] == 0 && $diff['hours'] != 0) {
         $frequency = 'hourly';
     } elseif ($diff['days'] == 0 && $diff['hours'] == 0) {
         $frequency = 'always';
     } else {
         $frequency = 'never';
     }
     return $frequency;
 }
Пример #2
0
    $menu[$i]['menuId'] = MYSQL_RESULT($result4menu, $i, "menuId");
    $menu[$i]['orderTime'] = MYSQL_RESULT($result4menu, $i, "orderTime");
    $i++;
}
// Obtain a list of columns
foreach ($menuAvail as $key => $row) {
    $link[$key] = $row['link'];
    $delTime[$key] = $row['deliveryTime'];
}
// Add $data as the last parameter, to sort by the common key
array_multisort($link, SORT_ASC, $delTime, SORT_ASC, $menuAvail);
$link = 0;
$i = 0;
while ($i < $numberOfRows4avail) {
    if ($i == 0 || $menuAvail[$i]['link'] != $menuAvail[$i - 1]['link']) {
        $link = $menuAvail[$i]['link'];
        $dTime = $menuAvail[$i]['deliveryTime'];
        $j = 0;
        while ($j < $numberOfRows4menu) {
            if ($menuAvail[$i]['menuId'] == $menu[$j]['menuId']) {
                $oTime = $menu[$j]['orderTime'];
                $timeDiff = get_time_difference($dTime, $oTime);
                $query = "insert into order_time (link,time) values ({$link},'{$timeDiff}')";
                $result = mysql_query($query);
                echo $link . "    " . $timeDiff . "  inserted <br>";
            }
            $j++;
        }
    }
    $i++;
}
Пример #3
0
 $jnow = JFactory::getDate();
 $current_date_string = $jnow->toSQL();
 $current_date_int = strtotime($current_date_string);
 $sql = "select pp.price, pp.default, s.name from #__guru_program_renewals pp, #__guru_subplan s where s.id = pp.plan_id and pp.product_id=" . intval($course_id) . " order by s.ordering asc";
 $db->setQuery($sql);
 $db->query();
 $plans = $db->loadAssocList();
 if (count($plans) == 0) {
     // no plans for renew
     $plans = $this->plans;
     // from buy plans
 }
 ?>
     
                 <?php 
 $difference_int = get_time_difference($current_date_int, $expired_date_int);
 if ($difference_int) {
     //not expired
     ?>
                 <form action="index.php?option=com_guru&view=guruEditplans&task=renew" name="adminForm" method="post" style="padding:10px;">
                     <div id="g_prices_modal_text"  class="g_prices_modal_text">
                         <b>
                         <?php 
     echo $config["0"]["content_selling"];
     ?>
                         </b>
                     </div>
                     
                     
                 <table id="g_prices_modal" class="uk-table">
                     <?php 
Пример #4
0
                                    <td colspan="6" align="center"><b><i>No office hours for this semester</i></b></td>
                                </tr>
    <?php 
} else {
    $sql = "select * from facultyhours where uid=" . $_SESSION["userid"] . " and semid=" . $_SESSION["ddlsem7"] . " and type='office'";
    $data = ExecuteNonQuery($sql);
    $hrtemp = 0;
    $mintemp = 0;
    $cday = array();
    while ($info = mysqli_fetch_assoc($data)) {
        $cday = explode(" ", $info["cday"]);
        for ($i = 0; $i < count($cday); $i++) {
            $time1 = date("H:i", strtotime($info["starttime"]));
            $time2 = date("H:i", strtotime($info["endtime"]));
            //							echo $time1." ".$time2;
            $t = get_time_difference($time1, $time2);
            //	echo date("h:i A", strtotime($t));
            //echo (timeDiff($time1,$time2)/60)/60;
            /* list($hours, $minutes) = explode(':', $time1);
                          $startTimestamp = mktime($hours, $minutes);
            
                          list($hours, $minutes) = explode(':', $time2);
                          $endTimestamp = mktime($hours, $minutes);
            
                          $seconds = $endTimestamp - $startTimestamp;
                          $minutes = ($seconds / 60) % 60;
                          $hours = floor($seconds / (60 * 60));
            
                          $hrtemp=$hrtemp+$hours;
                          $mintemp=$mintemp+$minutes; */
        }
Пример #5
0
  <th>Transaction ID</th>
  <th>Age</th>
  <th>Amount Sent</th>
</tr>';
foreach ($txs as $key => $value) {
    if ($count > 9) {
        break;
    }
    $tx[$key] = $_SESSION[$rpc_client]->getrawtransaction($value, 1);
    if (!$show_cbtxs && $tx[$key]['vin'][0]['coinbase'] === true) {
        continue;
    }
    $total = '';
    foreach ($tx[$key]['vout'] as $k => $value) {
        if (!isset($tx[$k]['limit'])) {
            $total = bcadd($total, remove_ep($value['value']));
        }
    }
    $tx_time = date("Y-m-d h:i:s A e", $tx[$key]['time']);
    $tx_age = get_time_difference($tx_time, date("Y-m-d h:i:s A e"));
    $count++;
    if ($tx_age['seconds'] < 1) {
        $tx_age = '< 1 second';
    } elseif ($tx_age['minutes'] < 1) {
        $tx_age = $tx_age['seconds'] . ' seconds';
    } else {
        $tx_age = $tx_age['minutes'] . ' minutes';
    }
    echo "<tr><td><a href='./?tx=" . $tx[$key]['txid'] . "'>" . $tx[$key]['txid'] . "</a></td><td>" . $tx_age . "</td><td>" . $total . ' ' . $curr_code . "</td></tr>";
}
echo '</table>';
Пример #6
0
function blogsfera_widget_tag_results()
{
    $title = __('Resultados de la tag');
    ?>
	
	<li id="search-results" class="clearfix">
		<h2><?php 
    echo $title;
    ?>
</h2>
		<p class="query">Estos son los resultados con el tag "<?php 
    current_tag();
    ?>
":</p>
		<ul>
		<?php 
    if ($result = tag_results()) {
        global $post;
        $result = array_slice($result, 0, 12);
        $list = "";
        $last = count($result) - 1;
        $i = 0;
        foreach ($result as $post) {
            $list .= "<li";
            if ($i == $last) {
                $list .= " class='last clearfix'";
            }
            $list .= "><a class='avatar' href='{$post->guid}'><img src='" . author_image_path($post->post_author, $display = false) . "' alt='avatar' width='48px' height='48px'/></a><h3><a href='{$post->guid}'>{$post->post_title}</a></h3><p>hace " . get_time_difference($post->post_date_gmt, $display = true) . "</p></li>";
            $i++;
        }
        echo $list;
    } else {
        ?>
		    <li>Not Found</li>
		 <?php 
    }
    ?>
		</ul>
	</li>
	<?php 
}
Пример #7
0
function getOrderDatails($num)
{
    include 'db.php';
    mysqli_set_charset($connection, "utf-8");
    $query1 = "\tSELECT * FROM `tbl_users_216` WHERE `orderNumber`=";
    $query1 .= $num;
    $result = mysqli_query($connection, $query1);
    if (!$result) {
        echo "לא ניתן להביא את הנתונים מהשרת";
        die("DB query failed.");
    }
    $row = mysqli_fetch_assoc($result);
    mysqli_free_result($result);
    mysqli_close($connection);
    $fieldNumber = 1;
    foreach ($row as $field) {
        switch ($fieldNumber) {
            case 1:
                $orderTime = $field;
                break;
            case 2:
                $orderNumber = $field;
                break;
            case 4:
                $clientName = $field;
                break;
            case 9:
                $orderDate = $field;
                break;
            case 10:
                $waitingRange = $field;
                break;
            case 11:
                $dispacherName = $field;
                break;
            case 12:
                $doctor = $field;
                break;
            default:
                break;
        }
        $fieldNumber++;
    }
    $order_str = '<p>';
    $order_str .= $orderNumber . '</p>';
    $order_str .= '<p>' . $orderDate . '</p>';
    $order_str .= '<p>' . $orderTime . '</p>';
    $order_str .= '<p>' . $waitingRange . '</p>';
    $now = new DateTime("now", new DateTimeZone('Asia/Jerusalem'));
    $diff = @get_time_difference($orderTime, $now->format('H:i'));
    //$order_str.= '<p>'.$now->format('H:i').'</p>';
    $order_str .= '<p>' . sprintf('%d:%02d', $diff['hours'], $diff['minutes']) . ' </p>';
    $order_str .= '?';
    $order_str .= '<p>' . $dispacherName . '</p>';
    $order_str .= '<p>' . $clientName . '</p>';
    $order_str .= '<p>' . $doctor . '</p>';
    if ($doctor == "") {
        $order_str .= '<a href="#" id="adaptDoctor">שליחת ביקור לרופא</a>';
        $order_str .= '<script>$("#adaptDoctor").click(function() { onDoctorInfoClick(); });</script>';
    } else {
        $order_str .= '<a href="#" id="closeOrder">סגירת ביקור</a>';
        $order_str .= '<script>$("#closeOrder").click(function() { onCloseOrderClick(); });</script>';
    }
    $order_str .= "<p id='loading'></p>";
    return $order_str;
}
Пример #8
0
function tab4($exercise, $config)
{
    ?>
<div class="course_view_exercises span12">
    <ul>
<?php 
    $db = JFactory::getDBO();
    $course_id = intval(JRequest::getVar("cid", 0));
    $my = JFactory::getUser();
    foreach ($exercise as $element) {
        ?>
    <li class="g_row">
        <div class="g_cell span12">
    <script type="text/javascript">
            <?php 
        if ($my->id > 0 && $element->access != 2) {
            $sql = "select count(*) from #__guru_buy_courses where `userid`=" . intval($my->id) . " and `course_id`=" . intval($course_id);
            $db->setQuery($sql);
            $db->query();
            $result = $db->loadResult();
            if ($result > 0) {
                $expired = false;
                $sql = "select expired_date from #__guru_buy_courses where userid=" . intval($my->id) . " and course_id=" . intval($course_id);
                $db->setQuery($sql);
                $db->query();
                $expired_date_string = $db->loadResult();
                $current_date_string = "";
                $sql = "select bc.id from #__guru_buy_courses bc, #__guru_order o where bc.userid=" . intval($my->id) . " and bc.course_id=" . intval($course_id) . " and (bc.expired_date >= '" . $current_date_string . "' or bc.expired_date = '0000-00-00 00:00:00') and bc.order_id = o.id and o.status <> 'Pending'";
                $db->setQuery($sql);
                $db->query();
                $result = $db->loadResult();
                if ($expired_date_string != "0000-00-00 00:00:00" || (!isset($result) || intval($result) == 0)) {
                    $expired_date_int = strtotime($expired_date_string);
                    $jnow = JFactory::getDate();
                    $current_date_string = $jnow->toSQL();
                    $current_date_int = strtotime($current_date_string);
                    if ($current_date_int < $expired_date_int) {
                        $expired = false;
                    }
                    $sql = "select bc.course_id from #__guru_buy_courses bc, #__guru_order o where o.id=bc.order_id and bc.userid=" . intval($my->id) . " and o.status='Paid'";
                    $db->setQuery($sql);
                    $db->query();
                    $my_courses = $db->loadColumn();
                    if (in_array($course_id, $my_courses)) {
                        // I bought this course
                        $difference_int = get_time_difference($current_date_int, $expired_date_int);
                        $difference = $difference_int["days"];
                        if ($difference_int["days"] == 0) {
                            if ($difference_int["hours"] == 0) {
                                if ($difference_int["minutes"] == 0) {
                                    $difference = "0";
                                } else {
                                    $difference = $difference_int["minutes"];
                                }
                            } else {
                                $difference = $difference_int["hours"];
                            }
                        }
                        if ($expired_date_string == "0000-00-00 00:00:00") {
                            //unlimited
                            $difference_int = "1";
                            //default for unlimited
                        }
                        if ($difference_int !== FALSE) {
                            // is not expired
                            $expired = true;
                        } else {
                            $expired = false;
                        }
                    } else {
                        $sql = "select count(*) from #__guru_buy_courses where `userid`=" . intval($my->id) . " and `course_id`=" . intval($course_id) . " and order_id=0";
                        $db->setQuery($sql);
                        $db->query();
                        $result = $db->loadResult();
                        if ($result > 0) {
                            $expired = true;
                        }
                    }
                }
            } else {
                $expired = false;
                @($expired_date_int = -1);
            }
        }
        $access_exerc = 1;
        if ($expired_date_string == '0000-00-00 00:00:00') {
            $access_exerc = 1;
        } elseif ($expired_date_int == -1) {
            $access_exerc = 0;
        } else {
            $expired_date_int = strtotime($expired_date_string);
            $jnow = JFactory::getDate();
            $current_date_string = $jnow->toSQL();
            $current_date_int = strtotime($current_date_string);
            if ($current_date_int > $expired_date_int) {
                $access_exerc = 0;
            } else {
                $access_exerc = 1;
            }
            if ($expired_date_int == 0) {
                $access_exerc = 1;
            }
        }
        ?>
            <?php 
        if ($element->access == 2 || $element->access < 2 && $my->id > 0 && $access_exerc == 1) {
            if ($element->type == "docs" && trim($element->local) != "") {
                ?>
                document.write('<a target="_blank" href="<?php 
                echo JURI::root() . $config->docsin . '/' . $element->local;
                ?>
"><img src="components/com_guru/images/<?php 
                echo $element->type;
                ?>
.gif" alt="<?php 
                echo $element->type;
                ?>
" align="absmiddle" />&nbsp;<?php 
                echo $element->local;
                ?>
</a>');
                    <?php 
            } elseif ($element->type == "docs" && trim($element->url) != "") {
                ?>
                	document.write('<a target="_blank" href="<?php 
                echo JURI::root() . $element->url;
                ?>
"><img src="components/com_guru/images/<?php 
                echo $element->type;
                ?>
.gif" alt="<?php 
                echo $element->type;
                ?>
" align="absmiddle" />&nbsp;<?php 
                echo $element->name;
                ?>
</a>');
                    <?php 
            } elseif ($element->type == "file" && trim($element->local) != "") {
                ?>
                document.write('<a target="_blank" href="<?php 
                echo JURI::root() . $config->filesin . '/' . $element->local;
                ?>
"><img src="components/com_guru/images/<?php 
                echo $element->type;
                ?>
.gif" alt="<?php 
                echo $element->type;
                ?>
" align="absmiddle" />&nbsp;<?php 
                echo $element->local;
                ?>
</a>');
                    <?php 
            }
        } else {
            if (trim($element->local) != "") {
                ?>
                document.write('<a href="<?php 
                echo JURI::root() . "index.php?option=com_guru&view=guruEditplans&course_id=" . $course_id . "-" . $alias . "&tmpl=component" . $action;
                ?>
" onclick="openMyModal(\'\',\'\',\'<?php 
                echo JURI::root();
                ?>
index.php?option=com_guru&view=guruEditplans&course_id=<?php 
                echo $course_id;
                ?>
-<?php 
                echo $alias;
                ?>
&tmpl=component<?php 
                echo $action;
                ?>
\'); return false;" ><img src="components/com_guru/images/<?php 
                echo $element->type;
                ?>
.gif" alt="<?php 
                echo $element->type;
                ?>
" align="absmiddle" />&nbsp;<?php 
                echo $element->local;
                ?>
</a>');
                    <?php 
            }
        }
        ?>
            
    </script>
        </div>
        </li>
        <?php 
    }
    ?>
    </ul>
</div>
<?php 
}
Пример #9
0
<?php

$balance = $_SESSION[$rpc_client]->listbalances(1, array($cb_address));
$mining_info = $_SESSION[$rpc_client]->getmininginfo();
$tx_stats = $_SESSION[$rpc_client]->gettxoutsetinfo();
$now_time = date("Y-m-d H:i:s e");
$start_time = date("Y-m-d H:i:s e", $launch_time);
$time_diff = get_time_difference($start_time, $now_time);
$coin_supply = remove_ep($tx_stats['total_amount']);
$cb_balance = remove_ep($balance[0]['balance']);
$frac_reman = bcdiv($cb_balance, $total_coin);
$block_rwrd = bcmul($first_reward, $frac_reman);
$l_dat = explode(':', file_get_contents("./db/last_dat"));
$s_dat = explode(':', file_get_contents("./db/stat_dat"));
?>

<h1>Statistics</h1><br />

<table class="table table-striped">
<tr><td>
  <b>Coin supply:</b></td><td>
  <?php 
echo float_format($coin_supply, 6) . " {$curr_code}";
?>
</td></tr><tr><td>
  <b>Unmined coins:</b></td><td>
  <?php 
echo float_format($cb_balance, 4) . ' ' . $curr_code;
?>
</td></tr><tr><td>
  <b>Block Reward:</b></td><td>
Пример #10
0
function write_table()
{
    $shifts = get_shifts();
    // Laufvariablenarray fuer die Rowspan-Berechnung
    $rowspan_counter = array(0, 0, 0, 0, 0);
    $table = '<table id="shifttable" border="0" cellspacing="0px" >' . "\n";
    $table .= '<tr class="shiftrow days">' . "\n";
    $table .= "<td class=\"shiftcell day\"></td>\n";
    $table .= "<td class=\"shiftcell day\">Montag</td>\n";
    $table .= "<td class=\"shiftcell day\">Dienstag</td>\n";
    $table .= "<td class=\"shiftcell day\">Mittwoch</td>\n";
    $table .= "<td class=\"shiftcell day\">Donnerstag</td>\n";
    $table .= "<td class=\"shiftcell day\">Freitag</td>\n";
    $table .= "</tr>\n";
    for ($h = 8; $h < 22; $h++) {
        for ($m = 0; $m < 60; $m += 15) {
            $table .= '<tr class="shiftrow h' . $h . ' m' . $m . '">' . "\n";
            $table .= '<td class="shiftcell time">';
            $table .= sprintf('%02u:%02u', $h, $m) . "</td>\n";
            for ($d = 0; $d < 5; $d++) {
                $matches = 0;
                foreach ($shifts as $shift) {
                    if ($shift->is_now(sprintf('%u,%02u:%02u', $d, $h, $m))) {
                        $matches++;
                        $match = $shift;
                    }
                }
                if ($matches == 0) {
                    $table .= '<td class="shiftcell closed d' . $d . '" >&nbsp;</td>' . "\n";
                } else {
                    if ($rowspan_counter[$d] <= 1) {
                        $diff = get_time_difference($match->start, $match->end);
                        $rows = $diff['hours'] * 4 + $diff['minutes'] / 15;
                        $rowspan_counter[$d] = $rows;
                        $table .= sprintf('<td title="%s" rowspan="%s" ' . 'class="shift%s shiftcell open d%u">%s</td>' . "\n", $match->user->name, $rows, $match->sid, $d, $match->user->name);
                    } else {
                        $rowspan_counter[$d]--;
                    }
                }
                if ($matches > 1) {
                    error(sprintf('mehr als ein match: d:%s h:%s m:%s', $d, $h, $m));
                }
            }
            $table .= "</tr>\n";
        }
    }
    $table .= "</table>\n";
    print $table;
}
Пример #11
0
><?php 
            echo $menuAvail[$f]['deliveryPoint'];
            ?>
</td>
						<?php 
            if ($f == 0 || $menuAvail[$f]['link'] != $menuAvail[$f - 1]['link']) {
                $j = 0;
                while ($j < $numberOfRows4qty) {
                    if ($menuAvail[$f]['link'] == $menuQty[$j]['link']) {
                        break;
                    }
                    $j++;
                }
                ?>
						<td align="center" style="border-top-color:#999999; border-top-style:dotted; border-top-width:thin;"><?php 
                echo get_time_difference($menuAvail[$f]['deliveryTime'], $menu[$i]['orderTime']);
                ?>
</td>
						<td align="center" style="border-top-color:#999999; border-top-style:dotted; border-top-width:thin;"><?php 
                echo $menuQty[$j]['qty'];
                ?>
</td>
						<?php 
            }
            ?>
					  </tr>
					  <?php 
        }
        $f++;
    }
    ?>
Пример #12
0
function find_turnaround_time($sample_id, $id)
{
    $link = start_nchsls();
    $sql_tt = 'select sample_receipt_time from sample where sample_id=\'' . $sample_id . '\'';
    $sql = 'select id,name_of_examination,details,result,unit,referance_range from examination where sample_id=\'' . $sample_id . '\' and id=\'' . $id . '\'';
    //echo $sql_tt;
    $result_tt = mysql_query($sql_tt, $link);
    $sample_r_t = mysql_fetch_assoc($result_tt);
    $sample_receipt_time = $sample_r_t['sample_receipt_time'];
    if (mysql_num_rows($result = mysql_query($sql, $link)) > 0) {
        while ($ar = mysql_fetch_assoc($result)) {
            if ($ar['id'] < 1000) {
                $ex = explode('|', $ar['details']);
                $tt = get_time_difference($sample_receipt_time, $ex[0]);
                //print_r($tt);
                if ($tt != FALSE) {
                    return $tt_in_hours = ceil($tt['days'] * 24 + $tt['hours'] + $tt['minutes'] / 60);
                } else {
                    return FALSE;
                }
            }
        }
    }
}
Пример #13
0
    $menuQty[$i]['link'] = MYSQL_RESULT($result4qty, $i, "link");
    $menuQty[$i]['qty'] = MYSQL_RESULT($result4qty, $i, "qty");
    $i++;
}
$i = 0;
while ($i < $numberOfRows4time) {
    $menuTime[$i]['link'] = MYSQL_RESULT($result4time, $i, "link");
    $menuTime[$i]['time'] = MYSQL_RESULT($result4time, $i, "time");
    $i++;
}
$i = 0;
while ($i < $numberOfRows4avail) {
    $menuAvail[$i]['menuId'] = MYSQL_RESULT($result4avail, $i, "menuId");
    $menuAvail[$i]['deliveryTime'] = MYSQL_RESULT($result4avail, $i, "time");
    $menuAvail[$i]['deliveryTime1'] = $menuAvail[$i]['deliveryTime'];
    $menuAvail[$i]['deliveryTime'] = get_time_difference($menuAvail[$i]['deliveryTime'], "00:00:00");
    $menuAvail[$i]['link'] = MYSQL_RESULT($result4avail, $i, "link");
    $menuAvail[$i]['deliveryPoint'] = MYSQL_RESULT($result4avail, $i, "deliveryPoint");
    $i++;
}
$i = 0;
while ($i < $numberOfRows4menu) {
    $menu[$i]['menuId'] = MYSQL_RESULT($result4menu, $i, "menuId");
    $menu[$i]['item'] = MYSQL_RESULT($result4menu, $i, "item");
    $menu[$i]['price'] = MYSQL_RESULT($result4menu, $i, "price");
    $i++;
}
if (!$verified) {
    $alert = 1;
    ?>
					<script type="text/javascript" language="javascript"> 
Пример #14
0




// example 1
$time1 = "08:00:00";
$time2 = "13:40:00";

echo "Time difference: ".get_time_difference($time1, $time2)." hours<br/>";

// example 2
$time1 = "22:00:00";
$time2 = "04:00:00";

echo "Time difference: ".get_time_difference($time1, $time2)." hours<br/>";

function get_time_difference($time1, $time2)
{
    $time1 = strtotime("1/1/1980 $time1");
    $time2 = strtotime("1/1/1980 $time2");
    
    if ($time2 < $time1)
    {
        $time2 = $time2 + 86400;
    }
    
    return ($time2 - $time1) / 3600;
    
}  
?>
Пример #15
0
            $date_last_visit = date("" . $format_date . "", strtotime($date_last_visit));
        } else {
            $date_last_visit = "";
        }
        $count_quizz_taken = $guruModelguruOrder->countQuizzTakenF($user_id, $id);
        ?>
                            <td class="g_cell_3 hidden-phone"><?php 
        echo $date_last_visit;
        ?>
</td>
                            <td class="g_cell_5">
                                <?php 
        if ($bool_expired == 0) {
            // not expired
            $date_int = strtotime($course->expired_date);
            $difference_int = get_time_difference($int_current_date, $date_int);
            $difference = $difference_int["days"] . " " . JText::_("GURU_REAL_DAYS");
            if ($difference_int["days"] == 0) {
                if ($difference_int["hours"] == 0) {
                    if ($difference_int["minutes"] == 0) {
                        $difference = "0";
                    } else {
                        $difference = $difference_int["minutes"] . " " . JText::_("GURU_REAL_MINUTES");
                    }
                } else {
                    $difference = $difference_int["hours"] . " " . JText::_("GURU_REAL_HOURS");
                }
            }
            $comfirm_text = JText::_("GURU_STILL_HAVE") . " " . $difference . " " . JText::_("GURU_AVAILABLE_COURSE") . " " . JText::_("GURU_YES") . " " . JText::_("GURU_ADD_TIME") . " " . JText::_("GURU_CANCEL") . " " . JText::_("GURU_GO_TO_COURSE_PAGE");
            if (!$no_renew) {
                ?>
Пример #16
0
require 'randomPost.php';
// $a = new BirthdayPost();
//print_r($a);
//echo "\n\n";
// echo $a->body;
$url = "http://shackchatty.com/search.xml?author=Steve+Gibson";
$dom = file_get_dom($url);
$postFirst = $dom->find("comment[author]", 0);
$str = $postFirst->date;
if (($timestamp = strtotime($str)) === false) {
    echo "The string ({$str}) is bogus";
} else {
    echo "{$str} == " . date('l dS \\o\\f F Y h:i:s A', $timestamp);
}
$end = date('Y-m-d');
if ($diff = @get_time_difference($str, $end)) {
    echo sprintf('days : %02d', $diff['days']);
} else {
    echo "Hours: Error";
}
// print $postFirst->date;
//
print "\n";
function get_time_difference($start, $end)
{
    $uts['start'] = strtotime($start);
    $uts['end'] = strtotime($end);
    if ($uts['start'] !== -1 && $uts['end'] !== -1) {
        if ($uts['end'] >= $uts['start']) {
            $diff = $uts['end'] - $uts['start'];
            if ($days = intval(floor($diff / 86400))) {