Example #1
0
<?php

namespace Framework\Utilities;

error_reporting(E_ALL);
ini_set("display_errors", 1);
include '../DatabaseFunctions.php';
echo "<h2>Testing DatabaseFunctions class</h2>";
/* Enter your database connection information. You should first import the sql file given in data folder */
$connection_information = array("host" => "localhost", "user" => "nadir", "password" => "kcbW5eFSCbPXbJGLHvUGG8T8", "database" => "dev_pakphp", "debug" => "2", "charset" => "utf8");
SelectQuery($connection_information);
UpdateQuery($connection_information);
InsertQuery($connection_information);
//DeleteQuery($connection_information);
/**
 * Used to select data from database
 * 
 * @since 1.2.2
 * @param array $connection_information an array with following keys:
 * host => the database host name
 * user => the database user
 * password => the database password
 * database => the database name
 * debug => the debug level it can be 0,1 or 2
 * charset => utf8
 */
function SelectQuery($connection_information)
{
    /** The database connection details */
    $parameters = $connection_information;
    /** The DatabaseFunctions object is created */
Example #2
0
            $totind = 0;
            $regfee = 0;
            $exemptedfee = 0;
        }
        //end wopi
    }
    // end cango
    //sakit na ulo ko
    $gtp = mysql_query("update ebpls_business_enterprise_permit  set active = 0 where\n\t\t\t\t\t\towner_id ='{$owner_id}' and business_id ='{$business_id}'");
    // $gtp = mysql_query("update ebpls_business_enterprise_permit  set active = 1 where
    // 						owner_id ='$owner_id' and business_id ='$business_id' order by for_year desc limit 1");
    $yeary = $yearnow - 1;
    $wil = UpdateQuery($dbtype, $dbLink, "tempbusnature", "active=0", "owner_id ='{$owner_id}' and business_id ='{$business_id}'");
    $wil = UpdateQuery($dbtype, $dbLink, "tempbusnature", "active=1", "owner_id ='{$owner_id}' and business_id ='{$business_id}' and date_create like '{$yeary}%'");
    $wil = UpdateQuery($dbtype, $dbLink, "tempassess", "active=0", "owner_id ='{$owner_id}' and business_id ='{$business_id}'");
    $wil = UpdateQuery($dbtype, $dbLink, "tempassess", "active=1", "owner_id ='{$owner_id}' and business_id ='{$business_id}' and date_create like '{$yeary}%'");
    //will create permit record
    $res = InsertQuery($dbtype, $dbLink, "ebpls_business_enterprise_permit", "\n\t\t\t\t(business_id, owner_id, for_year,\n\t\t\t\tapplication_date,input_by, transaction, \n\t\t\t\tpaid, steps, pin, active)", "{$business_id}, {$owner_id},'{$yearnow}', \n\t\t\t\tnow(), '{$usern}', '{$stat}', \n\t\t\t\t0,'For Assessment', '{$pin}', 1");
    ?>

<body onload="alert('Assessment Process Completed'); parent.location='index.php?part=4&class_type=Permits&itemID_=1221&owner_id=<?php 
    echo $owner_id;
    ?>
&com=<?php 
    echo $stat;
    ?>
&permit_type=Business&stat=<?php 
    echo $stat;
    ?>
&business_id=<?php 
    echo $business_id;
Example #3
0
<?php

if ($reg_but == 'Save') {
    $chkboat = SelectDataWhere($dbtype, $dbLink, "fish_boat", " where boat_name='{$boat_name}'");
    $chkboat = NumRows($dbtype, $chkboat);
    if ($chkboat == 1 and $editit != 1) {
        ?>
                <body onload='javascript:alert("Duplicate Boat Name Found");'></body>
		        <?php 
    } else {
        if ($editit != 1) {
            $insboat = InsertQuery($dbtype, $dbLink, "fish_boat", "", "'',{$owner_id},'{$boat_name}',\n\t\t\t\t\t\t'{$crew_num}','{$eng_type}',{$eng_cap},\n\t\t\t\t\t\t'{$reg_num}',now(),'{$usern}','',''");
        } else {
            $upboat = UpdateQuery($dbtype, $dbLink, "fish_boat", "boat_name='{$boat_name}', crew='{$crew_num}',\n\t\t\t\t\t\tengine_type='{$eng_type}', engine_cap={$eng_cap},\n\t\t\t\t\t\treg_no='{$reg_num}', up_date=now(), \n\t\t\t\t\t\tup_by='{$usern}'", "boat_id={$boatid}");
        }
    }
} else {
    if ($fishcom == 'Edit') {
        $getr = SelectDataWhere($dbtype, $dbLink, "fish_boat", "where boat_id = {$boatid}");
        $getb = FetchRow($dbtype, $getr);
        $editit = 1;
    } elseif ($fishcom == 'Delete') {
        $getd = DeleteQuery($dbtype, $dbLink, "fish_boat", "boat_id = {$boatid}");
        $editit = '';
    }
}
?>


<table cellspacing=0 cellpadding=0 border=1 width=60%>
        <tr>
Example #4
0
     $tt = $tt + $totind;
     $grandamt = $tt;
     if (is_numeric($gethuh[amtformula])) {
         $gethuh[amtformula] = number_format($gethuh[amtformula], 2);
     }
     print "<td align=right  width=25%>\n        <input type=hidden name=natureid[{$varx}] value={$gethuh['natureid']}>\n        <input type=hidden name=z[{$varx}] value={$gethuh['amtformula']}>{$usemin1} &nbsp; \n\t{$gethuh['amtformula']} {$show_complex} \n\t<input type=hidden name=taxfeeid[{$varx}] value={$gethuh['taxfeeid']}></td>\n        <td align=right width=25%>\n\t<input type=hidden name=y{$varx} value={$totind} size=5 readonly>{$usemin} &nbsp; {$taxdue}</td>\n        </tr>";
     $usemin = '';
     $havemayor = strpos(strtolower($getd[tfodesc]), 'mayor');
     //echo $getd[taxfeetype]."<br>";
     if ($getd[taxfeetype] != 1 || $havemayor > -1) {
         $feecompute1 = $feecompute1 + $totind;
         $tt = $tt - $totind;
         $grandamt = $tt;
         $nyotfee = $totind + $nyotfee;
     }
     $result1 = UpdateQuery($dbtype, $dbLink, "tempassess", "compval='{$totind}'", "owner_id='{$owner_id}'\n                        and business_id='{$business_id}' and natureid='{$gethuh['natureid']}'\n                        and taxfeeid='{$gethuh['taxfeeid']}' and active=1");
     /* ============================*/
 } else {
     //put to tempassess;
     $nat_id = $getn[0];
     if ($getd[indicator] == 2 and $stt == 'New') {
         //if formula
         $indi = 1;
         $basis = $getn[2];
         if ($getd[basis] == 3) {
             $basis = 0;
         }
         if ($getd[mode] == 2) {
             //complex
             include_once "class/TaxFeeOtherChargesClass.php";
             $searchme = new TaxFee();
Example #5
0
        $get1 = @mysql_fetch_assoc($get);
        $desc = $get1[fee_desc];
        $exist = SelectDataWhere($dbtype, $dblink, 'ebpls_fess_paid', "where fee_desc = '{$desc}'");
        $exist1 = @mysql_num_rows($get);
        if ($exist1 > 0) {
            ?>
				<body onLoad='javascript:alert ("Cannot Delete, Record exist in other table");'></body>
				<?php 
        } else {
            $delrec = DeleteQuery($dbtype, $dbLink, $dtable, "fee_id='{$bbo}'");
            ?>
		        <body onLoad='javascript:alert ("Fee Deleted"); parent.location="index.php?part=4&class_type=Preference&permit=others&selMode=ebpls_notherfees&action_=8&itemEvent=1&data_item=0";'></body>
<?php 
        }
    } else {
        $delrec = UpdateQuery($dbtype, $dbLink, $dtable, "active=0", "fee_id={$owner_id}");
        ?>
		        <body onLoad='javascript:alert ("Fee DeActivated"); parent.location="index.php?part=4&class_type=Preference&permit=others&selMode=ebpls_notherfees&action_=8&itemEvent=1&data_item=0";'></body>
<?php 
    }
    //$delrec =mysql_query ("delete from  $dtable  where fee_id =$id")  or die("DELETE Error: ".mysql_error());
    //int "<td align=right><font color=red>Record Dele</font></td>";
    //int "<td align=left><font color=red>ted Successfully</font></td>";
    $owner_id = '';
    $id = '';
    $feeid = '';
    $desc = '';
    $amt = '';
    $ptype = '';
    if ($feet == "") {
        $feet = "Motorized";
Example #6
0
            $updateit = UpdateQuery($dbtype, $dbLink, $permittable, "released = 1, steps='Released'", "owner_id = {$owner_id}");
            $checkrentype = @mysql_query("select * from ebpls_motorized_penalty where permit_type = '{$permit_type}'");
            $checkrentype1 = @mysql_fetch_assoc($checkrentype);
            if ($permit_type == "Motorized") {
                $updatetempt = mysql_query("update ebpls_mtop_temp_fees set active = '0' where owner_id = '{$owner_id}' and year = '{$yearsdf}'");
            }
            if ($checkrentype1['renewaltype'] == '2' and $stat == "ReNew") {
                $updateit = UpdateQuery($dbtype, $dbLink, "ebpls_motorized_vehicles", "retire = '5'", "motorized_operator_id = '{$owner_id}' and retire='4'");
                $nbvyear = date('Y');
                $updateit1 = UpdateQuery($dbtype, $dbLink, "ebpls_fees_paid", "active = '0'", "owner_id = '{$owner_id}' and active = '1' and input_date like '{$nbvyear}%'");
                $updateit2 = UpdateQuery($dbtype, $dbLink, "renew_vehicle", "paid = '1'", "owner_id = '{$owner_id}' and paid = '0' and date_updated like '{$nbvyear}%'");
            }
        } else {
            /*
             */
            $updateit = UpdateQuery($dbtype, $dbLink, $permittable, "{$incode}='{$permitnumber}', \n\t\t\t\treleased = 1, steps='Release',transaction='{$stat}', released_date=now()", "owner_id={$owner_id} and business_id={$business_id}\n\t\t\t\torder by business_permit_id desc limit 1\n\t\t\t\t");
        }
        $isrel = 0;
    } else {
        $permitnumber = $veri[1];
        $isrel = 1;
    }
    $permit_num = $permitnumber;
    if ($permit_type == 'Business') {
        $report_desc = 'Business Permit';
        ?>
		<body onLoad="javascript:window.open('reports/ebpls_buss_permit.php?owner_id=<?php 
        echo $owner_id;
        ?>
&business_id=<?php 
        echo $business_id;
Example #7
0
            $checkrentype1 = @mysql_fetch_assoc($checkrentype);
            if ($checkrentype1['renewaltype'] == '2' and $stat == "ReNew") {
                $updateit = UpdateQuery($dbtype, $dbLink, "ebpls_motorized_vehicles", "retire = '5'", "motorized_operator_id = '{$owner_id}' and retire = '4'");
                $vbnmyear = date('Y');
                $updateit321 = UpdateQuery($dbtype, $dbLink, "ebpls_motorized_vehicles", "retire = '5'", "motorized_operator_id = '{$owner_id}' and retire = '0' and create_ts like '{$vbnmyear}%'");
                $nbvyear = date('Y');
                $updateit = UpdateQuery($dbtype, $dbLink, "ebpls_fees_paid", "active = '0'", "owner_id = '{$owner_id}' and active = '1' and input_date like '{$nbvyear}%'");
            } elseif ($stat == "Transfer/Dropping") {
                $updateit = UpdateQuery($dbtype, $dbLink, "ebpls_motorized_vehicles", "retire = '2', motorized_operator_id = ''", "motorized_operator_id = '{$owner_id}'  and retire = '1'");
                $nbvyear = date('Y');
                $updateit1 = UpdateQuery($dbtype, $dbLink, "ebpls_fees_paid", "active = '0'", "owner_id = '{$owner_id}' and active = '1' and input_date like '{$nbvyear}%'") or die(mysql_error);
                $checkifmore = SelectDataWhere($dbtype, $dbLink, "ebpls_motorized_vehicles", "where motorized_operator_id = '{$owner_id}'");
                $ifmore = mysql_num_rows($checkifmore);
                if ($ifmore > 0) {
                    $nbvyear = date('Y');
                    $updateit1 = UpdateQuery($dbtype, $dbLink, "ebpls_motorized_operator_permit ", " motorized_no_of_units = '{$ifmore}', transaction = 'ReNew', steps = 'For Payment'", "owner_id = '{$owner_id}' and active = '1' and for_year = '{$nbvyear}'") or die(mysql_error);
                }
            }
            ?>
                <body onload="parent.location='index.php?part=4&class_type=Permits&itemID_=3212&owner_id=<?php 
            echo $owner_id;
            ?>
&com=PrintReport&permit_type=<?php 
            echo $permit_type;
            ?>
&stat=<?php 
            echo $stat;
            ?>
&busItem=<?php 
            echo $permit_type;
            ?>
            $interestrate = $getpended[rateofinterest] * $d;
        } elseif ($getpended['inttype'] == '2') {
            while ($x <= $d) {
                $counter = $counter * $intrate;
                $x++;
            }
            $interestrate = $counter - 1;
        }
        if ($getpended['feeonly'] == '1') {
            $busint = $interestrate * $nTotalTax;
        } elseif ($getpended['feeonly'] == '2') {
            $busint = $interestrate * ($nTotalTax + $nTotalFee);
        } elseif ($getpended['feeonly'] == '3') {
            $busint = $interestrate * ($nTotalTax + $nTotalFee + $buspen);
        }
        $updatebus = UpdateQuery($dbtype, $dbLink, "bus_grandamt", "active = 0", "owner_id = '{$owner_id}' and business_id='{$business_id}' and ts != '{$yearnow1}'");
        $ramt2 = round($ramt2, 2);
        $nTaxnFee = round($nTotalTax + $nTotalFee, 2);
        $nTotalTax = round($nTotalTax, 2);
        $buspen = round($buspen, 2);
        $busint = round($busint, 2);
        $nbacktax = round($nbacktax, 2);
        $divtax = round($divtax, 2);
        $totalexptax = round($totalexptax, 2);
        $totexemption = $grandamt * $getbusexempt1[tax_exemption] / 100;
        $totexemption = round($totexemption, 2);
        $busvalues = "'', '{$owner_id}', '{$business_id}', '{$nTaxnFee}', '{$buspen}', '{$busint}', '0', '{$nTotalTax}', '', '1', '{$stat}', '{$totexemption}', '{$yearnow1}', '{$pmode}', '{$robert}'";
        $insertbus = InsertQuery($dbtype, $dbLink, "bus_grandamt", "", $busvalues);
    }
}
//}
Example #9
0
<?php

if ($stat == 'New') {
    $tftype = 1;
} elseif ($stat == 'ReNew') {
    $tftype = 2;
} else {
    $tfttype = 3;
}
//update old assess
$ui = UpdateQuery($dbtype, $dbLink, "tempassess", "active = 0", "owner_id={$owner_id} and\r\n\t\t business_id={$business_id} and transaction<>'{$stat}'");
//use decimal
$dec = SelectDataWhere($dbtype, $dbLink, "ebpls_buss_preference", "");
$dec = FetchArray($dbtype, $dec);
$dec = $dec[sdecimal];
if ($dec == '1') {
    $d = '(';
} else {
    $d = '(int)(';
}
$df = 0;
//get naturecode
if ($stat == 'Retire') {
    $retstr = "and a.retire=2";
} else {
    $retstr = '';
}
$getnat = SelectMultiTable($dbtype, $dbLink, "tempbusnature a, ebpls_buss_nature b", "a.bus_code, b.naturedesc, a.cap_inv, a.last_yr, a.transaction", "where owner_id={$owner_id} and business_id={$business_id} \r\n\t\t\tand a.bus_code=b.natureid and active = 1 {$retstr}");
while ($getn = FetchRow($dbtype, $getnat)) {
    $stt = $getn[4];
    if ($stt == 'New') {
Example #10
0
        $luk = SelectDataWhere($dbtype, $dbLink, $permittable, " \n\t\t\t\towner_id={$owner_id} and \n\t\t\t\tbusiness_id={$business_id} \n\t\t\t\tand active=1 and transaction='ReNew'");
        $luk = NumRows($luk);
        if ($luk == 0) {
            $res = InsertQuery($dbtype, $dbLink, $permittable, "\n\t\t\t\t(business_id, owner_id, for_year,\n\t\t\t\tapplication_date,input_by, transaction, \n\t\t\t\tpaid, steps, pin, active)", "{$business_id}, {$owner_id},'{$currdate['year']}', \n\t\t\t\tnow(), '{$usern}', '{$stat}', \n\t\t\t\t0,'For Assessment', '{$pin}', 1");
        }
        $wil = UpdateQuery($dbtype, $dbLink, "tempbusnature", "active=0", "tempid=" . $tempid);
        $bp = UpdateQuery($dbtype, $dbLink, $permittable, "active=0", "owner_id={$owner_id} and business_id={$business_id}\n\t\t\tand active=1");
        $clr = 1;
    } elseif ($stat == 'Retire') {
        $wil = InsertQuery($dbtype, $dbLink, "tempbusnature", "", "'', '{$bus_code}', '{$bus_nature}',{$oldlay},\n                        {$lay},{$owner_id}, {$business_id}, now(),\n                        0, 1,2,'Retire'");
        $updatepermit = UpdateQuery($dbtype, $dbLink, "ebpls_business_enterprise_permit", "pmode='{$pmode}'", "owner_id={$owner_id} and \n\t\t\tbusiness_id={$business_id} order by \n\t\t\tbusiness_permit_id desc limit 1");
        $wil3 = UpdateQuery($dbtype, $dbLink, "ebpls_business_enterprise", "business_payment_mode='Annual'", "owner_id={$owner_id} and business_id={$business_id}");
        $luk = SelectDataWhere($dbtype, $dbLink, $permittable, " where \n\t\t\towner_id={$owner_id} and business_id={$business_id}\n                        and active=1 and transaction='Retire'");
        $luk = NumRows($luk);
        if ($luk == 0) {
            $res = InsertQuery($dbtype, $dbLink, $permittable, "(business_id, owner_id, for_year,\n\t\t\tapplication_date,input_by, transaction, \n\t\t\tpaid, steps, pin, active)", "{$business_id},{$owner_id},'{$currdate['year']}', \n\t\t\tnow(), '{$usern}', '{$stat}', \n\t\t\t0,'For Assessment', '{$pin}', 1");
        }
        $wil = UpdateQuery($dbtype, $dbLink, "tempbusnature", "active=0", "tempid=" . $tempid);
        $bp = UpdateQuery($dbtype, $dbLink, $permittable, "active=0", "owner_id={$owner_id} and business_id={$business_id}\n                        and active=1");
        $clr = 1;
    }
    if ($clr == 1) {
        $dt = DeleteQuery($dbtype, $dbLink, "tempassess", "owner_id={$owner_id} and business_id={$business_id}\n\t\t\tand active=1 and transaction='{$stat}'");
        ?>
	<body onLoad='javascript: opener.location.reload(true); window.close()'></body>
<?php 
    }
}
?>
	
Example #11
0
<?php

if ($permit_type != 'Business') {
    $searchif = SelectDataWhere($dbtype, $dbLink, $permittable, " where owner_id={$owner_id}");
    $existid = NumRows($dbtype, $searchif);
    if ($existid == 0) {
        $inserttemp = InsertQuery($dbtype, $dbLink, $permittable, "({$incode}, owner_id, for_year, {$appdate}, paid,transaction)", "'{$permitcode}', {$owner_id}, '{$currdate['year']}', '{$tdate}', 0,'{$stat}')");
    }
    if ($tag == 'Occupational' and $permit_type == 'Occupational') {
        //update occu permit
        if ($existid != 0) {
            if ($frmedit == 'yes') {
                $slash = 'add';
                require_once "includes/stripslash.php";
                $updateemp = UpdateQuery($dbtype, $dbLink, "ebpls_occupational_permit", "occ_position_applied ='{$pos_app}',\n\t\t\t                business_id='{$employer_business}',\n\t\t\t                for_year='{$currdate['year']}'", "owner_id={$owner_id} and active=1");
            }
        } else {
            $slash = 'add';
            require_once "includes/stripslash.php";
            if ($frmedit != 'yes') {
                if ($employer_business > 0) {
                    $insertemp = InsertQuery($dbtype, $dbLink, "ebpls_occupational_permit", "(owner_id ,  occ_permit_application_date, \n\t\t\t\t\tocc_position_applied, for_year, paid,\n\t\t\t\t\ttransaction, steps, pin, active, business_id)", "{$owner_id}, '{$tdate}', '{$pos_app}',\n                \t\t\t'{$currdate['year']}', 0,'{$stat}', 'For Payment', \n\t\t\t\t\t'{$pin}', 1, {$employer_business}");
                } else {
                    ?>
<body onload='alert("Please select employer."); parent.location="index.php?part=4&itemID_=1221&permit_type=Occupational&stat=<?php 
                    echo $stat;
                    ?>
&owner_id=<?php 
                    echo $owner_id;
                    ?>
&upOwner=UPDATE&business_id=<?php 
Example #12
0
            $grandamt = 0;
            $totfee = 0;
            $exemptot = 0;
            $totind = 0;
            $regfee = 0;
        }
        //end wopi
    }
    // end cango
    $yearnow2 = $yearnow - 1;
    $wil = UpdateQuery($dbtype, $dbLink, "tempassess", "active=0", "owner_id ='{$owner_id}' and business_id ='{$business_id}'");
    $wil = UpdateQuery($dbtype, $dbLink, "tempassess", "active=1", "owner_id ='{$owner_id}' and business_id ='{$business_id}' and date_create like '{$inputdate}%'");
    $wil = UpdateQuery($dbtype, $dbLink, "tempbusnature", "active=0", "owner_id ='{$owner_id}' and business_id ='{$business_id}'");
    $cht = mysql_query("select distinct(bus_code)  from tempbusnature where owner_id='{$owner_id}' and business_id='{$business_id}'");
    $cnte = mysql_num_rows($cht);
    $wil = UpdateQuery($dbtype, $dbLink, "tempbusnature", "active=1", "owner_id ='{$owner_id}' and business_id ='{$business_id}' and date_create like '{$yearnow2}-12%' limit {$cnte}");
    $stat = 'ReNew';
    ?>

<body onload="alert('Assessment Process Completed'); parent.location='index.php?part=4&class_type=Permits&itemID_=1221&owner_id=<?php 
    echo $owner_id;
    ?>
&com=<?php 
    echo $stat;
    ?>
&permit_type=Business&stat=<?php 
    echo $stat;
    ?>
&business_id=<?php 
    echo $business_id;
    ?>
Example #13
0
        }
        $wopi++;
    }
    if ($cango == '1') {
        $wopi = 0;
        $ui = UpdateQuery($dbtype, $dbLink, "tempassess", "active = 0", "owner_id='{$owner_id}' and\n                 business_id='{$business_id}'");
        while ($wopi < $gr) {
            $tempid = $tempbus[$wopi];
            $lastyr = $gross[$wopi];
            $getbus = SelectDataWhere($dbtype, $dbLink, "tempbusnature", "where tempid={$tempid}");
            $getbu = FetchRow($dbtype, $getbus);
            $bus_code = $getbu[1];
            $bus_nature = $getbu[2];
            $oldlay = $getbu[4];
            $result = InsertQuery($dbtype, $dbLink, "tempbusnature", "", "'', '{$bus_code}', '{$bus_nature}',{$lastyr},\n                \t        \t{$lastyr},{$owner_id},{$business_id}, now(),\n\t                        \t0, 1,'','{$stat}','0'");
            $wil = UpdateQuery($dbtype, $dbLink, "tempbusnature", "active=0", "tempid='{$tempid}'");
            $wopi++;
        }
        // end wopi
    }
    ?>

<body onload="alert('Assessment Process Completed'); parent.location='index.php?part=4&newpred=1&noregfee=1&class_type=Permits&itemID_=4212&owner_id=<?php 
    echo $owner_id;
    ?>
&com=assess&permit_type=Business&stat=<?php 
    echo $stat;
    ?>
&business_id=<?php 
    echo $business_id;
    ?>
Example #14
0
$PROCESS = isset($PROCESS) ? $PROCESS : '';
//2008.05.06 define undefined
$com = isset($com) ? $com : '';
if ($com != 'approve') {
    // process successful
    if ($PROCESS == 'SAVE' || $PROCESS == 'PAYMENT') {
        $dec_comment = addslashes($dec_comment);
        $getapp = SelectDataWhere($dbtype, $dbLink, "ebpls_buss_approve", "where owner_id = {$owner_id} and \n\t\t\t\t business_id={$business_id}");
        $getnum = NumRows($dbtype, $getapp);
        if ($getnum == 0) {
            $savedata = InsertQuery($dbtype, $dbLink, "ebpls_buss_approve", "", "'',{$owner_id}, {$business_id}, {$decide}, \n\t\t\t\t '{$dec_comment}', '{$stat}'");
        } else {
            $updata = UpdateQuery($dbtype, $dbLink, "ebpls_buss_approve", "decision={$decide},dec_comment='{$dec_comment}', \n\t\t\t\t transaction='{$stat}'", "owner_id = {$owner_id} and business_id={$business_id}");
        }
        if ($decide == 1) {
            $updateit = UpdateQuery($dbtype, $dbLink, $permittable, "steps='For Payment'", "owner_id={$owner_id} and business_id={$business_id}");
        }
        if ($PROCESS == 'PAYMENT' and $decide == 1) {
            ?>
			<body onload="parent.location='index.php?part=4&newpred=<?php 
            echo $newpred;
            ?>
&noregfee=<?php 
            echo $noregfee;
            ?>
&class_type=Permits&itemID_=2212&owner_id=<?php 
            echo $owner_id;
            ?>
&com=cash&permit_type=<?php 
            echo $permit_type;
            ?>
Example #15
0
            }
        }
    }
} elseif ($com == 'DeAct') {
    ?>
       <body onload='javascript:alert("Fee DeActivated");'></body>
<?php 
    //	print "<div align=center><font color=red>Fee DeActivated</font></div>";
    $deact = UpdateQuery($dbtype, $dbLink, "culture_fee", "active=0", "culture_id='{$boat_type}' and transaction='{$trans}'");
    $chkread = "checkbox";
} elseif ($com == 'Act') {
    ?>
       <body onload='javascript:alert("Fee Activated");'></body>
<?php 
    //	 print "<div align=center><font color=red>Fee Activated</font></div>";
    $deact = UpdateQuery($dbtype, $dbLink, "culture_fee", "active=1", "culture_id='{$boat_type}' and transaction='{$trans}'");
    $chkread = "checkbox";
}
?>

<tr>
<td align="right" valign="center" ><br>
Unit Of Measure:
</td>
<td align="left" valign="center" ><br>
&nbsp
<input type=text name="uom" value="<?php 
echo $rr[6];
?>
">
</td></tr>                                                        
Example #16
0
                $updateit = UpdateQuery($dbtype, $dbLink, $vehicle, "motorized_operator_id  = {$ft['old_owner']},permit_type='{$permit_type}',retire=2,transaction='Drop'", " motorized_motor_id='{$mid}'");
                $D = DeleteQuery($dbtype, $dbLink, "vehicle_transfer", "motor_id='{$mid}' and\n\t\t\t\t\t\tnew_owner='{$owner_id}'");
                ?>
			<body onload='javascript:("Vehicle Transferred Cancelled");'</body>
			<?php 
            } else {
                ?>
		<body onload='javascript:ExistOther();'></body>
		<?php 
            }
        } else {
            $delvec = DeleteQuery($dbtype, $dbLink, $vehicle, "motorized_motor_id={$mid}");
        }
    } elseif ($com == 'Drop') {
        //drop vehicle
        $dropvek = UpdateQuery($dbtype, $dbLink, $vehicle, "retire=1, transaction={$com}", " motorized_motor_id={$mid}");
    }
    require_once "includes/mtop.php";
} elseif ($clearveh == 'Clear' or $clearveh == 'Cancel') {
    $mid = '';
    $mmodel = '';
    $mnum = '';
    $cnum = '';
    $pnum = '';
    $bnum = '';
    $route = '';
    $ltype = '';
    $bcolor = '';
    $ltoreg = '';
    $cro = '';
    $buttag1 = 'Clear';
Example #17
0
require_once "ebpls-php-lib/utils/ebpls.search.funcs.php";
//--- get connection from DB
//$dbLink = get_db_connection();
global $ThUserData;
require_once "includes/variables.php";
include "lib/multidbconnection.php";
$dbLink = Open($dbtype, $connecttype, $dbhost, $dbuser, $dbpass, $dbname);
if ($msgid == '') {
    $msgid = 0;
}
if ($savebt == 'SAVE') {
    if ($keyword != null and $message != null) {
        $keyword = strtolower(addslashes($keyword));
        $message = trim(addslashes($message));
        if ($com == 'editsms') {
            $result = UpdateQuery($dbtype, $dbLink, "sms_message", "keyword='{$keyword}', full_message='{$message}',\r\n\t\t\t\t\tdateupdated=now(),updateby='{$usern}'", "msgid={$msgid}");
        } else {
            $result = InsertQuery($dbtype, $dbLink, "sms_message", "", "'','{$keyword}','{$message}',now(),'{$usern}'");
        }
        $msgid = 0;
        $keyword = '';
        $message = '';
    }
}
if ($com == 'deletesms') {
    $result = DeleteQuery($dbtype, $dbLink, "sms_message", "msgid={$msgid}");
    $msgid = 0;
} elseif ($com == 'editsms') {
    $getmsg = SelectDataWhere($dbtype, $dbLink, "sms_message", "where msgid={$msgid}");
    $getmsg = mysql_fetch_row($getmsg);
}
Example #18
0
<?php

require_once "includes/variables.php";
include "lib/multidbconnection.php";
$dbLink = Open($dbtype, $connecttype, $dbhost, $dbuser, $dbpass, $dbname);
$wil2 = UpdateQuery($dbtype, $dbLink, "tempbusnature", "retire=1", "owner_id={$owner_id} and\n                                        business_id={$business_id} and\n                                        active=1 and transaction='Retire'");
$updatebusnature = UpdateQuery($dbtype, $dbLink, "tempbusnature", "active=0", "owner_id={$owner_id} and\n                                        business_id={$business_id} and transaction='Retire'");
$chkretire = SelectDataWhere($dbtype, $dbLink, "tempbusnature", "where owner_id={$owner_id} and\n                                        business_id={$business_id} and active=1");
$chkretire = FetchRow($dbtype, $chkretire);
if ($chkretire == 0) {
    $updateretire = UpdateQuery($dbtype, $dbLink, "ebpls_business_enterprise", "retire=1, business_retirement_date=now()", "owner_id={$owner_id} and business_id={$business_id}");
    $ubp = UpdateQuery($dbtype, $dbLink, "ebpls_business_enterpr1ise_permit", "active = 0", "owner_id = {$owner_id} and\n                                        business_id = {$business_id}");
} else {
    //deact all permit
    $ubp = UpdateQuery($dbtype, $dbLink, "ebpls_business_enterprise_permit", "active = 0", "owner_id = {$owner_id} and \n\t                     business_id = {$business_id}");
    //active 1
    $updatepermit = UpdateQuery($dbtype, $dbLink, "ebpls_business_enterprise_permit", "active=1", "owner_id={$owner_id} and business_id={$business_id}\n                            and transaction<>'Retire' order by business_permit_id desc limit 1");
    //change pmode back to orig -- ang orig sa bicol ay baboy
    $getpmode = SelectDataWhere($dbtype, $dbLink, "ebpls_business_enterprise_permit", "where owner_id={$owner_id} and business_id={$business_id}\n                and pmode<>'' order by business_permit_id desc limit 1");
    $pmode = FetchArray($dbtype, $getpmode);
    $pmode = $pmode[pmode];
    $updatepmode = UpdateQuery($dbtype, $dbLink, "ebpls_business_enterprise", "business_payment_mode = '{$pmode}'", "owner_id={$owner_id} and business_id={$business_id}");
}
?>
<body onload="parent.location='index.php?part=4&class_type=Permits&permit_type=Business&busItem=Business&itemID_=2212&mtopsearch=SEARCH'";></body>





Example #19
0
     CreateNewHost($EditId, $EditArr);
 }
 if (ValidId($HostId) && !ValidVar($EditPage) && !ValidVar($EditEvent) && ValidArr($EditArr)) {
     UpdateHost($HostId, $EditArr);
 }
 if ($EditPage == "new" && ValidArr($EditArr)) {
     AddSitePage($HostId, $EditArr);
 }
 if (ValidId($EditPage) && ValidArr($EditArr)) {
     UpdatePage($EditPage, $EditArr);
 }
 if (ValidId($DeletePage)) {
     DeletePage($DeletePage);
 }
 if (ValidId($EditEvent) && ValidArr($EditArr2)) {
     UpdateQuery($EditEvent, $EditArr2);
 }
 if (ValidVar($EditEvent) == "new" && ValidId($EventPage) && ValidArr($EditArr2)) {
     CreateQuery($EventPage, $EditArr2);
 }
 if (ValidId($DeleteEvent)) {
     DeleteQuery($DeleteEvent);
 }
 if (ValidId($HostId) && ValidVar($NewHost)) {
     CreateNewSiteHost($HostId, $NewHost);
 }
 if (ValidArr($Enable)) {
     SetEnable($Enable);
 }
 if (ValidId($DelSiteHost)) {
     DeleteSiteHost($DelSiteHost);
Example #20
0
 if ($savenat != '') {
     $nat = SelectDataWhere($dbtype, $dbLink, "ebpls_buss_nature", "where natureid='{$_idx}'");
     $getnat = FetchArray($dbtype, $nat);
     $getna = $getnat['naturedesc'];
     $nat = SelectDataWhere($dbtype, $dbLink, "tempbusnature", "where tempid='{$savenat}'");
     $getnat = FetchArray($dbtype, $nat);
     $transme = $getnat['transaction'];
     if ($transme == 'New') {
         $multi = $_cap;
         $oldm = $getnat[cap_inv];
     } else {
         $multi = $lastyr;
         $oldm = $getnat[last_yr];
     }
     $result = UpdateQuery($dbtype, $dbLink, "tempbusnature", "bus_code={$_idx}, bus_nature='{$getna}', cap_inv='{$_cap}',\n                                          last_yr='{$lastyr}'", "tempid='{$savenat}'");
     $result = UpdateQuery($dbtype, $dbLink, "tempassess", "multi='{$multi}'", "owner_id='{$owner_id}' and\n\t\t\t\t\t  business_id='{$business_id}' and natureid = '{$business_nature_code}'\n\t\t\t\t\t  and transaction = '{$stat}' and multi='{$oldm}'");
 } else {
     $check = SelectDataWhere($dbtype, $dbLink, $tempbiz, "where bus_code='{$_idx}' and business_id={$business_id}\n                                        and owner_id={$owner_id}");
     $checkit = NumRows($dbtype, $check);
     if ($checkit == 0) {
         //get nature_desc
         $nat = SelectDataWhere($dbtype, $dbLink, "ebpls_buss_nature", "where natureid='{$_idx}'");
         $getnat = FetchArray($dbtype, $nat);
         $getnat = $getnat['naturedesc'];
         //save to temp table
         if ($stat == 'New') {
             if ($business_capital_investment != 0) {
                 $oki = 1;
             } else {
                 $oki = 0;
             }
Example #21
0
            $howmany = $howmany - 1;
        }
        $i = 0;
        while ($i < $howmany) {
            $i++;
            //echo $varx."<BR>";
            if (!is_numeric($x[$i])) {
                ?>
			<body onload='javascript:alert("Invalid Input");'></body>
<?php 
                $i = $howmany;
                $woki = 0;
            } else {
                $woki = 2;
                if ($invest_up != 1) {
                    $res = UpdateQuery($dbtype, $dbLink, "tempassess", "multi={$x[$i]}", "assid='{$i}'\n\t\t        \t                and owner_id={$owner_id} and business_id={$business_id} \n\t\t\t\t\t\tand active=1 and transaction='{$stat}'");
                }
            }
        }
        $i = 1;
        if ($woki == 1) {
            while ($i < $howmany) {
                if ($invest_up != 1) {
                    $res = UpdateQuery($dbtype, $dbLink, "tempassess", "multi={$x[$i]},compval={$y[$i]}", "assid='{$i}' and owner_id={$owner_id} \n\t\t\t\tand business_id={$business_id} and active=1\n\t                        and transaction='{$stat}'");
                }
                $i++;
            }
        }
    }
    require_once "ebpls4222.php";
}
Example #22
0
         } else {
             $woki = 1;
         }
         $i++;
     }
     if ($updateit == 1) {
         $ftag = 'Update';
     } else {
         $ftag = 'Save';
     }
 }
 $i = 0;
 if ($woki == 1) {
     while ($i < $no_range) {
         if ($updateit == '1') {
             $insnew = UpdateQuery($dbtype, $dbLink, "boat_fee", "boat_type='{$boat_type}',\n                                                range_lower={$rangelow[$i]},\n                                                range_higher={$rangehigh[$i]},\n                                                unit_measure='{$uom}',\n                                                amt={$amt[$i]}, transaction = '{$ptype}'", "fee_id={$feeid[$i]}");
         } else {
             if ($userenew == true) {
                 $insnew = InsertQuery($dbtype, $dbLink, "boat_fee", "", "'','{$boat_type}',{$rangelow[$i]},\n\t\t\t\t\t\t\t{$rangehigh[$i]},'{$uom}',{$amt[$i]},'New',1,3");
                 $insrenew = InsertQuery($dbtype, $dbLink, "boat_fee", "", "'','{$boat_type}',{$rangelow[$i]},\n\t                        {$rangehigh[$i]},'{$uom}',{$amt[$i]},'ReNew',1,3");
             } else {
                 $insnew = InsertQuery($dbtype, $dbLink, "boat_fee", "", "'','{$boat_type}',{$rangelow[$i]},\n\t                        \t                {$rangehigh[$i]},'{$uom}',{$amt[$i]},'{$ptype}',1,3");
             }
         }
         $i++;
     }
     if ($updateit == '1') {
         ?>
                         <body onload='UpRec();parent.location="index.php?part=4&class_type=Preference&selMode=ebpls_nboatfees&permit=others&action_=8&itemEvent=1&data_item=0&orderbyasdes=1"';></body>
                 <?php 
     } else {
Example #23
0
    $updateit = UpdateQuery($dbtype, $dbLink, $permittable, "steps='For Releasing'", "owner_id={$owner_id} and business_id={$business_id}");
    // save fees paid
    $gettag = SelectDataWhere($dbtype, $dbLink, "ebpls_buss_preference", "");
    $gettag = FetchArray($dbtype, $gettag);
    if ($gettag[sassess] == '') {
        //check if have rec
        $chkit = SelectDataWhere($dbtype, $dbLink, "bus_fees_paid", "where owner_id={$owner_id} and \n\t\t\t\t\t\tbusiness_id={$business_id}");
        $chkit = NumRows($dbtype, $chkit);
        if ($chkit == 0) {
            $getfee = SelectDataWhere($dbtype, $dbLink, "ebpls_buss_tfo", "where\ttfoindicator=1 and \n\t\t\t\t\t\ttaxfeetype!=1 and tfostatus='A'");
            while ($getf = FetchRow($dbtype, $getfee)) {
                $insit = InsertQuery($dbtype, $dbLink, "bus_fees_paid", "''", "'',{$owner_id}, {$business_id},\n\t\t\t\t\t\t{$getf['0']}, {$getf['6']},now())");
            }
        }
    }
    $updatebusnature = UpdateQuery($dbtype, $dbLink, "tempbusnature", "linepaid=5,recpaid=1", "owner_id={$owner_id} and business_id={$business_id} and active='1'");
    ?>
                        <body onunload='opener.location.reload(true); ' onLoad='window.open("ebplsreceipt.php?owner_id=<?php 
    echo $owner_id;
    ?>
&business_id=<?php 
    echo $business_id;
    ?>
&or_no=<?php 
    echo $or_no;
    ?>
&cn=<?php 
    echo $orno;
    ?>
&cmd=<?php 
    echo $cmd;