<% local msg = {} if _SESSION["logined"] ~= nil then local admin = _POST["admin"] if admin ~= nil then admin = json.decode(admin) local result = c_AdminExist(admin.username) if result == true then rawset(msg, "code", -3) rawset(msg, "error", "admin exist") print(json.encode(msg)) else admin.username = string.gsub(admin.username,"%[","") admin.username = string.gsub(admin.username,"%]","") AddAdmin(admin) rawset(msg, "code", 0) print(json.encode(msg)) end else rawset(msg, "code", -2) rawset(msg, "error", "admin is empty") print(json.encode(msg)) end else rawset(msg, "code", -1) rawset(msg, "error", "not logged in") print(json.encode(msg)) end %>