$id = get_isset($_GET['id']); $i_name = get_isset($i_name); $path = "../img/building/"; $i_img_tmp = $_FILES['i_img']['tmp_name']; $i_img = $_FILES['i_img']['name'] ? $_FILES['i_img']['name'] : ""; $i_img = str_replace(" ", "", $i_img); $date = $_FILES['i_img']['name'] ? date("Ymdhms") . "_" : ""; if ($i_img) { if (move_uploaded_file($i_img_tmp, $path . $date . $i_img)) { $get_img_old = get_img_old($id); if ($get_img_old) { unlink("../img/building/" . $get_img_old); } $data = "building_name = '{$i_name}',\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tbuilding_img = '{$date}{$i_img}'\n\n\t\t\t\t\t"; } } else { $data = "building_name = '{$i_name}'\n\t\t\t\t\t"; } update($data, $id); header('Location: building.php?page=list&did=2'); break; case 'delete': $id = get_isset($_GET['id']); $get_img_old = get_img_old($id); if ($get_img_old) { unlink("../img/building/" . $get_img_old); } delete($id); header('Location: building.php?page=list&did=3'); break; }
} //echo $data; //$update2 = "land_area = land_area + ".$i_luas.""; update_progres($data, $p_id); //update("lands", $update2,"land_id",$id); header("Location: progres.php?page=form_payment&did=2&id={$id}"); break; case 'delete': $id = get_isset($_GET['id']); delete($id); header('Location: progres.php?page=list&did=3'); break; case 'delete_progres': $id = get_isset($_GET['id']); $p_id = isset($_GET['p_id']) ? $_GET['p_id'] : null; $get_img_old = get_img_old($p_id); if ($get_img_old) { unlink("../img/progres/" . $get_img_old); } delete_progres($p_id); header("Location: progres.php?page=form_payment&did=2&id={$id}"); break; case 'send_email': $id = isset($_GET['id']) ? $_GET['id'] : null; $myquery = "select a.*, b.progres_persen \n\t\t\t\t\t\tfrom table_progres a\n\t\t\t\t\t\tjoin progress b on b.progres_id = a.progres_id\n\t\t\t\t\t\twhere a.table_id = '{$id}'\n\t\t\t\t\t\torder by table_progres_id\n\t\t\t\t\t\t"; $daftarprogres = mysql_query($myquery) or die(mysql_error()); $query = mysql_query("select a.*, b.tt_name, c.tb_name, d.building_name, e.*, f.user_name as nama_sales, f.user_phone as telp_sales\n\t\t\t\t\tfrom tables a\n\t\t\t\t\tjoin table_types b on b.tt_id = a.tt_id\n\t\t\t\t\t\t\t\t\tjoin table_blocks c on c.tb_id = b.tb_id\n\t\t\t\t\t\t\t\t\tjoin buildings d on d.building_id = c.building_id\n\t\t\t\t\t\t\t\t\tleft join payments e on e.table_id = a.table_id\n\t\t\t\t\t\t\t\t\tleft join users f on f.user_id = e.seller_id\n\t\t\t\t\twhere a.table_id = '{$id}'"); $row = mysql_fetch_array($query); $laporan = "Halo Sdr " . $row['buyer_name'] . ",<br><br>"; $laporan .= "Berikut kami laporkan progres pembangunan rumah Anda<br><br>"; $laporan .= "Perumahan : " . $row['building_name'] . "<br>";