Exemple #1
0
function ProcessNewMessage()
{
    /*/////////////////////////////////////////////////////////////
           Author: Plottery Corp.
          Created: v1.0.0 - 2010-12-14
        Revisions: None
          Purpose: Sends a new message
          Returns: Nothing
      */
    /////////////////////////////////////////////////////////////
    global $LanguageID;
    global $UserID;
    $Strings = GSA('1604,1614');
    if (isset($_POST['MsgF']) && isset($_POST['MsgS']) && isset($_POST['MsgM']) && isset($_POST['MsgE'])) {
        if (strlen(trim($_POST['MsgM'])) < 0) {
            ReturnResponse(false, Pacify($Strings[1604]), 'errmsg nomrgb mrgts din', "Foc('MsgM');", 'CtcMsg');
        }
        if (is_numeric($_POST['MsgF']) && is_numeric($_POST['MsgS'])) {
            $From = $_POST['MsgE'];
            if ($UserID > 0) {
                $From .= ' (User ' . $UserID . ')';
            }
            if (SaveMessage(MessageUser, $From, GS((int) $_POST['MsgF']) . ':' . GS((int) $_POST['MsgS']), $_POST['MsgM'])) {
                SendMail('User ' . $UserID . PHP_EOL . PHP_EOL . Fix($_POST['MsgM']), Fix(GS((int) $_POST['MsgF']) . ':' . GS((int) $_POST['MsgS'])), '*****@*****.**', Fix($_POST['MsgE']));
                ReturnResponse(true, '', '', 'PopC(\'' . Pacify(Pacify($Strings[1614]), true) . '\');');
            }
        }
    }
    ReturnResponse(false, '', '', "PopErr();");
}
Exemple #2
0
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();
}