예제 #1
0
<?php

include_once "new_agency_control.php";
$controller = new agency_control();
$agency = $controller->getAgency($_GET["idAgency"]);
$agencyID = $_GET["id"];
$servername = "localhost";
$username = "******";
$password = "";
$dbname = "bolo_creator";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}
$sqlAgencyName = <<<SQL
        SELECT name
        FROM agencies
        WHERE id="{$agencyID}"
SQL;
$agencyName = $conn->query($sqlAgencyName);
$agencyName = $agencyName->fetch_assoc();
$sqlAgencyDelete = <<<SQL
        DELETE FROM agencies
        WHERE id = "{$agencyID}"
SQL;
$result = $conn->query($sqlAgencyDelete);
$sqlAgencyDeleteMeta = <<<SQL
        DELETE FROM wp_usermeta
        WHERE meta_key = agency AND meta_value = "{$agencyName}"
<?php
/**
 * Template Name: Agencies List Page
 *
 * @package Inkness
 */
 ?>
 <?php //page 1508?>
 <?php get_header();?>
 
 <?php
 include_once('new_agency_control.php');
     $control = new agency_control();
     $result = $control->get_agencies();
 ?>
 
 <script>
 //confirmation pop-up window
            function deleteJS(agencyID)
            {
                
                if(confirm("Are you sure you want to delete this Agency?"))
                {
                    jQuery.get("?page_id=1592&id=" + agencyID,function(){
                    location.reload();
                });
                }   
            }
</script>
 
<style>