<% if _SESSION["logined"] ~= nil then local taskname = _POST["taskname"] local type = _POST["type"] local daynum = _POST["day"] local datefrom = _POST["datefrom"] local timefrom = _POST["timefrom"] local script = _POST["script"] local modify = _POST["modify"] local reset = false if taskname ~= nil then if modify == nil then local result = c_TaskExist(taskname) if result == true then print("0") else local status,err = loadstring(script) if not status then if type(err) == "string" then print(string.format("Lua Error: %s!",err)) end else c_AddTask(taskname,type,daynum,datefrom,timefrom,script,reset) c_AddAdminLog("administrator '".._SESSION["admin"].."' added a task ["..taskname.."].",ADMIN_LOG_OK) print("1") end end else local status,err = loadstring(script) if not status then if type(err) == "string" then print(string.format("Lua Error: %s!",err)) end else c_AddTask(taskname,type,daynum,datefrom,timefrom,script,reset) c_AddAdminLog("administrator '".._SESSION["admin"].."' modified a task ["..taskname.."].",ADMIN_LOG_OK) print("1") end end end end %>