function updatePosition() { $positionList = $this->input->post('positionList'); $idList = $this->input->post('idList'); $levels = new Level(); for ($i = 0; $i < count($idList); $i++) { $levels->where("id", $idList[$i]); $levels->get(); $levels->position = $positionList[$i]; $levels->save(); $levels->clear(); } redirect("admin/levels/listAll/"); }