function getListStampHtml($atomeName)
{
    $provider = new EPListProvider('../../../php/config.ini');
    $supPastille = "<span class='";
    if ($provider->getBookForName($atomeName) == EPListProvider::$BOOK_RIMWARD) {
        $supPastille .= "RW";
    } else {
        if ($provider->getBookForName($atomeName) == EPListProvider::$BOOK_PANOPTICON) {
            $supPastille .= "PAN";
        } else {
            if ($provider->getBookForName($atomeName) == EPListProvider::$BOOK_SUNWARD) {
                $supPastille .= "SW";
            } else {
                if ($provider->getBookForName($atomeName) == EPListProvider::$BOOK_GATECRASHING) {
                    $supPastille .= "GC";
                } else {
                    if ($provider->getBookForName($atomeName) == EPListProvider::$BOOK_TRANSHUMAN) {
                        $supPastille .= "TH";
                    } else {
                        if ($provider->getBookForName($atomeName) == EPListProvider::$BOOK_ECLIPSEPHASE) {
                            $supPastille .= "EP";
                        }
                    }
                }
            }
        }
    }
    $supPastille .= "'></span>";
    return $supPastille;
}
 function connect()
 {
     $databasePDO = $this->configValues->getValue('SQLValues', 'databasePDO');
     $databaseUser = $this->configValues->getValue('SQLValues', 'databaseUser');
     $databasePassword = $this->configValues->getValue('SQLValues', 'databasePassword');
     try {
         self::$database = new PDO($databasePDO, $databaseUser, $databasePassword);
         if (!self::$database->query("SELECT * FROM `aptitude`")) {
             throw new PDOException('Aptitude table in Database is empty!  Database connection Error?');
         }
     } catch (PDOException $e) {
         error_log('Database connection failed: ');
         error_log('  ' . $databasePDO);
         error_log('  ' . $e->getMessage());
         error_log('  Current Dir:  ' . getcwd());
     }
 }
Exemple #3
0
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Manage Gear</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 '../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'];
    }
session_start();
?>
<ul class="mainlist" id="enterSkill">
	<li>
		<label class='listSection'> 1 creation points < 60 % < 2 creation points</label>
		<label class='listSection'> SPE cost 5 creation points</label>
	</li>
	<?php 
if (!$_SESSION['cc']->isNativeLanguageSet()) {
    echo "<li>\n\t\t\t\t<label>language : </label>\n\t\t\t\t<input  type='text' id='langToAdd' placeholder='Native language' />\n\t\t\t\t<span class='icone' id='addNativeLanguage' data-icon='&#x3a;'></span>\n\t\t\t\t</li>";
}
?>
	<li>
		<select id="knoprefix">
		<?php 
$provider = new EPListProvider('../../../php/config.ini');
$prefixList = $provider->getListPrefix();
foreach ($prefixList as $m) {
    if ($provider->getTypeForPrefix($m) == EPSkill::$KNOWLEDGE_SKILL_TYPE) {
        echo "<option value='" . $m . "'>" . $m . "</option>";
    }
}
?>
		</select>
		<input  type='text' id='knoToAdd' placeholder='Enter a field' />
		<span class="icone" id="addKnowSkill" data-icon="&#x3a;"></span>
	</li>
</ul>
<div id="knoSklDiv">
	<table class="skills" id="knoSkills">			    
			<thead>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Manage Morph</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 '../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/EPMorph.php';
$epListP = new EPListProvider('../php/config.ini');
$persistManager = new EPPersistentDataManager('../php/config.ini');
$_SESSION['morphList'] = $epListP->getListMorph();
$_SESSION['bmList'] = $epListP->getListBonusMalus();
$_SESSION['traitList'] = $epListP->getListTraits();
$_SESSION['gearList'] = $epListP->getListGears();
if (isset($_POST['addMorph'])) {
    $bmlistInject = array();
    if (!empty($_POST['selectedBM'])) {
        foreach ($_POST['selectedBM'] as $bm) {
            $bmObj = $epListP->getBonusMalusByName($bm);
            array_push($bmlistInject, $bmObj);
        }
    }
    $traitlistInject = array();
    if (!empty($_POST['selectedTrait'])) {
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Manage Reputation</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 '../php/EPConfigFile.php';
require_once '../php/EPListProvider.php';
require_once '../php/EPPersistentDataManager.php';
require_once '../php/EPReputation.php';
$epListP = new EPListProvider('../php/config.ini');
$persistManager = new EPPersistentDataManager('../php/config.ini');
$_SESSION['repList'] = $epListP->getListReputation();
$_SESSION['groupsList'] = $epListP->getListGroups();
if (isset($_POST['addRep'])) {
    $glistInject = array();
    foreach ($_POST['selectedGroups'] as $g) {
        array_push($glistInject, $g);
    }
    $arrayNewGroups = explode(";", $_POST['newGroups']);
    foreach ($arrayNewGroups as $h) {
        array_push($glistInject, $h);
    }
    $newRep = new EPReputation($_POST['name'], $_POST['desc'], $glistInject);
    if (!$persistManager->persistReputation($newRep)) {
        echo $persistManager->getLastError();
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Manage Trait</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/EPBonusMalus.php';
require_once '../php/EPTrait.php';
$epListP = new EPListProvider('../php/config.ini');
$persistManager = new EPPersistentDataManager('../php/config.ini');
$_SESSION['traitList'] = $epListP->getListTraits();
$_SESSION['bmList'] = $epListP->getListBonusMalus();
if (isset($_POST['addTrait'])) {
    $bmlistInject = array();
    if (isset($_POST['selectedBM'])) {
        foreach ($_POST['selectedBM'] as $bm) {
            $bmObj = $epListP->getBonusMalusByName($bm);
            array_push($bmlistInject, $bmObj);
        }
    }
    $newTrait = new EPTrait($_POST['name'], $_POST['desc'], $_POST['side'], $_POST['applyTo'], $_POST['cost'], $bmlistInject, $_POST['level'], $_POST['isFor']);
    if (!$persistManager->persistTrait($newTrait)) {
        echo $persistManager->getLastError();
        echo "<br><br>";
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Manage Stats</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/EPStat.php';
$epListP = new EPListProvider('../php/config.ini');
$persistManager = new EPPersistentDataManager('../php/config.ini');
$configValues = new EPConfigFile('./config.ini');
$_SESSION['statList'] = $epListP->getListStats($configValues, $_SESSION['cc']);
$_SESSION['groupsList'] = $epListP->getListGroups();
if (isset($_POST['addStat'])) {
    $glistInject = array();
    foreach ($_POST['selectedGroups'] as $g) {
        array_push($glistInject, $g);
    }
    $arrayNewGroups = explode(";", $_POST['newGroups']);
    foreach ($arrayNewGroups as $h) {
        array_push($glistInject, $h);
    }
    $newStat = new EPStat($_POST['name'], $_POST['desc'], $_POST['abr'], $glistInject, 0, $_SESSION['cc']);
    if (!$persistManager->persistStat($newStat)) {
function getBMHtml($bonusMalusArray, $parentName, $parentType)
{
    $provider = new EPListProvider('../../../php/config.ini');
    $prefixList = $provider->getListPrefix();
    $activeSkillList = $_SESSION['cc']->getActiveSkills();
    $knowledgeSkillList = $_SESSION['cc']->getKnowledgeSkills();
    $totalSkills = array_merge($activeSkillList, $knowledgeSkillList);
    //GRANTED BM
    if (grantedExist($bonusMalusArray)) {
        echo "<li>";
        echo "\t\t<label class='listSection'>Granted</label>";
        echo "</li>";
        foreach ($bonusMalusArray as $bm) {
            if ($bm->targetForChoice == "") {
                if ($bm->bonusMalusType == EPBonusMalus::$DESCRIPTIVE_ONLY) {
                    echo "<li>";
                    echo "\t\t<label class='bmGranted'>" . $bm->name . "</label>";
                    echo "\t\t<label class='bmGrantedDesc'>" . $bm->description . "</label>";
                    echo "</li>";
                } else {
                    echo "<li>";
                    echo "\t\t<label class='bmGranted'>" . $bm->name . "</label>";
                    echo "</li>";
                }
            }
        }
    }
    if (choiceExist($bonusMalusArray)) {
        //CHOICE BM
        echo "<li>";
        echo "\t\t<label class='listSection'>Define</label>";
        echo "</li>";
        foreach ($bonusMalusArray as $bm) {
            if ($bm->targetForChoice != "") {
                if ($bm->targetForChoice == EPBonusMalus::$ON_SKILL_WITH_PREFIX) {
                    if ($bm->forTargetNamed == null || $bm->forTargetNamed == "") {
                        echo "<li>";
                        echo "\t <label class='bmChoiceInput'>" . $bm->name;
                        if (skillWithPrefixExist($totalSkills, $bm->typeTarget)) {
                            echo "\t <select class='bmChoiceSelect' id='" . $bm->getUid() . "Sel'>";
                            foreach ($totalSkills as $acSkill) {
                                if ($acSkill->prefix == $bm->typeTarget) {
                                    echo "\t <option value='" . $acSkill->name . "'>" . $bm->typeTarget . " : " . $acSkill->name . "</option>";
                                }
                            }
                            echo "\t </select></label>";
                            echo "\t <span class='iconebmChoice'  id='" . $bm->getUid() . "' data-icon='&#x3a;'></span>";
                        } else {
                            echo "\t\t<label class='bmGrantedDesc'>Create an appropriate skill (skills menus)</label></label>";
                        }
                        echo "</li>";
                    } else {
                        echo "<li>";
                        echo "\t\t<label class='bmChoiceInput''> +" . $bm->value . " " . $bm->typeTarget . " : " . $bm->forTargetNamed . "</label>";
                        echo "\t\t<span class='iconebmRemChoice'  id='" . $bm->getUid() . "' data-icon='&#x39;'></span>";
                        echo "</li>";
                    }
                    echo "<input id='" . $bm->getUid() . "Case' type='hidden' value='" . EPBonusMalus::$ON_SKILL . "'>";
                } else {
                    if ($bm->targetForChoice == EPBonusMalus::$ON_SKILL_ACTIVE) {
                        if ($bm->forTargetNamed == null || $bm->forTargetNamed == "") {
                            echo "<li>";
                            echo "\t <label class='bmChoiceInput'>" . $bm->name;
                            echo "\t <select class='bmChoiceSelect' id='" . $bm->getUid() . "Sel'>";
                            foreach ($activeSkillList as $acSkill) {
                                if (!empty($acSkill->prefix)) {
                                    $sk_prefix = $acSkill->prefix . " : ";
                                } else {
                                    $sk_prefix = "";
                                }
                                echo "\t <option value='" . $acSkill->name . "'>" . $sk_prefix . $acSkill->name . "</option>";
                            }
                            echo "\t </select></label>";
                            echo "\t <span class='iconebmChoice'  id='" . $bm->getUid() . "' data-icon='&#x3a;'></span>";
                            echo "</li>";
                        } else {
                            echo "<li>";
                            echo "\t\t<label class='bmChoiceInput''> +" . $bm->value . " " . $bm->typeTarget . " : " . $bm->forTargetNamed . "</label>";
                            echo "\t\t<span class='iconebmRemChoice'  id='" . $bm->getUid() . "' data-icon='&#x39;'></span>";
                            echo "</li>";
                        }
                        echo "<input id='" . $bm->getUid() . "Case' type='hidden' value='" . EPBonusMalus::$ON_SKILL . "'>";
                    } else {
                        if ($bm->targetForChoice == EPBonusMalus::$ON_SKILL_KNOWLEDGE) {
                            if ($bm->forTargetNamed == null || $bm->forTargetNamed == "") {
                                echo "<li>";
                                echo "\t <label class='bmChoiceInput'>" . $bm->name;
                                if (!empty($knowledgeSkillList)) {
                                    echo "\t <select class='bmChoiceSelect' id='" . $bm->getUid() . "Sel'>";
                                    foreach ($knowledgeSkillList as $knSkill) {
                                        if (!empty($knSkill->prefix)) {
                                            $sk_prefix = $knSkill->prefix . " : ";
                                        } else {
                                            $sk_prefix = "";
                                        }
                                        echo "\t <option value='" . $knSkill->name . "'>" . $sk_prefix . $knSkill->name . "</option>";
                                    }
                                    echo "\t </select></label>";
                                } else {
                                    echo "\t\t<label class='bmGrantedDesc'>Create an appropriate skill (skills menus)</label></label>";
                                }
                                echo "\t <span class='iconebmChoice'  id='" . $bm->getUid() . "' data-icon='&#x3a;'></span>";
                                echo "</li>";
                            } else {
                                echo "<li>";
                                echo "\t\t<label class='bmChoiceInput''> +" . $bm->value . " " . $bm->typeTarget . " : " . $bm->forTargetNamed . "</label>";
                                echo "\t\t<span class='iconebmRemChoice'  id='" . $bm->getUid() . "' data-icon='&#x39;'></span>";
                                echo "</li>";
                            }
                            echo "<input id='" . $bm->getUid() . "Case' type='hidden' value='" . EPBonusMalus::$ON_SKILL . "'>";
                        } else {
                            if ($bm->targetForChoice == EPBonusMalus::$ON_SKILL_ACTIVE_AND_KNOWLEDGE) {
                                if ($bm->forTargetNamed == null || $bm->forTargetNamed == "") {
                                    echo "<li>";
                                    echo "\t <label class='bmChoiceInput'>" . $bm->name;
                                    echo "\t <select class='bmChoiceSelect' id='" . $bm->getUid() . "Sel'>";
                                    foreach ($totalSkills as $knSkill) {
                                        if (!empty($knSkill->prefix)) {
                                            $sk_prefix = $knSkill->prefix . " : ";
                                        } else {
                                            $sk_prefix = "";
                                        }
                                        echo "\t <option value='" . $knSkill->name . "'>" . $sk_prefix . $knSkill->name . "</option>";
                                    }
                                    echo "\t </select></label>";
                                    echo "\t <span class='iconebmChoice'  id='" . $bm->getUid() . "' data-icon='&#x3a;'></span>";
                                    echo "</li>";
                                } else {
                                    echo "<li>";
                                    echo "\t\t<label class='bmChoiceInput''> +" . $bm->value . " " . $bm->typeTarget . " : " . $bm->forTargetNamed . "</label>";
                                    echo "\t\t<span class='iconebmRemChoice'  id='" . $bm->getUid() . "' data-icon='&#x39;'></span>";
                                    echo "</li>";
                                }
                                echo "<input id='" . $bm->getUid() . "Case' type='hidden' value='" . EPBonusMalus::$ON_SKILL . "'>";
                            } else {
                                if ($bm->targetForChoice == EPBonusMalus::$ON_APTITUDE) {
                                    if ($bm->forTargetNamed == null || $bm->forTargetNamed == "") {
                                        echo "<li>";
                                        echo "\t\t<label class='bmChoiceInput'>" . $bm->name;
                                        echo "\t\t<select id='" . $bm->getUid() . "Sel'>";
                                        if ($parentType == 'morph') {
                                            $morph = $_SESSION['cc']->getMorphByName($parentName);
                                            if (!empty($morph)) {
                                                $banedAptNameList = $_SESSION['cc']->getMorphGrantedBMApptitudesNameList($morph);
                                                foreach ($_SESSION['cc']->getAptitudes() as $apt) {
                                                    if (!isNameOnList($apt->name, $banedAptNameList)) {
                                                        echo "<option value='" . $apt->name . "'>" . $apt->name . "</option>";
                                                    }
                                                }
                                            }
                                        } else {
                                            foreach ($_SESSION['cc']->getAptitudes() as $apt) {
                                                echo "<option value='" . $apt->name . "'>" . $apt->name . "</option>";
                                            }
                                        }
                                        echo "\t\t</select></label>";
                                        echo "\t\t<span class='iconebmChoice'  id='" . $bm->getUid() . "' data-icon='&#x3a;'></span>";
                                        echo "</li>";
                                    } else {
                                        echo "<li>";
                                        echo "\t\t<label class='bmChoiceInput''> +" . $bm->value . " on " . $bm->forTargetNamed . "</label>";
                                        echo "\t\t<span class='iconebmRemChoice'  id='" . $bm->getUid() . "' data-icon='&#x39;'></span>";
                                        echo "</li>";
                                    }
                                    echo "<input id='" . $bm->getUid() . "Case' type='hidden' value='" . EPBonusMalus::$ON_APTITUDE . "'>";
                                } else {
                                    if ($bm->targetForChoice == EPBonusMalus::$ON_REPUTATION) {
                                        if ($bm->forTargetNamed == null || $bm->forTargetNamed == "") {
                                            echo "<li>";
                                            echo "\t\t<label class='bmChoiceInput'>" . $bm->name;
                                            echo "\t\t<select id='" . $bm->getUid() . "Sel'>";
                                            foreach ($_SESSION['cc']->getReputations() as $apt) {
                                                echo "<option value='" . $apt->name . "'>" . $apt->name . "</option>";
                                            }
                                            echo "\t\t</select></label>";
                                            echo "\t\t<span class='iconebmChoice'  id='" . $bm->getUid() . "' data-icon='&#x3a;'></span>";
                                            echo "</li>";
                                        } else {
                                            echo "<li>";
                                            echo "\t\t<label class='bmChoiceInput''> +" . $bm->value . " on " . $bm->forTargetNamed . "</label>";
                                            echo "\t\t<span class='iconebmRemChoice'  id='" . $bm->getUid() . "' data-icon='&#x39;'></span>";
                                            echo "</li>";
                                        }
                                        echo "<input id='" . $bm->getUid() . "Case' type='hidden' value='" . EPBonusMalus::$ON_REPUTATION . "'>";
                                    } else {
                                        if ($bm->targetForChoice == EPBonusMalus::$MULTIPLE) {
                                            echo "<li>";
                                            echo "\t\t<label class='listSection'>Choose <span class='costInfo'>" . $_SESSION['cc']->getSelectedOnMulti($bm) . " / " . $bm->multi_occurence . "</span></label>";
                                            echo "</li>";
                                            if ($_SESSION['cc']->getSelectedOnMulti($bm) == $bm->multi_occurence) {
                                                foreach ($bm->bonusMalusTypes as $bmMulti) {
                                                    if ($bmMulti->selected) {
                                                        if ($bmMulti->targetForChoice == EPBonusMalus::$ON_SKILL_WITH_PREFIX) {
                                                            echo "<li>";
                                                            echo "\t\t<label class='bmChoiceInput''> +" . $bmMulti->value . " " . $bmMulti->typeTarget . " : " . $bmMulti->forTargetNamed . "</label>";
                                                            echo "\t\t<span class='iconebmRemChoice'  id='" . $bmMulti->getUid() . "' data-icon='&#x39;'></span>";
                                                            echo "</li>";
                                                        } else {
                                                            if ($bmMulti->targetForChoice == EPBonusMalus::$ON_APTITUDE) {
                                                                echo "<li>";
                                                                echo "\t\t<label class='bmChoiceInput''> +" . $bmMulti->value . " on " . $bmMulti->forTargetNamed . "</label>";
                                                                echo "\t\t<span class='iconebmRemChoice'  id='" . $bmMulti->getUid() . "' data-icon='&#x39;'></span>";
                                                                echo "</li>";
                                                            } else {
                                                                if ($bmMulti->targetForChoice == EPBonusMalus::$ON_REPUTATION) {
                                                                    echo "<li>";
                                                                    echo "\t\t<label class='bmChoiceInput''> +" . $bmMulti->value . " on " . $bmMulti->forTargetNamed . "</label>";
                                                                    echo "\t\t<span class='iconebmRemChoice'  id='" . $bmMulti->getUid() . "' data-icon='&#x39;'></span>";
                                                                    echo "</li>";
                                                                } else {
                                                                    echo "<li>";
                                                                    echo "\t\t<label class='bmGranted' id='" . $bmMulti->getUid() . "'>" . $bmMulti->name . "</label>";
                                                                    echo "\t\t<span class='iconebmSimpleRemChoice' id='" . $bmMulti->getUid() . "' data-icon='&#x39;'></span>";
                                                                    echo "</li>";
                                                                }
                                                            }
                                                        }
                                                    }
                                                    echo "<input id='" . $bmMulti->getUid() . "MultiName' type='hidden' value='" . $bmMulti->name . "'>";
                                                    echo "<input id='" . $bmMulti->getUid() . "ParentId' type='hidden' value='" . $bm->getUid() . "'>";
                                                }
                                            } else {
                                                foreach ($bm->bonusMalusTypes as $bmMulti) {
                                                    if ($bmMulti->targetForChoice == EPBonusMalus::$ON_SKILL_WITH_PREFIX) {
                                                        if ($bmMulti->forTargetNamed == null || $bmMulti->forTargetNamed == "") {
                                                            echo "<li>";
                                                            echo "\t <label class='bmChoiceInput'>" . $bmMulti->name;
                                                            if (skillWithPrefixExist($totalSkills, $bmMulti->typeTarget)) {
                                                                echo "\t <select class='bmChoiceSelect' id='" . $bmMulti->getUid() . "Sel'>";
                                                                foreach ($totalSkills as $acSkill) {
                                                                    if ($acSkill->prefix == $bmMulti->typeTarget) {
                                                                        echo "\t <option value='" . $acSkill->name . "'>" . $acSkill->prefix . " : " . $acSkill->name . "</option>";
                                                                    }
                                                                }
                                                                echo "\t </select></label>";
                                                                echo "\t <span class='iconebmChoice'  id='" . $bmMulti->getUid() . "' data-icon='&#x3a;'></span>";
                                                            } else {
                                                                echo "\t\t<label class='bmGrantedDesc'>Create an appropriate skill (skills menus)</label>";
                                                            }
                                                            echo "</li>";
                                                        } else {
                                                            echo "<li>";
                                                            echo "\t\t<label class='bmChoiceInput''> +" . $bmMulti->value . " " . $bmMulti->typeTarget . " : " . $bmMulti->forTargetNamed . "</label>";
                                                            echo "\t\t<span class='iconebmRemChoice'  id='" . $bmMulti->getUid() . "' data-icon='&#x39;'></span>";
                                                            echo "</li>";
                                                        }
                                                        echo "<input id='" . $bmMulti->getUid() . "MultiName' type='hidden' value='" . $bmMulti->name . "'>";
                                                    } else {
                                                        if ($bmMulti->targetForChoice == EPBonusMalus::$ON_SKILL_ACTIVE) {
                                                            if ($bmMulti->forTargetNamed == null || $bmMulti->forTargetNamed == "") {
                                                                echo "<li>";
                                                                echo "\t <label class='bmChoiceInput'>" . $bmMulti->name;
                                                                echo "\t <select class='bmChoiceSelect' id='" . $bmMulti->getUid() . "Sel'>";
                                                                foreach ($activeSkillList as $acSkill) {
                                                                    if (!empty($acSkill->prefix)) {
                                                                        $sk_prefix = $acSkill->prefix . " : ";
                                                                    } else {
                                                                        $sk_prefix = "";
                                                                    }
                                                                    echo "\t <option value='" . $acSkill->name . "'>" . $sk_prefix . $acSkill->name . "</option>";
                                                                }
                                                                echo "\t </select></label>";
                                                                echo "\t <span class='iconebmChoice'  id='" . $bmMulti->getUid() . "' data-icon='&#x3a;'></span>";
                                                                echo "</li>";
                                                            } else {
                                                                echo "<li>";
                                                                echo "\t\t<label class='bmChoiceInput''> +" . $bmMulti->value . " " . $bmMulti->typeTarget . " : " . $bmMulti->forTargetNamed . "</label>";
                                                                echo "\t\t<span class='iconebmRemChoice'  id='" . $bmMulti->getUid() . "' data-icon='&#x39;'></span>";
                                                                echo "</li>";
                                                            }
                                                            echo "<input id='" . $bm->getUid() . "Case' type='hidden' value='" . EPBonusMalus::$ON_SKILL . "'>";
                                                        } else {
                                                            if ($bmMulti->targetForChoice == EPBonusMalus::$ON_SKILL_KNOWLEDGE) {
                                                                if ($bmMulti->forTargetNamed == null || $bmMulti->forTargetNamed == "") {
                                                                    echo "<li>";
                                                                    echo "\t <label class='bmChoiceInput'>" . $bmMulti->name;
                                                                    echo "\t <select class='bmChoiceSelect' id='" . $bmMulti->getUid() . "Sel'>";
                                                                    foreach ($knowledgeSkillList as $knSkill) {
                                                                        if (!empty($knSkill->prefix)) {
                                                                            $sk_prefix = $knSkill->prefix . " : ";
                                                                        } else {
                                                                            $sk_prefix = "";
                                                                        }
                                                                        echo "\t <option value='" . $knSkill->name . "'>" . $sk_prefix . $knSkill->name . "</option>";
                                                                    }
                                                                    echo "\t </select></label>";
                                                                    echo "\t <span class='iconebmChoice'  id='" . $bmMulti->getUid() . "' data-icon='&#x3a;'></span>";
                                                                    echo "</li>";
                                                                } else {
                                                                    echo "<li>";
                                                                    echo "\t\t<label class='bmChoiceInput''> +" . $bmMulti->value . " " . $bmMulti->typeTarget . " : " . $bmMulti->forTargetNamed . "</label>";
                                                                    echo "\t\t<span class='iconebmRemChoice'  id='" . $bmMulti->getUid() . "' data-icon='&#x39;'></span>";
                                                                    echo "</li>";
                                                                }
                                                                echo "<input id='" . $bm->getUid() . "Case' type='hidden' value='" . EPBonusMalus::$ON_SKILL . "'>";
                                                            } else {
                                                                if ($bmMulti->targetForChoice == EPBonusMalus::$ON_SKILL_ACTIVE_AND_KNOWLEDGE) {
                                                                    if ($bmMulti->forTargetNamed == null || $bmMulti->forTargetNamed == "") {
                                                                        echo "<li>";
                                                                        echo "\t <label class='bmChoiceInput'>" . $bmMulti->name;
                                                                        echo "\t <select class='bmChoiceSelect' id='" . $bmMulti->getUid() . "Sel'>";
                                                                        foreach ($totalSkills as $knSkill) {
                                                                            if (!empty($knSkill->prefix)) {
                                                                                $sk_prefix = $knSkill->prefix . " : ";
                                                                            } else {
                                                                                $sk_prefix = "";
                                                                            }
                                                                            echo "\t <option value='" . $knSkill->name . "'>" . $sk_prefix . $knSkill->name . "</option>";
                                                                        }
                                                                        echo "\t </select></label>";
                                                                        echo "\t <span class='iconebmChoice'  id='" . $bmMulti->getUid() . "' data-icon='&#x3a;'></span>";
                                                                        echo "</li>";
                                                                    } else {
                                                                        echo "<li>";
                                                                        echo "\t\t<label class='bmChoiceInput''> +" . $bmMulti->value . " " . $bmMulti->typeTarget . " : " . $bmMulti->forTargetNamed . "</label>";
                                                                        echo "\t\t<span class='iconebmRemChoice'  id='" . $bmMulti->getUid() . "' data-icon='&#x39;'></span>";
                                                                        echo "</li>";
                                                                    }
                                                                    echo "<input id='" . $bm->getUid() . "Case' type='hidden' value='" . EPBonusMalus::$ON_SKILL . "'>";
                                                                } else {
                                                                    if ($bmMulti->targetForChoice == EPBonusMalus::$ON_APTITUDE) {
                                                                        if ($bmMulti->forTargetNamed == null || $bmMulti->forTargetNamed == "") {
                                                                            echo "<li>";
                                                                            echo "\t\t<label class='bmChoiceInput'>" . $bmMulti->name;
                                                                            echo "\t\t<select id='" . $bmMulti->getUid() . "Sel'>";
                                                                            foreach ($_SESSION['cc']->getAptitudes() as $apt) {
                                                                                echo "<option value='" . $apt->name . "'>" . $apt->name . "</option>";
                                                                            }
                                                                            echo "\t\t</select></label>";
                                                                            echo "\t\t<span class='iconebmChoice'  id='" . $bmMulti->getUid() . "' data-icon='&#x3a;'></span>";
                                                                            echo "</li>";
                                                                        } else {
                                                                            echo "<li>";
                                                                            echo "\t\t<label class='bmChoiceInput''> +" . $bmMulti->value . " on " . $bmMulti->forTargetNamed . "</label>";
                                                                            echo "\t\t<span class='iconebmRemChoice'  id='" . $bmMulti->getUid() . "' data-icon='&#x39;'></span>";
                                                                            echo "</li>";
                                                                        }
                                                                        echo "<input id='" . $bmMulti->getUid() . "MultiName' type='hidden' value='" . $bmMulti->name . "'>";
                                                                    } else {
                                                                        if ($bmMulti->targetForChoice == EPBonusMalus::$ON_REPUTATION) {
                                                                            if ($bmMulti->forTargetNamed == null || $bmMulti->forTargetNamed == "") {
                                                                                echo "<li>";
                                                                                echo "\t\t<label class='bmChoiceInput'>" . $bmMulti->name;
                                                                                echo "\t\t<select id='" . $bmMulti->getUid() . "Sel'>";
                                                                                foreach ($_SESSION['cc']->getReputations() as $apt) {
                                                                                    echo "<option value='" . $apt->name . "'>" . $apt->name . "</option>";
                                                                                }
                                                                                echo "\t\t</select></label>";
                                                                                echo "\t\t<span class='iconebmChoice'  id='" . $bmMulti->getUid() . "' data-icon='&#x3a;'></span>";
                                                                                echo "</li>";
                                                                            } else {
                                                                                echo "<li>";
                                                                                echo "\t\t<label class='bmChoiceInput''> +" . $bmMulti->value . " on " . $bmMulti->forTargetNamed . "</label>";
                                                                                echo "\t\t<span class='iconebmRemChoice'  id='" . $bmMulti->getUid() . "' data-icon='&#x39;'></span>";
                                                                                echo "</li>";
                                                                            }
                                                                            echo "<input id='" . $bmMulti->getUid() . "MultiName' type='hidden' value='" . $bmMulti->name . "'>";
                                                                        } else {
                                                                            if ($bmMulti->selected) {
                                                                                echo "<li>";
                                                                                echo "\t\t<label class='bmGranted'>" . $bmMulti->name . "</label>";
                                                                                echo "\t\t<input id='" . $bmMulti->getUid() . "Sel' type='hidden' value='" . $bmMulti->forTargetNamed . "'>";
                                                                                echo "\t\t<span class='iconebmSimpleRemChoice'  id='" . $bmMulti->getUid() . "' data-icon='&#x39;'></span>";
                                                                                echo "</li>";
                                                                            } else {
                                                                                echo "<li>";
                                                                                echo "\t\t<label class='bmGranted'>" . $bmMulti->name . "</label>";
                                                                                echo "\t\t<input id='" . $bmMulti->getUid() . "Sel' type='hidden' value='" . $bmMulti->forTargetNamed . "'>";
                                                                                echo "\t\t<span class='iconebmSimpleChoice'  id='" . $bmMulti->getUid() . "' data-icon='&#x3a;'></span>";
                                                                                echo "</li>";
                                                                            }
                                                                            echo "<input id='" . $bmMulti->getUid() . "MultiName' type='hidden' value='" . $bmMulti->name . "'>";
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                    echo "<input id='" . $bmMulti->getUid() . "ParentId' type='hidden' value='" . $bm->getUid() . "'>";
                                                }
                                            }
                                            echo "<li>";
                                            echo "\t\t<label class='listSectionClose'>-</label>";
                                            echo "</li>";
                                            echo "<input id='" . $bm->getUid() . "Case' type='hidden' value='" . EPBonusMalus::$MULTIPLE . "'>";
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                echo "<input id='" . $bm->getUid() . "Parent' type='hidden' value='" . $parentName . "'>";
                echo "<input id='" . $bm->getUid() . "Type' type='hidden' value='" . $parentType . "'>";
                echo "<input id='" . $bm->getUid() . "BmName' type='hidden' value='" . $bm->name . "'>";
            }
        }
    }
}
Exemple #10
0
    </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 '../php/EPConfigFile.php';
require_once '../php/EPListProvider.php';
require_once '../php/EPPersistentDataManager.php';
require_once '../php/EPConfigFile.php';
require_once '../php/EPAptitude.php';
require_once '../php/EPSkill.php';
require_once '../php/EPAi.php';
require_once '../php/EPStat.php';
$epListP = new EPListProvider('../php/config.ini');
$persistManager = new EPPersistentDataManager('../php/config.ini');
$configValues = new EPConfigFile('./config.ini');
$_SESSION['aiList'] = $epListP->getListAi();
$_SESSION['aptList'] = $epListP->getListAptitudes();
$_SESSION['skillList'] = $epListP->getListSkills($_SESSION['aptList']);
$_SESSION['statList'] = $epListP->getListStats($configValues, $_SESSION['cc']);
if (isset($_POST['addAi'])) {
    $aptListInject = array();
    foreach ($_SESSION['aptList'] as $m) {
        if (isset($_POST['check_' . $m->abbreviation])) {
            $apatObj = $epListP->getAptitudeByName($_POST['check_' . $m->abbreviation]);
            $apatObj->value = $_POST['val_' . $m->abbreviation];
            array_push($aptListInject, $apatObj);
        }
    }
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Manage PsySleight</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/EPBonusMalus.php';
require_once '../php/EPPsySleight.php';
$epListP = new EPListProvider('../php/config.ini');
$persistManager = new EPPersistentDataManager('../php/config.ini');
$_SESSION['psyList'] = $epListP->getListPsySleights();
$_SESSION['bmList'] = $epListP->getListBonusMalus();
if (isset($_POST['addPsy'])) {
    $bmlistInject = array();
    if (isset($_POST['selectedBM']) && !empty($_POST['selectedBM'])) {
        foreach ($_POST['selectedBM'] as $bm) {
            $bmObj = $epListP->getBonusMalusByName($bm);
            array_push($bmlistInject, $bmObj);
        }
    }
    $newPsy = new EPPsySleight($_POST['name'], $_POST['desc'], $_POST['pType'], $_POST['range'], $_POST['duration'], $_POST['action'], $_POST['strain'], $_POST['level'], $bmlistInject, $_POST['needed']);
    if (!$persistManager->persistPsySleight($newPsy)) {
        echo $persistManager->getLastError();
        echo "<br><br>";
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Manage Skills</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/EPSkill.php';
require_once '../php/EPAptitude.php';
$epListP = new EPListProvider('../php/config.ini');
$persistManager = new EPPersistentDataManager('../php/config.ini');
$_SESSION['prefixList'] = $epListP->getListPrefix();
$_SESSION['groupsList'] = $epListP->getListGroups();
$_SESSION['skillList'] = $epListP->getListSkills($epListP->getListAptitudes());
if (isset($_POST['addSkill'])) {
    $glistInject = array();
    if (isset($_POST['selectedGroups'])) {
        foreach ($_POST['selectedGroups'] as $g) {
            array_push($glistInject, $g);
        }
    }
    $arrayNewGroups = explode(";", $_POST['newGroups']);
    foreach ($arrayNewGroups as $h) {
        array_push($glistInject, $h);
    }
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Manage Background</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';
require_once '../php/EPBackground.php';
$epListP = new EPListProvider('../php/config.ini');
$persistManager = new EPPersistentDataManager('../php/config.ini');
$_SESSION['backgroundList'] = $epListP->getListBackgrounds();
$_SESSION['groupsList'] = $epListP->getListGroups();
$_SESSION['bmList'] = $epListP->getListBonusMalus();
$_SESSION['traitsList'] = $epListP->getListTraits();
if (isset($_POST['addBackground'])) {
    $bmlistInject = array();
    foreach ($_POST['selectedBM'] as $bm) {
        $bmObj = $epListP->getBonusMalusByName($bm);
        array_push($bmlistInject, $bmObj);
    }
    $traitlistInject = array();
    if (isset($_POST['selectedTraits'])) {
        foreach ($_POST['selectedTraits'] as $t) {
            $traitObj = $epListP->getTraitByName($t);
            $bonusMalus = $m->bonusMalus;
            echo "With Bonus malus : <br>";
            foreach ($bonusMalus as $o) {
                echo $o->name . " Desc : " . $o->description . "<br>";
            }
            echo '<br>';
            echo '<br>';
        }
    }
}
if (strcmp($cibleTest, 'Delete') == 0) {
    //=====DELETE TESTS ================================================
    require_once 'EPPersistentDataManager.php';
    require_once 'EPAptitude.php';
    require_once 'EPListProvider.php';
    $listProvider = new EPListProvider('./config.ini');
    $persistManager = new EPPersistentDataManager('./config.ini');
    //Aptitude
    echo "<br><br>APTITUDE DELETION------------------------------------------ <br><br>";
    $apdel = new EPAptitude('APTITUDE_TODELETE', EPAptitude::$COGNITION, "", array("TODELETE1", "TODELETE2"));
    if (!$persistManager->persistAptitude($apdel)) {
        echo $persistManager->getLastError();
        echo "<br>";
    } else {
        echo "Aptitude added ! <br>";
    }
    if (!$persistManager->deleteAptitude($apdel->name)) {
        echo $persistManager->getLastError();
        echo "<br>";
    } else {
        echo "Aptitude Deleted ! <br>";
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Manage Skill Prefix</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 '../php/EPConfigFile.php';
require_once '../php/EPListProvider.php';
require_once '../php/EPPersistentDataManager.php';
$epListP = new EPListProvider('../php/config.ini');
$persistManager = new EPPersistentDataManager('../php/config.ini');
$_SESSION['prefixList'] = $epListP->getListPrefix();
$_SESSION['aptitudesList'] = $epListP->getListAptitudes();
if (isset($_POST['addPrefix'])) {
    if (!$persistManager->persistSkillPrefix($_POST['name'], $_POST['apt'], $_POST['type'], $_POST['desc'])) {
        echo $persistManager->getLastError();
        echo "<br><br>";
    } else {
        $_SESSION['prefixList'] = $epListP->getListPrefix();
        echo "<b> Skill Prefix Added ! </b><br><br>";
    }
} else {
    if (isset($_POST['deletePrefix'])) {
        if (!$persistManager->deleteSkillPrefix($_POST['deletePrefix'])) {
            echo $persistManager->getLastError();
        if (strcmp($creatorError->typeError, EPCreatorErrors::$SYSTEM_ERROR) == 0) {
            returnErrors($data, $creatorError->textError);
        } else {
            if (strcmp($creatorError->typeError, EPCreatorErrors::$RULE_ERROR) == 0) {
                returnMessage($data, $creatorError->getTextOnly());
            } else {
                returnErrors($data, "Unknown error ? : " . $creatorError->textError);
            }
        }
    }
}
//DISPATCH============================
//INIT
$return = array();
$return['error'] = false;
$provider = new EPListProvider('../../../php/config.ini');
//error_log(print_r($_POST,true));
//error_log(print_r($_FILES,true));
//error_log(print_r($_SESSION,true));
//if a file to load LOAD FILE
if (isset($_POST['load_char'])) {
    if (isset($_SESSION['fileToLoad'])) {
        $saveFile = json_decode($_SESSION['fileToLoad'], true);
        if (!empty($saveFile['versionNumber']) && floatval($saveFile['versionNumber']) >= $_SESSION['cc']->configValues->getValue('GeneralValues', 'versionNumberMin')) {
            $_SESSION['cc'] = new EPCharacterCreator("../../../php/config.ini");
            $_SESSION['cc']->back = new EPCharacterCreator("../../../php/config.ini");
            $_SESSION['cc']->loadSavePack($saveFile);
            $_SESSION['cc']->back->loadSavePack($saveFile);
            $_SESSION['cc']->back->setMaxRepValue($_SESSION['cc']->configValues->getValue('RulesValues', 'EvoMaxRepValue'));
            $_SESSION['cc']->setMaxRepValue($_SESSION['cc']->configValues->getValue('RulesValues', 'EvoMaxRepValue'));
            $_SESSION['cc']->back->setMaxSkillValue($_SESSION['cc']->configValues->getValue('RulesValues', 'SkillEvolutionMaxPoint'));
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <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 != "") {
    </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/EPBackground.php';
require_once '../php/EPTrait.php';
require_once '../php/EPGear.php';
require_once '../php/EPPsySleight.php';
$epListP = new EPListProvider('../php/config.ini');
$persistManager = new EPPersistentDataManager('../php/config.ini');
$_SESSION['backgroundList'] = $epListP->getListBackgrounds();
$_SESSION['traitList'] = $epListP->getListTraits();
$_SESSION['gearList'] = $epListP->getListGears();
$_SESSION['psyList'] = $epListP->getListPsySleights();
$_SESSION['morphList'] = $epListP->getListMorph();
$_SESSION['aiList'] = $epListP->getListAi();
if (isset($_POST['addBook'])) {
    $totalInject = array();
    if (isset($_POST['selectedBackground'])) {
        foreach ($_POST['selectedBackground'] as $b) {
            array_push($totalInject, $b);
        }
    }
    if (isset($_POST['selectedTraits'])) {
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Manage Aptitude</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/EPAptitude.php';
$epListP = new EPListProvider('../php/config.ini');
$persistManager = new EPPersistentDataManager('../php/config.ini');
$_SESSION['aptitudesList'] = $epListP->getListAptitudesComplete();
$_SESSION['groupsList'] = $epListP->getListGroups();
if (isset($_POST['addAptitude'])) {
    $glistInject = array();
    foreach ($_POST['selectedGroups'] as $g) {
        array_push($glistInject, $g);
    }
    $arrayNewGroups = explode(";", $_POST['newGroups']);
    foreach ($arrayNewGroups as $h) {
        array_push($glistInject, $h);
    }
    $newAptitude = new EPAptitude($_POST['name'], $_POST['abr'], $_POST['desc'], $glistInject, 0, 0, 0, $epListP->configValues->getValue('RulesValues', 'AbsoluteAptitudesMaxValue'));
    if (!$persistManager->persistAptitude($newAptitude)) {
        echo $persistManager->getLastError();