Exemple #1
0
            $nBarangay->setData(G_ZONE, $g_zone);
            $nBarangay->setData(UPPER, $iDistrict);
            $nBarangay->setData(BLGF_CODE, $iBLGFCode);
            $nBarangay->add();
            $iDistrict = "";
            $iBarangay = "";
            $iBLGFCode = "";
            $iDistrict = "";
            $iCheck = "";
            ?>
			<body onload='javascript:alert ("Data is successfully added to the database!!");'></body>
			<?php 
        }
    } else {
        $nBarangay = new EBPLSBarangay($dbLink, 'false');
        $nBarangay->searchcomp($bbo, $iBarangay, $iDistrict);
        $rResult = $nBarangay->rcount;
        if ($rResult > 0) {
            ?>
			<body onload='javascript: alert ("Existing Barangay Found!!");'></body>
			<?php 
        } else {
            $datetoday = date("Y-m-d H:i:s");
            $nBarangay = new EBPLSBarangay($dbLink, 'false');
            $nBarangay->setData(BARANGAY_DESC, $iBarangay);
            $nBarangay->setData(BARANGAY_DATE_REGISTERED, $datetoday);
            $nBarangay->setData(BARANGAY_DATE_UPDATED, $datetoday);
            $nBarangay->setData(UPDATED_BY, $usern);
            $nBarangay->setData(G_ZONE, $g_zone);
            $nBarangay->setData(UPPER, $iDistrict);
            $nBarangay->setData(BLGF_CODE, $iBLGFCode);