session_start(); require_once '../classes/connection.class.php'; require_once '../classes/event.class.php'; $addeventobj = new Event(); /*echo '<pre>'; print_r($addeventobj); echo '</pre>'; exit; */ $event_id = mysqli_real_escape_string($addeventobj->conxn, $_POST['event_id']); $event_title = mysqli_real_escape_string($addeventobj->conxn, $_POST['title']); $event_desc = mysqli_real_escape_string($addeventobj->conxn, $_POST['desc']); $event_date = mysqli_real_escape_string($addeventobj->conxn, $_POST['date']); $addeventobj->setEventID($event_id); $addeventobj->setEventTitle($event_title); $addeventobj->setEventDesc($event_desc); $addeventobj->setEventDate($event_date); //$adduserobj->setError($er); //$adduserobj->setMessage($msg); $addeventobj->addEvent(); /*echo '<pre>'; print_r ($adduserobj); echo '</pre>'; exit;*/ if ($addeventobj) { header('location:../index.php?page=event&action=view'); $_SESSION['msg'] = $addeventobj->msg = "The event has been added sucessfully"; } else { echo $_SESSION['msg'] = $addeventobj->msg = "Sorry the event has not been added, please try again later"; }
<?php require_once '../classes/connection.class.php'; require_once '../classes/event.class.php'; require_once '../classes/locate.class.php'; if (isset($_POST['submit'])) { $event_id = $_POST['event_id']; $event_title = $_POST['title']; $event_desc = $_POST['desc']; $event_date = $_POST['event_date']; } $updateEventObject = new Event(); $updateEventObject->setEventID($event_id); $updateEventObject->setEventTitle($event_title); $updateEventObject->setEventDesc($event_desc); $updateEventObject->setEventDate($event_date); $flag = $updateEventObject->updateevent(); /*echo '<pre>'; print_r($updatePostObject); echo '</pre>'; exit;*/ if ($flag) { $_SESSION['event_updated'] = $err = "The event has been updated successfully"; new Locate('../index.php?page=event&action=view'); } else { $_SESSION['event_not_updated'] = $err = "The event couldn't be updated"; new Locate('../index.php?page=event&action=view'); }
$usageEvent1 = new Event(); $usageEvent1->setMerchantEventId("eventID-1-" . $testId); // unique Id $usageEvent1->setEventDate('2015-03-27T06:29:34-07:00'); $usageEvent1->setDescription("Service usage"); $usageEvent1->setMerchantAutoBillId("subscriptionID101"); // CashBox will automatically identify which AutoBill item the event should be // applied to if there are no more than one item with same product. If the // subscription $usageEvent1->setMerchantProductId("ratedPriceProduct"); $usageEvent1->setAmount(14902); // Separate event related to another subscription can be reported in a single call $usageEvent2 = new Event(); $usageEvent2->setMerchantEventId("eventID-2-" . $testId); // unique Id $usageEvent2->setEventDate('2015-03-28T23:59:00-07:00'); $usageEvent2->setDescription("Service usage"); $usageEvent2->setMerchantAutoBillId("subscriptionID102"); $usageEvent2->setMerchantProductId("regular-product"); $usageEvent2->setAmount(159002); // Now let's record the two events with CashBox $rp = new RatePlan(); // This is the SOAP interface that supports the recordEvent call $response = $rp->recordEvent(array($usageEvent1, $usageEvent2)); // up to 50 events can be put in the array print_r($response); if ($response['returnCode'] == 200) { print "Successfully reported events. Call SOAP ID" . $response['data']->return->soapId . "\n"; } else { print "Events could not be reported"; print "Return code: " . $response['returnCode'] . " Return string: " . $response['returnString'] . " Call SOAP ID: " . $response['data']->return->soapId . "\n";