<?php require_once "core.php"; $resultQuery = Dp::getDpById($PatternID); $anXMLString = '<?xml version="1.0" encoding="UTF-8"?> <Patern> <GENERAL> </GENERAL> <PROBLEM> </PROBLEM> <SET_OF_SOLUTIONS> </SET_OF_SOLUTIONS> <SET_OF_RELATED_PATTERNS> </SET_OF_RELATED_PATTERNS> <PATTERN_IDENTIFICATION> </PATTERN_IDENTIFICATION> </Patern>'; $doc = new domDocument(); $doc->loadXML($anXMLString); $key = key($resultQuery); $val = current($resultQuery); $nbrValues = count($resultQuery); while (list($key, $val) = each($resultQuery)) { if (!is_array($val)) { switch ($key) { case $key == 'pattern_name': $newnode = $doc->createElement($key, $val); $doc->appendChild($newnode); $add = $doc->getElementsByTagName('GENERAL')->item(0); $add->appendChild($newnode); break;
<?php require_once 'core.php'; if (array_key_exists('dpId', $_GET)) { $dpId = $_GET['dpId']; $dp = Dp::getDpById($dpId); $smarty->assign('dpId', $dpId); //$_SESSION['dp'] = $dp ; } if (array_key_exists('step', $_GET)) { $step = $_GET['step']; } else { $step = "One"; } print_r($dp); switch ($step) { case "One": $dpId = $_SESSION['dp']['pattern_id']; /*$dpActors = Dp::getAllActors(); $dpActorsToUpdate = $_SESSION['dp']['actors_type']; for($a=0;$a<count($dpActors);$a++){ for($b=0;$b<count($dpActorsToUpdate);$b++){ if (strcmp($dpActors[$a]['actor'],$dpActorsToUpdate[$b])==0){ $dpActors[$a]['selected'] = "selected"; } } }*/ $dpCategoriesToUpdate = $_SESSION['dp']['categories']; $dpCategories = Dp::getAllCategories(); for ($a = 0; $a < count($dpCategories); $a++) { for ($b = 0; $b < count($dpCategoriesToUpdate); $b++) {