if ($prev_model != $arr[0])
			{
				$prev_model = $arr[0];
				$query = "DELETE FROM products_plant WHERE products_model = '".$arr[0]."'";
				if (deleteFrom($query))
					if (mysql_affected_rows() > 0)
						echo "Sizes deleted for plant  = ".$arr[0].'<br />';
			}

			$query = "SELECT * FROM ".products_plant." WHERE products_model='".$arr[0]."' AND plant_maat='".$arr[3]."'";
			if (recordExists($query))
			{
				if ($arr[7] == 'DELETE') //Status
				{
					$query = "DELETE FROM products_plant WHERE products_model='".$arr[0]."' AND plant_maat = '".$arr[3]."'";
					if (deleteFrom($query)) echo "Record Delete for the plant = ".$arr[0]." AND plant_mmat = ".$arr[3]."<br />";
				}
				else
				{
					// Update the record
					$query = "UPDATE products_plant SET plant_sort='".$arr[1]."',plant_mc='".$arr[2]."',plant_description='".$arr[4]."',plant_price='".$arr[5]."',plant_vrij='".$arr[6]
						."' WHERE products_model='".$arr[0]."' AND plant_maat='".$arr[3]."'";
					if (updateRecord($query)) { echo "Record Updated for the plant ='".$arr[0]."' AND plant_maat=".$arr[3]."<br>"; }
				}
			}
			elseif ($arr[7] != 'DELETE')
			{
				$arr = array_slice($arr, 0, 7); //First 7 values;
				// Add new record
				$sql = "insert into products_plant (products_model, plant_sort, plant_mc, plant_maat, plant_description, plant_price, plant_vrij) values ('".implode("','", $arr)."')";
				mysql_query ($sql);
Exemple #2
0
<?php

include_once '../../config/config.php';
include_once $serverPath . 'utils/db_post.php';
if (!empty($_GET['faceBookID'])) {
    $table = "photos";
    $insert = "DELETE FROM " . getTableQuote($table) . " WHERE faceBookID=" . $_GET['faceBookID'] . ";";
    runInsert($insert);
}
if (!empty($_GET['carousel_image_id'])) {
    $table = "carousel_images";
    deleteFrom($table, $_GET['carousel_image_id']);
}
Exemple #3
0
<?php

include_once '../../config/config.php';
include_once $serverPath . 'utils/db/db_post.php';
if (!empty($_GET['id'])) {
    $table = "dungeon";
    deleteFrom($table, $_GET['id']);
}
Exemple #4
0
<?php

include_once '../config/config.php';
include_once $serverPath . 'utils/security/requireAdmin.php';
include_once $serverPath . 'utils/db/db_post.php';
include_once $serverPath . 'utils/db/db_get.php';
$_POST = json_decode(file_get_contents('php://input'), true);
if (!empty($_POST) && !empty($_POST['id']) && $_POST['id'] != $_SESSION['user']['id']) {
    $id = $_POST['id'];
    $table = "users";
    $user = findById($table, $id);
    if ($user['protected'] == '0') {
        deleteFrom($table, $id);
    }
}