Closed imamimam113 closed 1 year ago
never mind, already fix it with this
public function copy_to_pembayaran($last_id) { $form_pembayaran_data = $this->db->get_where('form_pembayaran', ['id' => $last_id])->row(); if ($form_pembayaran_data) { $old_path = FCPATH . 'uploads/form_pembayaran/' . $form_pembayaran_data->bukti_pembayaran; $new_path = FCPATH . 'uploads/pembayaran/' . $form_pembayaran_data->bukti_pembayaran;
if (file_exists($old_path)) {
// Move file to the new directory
rename($old_path, $new_path);
}
$this->db->query("INSERT INTO pembayaran (nominal_pembayaran, jenis_pembayaran, tanggal_pembayaran, nama_mahasiswa, stambuk, metode_pembayaran, nama_bank, bukti_pembayaran)
SELECT nominal_pembayaran, jenis_pembayaran, tanggal_pembayaran, nama_mahasiswa, stambuk, metode_pembayaran, nama_bank, bukti_pembayaran
FROM form_pembayaran WHERE id = ?", [$last_id]);
}
}
Is it possible to make a crud from a form, i would like to make a crud from a form, because i try to make a crud then a form, and try to have the submitted results shows on a crud, it's not working, I've try to add a line of code on the form controller to save it on a different tables, but it's not working,
`<?php defined('BASEPATH') OR exit('No direct script access allowed');
/* | -------------------------------------------------------------------------- | Form Pembayaran Controller | -------------------------------------------------------------------------- | Form Pembayaran site | */ class Form_pembayaran extends Admin {
}
/ End of file form_pembayaran.php / / Location: ./application/controllers/administrator/Form Pembayaran.php /`