<?php

if ($this->is_id()) {
	//$delete_query = "DELETE FROM shirt WHERE shirt_id = " . $this->get_id() . ";";
	//$sql->execute_query($delete_query);

	//akiknek ez a shirt_id van beállítva, azoknál null-ra állítjuk
	$shirt_query = "SELECT uk_id FROM user_kid WHERE uk_shirt_size_ss_id = " . $this->get_id();
	$shirt_assoc_array = $sql->assoc_array($shirt_query);
	foreach ($shirt_assoc_array as $uk_id) {
		$sql->update_table('user_kid', array('uk_shirt_size_ss_id' => 'null'), array('uk_id' => $uk_id['uk_id']));
	}

	$sql->update_table('shirt', array('shirt_deleted' => 1), array('shirt_id' => $this->get_id()));

	log::register('delete_shirt', $this->get_id());
	header("Location: /admin/shirts");
}


?>