예제 #1
0
    $temp = 60 * ($temp - $hours);
    $minutes = floor($temp);
    $temp = 60 * ($temp - $minutes);
    if ($days == '1' && $hours == '0') {
        return 'Yesterday at ' . date('H A', strtotime($startdate));
    } elseif ($days >= '1') {
        return date('F', strtotime($startdate)) . ' ' . date('d', strtotime($startdate));
    } elseif ($hours > '1' && $hours < '24') {
        return $hours . ' hours ago';
    } elseif ($hours == '1') {
        return 'About an hour ago';
    } else {
        return $minutes . ' minutes ago';
    }
}
$noti = $db->getRecord(NOTI, '', " `by` = 'associate' AND `status` = 'unread' order by id DESC  limit 5");
$users = $db->getRecord(USERS);
?>
<ul class="notitab">
	<li class="current"><a href="#messages">Activities</a></li>
</ul>

<div id="messages">
    <ul class="msglist">
<?php 
if ($noti) {
    foreach ($noti as $key => $value) {
        $usrId = search_array($value['userId'], 'userId', $users);
        $us = $users[$usrId][companyName];
        if ($value['type'] == 'service') {
            $cnt = count(explode(',', $value['remark']));
예제 #2
0
        if ($_POST['tbl'] == USERS) {
            $id = 'userId';
        }
        if ($db->update($_POST['tbl'], array('status' => $cnd), " `" . $id . "` = '{$_POST['id']}' ")) {
            if ($_POST['tbl'] == ADDRESS) {
                adminNoti('address', $_POST['id'], $_POST['userId'], "your address status changed to {$cnd}");
            }
            $_SESSION['succ'] = 'Status Changed successfully';
            echo "<script>window.location='{$_SERVER['HTTP_REFERER']}'</script>";
            die;
        }
    }
}
if ($act == 'approve') {
    //print_r($_POST);die;
    $noti = $db->getRecord(NOTI, '', "id = '" . $_POST['notiId'] . "' ");
    $rdata = json_decode(stripslashes($noti[0]['data']), TRUE);
    if ($noti[0]['record'] == 'new') {
        $data = array('status' => $_POST['cnd'] == 'approved' ? 'active' : $_POST['cnd']);
    } else {
        if (ADDRESS == $_POST['tbl'] && $_POST['type'] == 'service') {
            $address = $db->getRecord(ADDRESS, '', "id = '" . $noti[0]['typeId'] . "' ");
            if ($_POST['cnd'] == 'approved') {
                $array = trim(implode(',', array_unique(array_merge(explode(',', $address[0]['service']), $_POST['service']))), ',');
                $data = array('service' => $array);
            }
        } else {
            if (ADDRESS == $_POST['tbl']) {
                $data = array('name' => $rdata['name'], 'email' => $rdata['email'], 'pincode' => $rdata['pincode'], 'landlineNo' => $rdata['landlineNo'], 'mobileNo' => $rdata['mobileNo'], 'faxNo' => $rdata['faxNo'], 'address' => $rdata['address'], 'landmark' => $rdata['landmark'], 'city' => $rdata['city'], 'state' => $rdata['state'], 'country' => $rdata['country']);
            } else {
                if (HOTEL == $_POST['tbl']) {