Jump to content

possible with model?


homer.favenir

Recommended Posts

hi,

i have an input field, my variable for it is $directory.

is it possible that 2 models will received the input data?

 

controller:

    function process()
    {
        $data['title'] = "DS Validator";
        $data['header'] = "DS Validator";
        $data['batch'] = $this->process_model->directory(); // first model to received the input
        $this->process_model->export(); // 2nd model to received the input
        $this->load->view('process', $data);
    }
    function export()
    {
        $data['title'] = "DS Validator Export";
        $data['header'] = "DS Validator Export";
        $data['excel_file'] = $this->process_model->export();
        $this->load->view('export', $data);
    }

model

function directory()
    {
        $title = "DS Validator Results";
        $header = "DS Validator Results";
        $kebase = "//asecasianas2/DS_Keying/STATS/KE-DIR/";
        $qcbase = "//asecasianas2/DS_Keying/STATS/QC-DIR/";
        $dir = $this->input->post('directory');
        $kedir = $kebase . $dir;
        $qcdir = $qcbase . $dir;
        $kefiles = scandir($kedir);
        $qcfiles = scandir($qcdir);
        $count_files = count($qcfiles);
        return array($kebase,
                    $qcbase,
                    $dir,
                    $kedir,
                    $qcdir,
                    $kefiles,
                    $qcfiles,
                    $count_files,
                    $title,
                    $header);
    }
    function export()
    {
        $title = "DS Validator Results";
        $header = "DS Validator Results";
        $kebase = "//asecasianas2/DS_Keying/STATS/KE-DIR/";
        $qcbase = "//asecasianas2/DS_Keying/STATS/QC-DIR/";
        $dir = $this->input->post('directory');
        $kedir = $kebase . $dir;
        $qcdir = $qcbase . $dir;
        $kefiles = scandir($kedir);
        $qcfiles = scandir($qcdir);
        $count_files = count($qcfiles);
        return array($kebase,
                    $qcbase,
                    $dir,
                    $kedir,
                    $qcdir,
                    $kefiles,
                    $qcfiles,
                    $count_files,
                    $title,
                    $header);
    
    }

but this script doesnt work.

 

please help

 

thanks

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.