foreach ($postlist as $variable) { if (substr($variable, 0, 3) == "Det") { $id = substr($variable, 3, 10); $fotoDet[$id] = $_POST[$variable]; } if (substr($variable, 0, 3) == "Ord") { $id = substr($variable, 3, 10); $fotoOrd[$id] = $_POST[$variable]; } if (substr($variable, 0, 3) == "Sch") { $id = substr($variable, 3, 10); $fotoSch[$id] = $_POST[$variable]; } } foreach ($fotoDet as $id => $value) { $foto = Foto::find_by_id($id); $foto->Detalii = $value; $foto->Ordin = $fotoOrd[$id]; $foto->Schita = $fotoSch[$id]; $foto->save(); } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ro" lang="ro"> <head> <title>Imobiliare - Modificare fotografii</title> <link type="text/css" href=".././themes/base/ui.all.css" rel="stylesheet" /> <link rel="stylesheet" type="text/css" href=".././styles/main.css" />
<?php require_once ".././include/initialize.php"; if (!$session->is_logged_in()) { redirect_to("login.php"); } //echo "Sterg foto ".$_GET['id']; $foto = Foto::find_by_id($_GET['id']); $idOferte = $_GET['of']; $apid = $foto->idApartament; $done = $foto->destroy(); redirect_to("foto_update2.php?id=" . $apid . "&idOferta=" . $idOferte);