| Server IP : 209.209.40.120 / Your IP : 216.73.217.112 Web Server : Microsoft-IIS/10.0 System : Windows NT NEWWWW 10.0 build 17763 (Windows Server 2019) i586 User : NEWWWW$ ( 0) PHP Version : 8.3.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /software/Services/EmailPenpalAfrica/php/ |
Upload File : |
<?PHP
$filename = "LTE DATA_UC_UT.xml";
$fp = fopen($filename, "r");//open file in read mode
$contents = fread($fp, filesize($filename));//read file
//$contents = '';
$cnt=1;
$cnt1=0;
$tdf_id_start =1;
while ($cnt ==1){
$tdf_id_first = strpos($contents,'<Node OfferId="',$tdf_id_start);
$tdf_id_second = strpos($contents,'"',$tdf_id_first+15);
$cnt1++;
//echo $tdf_id_first."\n";
//echo $tdf_id_second."\n";
//if($cnt1==2)
//exit();
if($tdf_id_first>0){
$offer = substr($contents,$tdf_id_first+15,$tdf_id_second-($tdf_id_first+15));
echo $offer;
$replac_str1= 'BooleanOperator<Operation>AND</Operation><Condition>ActiveOffer<ActiveOffer>'.$offer.'</ActiveOffer></Condition><Condition>FieldSelection<Field Context="ALL fields" condition="String" field="3GPP-SGSN-MCC-MNC"/><Text>63510</Text><Comparation>3</Comparation><MatchCase>false</MatchCase></Condition><Condition>';
$replac_str2= 'FieldSelection<Field Context="ALL fields" condition="UsageCounter" field="UsageThreshold">';
//$replac_str3= 'UT<Condition>BooleanOperator<Operation>AND</Operation><Condition>FieldSelection<Field Context="ALL fields" condition="UsageCounter" field="UsageThreshold">';
}
//first insert
if($tdf_id_first>0 && $offer !=""){
//echo $offer."\n";
$tdf_id_third = strpos($contents,'FieldSelection<Field Context="ALL fields" condition="UsageCounter" field="UsageThreshold">',$tdf_id_second);
$contents =substr_replace($contents, $replac_str1, $tdf_id_third, 0);
}
$tdf_id_start= $tdf_id_third;
$offer="";
//$tdf_id_second=0;
//echo $tdf_id_first."\n";
//echo $tdf_id_second."\n";
//echo $tdf_id_third."\n";
//echo $tdf_id_fourth."\n";
//$cnt= $tdf_id_start;
if($tdf_id_first>0)
$cnt=1;
else
$cnt=0;
//echo $cnt1++;
// echo "first".$tdf_id_first."offer".$offer;
// if($cnt1 >0)
// $cnt=0;
}
$fp = fopen('LTE DATA_UC_UT.txt', 'a');
fwrite($fp,$contents);
echo "Done";
exit();
?>