function group_name($uid, $kolom) { $iduser = data_user($uid, 'GUID'); $iduserdetail = data_user_detail_user($iduser, 'GUID'); $idmog = data_mog_user_detail($iduserdetail, 'MS_GROUP_ID'); $grup = data_group_name($idmog, 'GROUP_NAME'); return $grup; }
</div> <div class="form-group"> <div class="col-sm-offset-2 col-sm-10"> <button type="submit" class="btn btn-success">Save & Activate</button> <button type="reset" class="btn btn-warning">Reset</button> </div> </div> </form> <?php break; case 'delete': $guid = mysql_real_escape_string($_GET['guid']); if ($guid == "") { eksyen('', '?p=user'); } else { $iduserdetail = data_user_detail_user($guid, 'GUID'); // hapus member_of_group mysql_query("delete from member_of_group where USER_DETAIL_ID='{$iduserdetail}'"); // hapus user_education mysql_query("delete from user_education where USER_DETAIL_ID='{$iduserdetail}'"); // hapus user_detail mysql_query("delete from user_detail where GUID='{$iduserdetail}'"); // hapus user mysql_query("delete from user where GUID='{$guid}'"); eksyen('', '?p=user'); } break; default: # code... break; }
<?php $iduser = $_SESSION['iduser']; $iduserdetail = data_user_detail_user($iduser, 'GUID'); $a = mysql_query("select * from user where GUID='{$iduser}'"); $b = mysql_fetch_array($a); $q = mysql_query("select * from user_detail where GUID='{$iduserdetail}'"); $d = mysql_fetch_array($q); if (isset($_POST['namadepan'])) { $iduser = $_SESSION['iduser']; $userr = $_SESSION['username']; $noid = mysql_real_escape_string($_POST['noid']); $nims = mysql_real_escape_string($_POST['nims']); $namadepan = mysql_real_escape_string($_POST['namadepan']); $namabelakang = mysql_real_escape_string($_POST['namabelakang']); $tempatlahir = mysql_real_escape_string($_POST['tempatlahir']); $tanggallahir = mysql_real_escape_string($_POST['tanggallahir']); $jk = mysql_real_escape_string($_POST['jk']); $alamat = mysql_real_escape_string($_POST['alamat']); $tel1 = mysql_real_escape_string($_POST['tel1']); $tel2 = mysql_real_escape_string($_POST['tel2']); $email = mysql_real_escape_string($_POST['email']); $hobi = mysql_real_escape_string($_POST['hobi']); if ($_FILES['foto']['name'] != '') { //--------------------------photo----------------------------------// $tmp_name = $_FILES['foto']['tmp_name']; //nama local temp file di server $file_size = $_FILES['foto']['size']; //ukuran file (dalam bytes) $file_type = $_FILES['foto']['type']; //tipe filenya (langsung detect MIMEnya)