示例#1
0
function ProcessNameLocation()
{
    global $UserID;
    global $SessionID;
    global $SessionCoords;
    global $Response;
    if (!($UserID == 0 || ($SessionID = 0 || count($SessionCoords) == 0))) {
        list($OK, $Msgs) = ValidateForm(array(array(TypePOST, 'LName', MustExist, ValidateString, null, null, 0)));
        if ($OK) {
            if (ExecCommand("INSERT INTO 3000_Locations (LocationLatitude, LocationLongitude, CountryID) VALUES (" . $SessionCoords[0] . "," . $SessionCoords[1] . "," . (int) $SessionCoords[2] . ");")) {
                list($QR, $DR, $T) = QuerySingle("SELECT last_insert_id() AS ID;");
                if ($QR > 0) {
                    $LocationID = $DR['ID'];
                    if (ExecCommand("INSERT INTO 1100_User_Locations (UserID, LocationID, UserLocationName) VALUES (" . $UserID . "," . $LocationID . ",'" . Pacify(substr(trim($_POST['LName']), 0, 20), true) . "');")) {
                        $Response->S = true;
                        $Response->J = 'ClWin(); SetCLoc(' . $LocationID . '); GetData(); PopC(\'' . Pacify(Pacify('"' . substr(trim($_POST['LName']), 0, 20) . '" ' . GS(1365)), true) . '\');';
                        $Response->Send();
                        ExecCommand("UPDATE 0700_Sessions SET Latitude = NULL, Longitude = NULL, Country = 0 WHERE SessionID = " . $SessionID . ";");
                    } else {
                        SysLogIt('Error creating user location for location with ID of ' . $LocationID . '.', StatusError, ActionInsert);
                    }
                } else {
                    SysLogIt('Error retrieving ID of newly created location.', StatusError, ActionSelect);
                }
            } else {
                SysLogIt('Error creating location.', StatusError, ActionInsert);
            }
        }
    }
    $Response->Send();
}
示例#2
0
function GetTerms()
{
    global $Response;
    $Terms = file_get_contents('./Scripts/Terms.txt', true);
    $Response->R = '<DIV CLASS="ttlw">' . GS(1010) . '<HR></DIV><DIV CLASS="abs fulls fktbl flwa">' . StringAdjust($Terms, false, true) . '</DIV>';
    $Response->S = true;
    $Response->Send();
}
示例#3
0
function GetSources($LID = 1)
{
    /*/////////////////////////////////////////////////////////////
           Author: Plottery Corp.
          Created: v1.0.0 - 2011-01-17
        Revisions: None
          Purpose: Display category and type keywords
          Returns: Nothing
      */
    /////////////////////////////////////////////////////////////
    global $Response;
    if ($RandomKey = GetNewAccessKey()) {
        $Response->J = 'F5();';
        //Retrieve categories, types and keywords
        list($QR, $RS, $T) = QuerySet('SELECT * FROM 4100_Deal_Sources;');
        if ($QR < 0) {
            SysLogIt('Query returned an error.', StatusError, ActionSelect);
        } else {
            $Response->S = true;
            $Response->R = '<DIV CLASS="ttlw"><FORM onSubmit="SavSrc(); return false;"><INPUT TYPE="hidden" ID="Key" VALUE="' . $RandomKey . '"><INPUT TYPE="submit" CLASS="butt" VALUE="Save"><INPUT TYPE="button" CLASS="mrgl butt shwl rbrds mgrr" VALUE="New Source" onClick="AddSrc();"><SPAN CLASS="" ID="StrMsg"></SPAN><HR></DIV><DIV CLASS="abs fulls flwa"><TABLE CELLPADDING=2 CELLSPACING=0 BORDER=0 ID="SrcTbl"><TBODY>';
            if ($QR > 0) {
                while ($DR = mysql_fetch_array($RS)) {
                    $Response->R .= '<TR>
                               <TD><INPUT CLASS="w100" ID="D' . $DR['DealSourceID'] . '" VALUE="' . $DR['DealSourceName'] . '" onChange="Mark(this);"></TD>
                               <TD><INPUT CLASS="w300" ID="H' . $DR['DealSourceID'] . '" VALUE="' . $DR['DealSourceHomepage'] . '" onChange="Mark(this);"></TD>
                               <TD><INPUT CLASS="w100" ID="F' . $DR['DealSourceID'] . '" VALUE="' . $DR['DealSourceFileName'] . '" onChange="Mark(this);"></TD>
                               <TD><INPUT CLASS="w150" ID="R' . $DR['DealSourceID'] . '" VALUE="' . $DR['DealSourceRefCode'] . '" onChange="Mark(this);"></TD>
                               <TD><SELECT ID="S' . $DR['DealSourceID'] . '" CLASS="w100 mrgls" onChange="Mark(this);">';
                    for ($x = 0; $x < 2; $x++) {
                        $Response->R .= '<OPTION VALUE="' . $x . '"';
                        if ($x == $DR['DealSourceStatus']) {
                            $Response->R .= ' SELECTED';
                        }
                        $Response->R .= '>' . GS(1545 + $x) . '</OPTION>';
                    }
                    $Response->R .= '   </SELECT></TD>
                               <TD><INPUT CLASS="w80" ID="E' . $DR['DealSourceID'] . '" VALUE="' . $DR['DealSourceResetTime'] . '" onChange="Mark(this);"></TD>
                            </TR>';
                }
            }
            $Response->R .= '</TBODY></TABLE></FORM></DIV>';
            $Response->J = 'AddScr("/Scripts/Admin.js"); NewSrc = 0;';
        }
    }
    $Response->Send();
}
示例#4
0
文件: db.php 项目: sodemacom/ITG
 public function openVS()
 {
     $this->hst = GS('vshst');
     $this->usr = GS('vsusr');
     $this->pwd = GS('vspwd');
     $this->db = GS('vsdb');
     global $conn;
     if ($conn == null) {
         $this->con = @mysql_pconnect($this->hst, $this->usr, $this->pwd);
         $conn = $this->con;
         if (!$this->con) {
             $this->st = 0;
             die("{success:true, conn:0}");
         }
         $use = mysql_query("USE " . $this->db);
         if (!$use) {
             $this->st = -1;
         } else {
             $this->query("SET NAMES utf8");
             $this->query("SET collation_connection utf8_general_ci");
             $this->st = 1;
         }
     }
 }