function CropImage($file) { global $ImageMagik; global $CropFuzz; $Command = $ImageMagik . " " . $file . ' -fuzz ' . $CropFuzz . '% -trim ' . $file . "\n"; $Cropping = ExecCommand($Command); }
function FlushSessions() { //Delete old sessions if (!ExecCommand("DELETE FROM 0700_Sessions\n WHERE (SessionAccessDate < " . date('YmdHis', mktime(date('H'), date('i'), date('s'), date('n'), date('j') - 90, date('Y'))) . ")\n OR (SessionAccessDate < " . date('YmdHis', mktime(date('H') - 3, date('i'), date('s'), date('n'), date('j'), date('Y'))) . " AND SessionPort = 0);")) { SysLogIt('Error deleting old sessions.', StatusError, ActionDelete); } //Delete old logs if (!ExecCommand("DELETE FROM 0500_System_Log\n WHERE EntryTimestamp < " . date('YmdHis', mktime(date('H'), date('i'), date('s'), date('n'), date('j') - 14, date('Y'))) . "\n AND EntryIP = '';")) { SysLogIt('Error deleting old system log entries.', StatusError, ActionDelete); } if (!ExecCommand("DELETE FROM 0500_System_Log\n WHERE EntryTimestamp < " . date('YmdHis', mktime(date('H'), date('i'), date('s'), date('n'), date('j') - 90, date('Y'))) . ";")) { SysLogIt('Error deleting old log entries.', StatusError, ActionDelete); } }
public function GetNewDivisions($SID) { ExecCommand("UPDATE 4100_Deal_Sources SET URLsLastUpdated = " . date('YmdHis') . " WHERE DealSourceID = " . $SID . ";"); return true; //Success /* SysLogIt('Retrieving Fabfind homepage.'); if (!list ($Data, $DURL) = GetWebData('http://www.Fabfind.ca/')) { return SysLogIt('Error getting web data.', StatusError); } //file_put_contents("Fabfind.txt", $Data); SysLogIt('Parsing HTML.'); if ($DataArray = FindSubData($Dasta, 'id="cityBoxFancyAP"', '<table>', '</table>', false)); if ($DataArray === false) return SysLogIt("Couldn't find city content.", StatusError); //Large Centres $DataArray = explode('</td>', $DataArray); foreach ($DataArray as $DataItem) { if (stripos($DataItem, 'otherCity') !== false) { $ID = FindData($DataItem, 'change-to-', '"', 10, 0, false, 0, false); $Name = FindSubData($DataItem, '<span><a', '>', '<', false); if ($Name !== false && $ID !== false) { if (!CheckURL('Fabfind', $SID, $Name, $ID)) return false; } } } return UpStatus('Fabfind', $SID); */ }
function DeleteAccessKey($InKey) { if (!ExecCommand("DELETE FROM 0600_Access_Keys WHERE KeyID = " . $InKey . ";")) { return SysLogIt('Error deleting access key with ID of ' . $InKey . '.', StatusError, ActionDelete); } return true; }
function CheckUnsubscribe() { /*///////////////////////////////////////////////////////////// Author: Plottery Corp. Created: v1.0.0 - 2011-08-14 Revisions: None Purpose: Unsubscribes a user from all notifications Returns: Nothing */ ///////////////////////////////////////////////////////////// if (isset($_GET['Key'])) { list($QR, $DR, $T) = QuerySingle("SELECT UN.NotificationID AS NID, UN.UserID AS UID\n FROM 1400_User_Notifications UN\n WHERE UN.CancelKey = '" . Pacify($_GET['Key']) . "';"); if ($QR < 0) { SysLogIt('Error searching for cancel key ' . Pacify($_GET['Key']) . '.', StatusError, ActionSelect); } else { $Strings = GSA('2112'); if ($QR > 0) { if (ExecCommand("UPDATE 1000_Users SET UserFlags = (UserFlags & ~" . UserReminders . ") WHERE UserID = " . $DR['UID'] . ";")) { SysLogIt('Successfully disabled reminders for user with ID of ' . $DR['UID'] . '.', StatusInfo); if (ExecCommand("UPDATE 1400_User_Notifications SET Settings = 0 WHERE NotificationID = " . $DR['NID'] . ";")) { SysLogIt('Successfully disabled digests for user with ID of ' . $DR['UID'] . '.', StatusInfo); return DisplayMainScreen("SetBackMap(); PopC('" . Pacify(Pacify($Strings[2112]), true) . "','GH();');"); } else { SysLogIt('Could not disable digests for user with ID of ' . $UID . '.', StatusError, ActionInsert); } } else { SysLogIt('Could not disable reminders for user with ID of ' . $UID . '.', StatusError, ActionInsert); } } } } return DisplayMainScreen('PopErr();'); }
function SetTypes() { /*///////////////////////////////////////////////////////////// Author: Plottery Corp. Created: v1.0.0 - 2010-12-09 Revisions: None Purpose: Set deal types Returns: Nothing */ ///////////////////////////////////////////////////////////// global $Response; $Response->J = 'F5();'; if (isset($_POST['Key'])) { if ($AKey = ValidAccessKey($_POST['Key'])) { //Saving DeleteAccessKey($AKey); //Validation foreach ($_POST as $Key => $Value) { if (is_numeric($Key) && is_numeric($Value)) { if (ExecCommand("UPDATE 2000_Stores SET TypeID = '" . (int) $Value . "' WHERE StoreID = " . (int) $Key . ";")) { SysLogIt('Updated store with ID of ' . (int) $Key . ' to type with ID of ' . (int) $Value . '.', StatusInfo, ActionUpdate); } else { SysLogIt('Error updating store with ID of ' . (int) $Key . '.', StatusError, ActionUpdate); $Response->Send(); } } } $Response->J = 'EdtTyp(true);'; $Response->S = true; } } $Response->Send(); }
function DoHistoryGraph($SID) { $Filepath = dirname(__FILE__) . '/../Hist/'; list($QR, $DR, $T) = QuerySingle("SELECT SH.HistoryID AS HID, SH.Filename AS FName, COUNT(D.DealID) AS Deals, MAX(GREATEST(D.DealPrice, D.DealValue)) AS MaxVal,\n AVG(D.DealValue) AS AvgVal, AVG(D.DealPrice) AS AvgPrc\n FROM 4000_Deals D\n LEFT JOIN 2600_Store_History SH ON D.StoreID = SH.StoreID\n WHERE D.StoreID = " . $SID . "\n GROUP BY D.StoreID;"); if ($QR < 0) { return SysLogIt('Error searching deals for history.', StatusError, ActionSelect); } if ($QR > 0) { list($QR, $SDR, $T) = QuerySingle('SELECT GROUP_CONCAT(X.DealID) AS DIDs, GROUP_CONCAT(X.DealPrice) AS DPrcs, GROUP_CONCAT(X.DealValue) AS DVals, GROUP_CONCAT(X.DealSourceName) AS SNams, GROUP_CONCAT(X.DEnd) AS DEnds FROM ( SELECT D.StoreID, D.DealID, D.DealPrice, D.DealValue, DS.DealSourceName, UNIX_TIMESTAMP(D.DateEnds) AS DEnd FROM 4000_Deals D INNER JOIN 4100_Deal_Sources DS ON D.DealSourceID = DS.DealSourceID WHERE D.StoreID = ' . $SID . ' ORDER BY D.DateEnds ) X GROUP BY X.StoreID;'); if ($QR < 0) { return SysLogIt('Error searching deal details for history.', StatusError, ActionSelect); } if ($QR > 0) { if ($DR['Deals'] <= 1) { return false; } if (!is_null($DR['FName'])) { if (file_exists($Filepath . $DR['FName'])) { unlink($Filepath . $DR['FName']); } } $Filename = md5($SID . time()) . '.svg'; $LMarg = 15; $RMarg = 30; $TMarg = 25; $VHeight = 80; $HSpacing = (int) ((400 - $LMarg - $RMarg) / ($DR['Deals'] - 1)); $DPrcs = explode(',', $SDR['DPrcs']); $DVals = explode(',', $SDR['DVals']); $SNams = explode(',', $SDR['SNams']); $DEnds = explode(',', $SDR['DEnds']); $LPrc = 0; $MSav = 0; $MSvP = 0; for ($x = 0; $x < $DR['Deals']; $x++) { if ((int) $DPrcs[$x] < $LPrc || $LPrc == 0) { $LPrc = (int) $DPrcs[$x]; } if ((int) $DVals[$x] - (int) $DPrcs[$x] > $MSav) { $MSav = (int) $DVals[$x] - (int) $DPrcs[$x]; } if ((int) (100 - $DPrcs[$x] / $DVals[$x] * 100) > $MSvP) { $MSvP = (int) (100 - $DPrcs[$x] / $DVals[$x] * 100); } } $Output = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="400" height="' . ($TMarg + $VHeight + 20 + ($DR['Deals'] * 20 + 10) + 10 + 30) . '">'; //Grid for ($x = 0; $x < $DR['Deals']; $x++) { $Output .= '<path d="M' . $LMarg . ',' . ($TMarg + ($VHeight - (int) ($DPrcs[$x] / $DR['MaxVal'] * $VHeight))) . ' L' . ($LMarg + ($DR['Deals'] - 1) * $HSpacing) . ',' . ($TMarg + ($VHeight - (int) ($DPrcs[$x] / $DR['MaxVal'] * $VHeight))) . '" style="stroke: #C0C0C0; stroke-width: 1; fill: none;"/>'; $Output .= '<path d="M' . $LMarg . ',' . ($TMarg + ($VHeight - (int) ($DVals[$x] / $DR['MaxVal'] * $VHeight))) . ' L' . ($LMarg + ($DR['Deals'] - 1) * $HSpacing) . ',' . ($TMarg + ($VHeight - (int) ($DVals[$x] / $DR['MaxVal'] * $VHeight))) . '" style="stroke: #C0C0C0; stroke-width: 1; fill: none;"/>'; $Output .= '<path d="M' . $LMarg . ',' . ($TMarg + ($VHeight - (int) (($DVals[$x] - $DPrcs[$x]) / $DR['MaxVal'] * $VHeight))) . ' L' . ($LMarg + ($DR['Deals'] - 1) * $HSpacing) . ',' . ($TMarg + ($VHeight - (int) (($DVals[$x] - $DPrcs[$x]) / $DR['MaxVal'] * $VHeight))) . '" style="stroke: #C0C0C0; stroke-width: 1; fill: none;"/>'; } $Output .= '<path d="M' . $LMarg . ',' . $TMarg . ' L' . ($LMarg + ($DR['Deals'] - 1) * $HSpacing) . ',' . $TMarg . '" style="stroke: #607080; stroke-width: 1; fill: none;"/>'; $Output .= '<text x="' . ($LMarg + (400 - $RMarg) - 10) . '" y="' . ($TMarg + 5) . '" style="font-family: Arial; font-size:12px; stroke: #607080;">' . $DR['MaxVal'] . '</text>'; $Output .= '<path d="M' . $LMarg . ',' . ($TMarg + $VHeight) . ' L' . ($LMarg + ($DR['Deals'] - 1) * $HSpacing) . ',' . ($TMarg + $VHeight) . '" style="stroke: #607080; stroke-width: 1; fill: none;"/>'; $Output .= '<text x="' . ($LMarg + (400 - $RMarg) - 10) . '" y="' . ($TMarg + $VHeight + 5) . '" style="font-family: Arial; font-size:12px; stroke: #607080;">0</text>'; for ($x = 0; $x < $DR['Deals']; $x++) { $Output .= '<path d="M' . ($LMarg + $x * $HSpacing) . ',' . $TMarg . ' L' . ($LMarg + $x * $HSpacing) . ',' . ($TMarg + $VHeight) . '" style="stroke: #607080; stroke-width: 1; fill: none;"/>'; } //Text for ($x = 0; $x < $DR['Deals']; $x++) { $Output .= '<circle cx="' . ($LMarg + $x * $HSpacing) . '" cy="' . ($TMarg - 15) . '" r="8" style="fill:#000000"/>'; $Output .= '<text x="' . ($LMarg + $x * $HSpacing) . '" y="' . ($TMarg - 11) . '" style="font-family: Arial; font-size:10px; fill: #FFFFFF; stroke: #FFFFFF;" text-anchor="middle">' . ($x + 1) . '</text>'; } /* for ($x=0; $x<$DR['Deals']; $x++) { $Output .= '<text x="'.($LMarg+0+($x*$HSpacing)).'" y="'.($TMarg-10).'" transform="rotate(270 '.($LMarg+0+($x*$HSpacing)).','.($TMarg-10).')" style="font-family: Arial; font-size:12px;">'.date('Y.m.d', $DEnds[$x]).'</text>'; $Output .= '<text x="'.($LMarg+10+($x*$HSpacing)).'" y="'.($TMarg-10).'" transform="rotate(270 '.($LMarg+10+($x*$HSpacing)).','.($TMarg-10).')" style="font-family: Arial; font-size:12px;">'.$SNams[$x].'</text>'; } */ //Values $Output .= '<path d="'; for ($x = 0; $x < $DR['Deals']; $x++) { $Output .= ($x == 0 ? 'M' : 'L') . ($LMarg + $x * $HSpacing) . ',' . ($TMarg + ($VHeight - (int) ($DVals[$x] / $DR['MaxVal'] * $VHeight))) . ' '; } $Output .= '" style="stroke: #974d57; stroke-width: 2; fill: none;"/>'; for ($x = 0; $x < $DR['Deals']; $x++) { $Output .= '<circle cx="' . ($LMarg + $x * $HSpacing) . '" cy="' . ($TMarg + ($VHeight - (int) ($DVals[$x] / $DR['MaxVal'] * $VHeight))) . '" r="4" style="fill:#974d57"/>'; } //Prices $Output .= '<path d="'; for ($x = 0; $x < $DR['Deals']; $x++) { $Output .= ($x == 0 ? 'M' : 'L') . ($LMarg + $x * $HSpacing) . ',' . ($TMarg + ($VHeight - (int) ($DPrcs[$x] / $DR['MaxVal'] * $VHeight))) . ' '; } $Output .= '" style="stroke: #448541; stroke-width: 2; fill: none;"/>'; for ($x = 0; $x < $DR['Deals']; $x++) { $Output .= '<circle cx="' . ($LMarg + $x * $HSpacing) . '" cy="' . ($TMarg + ($VHeight - (int) ($DPrcs[$x] / $DR['MaxVal'] * $VHeight))) . '" r="4" style="fill:#448541"/>'; } //Savings $Output .= '<path d="'; for ($x = 0; $x < $DR['Deals']; $x++) { $Output .= ($x == 0 ? 'M' : 'L') . ($LMarg + $x * $HSpacing) . ',' . ($TMarg + ($VHeight - (int) (($DVals[$x] - $DPrcs[$x]) / $DR['MaxVal'] * $VHeight))) . ' '; } $Output .= '" style="stroke: #0000FF; stroke-width: 2; fill: none;"/>'; for ($x = 0; $x < $DR['Deals']; $x++) { $Output .= '<circle cx="' . ($LMarg + $x * $HSpacing) . '" cy="' . ($TMarg + ($VHeight - (int) (($DVals[$x] - $DPrcs[$x]) / $DR['MaxVal'] * $VHeight))) . '" r="4" style="fill:#0000FF"/>'; //$Output .= '<text x="'.($LMarg+3+($x*$HSpacing)).'" y="'.(($TMarg+($VHeight-((int)(($DVals[$x] - $DPrcs[$x]) / $DR['MaxVal'] * $VHeight))))-5).'" style="font-family: Arial; font-size:10px; fill: #0000FF;">'.(int)($DPrcs[$x] / $DVals[$x] * 100).'%</text>'; } //Tables for ($x = 0; $x < $DR['Deals']; $x++) { if ($x % 2 != 0) { $Output .= '<rect x="0" y="' . ($TMarg + $VHeight + 25 + $x * 20) . '" width="400" height="20" style="stroke-width: 0; fill: #F0F0F0;" />'; } } $Output .= '<rect x="0" y="' . ($TMarg + $VHeight + 20) . '" rx="10" ry="10" width="400" height="' . (($DR['Deals'] + 1) * 20 + 20) . '" style="stroke: #C0C0C0; fill: none;" />'; for ($x = 0; $x < $DR['Deals']; $x++) { if ((int) $DPrcs[$x] == $LPrc) { $Output .= '<rect x="298" y="' . ($TMarg + $VHeight + 25 + $x * 20) . '" rx="5" ry="5" width="40" height="20" style="stroke: #009900; stroke-width: 1; fill: none;" />'; } if ((int) $DVals[$x] - (int) $DPrcs[$x] == $MSav) { $Output .= '<rect x="248" y="' . ($TMarg + $VHeight + 25 + $x * 20) . '" rx="5" ry="5" width="40" height="20" style="stroke: #009900; stroke-width: 1; fill: none;" />'; } if ((int) (100 - $DPrcs[$x] / $DVals[$x] * 100) == $MSvP) { $Output .= '<rect x="348" y="' . ($TMarg + $VHeight + 25 + $x * 20) . '" rx="5" ry="5" width="40" height="20" style="stroke: #009900; stroke-width: 1; fill: none;" />'; } $Output .= '<text x="0" y="' . ($TMarg + $VHeight + 40 + $x * 20) . '" style="font-family: Arial; font-size:12px;">'; $Output .= '<tspan x="5" style="font-weight: bold;">' . ($x + 1) . '.</tspan>'; $Output .= '<tspan x="22">' . date('Y.m.d', $DEnds[$x]) . '</tspan>'; $Output .= '<tspan x="90">' . $SNams[$x] . '</tspan>'; $Output .= '<tspan x="200" style="fill: #974d57">' . $DVals[$x] . '</tspan>'; $Output .= '<tspan x="240">-</tspan>'; $Output .= '<tspan x="250" style="fill: #0000FF">' . ($DVals[$x] - $DPrcs[$x]) . '</tspan>'; $Output .= '<tspan x="290">=</tspan>'; $Output .= '<tspan x="300" style="fill: #448541">' . $DPrcs[$x] . '</tspan>'; $Output .= '<tspan x="350" style="fill: #0000FF">(' . (int) (100 - $DPrcs[$x] / $DVals[$x] * 100) . '%)</tspan>'; $Output .= '</text>'; } $Output .= '<line x1="0" y1="' . ($TMarg + $VHeight + 20 + ($DR['Deals'] * 20 + 10)) . '" x2="400" y2="' . ($TMarg + $VHeight + 20 + ($DR['Deals'] * 20 + 10)) . '" style="stroke: #C0C0C0;" />'; $Output .= '<text x="0" y="' . ($TMarg + $VHeight + 20 + ($DR['Deals'] * 20 + 10) + 20) . '" style="font-family: Arial; font-size:12px; font-weight: bold;">'; $Output .= '<tspan x="20" style="font-weight: bold;">=</tspan>'; $Output .= '<tspan x="200" style="fill: #974d57">' . (int) $DR['AvgVal'] . '</tspan>'; $Output .= '<tspan x="240">-</tspan>'; $Output .= '<tspan x="250" style="fill: #0000FF">' . ((int) $DR['AvgVal'] - (int) $DR['AvgPrc']) . '</tspan>'; $Output .= '<tspan x="290">=</tspan>'; $Output .= '<tspan x="300" style="fill: #448541">' . (int) $DR['AvgPrc'] . '</tspan>'; $Output .= '<tspan x="350" style="fill: #0000FF">(' . (int) (100 - (int) $DR['AvgPrc'] / (int) $DR['AvgVal'] * 100) . '%)</tspan>'; $Output .= '</text>'; $Output .= '<image width="11" height="12" x="5" y="' . ($TMarg + $VHeight + 20 + ($DR['Deals'] * 20 + 10) + 8) . '" xlink:href="/IF/Avg.png" />'; $Output .= '</svg>'; $File = fopen($Filepath . $Filename, 'x'); if ($File === false) { return SysLogIt('Error opening history graph for output.', StatusError); } fwrite($File, $Output); fclose($File); if (file_exists($Filepath . $Filename)) { if (is_null($DR['HID'])) { if (!ExecCommand("INSERT INTO 2600_Store_History (StoreID, Filename, LastUpdated) VALUES (" . $SID . ", '" . Pacify($Filename) . "', " . date('YmdHis') . ");")) { return SysLogIt('Error adding history graph for store with ID of ' . $SID . '. File ' . $Filename . ' is orphaned.', StatusError, ActionInsert); } } else { if (!ExecCommand("UPDATE 2600_Store_History SET Filename = '" . Pacify($Filename) . "', LastUpdated = " . date('YmdHis') . " WHERE HistoryID = " . $DR['HID'] . ";")) { return SysLogIt('Error updating history graph for store with ID of ' . $SID . '. File ' . $Filename . ' is orphaned.', StatusError, ActionUpdate); } } SysLogIt('Created history graph for store with ID of ' . $SID . '.', StatusInfo); return $Filename; } SysLogIt('Could not find generated history file for store with ID of ' . $SID . '.', StatusError); unlink($Filepath . $Filename); } } else { return SysLogIt('Could not find deals for history.', StatusError, ActionSelect); } return false; }
function InsertNewString($SQL, $ID) { if (!ExecCommand($SQL)) { return SysLogIt('Error creating new string header.', StatusError, ActionInsert); } SysLogIt('Created new string header with ID of ' . $ID . '.', StatusInfo, ActionInsert); return $ID; }
function DisplayShareOptions() { global $UserID; global $Response; $Response->J = 'ClWin(); PopErr();'; if (isset($_POST['DID'])) { if (is_numeric($_POST['DID'])) { list($QR, $DR, $T) = QuerySingle("SELECT D.DealID\n FROM 4000_Deals D\n WHERE D.DealID = " . (int) $_POST['DID'] . ";"); if ($QR < 0) { SysLogIt('Error searching for deal information for sharing.', StatusError, ActionSelect); } elseif ($QR > 0) { if (isset($_POST['Name']) && isset($_POST['Adr']) && isset($_POST['Note'])) { if (trim($_POST['Name']) != '' && trim($_POST['Adr']) != '') { $Strings = GSA('1570,1571,1572,1573,1574,1575'); $Msg = trim($_POST['Name']) . ' ' . $Strings[1571] . ' http://www.dealplotter.com/?' . $DR['DealID']; if (trim($_POST['Note']) != '') { $Msg .= ' ' . $Strings[1572] . ' "' . Fix(trim($_POST['Note'])) . '"'; } $Msg .= PHP_EOL . PHP_EOL . $Strings[1573] . PHP_EOL . PHP_EOL . $Strings[1574]; if (SendMail($Msg, trim($_POST['Name']) . ' ' . $Strings[1575], trim($_POST['Adr']))) { $Note = 'NULL'; if (trim($_POST['Note']) != '') { $Note = "'" . Pacify(trim($_POST['Note'])) . "'"; } if (!ExecCommand("INSERT INTO 4300_Deal_Shares (DealID, UserID, ShareDate, ShareName, ShareAdr, ShareNote)\n VALUES (" . $DR['DealID'] . "," . $UserID . "," . date('YmdHis') . ",'" . Pacify(trim($_POST['Name'])) . "','" . Pacify(trim($_POST['Adr'])) . "'," . $Note . ");")) { SysLogIt('Error adding share details.', StatusError, ActionInsert); } $Response->S = true; $Response->J = 'PopC(\'' . Pacify(Pacify($Strings[1570]), true) . '\');'; } } else { $Response->J = "ClRep(getI('MailMsg'), 'dno', 'din');"; } } else { $UserFull = ''; if ($UserID > 0) { list($QR, $SDR, $T) = QuerySingle("SELECT U.UserName\n FROM 1000_Users U\n WHERE U.UserID = " . $UserID . ";"); if ($QR > 0) { $UserFull = $SDR['UserName']; } } $Strings = GSA('1560,1561,1562,1563,1564,1565,1566,1567,1568,1569,1576'); $Response->S = true; $Response->J = 'DoGP();'; $Response->R = ' <DIV CLASS="ttlw"><DIV>' . $Strings[1560] . '</DIV><HR></DIV> <DIV CLASS="abs mvb algc padbs"><HR> <DIV CLASS="din"> <DIV CLASS="fll pnt butt tsfb wht mgrrxs" onClick="PWin(\'http://www.facebook.com/share.php?u=http://www.dealplotter.com/?' . $DR['DealID'] . '\'); ClWin();"><DIV CLASS="padlm">' . $Strings[1561] . '</DIV></DIV> <DIV CLASS="fll pnt butt tstw wht" onClick="PWin(\'http://twitter.com/home?status=' . $Strings[1576] . ' http://www.dealplotter.com/?' . $DR['DealID'] . '\'); ClWin();"><DIV CLASS="padlm">' . $Strings[1562] . '</DIV></DIV> <DIV CLASS="gpb" ID="GPBS"><g:plusone annotation="none" href="http://www.dealplotter.com/?' . $DR['DealID'] . '"></g:plusone></DIV> </DIV> </DIV> <DIV CLASS="abs fullb flwa sz13"> <DIV CLASS="algc padbs">' . $Strings[1569] . '</DIV> <DIV CLASS="errmsg mrgbxs dno" ID="MailMsg">' . $Strings[1568] . '</DIV> <DIV><DIV CLASS="label">' . $Strings[1565] . '</DIV><INPUT TYPE="text" ID="MailName" CLASS="w170" VALUE="' . Fix($UserFull) . '" MAXLENGTH=30></DIV> <DIV><DIV CLASS="label">' . $Strings[1566] . '</DIV><INPUT TYPE="text" ID="MailAdr" CLASS="w170" VALUE="" MAXLENGTH=30></DIV> <DIV><DIV CLASS="label">' . $Strings[1567] . '</DIV><TEXTAREA ID="MailNote" CLASS="w170 h40"></TEXTAREA></DIV> <DIV CLASS="algc padtxs"><INPUT TYPE="Button" ID="NewMailBut" CLASS="din butt padr padl pnt" onClick="ChkNewMail(this,' . $DR['DealID'] . ');" VALUE="' . $Strings[1563] . '"></DIV> <DIV CLASS="padtxs padbxs"><HR><INPUT TYPE="text" CLASS="w100p algc" VALUE="http://www.dealplotter.com/?' . $DR['DealID'] . '"></DIV> '; } } } } $Response->Send(); }
function FlushSession($UserID = 0) { /*///////////////////////////////////////////////////////////// Author: Plottery Created: v1.0.0 - 2010-12-09 Revisions: None Purpose: Delete sessions and cookies for user Returns: True if successful, or false */ ///////////////////////////////////////////////////////////// global $SessionID; setcookie('SKEY', '', time() - 3600); setcookie('LID', '', time() - 3600); if ($SessionID > 0) { if (!ExecCommand("DELETE FROM 0700_Sessions WHERE SessionID = " . (int) $SessionID . ";")) { return SysLogIt('Could not delete session with ID of ' . (int) $SessionID . '.', StatusError, ActionDelete); } } if ($UserID > 0) { if (!ExecCommand("DELETE FROM 0700_Sessions WHERE UserID = " . (int) $UserID . ";")) { return SysLogIt('Could not delete session(s) for user with ID of ' . (int) $UserID . '.', StatusError, ActionDelete); } } return true; }
$UserName = ''; $UserSort = 0; $UserFlags = 0; $SessionID = 0; $SessionCoords = array(); $LanguageID = 0; require_once './Code/Cookies.php'; require_once './Code/DB.php'; require_once './Code/Logging.php'; require_once './Code/Validator.php'; ReadCookies(); if (!empty($_GET)) { if (is_array($_GET)) { foreach ($_GET as $ID => $Value) { if (is_numeric($ID)) { OpenDB(); list($QR, $DR, $T) = QuerySingle("SELECT D.DealURL, DS.DealSourceRefCode\n FROM 4000_Deals D\n INNER JOIN 4100_Deal_Sources DS ON DS.DealSourceID = D.DealSourceID\n WHERE D.DealID = " . (int) $ID . ";"); if ($QR > 0) { if (!ExecCommand("INSERT INTO 4200_Deal_Clickthroughs (DealID, UserID, ClickDate) VALUES (" . (int) $ID . "," . $UserID . "," . date('YmdHis') . ");")) { SysLogIt('Error inserting clickthrough data.', StatusError, ActionInsert); } header('Location: ' . $DR['DealURL'] . $DR['DealSourceRefCode']); exit; } CloseDB(); break; } } } } header('Location: /index.php');