** ************************************************************************************************************************** */ session_start(); include_once 'directory.php'; //print header $pageTitle = _('SUSHI Import'); include 'templates/header.php'; //this a SUSHI Service ID has been passed in, it needs to be run if (isset($_POST['sushiServiceID']) and $_POST['sushiServiceID'] > 0) { $sushiServiceID = $_POST['sushiServiceID']; $sushiService = new SushiService(new NamedArguments(array('primaryKey' => $sushiServiceID))); $sushiService->setImportDates($_POST['startDate'], $_POST['endDate']); //try to run! try { $logText = $sushiService->runAll($_POST['overwritePlatform']); } catch (Exception $e) { $logText = $e->getMessage(); } $logText = "<div class='headerText'>" . _("Sushi Output Log:") . "</div>" . nl2br($logText) . "<br /><br />"; } ?> <script type="text/javascript" src="js/sushi.js"></script> <table class="headerTable" style="background-image:url('images/header.gif');background-repeat:no-repeat;"> <tr><td> <table style='width:897px;'> <tr style='vertical-align:top'> <td><span class="headerText"><?php echo _("SUSHI Administration");
$sushiService->password = $_POST['password']; $sushiService->serviceDayOfMonth = $_POST['serviceDayOfMonth']; $sushiService->noteText = $_POST['noteText']; try { $sushiService->save(); } catch (Exception $e) { echo $e->getMessage(); } break; case 'runSushiService': //update if (isset($_GET['sushiServiceID']) && $_GET['sushiServiceID'] != '') { $sushiService = new SushiService(new NamedArguments(array('primaryKey' => $_GET['sushiServiceID']))); //try to run! try { $sushiService->runAll(); } catch (Exception $e) { echo $e->getMessage(); } } break; case 'testSushiService': //update if (isset($_GET['sushiServiceID']) && $_GET['sushiServiceID'] != '') { $sushiService = new SushiService(new NamedArguments(array('primaryKey' => $_GET['sushiServiceID']))); //try to run! try { echo $sushiService->runTest(); } catch (Exception $e) { echo $e->getMessage(); }