示例#1
0
function excluirWS()
{
    global $id, $esquemaadmin;
    try {
        include "conexao.php";
        $sql = "DELETE from " . $esquemaadmin . "i3geoadmin_ws WHERE id_ws = {$id}";
        $dbhw->query($sql);
        i3GeoAdminInsertLog($dbhw, $sql);
        $dbhw = null;
        $dbh = null;
        return "ok";
    } catch (PDOException $e) {
        return "Error!: ";
    }
}
示例#2
0
function excluir($id_tema, $id_grupo, $dbhw)
{
    global $esquemaadmin;
    try {
        $sql = "DELETE from " . $esquemaadmin . "i3geousr_grupotema where id_tema = ? and id_grupo = ? ";
        $prep = $dbhw->prepare($sql);
        $prep->execute(array($id_tema, $id_grupo));
        i3GeoAdminInsertLog($dbhw, $sql, array($id_tema, $id_grupo));
        return true;
    } catch (PDOException $e) {
        return false;
    }
}
示例#3
0
function excluirGrupoUsrTema()
{
    global $id_tema, $id_grupo, $locaplic, $esquemaadmin;
    include $locaplic . "/admin/php/conexao.php";
    $sql = "DELETE from " . $esquemaadmin . "i3geousr_grupotema where id_tema = ? and id_grupo = ? ";
    $prep = $dbhw->prepare($sql);
    $prep->execute(array($id_tema, $id_grupo));
    i3GeoAdminInsertLog($dbhw, $sql, array($id_tema, $id_grupo));
    return "ok";
}
示例#4
0
function i3GeoAdminOrdena($pdo, $ordem, $tabela, $colunaid)
{
    global $esquemaadmin;
    $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    $arr = array();
    $n = count($ordem) + 1;
    for ($i = 1; $i < $n; $i++) {
        $arr[$ordem[$i - 1]] = $i;
    }
    $str_ids = implode(',', array_keys($arr));
    $str_when_then = "";
    foreach ($arr as $id => $ordem) {
        $str_when_then .= sprintf(" WHEN " . $colunaid . " = %d THEN %s ", $id, $ordem);
    }
    //whitespace + appends included in example for readability
    $template = "UPDATE '" . $esquemaadmin . $tabela . "' " . "   SET 'ordem' = CASE " . "     %s " . "   END " . " WHERE " . $colunaid . " IN (%s);";
    $sql = sprintf($template, $str_when_then, $str_ids);
    try {
        $resultado = $pdo->query($sql);
    } catch (PDOException $e) {
        return false;
    }
    i3GeoAdminInsertLog($pdo, $sql, array());
    return true;
}
示例#5
0
function excluirPapelUsuario()
{
    global $id_usuario, $id_papel;
    try {
        include dirname(__FILE__) . "/conexao.php";
        $sql = "DELETE FROM " . $esquemaadmin . "i3geousr_papelusuario WHERE id_usuario = {$id_usuario} AND id_papel = {$id_papel} ";
        $dbhw->query($sql);
        i3GeoAdminInsertLog($dbhw, $sql);
        $dbhw = null;
        $dbh = null;
        return "ok";
    } catch (PDOException $e) {
        return "Error!: ";
    }
}
示例#6
0
function excluirPapelOperacao()
{
    global $id_operacao, $id_papel;
    try {
        include dirname(__FILE__) . "/conexao.php";
        $sql = "DELETE from " . $esquemaadmin . "i3geousr_operacoespapeis WHERE id_operacao = {$id_operacao} AND id_papel = {$id_papel}";
        $dbhw->query($sql);
        i3GeoAdminInsertLog($dbhw, $sql);
        $dbhw = null;
        $dbh = null;
        return "ok";
    } catch (PDOException $e) {
        return "Error!: ";
    }
}