| 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 : C:/New folder/New folder/software/Services/EmailPenpalAfrica/php/ |
Upload File : |
<?PHP
$filename = "PWC_PA02_31.xml";
$fp = fopen($filename, "r");//open file in read mode
$contents = fread($fp, filesize($filename));//read file
//$contents = 'suiiuuiweuieuiiw jiei weiuie e<Node OfferId="410001" type="OfferNode">NewYoloDataNightBonus1GB<Condition>TimeOfDay<From>00:00:00</From><To>05:59:59</To></Condition><Node>UC<UT<Condition>FieldSelection<Field Context="ALL fields" condition="UsageCounter" field="UsageThreshold"><Index><Value datatype="Integer">410301</Value></Index></Field><Operation>LT</Operation><Operator>MUL</Operator><FactorValue>100.0</FactorValue><Limit>true</Limit><Termination>false</Termination></Condition><Node>UC<UT<Tariff>AccountUnitTypeRate<UnitType>Volume Total</UnitType><Price>1.0<Factor>1</Factor></Price><UseUnifiedInterval>false</UseUnifiedInterval><Interval>1<Factor>1024</Factor></Interval><NonMoneyInterval>1<Factor>1024</Factor></NonMoneyInterval><UpdateType>Active</UpdateType><UsageCounter ID="410301"/><NonMonetaryFactor>1.0</NonMonetaryFactor></Tariff></Node></Node></Node><Node OfferId="918" type="OfferNode">YOLOPromo500MBsReward<Node>UC<UT<Condition>FieldSelection<Field Context="ALL fields" condition="UsageCounter" field="UsageThreshold"><Index><Value datatype="Integer">240</Value></Index></Field><Operation>LT</Operation><Operator>MUL</Operator><FactorValue>100.0</FactorValue><Limit>true</Limit><Termination>false</Termination></Condition><Node>UC<UT<Tariff>SetField<TreeDefinedField>PackName</TreeDefinedField><CopyFrom/><Value>YOLOPromo500MBsReward</Value></Tariff><Tariff>AccountUnitTypeRate<UnitType>Volume Total</UnitType><Price>1.0<Factor>1</Factor></Price><Interval>1<Factor>1024</Factor></Interval><NonMoneyInterval>1<Factor>1024</Factor></NonMoneyInterval><UpdateType>Active</UpdateType><UsageCounter ID="240"/><NonMonetaryFactor>1.0</NonMonetaryFactor></Tariff></Node></Node></Node><Node OfferId="914" type="OfferNode">YOLOPromoOptIn100MBsGift<Node>UC<UT<Condition>FieldSelection<Field Context="ALL fields" condition="UsageCounter" field="UsageThreshold"><Index><Value datatype="Integer">239</Value></Index></Field><Operation>LT</Operation><Operator>MUL</Operator><FactorValue>100.0</FactorValue><Limit>true</Limit><Termination>false</Termination></Condition><Node>UC<UT<Tariff>SetField<TreeDefinedField>PackName</TreeDefinedField><CopyFrom/><Value>YOLOPromoOptIn100MBsGift</Value></Tariff><Tariff>AccountUnitTypeRate<UnitType>Volume Total</UnitType><Price>1.0<Factor>1</Factor></Price><Interval>1<Factor>1024</Factor></Interval><NonMoneyInterval>1<Factor>1024</Factor></NonMoneyInterval><UpdateType>Active</UpdateType><UsageCounter ID="239"/><NonMonetaryFactor>1.0</NonMonetaryFactor></Tariff></Node></Node></Node><Node OfferId="2180" type="OfferNode">50MBs Non Expiry Bundle<Node>UC<UT<Condition>FieldSelection<Field Context="ALL fields" condition="UsageCounter" field="UsageThreshold"><Index><Value datatype="Integer">2180</Value></Index></Field><Operation>LT</Operation><Operator>MUL</Operator><FactorValue>100.0</FactorValue><Limit>true</Limit><Termination>false</Termination></Condition><Node>UC<UT<Tariff>SetField<TreeDefinedField>PackName</TreeDefinedField><CopyFrom/><Value>50MBsNonExpiryBundle</Value></Tariff><Tariff>AccountUnitTypeRate<UnitType>Volume Total</UnitType><Price>1.0<Factor>1</Factor></Price><Interval>1<Factor>1024</Factor></Interval><NonMoneyInterval>1<Factor>1024</Factor></NonMoneyInterval><UpdateType>Active</UpdateType><UsageCounter ID="2180"/><NonMonetaryFactor>1.0</NonMonetaryFactor></Tariff></Node></Node></Node><Node OfferId="201018" id="50MBs Non Expiry Bundle" type="OfferNode">PWC Audit<Node>UC<UT<Condition>FieldSelection<Field Context="ALL fields" condition="UsageCounter" field="UsageThreshold"><Index><Value datatype="Integer">201018</Value></Index></Field><Operation>LT</Operation><Operator>MUL</Operator><FactorValue>100.0</FactorValue><Limit>true</Limit><Termination>false</Termination></Condition><Node>UC<UT<Tariff>SetField<TreeDefinedField>PackName</TreeDefinedField><CopyFrom/><Value>50MBsNonExpiryBundle</Value></Tariff><Tariff>AccountUnitTypeRate<UnitType>Volume Total</UnitType><Price>1.0<Factor>1</Factor></Price><UseUnifiedInterval>false</UseUnifiedInterval><Interval>1<Factor>1024</Factor></Interval><NonMoneyInterval>1<Factor>1024</Factor></NonMoneyInterval><UpdateType>Active</UpdateType><UsageCounter ID="201018"/><NonMonetaryFactor>1.0</NonMonetaryFactor></Tariff></Node></Node></Node><Node OfferId="2181" type="OfferNode">130MBs Non Expiry Bundle<Node>UC<UT<Condition>FieldSelection<Field Context="ALL fields" condition="UsageCounter" field="UsageThreshold"><Index><Value datatype="Integer">2181</Value></Index></Field><Operation>LT</Operation><Operator>MUL</Operator><FactorValue>100.0</FactorValue><Limit>true</Limit><Termination>false</Termination></Condition><Node>UC<UT<Tariff>SetField<TreeDefinedField>PackName</TreeDefinedField><CopyFrom/><Value>130MBsNonExpiryBundle</Value></Tariff><Tariff>AccountUnitTypeRate<UnitType>Volume Total</UnitType><Price>1.0<Factor>1</Factor></Price><Interval>1<Factor>1024</Factor></Interval><NonMoneyInterval>1<Factor>1024</Factor></NonMoneyInterval><UpdateType>Active</UpdateType><UsageCounter ID="2181"/><NonMonetaryFactor>1.0</NonMonetaryFactor></Tariff></Node></Node></Node>';
$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));
$replac_str1= "<Condition>ActiveOffer<ActiveOffer>$offer</ActiveOffer></Condition></Condition>";
$replac_str2= 'UT<Condition>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_fourth = strpos($contents,'<Node>UC<UT<Tariff>SetField<TreeDefinedField>PackName</TreeDefinedField>',$tdf_id_second);
$tdf_id_fifth = strpos($contents,'<Node OfferId="',$tdf_id_second);
// if($offer =="410001" || $offer =="421010"){
// echo $offer."nosa"."\n";
// $tdf_id_third = strpos($contents,$replac_str2,$tdf_id_second);
//}else{
//start of 410001
if($tdf_id_fourth>$tdf_id_fifth){
if(!$tdf_id_fifth >0){
// echo $offer."\n";
$tdf_id_third = strpos($contents,$replac_str2,$tdf_id_second);
$contents =substr_replace($contents, $replac_str3, $tdf_id_third, 103);
$tdf_id_fourth = strpos($contents,'<Node>UC<UT<Tariff>SetField<TreeDefinedField>PackName</TreeDefinedField>',$tdf_id_third);
$contents =substr_replace($contents, $replac_str1, $tdf_id_fourth, 0);
// $tdf_id_fourth = strpos($contents,'<Node>UC<UT<Tariff>SetField<TreeDefinedField>PackName</TreeDefinedField>',$tdf_id_second);
}else{
echo $offer."hello".$tdf_id_fourth."\n";
if($offer !="204000" ){
$replac_str1= "<Condition>ActiveOffer<ActiveOffer>$offer</ActiveOffer></Condition>";
$tdf_id_third = strpos($contents,$replac_str2,$tdf_id_second);
$tdf_id_fourth = strpos($contents,'<Node>UC<UT<Tariff>AccountUnitTypeRate<UnitType>',$tdf_id_third);
$contents =substr_replace($contents, $replac_str1, $tdf_id_fourth, 0);
}else{
$tdf_id_third = strpos($contents,$replac_str2,$tdf_id_second);
}
}
}else{
$tdf_id_third = strpos($contents,$replac_str2,$tdf_id_second);
$contents =substr_replace($contents, $replac_str3, $tdf_id_third, 103);
$tdf_id_fourth = strpos($contents,'<Node>UC<UT<Tariff>SetField<TreeDefinedField>PackName</TreeDefinedField>',$tdf_id_third);
$contents =substr_replace($contents, $replac_str1, $tdf_id_fourth, 0);
// $tdf_id_fourth = strpos($contents,'<Node>UC<UT<Tariff>SetField<TreeDefinedField>PackName</TreeDefinedField>',$tdf_id_second);
}
// }//end of 410001
}
$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('DATA_Offer_Driven_Rating_UC_UT_31.txt', 'a');
fwrite($fp,$contents);
echo "Done";
exit();
?>