public static function fetchOne($sql) { $con = new connection(); $con->execute($sql); $con->fetch(); return $con->rows; }
function dateExists() { $date = date('Y-m-d', strtotime($_GET['date'])); $sql = "SELECT COUNT(*) AS count FROM ipodate WHERE ipodate = '" . mysql_escape_string($date) . "'"; $con = new connection(); $con->execute($sql); die($con->fetch()); }
function useralive($userid) { $con= new connection(); $con->execute("select time from users where iduser='******'"); $con->fetch(); $time1= $con->rows['time']; if ($time1<(time()-13)) return false; else return true; }
function getSymbols() { // get a list of IPOs from database that are missing the ipoprice $sql = "SELECT DISTINCT symbol FROM ipo WHERE ipoprice IS NULL"; $con = new connection(); $con->execute($sql); $symbols = array(); while ($con->fetch()) { $symbols[] = $con->rows["symbol"]; } return $symbols; }
function getSymbols() { // get a list of all IPOs that don't have first day open/close price set $sql = "SELECT DISTINCT symbol, ipodate FROM ipo WHERE closeprice = 0 OR openprice = 0"; $con = new connection(); $con->execute($sql); $symbols = array(); while ($con->fetch()) { $symbols[] = array("symbol" => $con->rows["symbol"], "ipodate" => $con->rows["ipodate"]); } return $symbols; }
function getSymbols() { // get the full list of IPOs in the database $sql = "SELECT DISTINCT symbol FROM ipo"; $con = new connection(); $con->execute($sql); $symbols = array(); while ($con->fetch()) { $symbols[] = $con->rows["symbol"]; } return $symbols; }
function symbolsNoScore() { // get a list of IPOs and their dates from the database that are missing tweets/hype or are in the future $sql = "SELECT DISTINCT symbol, ipodate FROM ipo WHERE hype IS NULL OR ipodate >= CURDATE()"; $con = new connection(); $con->execute($sql); $symbols = array(); while ($con->fetch()) { $symbol = array(); $symbol["symbol"] = $con->rows["symbol"]; $symbol["ipodate"] = strtotime($con->rows["ipodate"]); $symbols[] = $symbol; } return $symbols; }
function closedeadrooms() { $con= new connection(); $con->execute("select idchat, user1, user2, full from chat where closed<>'Y'"); while($con->fetch()) { $user= new users(); if ($user->useralive($con->rows['user1'])==false) $this->closeroom($con->rows['idchat']); if ($user->useralive($con->rows['user2'])==false && $con->rows['full']=='Y') $this->closeroom($con->rows['idchat']); } }
else echo "<b>Partner has left the chat</b>"; echo " - $count Users Online!"; $con=new connection(); $con->execute("select * from text where idchat='" . $_REQUEST['idchat'] . "' "); $count=$con->numRows(); /* if ($count > 12) $start=$count - 12; else $start=0; */ $con->execute("select * from text where idchat='" . $_REQUEST['idchat'] . "'"); while ($con->fetch()) { $name = $user->getname($con->rows['iduser']); $txt=stripslashes($con->rows['text']); echo "<div style='margin:2px; padding:5px; width:290px; color:#333333; font-size:11px; font-family:\"lucida grande\",tahoma,verdana,arial,sans-serif; background-color:#ECEFF5; '><span style='font-weight:bold;color:#3B5998; text-transform:capitalize; margin-right:3px;'>$name</span> {$txt}</div>"; } if ($chat->chatclosed($_REQUEST['idchat']) ) echo "<div style='margin:2px; padding:5px; width:290px; color:#333333; font-size:11px; font-family:\"lucida grande\",tahoma,verdana,arial,sans-serif; background-color:#ECEFF5; '><span style='font-weight:bold;color:#3B5998; text-transform:capitalize; margin-right:3px;'></span> Your partner has left the chat</div>"; $con->execute("update users set time='" . time() . "' where iduser='******'iduser']}'"); if (!$chat->chatclosed($_REQUEST['idchat']) && $chat->getchatpartnerid($_POST['idchat'], $_POST['iduser'])) { $timeout=time() - 10; $con->execute(