private function chainUpdate($node) { if (count($node->children) > 0) { $ids = []; foreach ($node->children as $n) { array_push($ids, $n->id); } $dpt = getDepth($node->id); $data = ['parent_id' => $node->id, 'depth' => $dpt['depth'], 'thread' => $dpt['thread']]; \App\Node::whereIn('id', $ids)->update($data); foreach ($node->children as $n) { if (count($n->children) > 0) { $this->chainUpdate($n); } } } }
function getDepthViaJS($exchange, $product, $level) { if ($_SESSION["instabid_userId"] == NULL) { return '{"result":"FAIL","msg":"Sorry but this user is unidentified creating a risk of outside fraudulent access. You have to call the function authorize_user_to_bid(userId) in instabid.php first"}'; } else { //return $_SESSION["instabid_userId"]; return getDepth($exchange, $product, $level); } }
function endElement($parser, $name) { setCurrentTag(""); switch($name) { ////////////////////// Paragraph case "P": if (getEmpty()) add2Doc(" "); setLastTag("p"); clearCSS(); add2Doc("</p>\n"); setDepth(getDepth()-1); resetLastStyle(); break; ////////////////////// List Item case "LI": setLastTag("li"); add2Doc("</li>\n"); setDepth(getDepth()-1); resetLastStyle(); break; ////////////////////// Bold case "B": setLastTag("strong"); add2Doc("</strong>"); setDepth(getDepth()-1); break; ////////////////////// Italic case "I": setLastTag("em"); add2Doc("</em>"); setDepth(getDepth()-1); break; ////////////////////// Underline case "U": setLastTag("u"); add2Doc("</span>"); setDepth(getDepth()-1); break; ////////////////////// Underline case "A": setLastTag("a"); add2Doc("</a>"); setDepth(getDepth()-1); break; ////////////////////// Font <span> case "FONT": setLastTag("span"); add2Doc("</span>"); setDepth(getDepth()-1); break; case "PARSERDOCUMENT": break; case "TEXTFORMAT": break; /////////////////////// Abort filtering on unsupported tags default: abortFiltering(); //echo "Aborted filtering on </$name><br />"; break; } }