<div id="notification-list" style="display:none"> <div class="notification-messages info"> <div class="message-wrapper"> <div class="heading"> <?php echo $db->fob("NAMA", "si_" . $t, "WHERE USER_ID = '" . $dt_notif->FROM_ID . "'"); ?> </div> <div class="description"> <?php echo $dt_notif->ISI; ?> </div> <div class="date pull-left"> <?php echo getElapsedTime($dt_notif->TGL); ?> </div> </div> <div class="clearfix"></div> </div> <div class="notification-messages danger"> <div class="iconholder"> <i class="icon-warning-sign"></i> </div> <div class="message-wrapper"> <div class="heading"> Server load limited </div> <div class="description"> Database server has reached its daily capicity
<?php $now = time(); sleep(1); $after_sleep = time(); echo getElapsedTime($now, $after_sleep); function getElapsedTime($from_timestamp, $to_timestamp) { $second = 1; $minute = 60; $hour = $minute * 60; $day = 24 * $hour; $week = $day * 7; $month = $day * 30; $year = $month * 12; $time_diff = $to_timestamp - $from_timestamp; $duration = ""; $years = (int) ($time_diff / $year); if ($years > 0) { $time_diff = $time_diff - $year * $years; $duration .= $years . ($years > 1 ? ' Years ' : ' Year '); } $months = (int) ($time_diff / $month); if ($months > 0) { $time_diff = $time_diff - $month * $months; $duration .= $months . ($months > 1 ? ' Months ' : ' Month '); } $weeks = (int) ($time_diff / $week); if ($weeks > 0) { $time_diff = $time_diff - $week * $weeks; $duration .= $weeks . ($weeks > 1 ? ' Weeks ' : ' Week ');
function fetch_event_payment_infos($zangunievent, $event_id) { $action = $_POST['action']; $intent = $_POST['intent']; $client = $_POST['client']; include 'dbcrud/eventpurchases.class.php'; $eventpurchases = new Eventpurchases($action, $client); $columns = array("eventid", "ispurchased"); $records = array($event_id, 1); $purchases_paid = $eventpurchases->query_from_eventpurchases($columns, $records); $count_paid = $eventpurchases->is_exists($columns, $records); $tbl_paid = '<h5 style="font-weight:bold;font-size:16px;color:#54007e;">Paid Purchases (<span class="">' . $count_paid . '</span>)</h5>'; if (count($purchases_paid) > 0) { $tbl_paid .= '<table class="responsive-table card striped"><thead> <tr><th></th> <th>Purchase ID</th> <th>Buyer Name </th> <th>Buyer Phone</th> <th>Buyer Email</th> <th>Purchase Time</th> </tr></thead>'; for ($i = 0; $i < count($purchases_paid); $i++) { $purchaseid = $purchases_paid[$i]['purchaseid']; $buyername = $purchases_paid[$i]['buyername']; $buyerphone = $purchases_paid[$i]['buyerphone']; $buyeremail = $purchases_paid[$i]['buyeremail']; $ispurchased = $purchases_paid[$i]['ispurchased']; $eventid = $purchases_paid[$i]['eventid']; $purchasedate = $purchases_paid[$i]['purchasedate']; $tbl_paid .= '<tr><td>' . ($i + 1) . '</td> <td>' . $purchaseid . '</td><td>' . $buyername . '</td> <td>' . $buyerphone . '</td> <td>' . $buyeremail . '</td> <td>' . getElapsedTime(strtotime($purchasedate), time()) . ' Ago</td> </tr>'; } $zangunievents = $zangunievent->query_from_zangunievent(array("eventid"), array($event_id)); $ticketprice = $zangunievents[0]['ticketprice']; $tbl_paid .= '<tr> <td>Total</td> <td></td> <td></td> <td></td><td></td> <td>Ksh. ' . $ticketprice * $count_paid . '</td> </tr>'; $tbl_paid .= '</table>'; } else { $tbl_paid .= 'No one has paid for this event'; } $columns = array("eventid", "ispurchased"); $records = array($event_id, 0); $purchases_not_paid = $eventpurchases->query_from_eventpurchases($columns, $records); $count_not_paid = $eventpurchases->is_exists($columns, $records); $tbl_not_paid = '<h5 style="font-weight:bold;font-size:16px;color:#54007e;">Not Paid Purchases (<span class="">' . $count_not_paid . '</span>)</h5>'; if (count($purchases_not_paid) > 0) { $tbl_not_paid .= '<table class="responsive-table card striped"><thead> <tr><th></th> <th>Purchase ID</th> <th>Buyer Name </th> <th>Buyer Phone</th> <th>Buyer Email</th> <th>Purchase Time</th> </tr></thead>'; for ($i = 0; $i < count($purchases_not_paid); $i++) { $purchaseid = $purchases_not_paid[$i]['purchaseid']; $buyername = $purchases_not_paid[$i]['buyername']; $buyerphone = $purchases_not_paid[$i]['buyerphone']; $buyeremail = $purchases_not_paid[$i]['buyeremail']; $ispurchased = $purchases_not_paid[$i]['ispurchased']; $eventid = $purchases_not_paid[$i]['eventid']; $purchasedate = $purchases_not_paid[$i]['purchasedate']; $tbl_not_paid .= '<tr><td>' . ($i + 1) . '</td> <td>' . $purchaseid . '</td><td>' . $buyername . '</td> <td>' . $buyerphone . '</td> <td>' . $buyeremail . '</td> <td>' . getElapsedTime(strtotime($purchasedate), time()) . ' Ago</td> </tr>'; } $zangunievents = $zangunievent->query_from_zangunievent(array("eventid"), array($event_id)); $ticketprice = $zangunievents[0]['ticketprice']; $tbl_not_paid .= '<tr> <td>Total</td> <td></td> <td></td> <td></td> <td></td> <td>Ksh. ' . $ticketprice * $count_not_paid . '</td> </tr>'; $tbl_not_paid .= '</table>'; } else { //Ensure that atleast someone has paid for this if (count($purchases_paid) > 0) { $tbl_not_paid .= 'No pending payments for the events'; } else { $tbl_not_paid .= 'Looks like no one has heard of this event'; } } if (count($purchases_paid) == 0 && count($purchases_not_paid) == 0) { echo $tbl_not_paid; } else { if (count($purchases_paid) > 0) { echo $tbl_paid; } if (count($purchases_not_paid) > 0) { echo $tbl_not_paid; } } }
//if(is_array($pair)) //foreach ($pair as $type=>$value) //{ // echo "$type is $value\n"; //}else echo "$key is $pair"; } //echo "guna get $docinfo[id]"; //displayObject($docinfo['id'],$search); $ids[] = $docinfo['id']; } displayObjects($ids, $search); } } echo "Result is \n" + implode("\n", $result); //print_r( $result ); $time = getElapsedTime($time_start); if ($numResults > $numViewed) { print "Showing Page " . $page . " of " . $numResults . " results in {$time} seconds<p>"; } else { print "Showing " . $numResults . " results in {$time} seconds<p>"; } } if ($type == "parcel") { //im not really focusing on parcels right now, ill update it later $query = "Select Name,Description,match(Name,Description) against('" . $search . "') " . "as Score from Parcel where match(Name,Description) against('" . $search . "')"; $result = mysql_query($query); $numResults = mysql_num_rows($result); mysql_free_result($result); $query = "Select Name,Description,match(Name,Description) against('" . $search . "') " . "as Score from Parcel where match(Name,Description) against('" . $search . "') " . " LIMIT " . $start . ", 10"; $result = mysql_query($query) or die(mysql_error()); $time_end = microtime_float();
<link rel="stylesheet" type="text/css" href="style.css" /> </head> <body> <?php if (isset($_GET["objectID"])) { //$id=htmlspecialchars($_GET["objectID"]); //rawurldecode($_GET["objectID"]); $id = mysql_real_escape_string(urldecode($_GET["objectID"])); } echo "ID is {$id}<p>"; $query = "Select * from Object where LocalID LIKE '{$id}'"; $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_assoc($result); echo "Name is {$row['Name']}<p>"; echo '<table>'; foreach ($row as $key => $value) { echo "<tr><td>{$key}</td><td>{$value}</td></tr>"; } echo '</table>'; echo 'Page Completed in ' . getElapsedTime($time_start) . ' seconds.'; ?> </body> </html>