@@ -1429,7 +1429,7 @@ discard block |
||
1429 | 1429 | // $csv_data = $this->csvreader->parse_file($uploadedFile, $new_final_arr_key, $check_header); |
1430 | 1430 | |
1431 | 1431 | $csv_data = $this->utf8_converter($this->csvreader->parse_file($uploadedFile, $field_select, $check_header)); |
1432 | - if (!empty($csv_data)) |
|
1432 | + if (!empty($csv_data)) |
|
1433 | 1433 | { |
1434 | 1434 | $full_path = $this->config->item('rates-file-path'); |
1435 | 1435 | $actual_file_name = "ASTPP-TERMINATION-RATES-" . date("Y-m-d H:i:s") . "." . $ext; |
@@ -1566,11 +1566,11 @@ discard block |
||
1566 | 1566 | { |
1567 | 1567 | $result = $this->rates_model->bulk_insert_termination_rate($new_final_arr); |
1568 | 1568 | } |
1569 | - else |
|
1570 | - { |
|
1569 | + else |
|
1570 | + { |
|
1571 | 1571 | |
1572 | - $this->session->set_flashdata('astpp_errormsg', 'Error - Nothing selected to import/process!'); |
|
1573 | - redirect(base_url() . 'rates/termination_rates_list/'); |
|
1572 | + $this->session->set_flashdata('astpp_errormsg', 'Error - Nothing selected to import/process!'); |
|
1573 | + redirect(base_url() . 'rates/termination_rates_list/'); |
|
1574 | 1574 | } |
1575 | 1575 | |
1576 | 1576 | unlink($full_path . $terminationrate_file_name); |
@@ -7,19 +7,19 @@ discard block |
||
7 | 7 | }); |
8 | 8 | </script> <script type="text/javascript" language="javascript"><? |
9 | 9 | if (isset($mapto_fields) && !empty($mapto_fields)) { |
10 | - foreach($mapto_fields as $csv_key => $csv_value) { |
|
11 | - echo '$("#'.$csv_value .'-prefix").live("change", function () {'; |
|
12 | - echo 'var select = document.getElementById("'.$csv_value .'-select");'; |
|
13 | - echo 'var answer = select.options[select.selectedIndex].value;'; |
|
14 | - echo 'document.getElementById("'.$csv_value .'-display").value = (!answer) ? document.getElementById("'.$csv_value .'-prefix").value : document.getElementById("'.$csv_value .'-prefix").value + csv_tmp_data[2][answer];'; |
|
15 | - echo '});'; |
|
16 | - echo '$("#'.$csv_value .'-select").live("change", function () {'; |
|
17 | - echo 'var select = document.getElementById("'.$csv_value .'-select");'; |
|
18 | - echo 'var answer = select.options[select.selectedIndex].value;'; |
|
19 | - echo 'document.getElementById("'.$csv_value .'-display").value = (!answer) ? document.getElementById("'.$csv_value .'-prefix").value : document.getElementById("'.$csv_value .'-prefix").value + csv_tmp_data[2][answer];'; |
|
20 | - echo '});'; |
|
21 | - } |
|
22 | - } |
|
10 | + foreach($mapto_fields as $csv_key => $csv_value) { |
|
11 | + echo '$("#'.$csv_value .'-prefix").live("change", function () {'; |
|
12 | + echo 'var select = document.getElementById("'.$csv_value .'-select");'; |
|
13 | + echo 'var answer = select.options[select.selectedIndex].value;'; |
|
14 | + echo 'document.getElementById("'.$csv_value .'-display").value = (!answer) ? document.getElementById("'.$csv_value .'-prefix").value : document.getElementById("'.$csv_value .'-prefix").value + csv_tmp_data[2][answer];'; |
|
15 | + echo '});'; |
|
16 | + echo '$("#'.$csv_value .'-select").live("change", function () {'; |
|
17 | + echo 'var select = document.getElementById("'.$csv_value .'-select");'; |
|
18 | + echo 'var answer = select.options[select.selectedIndex].value;'; |
|
19 | + echo 'document.getElementById("'.$csv_value .'-display").value = (!answer) ? document.getElementById("'.$csv_value .'-prefix").value : document.getElementById("'.$csv_value .'-prefix").value + csv_tmp_data[2][answer];'; |
|
20 | + echo '});'; |
|
21 | + } |
|
22 | + } |
|
23 | 23 | ?></script> |
24 | 24 | <? |
25 | 25 | if (isset($csv_tmp_data) && !empty($csv_tmp_data)) { |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | echo 'var csv_tmp_data = ' . json_encode($csv_tmp_data) . ';'; |
28 | 28 | echo '</script>'; |
29 | 29 | } |
30 | - ?> |
|
30 | + ?> |
|
31 | 31 | <?php |
32 | 32 | endblock() ?> |
33 | 33 | <?php |
@@ -51,9 +51,9 @@ discard block |
||
51 | 51 | <div class="w-box"> |
52 | 52 | <span style="margin-left:10px; text-align: center;background-color: none;color:#DD191D;"> |
53 | 53 | <?php |
54 | - if (isset($error) && !empty($error)) { |
|
55 | - echo $error; |
|
56 | - } ?> |
|
54 | + if (isset($error) && !empty($error)) { |
|
55 | + echo $error; |
|
56 | + } ?> |
|
57 | 57 | </span> |
58 | 58 | <h3 class="padding-t-10 padding-l-16">You must either select a field from your file OR provide a default value for the following fields:</h3> |
59 | 59 | <p>Code,Destination,Connect Cost,Included Seconds,Per Minute Cost,Increment,Precedence,Strip,Prepend.</p> |
@@ -67,10 +67,10 @@ discard block |
||
67 | 67 | <label class="col-md-3">Trunk List:</label> |
68 | 68 | <div class="col-md-8"> |
69 | 69 | <?php |
70 | - $trunklist = form_dropdown('trunk_id', $this->db_model->build_dropdown("id,name", "trunks", "where_arr", array( |
|
71 | - "status " => "0" |
|
72 | - )) , ''); |
|
73 | - echo $trunklist; ?> |
|
70 | + $trunklist = form_dropdown('trunk_id', $this->db_model->build_dropdown("id,name", "trunks", "where_arr", array( |
|
71 | + "status " => "0" |
|
72 | + )) , ''); |
|
73 | + echo $trunklist; ?> |
|
74 | 74 | </div> |
75 | 75 | </div> |
76 | 76 | |
@@ -135,28 +135,28 @@ discard block |
||
135 | 135 | </thead> |
136 | 136 | <tbody> |
137 | 137 | <?php |
138 | - foreach($mapto_fields as $csv_key => $csv_value) { |
|
138 | + foreach($mapto_fields as $csv_key => $csv_value) { |
|
139 | 139 | |
140 | - echo "<tr>"; |
|
141 | - echo "<td>" . $csv_key . '(' . $csv_value . ")</td>"; |
|
142 | - echo "<td><input type='text' name='".$csv_value ."-prefix' id='".$csv_value ."-prefix'></td>"; |
|
143 | - echo "<td>"; |
|
144 | - echo "<select name='".$csv_value ."-select' id='".$csv_value ."-select'>"; |
|
145 | - ?> |
|
140 | + echo "<tr>"; |
|
141 | + echo "<td>" . $csv_key . '(' . $csv_value . ")</td>"; |
|
142 | + echo "<td><input type='text' name='".$csv_value ."-prefix' id='".$csv_value ."-prefix'></td>"; |
|
143 | + echo "<td>"; |
|
144 | + echo "<select name='".$csv_value ."-select' id='".$csv_value ."-select'>"; |
|
145 | + ?> |
|
146 | 146 | <option value=""></option> |
147 | 147 | <?php |
148 | - $keys = array_keys($file_data); |
|
149 | - for ($i = 0; $i < count($file_data); $i++) { ?> |
|
148 | + $keys = array_keys($file_data); |
|
149 | + for ($i = 0; $i < count($file_data); $i++) { ?> |
|
150 | 150 | <option value="<?php |
151 | - echo $file_data[$i]; ?>"><?php |
|
152 | - echo $file_data[$i]; ?></option> |
|
151 | + echo $file_data[$i]; ?>"><?php |
|
152 | + echo $file_data[$i]; ?></option> |
|
153 | 153 | <?php |
154 | - } |
|
155 | - echo "</td>"; |
|
156 | - echo "<td><input type='text' name='".$csv_value ."-display' id='".$csv_value ."-display'></td>"; |
|
157 | - echo "</tr>"; |
|
154 | + } |
|
155 | + echo "</td>"; |
|
156 | + echo "<td><input type='text' name='".$csv_value ."-display' id='".$csv_value ."-display'></td>"; |
|
157 | + echo "</tr>"; |
|
158 | 158 | |
159 | - } ?> |
|
159 | + } ?> |
|
160 | 160 | </tbody> |
161 | 161 | </table> |
162 | 162 | <input type="hidden" name="trunkid" value="<?php echo $trunkid ?>" /> |
@@ -174,25 +174,25 @@ discard block |
||
174 | 174 | <form id="import_form" name="import_form" action="<?=base_url()?>rates/termination_rate_rates_import/<?= $trunkid?>/<?=$check_header?>/" method="POST"> |
175 | 175 | <table width="100%" border="1" class="details_table table"> |
176 | 176 | <? $cnt =1; |
177 | - foreach($csv_tmp_data as $csv_key => $csv_value){ |
|
178 | - if($csv_key < 15){ |
|
179 | - echo "<tr>"; |
|
180 | - foreach($csv_value as $field_name => $field_val){ |
|
181 | - if($csv_key == 0){ |
|
182 | - echo "<th>".ucfirst($field_val)."</th>"; |
|
183 | - }else{ |
|
184 | - echo "<td class='portlet-content'>".$field_val."</td>"; |
|
185 | - $cnt++; |
|
186 | - } |
|
187 | - } |
|
188 | - echo "</tr>"; |
|
189 | - } |
|
190 | - } |
|
177 | + foreach($csv_tmp_data as $csv_key => $csv_value){ |
|
178 | + if($csv_key < 15){ |
|
179 | + echo "<tr>"; |
|
180 | + foreach($csv_value as $field_name => $field_val){ |
|
181 | + if($csv_key == 0){ |
|
182 | + echo "<th>".ucfirst($field_val)."</th>"; |
|
183 | + }else{ |
|
184 | + echo "<td class='portlet-content'>".$field_val."</td>"; |
|
185 | + $cnt++; |
|
186 | + } |
|
187 | + } |
|
188 | + echo "</tr>"; |
|
189 | + } |
|
190 | + } |
|
191 | 191 | |
192 | - echo "<tr><td colspan='".$cnt."'> |
|
192 | + echo "<tr><td colspan='".$cnt."'> |
|
193 | 193 | <a href='".base_url()."rates/termination_rates_list/'><input type='button' class='btn btn-line-sky pull-right margin-x-10' value='Back'/></a> |
194 | 194 | <input type='submit' class='btn btn-line-parrot pull-right'' id='Process' value='Process'/></td></tr>"; |
195 | - ?> </table></form> |
|
195 | + ?> </table></form> |
|
196 | 196 | </div> |
197 | 197 | </div> |
198 | 198 | </div> |