function indexAction()
 {
     if (POST) {
         set_time_limit(999999);
         $emails = $users = array();
         $emailRaw = $this->user->ImportContacts($_POST['of'], $_POST["n"], $_POST["p"]);
         foreach ($emailRaw["out"] as $k => $v) {
             if ($this->user->CheckEmail($v[0])) {
                 $usr = $this->user->GetDetailsByEmail($v[0]);
                 $usrNam = strlen($usr["fname"] . $usr["lname"]) < 10 ? $usr["fname"] . " " . $usr["lname"] : (strlen($usr["fname"]) < 10 ? $usr["fname"] : substr($usr["fname"], 0, 10) . '..');
                 $users[] = array(encode($usr["id"]), $usr["image"], $usrNam, ($usr["gender"] == "M" ? "Male" : "Female") . ", " . timeDiff(strtotime($usr["birthDay"]), array('parts' => 1, 'precision' => 'year', 'separator' => '', 'next' => '')));
             } else {
                 $eM = array("n" => $k, "i" => encode($v[1]));
                 if (strpos($v[0], "@")) {
                     $eM = array_merge($eM, array("e" => $v[0]));
                 }
                 if ($v[2] > 0) {
                     $eM = array_merge($eM, array("m" => $v[2]));
                 }
                 $emails[] = $eM;
             }
         }
         die(json_encode(array("emails" => $emails, "users" => $users, "m" => count($emails) > 0 ? "You got " . count($emails) . " contacts from your " . $_POST["of"] . " id." : "<strong>No contacts found.</strong><br />May be your login are invalid.", "mT" => count($emails) > 0 ? "yeppe" : "")));
     }
     $this->view->outContacts = $this->user->outContacts();
     $this->view->inContacts = $this->user->inContacts();
 }
    function energizingAction()
    {
        $user = new UsersModel();
        $this->session->from = $this->session->from > 0 ? $this->session->from + 1 : 30;
        $users = $user->Search(array(), array($this->session->from, 1), NULL, array("gender DESC"));
        ?>
        <?php 
        $i = 0;
        foreach ($users as $r) {
            ?>
            <a href="<?php 
            echo WWW_ROOT;
            ?>
user/<?php 
            echo encode($r["id"]);
            ?>
"><img src="<?php 
            echo IMAGES;
            ?>
user/icon/<?php 
            echo $r["image"];
            ?>
" /><span><?php 
            echo strlen($r["username"]) < 10 ? $r["username"] : substr($r["username"], 0, 10) . '..';
            ?>
<br /><em><?php 
            echo str_replace(" years", ", ", timeDiff(strtotime($r["birthDay"]), array('parts' => 1, 'precision' => 'year', 'separator' => '', 'next' => ''))) . ($r["gender"] == 'M' ? 'Male' : 'Female') . ($r["city"] ? "<br />" . $r["city"] : "");
            ?>
</em></span></a>
        <?php 
        }
        die;
    }
Exemple #3
0
function email_login($email, $password)
{
    $CI =& get_instance();
    $user = new User();
    $user->where(array('email' => $email, 'password' => $password))->get();
    if ($user->exists()) {
        if ($user->profile->type == "ประชาชนทั่วไป") {
            $timediff = timeDiff($user->last_login, date("Y-m-d H:i:s", now()));
            $webboard_status_config = new Webboard_status_config(1);
            if ($timediff > $webboard_status_config->memlock) {
                $user->m_status = "ban";
                $user->last_login = $user->last_login;
            } else {
                $user->m_status = "active";
                $user->last_login = date("Y-m-d H:i:s", now());
            }
        }
        $user->save();
        if ($user->m_status == "ban") {
            return FALSE;
        }
        $_SESSION['id'] = $user->id;
        // $CI->session->set_userdata('id',$user->id);
        $_SESSION['level'] = $user->level_id;
        // $CI->session->set_userdata('level',$user->level_id);
        //$log = fopen("log.txt", "a");
        //fwrite($log, ' '.$user->last_login.' - '.$user->email.' เข้าสู่ระบบ'.'\r\n');
        //fclose($log);
        file_put_contents('log.txt', $user->last_login . ' - ' . $user->email . ' เข้าสู่ระบบ' . "\n", FILE_APPEND);
        return TRUE;
    } else {
        return FALSE;
    }
}
Exemple #4
0
function dateAddTime($date, $time)
{
    $start = explode(" ", $date);
    $timeDiff = timeDiff($start[1], $time, "+");
    $diffArray = explode(":", $timeDiff);
    //>24?
    if ($diffArray[0] >= 24) {
        $diffArray[0] -= 24;
        $diffArray[0] = str_pad($diffArray[0], 2, "0", STR_PAD_LEFT);
        $start[0] = date("Y-m-d", strtotime($start[0] . " +1 day"));
    }
    return $start[0] . " " . implode(":", $diffArray);
}
 function getAction()
 {
     if (!$this->getRequest()->getParam('html')) {
         $uTw = array();
         $tweet = $this->tweet->Get($_REQUEST['limit'], $this->getRequest()->getParam('of') ? decode($this->getRequest()->getParam('of')) : NULL, $_REQUEST['limit'] == 1 ? 'DESC' : 'ASC');
         if ($tweet) {
             foreach ($tweet as $uT) {
                 $uT["timestamps"] = timeDiff(strtotime($uT["timestamps"]));
                 $uT["id"] = encode($uT["id"]);
                 $uT["uid"] = encode($uT["uid"]);
                 $uTw[] = $uT;
             }
         }
         jencode($uTw);
         die;
     }
 }
function displayStats($pid)
{
    if ($pid == 0) {
        return;
    }
    $ret = "";
    $mod = getModId($_GET[mod]);
    $map = getMapId($_GET[map]);
    $total = mysql_result(mysql_query("SELECT count(*) FROM Games2players WHERE playerId = {$pid} AND spectator=0"), 0, 0);
    $wins = mysql_result(mysql_query("SELECT count(*) FROM Games2players WHERE playerId = {$pid} AND spectator=0 AND victoryTeam=1 AND aliveTillEnd=1"), 0, 0);
    $quit = mysql_result(mysql_query("SELECT count(*) FROM Games2players WHERE playerId = {$pid} AND spectator=0 AND (dropTime<>0 OR leaveTime<>0) AND (dropTime < loseTime OR leaveTime < loseTime)"), 0, 0);
    $maptime = mysql_result(mysql_query("SELECT sum(duration) FROM Games WHERE mapId = {$map} AND id IN (SELECT distinct gameId FROM Games2players WHERE playerId={$pid})"), 0, 0);
    $modtime = mysql_result(mysql_query("SELECT sum(duration) FROM Games WHERE modId = {$mod} AND id IN (SELECT distinct gameId FROM Games2players WHERE playerId={$pid})"), 0, 0);
    $side = @mysql_result(mysql_query("SELECT side,count(*) AS cnt FROM Games2players WHERE playerId={$pid} AND spectator=0 GROUP BY side ORDER BY cnt DESC LIMIT 0,1"), 0, 0);
    @($ret = "total:{$total} games, skill rating:" . eloToText($pid) . " (" . round(getPlayerElo($pid)) . "), won:" . round(100 * $wins / $total) . "%, left:" . round(100 * $quit / $total) . "%, maptime:" . timeDiff($maptime) . ", modtime:" . timeDiff($modtime) . ", side:{$side}\n");
    return $ret;
}
function displaySmurf($id)
{
    $ret = "";
    $res = mysql_query("SELECT name, lastSeen, rank FROM Players AS p JOIN Players2ip AS i ON p.id = i.playerId WHERE ip IN (SELECT ip FROM Players2ip WHERE playerId={$id}) GROUP BY playerId ORDER BY name");
    $cnt = 0;
    while ($row = mysql_fetch_array($res)) {
        if ($row[rank] == 0) {
            $row[rank] = "?";
        }
        if ($cnt > 0) {
            $ret .= ", ";
        }
        $ret .= $row[name] . " (r:{$row['rank']}, " . timeDiff(time() - $row[lastSeen]) . ")";
        $cnt++;
    }
    return $ret;
}
Exemple #8
0
 private function _save($ot_id = 0)
 {
     $this->load->library("WorkflowSystem");
     if ($_POST) {
         $post = $this->input->post(NULL, TRUE);
         $ot_date = $post['input_ot_date'];
         $ot_time_from = $post['input_ot_time_from'];
         $ot_time_to = $post['input_ot_time_to'];
         $ot_remark = $post['input_ot_remark'];
         $data = array();
         $data['wot_date'] = dbDateFormatFromThaiUn543($ot_date);
         $data['wot_time_from'] = $ot_time_from;
         $data['wot_time_to'] = $ot_time_to;
         $data["wot_remark"] = $ot_remark;
         $data['wot_request_hour'] = timeDiff($ot_time_from, $ot_time_to);
         $data['wot_request_by'] = $this->user_id;
         $data['wot_workflow_id'] = $this->workflow_start_id;
         $data['wot_status_id'] = 1;
         if ($ot_id === 0) {
             $data['wot_request_date'] = getDateTimeNow();
             $ot_id = $this->ot->insert($data);
             insert_log_ot($ot_id, 'add', 'ส่งใบคำขอทำงานล่วงเวลา');
             $this->workflowsystem->set_require_data($ot_id, "overtime", "request");
         } else {
             $data['wot_latest_update'] = getDateTimeNow();
             $where = array("wot_id" => $ot_id);
             $affected = $this->ot->update($data, $where);
             insert_log_ot($ot_id, 'edit', 'แก้ไขใบคำขอทำงานล่วงเวลา');
             $this->workflowsystem->set_require_data($ot_id, "overtime", "editrequest");
         }
         //run workflow
         $process = $this->workflowsystem->run();
         //alert after all process
         if ($ot_id > 0 && $process == 'success') {
             echo swalc("บันทึกเรียบร้อย", '', 'success', 'window.location.href = "' . site_url('Overtime') . '"');
         } else {
             if ($ot_id > 0 && $process != 'success') {
                 echo swalc("บันทึกเรียบร้อย", 'แต่ไม่สามารถส่งอีเมล์ได้', 'warning', 'window.location.href = "' . site_url('Overtime') . '"');
             } else {
                 echo swalc("ผิดพลาด กรุณาลองใหม่ภายหลัง", '', 'error', 'window.location.href = "' . site_url('Overtime') . '"');
             }
         }
     }
 }
Exemple #9
0
	public function _home() {
		global $config, $user, $cache;

		$username = request_var('username', '');
		$ip = request_var('ip', '');

		if (_button() && ($username || $ip)) {
			if ($username) {
				$username_base = get_username_base($username);

				$sql = 'SELECT m.username, l.*
					FROM _members m, _members_iplog l
					WHERE m.user_id = l.log_user_id
						AND m.username_base = ?
					ORDER BY l.log_time DESC';
				$sql = sql_filter($sql, $username_base);
			} else if ($ip) {
				$sql = 'SELECT m.username, l.*
					FROM _members m, _members_iplog l
					WHERE m.user_id = l.log_user_id
						AND l.log_ip = ?
					ORDER BY l.log_time DESC';
				$sql = sql_filter($sql, $ip);
			}
			$result = sql_rowset($sql);

			foreach ($result as $i => $row) {
				if (!$i) _style('log');

				_style('log.row', array(
					'UID' => $row['log_user_id'],
					'USERNAME' => $row['username'],
					'TIME' => $user->format_date($row['log_time']),
					'ENDTIME' => (($row['log_endtime']) ? $user->format_date($row['log_endtime']) : '&nbsp;'),
					'DIFFTIME' => (($row['log_endtime']) ? _implode(' ', timeDiff($row['log_endtime'], $row['log_time'], true, 1)) : '&nbsp;'),
					'IP' => $row['log_ip'],
					'AGENT' => $row['log_agent'])
				);
			}
		}

		return;
	}
 function getAction()
 {
     if (!$this->getRequest()->getParam('html')) {
         $uTw = array();
         $pics = $this->pics->Get($_REQUEST['limit'], $this->getRequest()->getParam('of') ? decode($this->getRequest()->getParam('of')) : NULL, $_REQUEST['limit'] == 1 ? 'DESC' : 'ASC');
         if ($pics) {
             foreach ($pics as $uT) {
                 $uT["timestamps"] = timeDiff(strtotime($uT["timestamps"]));
                 $uT["W"] = $uT["width"];
                 unset($uT["width"]);
                 $uT["H"] = $uT["height"];
                 unset($uT["height"]);
                 $uT["id"] = encode($uT["id"]);
                 $uT["uid"] = encode($uT["uid"]);
                 $uTw[] = $uT;
             }
         }
         jencode($uTw);
         die;
     }
 }
Exemple #11
0
 function BanCheck($ip, $board = '', $force_display = false)
 {
     global $tc_db;
     if (!isset($_COOKIE['tc_previousip'])) {
         $_COOKIE['tc_previousip'] = '';
     }
     $bans = array();
     $results = $tc_db->GetAll("SELECT * FROM `" . KU_DBPREFIX . "banlist` WHERE ((`type` = '0' AND ( `ipmd5` = '" . md5($ip) . "' OR `ipmd5` = '" . md5($_COOKIE['tc_previousip']) . "' )) OR `type` = '1') AND (`expired` = 0)");
     if (count($results) > 0) {
         foreach ($results as $line) {
             if ($line['type'] == 1 && strpos($ip, md5_decrypt($line['ip'], KU_RANDOMSEED)) === 0 || $line['type'] == 0) {
                 if ($line['until'] != 0 && $line['until'] < time()) {
                     $tc_db->Execute("UPDATE `" . KU_DBPREFIX . "banlist` SET `expired` = 1 WHERE `id` = " . $line['id']);
                     $line['expired'] = 1;
                     $this->UpdateHtaccess();
                 }
                 if ($line['globalban'] != 1) {
                     if (in_array($board, explode('|', $line['boards'])) || $board == '') {
                         $line['appealin'] = substr(timeDiff($line['appealat'], true, 2), 0, -1);
                         $bans[] = $line;
                     }
                 } else {
                     $line['appealin'] = substr(timeDiff($line['appealat'], true, 2), 0, -1);
                     $bans[] = $line;
                 }
             }
         }
     }
     if (count($bans) > 0) {
         $tc_db->Execute("END TRANSACTION");
         echo $this->DisplayBannedMessage($bans);
         die;
     }
     if ($force_display) {
         /* Instructed to display a page whether banned or not, so we will inform them today is their rucky day */
         echo '<title>' . _gettext('YOU ARE NOT BANNED!') . '</title><div align="center"><img src="' . KU_WEBFOLDER . 'youarenotbanned.jpg"><br /><br />' . _gettext('Unable to find record of your IP being banned.') . '</div>';
     } else {
         return true;
     }
 }
 function getAction()
 {
     $scrap = $this->scrap->Get();
     $uTw = array();
     if ($scrap) {
         $recivedBy = $this->scrap->uid;
         foreach ($scrap as $uT) {
             $uT["timestamps"] = timeDiff(strtotime($uT["timestamps"]));
             $postedBy = $uT["uid"];
             $uT["id"] = encode($uT["id"]);
             $uT["uid"] = encode($uT["uid"]);
             $uT["scrap"] = str($uT["scrap"]);
             $uT["r"] = $recivedBy == $this->session->user['id'];
             $uT["d"] = $postedBy == $this->session->user['id'] || $recivedBy == $this->session->user['id'];
             if ($uT["d"] || $uT["privacy"] == 'N') {
                 $uTw[] = $uT;
             }
         }
         jencode($uTw);
     }
     die;
 }
				<?php 
    //endif;
    ?>
				<?php 
    if ($id_user == getAccountUserId() or $subitem->comment_by == getAccountUserId()) {
        echo loader_image_delete("class='deleteItem' onclick='callFuncDeleteComment({$subitem->id_photo_comment});'");
    }
    ?>
			</div>
			<div class="comment">
				<?php 
    echo maintainHtmlBreakLine($subitem->comment);
    ?>
			</div>
			<p class="time"><?php 
    echo timeDiff($subitem->add_date);
    ?>
</p>
		</div>
	</div>
	<div class="clear"></div>
<?php 
}
?>

<div class="clear"></div>
			
<div class="article-response">
	
	<div class="article-response-form" id="commentSectionSubmitDiv">
		<p>
// log_error("start $start, end $end, archivestart $archivestart, average $average, scale $scale, seconds $seconds");
/* Deduce a interface if possible and use the description */
$curif = explode("-", $curdatabase);
$curif = "{$curif['0']}";
$friendly = convert_friendly_interface_to_friendly_descr(strtolower($curif));
if ($friendly == "") {
    $friendly = $curif;
}
$search = array("-", ".rrd", $curif);
$replace = array(" :: ", "", $friendly);
$prettydb = ucwords(str_replace($search, $replace, $curdatabase));
$rrdtool = "/usr/bin/nice -n20 /usr/local/bin/rrdtool";
$uptime = "/usr/bin/uptime";
$sed = "/usr/bin/sed";
$havg = timeDiff($average, $defOptions);
$hperiod = timeDiff($seconds, $defOptions);
$data = true;
/* Don't leave it up to RRD Tool to select the RRA and resolution to use. */
/* Specify the RRA and resolution to use per the graph havg value. */
switch ($havg) {
    case "1 minute":
        $step = 60;
        break;
    case "5 minutes":
        $step = 300;
        break;
    case "1 hour":
        $step = 3600;
        break;
    case "1 day":
        $step = 86400;
    output($GLOBALS['I18N']->get('Processed') . ' ' . $processed . ' ' . $GLOBALS['I18N']->get('out of') . ' ' . $num_users . ' ' . $GLOBALS['I18N']->get('users'));
    if ($num_users - $sent <= 0) {
        # this message is done
        if (!$someusers) {
            output($GLOBALS['I18N']->get('Hmmm, No users found to send to'));
        }
        if (!$failed_sent) {
            repeatMessage($messageid);
            $status = Sql_query(sprintf('update %s set status = "sent",sent = now() where id = %d', $GLOBALS['tables']['message'], $messageid));
            if (!empty($msgdata['notify_end']) && !isset($msgdata['end_notified'])) {
                $notifications = explode(',', $msgdata['notify_end']);
                foreach ($notifications as $notification) {
                    sendMail($notification, $GLOBALS['I18N']->get('Message Sending has finished'), sprintf($GLOBALS['I18N']->get('phplist has finished sending the message with subject %s'), $message['subject']));
                }
                Sql_Query(sprintf('insert ignore into %s (name,id,data) values("end_notified",%d,now())', $GLOBALS['tables']['messagedata'], $messageid));
            }
            $timetaken = Sql_Fetch_Row_query("select sent,sendstart from {$tables['message']} where id = \"{$messageid}\"");
            output($GLOBALS['I18N']->get('It took') . ' ' . timeDiff($timetaken[0], $timetaken[1]) . ' ' . $GLOBALS['I18N']->get('to send this message'));
            sendMessageStats($messageid);
        }
    } else {
        if ($script_stage < 5) {
            $script_stage = 5;
        }
    }
}
if (!$num_messages) {
    $script_stage = 6;
}
# we are done
# shutdown will take care of reporting
Exemple #16
0
function sendMessageStats($msgid)
{
    global $stats_collection_address, $tables;
    $msg = '';
    if (defined("NOSTATSCOLLECTION") && NOSTATSCOLLECTION) {
        return;
    }
    if (!isset($stats_collection_address)) {
        $stats_collection_address = '*****@*****.**';
    }
    $data = Sql_Fetch_Array_Query(sprintf('select * from %s where id = %d', $tables["message"], $msgid));
    $msg .= "phpList version " . VERSION . "\n";
    $diff = timeDiff($data["sendstart"], $data["sent"]);
    if ($data["id"] && $data["processed"] > 10 && $diff != "very little time") {
        $msg .= "\n" . 'Time taken: ' . $diff;
        foreach (array('entered', 'processed', 'sendstart', 'sent', 'htmlformatted', 'sendformat', 'template', 'astext', 'ashtml', 'astextandhtml', 'aspdf', 'astextandpdf') as $item) {
            $msg .= "\n" . $item . ' => ' . $data[$item];
        }
        if ($stats_collection_address == '*****@*****.**' && $data["processed"] > 500) {
            mail($stats_collection_address, "PHPlist stats", $msg);
        } else {
            mail($stats_collection_address, "PHPlist stats", $msg);
        }
    }
}
Exemple #17
0
    echo WWW_ROOT;
    ?>
user/<?php 
    echo encode($r["id"]);
    ?>
"><img src="<?php 
    echo IMAGES;
    ?>
user/icon/<?php 
    echo $r["image"];
    ?>
" /><span><?php 
    echo strlen($r["username"]) < 10 ? $r["username"] : substr($r["username"], 0, 10) . '..';
    ?>
<br /><em><?php 
    echo str_replace(" years", ", ", timeDiff(strtotime($r["birthDay"]), array('parts' => 1, 'precision' => 'year', 'separator' => '', 'next' => ''))) . ($r["gender"] == 'M' ? 'Male' : 'Female') . ($r["city"] ? "<br />" . $r["city"] : "");
    ?>
</em></span></a>
            </li>
            <?php 
}
?>
        </ul>
        </div>
  </div>
<script type="text/javascript">
var xeno = true;
$(document).ready(function(){setInterval(function(){
	$("#new .l a").animate({'opacity':'0.5','background-position':'0 '+(xeno?'-37px':'0')},function(){$("#new .l a").animate({'opacity':'1'})}); xeno = (xeno?false:true);
	gst.msg = (Math.floor(Math.random()*7+1)+' users just pooled');
	$.get('<?php 
Exemple #18
0
 <tr><td valign="top">' . $GLOBALS['I18N']->get("Subject:") . '</td><td valign="top">%s</td></tr>
 <tr><td valign="top">' . $GLOBALS['I18N']->get("Entered:") . '</td><td valign="top">%s</td></tr>
 <tr><td valign="top">' . $GLOBALS['I18N']->get("Embargo:") . '</td><td valign="top">%s</td></tr>
 </table>
 </td>', stripslashes($msg["fromfield"]), stripslashes($msg["subject"]), $msg["entered"], $msg["embargo"]);
   if ($clicks[0]) {
       $clicked = sprintf('<tr><td></td>
   <td align="right" colspan=2>
   <b>' . $GLOBALS['I18N']->get('Clicks') . '</b></td>
   <td align="center"><b>%d</b></td></tr>
   ', $clicks[0]);
   } else {
       $clicked = '';
   }
   if ($msg['status'] == 'sent') {
       $status = $GLOBALS['I18N']->get("Sent") . ": " . $msg['sent'] . '<br/>' . $GLOBALS['I18N']->get("Time to send") . ': ' . timeDiff($msg["sendstart"], $msg["sent"]);
       if ($msg['viewed']) {
           $viewed = sprintf('<tr><td></td>
     <td align="right" colspan=2>
     <b>' . $GLOBALS['I18N']->get("Viewed") . '</b></td>
     <td align="center"><b>%d</b></td></tr>
     <tr><td></td><td align="right" colspan=2>
     <b>' . $GLOBALS['I18N']->get("Unique Views") . '</b></td>
     <td align="center"><b>%d</b></td></tr>
     ', $msg["viewed"], $uniqueviews[0]);
       } else {
           $viewed = '';
       }
       $sendstats = sprintf('<br /><table border=1>
   <tr>
     <td>' . $GLOBALS['I18N']->get("total") . '</td>
Exemple #19
0
 public function reserve($_id = '')
 {
     if (!$_SESSION["s"]["membership"]) {
         header("Location: /");
     }
     if ($_REQUEST["date"]) {
         $this->Space_reserve->debug();
         $s_r_id = $this->Space_reserve->add($_REQUEST);
         //            add_activity(1, $_REQUEST["user_id"], 1, $_REQUEST["user_id"], 0, "", Activity_model::A_TYPE_SPACE, $s_r_id);
         //            $_SESSION["msg"] = "공간공유가 신청되었습니다.<br />관리자 승인이 완료되면 공간공유 페이지에 노출됩니다.";
         $sp = $this->Space->get($_REQUEST["space_id"]);
         if ($sp["type"] > 2 && ($_SESSION["s"]["per"] & $this->settings->permission7) == $this->settings->permission7) {
             $tmp = $this->Members->get_etc("_key = 'permission7' and user_id = " . $_SESSION["s"]["id"]);
             if ($_REQUEST["date"] > $tmp["_value"] && $_REQUEST["rest"] >= timeDiff($_REQUEST["start"], $_REQUEST["end"])) {
                 $this->assigns["ok"] = 2;
                 add_activity(1, $_REQUEST["user_id"], 1, $_REQUEST["user_id"], 1, "", Activity_model::A_TYPE_SPACE, $s_r_id);
                 $_SESSION["msg"] = "예약 신청되었습니다.";
                 $ar["state"] = 1;
                 $this->Space_reserve->permit($s_r_id, $ar);
             } else {
                 $this->assigns["ok"] = 1;
                 add_activity(1, $_REQUEST["user_id"], 1, $_REQUEST["user_id"], 0, "", Activity_model::A_TYPE_SPACE, $s_r_id);
                 $_SESSION["msg"] = "예약 신청되었습니다.<br />관리자 승인이 완료되면 Reservation 페이지에 노출됩니다.";
             }
         } else {
             if ($sp["type"] == 3 && ($_SESSION["s"]["per"] & $this->settings->permission8) == $this->settings->permission8) {
                 $this->assigns["ok"] = 2;
                 add_activity(1, $_REQUEST["user_id"], 1, $_REQUEST["user_id"], 1, "", Activity_model::A_TYPE_SPACE, $s_r_id);
                 $_SESSION["msg"] = "예약 신청되었습니다.";
                 $ar["state"] = 1;
                 $this->Space_reserve->permit($s_r_id, $ar);
             } else {
                 $this->assigns["ok"] = 1;
                 add_activity(1, $_REQUEST["user_id"], 1, $_REQUEST["user_id"], 0, "", Activity_model::A_TYPE_SPACE, $s_r_id);
                 $_SESSION["msg"] = "예약  신청되었습니다.<br />관리자 승인이 완료되면 Reservation 페이지에 노출됩니다.";
             }
         }
         header("Location: /member/edit_space");
     }
     if ($_id) {
         $res = $this->Space_reserve->get($_id);
         if ($res["user_id"] == $_SESSION["s"]["id"]) {
             $this->assigns["res"] = $res;
         } else {
             header("Location: /");
         }
     }
     if ($_REQUEST["cancel"]) {
         $this->Space_reserve->delete($_REQUEST["cancel"]);
         header("Location: /member/edit_space");
     }
     $this->assigns["space"] = $this->Space->list_(1, 100, "visible = 1");
     //        print_r($_REQUEST);
     //        echo "/".timeDiff($_REQUEST["start"], $_REQUEST["end"]);
 }
Exemple #20
0
function sendMessageStats($msgid)
{
    global $stats_collection_address, $tables;
    $msg = '';
    if (defined('NOSTATSCOLLECTION') && NOSTATSCOLLECTION) {
        return;
    }
    if (!isset($stats_collection_address)) {
        $stats_collection_address = '*****@*****.**';
    }
    $data = Sql_Fetch_Array_Query(sprintf('select * from %s where id = %d', $tables['message'], $msgid));
    $msg .= 'phpList version ' . VERSION . "\n";
    $diff = timeDiff($data['sendstart'], $data['sent']);
    if ($data['id'] && $data['processed'] > 10 && $diff != 'very little time') {
        $msg .= "\n" . 'Time taken: ' . $diff;
        foreach (array('entered', 'processed', 'sendstart', 'sent', 'htmlformatted', 'sendformat', 'template', 'astext', 'ashtml', 'astextandhtml', 'aspdf', 'astextandpdf') as $item) {
            $msg .= "\n" . $item . ' => ' . $data[$item];
        }
        sendMail($stats_collection_address, 'phpList stats', $msg, '', '', true);
    }
}
Exemple #21
0
function superTimeDiff($time, $opt = array())
{
    return "<span title='" . date("l, n/j/Y @ g:ia", $time) . "'>" . timeDiff($time, $opt) . "</span>";
}
Exemple #22
0
    echo "<input type='submit' name='submit' value='submit' class='submitBtn'>";
} else {
    echo "<input type='submit' name='submit' value='submit' disabled><br/>";
    echo "You don't have any booked rooms at the moment";
}
echo "</form>";
$myBookedRooms = fetchRoomOrdersByUserID($user_id);
//needs to get the sql data again
echo "<table border='3'>";
echo "<tr><td><b>ID</b></td><td><b>RoomType</b></td><td><b>Floor</b></td><td><b>checkin</b></td><td><b>checkout</b></td><td><b>days</b></td><td><b>Prize</b></td></tr>";
while ($myArrayV = mysql_fetch_array($myBookedRooms)) {
    $room = mysql_fetch_array(fetchRoomByID($myArrayV["id"]));
    echo "<tr>";
    echo "<td>" . $myArrayV["id"] . "</td>";
    echo "<td>" . $room["rtype"] . "</td>";
    echo "<td>" . $room["floor"] . "</td>";
    echo "<td>" . $myArrayV["checkin"] . "</td>";
    echo "<td>" . $myArrayV["checkout"] . "</td>";
    echo "<td>" . timeDiff($myArrayV["checkin"], $myArrayV["checkout"]) . "</td>";
    echo "<td>" . $room["prize"] * timeDiff($myArrayV["checkin"], $myArrayV["checkout"]) . "€</td>";
    echo " </tr>";
}
echo "</table>";
?>
</div>
<div id="bottom_bar">

</div>
</body>
</html>
Exemple #23
0
<div id="wrap">
  <div id="head" class="abo"><a class="nojs" href="./"><img src="./img/logo<?php 
echo !$cfg['gtsonline'] ? "2" : "";
?>
.png" alt="Vlad's Global Trade Station"/></a></div>
  <div id="bord" class="cen">
<?php 
if (!isset($cfg['disabled']) || empty($cfg['disabled'])) {
    ?>
    <div id="nav">
      <ul>
        <li><a class="nojs" href="./">News</a></li>
        <li><a class="nojs" href="./?archive">Event archive</a></li>
        <li><a class="nojs" href="./?howto">How to connect</a></li>
<?php 
    echo !$cfg['gtsonline'] ? "        <li class=\"offline\">The GTS is offline.</li>\n" : "        <li class=\"online\">" . (!empty($cfg['gtsonlinesince']) && $cfg['gtsonlinesince'] > 0 ? "GTS has been online for " . timeDiff($cfg['gtsonlinesince'], 1) : "The GTS is online") . ".</li>";
    ?>
      </ul>
    </div>
    <div id="cont"><?php 
    echon(!empty($cfg['mysqlfatal']) ? "<b>MySQL error:</b> <em>{$cfg['mysqlfatal']}</em>" : $html, 1);
    ?>
</div>
<?php 
} else {
    echo "    <p>{$cfg['disabled']}</p>\n";
}
?>
  </div>
  <div id="foot"><p>Created by Vlad for the Project Pokemon community. Thanks to Rokis17 and SneakyTomato for their art. Generated in <?php 
echo $load->calc();
Exemple #24
0
 private function calcDuracion()
 {
     $this->duracion = timeDiff($this->tcIn, timeDiff($this->tcOut, "00:00:00:01", "+"));
     return $this->duracion;
 }
 function searchAction()
 {
     $this->view->country = $this->admin->Country();
     if (POST) {
         $rU = array();
         $result = $this->user->Search($_POST);
         foreach ($result as $r) {
             $rU[] = array("id" => encode($r["id"]), "i" => $r["image"], "u" => $r["username"], "a" => timeDiff(strtotime($r["birthDay"]), array('parts' => 1, 'precision' => 'year', 'separator' => '', 'next' => '')) . ", " . ($r["gender"] == 'M' ? 'Male' : 'Female') . "<br />" . $r["city"] . ($r["state"] ? ", " . $r["state"] : "") . "<br />" . $this->view->country[$r["country"]]);
         }
         die(json_encode($rU));
     }
 }
Exemple #26
0
    	$um = Sql_Fetch_Row($um);
			$notsent++;
			if (VERBOSE)
				output( "Not sending to $userdata[0], already sent ".$um[0]);
		}
  }
  if (!$safemode || $safemode_total < ($reload * $num_per_batch)) {
    if (!$someusers)
      output( "Hmmm, No users found to send to");
    $someusers = 0;
    if (ENABLE_RSS && $rssmessage) {
	    $status = Sql_query("update {$tables['message']} set status = \"submitted\",sent = now() where id = \"$messageid\"");
    } else {
    	repeatMessage($messageid);
	    $status = Sql_query("update {$tables['message']} set status = \"sent\",sent = now() where id = \"$messageid\"");
    }
    $timetaken = Sql_Fetch_Row_query("select sent,sendstart from {$tables['message']} where id = \"$messageid\"");
    output("It took ".timeDiff($timetaken[0],$timetaken[1])." to send this message");
    sendMessageStats($messageid);
  } else {
  	$script_stage = 5;
  }
}

if (!$safemode || $safemode_total < $reload * $num_per_batch)
	$script_stage = 6; # we are done
#print "$safemode_total, ".$reload * $num_per_batch;
# shutdown will take care of reporting

?>
        echo $subitem->id_user;
        ?>
');" class="chat">Chat</a> 
					<a href="javascript:void(0);" onclick="callFuncShowDialogSubmitQuestion(<?php 
        echo $subitem->id_user;
        ?>
);" class="ask-me">Ask Me</a>
				<?php 
    }
    ?>
				<?php 
    if ($isMyOwnFeed or $subitem->id_user == getAccountUserId()) {
        echo loader_image_delete("class='deleteItem' onclick='callFuncDeleteComment({$subitem->id_wall},{$id_wall});'");
    }
    ?>
			</div>
			<div class="comment">
				<?php 
    echo $this->wall_m->commentAccordingType($subitem);
    ?>
			</div>
			<p class="time"><?php 
    echo timeDiff($subitem->date_diff);
    //time_interval(explode(':',$subitem->add_date));
    ?>
</p>
		</div>
	</div>
	<div class="clear"></div>
<?php 
}
Exemple #28
0
         $resultStats .= '
    <tr><td>' . s('Clicks') . '</td><td>' . $clicks[0] . '</td></tr>';
     }
     $resultStats .= '
  <tr><td>' . s('Bounced') . '</td><td>' . $msg['bouncecount'] . '</td></tr>';
     $resultStats .= '</table>';
     //      $ls->addColumn($listingelement,s('Results'),$resultStats);
     //$ls->addColumn($listingelement,$GLOBALS['I18N']->get("Viewed"), $msg["viewed"]);
     //$ls->addColumn($listingelement,$GLOBALS['I18N']->get("Unique Views"), $uniqueviews[0]);
     //if ($clicks[0]) {
     //$ls->addColumn($listingelement,$GLOBALS['I18N']->get("Clicks"), $clicks[0]);
     //}
     //$ls->addColumn($listingelement,$GLOBALS['I18N']->get("Bounced"), $msg["bouncecount"]);
 }
 if ($msg['status'] == 'sent') {
     $timetosend = $GLOBALS['I18N']->get("Time to send") . ': ' . timeDiff($msg["sendstart"], $msg["sent"]);
 } else {
     $timetosend = '';
 }
 $colspan = 3;
 if (!empty($msg['aspdf'])) {
     $colspan++;
 }
 if (!empty($msg['astextandpdf'])) {
     $colspan++;
 }
 $clicksrow = $bouncedrow = '';
 //if ($clicks[0]) {
 //$clicksrow = sprintf('<tr><td colspan="%d">%s</td><td>%d</td></tr>',
 //$colspan-1,$GLOBALS['I18N']->get("Clicks"),$clicks[0]);
 //}
Exemple #29
0
         $resultStats .= '
    <tr><td>' . s('Clicks') . '</td><td>' . $clicks[0] . '</td></tr>';
     }
     $resultStats .= '
  <tr><td>' . s('Bounced') . '</td><td>' . $msg['bouncecount'] . '</td></tr>';
     $resultStats .= '</table>';
     //      $ls->addColumn($listingelement,s('Results'),$resultStats);
     //$ls->addColumn($listingelement,$GLOBALS['I18N']->get("Viewed"), $msg["viewed"]);
     //$ls->addColumn($listingelement,$GLOBALS['I18N']->get("Unique Views"), $uniqueviews[0]);
     //if ($clicks[0]) {
     //$ls->addColumn($listingelement,$GLOBALS['I18N']->get("Clicks"), $clicks[0]);
     //}
     //$ls->addColumn($listingelement,$GLOBALS['I18N']->get("Bounced"), $msg["bouncecount"]);
 }
 if ($msg['status'] == 'sent') {
     $timetosend = $GLOBALS['I18N']->get('Time to send') . ': ' . timeDiff($msg['sendstart'], $msg['sent']);
 } else {
     $timetosend = '';
 }
 $colspan = 3;
 if (!empty($msg['aspdf'])) {
     ++$colspan;
 }
 if (!empty($msg['astextandpdf'])) {
     ++$colspan;
 }
 $clicksrow = $bouncedrow = '';
 //if ($clicks[0]) {
 //$clicksrow = sprintf('<tr><td colspan="%d">%s</td><td>%d</td></tr>',
 //$colspan-1,$GLOBALS['I18N']->get("Clicks"),$clicks[0]);
 //}
Exemple #30
0
    ?>
</td>
				<td><?php 
    echo dateThaiFormatFromDB($row['wot_date']);
    ?>
</td>
				<td class="center-align"><?php 
    echo $row['wot_time_from'];
    ?>
</td>
				<td class="center-align"><?php 
    echo $row['wot_time_to'];
    ?>
</td>
				<td class="center-align"><?php 
    echo timeDiff($row['wot_time_from'], $row["wot_time_to"]);
    ?>
				<td><?php 
    echo $row['EmpFullnameThai'];
    ?>
</td>
				<td id="<?php 
    echo $row["wot_id"];
    ?>
_workflow_name"><?php 
    echo $row['workflow_name'];
    ?>
</td>
				<td>
					<a href="<?php 
    echo site_url("Overtime/detail/" . $row["wot_id"]);