$check1 = mysql_query("select * from ebpls_owner where owner_zone_code = '{$bbo}'"); $check1 = mysql_num_rows($check1); $check2 = mysql_query("select * from ebpls_business_enterprise where business_zone_code = '{$bbo}'"); $check2 = mysql_num_rows($check2); if ($check1 > 0 || $check2 > 0) { ?> <body onload='javascript:alert ("Cannot Delete. Record exist in other table(s).");'></body> <?php } else { $nZone = new EBPLSZone($dbLink, 'false'); $nZone->delete($bbo); $bbo = ""; $iBarangay = ""; $iZone = ""; $iBLGFCode = ""; ?> <body onload='javascript:alert ("Record Deleted!!");'></body> <?php } } if ($com == "edit") { $nZone = new EBPLSZone($dbLink, 'false'); $nZone->search($bbo, NULL); $nResult = $nZone->out; $iZone = $nResult[zone_desc]; $nBarangay = new EBPLSBarangay($dbLink, 'false'); $nBarangay->search($nResult[upper], NULL); $iResult = $nBarangay->out; $iBarangay = $iResult[barangay_code]; } include 'html/eBPLS_zone.html';
} else { $nBarangay = new EBPLSBarangay($dbLink, 'false'); $nBarangay->delete($bbo); $bbo = ""; $iBarangay = ""; $iDistrict = ""; $iBLGFCode = ""; $iCheck = ""; ?> <body onload='javascript:alert ("Record Deleted!!");'></body> <?php } } if ($com == "edit") { $nBarangay = new EBPLSBarangay($dbLink, 'false'); $nBarangay->search($bbo, NULL); $nResult = $nBarangay->out; $iBarangay = $nResult[barangay_desc]; $iBLGFCode = $nResult[blgf_code]; $iZone = $nResult[g_zone]; if ($iZone == "1") { $iCheck = "checked"; } else { $iCheck = ""; } $nDistrict = new EBPLSDistrict($dbLink, 'false'); $nDistrict->search($nResult[upper], NULL); $iResult = $nDistrict->out; $iDistrict = $iResult[district_code]; } include 'html/eBPLS_barangay.html';