Example #1
0
                            unlink($file);
                        }
                    }
                }
                // remove image from database
                $query2 = "delete from images where filename = '" . $line[filename] . "'";
                mysql_query($query2) or die("Could not delete.");
                $query2 = "delete from imagehits where filename = '" . $line[filename] . "'";
                mysql_query($query2) or die("Could not delete.");
                mysql_close($link);
                $msg = "This photo has been deleted.";
                $id = 1;
            }
        }
        $x =& $cp->add_node("msg");
        $x->set_data($msg);
        $x =& $cp->add_node("id");
        $x->set_data($id);
    }
}
$cp = new cpaint();
$cp->register('usersignup');
$cp->register('chkprofileupdate');
$cp->register('forgetpass');
$cp->register('u_deleteimage');
$cp->register('deleteimage');
$cp->register('reportimage');
$cp->register('imgstatus');
$cp->register('s_delete1image');
$cp->start();
$cp->return_data();
Example #2
0
$cp {CPAINT} - objeto CPAINT contendo os parâmetros da API CPAINT

As variáveis globais de cada função devem ser enviadas como prâmetros ao ser feita a requisição

Exemplo:

http://localhost/i3geo/classesphp/wscliente.php?funcao=listaRSSws&rss=http://localhost/i3geo/admin/xmlservicosws.php&g_sid=&cpaint_function=listaRSSws&cpaint_response_type=JSON
*/
include_once dirname(__FILE__) . "/sani_request.php";
$_GET = array_merge($_GET, $_POST);
include_once "lews/wms_functions.php";
include_once dirname(__FILE__) . "/../pacotes/cpaint/cpaint2.inc.php";
include_once "carrega_ext.php";
include dirname(__FILE__) . "/../ms_configura.php";
$cp = new cpaint();
$onlineresource = $_GET["onlineresource"];
$tipo = $_GET["tipo"];
$servico = $_GET["servico"];
$param = $_GET["param"];
$funcaows = $_GET["funcaows"];
$rss = $_GET["rss"];
//
//busca o getcapabilities de um wms
//
$funcao = $_GET["funcao"];
if ($funcao == "getcapabilities") {
    $cp->register('getcapabilities');
    $cp->start();
    $cp->return_data();
    exit;
Example #3
0
    // Set the path to aspell if you need to use it.
    define('ASPELL_BIN', '/usr/bin/aspell');
    require_once "pspell_comp.php";
}
// Create and configure a link to the pspell module.
$pspell_config = pspell_config_create("es");
//$pspell_config = pspell_new("en");
pspell_config_mode($pspell_config, PSPELL_FAST);
if ($usePersonalDict) {
    // Allows the use of a custom dictionary (Thanks to Dylan Thurston for this addition).
    //pspell_config_personal($pspell_config, $path_to_personal_dictionary);
}
$pspell_link = pspell_new_config($pspell_config);
require_once "cpaint/cpaint2.inc.php";
//AJAX library file
$cp = new cpaint();
$cp->register('showSuggestions');
$cp->register('spellCheck');
$cp->register('switchText');
$cp->register('addWord');
$cp->start();
$cp->return_data();
/*************************************************************
 * showSuggestions($word, $id)
 *
 * The showSuggestions function creates the list of up to 10
 * suggestions to return for the given misspelled word.
 *
 * $word - The misspelled word that was clicked on
 * $id - The id of the span containing the misspelled word.
 *
Example #4
0
include_once dirname(__FILE__) . "/../../classesphp/sani_request.php";
$_GET = array_merge($_GET, $_POST);
require_once dirname(__FILE__) . "/../../pacotes/cpaint/cpaint2.inc.php";
require_once dirname(__FILE__) . "/../../ms_configura.php";
include "../blacklist.php";
verificaBlFerramentas(basename(dirname(__FILE__)), $i3geoBlFerramentas, false);
require_once dirname(__FILE__) . "/../../pacotes/phpflickr/phpFlickr.php";
error_reporting(0);
$funcao = $_GET["funcao"];
$key = $_GET["key"];
$texto = $_GET["texto"];
$page = $_GET["page"];
$ret = $_GET["ret"];
$ai = $_GET["ai"];
$af = $_GET["af"];
$cp = new cpaint();
if ($funcao == "listafotosflickr") {
    $cp->register('listafotosflickr');
}
if ($funcao == "listafotospanoramio") {
    $cp->register('listafotospanoramio');
}
if ($funcao == "listafotoslocr") {
    $cp->register('listafotoslocr');
}
$cp->start();
$cp->return_data();
//$i3geo_proxy_server = "proxy.saude.gov";
function listafotosflickr()
{
    global $ret, $cp, $key, $texto, $ai, $af, $page;
Example #5
0
<?php

require_once 'cpaint/cpaint2.inc.php';
include 'config.php';
include PRJ_CLASS_PATH . 'tzn_generic.php';
include PRJ_CLASS_PATH . TZN_DB_CLASS;
include PRJ_CLASS_PATH . 'pkg_jobQueue.php';
$cp = new cpaint();
$cp->register('load_edit');
$cp->register('load_view');
$cp->start();
$cp->return_data();
function load_edit($id)
{
    global $cp;
    $objQueue = new Queue();
    $objQueue->setUid($id);
    if ($objQueue->load()) {
        $cp->set_data($objQueue->description);
    } else {
        $cp->set_data('item not found!');
    }
    return;
}
function load_view($id)
{
    global $cp;
    $objQueue = new Queue();
    $objQueue->setUid($id);
    if ($objQueue->load()) {
        $data = nl2br($objQueue->getBbs('description'));
Example #6
0
<?php

require_once 'capint/cpaint2.inc.php';
include 'config.php';
include PRJ_CLASS_PATH . 'tzn_generic.php';
include PRJ_CLASS_PATH . TZN_DB_CLASS;
include PRJ_CLASS_PATH . 'pkg_aat.php';
$cp = new cpaint();
$cp->set_name("list");
$cp->register('search_type');
$cp->start();
$cp->return_data();
function search_type($str)
{
    global $cp;
    $objTypeList = new Type();
    $objTypeList->addWhere("type LIKE '" . $str . "%'");
    $objTypeList->loadList();
    if ($objTypeList->rMore()) {
        while ($objType = $objTypeList->rNext()) {
            $cur =& $cp->add_node('type');
            $cur->set_data($objType->type);
        }
    }
    return;
}
Example #7
0
function cpjson($obj)
{
    if (ob_get_contents()) {
        ob_end_clean();
    }
    if (function_exists("json_encode")) {
        echojson(array2json($obj));
    } else {
        include_once dirname(__FILE__) . "/../pacotes/cpaint/cpaint2.inc.php";
        $cp = new cpaint();
        $cp->set_data($obj);
        $cp->return_data();
        exit;
    }
}
Example #8
0
        }
        $filename = explode("|", $chk);
        unset($filename[0]);
        $fid = "";
        foreach ($filename as $fn) {
            if ($fn != "") {
                $fid .= "|" . $fn;
                $sql = "update users set usergid={$s} where userid={$fn}";
                mysql_query($sql);
            }
        }
        $msg = "User Edited successfully.";
        $x =& $cp->add_node("response");
        $x->set_data($msg);
        $y =& $cp->add_node("fid");
        $y->set_data($fid);
        $z =& $cp->add_node("group");
        $z->set_data($group);
    }
}
$cp = new cpaint();
$cp->register('chkupdate');
$cp->register('delete');
$cp->register('deleteuser');
$cp->register('deletereport');
$cp->register('activateuser');
$cp->register('changeusergroup');
$cp->register('deleteftp');
$cp->register('ftpstatus');
$cp->start();
$cp->return_data();
<?php

/////////////////////////////////////////////////
## THIS IS AJAX BACK HAND SCRIPT FOR RATING CALCULATION
/////////////////////////////////////////////////
## My SMARTY INI
include "../include/config.php";
include "../include/function.php";
## My AJAX INI
require_once $config['BASE_DIR'] . "/ajax/cpaint2.inc.php";
$cp = new cpaint();
$cp->register('process_data');
$cp->register('process_comments');
$cp->register('process_Vote');
$cp->register('executeDB');
$cp->register('view_vote');
$cp->start();
$cp->return_data();
//##############################   DB EXEXUTION START  ####
function executeDB($sql)
{
    # INI
    global $cp;
    global $conn;
    $myFlag = "";
    ## Check sql
    if (!strstr($sql, 'select')) {
        if (!strstr($sql, 'SELECT')) {
            $myFlag = "2";
        } else {
            $myFlag = "1";
Example #10
0
<?php

include dirname(__FILE__) . "/../../ms_configura.php";
include dirname(__FILE__) . "/../blacklist.php";
verificaBlFerramentas(basename(dirname(__FILE__)), $i3geoBlFerramentas, false);
$usuarioGeonames = "i3geo";
//set_time_limit(600);
require_once dirname(__FILE__) . "/../../pacotes/cpaint/cpaint2.inc.php";
include_once dirname(__FILE__) . "/../../classesphp/sani_request.php";
$_GET = array_merge($_GET, $_POST);
$ret = $_GET["ret"];
require_once dirname(__FILE__) . "/../../classesphp/carrega_ext.php";
error_reporting(0);
$cp = new cpaint();
$cp->register('listaartigos');
$cp->start();
$cp->return_data();
function listaartigos()
{
    global $ret, $cp, $usuarioGeonames;
    $e = explode(" ", $ret);
    $url = "http://api.geonames.org/wikipediaBoundingBox?username="******"&style=full&north=" . $e[3] . "&south=" . $e[1] . "&east=" . $e[2] . "&west=" . $e[0] . "&maxRows=20";
    //echo $url;
    $xml = simplexml_load_file($url . "&lang=pt");
    $conta = 0;
    $fim = array();
    $resultado = "";
    foreach ($xml->entry as $e) {
        $r = $e->xpath('title');
        if (function_exists(mb_convert_encoding)) {
            $r = mb_convert_encoding($r[0], "HTML-ENTITIES", "auto");
<?php

/////////////////////////////////////////////////
## THIS IS AJAX BACK HAND SCRIPT FOR RATING CALCULATION
/////////////////////////////////////////////////
## My SMARTY INI
include "../include/config.php";
include "../include/function.php";
## My AJAX INI
require_once "cpaint2.inc.php";
$cp = new cpaint();
$cp->register('process_uservote');
$cp->start();
$cp->return_data();
// User Voting
function process_uservote($voter, $candate, $rate)
{
    global $cp;
    global $conn;
    $sql = "select count(*) as cnt from uservote where candate_id='{$candate}' and voter_id='{$voter}'";
    $res = $conn->execute($sql);
    $x = $res->fields[cnt];
    if ($x > 0) {
        // My flag
        $myMsg = 'f';
        $sql = "select rate from signup  where  UID='{$candate}'";
        $rs = $conn->execute($sql);
        $t = ceil($rs->fields[rate]);
        $cnt = floor($t / 2);
    } else {
        // My flag