getVar("credits") < $DEP_CREDIT) { $errormsg = sprintf($jkl["hd103"], $jakclient->getVar("credits"), JAK_rewrite::jakParseurl(JAK_CLIENT_URL)); } // We run the membership based system } elseif (JAK_BILLING_MODE == 2 && strtotime($jakclient->getVar("paid_until")) < time()) { $errormsg = sprintf($jkl['hd104'], JAK_rewrite::jakParseurl(JAK_CLIENT_URL)); } if ($errormsg) { die(json_encode(array("status" => 0, "errormsg" => $errormsg))); } } // Get all priorities but only if there is any $TPRIORITY = ""; $PRIORITY_ALL = $jakdb->select($jaktable2, ["id", "title"], ["AND" => ["opid" => $_SESSION['opid'], "depid" => [0, $_GET['depid']], "oponly" => 0], "ORDER" => ["dorder" => "ASC"]]); if (!empty($PRIORITY_ALL)) $TPRIORITY = $PRIORITY_ALL; // Get all options but only if there is any $TOPTIONS = ""; $TOPTIONS_ALL = $jakdb->select($jaktable3, ["id", "title"], ["AND" => ["opid" => $_SESSION['opid'], "depid" => [0, $_GET['depid']], "oponly" => 0], "ORDER" => ["dorder" => "ASC"]]); if (!empty($TOPTIONS_ALL)) $TOPTIONS = $TOPTIONS_ALL; // Get the custom fields if any jak_get_custom_fields($location, $opid, $depid, $clientid, $ticketid, $contactid, $lang, $readonly, $admin, $table, $registerform, $errors = NULL) $custom_fields = jak_get_custom_fields(2, $_SESSION['opid'], $_GET["depid"], JAK_CLIENTID, 0, 0, $BT_LANGUAGE, false, false, false, false, $errors); // finally get the predefined message if any. $JAK_PRE_CONTENT = $jakdb->get($jaktable, "pre_content", ["AND" => ["opid" => $_SESSION['opid'], "id" => $_GET['depid']]]); die(json_encode(array("status" => 1, "ticketpriority" => $TPRIORITY, "ticketoptions" => $TOPTIONS, "customfields" => $custom_fields, "precontent" => $JAK_PRE_CONTENT))); } else { die(json_encode(array("status" => 0, "errormsg" => $jkl['e25']))); } ?>