Exemplo n.º 1
0
/**
 *
 * @param resource $conn        	
 * @param string $tabla        	
 * @param string $param        	
 * @param string $SQLserverNameBack        	
 * @return array
 */
function borrar($conn, $tabla, $where, $SQLserverName)
{
    global $respError;
    $resultadoDelete = queryDelete($conn, $tabla, $where, $SQLserverName);
    if (is_array($resultadoDelete)) {
        $resultadoOperacion = array("codigoResultadoOperacion" => $resultadoDelete[0]["code"], "mensajeResultadoOperacion" => $resultadoDelete[0]["message"]);
        return array(__FUNCTION__ . "Result" => array("columnasAfectadas" => 0, "resultadoOperacion" => $resultadoOperacion));
    }
    return array(__FUNCTION__ . "Result" => array("columnasAfectadas" => $resultadoDelete, "resultadoOperacion" => $respError->sinErrores()));
}
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1">

        <link rel="shortcut icon" href="../img/SIM/ico.png">
        <link rel="stylesheet" href="../css/reset.css">
        <link rel="stylesheet" href="../css/AdminUtama/style.css">
        <link rel="stylesheet" href="../css/AdminUtama/sidebar.css">
        <link rel="stylesheet" href="../css/AdminUtama/aturBeritaMasjid.css">
    </head>
    <body>
        <?php 
if (isset($_GET['delete'])) {
    if ($_GET['delete'] == 'true') {
        $b = queryDelete('berita_masjid', 'id_berita_masjid=' . $_GET['berita_id']);
        header('location:http://localhost/SIMasjid/view/AdminUtama/aturBeritaMasjid.php');
    }
}
?>
        <div class="wrapper">
            <div class="col-full">
                <div class="header row">

                </div>
                <div class="content row">
                    <div class="side box span-1-8">

                    </div>
                    <div class="box span-10-3">
                        <div class="kotak-tengah box span-12">
         }
     }
 }
 $updateFotoGaleri = null;
 if (isset($_POST['judulGaleri'])) {
     $judulGaleri = $_POST['judulGaleri'];
     $idGaleri = $_POST['idGaleri'];
     for ($j = 0; $j < count($judulGaleri); $j++) {
         $updateFotoGaleri = queryUpdate('galeri', 'judul_foto="' . $judulGaleri[$j] . '"', 'id_foto=' . $idGaleri[$j]);
     }
 }
 if (isset($_POST['hapusGaleri'])) {
     $hapusGaleri = $_POST['hapusGaleri'];
     $nHapusGaleri = count($hapusGaleri);
     for ($i = 0; $i < $nHapusGaleri; $i++) {
         queryDelete('galeri', "id_foto='" . $hapusGaleri[$i] . "'");
     }
 }
 if ($insertGallery = true && ($updateFotoGaleri = true)) {
     header('location:http://localhost/SIMasjid/view/AdminMasjid/galeri.php?status=true');
 } else {
     if ($insertGallery = true && ($updateFotoGaleri = null)) {
         header('location:http://localhost/SIMasjid/view/AdminMasjid/galeri.php?status=true');
     } else {
         if ($insertGallery = null && ($updateFotoGaleri = true)) {
             header('location:http://localhost/SIMasjid/view/AdminMasjid/galeri.php?status=true');
         } else {
             if ($insertGallery = null && ($updateFotoGaleri = null)) {
                 header('location:http://localhost/SIMasjid/view/AdminMasjid/galeri.php?status=false');
             }
         }
<?php

session_start();
require_once '../../connectDB.php';
if (isset($_POST['adminutama_hapussent_submit'])) {
    if (count($_SESSION['pesanSentAU']) > 0) {
        if (isset($_POST['msg']) > 0) {
            $msglist = $_POST['msg'];
            for ($i = 0; $i < count($msglist); $i++) {
                queryDelete('pesan', 'id_pesan=' . $msglist[$i]);
                echo $msglist[$i];
            }
            header('location:http://localhost/SIMasjid/view/AdminUtama/sent.php?status=true');
        }
    } else {
        header('location:http://localhost/SIMasjid/view/AdminUtama/sent.php?status=false');
    }
}
            $urlFile = split('http://localhost/SIMasjid/', $temp2);
            echo 'url =' . $urlFile[1];
            unlink("../../../" . $urlFile[1]);
            queryDelete("file", "id_file=" . $listHapusFile[$i]);
        }
    }
    $deleteKegiatanRutin = queryDelete('kegiatan_rutin', 'id_masjid=' . $id_masjid);
    if (isset($_POST['kegiatanRutin']) && isset($_POST['hari']) && isset($_POST['jamAwal']) && isset($_POST['jamAkhir'])) {
        $kegiatanRutin = $_POST['kegiatanRutin'];
        $hari = $_POST['hari'];
        $jamAwal = $_POST['jamAwal'];
        $jamAkhir = $_POST['jamAkhir'];
        for ($i = 0; $i < count($kegiatanRutin); $i++) {
            $insertKegiatanRutin = queryInsert('kegiatan_rutin (id_masjid, nama, hari, jam_mulai, jam_selesai)', $id_masjid . ',"' . $kegiatanRutin[$i] . '","' . $hari[$i] . '","' . $jamAwal[$i] . '","' . $jamAkhir[$i] . '"');
        }
    }
    $deleteAngkot = queryDelete('rute_angkot', 'id_masjid=' . $id_masjid);
    if (isset($_POST['angkot']) && isset($_POST['jalan'])) {
        $angkot = $_POST['angkot'];
        $jalan = $_POST['jalan'];
        for ($i = 0; $i < count($angkot); $i++) {
            $insertAngkot = queryInsert('rute_angkot (id_masjid, nama_jalan, id_angkot)', $id_masjid . ',"' . $jalan[$i] . '",' . $angkot[$i] . '');
        }
    }
    $update_masjid = queryUpdate('masjid', 'id_wilayah=' . $wilayah . ', foto="' . $foto . '", nama_masjid="' . $nama_masjid . '", alamat="' . $alamat . '", rt="' . $rt . '", rw="' . $rw . '", kecamatan="' . $kecamatan . '", no_telepon="' . $no_tp . '", email="' . $email . '", peresmian_bangunan="' . $tanggalPeresmian . '", luas_tanah="' . $luasTanah . '", luas_bangunan="' . $luasBangunan . '", daya_tampung_dalam_masjid="' . $dayaTampungDalam . '", daya_tampung_luar_masjid="' . $dayaTampungLuar . '", deskripsi_masjid="' . $deskripsi . '", keunikan="' . $keunikan . '", latitude="' . $latitude . '", longitude="' . $longitude . '", struktur_organisasi="' . $struktur . '"', 'id_masjid= "' . $id_masjid . '"');
    if ($update_masjid) {
        header('location:http://localhost/SIMasjid/view/AdminUtama/isiAturDataMasjid.php?ubah=true&id_user='******'&id_masjid=' . $id_masjid . '&status=true');
    }
} else {
    header('location:http://localhost/SIMasjid/view/AdminUtama/isiAturDataMasjid.php?ubah=true&id_user='******'id_user'] . '&id_masjid=' . $_REQUEST['id_masjid'] . '&status=false');
}
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1">

        <link rel="shortcut icon" href="../img/SIM/ico.png">
        <link rel="stylesheet" href="../css/reset.css">
        <link rel="stylesheet" href="../css/AdminUtama/style.css">
        <link rel="stylesheet" href="../css/AdminUtama/sidebar.css">
        <link rel="stylesheet" href="../css/AdminUtama/aturVideoInformasiMasjid.css">
    </head>
    <body>
        <?php 
if (isset($_GET['delete'])) {
    if ($_GET['delete'] == 'true') {
        $b = queryDelete('video_informasi_masjid', 'id_video_masjid=' . $_GET['id_video_masjid']);
        header('location:http://localhost/SIMasjid/view/AdminUtama/aturVideoInformasiMasjid.php');
    }
}
?>
        <div class="wrapper">
            <div class="col-full">
                <div class="header row">

                </div>
                <div class="content row">
                    <div class="side box span-1-8">

                    </div>
                    <div class="box span-10-3">
                        <div class="kotak-tengah box span-12">
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1">

        <link rel="shortcut icon" href="../img/SIM/ico.png">
        <link rel="stylesheet" href="../css/reset.css">
        <link rel="stylesheet" href="../css/AdminUtama/style.css">
        <link rel="stylesheet" href="../css/AdminUtama/sidebar.css">
        <link rel="stylesheet" href="../css/AdminUtama/aturVideoCeramah.css">
    </head>
    <body>
        <?php 
if (isset($_GET['delete'])) {
    if ($_GET['delete'] == 'true') {
        $b = queryDelete('video_ceramah', 'id_video_ceramah=' . $_GET['id_video_ceramah']);
        header('location:http://localhost/SIMasjid/view/AdminUtama/aturVideoCeramah.php');
    }
}
?>
        <div class="wrapper">
            <div class="col-full">
                <div class="header row">

                </div>
                <div class="content row">
                    <div class="side box span-1-8">

                    </div>
                    <div class="box span-10-3">
                        <div class="kotak-tengah box span-12">
    <body>
        <?php 
if (isset($_GET['delete'])) {
    if ($_GET['delete'] == 'true') {
        $tempData = querySelect('*', 'masjid', 'id_masjid=' . $_GET['masjid_id'], null);
        $temp2 = $tempData[0]['foto'];
        $urlFoto = split('http://localhost/SIMasjid/View/', $temp2);
        unlink("../" . $urlFoto[1]);
        $tempFile = querySelect('*', 'file', 'id_masjid=' . $_GET['masjid_id'], null);
        for ($i = 0; $i < count($tempFile); $i++) {
            $temp2 = $tempFile[$i]['lokasi_file'];
            $urlFile = split('http://localhost/SIMasjid/View/', $temp2);
            unlink("../" . $urlFile[1]);
        }
        $b = queryDelete('user', 'id_user='******'id_user']);
        $c = queryDelete('masjid', 'id_masjid=' . $_GET['masjid_id']);
        header('location:http://localhost/SIMasjid/view/AdminUtama/aturDataMasjid.php');
    }
}
?>
        <div class="wrapper">
            <div class="col-full">
                <div class="header row">

                </div>
                <div class="content row">
                    <div class="side box span-1-8">

                    </div>
                    <div class="box span-10-3">
                        <div class="kotak-tengah box span-12">
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1">

        <link rel="shortcut icon" href="../img/SIM/ico.png">
        <link rel="stylesheet" href="../css/reset.css">
        <link rel="stylesheet" href="../css/AdminUtama/style.css">
        <link rel="stylesheet" href="../css/AdminUtama/sidebar.css">
        <link rel="stylesheet" href="../css/AdminUtama/aturBeritaUmum.css">
    </head>
    <body>
        <?php 
if (isset($_GET['delete'])) {
    if ($_GET['delete'] == 'true') {
        $b = queryDelete('berita_umum', 'id_berita_umum=' . $_GET['id_berita_umum']);
        header('location:http://localhost/SIMasjid/view/AdminUtama/aturBeritaUmum.php');
    }
}
?>
        <div class="wrapper">
            <div class="col-full">
                <div class="header row">

                </div>
                <div class="content row">
                    <div class="side box span-1-8">

                    </div>
                    <div class="box span-10-3">
                        <div class="kotak-tengah box span-12">
Exemplo n.º 10
0
Arquivo: query.php Projeto: shupa/SDMX
//}
if (isset($_GET['method'])) {
    if ($_GET['method'] == 'create' && isset($_GET['name']) && isset($_GET['query0'])) {
        queryCreate();
    } elseif ($_GET['method'] == 'save' && isset($_GET['name']) && isset($_GET['options']) && isset($_GET['filename'])) {
        //querySave($_GET['filename']);
    } elseif ($_GET['method'] == 'list') {
        queryList();
    } elseif ($_GET['method'] == 'shorten' && isset($_GET['uri'])) {
        queryShorten($_GET['uri']);
    } elseif ($_GET['method'] == 'download') {
        queryDownload($_GET['filetype']);
    } elseif ($_GET['method'] == 'get' && isset($_GET['filename'])) {
        queryGet($_GET['filename']);
    } elseif ($_GET['method'] == 'delete' && isset($_GET['filename'])) {
        queryDelete($_GET['filename']);
    } else {
        sendResponse(400, 'method parameters not valid');
    }
} else {
    //echo 'Function not Found';
    sendResponse(400, 'Function not Found');
}
// Helper method to get a string description for an HTTP status code
// From http://www.gen-x-design.com/archives/create-a-rest-api-with-php/
function getStatusCodeMessage($status)
{
    // these could be stored in a .ini file and loaded
    // via parse_ini_file()... however, this will suffice
    // for an example
    $codes = array(100 => 'Continue', 101 => 'Switching Protocols', 200 => 'OK', 201 => 'Created', 202 => 'Accepted', 203 => 'Non-Authoritative Information', 204 => 'No Content', 205 => 'Reset Content', 206 => 'Partial Content', 300 => 'Multiple Choices', 301 => 'Moved Permanently', 302 => 'Found', 303 => 'See Other', 304 => 'Not Modified', 305 => 'Use Proxy', 306 => '(Unused)', 307 => 'Temporary Redirect', 400 => 'Bad Request', 401 => 'Unauthorized', 402 => 'Payment Required', 403 => 'Forbidden', 404 => 'Not Found', 405 => 'Method Not Allowed', 406 => 'Not Acceptable', 407 => 'Proxy Authentication Required', 408 => 'Request Timeout', 409 => 'Conflict', 410 => 'Gone', 411 => 'Length Required', 412 => 'Precondition Failed', 413 => 'Request Entity Too Large', 414 => 'Request-URI Too Long', 415 => 'Unsupported Media Type', 416 => 'Requested Range Not Satisfiable', 417 => 'Expectation Failed', 500 => 'Internal Server Error', 501 => 'Not Implemented', 502 => 'Bad Gateway', 503 => 'Service Unavailable', 504 => 'Gateway Timeout', 505 => 'HTTP Version Not Supported');
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1">

        <link rel="shortcut icon" href="../img/SIM/ico.png">
        <link rel="stylesheet" href="../css/reset.css">
        <link rel="stylesheet" href="../css/AdminUtama/style.css">
        <link rel="stylesheet" href="../css/AdminUtama/sidebar.css">
        <link rel="stylesheet" href="../css/AdminUtama/aturVideoMusik.css">
    </head>
    <body>
        <?php 
if (isset($_GET['delete'])) {
    if ($_GET['delete'] == 'true') {
        $b = queryDelete('video_musik', 'id_video_musik=' . $_GET['id_video_musik']);
        header('location:http://localhost/SIMasjid/view/AdminUtama/aturVideoMusik.php');
    }
}
?>
        <div class="wrapper">
            <div class="col-full">
                <div class="header row">

                </div>
                <div class="content row">
                    <div class="side box span-1-8">

                    </div>
                    <div class="box span-10-3">
                        <div class="kotak-tengah box span-12">