Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I can't seem to get the php program to write the results to the fshp and fbo files under the function write files section at

I can't seem to get the php program to write the results to the fshp and fbo files under the function write files section at the bottom of the code to complete writing to the files. I am not allowed to use global.

// END MAINLINE function PrepareFiles(&$fshp,&$fbo ) { $fshp = fopen("shipped.txt", "w") or die("shipped not opened"); fprintf($fshp," SHIPPED REPORT "); fprintf($fshp," Order Id Item Id Shipped Message "); $fbo = fopen("backorder.txt", "w") or die("backorder not opened"); fprintf($fbo," BACK ORDER REPORT "); fprintf($fbo," Order Id Item Id Backordered "); } function DoCalcs($qtyOnHand,$qtyRequested, &$qtyShipped, &$qtyBackOrdered, &$message) { printf(" DoCalcs "); /// if($qtyRequested <= $qtyOnHand) { $qtyShipped = $qtyRequested; $qtyBackordered = 0; $message = "Fully Filled"; } else { if($qtyOnHand !=0) { $qtyShipped = $qtyOnHand; $qtyBackOrdered = $qtyRequested - $qtyOnHand; $message = "Partially Filled"; } else { $qtyShipped = 0; $qtyBackOrdered = $qtyRequested; $message = "Out of Stock"; } } }

function WriteFiles($fship, $fbo, $orderId, $itemId, $qtyOnHand, $qtyRequested, &$qtyShipped, &$qtyBackOrdered, &$message) { printf(" WriteFiles "); fprintf($fshp, "$orderId $itemId $qtyShipped $message "); fprintf($fbo, "$orderId $itemId $qtyBackOrdered ");

}

?>

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Principles Of Multimedia Database Systems

Authors: V.S. Subrahmanian

1st Edition

1558604669, 978-1558604667

More Books

Students also viewed these Databases questions

Question

Question Can a self-employed person adopt a money purchase plan?

Answered: 1 week ago