| @@ 84-94 (lines=11) @@ | ||
| 81 | printf($this->GRN.$text.$this->NC); |
|
| 82 | } |
|
| 83 | /* function read CSV file */ |
|
| 84 | protected function readCSV() |
|
| 85 | { |
|
| 86 | /* Silahkan di rubah sesuai struktur file csv */ |
|
| 87 | $file = fopen(database_path("seeds/".$this->fileName), "r"); |
|
| 88 | $all_data = array(); |
|
| 89 | $row = 1; |
|
| 90 | while(($data = fgetcsv($file, 1000, ",")) !== FALSE){ |
|
| 91 | $all_data[] = [ |
|
| 92 | 'id' => $data[0], |
|
| 93 | 'nama' => $data[1], |
|
| 94 | 'instansi' => $data[2], |
|
| 95 | 'nilai' => $data[3], |
|
| 96 | 'user_id' => $data[4], |
|
| 97 | ]; |
|
| @@ 87-104 (lines=18) @@ | ||
| 84 | printf($this->GRN.$text.$this->NC); |
|
| 85 | } |
|
| 86 | /* function read CSV file */ |
|
| 87 | protected function readCSV() |
|
| 88 | { |
|
| 89 | $file = fopen(database_path("seeds/".$this->fileName), "r"); |
|
| 90 | $all_data = array(); |
|
| 91 | $row = 1; |
|
| 92 | while(($data = fgetcsv($file, 1000, ",")) !== FALSE){ |
|
| 93 | $all_data[] = [ |
|
| 94 | 'id' => $data[0], |
|
| 95 | 'nomor_un' => $data[1], |
|
| 96 | 'master_sktm_id' => $data[2], |
|
| 97 | 'no_sktm' => $data[3], |
|
| 98 | 'nilai' => $data[4], |
|
| 99 | 'user_id' => $data[5], |
|
| 100 | ]; |
|
| 101 | } |
|
| 102 | fclose($file); |
|
| 103 | return $all_data; |
|
| 104 | } |
|
| 105 | } |
|
| 106 | ||