Example #1
0
 $ap[4] = new EPAptitude('Savvy', EPAptitude::$SAVVY);
 $ap[5] = new EPAptitude('Somatic', EPAptitude::$SOMATICS);
 $ap[6] = new EPAptitude('Willpower', EPAptitude::$WILLPOWER);
 foreach ($ap as $a) {
     if (!$persistManager->persistAptitude($a)) {
         echo $persistManager->getLastError();
         echo "<br>";
     } else {
         echo "DONE ! <br>";
     }
 }
 //Echo Aptitude
 echo "<br><br>APTITUDE LIST------------------------------------------ <br><br>";
 $aptitudeList = $listProvider->getListAptitudes($configValues->getValue('RulesValues', 'AptitudesMinValue'), $configValues->getValue('RulesValues', 'AptitudesMaxValue'));
 if ($aptitudeList == null) {
     echo $listProvider->getLastError();
     echo "<br>";
 } else {
     foreach ($aptitudeList as $m) {
         echo $m->name . " Desc : " . $m->description . " Abbr. : " . $m->abbreviation . "<br>";
         echo "Aptitudes on groups : <br>";
         $groupsList = $m->groups;
         foreach ($groupsList as $g) {
             echo "-> " . $g;
             echo '<br>';
         }
         echo '<br>';
     }
 }
 //Add  skill
 echo "<br><br>ADDING SKILL  --------------------------------------------- <br><br>";
    <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)) {
                array_push($glistInject, $h);
            }