@@ -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> |
@@ -1253,11 +1253,11 @@ |
||
| 1253 | 1253 | { |
| 1254 | 1254 | $result = $this->rates_model->bulk_insert_termination_rate($new_final_arr); |
| 1255 | 1255 | } |
| 1256 | - else |
|
| 1257 | - { |
|
| 1256 | + else |
|
| 1257 | + { |
|
| 1258 | 1258 | |
| 1259 | - $this->session->set_flashdata('astpp_errormsg', 'Error - Nothing selected to import/process!'); |
|
| 1260 | - redirect(base_url() . 'rates/termination_rates_list/'); |
|
| 1259 | + $this->session->set_flashdata('astpp_errormsg', 'Error - Nothing selected to import/process!'); |
|
| 1260 | + redirect(base_url() . 'rates/termination_rates_list/'); |
|
| 1261 | 1261 | } |
| 1262 | 1262 | |
| 1263 | 1263 | unlink($full_path . $terminationrate_file_name); |