예제 #1
0
 public static function delete($id)
 {
     global $db;
     $db->query("SELECT id FROM flat WHERE tenement_id={$id}");
     $rows = $db->fetchAll();
     foreach ($rows as $row) {
         Flat::delete($row['id']);
     }
     $db->query("DELETE FROM tenement WHERE id={$id}");
     Photo::deletePhotos(TENEMENT, $id);
 }
예제 #2
0
파일: flat.php 프로젝트: alex731/m12private
function delete() {	
	if (!isset($_SESSION['admin'])) {
		echo "Not admin";		
		//header("Location: /index.html");		
		exit();
	}
	$id = intval($_REQUEST['id']);
	Flat::delete($id);
	header("Location: ".$_SERVER['HTTP_REFERER']);		
}