| @@ 472-496 (lines=25) @@ | ||
| 469 | //unlink($full_path.$originationrate_file_name); |
|
| 470 | $count=count($invalid_array); |
|
| 471 | //echo "<pre>";print_r($count);exit; |
|
| 472 | if($count >0){ |
|
| 473 | $session_id = "-1"; |
|
| 474 | $fp = fopen($full_path.$session_id.'.csv', 'w'); |
|
| 475 | foreach($new_final_arr_key as $key=>$value){ |
|
| 476 | $custom_array[0][$key]=ucfirst($key); |
|
| 477 | } |
|
| 478 | $custom_array[0]['error']= "Error"; |
|
| 479 | $invalid_array =array_merge($custom_array,$invalid_array); |
|
| 480 | foreach($invalid_array as $err_data){ |
|
| 481 | fputcsv($fp,$err_data); |
|
| 482 | } |
|
| 483 | fclose($fp); |
|
| 484 | $this->session->set_userdata('import_package_code_csv_error', $session_id.".csv"); |
|
| 485 | $data["error"] = $invalid_array; |
|
| 486 | $data['packageid'] = $edit_id; |
|
| 487 | $data['impoted_count'] = count($new_final_arr); |
|
| 488 | $data['failure_count'] = count($invalid_array)-1; |
|
| 489 | $data['page_title'] = 'Package Patterns Import Error'; |
|
| 490 | //print_r($data) ;exit; |
|
| 491 | $this->load->view('view_import_error',$data); |
|
| 492 | } else{ |
|
| 493 | $this->session->set_flashdata('astpp_errormsg', 'Package patterns imported successfully!'); |
|
| 494 | //echo base_url()."package/package_pattern_list/" . $edit_id . "/";exit; |
|
| 495 | redirect(base_url()."package/package_pattern_list/" . $edit_id . "/"); |
|
| 496 | } |
|
| 497 | } |
|
| 498 | ||
| 499 | function data_validate($csvdata){ |
|
| @@ 181-203 (lines=23) @@ | ||
| 178 | } |
|
| 179 | unlink($full_path.$terminationrate_file_name); |
|
| 180 | $count=count($invalid_array); |
|
| 181 | if($count >0){ |
|
| 182 | $session_id = "-1"; |
|
| 183 | $fp = fopen($full_path.$session_id.'.csv', 'w'); |
|
| 184 | foreach($new_final_arr_key as $key=>$value){ |
|
| 185 | $custom_array[0][$key]=ucfirst($key); |
|
| 186 | } |
|
| 187 | $custom_array[0]['error']= "Error"; |
|
| 188 | $invalid_array =array_merge($custom_array,$invalid_array); |
|
| 189 | foreach($invalid_array as $err_data){ |
|
| 190 | fputcsv($fp,$err_data); |
|
| 191 | } |
|
| 192 | fclose($fp); |
|
| 193 | $this->session->set_userdata('import_termination_rate_csv_error', $session_id.".csv"); |
|
| 194 | $data["error"] = $invalid_array; |
|
| 195 | $data['trunkid'] = $trunkID; |
|
| 196 | $data['impoted_count'] = count($new_final_arr); |
|
| 197 | $data['failure_count'] = count($invalid_array)-1; |
|
| 198 | $data['page_title'] = 'Termination Rates Import Error'; |
|
| 199 | $this->load->view('view_import_error',$data); |
|
| 200 | } else{ |
|
| 201 | $this->session->set_flashdata('astpp_errormsg', 'Total '.count($new_final_arr).' Termination rates imported successfully!'); |
|
| 202 | redirect(base_url()."rates/termination_rates_list/"); |
|
| 203 | } |
|
| 204 | } |
|
| 205 | function termination_rate_error_download(){ |
|
| 206 | $this->load->helper('download'); |
|
| @@ 329-351 (lines=23) @@ | ||
| 326 | } |
|
| 327 | unlink($full_path.$originationrate_file_name); |
|
| 328 | $count=count($invalid_array); |
|
| 329 | if($count >0){ |
|
| 330 | $session_id = "-1"; |
|
| 331 | $fp = fopen($full_path.$session_id.'.csv', 'w'); |
|
| 332 | foreach($new_final_arr_key as $key=>$value){ |
|
| 333 | $custom_array[0][$key]=ucfirst($key); |
|
| 334 | } |
|
| 335 | $custom_array[0]['error']= "Error"; |
|
| 336 | $invalid_array =array_merge($custom_array,$invalid_array); |
|
| 337 | foreach($invalid_array as $err_data){ |
|
| 338 | fputcsv($fp,$err_data); |
|
| 339 | } |
|
| 340 | fclose($fp); |
|
| 341 | $this->session->set_userdata('import_origination_rate_csv_error', $session_id.".csv"); |
|
| 342 | $data["error"] = $invalid_array; |
|
| 343 | $data['pricelistid'] = $pricelistID; |
|
| 344 | $data['impoted_count'] = count($new_final_arr); |
|
| 345 | $data['failure_count'] = count($invalid_array)-1; |
|
| 346 | $data['page_title'] = 'Origination Rates Import Error'; |
|
| 347 | $this->load->view('view_import_error',$data); |
|
| 348 | } else{ |
|
| 349 | $this->session->set_flashdata('astpp_errormsg', 'Total '.count($new_final_arr).' Origination rates imported successfully!'); |
|
| 350 | redirect(base_url()."rates/origination_rates_list/"); |
|
| 351 | } |
|
| 352 | } |
|
| 353 | function data_validate($csvdata){ |
|
| 354 | $str=null; |
|
| @@ 1265-1294 (lines=30) @@ | ||
| 1262 | ||
| 1263 | unlink($full_path . $terminationrate_file_name); |
|
| 1264 | $count = count($invalid_array); |
|
| 1265 | if ($count > 0) |
|
| 1266 | { |
|
| 1267 | $session_id = "-1"; |
|
| 1268 | $fp = fopen($full_path . $session_id . '.csv', 'w'); |
|
| 1269 | foreach($new_final_arr_key as $key => $value) |
|
| 1270 | { |
|
| 1271 | $custom_array[0][$key] = ucfirst($key); |
|
| 1272 | } |
|
| 1273 | ||
| 1274 | $custom_array[0]['error'] = "Error"; |
|
| 1275 | $invalid_array = array_merge($custom_array, $invalid_array); |
|
| 1276 | foreach($invalid_array as $err_data) |
|
| 1277 | { |
|
| 1278 | fputcsv($fp, $err_data); |
|
| 1279 | } |
|
| 1280 | ||
| 1281 | fclose($fp); |
|
| 1282 | $this->session->set_userdata('import_termination_rate_mapper_csv_error', $session_id . ".csv"); |
|
| 1283 | $data["error"] = $invalid_array; |
|
| 1284 | $data['trunkid'] = $trunkID; |
|
| 1285 | $data['impoted_count'] = count($new_final_arr); |
|
| 1286 | $data['failure_count'] = count($invalid_array) - 1; |
|
| 1287 | $data['page_title'] = 'Termination Rates Import Error'; |
|
| 1288 | $this->load->view('view_import_error', $data); |
|
| 1289 | } |
|
| 1290 | else |
|
| 1291 | { |
|
| 1292 | $this->session->set_flashdata('astpp_errormsg', 'Total ' . count($new_final_arr) . ' Termination rates imported successfully!'); |
|
| 1293 | redirect(base_url() . "rates/termination_rate_list/"); |
|
| 1294 | } |
|
| 1295 | } |
|
| 1296 | ||
| 1297 | /*************************/ |
|