$data = lookupService($userid, $service); echo $data; } //lookupService if ($task == "getTasks") { echo getTasks(); } //task getTimes if ($task == "addTask") { $description = $request->taskdescription; echo addTask($description); } //task addProject if ($task == "getAllEntries") { $billed = $request->includebilled; $data = getAllEntries($userid, $billed); echo $data; } //task getAllEntries if ($task == "loadAllInvoices") { $data = loadAllInvoices($userid); echo $data; } //task loadAllInvoices if ($task == "generateInvoiceNumber") { $data = generateInvoiceNumber($userid); echo $data; } //task generateInvoiceNumber if ($task == "saveInvoice") { $invoiceid = $request->invoiceid;
</head> <body> <div class="block"> <div class="cell" style="float: left; clear: all; width: auto;"> <h1>Survey results</h1> <p><a href="/homework/hw4/index.html">Back to Homework 4</a></p> </div> </div> <?php require "api.php"; global $guest; global $party; global $guest_party; $res = getAllEntries(1); $rows = count($res); if ($rows == 0) { print "<script>alert('There are no entries now!'); window.location.href = 'http://162.105.146.180:8122/homework/hw4/index.html#q4'</script>"; } else { print "<div class='panel'>"; print " <h1>Results</h1> "; print "<div class='main' style='width: auto; border-width: 0px'>"; print " <table style='margin-left: auto; margin-right: auto;'>"; print " <tr> "; print " <td>Entry no.</td> "; print " <td>Guest</td> "; print " <td>Party</td> "; print " <td>Delete</td> "; print " </tr> "; }