Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php require "../database.php"; require "../classes/netxusa/netxusa.class.php"; //erro..

Decoded Output download

<?php 
require "../database.php"; 
require "../classes/netxusa/netxusa.class.php"; 
//error_reporting(15); 
 
$pullorders = new DB_Sql; 
$pullorders->query("select * from netxusaorders where macsprovisioned is NULL"); 
 
while($pullorders->next_record()){ 
 
        $netxusaordersid=$pullorders->f("netxusaordersid"); 
        $ordernumber=$pullorders->f("ordernumber"); 
        $phonecount=$pullorders->f("phonecount"); 
        $locationid=$pullorders->f("locationid"); 
        $orgid=$pullorders->f("orgid"); 
        $order[ordernumber]=$ordernumber; 
        $getmacs = new netxusa(0); 
        $getmacs->fetchdevicelist($order); 
        if($getmacs->error==0) 
        { 
//print $getmacs->response; 
                $lines=explode("
",$getmacs->response); 
                $newphonecount=count($lines); 
                $newphonecount=$newphonecount-1; 
                        //print $newphonecount; 
 
                if($newphonecount==$phonecount){ 
                        //all the macs have been provisioned, so lets load the order 
 
                        $linescount=count($lines); 
                        for($x=1;$x<=$linescount;$x++){ 
                                list($make,$partnumber,$mac,$serialnumber)=explode(",",$lines[$x]); 
 
                                $mac=strtolower($mac); 
 
                                $gethandsetid = new DB_Sql; 
                                $gethandsetid->query("select handsetid,phonemakeid from handset where polycomtag='polycom:$partnumber'"); 
                                $gethandsetid->next_record(); 
                                $handsetid=$gethandsetid->f("handsetid"); 
                                $phonemakeid=$gethandsetid->f("phonemakeid"); 
 
                                $checkmac = new DB_Sql; 
                                $checkmac->query("select macaddressid from macaddress where macaddress='$mac'"); 
 
                                //print "select count(macaddressid) from macaddress where macaddress='$mac'"; 
                                if($checkmac->num_rows()==0){ 
 
                                        if($mac!=""){ 
                                        $addmac = new DB_Sql; 
                                        $addmac->query("insert into macaddress 
                        (macaddress,orgid,locationid,phonemakeid,assigned,handsetid,netxusaordersid) 
                        values 
                        ('$mac','$orgid','$locationid','$phonemakeid','0','$handsetid','$netxusaordersid')"); 
                                } 
                                } 
                        } 
 
 
//update order 
$setmacprov = new DB_Sql; 
                        $setmacprov->query("update netxusaorders set macsprovisioned='Yes' where netxusaordersid='$netxusaordersid'"); 
 
                } 
 
 
        } 
        else 
        { 
 
                //error occured so exit 
        } 
 
} 
exit; 
?>

Did this file decode correctly?

Original Code

<?php
require "../database.php";
require "../classes/netxusa/netxusa.class.php";
//error_reporting(15);

$pullorders = new DB_Sql;
$pullorders->query("select * from netxusaorders where macsprovisioned is NULL");

while($pullorders->next_record()){

        $netxusaordersid=$pullorders->f("netxusaordersid");
        $ordernumber=$pullorders->f("ordernumber");
        $phonecount=$pullorders->f("phonecount");
        $locationid=$pullorders->f("locationid");
        $orgid=$pullorders->f("orgid");
        $order[ordernumber]=$ordernumber;
        $getmacs = new netxusa(0);
        $getmacs->fetchdevicelist($order);
        if($getmacs->error==0)
        {
//print $getmacs->response;
                $lines=explode("\n",$getmacs->response);
                $newphonecount=count($lines);
                $newphonecount=$newphonecount-1;
                        //print $newphonecount;

                if($newphonecount==$phonecount){
                        //all the macs have been provisioned, so lets load the order

                        $linescount=count($lines);
                        for($x=1;$x<=$linescount;$x++){
                                list($make,$partnumber,$mac,$serialnumber)=explode(",",$lines[$x]);

                                $mac=strtolower($mac);

                                $gethandsetid = new DB_Sql;
                                $gethandsetid->query("select handsetid,phonemakeid from handset where polycomtag='polycom:$partnumber'");
                                $gethandsetid->next_record();
                                $handsetid=$gethandsetid->f("handsetid");
                                $phonemakeid=$gethandsetid->f("phonemakeid");

                                $checkmac = new DB_Sql;
                                $checkmac->query("select macaddressid from macaddress where macaddress='$mac'");

                                //print "select count(macaddressid) from macaddress where macaddress='$mac'";
                                if($checkmac->num_rows()==0){

                                        if($mac!=""){
                                        $addmac = new DB_Sql;
                                        $addmac->query("insert into macaddress
                        (macaddress,orgid,locationid,phonemakeid,assigned,handsetid,netxusaordersid)
                        values
                        ('$mac','$orgid','$locationid','$phonemakeid','0','$handsetid','$netxusaordersid')");
                                }
                                }
                        }


//update order
$setmacprov = new DB_Sql;
                        $setmacprov->query("update netxusaorders set macsprovisioned='Yes' where netxusaordersid='$netxusaordersid'");

                }


        }
        else
        {

                //error occured so exit
        }

}
exit;
?>

Function Calls

None

Variables

None

Stats

MD5 b5b75dbc42ad56096754c96bd1f4cf81
Eval Count 0
Decode Time 52 ms