|
@@ 326-337 (lines=12) @@
|
| 323 |
|
|
| 324 |
|
$query = $this->user_model->get_user_rates_list(true, $paging_data["paging"]["start"], $paging_data["paging"]["page_no"]); |
| 325 |
|
$grid_fields = json_decode($this->user_form->user_rates_list()); |
| 326 |
|
foreach ($query->result_array() as $key => $value) { |
| 327 |
|
$cost=$account_data['type']!=3 ? ($value['cost'] + (($value['cost']*$markup)/100)) : $value['cost']; |
| 328 |
|
$json_data['rows'][] = array('cell' => array( |
| 329 |
|
$this->common->get_only_numeric_val("","",$value["pattern"]), |
| 330 |
|
$value['comment'], |
| 331 |
|
$this->common_model->calculate_currency($value['connectcost'],'','',true,false), |
| 332 |
|
$value['includedseconds'], |
| 333 |
|
$this->common_model->calculate_currency(($cost),'','',true,false), |
| 334 |
|
$value['init_inc'], |
| 335 |
|
$value['inc'] |
| 336 |
|
)); |
| 337 |
|
} |
| 338 |
|
echo json_encode($json_data); |
| 339 |
|
} |
| 340 |
|
|
|
@@ 380-391 (lines=12) @@
|
| 377 |
|
ob_clean(); |
| 378 |
|
$inbound_array[] = array("Code", "Destination","Connect Cost($currency)","Included Seconds","Per Minute Cost($currency)","Initital Increment","Increment"); |
| 379 |
|
if ($query->num_rows() > 0) { |
| 380 |
|
foreach ($query->result_array() as $row) { |
| 381 |
|
$cost=$account_data['type']!=3 ? ($row['cost'] + ($row['cost']*$markup)/100) :$row['cost']; |
| 382 |
|
$inbound_array[] = array( |
| 383 |
|
$row['pattern']=$this->common->get_only_numeric_val("","",$row["pattern"]), |
| 384 |
|
$row['comment'], |
| 385 |
|
$this->common_model->calculate_currency($row['connectcost'],'','',true,false), |
| 386 |
|
$row['includedseconds'], |
| 387 |
|
$this->common_model->calculate_currency($cost,'','',true,false), |
| 388 |
|
$row['init_inc'], |
| 389 |
|
$row['inc'] |
| 390 |
|
); |
| 391 |
|
} |
| 392 |
|
} |
| 393 |
|
$this->load->helper('csv'); |
| 394 |
|
array_to_csv($inbound_array, 'Rates_' . date("Y-m-d") . '.csv'); |