function process($form_data)
{
    include "Helper.php";
    // pretty_print_array($form_data);
    $a = session_id();
    include "connect.php";
    $conn = init($_SESSION["permission_type"]);
    $result = array();
    if (isset($form_data["transportoffer---relation"])) {
        $result = deleteTransportOffer($form_data, $conn);
    } else {
        if (isset($form_data["user---relation"])) {
            $result = deleteUser($form_data, $conn);
        } else {
            if (isset($form_data["contract---relation"])) {
                $result = deleteContract($form_data, $conn);
            } else {
                if (isset($form_data["market---relation"])) {
                    $result = deleteMarket($form_data, $conn);
                } else {
                    if (isset($form_data["transportoffer---relation"])) {
                        $result = deleteTransportOffer($form_data, $conn);
                    } else {
                        if (isset($form_data["immigrants---relation"])) {
                            $result = deleteImigrants($form_data, $conn);
                        } else {
                            if (isset($form_data["product---relation"])) {
                                $result = deleteProduct($form_data, $conn);
                            } else {
                                if (isset($form_data["transportcompany---relation"])) {
                                    $result = deleteTransportCompany($form_data, $conn);
                                } else {
                                    if (isset($form_data["flavour---relation"])) {
                                        $result = deleteTaste($form_data, $conn);
                                    } else {
                                        if (isset($form_data["storagetype---relation"])) {
                                            $result = deleteStoragetype($form_data, $conn);
                                        } else {
                                            if (isset($form_data["country---relation"])) {
                                                $result = deleteCountry($form_data, $conn);
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    if ($result["error"] == "") {
        $returnedData = $conn->query($result["data"]);
    }
    if ($conn->connect_errno) {
        $result["error"] = $conn->connect_error;
    }
    $result["data"] = "";
    echo json_encode($result);
}
Пример #2
0
            <p> <select name="startCountry" >
                    <?php 
selectCountryDropbox();
?>
 
                </select> 
            </p>
            <input type="submit" value="Löschen">

            <?php 
if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST["startCountry"])) {
    $startCountry = filterfunktion($_POST["startCountry"]);
    if ($startCountry != "") {
        try {
            deleteCountry($startCountry);
        } catch (Exception $e) {
            echo "Fehler beim Datenbankzugriff. Bitte dem Administrator Bescheid geben.";
        }
    }
}
?>
        </form>

        <!-- ADD NEW COUNTRY -->
        <form onSubmit="return" action="<?php 
echo htmlspecialchars($_SERVER["PHP_SELF"]);
?>
" method="post">

            <h3>Land hinzufügen</h3>
function letsGetStarted()
{
    global $dbconn;
    $now_alternative = date('Y-m-d H:m:s');
    /*
    	$countriesToDelete = array(
     array('country'=>'Albania', 'id'=>'37623'),
     array('country'=>'Algeria', 'id'=>'37628'),
     array('country'=>'Austria', 'id'=>'35824'),
     array('country'=>'Belgium', 'id'=>'35850'),
     array('country'=>'Bosnia Herze', 'id'=>'37619'),
     array('country'=>'Bulgaria', 'id'=>'35907'),
     array('country'=>'Chile', 'id'=>'35922'),
     array('country'=>'Croatia', 'id'=>'35967'),
     array('country'=>'Cyprus', 'id'=>'35976'),
     array('country'=>'Czech Republic', 'id'=>'35988'),
     array('country'=>'Denmark', 'id'=>'35999'),
     array('country'=>'England', 'id'=>'36023'),
     array('country'=>'Europe UEFA', 'id'=>'35253'),
     array('country'=>'France', 'id'=>'36133'),
     array('country'=>'Germany', 'id'=>'36159'),
     array('country'=>'Greece', 'id'=>'36184'),
     array('country'=>'Hungary', 'id'=>'36204'),
     array('country'=>'Iran', 'id'=>'37640'),
     array('country'=>'Israel', 'id'=>'36304'),
     array('country'=>'Italy', 'id'=>'36317'),
     array('country'=>'Jordan', 'id'=>'37856'),
     array('country'=>'Kuwait', 'id'=>'37694'),
     array('country'=>'Malta', 'id'=>'37854'),
     array('country'=>'Moldova', 'id'=>'37657'),
     array('country'=>'Montenegro', 'id'=>'37950'),
     array('country'=>'Morocco', 'id'=>'37645'),
     array('country'=>'Netherlands', 'id'=>'36421'),
     array('country'=>'Northern Ireland', 'id'=>'36457'),
     array('country'=>'Oman', 'id'=>'37876'),
     array('country'=>'Poland', 'id'=>'36498'),
     array('country'=>'Portugal', 'id'=>'36509'),
     array('country'=>'Qatar', 'id'=>'37700'),
     array('country'=>'Romania', 'id'=>'36519'),
     array('country'=>'Russia', 'id'=>'36521'),
     array('country'=>'Saudia Arabia', 'id'=>'37652'),
     array('country'=>'Scotland', 'id'=>'36616'),
     array('country'=>'Slovakia', 'id'=>'36667'),
     array('country'=>'Slovenia', 'id'=>'36677'),
     array('country'=>'Spain', 'id'=>'36734'),
     array('country'=>'Switzerland', 'id'=>'36763'),
     array('country'=>'Tunisia', 'id'=>'37637'),
     array('country'=>'Turkey', 'id'=>'36774'),
     array('country'=>'UAE', 'id'=>'37708'),
     array('country'=>'Ukraine', 'id'=>'36798'),
     array('country'=>'Wales', 'id'=>'36840')
    );
    */
    foreach ($countriesToDelete as $country) {
        $leagues = getLeagues($country['id']);
        foreach ($leagues as $league) {
            $leagueID = $league['id'];
            $subleagues = getSubLeagues($leagueID);
            doDeleting($leagueID);
            if (count($subleagues) > 0) {
                foreach ($subleagues as $subleague) {
                    $subleague_id = $subleague['id'];
                    doDeleting($leagueID);
                }
            }
        }
        deleteCountry($country['id']);
    }
    vacuumDatabase();
    echo 'DELETED';
}