} } elseif ($confx == 1) { $check1 = mysql_query("select * from ebpls_owner where owner_district_code = '{$bbo}'"); $check1 = mysql_num_rows($check1); $check2 = mysql_query("select * from ebpls_business_enterprise where business_district_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 { $nDistrict = new EBPLSDistrict($dbLink, 'false'); $nDistrict->delete($bbo); $bbo = ""; ?> <body onload='javascript:alert ("Record Deleted!!");'></body> <?php } } if ($com == "edit") { $nDistrict = new EBPLSDistrict($dbLink, 'false'); $nDistrict->search($bbo, NULL); $nResult = $nDistrict->out; $iDistrict = $nResult[district_desc]; $iBLGFCode = $nResult[blgf_code]; $nLGU = new EBPLSLGU($dbLink, 'false'); $nLGU->search($nResult[upper], NULL); $iResult = $nLGU->out; $iLGU = $iResult[city_municipality_code]; } include 'html/eBPLS_district.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';
$is_desc = 'DESC'; } if ($is_desc == 'DESC') { $is_desc = 'ASC'; } else { $is_desc = 'DESC'; } $is_asc = $is_desc; if ($pagemulti == '') { $pagemulti = 1; } //echo $is_desc."VooDoo"; if ($orderkey == "") { $orderkey = "district_code"; } $nresult = new EBPLSDistrict($dbLink, 'false'); $nresult->pagesearch($fromr, $max_resultsr, $orderkey, $is_desc); $fetarray = $nresult->rcount; $total_sr = @mysql_fetch_row($fetarray); $total_resultsr = $total_sr[0]; $fetchrecord = $nresult->out; // Figure out the total number of pages. Always round up using ceil() $total_pagesr = ceil($total_resultsr / $max_resultsr); //echo $total_resultsr."VooDoo"; echo "<table border=0 width=100%><tr><td align=left>"; if ($pager > 1) { $prevr = $pager - 1; echo "<a href='index.php?part=4&class_type=Preference&selMode=ebpls_ndistrict&page=1&orderkey={$orderkey}&is_asc={$is_asc}'><< "; echo "<a href='index.php?part=4&class_type=Preference&selMode=ebpls_ndistrict&page={$prevr}&orderkey={$orderkey}&is_asc={$is_asc}'>Prev "; } if ($pager >= 7) {