• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Add the edit option

#1
Hi guys, I'm working on a codeigniter template ( https://codecanyon.net/item/class-ease-e...m/29109477 )

This template is for a school and I have a problem :



I must have the possibility to modify the fees owed by the students, the fact of being able to edit is available for most objects (courses, teachers, students etc ...). But you cannot edit the payments due. So I started to set this system up, I added the edit button but the data is not saved, do you know where I can change that?





StudentsDues Controller
PHP Code:
public function save()
    {
        $this->checkIfDemo();
        $this->form_validation->set_rules('amount''Amount''trim|required|numeric');
        $this->form_validation->set_rules('description''Description''trim|required|min_length[2]|max_length[50]');

        $edit $this->xssCleanInput('student_due_id') ? $this->xssCleanInput('student_due_id') : false;

        if ($edit && $this->form_validation->run() === FALSE) {
            echo json_encode(array(
                'success' => 'false',
                'messages' => $this->ajaxErrorMessage(array('error' => validation_errors()))
            ));
        } else {
            $data $this->AdminStudentDueModel->storeStudentDue();
            echo json_encode(array(
                'success' => 'true',
                'messages' => $this->ajaxErrorMessage(array('success' => lang('student_due') . ($edit lang('updated') : lang('created')))),
                'data' => $data.' '.lang('student_dues_created'),
            ));

        }
    



Courses Controller

PHP Code:
public function save()
    {
        $this->checkIfDemo();
        $this->form_validation->set_rules('title''Title''trim|required|min_length[2]|max_length[50]');
        $this->form_validation->set_rules('code''Code''trim|required|min_length[2]|max_length[50]');
        $this->form_validation->set_rules('description''Description''trim|required|min_length[10]|max_length[5000]');

        $edit $this->xssCleanInput('course_id') ? $this->xssCleanInput('course_id') : false;

        if ($this->form_validation->run() === FALSE) {
            echo json_encode(array(
                'success' => 'false',
                'messages' => $this->ajaxErrorMessage(array('error' => validation_errors()))
            ));
        } elseif ($this->AdminCourseModel->valueExist('code'$this->xssCleanInput('code'), $edit)) {
            echo json_encode(array(
                'success' => 'false',
                'messages' => $this->ajaxErrorMessage(array('error' => lang('code_already_exist')))
            ));
        } else {
            $data $this->AdminCourseModel->storeCourse($edit);
            echo json_encode(array(
                'success' => 'true',
                'messages' => $this->ajaxErrorMessage(array('success' => lang('course') . ($edit lang('updated') : lang('created')))),
                'data' => $data
            
));
        }
    


Thanks !
Reply

#2
I think you must request support to template's owner @codewand in condecanyon page: https://codecanyon.net/user/codewand
Reply

#3
Sad 
(01-07-2021, 07:15 AM)nicojmb Wrote: I think you must request support to template's owner @codewand in condecanyon page:  https://codecanyon.net/user/codewand

I've already sent him a mail but he said he just did'nt put that option and he gave me like an alternative way, and no code :/

So I wanted to ask for help from all of you.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.