$_POST['name'], 'type' => $_POST['type'], 'location' => $_POST['location'], 'user' => $_SESSION['username'], 'desc' => $_POST['desc'] ); if ($comm->create($data)){ //echo ' insert bisa '; $idp = $comm->getId(); mkdir(user_file . $idp, 0700); //mkdir(user_file . $idp, 0777); foreach($_POST['select3'] as $value){ $data['id_community'] = $idp; $data['user'] = $value; $data['role'] = 'Anggota'; $comm->inputmember($data); } if (!empty($_FILES['file']['name'])){ $foto = new Foto($_FILES); $foto->insert($idp); $hasil = $foto->getHasil(); $photo = $hasil['lokasi']; //echo $photo; if($comm->inputPhotoComm($photo,$idp))header('Location: community.php?id='.$idp); else echo '
gagal foto'; } header('Location: community.php?id='.$idp); } else echo '
gagal'; } function updateCommunity(){ } function comm($id){ $c = new Community(); $data['desc'] = $c->getComDesc($id); //print_r($data['desc']); $data['member'] = $c->getComMember($id); $data['event'] = $c->getEvent($id); $data['cEvent'] = mysql_num_rows($data['event']); return $data; } function commlist(){ $h = new Home(); $data = $h->getAllcomm(); return $data; } function ismember($idp,$idc){ $c = new Community(); return $c->ismember($idp,$idc); } function event($id){ $comm = new Community(); return $comm->getEvent2($id); } function addEvent(){ $comm = new Community(); $data = array( 'name' => $_POST['name'], 'type' => $_POST['type'], 'desc' => $_POST['desc'], 'date' => $_POST['date'], 'community' => $_POST['idc'] ); if ($comm->createEvent($data)){ //echo ' insert bisa '; $idp = $comm->getId(); if (!empty($_FILES['file']['name'])){ $foto = new Foto($_FILES); $foto->insert($_POST['idc'],'Ev '.$_POST['name']); $hasil = $foto->getHasil(); $photo = $hasil['lokasi']; //echo $photo; if($comm->inputPhotoEve($photo,$idp))header('Location: community.php?event='.$idp); else echo '
gagal foto'; } } else echo '
gagal'; } ?>