Beispiel #1
0
    $bcode = str_replace("  ", " ", trim($bcode));
    $nQuery = "select * from {$preft} where {$prefd}='{$bcode}'";
    echo $nQuery;
    $nProvince = new Province();
    $nProvince->Query1($nQuery);
    $nRecord = $nProvince->dbResultOut;
    if ($nRecord == 0) {
        $bname = strtoupper($bname);
        $sQuery = "select * from {$preft} where {$prefc}='{$bname}' and blgf_code='{$blgf_codes}'";
        $nProvince = new Province();
        $nProvince->Query1($sQuery);
        $chkDuplicate = $nProvince->dbResultOut;
        if ($chkDuplicate == 0) {
            $dQuery = "insert into {$preft} values ('{$bname}', '{$bname}',now(),now(),'{$usern}', '{$blgf_codes}')";
            $nProvince = new Province();
            $nProvince->InsertQuery($preft, $dQuery);
            ?>
			<body onLoad='javascript:alert("Record Successfully Saved");'></body>
			<?php 
        } else {
            ?>
                <body onload='javascript:alert("Duplicate Record Found");'></body>
<?php 
            //	 		echo "<div align=center>DUPLICATE RECORD</div>";
        }
    } elseif ($com == 'edit') {
        $bname = strtoupper($bname);
        $sQuery = "update {$preft} set {$prefd}='{$bname}', blgf_code='{$blgf_codes}' where {$prefc}='{$bbo}'";
        $nProvince = new Province();
        $nProvince->UpdateQuery($preft, $sQuery);
        $blgf_codes = '';