Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- $Day = date("l");
- $Hour = date("G");
- if($Day != 'Sunday' && $Hour >= 6 && $Hour <= 18){
- $HTML = array(
- array("<a title='' target='_blank' href='https://productimageserver.com/rebates/",".pdf'>","</a>"),
- array("<a href='index.php?rebates=","'>","</a>"),
- array("<br><span class='rebates'>","</span><br><span class='rebatedate'>the rebate period is ","</span><br><br>"));
- $MFG = array("ACR","Blue Sea","FLIR Systems","Furuno","Garmin","KVH","Lowrance","Spot","Standard Horizon","Vesper");
- $MFGlist = 'xlist.txt';
- copy("xlist.txt", "xlist.bak");
- for($i = 0; $i <= count($MFG) - 1; $i++){
- if(file_exists($MFG[$i] . ".reb")){copy($MFG[$i] . ".reb", $MFG[$i] . ".reb.bak");}
- $CWRfile = $MFG[$i] . '.tab';
- $Rebfile = $MFG[$i] . '.reb';
- $CWRArray = file($CWRfile);
- $Rebfilehandle = fopen($Rebfile, 'w');
- foreach($CWRArray as $line){
- $CWRresultArray = explode("\t", $line);
- if ($CWRresultArray[3] == 1){
- fwrite($Rebfilehandle, $HTML[0][0] . $CWRresultArray[0] . $HTML[0][1] . $CWRresultArray[2] . $HTML[0][2] . $HTML[2][0] . $CWRresultArray[4] . $HTML[2][1] . $CWRresultArray[5] . " to " . $CWRresultArray[6] . $HTML[2][2]);
- }} fclose($Rebfilehandle);
- $OldReb = file_get_contents($MFG[$i] . ".reb.bak");
- $NewReb = file_get_contents($Rebfile);
- if($OldReb != $NewReb){
- mail("webmaster@somdcomputerguy.com", $MFG[$i] . " Change", "http://somdcomputerguy.com/Rebates/rebates.php?page=$MFG[$i]");
- }
- }
- $MFGlisthandle = fopen($MFGlist, 'w');
- foreach(glob("*.reb") as $RebFilename){
- $RebArray = file($RebFilename);
- $RebPieces = explode(".", $RebFilename);
- if(filesize($RebFilename) != 0){ fwrite($MFGlisthandle, $HTML[1][0] . $RebPieces[0] . $HTML[1][1] . $RebPieces[0] . "<span class='noofrebs'> " . (count($RebArray) - 1) . '</span>' . $HTML[1][2]);
- }} fclose($MFGlisthandle); }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement