Exemplo n.º 1
0
    <body>
        <?php 
error_reporting(E_ALL);
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
ini_set('display_errors', '1');
// session_start();
require_once '../php/EPConfigFile.php';
require_once '../php/EPListProvider.php';
require_once '../php/EPPersistentDataManager.php';
require_once '../php/EPConfigFile.php';
require_once '../php/EPBonusMalus.php';
require_once '../php/EPGear.php';
$epListP = new EPListProvider('../php/config.ini');
$persistManager = new EPPersistentDataManager('../php/config.ini');
$_SESSION['gearList'] = $epListP->getListGears();
$_SESSION['bmList'] = $epListP->getListBonusMalus();
if (isset($_POST['addGear'])) {
    $bmlistInject = array();
    if (isset($_POST['selectedBM'])) {
        foreach ($_POST['selectedBM'] as $bm) {
            $bmObj = $epListP->getBonusMalusByName($bm);
            array_push($bmlistInject, $bmObj);
        }
    }
    $arm_k = "0";
    if (!empty($_POST['armorKinetic'])) {
        $arm_k = $_POST['armorKinetic'];
    }
    $arm_e = "0";
    if (!empty($_POST['armorEnergy'])) {
        $arm_e = $_POST['armorEnergy'];
Exemplo n.º 2
0
     echo "<br>";
 } else {
     echo "Aptitude Deleted ! <br>";
 }
 //Background
 echo "<br><br>BACKGROUND DELETION------------------------------------------ <br><br>";
 $bm1 = new EPBonusMalus("TODELETE1", EPBonusMalus::$ON_APTITUDE, 5);
 $bm2 = new EPBonusMalus("TODELETE2", EPBonusMalus::$ON_SKILL_PREFIX, 20, "Networking", "", array("Hacker pack", "Scientist base tech"));
 $bm1_1 = new EPBonusMalus("COG 5 Bonus", EPBonusMalus::$ON_APTITUDE, 5);
 $bm1_2 = new EPBonusMalus("COG 5 Bonus", EPBonusMalus::$ON_APTITUDE, 5);
 $bm1_3 = new EPBonusMalus("COG 5 Bonus", EPBonusMalus::$ON_APTITUDE, 5);
 $bm2_1 = new EPBonusMalus("Free Networking 20 Bonus", EPBonusMalus::$ON_SKILL_PREFIX, 20, "Networking", "", array("Hacker pack", "Scientist base tech"));
 $bm2_2 = new EPBonusMalus("Free Networking 20 Bonus", EPBonusMalus::$ON_SKILL_PREFIX, 20, "Networking", "", array("Hacker pack", "Scientist base tech"));
 $bm3_1 = new EPBonusMalus("Circadian Regulation", EPBonusMalus::$DESCRIPTIVE_ONLY, 0, "", "The character dreams constantly while asleep and can both fall asleep and wake up almost instantly. In addition, the character can easily and with no ill-effects shift to a 2-day cycle, where they are awake for 44 hours and sleep for 4.");
 $bonusMalusArray = array($bm1_1, $bm1_2, $bm1_3, $bm2_1, $bm2_2, $bm3_1);
 array_merge($bonusMalusArray, $listProvider->getListBonusMalus());
 $trait1 = new EPTrait("TODELETE3", "sting in the rule, just for test", EPTrait::$POSITIVE_TRAIT, EPTrait::$MORPH_TRAIT, 10, $bonusMalusArray);
 $toDelBackgrounds = new EPBackground('BACKGROUND_TODELETE', 'Bla bla bla bla', EPBackground::$ORIGIN, array($bm1_1, $bm1_2, $bm1_3, $bm2_2), array($trait1), array('TODELETE4', 'TODELETE5'), array('TODELETE5', 'TODELETE6'));
 if (!$persistManager->persistBackground($toDelBackgrounds)) {
     echo $persistManager->getLastError();
     echo "<br>";
 } else {
     echo "Background added ! <br>";
 }
 if (!$persistManager->deleteBackground($toDelBackgrounds->name)) {
     echo $persistManager->getLastError();
     echo "<br>";
 } else {
     echo "Background Deleted ! <br>";
 }
 //BonusMalus
        <title>Manage Bonus / Malus</title>
    </head>
    <body>
        <?php 
error_reporting(E_ALL);
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
ini_set('display_errors', '1');
// session_start();
require_once 'EPPersistentDataManager.php';
require_once '../php/EPConfigFile.php';
require_once '../php/EPListProvider.php';
require_once '../php/EPConfigFile.php';
require_once '../php/EPBonusMalus.php';
$epListP = new EPListProvider('../php/config.ini');
$persistManager = new EPPersistentDataManager('../php/config.ini');
$_SESSION['bonusmalusList'] = $epListP->getListBonusMalus();
if ($_SESSION['bonusmalusList'] == null) {
    echo $epListP->getLastError();
}
$_SESSION['groupsList'] = $epListP->getListGroups();
if (isset($_POST['addBonusmalus'])) {
    $glistInject = array();
    if (isset($_POST['selectedGroups'])) {
        foreach ($_POST['selectedGroups'] as $g) {
            array_push($glistInject, $g);
        }
    }
    $arrayNewGroups = explode(";", $_POST['newGroups']);
    if ($arrayNewGroups != null || $arrayNewGroups != "") {
        foreach ($arrayNewGroups as $h) {
            if (!empty($h)) {