IMPROVEMENT
This commit is contained in:
@@ -29,9 +29,11 @@ class pmDynaform
|
|||||||
$dynContent = G::json_decode($this->record["DYN_CONTENT"]);
|
$dynContent = G::json_decode($this->record["DYN_CONTENT"]);
|
||||||
if (isset($dynContent->items)) {
|
if (isset($dynContent->items)) {
|
||||||
$this->items = $dynContent->items[0]->items;
|
$this->items = $dynContent->items[0]->items;
|
||||||
for($i=0; $i<count($this->items); $i++){
|
$n = count($this->items);
|
||||||
for($j=0; $j<count($this->items[$i]); $j++){
|
for ($i = 0; $i < $n; $i++) {
|
||||||
if($this->items[$i][$j]->required == 1){
|
$m = count($this->items[$i]);
|
||||||
|
for ($j = 0; $j < $m; $j++) {
|
||||||
|
if (isset($this->items[$i][$j]->required) && $this->items[$i][$j]->required == 1) {
|
||||||
array_push($this->arrayFieldRequired, $this->items[$i][$j]->name);
|
array_push($this->arrayFieldRequired, $this->items[$i][$j]->name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -77,7 +79,7 @@ class pmDynaform
|
|||||||
}
|
}
|
||||||
//query
|
//query
|
||||||
$arrayVariable = array();
|
$arrayVariable = array();
|
||||||
if ($row["VAR_DBCONNECTION"] !== "none") {
|
if ($row["VAR_DBCONNECTION"] !== "none" && $row["VAR_SQL"] !== "") {
|
||||||
$cnn = Propel::getConnection($row["VAR_DBCONNECTION"]);
|
$cnn = Propel::getConnection($row["VAR_DBCONNECTION"]);
|
||||||
$stmt = $cnn->createStatement();
|
$stmt = $cnn->createStatement();
|
||||||
$rs = $stmt->executeQuery(\G::replaceDataField($row["VAR_SQL"], $arrayVariable), \ResultSet::FETCHMODE_NUM);
|
$rs = $stmt->executeQuery(\G::replaceDataField($row["VAR_SQL"], $arrayVariable), \ResultSet::FETCHMODE_NUM);
|
||||||
|
|||||||
Reference in New Issue
Block a user