@@ -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 |
@@ -50,9 +50,9 @@ discard block |
||
50 | 50 | <div class="w-box"> |
51 | 51 | <span style="margin-left:10px; text-align: center;background-color: none;color:#DD191D;"> |
52 | 52 | <?php |
53 | - if (isset($error) && !empty($error)) { |
|
54 | - echo $error; |
|
55 | - } ?> |
|
53 | + if (isset($error) && !empty($error)) { |
|
54 | + echo $error; |
|
55 | + } ?> |
|
56 | 56 | </span> |
57 | 57 | <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> |
58 | 58 | <p>Code,Destination,Connect Cost,Included Seconds,Per Minute Cost,Increment,Precedence,Strip,Prepend.</p> |
@@ -66,10 +66,10 @@ discard block |
||
66 | 66 | <label class="col-md-3">Trunk List:</label> |
67 | 67 | <div class="col-md-8"> |
68 | 68 | <?php |
69 | - $trunklist = form_dropdown('trunk_id', $this->db_model->build_dropdown("id,name", "trunks", "where_arr", array( |
|
70 | - "status " => "0" |
|
71 | - )) , ''); |
|
72 | - echo $trunklist; ?> |
|
69 | + $trunklist = form_dropdown('trunk_id', $this->db_model->build_dropdown("id,name", "trunks", "where_arr", array( |
|
70 | + "status " => "0" |
|
71 | + )) , ''); |
|
72 | + echo $trunklist; ?> |
|
73 | 73 | </div> |
74 | 74 | </div> |
75 | 75 | |
@@ -134,28 +134,28 @@ discard block |
||
134 | 134 | </thead> |
135 | 135 | <tbody> |
136 | 136 | <?php |
137 | - foreach($mapto_fields as $csv_key => $csv_value) { |
|
137 | + foreach($mapto_fields as $csv_key => $csv_value) { |
|
138 | 138 | |
139 | - echo "<tr>"; |
|
140 | - echo "<td>" . $csv_key . '(' . $csv_value . ")</td>"; |
|
141 | - echo "<td><input type='text' name='".$csv_value ."-prefix' id='".$csv_value ."-prefix'></td>"; |
|
142 | - echo "<td>"; |
|
143 | - echo "<select name='".$csv_value ."-select' id='".$csv_value ."-select'>"; |
|
144 | - ?> |
|
139 | + echo "<tr>"; |
|
140 | + echo "<td>" . $csv_key . '(' . $csv_value . ")</td>"; |
|
141 | + echo "<td><input type='text' name='".$csv_value ."-prefix' id='".$csv_value ."-prefix'></td>"; |
|
142 | + echo "<td>"; |
|
143 | + echo "<select name='".$csv_value ."-select' id='".$csv_value ."-select'>"; |
|
144 | + ?> |
|
145 | 145 | <option value=""></option> |
146 | 146 | <?php |
147 | - $keys = array_keys($file_data); |
|
148 | - for ($i = 0; $i < count($file_data); $i++) { ?> |
|
147 | + $keys = array_keys($file_data); |
|
148 | + for ($i = 0; $i < count($file_data); $i++) { ?> |
|
149 | 149 | <option value="<?php |
150 | - echo $file_data[$i]; ?>"><?php |
|
151 | - echo $file_data[$i]; ?></option> |
|
150 | + echo $file_data[$i]; ?>"><?php |
|
151 | + echo $file_data[$i]; ?></option> |
|
152 | 152 | <?php |
153 | - } |
|
154 | - echo "</td>"; |
|
155 | - echo "<td><input type='text' name='".$csv_value ."-display' id='".$csv_value ."-display'></td>"; |
|
156 | - echo "</tr>"; |
|
153 | + } |
|
154 | + echo "</td>"; |
|
155 | + echo "<td><input type='text' name='".$csv_value ."-display' id='".$csv_value ."-display'></td>"; |
|
156 | + echo "</tr>"; |
|
157 | 157 | |
158 | - } ?> |
|
158 | + } ?> |
|
159 | 159 | </tbody> |
160 | 160 | </table> |
161 | 161 | <input type="hidden" name="trunkid" value="<?php echo $trunkid ?>" /> |
@@ -167,30 +167,30 @@ discard block |
||
167 | 167 | <H2> Import File Data..</H2> |
168 | 168 | <table width="100%" border="1" class="details_table"> |
169 | 169 | <?php |
170 | - $cnt = 1; |
|
171 | - foreach($csv_tmp_data as $csv_key => $csv_value) { |
|
172 | - if ($csv_key < 15) { |
|
173 | - echo "<tr>"; |
|
174 | - foreach($csv_value as $field_name => $field_val) { |
|
175 | - if ($csv_key == 0) { |
|
170 | + $cnt = 1; |
|
171 | + foreach($csv_tmp_data as $csv_key => $csv_value) { |
|
172 | + if ($csv_key < 15) { |
|
173 | + echo "<tr>"; |
|
174 | + foreach($csv_value as $field_name => $field_val) { |
|
175 | + if ($csv_key == 0) { |
|
176 | 176 | |
177 | - echo "<th>".ucfirst($field_val)."</th>"; |
|
177 | + echo "<th>".ucfirst($field_val)."</th>"; |
|
178 | 178 | |
179 | - } |
|
180 | - else { |
|
181 | - echo "<td class='portlet-content'>" . $field_val . "</td>"; |
|
182 | - $cnt++; |
|
183 | - } |
|
184 | - } |
|
179 | + } |
|
180 | + else { |
|
181 | + echo "<td class='portlet-content'>" . $field_val . "</td>"; |
|
182 | + $cnt++; |
|
183 | + } |
|
184 | + } |
|
185 | 185 | |
186 | - echo "</tr>"; |
|
187 | - } |
|
188 | - } |
|
186 | + echo "</tr>"; |
|
187 | + } |
|
188 | + } |
|
189 | 189 | |
190 | - echo "<tr><td colspan='" . $cnt . "'> |
|
190 | + echo "<tr><td colspan='" . $cnt . "'> |
|
191 | 191 | <a href='" . base_url() . "rates/termination_rate_list/'><input type='button' class='btn btn-line-sky pull-right margin-x-10' value='Back'/></a> |
192 | 192 | <input type='submit' class='btn btn-line-parrot pull-right'' id='Process' value='Process Records'/></td></tr>"; |
193 | - ?> |
|
193 | + ?> |
|
194 | 194 | </table> |
195 | 195 | </form> |
196 | 196 | </div> |
@@ -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,9 +1566,9 @@ discard block |
||
1566 | 1566 | { |
1567 | 1567 | $result = $this->rates_model->bulk_insert_termination_rate($new_final_arr); |
1568 | 1568 | } |
1569 | - else |
|
1570 | - { |
|
1571 | - $data['error'] = "Error - Nothing selected to import/process"; |
|
1569 | + else |
|
1570 | + { |
|
1571 | + $data['error'] = "Error - Nothing selected to import/process"; |
|
1572 | 1572 | |
1573 | 1573 | } |
1574 | 1574 |