session_start(); if ($_SESSION['login']!='Ok'){include('./login.php');} if ($_GET['delete']==true){ if (file_exists('./objecten/'.$_SESSION['nr'])){unlink('./objecten/'.$_SESSION['nr']);} if (file_exists('./objecten/'.$_SESSION['nr'].'-onderschriften')){unlink('./objecten/'.$_SESSION['nr'].'-onderschriften');} } $startdir='./objecten/'; $cat[0]='Beleggingen: bedrijfspanden'; $cat[1]='Beleggingen: winkels'; $cat[2]='Beleggingen: woningen'; $cat[3]='Te koop: bedrijfspanden'; $cat[4]='Te koop: winkels'; $cat[5]='Te koop: woningen'; $cat[6]='Te huur: bedrijfspanden'; $cat[7]='Te huur: winkels'; $cat[8]='Te huur: woningen'; $cat[9]='Transacties'; $sep=PHP_EOL; if ($_GET['id']!=''){ $nr=$_GET['id']; $_SESSION['nr']=$nr; if (file_exists($startdir.$nr) && is_file($startdir.$nr)){ $parts = file_get_contents($startdir.$nr); $parts = remove_eol($parts); $part=explode(PHP_EOL,$parts); $zichtbaar=$part[0]; $categorie=$part[1]; $titel=$part[2]; $type=$part[3]; $adres=$part[4]; $postcode=$part[5]; $plaats=$part[6]; $oppervlakte=$part[7]; $huuropbrengst=$part[8]; $beschrijving=br2nl($part[9]); $url=$part[10]; $fundalink=$part[11]; $_SESSION['cat']=$categorie; $edit=true; } }else{ if (isset($_POST['opslaan'])){ if ($_POST['number']!=''){ $nr = $_POST['number']; } else { $nr = GetNewnumber(); } $_SESSION['nr']=$nr; if (isset($_POST['zichtbaar']) ? $zichtbaar=1 : $zichtbaar=0); $categorie=trim($_POST['categorie']); $titel=(stripslashes(trim($_POST['titel']))); $type=(stripslashes(trim($_POST['type']))); $adres=(stripslashes(trim($_POST['adres']))); $postcode=(stripslashes(trim($_POST['postcode']))); $plaats=(stripslashes(trim($_POST['plaats']))); $oppervlakte=(stripslashes(trim($_POST['oppervlakte']))); $huuropbrengst=(stripslashes(trim($_POST['huuropbrengst']))); $beschrijving=stripslashes(trim($_POST['beschrijving'])); $url=(stripslashes(trim($_POST['url']))); $fundalink=(stripslashes(trim($_POST['fundalink']))); $fl=stripslashes($zichtbaar.$sep.$categorie.$sep.$titel.$sep.$type.$sep.$adres.$sep.$postcode.$sep.$plaats.$sep.$oppervlakte.$sep.$huuropbrengst.$sep.nl2br($beschrijving).$sep.$url.$sep.$fundalink); $fl=str_replace('€','€',$fl); $fl=utf8_decode($fl); $_SESSION['cat']=$categorie; $edit=true; file_put_contents($startdir.$nr,$fl); if ($oldurl!=$url && $url!=''){ $rd=file_get_contents('./.htaccess'); if ($rd!=''){$rd.=PHP_EOL;} $redir = 'redirect /'.urldec($url).' http://ringstate.nl/portefeuille.php?cat='.urldec($categorie).'&id='.$nr; file_put_contents('./.htaccess',$rd.$redir); } } else { $nr= ''; //$_SESSION['nr']; $zichtbaar=1; } } if ($nr=='' ? $n='****' : $n=$nr); $files=scandir($startdir); $obj.='Nieuwe invoer...