Completed
Pull Request — v3.0 (#146)
by
unknown
151:42 queued 140:10
created
web_interface/astpp/application/modules/rates/controllers/rates.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1429,7 +1429,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
application/modules/rates/views/view_import_termination_rate_mapper.php 1 patch
Indentation   +70 added lines, -70 removed lines patch added patch discarded remove patch
@@ -7,19 +7,19 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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,54 +174,54 @@  discard block
 block discarded – undo
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 =7;
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_name)."</th>";
183
-               								}else{
184
-               									echo "<td class='portlet-content'>".$field_val."</td>";
185
-               								}
186
-               							}
187
-               							echo "</tr>";
188
-               						}
189
-               					}
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_name)."</th>";
183
+			   								}else{
184
+			   									echo "<td class='portlet-content'>".$field_val."</td>";
185
+			   								}
186
+			   							}
187
+			   							echo "</tr>";
188
+			   						}
189
+			   					}
190 190
 
191
-               					echo "<tr><td colspan='".$cnt."'>
191
+			   					echo "<tr><td colspan='".$cnt."'>
192 192
                                        <a href='".base_url()."rates/termination_rates_list/'><input type='button' class='btn btn-line-sky pull-right  margin-x-10' value='Back'/></a>
193 193
                                        <input type='submit' class='btn btn-line-parrot pull-right'' id='Process' value='Process'/></td></tr>";
194
-               		?> </table></form>
194
+			   		?> </table></form>
195 195
                     </div>
196 196
                            </div>
197 197
                        </div>
198 198
                    </div>
199 199
                <table width="100%" border="1"  class="details_table">
200 200
                   <?php
201
-                     $cnt = 1;
202
-                     foreach($csv_tmp_data as $csv_key => $csv_value) {
203
-                     	if ($csv_key < 15) {
204
-                     		echo "<tr>";
205
-                     		foreach($csv_value as $field_name => $field_val) {
206
-                     			if ($csv_key == 0) {
201
+					 $cnt = 1;
202
+					 foreach($csv_tmp_data as $csv_key => $csv_value) {
203
+					 	if ($csv_key < 15) {
204
+					 		echo "<tr>";
205
+					 		foreach($csv_value as $field_name => $field_val) {
206
+					 			if ($csv_key == 0) {
207 207
 
208
-                     				 echo "<th>".ucfirst($field_val)."</th>";
208
+					 				 echo "<th>".ucfirst($field_val)."</th>";
209 209
 
210
-                     			}
211
-                     			else {
212
-                     				echo "<td class='portlet-content'>" . $field_val . "</td>";
213
-                     				$cnt++;
214
-                     			}
215
-                     		}
210
+					 			}
211
+					 			else {
212
+					 				echo "<td class='portlet-content'>" . $field_val . "</td>";
213
+					 				$cnt++;
214
+					 			}
215
+					 		}
216 216
 
217
-                     		echo "</tr>";
218
-                     	}
219
-                     }
217
+					 		echo "</tr>";
218
+					 	}
219
+					 }
220 220
 
221
-                     echo "<tr><td colspan='" . $cnt . "'>
221
+					 echo "<tr><td colspan='" . $cnt . "'>
222 222
                                             <a href='" . base_url() . "rates/termination_rate_list/'><input type='button' class='btn btn-line-sky pull-right  margin-x-10' value='Back'/></a>
223 223
                                             <input type='submit' class='btn btn-line-parrot pull-right'' id='Process' value='Process Records'/></td></tr>";
224
-                     ?>
224
+					 ?>
225 225
                </table>
226 226
             </form>
227 227
          </div>
Please login to merge, or discard this patch.