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
https://forums.phpfreaks.com/topic/130245-possible-with-model/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.