/src/beheer/updateAanbieder.php
PHP | 82 lines | 71 code | 10 blank | 1 comment | 8 complexity | 97bad6aae73e59fa78128ba915bdfc8e MD5 | raw file
- <?php
- if($_POST["vvlogolinks"]=="ja"){
- $tok = explode('.',$_FILES["logolinks"]["name"]);
- $logolinks = 'logo'.$_GET["id"].'_links.'.$tok[count($tok)-1];
- move_uploaded_file($_FILES["logolinks"]["tmp_name"], "../img/aanbieders/".$logolinks);
- $logopath = getcwd().'/../img/aanbieders/'.$logolinks;
- chmod($logopath, 0777);
- }
- if($_POST["vvlogorechts"]=="ja"){
- $tok = explode('.',$_FILES["logorechts"]["name"]);
- $logorechts = 'logo'.$_GET["id"].'_rechts.'.$tok[count($tok)-1];
- move_uploaded_file($_FILES["logorechts"]["tmp_name"], "../img/aanbieders/".$logorechts);
- $logopath = getcwd().'/../img/aanbieders/'.$logorechts;
- chmod($logopath, 0777);
- }
- $conn = mysql_connect('91.184.10.91', 'mysqlgratisgolf', 'g0lfp0l1s');
- mysql_select_db('gratisgolfpolis', $conn);
- $result = mysql_query("SELECT * FROM user WHERE id='".$_COOKIE["bid"]."'");
- $aantal = mysql_num_rows($result);
- if($aantal==1){
- $row = mysql_fetch_array($result);
- $bid = $row["id"];
- $bname = $row['name'];
- } else {
- //header("Location:login.html");
- }
- $result = mysql_query("SELECT * FROM aanbieders WHERE id='".$_GET["id"]."'");
- $row = mysql_fetch_array($result);
- $entrycode=0;
- if($_POST["entrycode"]=="ja"){
- $entrycode=1;
- }
-
- $algemeenaktie=0;
- if($_POST["algemeenaktie"]=="ja"){
- $algemeenaktie=1;
- }
-
- $sponsorpagina=0;
- if($_POST["sponsorpagina"]=="ja"){
- $sponsorpagina=1;
- }
-
- if(isset($_POST["detailtext"])){
- $str = "UPDATE aanbieders SET hiobedrag='".$_POST["hiobedrag"]."', intro='".str_replace("'","\'",$_POST["intro"])."', aanvraag='".str_replace("'","\'",$_POST["aanvraagtext"])."', bedankpagina='".str_replace("'","\'",$_POST["bedanktext"])."',hioinfo='".str_replace("'","\'",$_POST["hioinfotext"])."', detail='".str_replace("'","\'",$_POST["detailtext"])."', exitlink='".$_POST["exitlink"]."', entrycode=".$entrycode.", algemeenaktie=".$algemeenaktie.", sponsorpagina=".$sponsorpagina;
- } else {
- $str = "UPDATE aanbieders SET hiobedrag='".$_POST["hiobedrag"]."', intro='".str_replace("'","\'",$_POST["intro"])."', aanvraag='".str_replace("'","\'",$_POST["aanvraagtext"])."', bedankpagina='".str_replace("'","\'",$_POST["bedanktext"])."',hioinfo='".str_replace("'","\'",$_POST["hioinfotext"])."', entrycode=".$entrycode.", algemeenaktie=".$algemeenaktie.", sponsorpagina=".$sponsorpagina;
- }
- if($_POST["vvlogolinks"]=="ja"){
- $str = $str.", logolinks='".$logolinks."'";
- }
- if($_POST["vvlogorechts"]=="ja"){
- $str = $str.", logorechts='".$logorechts."'";
- }
- $str = $str.", urlname='".$_POST["urlname"]."'";
-
- $str = $str.", kvk='". $_POST["kvk"]."'
- , bedrijfsnaam='". $_POST["bedrijfsnaam"]."'
- , adres='".$_POST["adres"]."'
- , huisnr='".$_POST["huisnr"]."'
- , postcode='".$_POST["postcode"]."'
- , plaats='".$_POST["plaats"]."'
- , telefoon='".$_POST["telefoon"]."'
- , fax='".$_POST["fax"]."'
- , email='".$_POST["email"]."'
- , homepage='".$_POST["homepage"]."'
- , kontaktpersoon='".$_POST["kontaktpersoon"]."'";
-
- $str = $str." WHERE id='".$_GET["id"]."'";
-
- mysql_query($str);
-
- header("Location:index.php?act=aanbieders");
- ?>