php - Display current import file (html table form) from database into cakephp -


cakephp version 2.5.1, import file (csv format), database (mssql)

i have imported csv file , saved database, after save want display each of 'current' import data using html table in cakephp. problem don't have idea code find current batch upload each batch start point l01-0-00-00-000 until end l01-0-00-00-999.the l01 on each string change l02, l03 , on.

i try use function in mycontroller, show table line=01

my controller: function index () { $this->set('uploads', $this->upload->getcolumntypes('all', array('conditions' => array('ras_off_upload.ras_code' => ' l01-0-00-00-000' && ' l01-0-00-00-999' )))); }

thank of suggestion.

output table in database: ras_off_upload table

no  ras_code         value  remark  sf  create_by  cln       lot       prod  time date  1   l01-0-00-00-000   0     test    h   d123     cln12345   sltc123m  ln2cpw 7:10 25jun 2   l01-1-01-01-111  68     test    l   d123                                 7:15 25jun 3   l01-0-01-01-222  40     test    l   d123                                 7:18 25jun          4   l01-0-01-01-333  82     test    l   d123                                 7:20 25jun 5   l01-0-00-00-444  59     test    l   d123                                 7:21 25jun 6   l01-0-00-00-555  59     test    l   d123                                 7:23 25jun 7   l01-0-00-00-666  59     test    l   d123                                 7:34 25jun 8   l01-0-00-00-777  59     test    l   d123                                 7:37 25jun 9   l01-0-00-00-888  59     test    l   d123                                 7:40 25jun 10  l01-0-00-00-999   0     test    e   d123                                 7:41 25jun 

i considering rasoffupload model correspond ras_off_upload table.

try following:

function index () {      $this->set('uploads', $this->rasoffupload->find('all',                  array('conditions' => array('rasoffupload.ras_code regexp' => '^l01-0-00-00-[0-9]*$'))));  } 

use find method instead of getcolumntypes. can try use ^l01-0-00-00-[[:digit:]][[:digit:]][[:digit:]]$.

if in middle digit varies 0 9, can use like: ^l01-[[:digit:]]-00-00-[[:digit:]][[:digit:]][[:digit:]]$.


Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -