function choose_step()
{
    global $_GET;
    extract($_GET);
    if (isset($id)) {
        require_lib("validate");
        $v =& new Validate();
        if (!$v->isOk($id, "num", 1, 9, "")) {
            return "<li class=err>Invalid site entry id</li>";
        }
    }
    $step = 1;
    switch ($step) {
        case "0":
            if (!isset($msg)) {
                $msg = "";
            }
            $OUTPUT = "{$msg}";
            break;
        case "1":
            $request = @file(urler(REPORTS_URL . "?" . sendhash()));
            if ($request == false) {
                $site_msg = "<li class=err>Connection to server failed. Check you internet connection and try again.</li>";
                return $site_msg;
            }
            $OUTPUT = implode("", $request);
            break;
    }
    return $OUTPUT;
}
function choose_step()
{
    global $_GET;
    extract($_GET);
    switch ($step) {
        case "0":
            if (!isset($msg)) {
                $msg = "";
            }
            $OUTPUT = "{$msg}";
            break;
        case "1":
            $OUTPUT = "\r\n\t\t<h3>General Message</h3>\r\n\t\t<form method=get action='" . SELF . "'>\r\n\t\t<input type=hidden name=step value='2'>\r\n\t\t<table cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "'>\r\n\t\t<tr>\r\n\t\t\t<th colspan=2>Message Details</th>\r\n\t\t</tr>\r\n\t\t<tr class='bg-odd'>\r\n\t\t\t<td>Cell Number:</td>\r\n\t\t\t<td><input name=cellnum type=text></td>\r\n\t\t</tr>\r\n\t\t<tr class='bg-even'>\r\n\t\t\t<td>Message</td>\r\n\t\t\t<td><textarea cols=25 rows=4 name=message></textarea></td>\r\n\t\t</tr>\r\n\t\t<tr>\r\n\t\t\t<td colspan=2 align=center><input type=submit value='Send'></td>\r\n\t\t</tr>\r\n\t\t</table>\r\n\t\t</form>";
            break;
        case "2":
            $message = str_replace("=", "|", base64_encode($message));
            $request = @file(urler(GENERALMSG_URL . "?cellnum={$cellnum}&message={$message}&" . sendhash()));
            if ($request == false) {
                return "<li class=err>Connection failed. Check your internet connection and try again.</li>";
            }
            $OUTPUT = implode("", $request);
            break;
    }
    return $OUTPUT;
}
function choose_step()
{
    global $_GET;
    extract($_GET);
    if (isset($id)) {
        require_lib("validate");
        $v =& new Validate();
        if (!$v->isOk($id, "num", 1, 9, "")) {
            return "<li class=err>Invalid site entry id</li>";
        }
    }
    $step = 1;
    switch ($step) {
        case "0":
            if (!isset($msg)) {
                $msg = "";
            }
            $OUTPUT = "{$msg}";
            break;
        case "1":
            $OUTPUT = "<script>document.location.href='" . urler(PURCHASE_URL . "?" . sendhash()) . "';</script>";
            break;
    }
    return $OUTPUT;
}
function choose_step()
{
    $request = @file(urler(READCREDITS_URL . "?" . sendhash()));
    if ($request == false) {
        return "<li class=err>Connection failed. Check your internet connection and try again.</li>";
    }
    $OUTPUT = implode("", $request);
    return $OUTPUT;
}
function search()
{
    global $_GET;
    extract($_GET);
    require_lib("validate");
    $v =& new Validate();
    $v->isOk($idnum, "string", 0, 100, "Invalid id / registration number.");
    if ($v->isError()) {
        $err = "";
        foreach ($v->getErrors() as $key => $value) {
            $err .= "<li class=err>{$value['msg']}</li>";
        }
        return enter($err);
    }
    // post the search request
    $search_request = @file(urler(BLACKLIST_SEARCH_URL . "?idnum={$idnum}&" . sendhash()));
    if ($search_request == false) {
        $site_msg = "<li class=err>Connection to server failed. Check you internet connection and try again.</li>";
    } else {
        $site_msg = "";
        $status = 0;
        // 0 = none, 1 = read message
        foreach ($search_request as $value) {
            $value = str_replace("\n", "", $value);
            switch ($value) {
                case "<DR_E>":
                    break;
                case "<DR_M>":
                    $status = 1;
                    break;
                case "</DR_M>":
                    $status = 0;
                    break;
                case "</DR_E>":
                    $status = 0;
                    break;
                default:
                    if ($status == 1) {
                        $site_msg .= "{$value}\n";
                    }
            }
        }
    }
    $OUTPUT = "\r\n\t<h3>Search Black / White List Registry</h3>";
    foreach ($_GET as $key => $value) {
        if ($key != "key") {
            $OUTPUT .= "<input type=hidden name='{$key}' value='{$value}'>";
        }
    }
    $OUTPUT .= "\r\n\t<table cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "'>\r\n\t<tr>\r\n\t\t<th>Data Returned</th>\r\n\t</tr>\r\n\t<tr class='bg-odd'>\r\n\t\t<td valign=top>{$site_msg}</td>\r\n\t</tr>\r\n\t</table>";
    return $OUTPUT;
}
#Developers, Software Vendors, Support, Accountants, Users
#
#
#The full software license can be found here:
#http://www.accounting-123.com/a.php?a=153/GPLv3
#
#
#
#
#
#
#
#
#
#
#
require "settings.php";
require "https_urlsettings.php";
db_conn_maint("cubit");
$sql = "SELECT * FROM version";
$rslt = db_exec($sql) or errDie("Error fetching version info.");
$version = pg_fetch_result($rslt, 0, 0);
// post the search request
$update_request = @file(urler(UPDATE_URL . "?version={$version}&" . sendhash()));
if ($update_request == false) {
    $site_msg = "<li class=err>Connection to server failed. Check you internet connection and try again.</li>";
} else {
    $site_msg = implode("<br>", $update_request);
}
$OUTPUT = "\r\n<h3>Cubit Update Download</h3>\r\n{$site_msg}";
require "template.php";
function submit()
{
    global $_GET;
    extract($_GET);
    require_lib("validate");
    $v =& new Validate();
    $v->isOk($idnum, "string", 0, 100, "Invalid id / registration number.");
    $v->isOk($name, "string", 0, 100, "Invalid tenant full name.");
    $v->isOk($surname, "string", 0, 100, "Invalid tenant surname.");
    $v->isOk($comment, "string", 0, 100, "Invalid tenant comment.");
    $v->isOk($personname, "string", 0, 100, "Invalid listing person name.");
    $v->isOk($persontel, "string", 0, 100, "Invalid listing person telephone number.");
    if (isset($paying)) {
        $v->isOk($paying, "string", 0, 100, "Invalid Paying quality selection.");
    }
    if (isset($person)) {
        $v->isOk($person, "string", 0, 100, "Invalid Person quality selection.");
    }
    if (isset($dobusiness)) {
        $v->isOk($dobusiness, "string", 0, 100, "Invalid 'Do Business' value.");
    }
    if (!isset($paying)) {
        $v->addError("", "Invalid Paying quality selection.");
    }
    if (!isset($person)) {
        $v->addError("", "Invalid Person quality selection.");
    }
    if (!isset($dobusiness)) {
        $v->addError("", "Invalid 'Do Business' value.");
    }
    if ($v->isError()) {
        $err = "";
        foreach ($v->getErrors() as $key => $value) {
            $err .= "<li class=err>{$value['msg']}</li>";
        }
        return enter($err);
    }
    $comment = str_replace("=", "|", base64_encode($comment));
    // post the search request
    $search_request = @file(urler(BLACKLIST_SUBMIT_URL . "?idnum={$idnum}&name={$name}&surname={$surname}&comment={$comment}&personname={$personname}&persontel={$persontel}&paying={$paying}&person={$person}&dobusiness={$dobusiness}&" . sendhash()));
    if ($search_request == false) {
        $site_msg = "<li class=err>Connection to server failed. Check you internet connection and try again.</li>";
    } else {
        $site_msg = "";
        $status = 0;
        // 0 = none, 1 = read message
        foreach ($search_request as $value) {
            $value = str_replace("\n", "", $value);
            switch (trim($value)) {
                case "<DR_E>":
                    break;
                case "<DR_M>":
                    $status = 1;
                    break;
                case "</DR_M>":
                    $status = 0;
                    break;
                case "</DR_E>":
                    $status = 0;
                    break;
                default:
                    if ($status == 1) {
                        $site_msg .= "{$value}\n";
                    }
            }
        }
        $site_msg = nl2br($site_msg);
    }
    $OUTPUT = "\r\n\t<h3>Create Black / White List Registry Entry</h3>";
    foreach ($_GET as $key => $value) {
        if ($key != "key") {
            $OUTPUT .= "<input type=hidden name='{$key}' value='{$value}'>";
        }
    }
    $OUTPUT .= "\r\n\t<table cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "'>\r\n\t<tr>\r\n\t\t<th>Data Returned</th>\r\n\t</tr>\r\n\t<tr class='bg-odd'>\r\n\t\t<td>{$site_msg}</td>\r\n\t</tr>\r\n\t</table>";
    return $OUTPUT;
}
Example #8
0
    $locate->base = $stripfile[0] . '/';
    array_shift($stripfile);
    if (strpos(end($stripfile), '.') !== false) {
        $locate->file = end($stripfile);
        array_pop($stripfile);
        $locate->url = implode('/', $stripfile) . '/';
    } else {
        $locate->file = null;
        $locate->url = implode('/', $stripfile);
    }
    return $locate;
}
$store = $memcache->get($settings->memcacheprefix . "page" . $pid);
if ($store === false || count($store[1]) < 1) {
    //parse and format the page url
    $locate = urler($url);
    //get the page data for scraping
    $curl = $locate->protocol . $locate->base . $locate->url . $locate->file . $locate->query;
    $_curl = curl_init();
    curl_setopt($_curl, CURLOPT_SSL_VERIFYHOST, 1);
    curl_setopt($_curl, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($_curl, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($_curl, CURLOPT_FOLLOWLOCATION, 1);
    //curl_setopt($_curl, CURLOPT_COOKIEJAR, $_SERVER["DOCUMENT_ROOT"].'/cookies/cookies.txt');
    if (strpos($locate->base, 'facebook.com') > -1) {
        curl_setopt($_curl, CURLOPT_FOLLOWLOCATION, 0);
    }
    curl_setopt($_curl, CURLOPT_URL, $curl);
    $html = curl_exec($_curl);
    $getagain = false;
    foreach ($settings->useragent_change as $needle) {
Example #9
0
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * 
 * michael@piquant.ie
 * Piquant Media
 * http://www.piquant.ie
 * */
/*
 * Submit a new page URL to imager
 * 
 * */
include 'connect.php';
require_once 'process.php';
$locater = new stdClass();
$locater->url = $_POST["url"];
$locater->image = htmlspecialchars($_POST["image"]);
$locater->title = htmlspecialchars($_POST["title"]);
$url = urler($locater->url);
$locater->url = $url->protocol . $url->base . $url->url . $url->file . $url->query;
$response = $imager->add($locater->url, $locater->image, $locater->title);
if ($settings->clearfrontonadd) {
    $memcache->delete($settings->memcacheprefix . "getall");
}
function send($_POST)
{
    extract($_POST);
    # validate input
    require_lib("validate");
    $v = new validate();
    $v->isOk($id, "num", 1, 9, "Invalid Query ID.");
    $v->isOk($to, "num", 1, 20, "Invalid cell no.");
    $v->isOk($text, "string", 1, 150, "Invalid sms text.");
    # display errors, if any
    if ($v->isError()) {
        $confirm = "";
        $errors = $v->getErrors();
        foreach ($errors as $e) {
            $confirm .= "<li class=err>" . $e["msg"];
        }
        return error($_POST, $confirm . "</li>");
    }
    db_conn('crm');
    $Sl = "SELECT * FROM tokens WHERE id='{$id}'";
    $Ry = db_exec($Sl) or errDie("Unable to get query data from db.");
    if (pg_numrows($Ry) < 1) {
        return "Invalid query.";
    }
    $time = date("H:i:s");
    $date = date("Y-m-d");
    $text_enc = base64_encode($text);
    $request = @file(urler(GENERALMSG_URL . "?cellnum={$to}&message={$text_enc}&" . sendhash()));
    if ($request == false) {
        return "<li class=err>Connection failed. Check your internet connection and try again.</li>";
    }
    db_conn('crm');
    $Sl = "INSERT INTO token_actions(token,action,donedate,donetime,doneby,donebyid)\r\n\tVALUES ('{$id}','Sent SMS','{$date}','{$time}','" . USER_NAME . "','" . USER_ID . "')";
    $Ry = db_exec($Sl) or errDie("Unable to insert record.");
    $OUTPUT .= "<script> window.opener.parent.mainframe.location.reload(); window.close(); </script>";
    return $OUTPUT;
    $out = "<table border=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "'>\r\n\t<tr><th>SMS Sent</th></tr>\r\n\t<tr class='bg-odd'><td>" . implode("", $request) . "</td></tr>\r\n\t</table>";
    return $out;
}