public function save_order() { $testimonial_array = $_POST['testimonial_id']; $order_array = $_POST['order']; $testimonial = new Testimonial(); foreach ($testimonial_array as $key => $value) { $testimonial_id = $value; $testimonial_order = $order_array[$key]; $testimonial->update('Testimonial', array('sequence' => $testimonial_order), 'id=' . $testimonial_id); } Flash::set('success', __('This testimonial sequence has been saved.')); redirect(get_url('testimonial')); }