Creating a report from a text file. But got a problem with it showing 2 results per SMS. Want 1 report/ SMS

From: J (
Date: 02/28/05

Date: Mon, 28 Feb 2005 20:51:21 GMT

Hi All

I have this working but it gives 2 outputs per number, I would just want it
to give 1 output, but change as the delivery status changes (from 003 to

I have a text file with this isn:
--------------------- text file ---------------------------

The end ID is always different, its an ID for a text message that is sent.
003 at the beginning = delivered to SMS server
004 " " = Delivered to Mobile phone.

I want the report to read something like:
(but it shows every line, so 2 reports per sms, not one report per sms)

----------- Report ---------------------
Number sent to: 447887841666 | sent from: 447849194666
Used: 1.5 Credits | Status: Delivered to Phone

Number sent to: 447887841333 | sent from: 447849194333
Used: 1.5 Credits | Status: Delivered to SMS server (If not delivered to
phone yet)

Number sent to: 447887841111 | sent from: 447849194111
Used: 1.5 Credits | Status: Delivered to Phone

--------- Script--------------
$file = file("status.txt");

echo "<table border=0 id=table2 align=center><tr>";

// Get amount of lines in file
$totalLines = sizeof($file);
// Loop through and display all users
for($line = 0; $line < $totalLines; $line++){
$formdate = date("d-m-y H:i:s", $timedate +5);
    // Dont print out lines beginning with a comment
    if("//" != substr($file[$line], 0, 2)){
        // Put contents of line into variables
        @list($nothing1, $status, $timedate, $to, $from, $creditused, $id) =
explode("<del>", $file[$line]);

        $string .= "<tr><td><font face=verdana size=2>Message to: <input
readOnly value=\"$to\" name=to id=to size=15></td>";
        $string .= "<td>From<input readOnly value=\"$from\" name=from
id=from size=15></td>";
        $string .= "<td>Used: ". $creditused. " credits</a></td></tr>";
        $string .= "<td>Time: $formdate Status: ";

        if ($status == 003){
         $string .= "Delivered to SMS server<br>";
        if ($status == 004){
         $string .= "Delivered to Phone<br>";
        " credits</a></td></tr>";

        echo $string;

Any ideas?
Thanks all,

Relevant Pages

  • Re: new record and form
    ... So i have 4 tab pages Registration, progress, delivery and baby, and after delivery care. ... I do believe however that it is important that your database models the entity type which is the relationship between a mother and her infants *in the context of the database*. ... As regards a report this is, as Phil has pointed out, more a question of creating a query which joins the relevant tables and returns rows for each shift. ...
  • Re: Please help, Report Prob
    ... After trying out the report sometimes, ... delivery address and cust_code. ... set order to prod_code ... what ever business rule you use for consolidation. ...
  • Re: Dealing with Duplicate Information
    ... it in summary format so I can retain it, add to it without duplicating, ... listed just one example from the report I'm working with. ... each seperate delivery number has ...
  • Re: Delivery reports... or NOT !!!!
    ... Just wondering if anyone else has this same problem that Delivery ... positive feedback that they got your e-mail. ... a delivery report can be used by spammers to validate their ... Acknowlegements to read receipt requests are handled by the recipient's ...
  • Re: Report Footer totals
    ... OrderID, CustomerCode, ShippedDate, DeliveryCharge etc) and tblOrderDetails ... Each line in the report is a summary of a sale (displayed in the OrderID ... My problem is displaying the total delivery charges for the report. ...