@@ -6,17 +6,17 @@ discard block |
||
| 6 | 6 | <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| 7 | 7 | <title> |
| 8 | 8 | <?php |
| 9 | - $this->db->where('domain',$_SERVER['HTTP_HOST']); |
|
| 9 | + $this->db->where('domain', $_SERVER['HTTP_HOST']); |
|
| 10 | 10 | $this->db->select('*'); |
| 11 | 11 | $this->db->order_by('accountid', 'desc'); |
| 12 | 12 | $this->db->limit(1); |
| 13 | 13 | $invoiceconf = $this->db->get('invoice_conf'); |
| 14 | 14 | $invoiceconf = (array)$invoiceconf->first_row(); |
| 15 | - if(isset($invoiceconf['website_title']) && $invoiceconf['website_title']!='') { |
|
| 15 | + if (isset($invoiceconf['website_title']) && $invoiceconf['website_title'] != '') { |
|
| 16 | 16 | ?> |
| 17 | 17 | Forgot Password | <?php echo $invoiceconf['website_title']; ?> |
| 18 | 18 | <?php |
| 19 | - }else{ |
|
| 19 | + } else { |
|
| 20 | 20 | ?> |
| 21 | 21 | Forgot Password | ASTPP - Open Source Voip Billing Solution |
| 22 | 22 | <?php |
@@ -71,18 +71,18 @@ discard block |
||
| 71 | 71 | |
| 72 | 72 | |
| 73 | 73 | <?php |
| 74 | - if(isset($this->session->userdata['user_logo']) && $this->session->userdata['user_logo'] != ""){ |
|
| 74 | + if (isset($this->session->userdata['user_logo']) && $this->session->userdata['user_logo'] != "") { |
|
| 75 | 75 | $logo = $this->session->userdata['user_logo']; |
| 76 | - }else{ |
|
| 76 | + } else { |
|
| 77 | 77 | $logo = 'logo.png'; |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | if ($this->session->userdata('userlevel_logintype') != '0') {?> |
| 81 | 81 | <a class="col-md-12" style="padding:0px 0px 10px 0px" href="<?php echo base_url(); ?>"> |
| 82 | - <img style="height: 44px; width:216px;" id="logo" alt="dashboard" src="<?php echo base_url(); ?>upload/<?php echo$logo;?>"> |
|
| 82 | + <img style="height: 44px; width:216px;" id="logo" alt="dashboard" src="<?php echo base_url(); ?>upload/<?php echo$logo; ?>"> |
|
| 83 | 83 | <? } else {?> |
| 84 | 84 | <a class="col-md-12" style="padding:0px 0px 20px 0px" href="<?php echo base_url(); ?>"> |
| 85 | - <img style="height: 44px; width:216px;" id="logo" title='ASTPP - Open Source Voip Billing Solution' alt='ASTPP - Open Source Voip Billing Solution' src="<?php echo base_url(); ?>upload/<?php echo$logo;?>"> |
|
| 85 | + <img style="height: 44px; width:216px;" id="logo" title='ASTPP - Open Source Voip Billing Solution' alt='ASTPP - Open Source Voip Billing Solution' src="<?php echo base_url(); ?>upload/<?php echo$logo; ?>"> |
|
| 86 | 86 | <? }?> |
| 87 | 87 | </a> |
| 88 | 88 | |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | ?> |
| 17 | 17 | Forgot Password | <?php echo $invoiceconf['website_title']; ?> |
| 18 | 18 | <?php |
| 19 | - }else{ |
|
| 19 | + } else{ |
|
| 20 | 20 | ?> |
| 21 | 21 | Forgot Password | ASTPP - Open Source Voip Billing Solution |
| 22 | 22 | <?php |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | <?php |
| 74 | 74 | if(isset($this->session->userdata['user_logo']) && $this->session->userdata['user_logo'] != ""){ |
| 75 | 75 | $logo = $this->session->userdata['user_logo']; |
| 76 | - }else{ |
|
| 76 | + } else{ |
|
| 77 | 77 | $logo = 'logo.png'; |
| 78 | 78 | } |
| 79 | 79 | |
@@ -6,12 +6,12 @@ |
||
| 6 | 6 | <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| 7 | 7 | <title> |
| 8 | 8 | <?php |
| 9 | - $this->db->where('domain',$_SERVER['HTTP_HOST']); |
|
| 10 | - $this->db->select('*'); |
|
| 11 | - $this->db->order_by('accountid', 'desc'); |
|
| 12 | - $this->db->limit(1); |
|
| 13 | - $invoiceconf = $this->db->get('invoice_conf'); |
|
| 14 | - $invoiceconf = (array)$invoiceconf->first_row(); |
|
| 9 | + $this->db->where('domain',$_SERVER['HTTP_HOST']); |
|
| 10 | + $this->db->select('*'); |
|
| 11 | + $this->db->order_by('accountid', 'desc'); |
|
| 12 | + $this->db->limit(1); |
|
| 13 | + $invoiceconf = $this->db->get('invoice_conf'); |
|
| 14 | + $invoiceconf = (array)$invoiceconf->first_row(); |
|
| 15 | 15 | if(isset($invoiceconf['website_title']) && $invoiceconf['website_title']!='') { |
| 16 | 16 | ?> |
| 17 | 17 | Forgot Password | <?php echo $invoiceconf['website_title']; ?> |
@@ -6,12 +6,12 @@ |
||
| 6 | 6 | <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| 7 | 7 | <title> |
| 8 | 8 | <?php |
| 9 | - $this->db->where('domain',$_SERVER['HTTP_HOST']); |
|
| 10 | - $this->db->select('*'); |
|
| 11 | - $this->db->order_by('accountid', 'desc'); |
|
| 12 | - $this->db->limit(1); |
|
| 13 | - $invoiceconf = $this->db->get('invoice_conf'); |
|
| 14 | - $invoiceconf = (array)$invoiceconf->first_row(); |
|
| 9 | + $this->db->where('domain',$_SERVER['HTTP_HOST']); |
|
| 10 | + $this->db->select('*'); |
|
| 11 | + $this->db->order_by('accountid', 'desc'); |
|
| 12 | + $this->db->limit(1); |
|
| 13 | + $invoiceconf = $this->db->get('invoice_conf'); |
|
| 14 | + $invoiceconf = (array)$invoiceconf->first_row(); |
|
| 15 | 15 | if(isset($invoiceconf['website_title']) && $invoiceconf['website_title']!='') { |
| 16 | 16 | ?> |
| 17 | 17 | Forgot Password | <?php echo $invoiceconf['website_title']; ?> |
@@ -6,17 +6,17 @@ discard block |
||
| 6 | 6 | <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| 7 | 7 | <title> |
| 8 | 8 | <?php |
| 9 | - $this->db->where('domain',$_SERVER['HTTP_HOST']); |
|
| 9 | + $this->db->where('domain', $_SERVER['HTTP_HOST']); |
|
| 10 | 10 | $this->db->select('*'); |
| 11 | 11 | $this->db->order_by('accountid', 'desc'); |
| 12 | 12 | $this->db->limit(1); |
| 13 | 13 | $invoiceconf = $this->db->get('invoice_conf'); |
| 14 | 14 | $invoiceconf = (array)$invoiceconf->first_row(); |
| 15 | - if(isset($invoiceconf['website_title']) && $invoiceconf['website_title']!='') { |
|
| 15 | + if (isset($invoiceconf['website_title']) && $invoiceconf['website_title'] != '') { |
|
| 16 | 16 | ?> |
| 17 | 17 | Forgot Password | <?php echo $invoiceconf['website_title']; ?> |
| 18 | 18 | <?php |
| 19 | - }else{ |
|
| 19 | + } else { |
|
| 20 | 20 | ?> |
| 21 | 21 | Forgot Password | ASTPP - Open Source Voip Billing Solution |
| 22 | 22 | <?php |
@@ -69,18 +69,18 @@ discard block |
||
| 69 | 69 | <div class="w-box dark sign-in-wr box_shadow margin-b-10"> |
| 70 | 70 | <div class="col-md-12 no-padding"> |
| 71 | 71 | <?php |
| 72 | - if(isset($this->session->userdata['user_logo']) && $this->session->userdata['user_logo'] != ""){ |
|
| 72 | + if (isset($this->session->userdata['user_logo']) && $this->session->userdata['user_logo'] != "") { |
|
| 73 | 73 | $logo = $this->session->userdata['user_logo']; |
| 74 | - }else{ |
|
| 74 | + } else { |
|
| 75 | 75 | $logo = 'logo.png'; |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | if ($this->session->userdata('userlevel_logintype') != '0') {?> |
| 79 | 79 | <a class="col-md-9" style="padding:0px 0px 10px 0px" href="<?php echo base_url(); ?>"> |
| 80 | - <img style="height: 44px; width:216px;" id="logo" alt="dashboard" src="<?php echo base_url(); ?>upload/<?php echo$logo;?>"> |
|
| 80 | + <img style="height: 44px; width:216px;" id="logo" alt="dashboard" src="<?php echo base_url(); ?>upload/<?php echo$logo; ?>"> |
|
| 81 | 81 | <? } else {?> |
| 82 | 82 | <a class="col-md-9" style="padding:0px 0px 20px 0px" href="<?php echo base_url(); ?>"> |
| 83 | - <img style="height: 44px; width:216px;" id="logo" title='ASTPP - Open Source Voip Billing Solution' alt='ASTPP - Open Source Voip Billing Solution' src="<?php echo base_url(); ?>upload/<?php echo$logo;?>"> |
|
| 83 | + <img style="height: 44px; width:216px;" id="logo" title='ASTPP - Open Source Voip Billing Solution' alt='ASTPP - Open Source Voip Billing Solution' src="<?php echo base_url(); ?>upload/<?php echo$logo; ?>"> |
|
| 84 | 84 | <? }?> |
| 85 | 85 | |
| 86 | 86 | </a> |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | ?> |
| 17 | 17 | Forgot Password | <?php echo $invoiceconf['website_title']; ?> |
| 18 | 18 | <?php |
| 19 | - }else{ |
|
| 19 | + } else{ |
|
| 20 | 20 | ?> |
| 21 | 21 | Forgot Password | ASTPP - Open Source Voip Billing Solution |
| 22 | 22 | <?php |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | <?php |
| 72 | 72 | if(isset($this->session->userdata['user_logo']) && $this->session->userdata['user_logo'] != ""){ |
| 73 | 73 | $logo = $this->session->userdata['user_logo']; |
| 74 | - }else{ |
|
| 74 | + } else{ |
|
| 75 | 75 | $logo = 'logo.png'; |
| 76 | 76 | } |
| 77 | 77 | |
@@ -103,16 +103,32 @@ discard block |
||
| 103 | 103 | <div class="col-md-12 margin-t-20 padding-r-32 padding-l-32"> |
| 104 | 104 | <label class="col-md-5 no-padding" style="text-align: left;">Password</label> |
| 105 | 105 | <div class="col-md-7 no-padding"> |
| 106 | -<input type="text" name="password" required value="<?php if (isset($value['password'])) echo $value['password']; else ''; ?>" id="password" size="15" maxlength="40" class="form-control" /> |
|
| 107 | -<div class='error-style col-md-12 no-padding' style='color:red; font-size: 13px;' id="une"><?php if (isset($error['password'])) echo $error['password']; ?></div> |
|
| 106 | +<input type="text" name="password" required value="<?php if (isset($value['password'])) { |
|
| 107 | + echo $value['password']; |
|
| 108 | +} else { |
|
| 109 | + ''; |
|
| 110 | +} |
|
| 111 | +?>" id="password" size="15" maxlength="40" class="form-control" /> |
|
| 112 | +<div class='error-style col-md-12 no-padding' style='color:red; font-size: 13px;' id="une"><?php if (isset($error['password'])) { |
|
| 113 | + echo $error['password']; |
|
| 114 | +} |
|
| 115 | +?></div> |
|
| 108 | 116 | </div> |
| 109 | 117 | </div> |
| 110 | 118 | |
| 111 | 119 | <div class="col-md-12 margin-t-10 padding-r-32 padding-l-32"> |
| 112 | 120 | <label class="col-md-5 no-padding" style="text-align: left;">Confirm Password</label> |
| 113 | 121 | <div class="col-md-7 no-padding"> |
| 114 | -<input type="text" name="confirmpassword" required value="<?php if (isset($value['confirm_password'])) echo $value['confirm_password']; else ''; ?>" id="confirm_password" size="15" maxlength="40" class="form-control" /> |
|
| 115 | -<div class='error-style col-md-12' style='color:red; font-size: 13px;' id="conpas"><?php if (isset($error['confirm_password'])) echo $error['confirm_password']; ?></div> |
|
| 122 | +<input type="text" name="confirmpassword" required value="<?php if (isset($value['confirm_password'])) { |
|
| 123 | + echo $value['confirm_password']; |
|
| 124 | +} else { |
|
| 125 | + ''; |
|
| 126 | +} |
|
| 127 | +?>" id="confirm_password" size="15" maxlength="40" class="form-control" /> |
|
| 128 | +<div class='error-style col-md-12' style='color:red; font-size: 13px;' id="conpas"><?php if (isset($error['confirm_password'])) { |
|
| 129 | + echo $error['confirm_password']; |
|
| 130 | +} |
|
| 131 | +?></div> |
|
| 116 | 132 | </div> |
| 117 | 133 | </div> |
| 118 | 134 | |
@@ -6,12 +6,12 @@ |
||
| 6 | 6 | <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| 7 | 7 | <title> |
| 8 | 8 | <?php |
| 9 | - $this->db->where('domain',$_SERVER['HTTP_HOST']); |
|
| 10 | - $this->db->select('*'); |
|
| 11 | - $this->db->order_by('accountid', 'desc'); |
|
| 12 | - $this->db->limit(1); |
|
| 13 | - $invoiceconf = $this->db->get('invoice_conf'); |
|
| 14 | - $invoiceconf = (array)$invoiceconf->first_row(); |
|
| 9 | + $this->db->where('domain',$_SERVER['HTTP_HOST']); |
|
| 10 | + $this->db->select('*'); |
|
| 11 | + $this->db->order_by('accountid', 'desc'); |
|
| 12 | + $this->db->limit(1); |
|
| 13 | + $invoiceconf = $this->db->get('invoice_conf'); |
|
| 14 | + $invoiceconf = (array)$invoiceconf->first_row(); |
|
| 15 | 15 | if(isset($invoiceconf['website_title']) && $invoiceconf['website_title']!='') { |
| 16 | 16 | ?> |
| 17 | 17 | Signup | <?php echo $invoiceconf['website_title']; ?> |
@@ -6,17 +6,17 @@ discard block |
||
| 6 | 6 | <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| 7 | 7 | <title> |
| 8 | 8 | <?php |
| 9 | - $this->db->where('domain',$_SERVER['HTTP_HOST']); |
|
| 9 | + $this->db->where('domain', $_SERVER['HTTP_HOST']); |
|
| 10 | 10 | $this->db->select('*'); |
| 11 | 11 | $this->db->order_by('accountid', 'desc'); |
| 12 | 12 | $this->db->limit(1); |
| 13 | 13 | $invoiceconf = $this->db->get('invoice_conf'); |
| 14 | 14 | $invoiceconf = (array)$invoiceconf->first_row(); |
| 15 | - if(isset($invoiceconf['website_title']) && $invoiceconf['website_title']!='') { |
|
| 15 | + if (isset($invoiceconf['website_title']) && $invoiceconf['website_title'] != '') { |
|
| 16 | 16 | ?> |
| 17 | 17 | Signup | <?php echo $invoiceconf['website_title']; ?> |
| 18 | 18 | <?php |
| 19 | - }else{ |
|
| 19 | + } else { |
|
| 20 | 20 | ?> |
| 21 | 21 | Signup | ASTPP - Open Source Voip Billing Solution |
| 22 | 22 | <?php |
@@ -70,18 +70,18 @@ discard block |
||
| 70 | 70 | <div class="w-box dark sign-in-wr box_shadow margin-b-10"> |
| 71 | 71 | <div class="col-md-12 no-padding"> |
| 72 | 72 | <?php |
| 73 | - if(isset($this->session->userdata['user_logo']) && $this->session->userdata['user_logo'] != ""){ |
|
| 73 | + if (isset($this->session->userdata['user_logo']) && $this->session->userdata['user_logo'] != "") { |
|
| 74 | 74 | $logo = $this->session->userdata['user_logo']; |
| 75 | - }else{ |
|
| 75 | + } else { |
|
| 76 | 76 | $logo = 'logo.png'; |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | if ($this->session->userdata('userlevel_logintype') != '0') {?> |
| 80 | 80 | <a class="col-md-12" style="padding:0px 0px 10px 0px" href="<?php echo base_url(); ?>"> |
| 81 | - <img style="height: 44px; width:216px;" id="logo" alt="dashboard" src="<?php echo base_url(); ?>upload/<?php echo$logo;?>"> |
|
| 81 | + <img style="height: 44px; width:216px;" id="logo" alt="dashboard" src="<?php echo base_url(); ?>upload/<?php echo$logo; ?>"> |
|
| 82 | 82 | <? } else {?> |
| 83 | 83 | <a class="col-md-12" style="padding:0px 0px 20px 0px" href="<?php echo base_url(); ?>"> |
| 84 | - <img style="height: 44px; width:216px;" id="logo" title='ASTPP - Open Source Voip Billing Solution' alt='ASTPP - Open Source Voip Billing Solution' src="<?php echo base_url(); ?>upload/<?php echo$logo;?>"> |
|
| 84 | + <img style="height: 44px; width:216px;" id="logo" title='ASTPP - Open Source Voip Billing Solution' alt='ASTPP - Open Source Voip Billing Solution' src="<?php echo base_url(); ?>upload/<?php echo$logo; ?>"> |
|
| 85 | 85 | <? }?> |
| 86 | 86 | </a> |
| 87 | 87 | |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | ?> |
| 17 | 17 | Signup | <?php echo $invoiceconf['website_title']; ?> |
| 18 | 18 | <?php |
| 19 | - }else{ |
|
| 19 | + } else{ |
|
| 20 | 20 | ?> |
| 21 | 21 | Signup | ASTPP - Open Source Voip Billing Solution |
| 22 | 22 | <?php |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | <?php |
| 73 | 73 | if(isset($this->session->userdata['user_logo']) && $this->session->userdata['user_logo'] != ""){ |
| 74 | 74 | $logo = $this->session->userdata['user_logo']; |
| 75 | - }else{ |
|
| 75 | + } else{ |
|
| 76 | 76 | $logo = 'logo.png'; |
| 77 | 77 | } |
| 78 | 78 | |
@@ -6,12 +6,12 @@ |
||
| 6 | 6 | <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| 7 | 7 | <title> |
| 8 | 8 | <?php |
| 9 | - $this->db->where('domain',$_SERVER['HTTP_HOST']); |
|
| 10 | - $this->db->select('*'); |
|
| 11 | - $this->db->order_by('accountid', 'desc'); |
|
| 12 | - $this->db->limit(1); |
|
| 13 | - $invoiceconf = $this->db->get('invoice_conf'); |
|
| 14 | - $invoiceconf = (array)$invoiceconf->first_row(); |
|
| 9 | + $this->db->where('domain',$_SERVER['HTTP_HOST']); |
|
| 10 | + $this->db->select('*'); |
|
| 11 | + $this->db->order_by('accountid', 'desc'); |
|
| 12 | + $this->db->limit(1); |
|
| 13 | + $invoiceconf = $this->db->get('invoice_conf'); |
|
| 14 | + $invoiceconf = (array)$invoiceconf->first_row(); |
|
| 15 | 15 | if(isset($invoiceconf['website_title']) && $invoiceconf['website_title']!='') { |
| 16 | 16 | ?> |
| 17 | 17 | Signup | <?php echo $invoiceconf['website_title']; ?> |
@@ -6,17 +6,17 @@ discard block |
||
| 6 | 6 | <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| 7 | 7 | <title> |
| 8 | 8 | <?php |
| 9 | - $this->db->where('domain',$_SERVER['HTTP_HOST']); |
|
| 9 | + $this->db->where('domain', $_SERVER['HTTP_HOST']); |
|
| 10 | 10 | $this->db->select('*'); |
| 11 | 11 | $this->db->order_by('accountid', 'desc'); |
| 12 | 12 | $this->db->limit(1); |
| 13 | 13 | $invoiceconf = $this->db->get('invoice_conf'); |
| 14 | 14 | $invoiceconf = (array)$invoiceconf->first_row(); |
| 15 | - if(isset($invoiceconf['website_title']) && $invoiceconf['website_title']!='') { |
|
| 15 | + if (isset($invoiceconf['website_title']) && $invoiceconf['website_title'] != '') { |
|
| 16 | 16 | ?> |
| 17 | 17 | Signup | <?php echo $invoiceconf['website_title']; ?> |
| 18 | 18 | <?php |
| 19 | - }else{ |
|
| 19 | + } else { |
|
| 20 | 20 | ?> |
| 21 | 21 | Signup | ASTPP - Open Source Voip Billing Solution |
| 22 | 22 | <?php |
@@ -53,9 +53,9 @@ discard block |
||
| 53 | 53 | <div class="row"> |
| 54 | 54 | |
| 55 | 55 | <div class="col-md-4 col-md-offset-4"> <span class="login_error"> |
| 56 | - <?php if (isset($astpp_notification)){ ?> |
|
| 56 | + <?php if (isset($astpp_notification)) { ?> |
|
| 57 | 57 | Login unsuccessful. Please make sure you entered the correct username and password, and that your account is active. |
| 58 | - <?php }else{ |
|
| 58 | + <?php } else { |
|
| 59 | 59 | echo " "; |
| 60 | 60 | } |
| 61 | 61 | $astpp_err_msg = $this->session->flashdata('astpp_signupmsg'); |
@@ -76,18 +76,18 @@ discard block |
||
| 76 | 76 | <div class=""> |
| 77 | 77 | <div class="col-md-9"> |
| 78 | 78 | <?php |
| 79 | - if(isset($this->session->userdata['user_logo']) && $this->session->userdata['user_logo'] != ""){ |
|
| 79 | + if (isset($this->session->userdata['user_logo']) && $this->session->userdata['user_logo'] != "") { |
|
| 80 | 80 | $logo = $this->session->userdata['user_logo']; |
| 81 | - }else{ |
|
| 81 | + } else { |
|
| 82 | 82 | $logo = 'logo.png'; |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | if ($this->session->userdata('userlevel_logintype') != '0') {?> |
| 86 | 86 | <a class="col-md-12" style="padding:0px 0px 10px 0px" href="<?php echo base_url(); ?>"> |
| 87 | - <img style="height: 44px; width:216px;" id="logo" alt="dashboard" src="<?php echo base_url(); ?>upload/<?php echo$logo;?>"> |
|
| 87 | + <img style="height: 44px; width:216px;" id="logo" alt="dashboard" src="<?php echo base_url(); ?>upload/<?php echo$logo; ?>"> |
|
| 88 | 88 | <? } else {?> |
| 89 | 89 | <a class="col-md-12" style="padding:0px 0px 20px 0px" href="<?php echo base_url(); ?>"> |
| 90 | - <img style="height: 44px; width:216px;" id="logo" title='ASTPP - Open Source Voip Billing Solution' alt='ASTPP - Open Source Voip Billing Solution' src="<?php echo base_url(); ?>upload/<?php echo$logo;?>"> |
|
| 90 | + <img style="height: 44px; width:216px;" id="logo" title='ASTPP - Open Source Voip Billing Solution' alt='ASTPP - Open Source Voip Billing Solution' src="<?php echo base_url(); ?>upload/<?php echo$logo; ?>"> |
|
| 91 | 91 | <? }?> |
| 92 | 92 | </a> |
| 93 | 93 | </div> |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | ?> |
| 17 | 17 | Signup | <?php echo $invoiceconf['website_title']; ?> |
| 18 | 18 | <?php |
| 19 | - }else{ |
|
| 19 | + } else{ |
|
| 20 | 20 | ?> |
| 21 | 21 | Signup | ASTPP - Open Source Voip Billing Solution |
| 22 | 22 | <?php |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | <div class="col-md-4 col-md-offset-4"> <span class="login_error"> |
| 56 | 56 | <?php if (isset($astpp_notification)){ ?> |
| 57 | 57 | Login unsuccessful. Please make sure you entered the correct username and password, and that your account is active. |
| 58 | - <?php }else{ |
|
| 58 | + <?php } else{ |
|
| 59 | 59 | echo " "; |
| 60 | 60 | } |
| 61 | 61 | $astpp_err_msg = $this->session->flashdata('astpp_signupmsg'); |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | <?php |
| 79 | 79 | if(isset($this->session->userdata['user_logo']) && $this->session->userdata['user_logo'] != ""){ |
| 80 | 80 | $logo = $this->session->userdata['user_logo']; |
| 81 | - }else{ |
|
| 81 | + } else{ |
|
| 82 | 82 | $logo = 'logo.png'; |
| 83 | 83 | } |
| 84 | 84 | |
@@ -6,12 +6,12 @@ |
||
| 6 | 6 | <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| 7 | 7 | <title> |
| 8 | 8 | <?php |
| 9 | - $this->db->where('domain',$_SERVER['HTTP_HOST']);
|
|
| 10 | - $this->db->select('*');
|
|
| 11 | - $this->db->order_by('accountid', 'desc');
|
|
| 12 | - $this->db->limit(1); |
|
| 13 | - $invoiceconf = $this->db->get('invoice_conf');
|
|
| 14 | - $invoiceconf = (array)$invoiceconf->first_row(); |
|
| 9 | + $this->db->where('domain',$_SERVER['HTTP_HOST']);
|
|
| 10 | + $this->db->select('*');
|
|
| 11 | + $this->db->order_by('accountid', 'desc');
|
|
| 12 | + $this->db->limit(1); |
|
| 13 | + $invoiceconf = $this->db->get('invoice_conf');
|
|
| 14 | + $invoiceconf = (array)$invoiceconf->first_row(); |
|
| 15 | 15 | if(isset($invoiceconf['website_title']) && $invoiceconf['website_title']!='') {
|
| 16 | 16 | ?> |
| 17 | 17 | Signup | <?php echo $invoiceconf['website_title']; ?> |
@@ -6,17 +6,17 @@ discard block |
||
| 6 | 6 | <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| 7 | 7 | <title> |
| 8 | 8 | <?php |
| 9 | - $this->db->where('domain',$_SERVER['HTTP_HOST']);
|
|
| 9 | + $this->db->where('domain', $_SERVER['HTTP_HOST']);
|
|
| 10 | 10 | $this->db->select('*');
|
| 11 | 11 | $this->db->order_by('accountid', 'desc');
|
| 12 | 12 | $this->db->limit(1); |
| 13 | 13 | $invoiceconf = $this->db->get('invoice_conf');
|
| 14 | 14 | $invoiceconf = (array)$invoiceconf->first_row(); |
| 15 | - if(isset($invoiceconf['website_title']) && $invoiceconf['website_title']!='') {
|
|
| 15 | + if (isset($invoiceconf['website_title']) && $invoiceconf['website_title'] != '') {
|
|
| 16 | 16 | ?> |
| 17 | 17 | Signup | <?php echo $invoiceconf['website_title']; ?> |
| 18 | 18 | <?php |
| 19 | - }else{
|
|
| 19 | + } else {
|
|
| 20 | 20 | ?> |
| 21 | 21 | Signup | ASTPP - Open Source Voip Billing Solution |
| 22 | 22 | <?php |
@@ -113,9 +113,9 @@ discard block |
||
| 113 | 113 | <div class="row"> |
| 114 | 114 | <div class="col-md-4 col-md-offset-4"> |
| 115 | 115 | <span class="login_error"> |
| 116 | - <?php if (isset($astpp_notification)){ ?>
|
|
| 116 | + <?php if (isset($astpp_notification)) { ?>
|
|
| 117 | 117 | Login unsuccessful. Please make sure you entered the correct username and password, and that your account is active. |
| 118 | - <?php }else{
|
|
| 118 | + <?php } else {
|
|
| 119 | 119 | echo " "; |
| 120 | 120 | } ?> |
| 121 | 121 | </span> |
@@ -132,18 +132,18 @@ discard block |
||
| 132 | 132 | <!-- Header Start--> |
| 133 | 133 | <div class="col-md-12"> |
| 134 | 134 | <?php |
| 135 | - if(isset($this->session->userdata['user_logo']) && $this->session->userdata['user_logo'] != ""){
|
|
| 135 | + if (isset($this->session->userdata['user_logo']) && $this->session->userdata['user_logo'] != "") {
|
|
| 136 | 136 | $logo = $this->session->userdata['user_logo']; |
| 137 | - }else{
|
|
| 137 | + } else {
|
|
| 138 | 138 | $logo = 'logo.png'; |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | if ($this->session->userdata('userlevel_logintype') != '0') {?>
|
| 142 | 142 | <a class="col-md-10" style="padding:0px 0px 10px 0px" href="<?php echo base_url(); ?>"> |
| 143 | - <img style="height: 44px; width:216px;" id="logo" alt="dashboard" src="<?php echo base_url(); ?>upload/<?php echo$logo;?>"> |
|
| 143 | + <img style="height: 44px; width:216px;" id="logo" alt="dashboard" src="<?php echo base_url(); ?>upload/<?php echo$logo; ?>"> |
|
| 144 | 144 | <? } else {?>
|
| 145 | 145 | <a class="col-md-10" style="padding:0px 0px 20px 0px" href="<?php echo base_url(); ?>"> |
| 146 | - <img style="height: 44px; width:216px;" id="logo" title='ASTPP - Open Source Voip Billing Solution' alt='ASTPP - Open Source Voip Billing Solution' src="<?php echo base_url(); ?>upload/<?php echo$logo;?>"> |
|
| 146 | + <img style="height: 44px; width:216px;" id="logo" title='ASTPP - Open Source Voip Billing Solution' alt='ASTPP - Open Source Voip Billing Solution' src="<?php echo base_url(); ?>upload/<?php echo$logo; ?>"> |
|
| 147 | 147 | <? }?> |
| 148 | 148 | </a> |
| 149 | 149 | <div class="col-md-2"> |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | ?> |
| 17 | 17 | Signup | <?php echo $invoiceconf['website_title']; ?> |
| 18 | 18 | <?php |
| 19 | - }else{
|
|
| 19 | + } else{
|
|
| 20 | 20 | ?> |
| 21 | 21 | Signup | ASTPP - Open Source Voip Billing Solution |
| 22 | 22 | <?php |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | <span class="login_error"> |
| 116 | 116 | <?php if (isset($astpp_notification)){ ?>
|
| 117 | 117 | Login unsuccessful. Please make sure you entered the correct username and password, and that your account is active. |
| 118 | - <?php }else{
|
|
| 118 | + <?php } else{
|
|
| 119 | 119 | echo " "; |
| 120 | 120 | } ?> |
| 121 | 121 | </span> |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | <?php |
| 135 | 135 | if(isset($this->session->userdata['user_logo']) && $this->session->userdata['user_logo'] != ""){
|
| 136 | 136 | $logo = $this->session->userdata['user_logo']; |
| 137 | - }else{
|
|
| 137 | + } else{
|
|
| 138 | 138 | $logo = 'logo.png'; |
| 139 | 139 | } |
| 140 | 140 | |
@@ -6,12 +6,12 @@ |
||
| 6 | 6 | <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| 7 | 7 | <title> |
| 8 | 8 | <?php |
| 9 | - $this->db->where('domain',$_SERVER['HTTP_HOST']);
|
|
| 10 | - $this->db->select('*');
|
|
| 11 | - $this->db->order_by('accountid', 'desc');
|
|
| 12 | - $this->db->limit(1); |
|
| 13 | - $invoiceconf = $this->db->get('invoice_conf');
|
|
| 14 | - $invoiceconf = (array)$invoiceconf->first_row(); |
|
| 9 | + $this->db->where('domain',$_SERVER['HTTP_HOST']);
|
|
| 10 | + $this->db->select('*');
|
|
| 11 | + $this->db->order_by('accountid', 'desc');
|
|
| 12 | + $this->db->limit(1); |
|
| 13 | + $invoiceconf = $this->db->get('invoice_conf');
|
|
| 14 | + $invoiceconf = (array)$invoiceconf->first_row(); |
|
| 15 | 15 | if(isset($invoiceconf['website_title']) && $invoiceconf['website_title']!='') {
|
| 16 | 16 | ?> |
| 17 | 17 | Signup | <?php echo $invoiceconf['website_title']; ?> |
@@ -6,17 +6,17 @@ discard block |
||
| 6 | 6 | <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| 7 | 7 | <title> |
| 8 | 8 | <?php |
| 9 | - $this->db->where('domain',$_SERVER['HTTP_HOST']);
|
|
| 9 | + $this->db->where('domain', $_SERVER['HTTP_HOST']);
|
|
| 10 | 10 | $this->db->select('*');
|
| 11 | 11 | $this->db->order_by('accountid', 'desc');
|
| 12 | 12 | $this->db->limit(1); |
| 13 | 13 | $invoiceconf = $this->db->get('invoice_conf');
|
| 14 | 14 | $invoiceconf = (array)$invoiceconf->first_row(); |
| 15 | - if(isset($invoiceconf['website_title']) && $invoiceconf['website_title']!='') {
|
|
| 15 | + if (isset($invoiceconf['website_title']) && $invoiceconf['website_title'] != '') {
|
|
| 16 | 16 | ?> |
| 17 | 17 | Signup | <?php echo $invoiceconf['website_title']; ?> |
| 18 | 18 | <?php |
| 19 | - }else{
|
|
| 19 | + } else {
|
|
| 20 | 20 | ?> |
| 21 | 21 | Signup | ASTPP - Open Source Voip Billing Solution |
| 22 | 22 | <?php |
@@ -53,9 +53,9 @@ discard block |
||
| 53 | 53 | <div class="row"> |
| 54 | 54 | |
| 55 | 55 | <div class="col-md-4 col-md-offset-4"> <span class="login_error"> |
| 56 | - <?php if (isset($astpp_notification)){ ?>
|
|
| 56 | + <?php if (isset($astpp_notification)) { ?>
|
|
| 57 | 57 | Login unsuccessful. Please make sure you entered the correct username and password, and that your account is active. |
| 58 | - <?php }else{
|
|
| 58 | + <?php } else {
|
|
| 59 | 59 | echo " "; |
| 60 | 60 | } |
| 61 | 61 | $astpp_err_msg = $this->session->flashdata('astpp_signupmsg');
|
@@ -75,18 +75,18 @@ discard block |
||
| 75 | 75 | |
| 76 | 76 | |
| 77 | 77 | <?php |
| 78 | - if(isset($this->session->userdata['user_logo']) && $this->session->userdata['user_logo'] != ""){
|
|
| 78 | + if (isset($this->session->userdata['user_logo']) && $this->session->userdata['user_logo'] != "") {
|
|
| 79 | 79 | $logo = $this->session->userdata['user_logo']; |
| 80 | - }else{
|
|
| 80 | + } else {
|
|
| 81 | 81 | $logo = 'logo.png'; |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | if ($this->session->userdata('userlevel_logintype') != '0') {?>
|
| 85 | 85 | <a class="col-md-12" style="padding:0px 0px 10px 0px" href="<?php echo base_url(); ?>"> |
| 86 | - <img style="height: 44px; width:216px;" id="logo" alt="dashboard" src="<?php echo base_url(); ?>upload/<?php echo$logo;?>"> |
|
| 86 | + <img style="height: 44px; width:216px;" id="logo" alt="dashboard" src="<?php echo base_url(); ?>upload/<?php echo$logo; ?>"> |
|
| 87 | 87 | <? } else {?>
|
| 88 | 88 | <a class="col-md-12" style="padding:0px 0px 20px 0px" href="<?php echo base_url(); ?>"> |
| 89 | - <img style="height: 44px; width:216px;" id="logo" title='ASTPP - Open Source Voip Billing Solution' alt='ASTPP - Open Source Voip Billing Solution' src="<?php echo base_url(); ?>upload/<?php echo$logo;?>"> |
|
| 89 | + <img style="height: 44px; width:216px;" id="logo" title='ASTPP - Open Source Voip Billing Solution' alt='ASTPP - Open Source Voip Billing Solution' src="<?php echo base_url(); ?>upload/<?php echo$logo; ?>"> |
|
| 90 | 90 | <? }?> |
| 91 | 91 | </a> |
| 92 | 92 | <div class="col-md-12 no-padding"></div> |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | ?> |
| 17 | 17 | Signup | <?php echo $invoiceconf['website_title']; ?> |
| 18 | 18 | <?php |
| 19 | - }else{
|
|
| 19 | + } else{
|
|
| 20 | 20 | ?> |
| 21 | 21 | Signup | ASTPP - Open Source Voip Billing Solution |
| 22 | 22 | <?php |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | <div class="col-md-4 col-md-offset-4"> <span class="login_error"> |
| 56 | 56 | <?php if (isset($astpp_notification)){ ?>
|
| 57 | 57 | Login unsuccessful. Please make sure you entered the correct username and password, and that your account is active. |
| 58 | - <?php }else{
|
|
| 58 | + <?php } else{
|
|
| 59 | 59 | echo " "; |
| 60 | 60 | } |
| 61 | 61 | $astpp_err_msg = $this->session->flashdata('astpp_signupmsg');
|
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | <?php |
| 78 | 78 | if(isset($this->session->userdata['user_logo']) && $this->session->userdata['user_logo'] != ""){
|
| 79 | 79 | $logo = $this->session->userdata['user_logo']; |
| 80 | - }else{
|
|
| 80 | + } else{
|
|
| 81 | 81 | $logo = 'logo.png'; |
| 82 | 82 | } |
| 83 | 83 | |
@@ -6,12 +6,12 @@ |
||
| 6 | 6 | <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| 7 | 7 | <title> |
| 8 | 8 | <?php |
| 9 | - $this->db->where('domain',$_SERVER['HTTP_HOST']); |
|
| 10 | - $this->db->select('*'); |
|
| 11 | - $this->db->order_by('accountid', 'desc'); |
|
| 12 | - $this->db->limit(1); |
|
| 13 | - $invoiceconf = $this->db->get('invoice_conf'); |
|
| 14 | - $invoiceconf = (array)$invoiceconf->first_row(); |
|
| 9 | + $this->db->where('domain',$_SERVER['HTTP_HOST']); |
|
| 10 | + $this->db->select('*'); |
|
| 11 | + $this->db->order_by('accountid', 'desc'); |
|
| 12 | + $this->db->limit(1); |
|
| 13 | + $invoiceconf = $this->db->get('invoice_conf'); |
|
| 14 | + $invoiceconf = (array)$invoiceconf->first_row(); |
|
| 15 | 15 | if(isset($invoiceconf['website_title']) && $invoiceconf['website_title']!='') { |
| 16 | 16 | ?> |
| 17 | 17 | Forgot Password | <?php echo $invoiceconf['website_title']; ?> |
@@ -6,17 +6,17 @@ discard block |
||
| 6 | 6 | <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| 7 | 7 | <title> |
| 8 | 8 | <?php |
| 9 | - $this->db->where('domain',$_SERVER['HTTP_HOST']); |
|
| 9 | + $this->db->where('domain', $_SERVER['HTTP_HOST']); |
|
| 10 | 10 | $this->db->select('*'); |
| 11 | 11 | $this->db->order_by('accountid', 'desc'); |
| 12 | 12 | $this->db->limit(1); |
| 13 | 13 | $invoiceconf = $this->db->get('invoice_conf'); |
| 14 | 14 | $invoiceconf = (array)$invoiceconf->first_row(); |
| 15 | - if(isset($invoiceconf['website_title']) && $invoiceconf['website_title']!='') { |
|
| 15 | + if (isset($invoiceconf['website_title']) && $invoiceconf['website_title'] != '') { |
|
| 16 | 16 | ?> |
| 17 | 17 | Forgot Password | <?php echo $invoiceconf['website_title']; ?> |
| 18 | 18 | <?php |
| 19 | - }else{ |
|
| 19 | + } else { |
|
| 20 | 20 | ?> |
| 21 | 21 | Forgot Password | ASTPP - Open Source Voip Billing Solution |
| 22 | 22 | <?php |
@@ -55,9 +55,9 @@ discard block |
||
| 55 | 55 | <div class="row"> |
| 56 | 56 | |
| 57 | 57 | <div class="col-md-4 col-md-offset-4"> <span class="login_error"> |
| 58 | - <?php if (isset($astpp_notification)){ ?> |
|
| 58 | + <?php if (isset($astpp_notification)) { ?> |
|
| 59 | 59 | Login unsuccessful. Please make sure you entered the correct username and password, and that your account is active. |
| 60 | - <?php }else{ |
|
| 60 | + <?php } else { |
|
| 61 | 61 | echo " "; |
| 62 | 62 | } |
| 63 | 63 | $astpp_err_msg = $this->session->flashdata('astpp_signupmsg'); |
@@ -74,18 +74,18 @@ discard block |
||
| 74 | 74 | <h2 class="text-center"> |
| 75 | 75 | |
| 76 | 76 | <?php |
| 77 | - if(isset($this->session->userdata['user_logo']) && $this->session->userdata['user_logo'] != ""){ |
|
| 77 | + if (isset($this->session->userdata['user_logo']) && $this->session->userdata['user_logo'] != "") { |
|
| 78 | 78 | $logo = $this->session->userdata['user_logo']; |
| 79 | - }else{ |
|
| 79 | + } else { |
|
| 80 | 80 | $logo = 'logo.png'; |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | if ($this->session->userdata('userlevel_logintype') != '0') {?> |
| 84 | 84 | <a class="col-md-12" style="padding:0px 0px 10px 0px" href="<?php echo base_url(); ?>"> |
| 85 | - <img style="height: 44px; width:216px;" id="logo" alt="dashboard" src="<?php echo base_url(); ?>upload/<?php echo$logo;?>"> |
|
| 85 | + <img style="height: 44px; width:216px;" id="logo" alt="dashboard" src="<?php echo base_url(); ?>upload/<?php echo$logo; ?>"> |
|
| 86 | 86 | <? } else {?> |
| 87 | 87 | <a class="col-md-12" style="padding:0px 0px 20px 0px" href="<?php echo base_url(); ?>"> |
| 88 | - <img style="height: 44px; width:216px;" id="logo" title='ASTPP - Open Source Voip Billing Solution' alt='ASTPP - Open Source Voip Billing Solution' src="<?php echo base_url(); ?>upload/<?php echo$logo;?>"> |
|
| 88 | + <img style="height: 44px; width:216px;" id="logo" title='ASTPP - Open Source Voip Billing Solution' alt='ASTPP - Open Source Voip Billing Solution' src="<?php echo base_url(); ?>upload/<?php echo$logo; ?>"> |
|
| 89 | 89 | <? }?> |
| 90 | 90 | </a> |
| 91 | 91 | <div class="col-md-12 no-padding"></div> |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | ?> |
| 17 | 17 | Forgot Password | <?php echo $invoiceconf['website_title']; ?> |
| 18 | 18 | <?php |
| 19 | - }else{ |
|
| 19 | + } else{ |
|
| 20 | 20 | ?> |
| 21 | 21 | Forgot Password | ASTPP - Open Source Voip Billing Solution |
| 22 | 22 | <?php |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | <div class="col-md-4 col-md-offset-4"> <span class="login_error"> |
| 58 | 58 | <?php if (isset($astpp_notification)){ ?> |
| 59 | 59 | Login unsuccessful. Please make sure you entered the correct username and password, and that your account is active. |
| 60 | - <?php }else{ |
|
| 60 | + <?php } else{ |
|
| 61 | 61 | echo " "; |
| 62 | 62 | } |
| 63 | 63 | $astpp_err_msg = $this->session->flashdata('astpp_signupmsg'); |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | <?php |
| 77 | 77 | if(isset($this->session->userdata['user_logo']) && $this->session->userdata['user_logo'] != ""){ |
| 78 | 78 | $logo = $this->session->userdata['user_logo']; |
| 79 | - }else{ |
|
| 79 | + } else{ |
|
| 80 | 80 | $logo = 'logo.png'; |
| 81 | 81 | } |
| 82 | 82 | |
@@ -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); |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | ini_set("max_execution_time", "259200"); |
| 37 | 37 | ini_set("upload_max_filesize", "200M"); |
| 38 | 38 | if ($this->session->userdata('user_login') == FALSE) |
| 39 | - redirect(base_url() . '/astpp/login'); |
|
| 39 | + redirect(base_url().'/astpp/login'); |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | function termination_rates_list() { |
@@ -73,70 +73,70 @@ discard block |
||
| 73 | 73 | |
| 74 | 74 | echo json_encode($json_data); |
| 75 | 75 | } |
| 76 | - function termination_rates_list_delete($flag='') { |
|
| 76 | + function termination_rates_list_delete($flag = '') { |
|
| 77 | 77 | $json_data = array(); |
| 78 | - $this->session->set_userdata('advance_batch_data_delete',1); |
|
| 78 | + $this->session->set_userdata('advance_batch_data_delete', 1); |
|
| 79 | 79 | $count_all = $this->rates_model->get_termination_rates_list(false); |
| 80 | 80 | echo $count_all; |
| 81 | 81 | } |
| 82 | 82 | /****************/ |
| 83 | 83 | function termination_rate_import() { |
| 84 | 84 | $data['page_title'] = 'Import Termination Rates'; |
| 85 | - $this->session->set_userdata('import_termination_rate_csv',""); |
|
| 86 | - $this->session->set_userdata('import_termination_rate_csv_error',""); |
|
| 85 | + $this->session->set_userdata('import_termination_rate_csv', ""); |
|
| 86 | + $this->session->set_userdata('import_termination_rate_csv_error', ""); |
|
| 87 | 87 | $this->load->view('view_import_termination_rate', $data); |
| 88 | 88 | } |
| 89 | - function termination_rate_preview_file(){ |
|
| 90 | - $invalid_flag= false; |
|
| 91 | - $check_header=$this->input->post('check_header',true); |
|
| 89 | + function termination_rate_preview_file() { |
|
| 90 | + $invalid_flag = false; |
|
| 91 | + $check_header = $this->input->post('check_header', true); |
|
| 92 | 92 | $data['page_title'] = 'Import Termination Rates'; |
| 93 | 93 | $new_final_arr_key = $this->config->item('Termination-rates-field'); |
| 94 | - if(empty($_FILES) || !isset($_FILES)){ |
|
| 94 | + if (empty($_FILES) || ! isset($_FILES)) { |
|
| 95 | 95 | redirect(base_url()."rates/termination_rates_list/"); |
| 96 | 96 | } |
| 97 | - if (isset($_FILES['termination_rate_import']['name']) && $_FILES['termination_rate_import']['name'] != "" && isset($_POST['trunk_id']) && $_POST['trunk_id'] != '') { |
|
| 97 | + if (isset($_FILES['termination_rate_import']['name']) && $_FILES['termination_rate_import']['name'] != "" && isset($_POST['trunk_id']) && $_POST['trunk_id'] != '') { |
|
| 98 | 98 | list($txt, $ext) = explode(".", $_FILES['termination_rate_import']['name']); |
| 99 | - if($ext == "csv" && $_FILES['termination_rate_import']['size'] > 0){ |
|
| 99 | + if ($ext == "csv" && $_FILES['termination_rate_import']['size'] > 0) { |
|
| 100 | 100 | $error = $_FILES['termination_rate_import']['error']; |
| 101 | - if ($error == 0 ) { |
|
| 101 | + if ($error == 0) { |
|
| 102 | 102 | $uploadedFile = $_FILES["termination_rate_import"]["tmp_name"]; |
| 103 | - $csv_data=$this->csvreader->parse_file($uploadedFile,$new_final_arr_key,$check_header); |
|
| 104 | - if(!empty($csv_data)){ |
|
| 103 | + $csv_data = $this->csvreader->parse_file($uploadedFile, $new_final_arr_key, $check_header); |
|
| 104 | + if ( ! empty($csv_data)) { |
|
| 105 | 105 | $full_path = $this->config->item('rates-file-path'); |
| 106 | - $actual_file_name = "ASTPP-TERMINATION-RATES-".date("Y-m-d H:i:s"). "." . $ext; |
|
| 107 | - if (move_uploaded_file($uploadedFile,$full_path.$actual_file_name)) { |
|
| 106 | + $actual_file_name = "ASTPP-TERMINATION-RATES-".date("Y-m-d H:i:s").".".$ext; |
|
| 107 | + if (move_uploaded_file($uploadedFile, $full_path.$actual_file_name)) { |
|
| 108 | 108 | $data['csv_tmp_data'] = $csv_data; |
| 109 | 109 | $data['trunkid'] = $_POST['trunk_id']; |
| 110 | - $data['check_header']=$check_header; |
|
| 110 | + $data['check_header'] = $check_header; |
|
| 111 | 111 | $data['page_title'] = 'Termination Rates Preview'; |
| 112 | - $this->session->set_userdata('import_termination_rate_csv',$actual_file_name); |
|
| 113 | - }else{ |
|
| 112 | + $this->session->set_userdata('import_termination_rate_csv', $actual_file_name); |
|
| 113 | + } else { |
|
| 114 | 114 | $data['error'] = "File Uploading Fail Please Try Again"; |
| 115 | 115 | } |
| 116 | 116 | } |
| 117 | 117 | } |
| 118 | - else{ |
|
| 119 | - $data['error']=="File Uploading Fail Please Try Again"; |
|
| 118 | + else { |
|
| 119 | + $data['error'] == "File Uploading Fail Please Try Again"; |
|
| 120 | 120 | } |
| 121 | - }else { |
|
| 121 | + } else { |
|
| 122 | 122 | $data['error'] = "Invalid file format : Only CSV file allows to import records(Can't import empty file)"; |
| 123 | 123 | } |
| 124 | - }else{ |
|
| 125 | - $invalid_flag=true; |
|
| 124 | + } else { |
|
| 125 | + $invalid_flag = true; |
|
| 126 | 126 | } |
| 127 | 127 | if ($invalid_flag) { |
| 128 | 128 | $str = ''; |
| 129 | - if (!isset($_POST['trunk_id']) || empty($_POST['trunk_id'])) { |
|
| 130 | - $str.= '<br/>Please Create Trunk.'; |
|
| 129 | + if ( ! isset($_POST['trunk_id']) || empty($_POST['trunk_id'])) { |
|
| 130 | + $str .= '<br/>Please Create Trunk.'; |
|
| 131 | 131 | } |
| 132 | 132 | if (empty($_FILES['termination_rate_import']['name'])) { |
| 133 | - $str.= '<br/>Please Select File.'; |
|
| 133 | + $str .= '<br/>Please Select File.'; |
|
| 134 | 134 | } |
| 135 | - $data['error']=$str; |
|
| 135 | + $data['error'] = $str; |
|
| 136 | 136 | } |
| 137 | 137 | $this->load->view('view_import_termination_rate', $data); |
| 138 | 138 | } |
| 139 | - function termination_rate_rates_import($trunkID,$check_header=false) { |
|
| 139 | + function termination_rate_rates_import($trunkID, $check_header = false) { |
|
| 140 | 140 | $new_final_arr = array(); |
| 141 | 141 | $invalid_array = array(); |
| 142 | 142 | $new_final_arr_key = $this->config->item('Termination-rates-field'); |
@@ -146,65 +146,65 @@ discard block |
||
| 146 | 146 | } |
| 147 | 147 | $full_path = $this->config->item('rates-file-path'); |
| 148 | 148 | $terminationrate_file_name = $this->session->userdata('import_termination_rate_csv'); |
| 149 | - $csv_tmp_data = $this->csvreader->parse_file($full_path.$terminationrate_file_name,$new_final_arr_key,$check_header); |
|
| 150 | - $i=0; |
|
| 149 | + $csv_tmp_data = $this->csvreader->parse_file($full_path.$terminationrate_file_name, $new_final_arr_key, $check_header); |
|
| 150 | + $i = 0; |
|
| 151 | 151 | foreach ($csv_tmp_data as $key => $csv_data) { |
| 152 | - if(isset($csv_data['pattern']) && $csv_data['pattern']!= '' && $i != 0){ |
|
| 153 | - $str=null; |
|
| 154 | - $csv_data['prepend']= isset($csv_data['prepend'])? $csv_data['prepend'] :''; |
|
| 155 | - $csv_data['comment']= isset($csv_data['comment'])? $csv_data['comment'] :''; |
|
| 156 | - $csv_data['connectcost']= isset($csv_data['connectcost']) ? $csv_data['connectcost'] :0; |
|
| 157 | - $csv_data['includedseconds']= isset($csv_data['includedseconds']) ? $csv_data['includedseconds'] :0; |
|
| 158 | - $csv_data['cost']= !empty($csv_data['cost']) && is_numeric( $csv_data['cost']) ? $csv_data['cost'] :0; |
|
| 159 | - $csv_data['inc']= isset($csv_data['inc']) ? $csv_data['inc'] :0; |
|
| 160 | - $csv_data['precedence']= isset($csv_data['precedence']) ? $csv_data['precedence'] :''; |
|
| 161 | - $csv_data['strip']= isset($csv_data['strip']) ? $csv_data['strip'] :''; |
|
| 152 | + if (isset($csv_data['pattern']) && $csv_data['pattern'] != '' && $i != 0) { |
|
| 153 | + $str = null; |
|
| 154 | + $csv_data['prepend'] = isset($csv_data['prepend']) ? $csv_data['prepend'] : ''; |
|
| 155 | + $csv_data['comment'] = isset($csv_data['comment']) ? $csv_data['comment'] : ''; |
|
| 156 | + $csv_data['connectcost'] = isset($csv_data['connectcost']) ? $csv_data['connectcost'] : 0; |
|
| 157 | + $csv_data['includedseconds'] = isset($csv_data['includedseconds']) ? $csv_data['includedseconds'] : 0; |
|
| 158 | + $csv_data['cost'] = ! empty($csv_data['cost']) && is_numeric($csv_data['cost']) ? $csv_data['cost'] : 0; |
|
| 159 | + $csv_data['inc'] = isset($csv_data['inc']) ? $csv_data['inc'] : 0; |
|
| 160 | + $csv_data['precedence'] = isset($csv_data['precedence']) ? $csv_data['precedence'] : ''; |
|
| 161 | + $csv_data['strip'] = isset($csv_data['strip']) ? $csv_data['strip'] : ''; |
|
| 162 | 162 | $csv_data['last_modified_date'] = date("Y-m-d H:i:s"); |
| 163 | - $str=$this->data_validate($csv_data); |
|
| 164 | - if($str != ""){ |
|
| 165 | - $invalid_array[$i]=$csv_data; |
|
| 163 | + $str = $this->data_validate($csv_data); |
|
| 164 | + if ($str != "") { |
|
| 165 | + $invalid_array[$i] = $csv_data; |
|
| 166 | 166 | $invalid_array[$i]['error'] = $str; |
| 167 | 167 | } |
| 168 | - else{ |
|
| 169 | - $csv_data['trunk_id']=$trunkID; |
|
| 170 | - $csv_data['pattern'] = "^" . $csv_data['pattern'] . ".*"; |
|
| 171 | - $new_final_arr[$i]=$csv_data; |
|
| 168 | + else { |
|
| 169 | + $csv_data['trunk_id'] = $trunkID; |
|
| 170 | + $csv_data['pattern'] = "^".$csv_data['pattern'].".*"; |
|
| 171 | + $new_final_arr[$i] = $csv_data; |
|
| 172 | 172 | } |
| 173 | 173 | } |
| 174 | 174 | $i++; |
| 175 | 175 | } |
| 176 | - if(!empty($new_final_arr)){ |
|
| 176 | + if ( ! empty($new_final_arr)) { |
|
| 177 | 177 | $result = $this->rates_model->bulk_insert_termination_rate($new_final_arr); |
| 178 | 178 | } |
| 179 | 179 | unlink($full_path.$terminationrate_file_name); |
| 180 | - $count=count($invalid_array); |
|
| 181 | - if($count >0){ |
|
| 180 | + $count = count($invalid_array); |
|
| 181 | + if ($count > 0) { |
|
| 182 | 182 | $session_id = "-1"; |
| 183 | 183 | $fp = fopen($full_path.$session_id.'.csv', 'w'); |
| 184 | - foreach($new_final_arr_key as $key=>$value){ |
|
| 185 | - $custom_array[0][$key]=ucfirst($key); |
|
| 184 | + foreach ($new_final_arr_key as $key=>$value) { |
|
| 185 | + $custom_array[0][$key] = ucfirst($key); |
|
| 186 | 186 | } |
| 187 | - $custom_array[0]['error']= "Error"; |
|
| 188 | - $invalid_array =array_merge($custom_array,$invalid_array); |
|
| 189 | - foreach($invalid_array as $err_data){ |
|
| 190 | - fputcsv($fp,$err_data); |
|
| 187 | + $custom_array[0]['error'] = "Error"; |
|
| 188 | + $invalid_array = array_merge($custom_array, $invalid_array); |
|
| 189 | + foreach ($invalid_array as $err_data) { |
|
| 190 | + fputcsv($fp, $err_data); |
|
| 191 | 191 | } |
| 192 | 192 | fclose($fp); |
| 193 | 193 | $this->session->set_userdata('import_termination_rate_csv_error', $session_id.".csv"); |
| 194 | 194 | $data["error"] = $invalid_array; |
| 195 | 195 | $data['trunkid'] = $trunkID; |
| 196 | 196 | $data['impoted_count'] = count($new_final_arr); |
| 197 | - $data['failure_count'] = count($invalid_array)-1; |
|
| 197 | + $data['failure_count'] = count($invalid_array) - 1; |
|
| 198 | 198 | $data['page_title'] = 'Termination Rates Import Error'; |
| 199 | - $this->load->view('view_import_error',$data); |
|
| 200 | - } else{ |
|
| 199 | + $this->load->view('view_import_error', $data); |
|
| 200 | + } else { |
|
| 201 | 201 | $this->session->set_flashdata('astpp_errormsg', 'Total '.count($new_final_arr).' Termination rates imported successfully!'); |
| 202 | 202 | redirect(base_url()."rates/termination_rates_list/"); |
| 203 | 203 | } |
| 204 | 204 | } |
| 205 | - function termination_rate_error_download(){ |
|
| 205 | + function termination_rate_error_download() { |
|
| 206 | 206 | $this->load->helper('download'); |
| 207 | - $error_data = $this->session->userdata('import_termination_rate_csv_error'); |
|
| 207 | + $error_data = $this->session->userdata('import_termination_rate_csv_error'); |
|
| 208 | 208 | $full_path = $this->config->item('rates-file-path'); |
| 209 | 209 | $data = file_get_contents($full_path.$error_data); |
| 210 | 210 | force_download("Termination_rate_error.csv", $data); |
@@ -212,182 +212,182 @@ discard block |
||
| 212 | 212 | } |
| 213 | 213 | function origination_rate_import() { |
| 214 | 214 | $data['page_title'] = 'Import Origination Rates'; |
| 215 | - $this->session->set_userdata('import_origination_rate_csv',""); |
|
| 216 | - $error_data = $this->session->userdata('import_origination_rate_csv_error'); |
|
| 215 | + $this->session->set_userdata('import_origination_rate_csv', ""); |
|
| 216 | + $error_data = $this->session->userdata('import_origination_rate_csv_error'); |
|
| 217 | 217 | $full_path = $this->config->item('rates-file-path'); |
| 218 | - if(file_exists($full_path.$error_data) && $error_data != ""){ |
|
| 218 | + if (file_exists($full_path.$error_data) && $error_data != "") { |
|
| 219 | 219 | unlink($full_path.$error_data); |
| 220 | - $this->session->set_userdata('import_origination_rate_csv_error',""); |
|
| 220 | + $this->session->set_userdata('import_origination_rate_csv_error', ""); |
|
| 221 | 221 | } |
| 222 | 222 | $this->load->view('view_import_origination_rate', $data); |
| 223 | 223 | } |
| 224 | - function origination_rate_preview_file(){ |
|
| 225 | - $invalid_flag= false; |
|
| 226 | - $data=array(); |
|
| 224 | + function origination_rate_preview_file() { |
|
| 225 | + $invalid_flag = false; |
|
| 226 | + $data = array(); |
|
| 227 | 227 | $data['page_title'] = 'Import Origination Rates'; |
| 228 | - $check_header=$this->input->post('check_header',true); |
|
| 229 | - if(empty($_FILES) || !isset($_FILES)){ |
|
| 228 | + $check_header = $this->input->post('check_header', true); |
|
| 229 | + if (empty($_FILES) || ! isset($_FILES)) { |
|
| 230 | 230 | redirect(base_url()."rates/origination_rate_list/"); |
| 231 | 231 | } |
| 232 | - $get_extension=strpos($_FILES['origination_rate_import']['name'],'.'); |
|
| 232 | + $get_extension = strpos($_FILES['origination_rate_import']['name'], '.'); |
|
| 233 | 233 | $new_final_arr_key = $this->config->item('Origination-rates-field'); |
| 234 | - if(!$get_extension){ |
|
| 235 | - $data['error']= "Please Upload File Atleast"; |
|
| 234 | + if ( ! $get_extension) { |
|
| 235 | + $data['error'] = "Please Upload File Atleast"; |
|
| 236 | 236 | } |
| 237 | 237 | if (isset($_FILES['origination_rate_import']['name']) && $_FILES['origination_rate_import']['name'] != "" && isset($_POST['pricelist_id']) && $_POST['pricelist_id'] != '') { |
| 238 | - list($txt,$ext) = explode(".", $_FILES['origination_rate_import']['name']); |
|
| 238 | + list($txt, $ext) = explode(".", $_FILES['origination_rate_import']['name']); |
|
| 239 | 239 | |
| 240 | - if($ext == "csv" && $_FILES['origination_rate_import']['size'] > 0){ |
|
| 240 | + if ($ext == "csv" && $_FILES['origination_rate_import']['size'] > 0) { |
|
| 241 | 241 | $error = $_FILES['origination_rate_import']['error']; |
| 242 | 242 | if ($error == 0) { |
| 243 | 243 | $uploadedFile = $_FILES["origination_rate_import"]["tmp_name"]; |
| 244 | - $csv_data=$this->csvreader->parse_file($uploadedFile,$new_final_arr_key,$check_header); |
|
| 245 | - if(!empty($csv_data)){ |
|
| 244 | + $csv_data = $this->csvreader->parse_file($uploadedFile, $new_final_arr_key, $check_header); |
|
| 245 | + if ( ! empty($csv_data)) { |
|
| 246 | 246 | $full_path = $this->config->item('rates-file-path'); |
| 247 | - $actual_file_name = "ASTPP-ORIGIN-RATES-".date("Y-m-d H:i:s"). "." . $ext; |
|
| 248 | - if (move_uploaded_file($uploadedFile,$full_path.$actual_file_name)) { |
|
| 249 | - $flag=false; |
|
| 250 | - $data['trunkid']=isset($_POST['trunk_id']) && $_POST['trunk_id'] > 0 ? $_POST['trunk_id'] : 0; |
|
| 247 | + $actual_file_name = "ASTPP-ORIGIN-RATES-".date("Y-m-d H:i:s").".".$ext; |
|
| 248 | + if (move_uploaded_file($uploadedFile, $full_path.$actual_file_name)) { |
|
| 249 | + $flag = false; |
|
| 250 | + $data['trunkid'] = isset($_POST['trunk_id']) && $_POST['trunk_id'] > 0 ? $_POST['trunk_id'] : 0; |
|
| 251 | 251 | $data['csv_tmp_data'] = $csv_data; |
| 252 | 252 | $data['pricelistid'] = $_POST['pricelist_id']; |
| 253 | 253 | $data['page_title'] = "Origination Rates Preview"; |
| 254 | - $data['check_header']=$check_header; |
|
| 255 | - $this->session->set_userdata('import_origination_rate_csv',$actual_file_name); |
|
| 256 | - }else{ |
|
| 254 | + $data['check_header'] = $check_header; |
|
| 255 | + $this->session->set_userdata('import_origination_rate_csv', $actual_file_name); |
|
| 256 | + } else { |
|
| 257 | 257 | $data['error'] = "File Uploading Fail Please Try Again"; |
| 258 | 258 | } |
| 259 | 259 | } |
| 260 | 260 | } |
| 261 | - else{ |
|
| 262 | - $data['error']=="File Uploading Fail Please Try Again"; |
|
| 261 | + else { |
|
| 262 | + $data['error'] == "File Uploading Fail Please Try Again"; |
|
| 263 | 263 | } |
| 264 | 264 | } |
| 265 | 265 | else { |
| 266 | 266 | $data['error'] = "Invalid file format : Only CSV file allows to import records(Can't import empty file)"; |
| 267 | 267 | } |
| 268 | - }else{ |
|
| 269 | - $invalid_flag=true; |
|
| 268 | + } else { |
|
| 269 | + $invalid_flag = true; |
|
| 270 | 270 | } |
| 271 | 271 | if ($invalid_flag) { |
| 272 | 272 | $str = ''; |
| 273 | - if (!isset($_POST['pricelist_id']) || empty($_POST['pricelist_id'])) { |
|
| 274 | - $str.= '<br/>Please Create Rate Group.'; |
|
| 273 | + if ( ! isset($_POST['pricelist_id']) || empty($_POST['pricelist_id'])) { |
|
| 274 | + $str .= '<br/>Please Create Rate Group.'; |
|
| 275 | 275 | } |
| 276 | 276 | if (empty($_FILES['origination_rate_import']['name'])) { |
| 277 | - $str.= '<br/>Please Select File.'; |
|
| 277 | + $str .= '<br/>Please Select File.'; |
|
| 278 | 278 | } |
| 279 | - $data['error']=$str; |
|
| 279 | + $data['error'] = $str; |
|
| 280 | 280 | } |
| 281 | 281 | $this->load->view('view_import_origination_rate', $data); |
| 282 | 282 | } |
| 283 | - function origination_rate_import_file($pricelistID,$trunkid,$check_header=false) { |
|
| 283 | + function origination_rate_import_file($pricelistID, $trunkid, $check_header = false) { |
|
| 284 | 284 | $new_final_arr = array(); |
| 285 | 285 | $invalid_array = array(); |
| 286 | 286 | $new_final_arr_key = $this->config->item('Origination-rates-field'); |
| 287 | 287 | $screen_path = $this->config->item('screen_path'); |
| 288 | - $reseller_id=0; |
|
| 288 | + $reseller_id = 0; |
|
| 289 | 289 | if ($this->session->userdata('logintype') == 1 || $this->session->userdata('logintype') == 5) { |
| 290 | 290 | $reseller_id = $this->session->userdata["accountinfo"]['id']; |
| 291 | 291 | } |
| 292 | 292 | |
| 293 | 293 | $full_path = $this->config->item('rates-file-path'); |
| 294 | 294 | $originationrate_file_name = $this->session->userdata('import_origination_rate_csv'); |
| 295 | - $csv_tmp_data = $this->csvreader->parse_file($full_path.$originationrate_file_name,$new_final_arr_key,$check_header); |
|
| 295 | + $csv_tmp_data = $this->csvreader->parse_file($full_path.$originationrate_file_name, $new_final_arr_key, $check_header); |
|
| 296 | 296 | //echo "<pre>";print_r($csv_tmp_data);exit; |
| 297 | - $i=0; |
|
| 297 | + $i = 0; |
|
| 298 | 298 | foreach ($csv_tmp_data as $key => $csv_data) { |
| 299 | - if(isset($csv_data['pattern']) && $csv_data['pattern']!= '' && $i != 0){ |
|
| 300 | - $str=null; |
|
| 301 | - $csv_data['comment']= isset($csv_data['comment'])? $csv_data['comment'] :''; |
|
| 302 | - $csv_data['connectcost']= isset($csv_data['connectcost']) ? $csv_data['connectcost'] :0; |
|
| 303 | - $csv_data['includedseconds']= isset($csv_data['includedseconds']) ? $csv_data['includedseconds'] :0; |
|
| 304 | - $csv_data['cost']= !empty($csv_data['cost']) && is_numeric( $csv_data['cost']) ? $csv_data['cost'] :0; |
|
| 305 | - $csv_data['inc']= isset($csv_data['inc']) ? $csv_data['inc'] :0; |
|
| 306 | - $csv_data['precedence']= isset($csv_data['precedence']) ? $csv_data['precedence'] :''; |
|
| 299 | + if (isset($csv_data['pattern']) && $csv_data['pattern'] != '' && $i != 0) { |
|
| 300 | + $str = null; |
|
| 301 | + $csv_data['comment'] = isset($csv_data['comment']) ? $csv_data['comment'] : ''; |
|
| 302 | + $csv_data['connectcost'] = isset($csv_data['connectcost']) ? $csv_data['connectcost'] : 0; |
|
| 303 | + $csv_data['includedseconds'] = isset($csv_data['includedseconds']) ? $csv_data['includedseconds'] : 0; |
|
| 304 | + $csv_data['cost'] = ! empty($csv_data['cost']) && is_numeric($csv_data['cost']) ? $csv_data['cost'] : 0; |
|
| 305 | + $csv_data['inc'] = isset($csv_data['inc']) ? $csv_data['inc'] : 0; |
|
| 306 | + $csv_data['precedence'] = isset($csv_data['precedence']) ? $csv_data['precedence'] : ''; |
|
| 307 | 307 | $csv_data['last_modified_date'] = date("Y-m-d H:i:s"); |
| 308 | - $str=$this->data_validate($csv_data); |
|
| 309 | - if($str != ""){ |
|
| 310 | - $invalid_array[$i]=$csv_data; |
|
| 308 | + $str = $this->data_validate($csv_data); |
|
| 309 | + if ($str != "") { |
|
| 310 | + $invalid_array[$i] = $csv_data; |
|
| 311 | 311 | $invalid_array[$i]['error'] = $str; |
| 312 | 312 | } |
| 313 | - else{ |
|
| 314 | - $csv_data['pricelist_id']=$pricelistID; |
|
| 315 | - $csv_data['trunk_id']=$trunkid; |
|
| 316 | - $csv_data['pattern'] = "^" . $csv_data['pattern'] . ".*"; |
|
| 317 | - $csv_data['reseller_id']= $reseller_id; |
|
| 313 | + else { |
|
| 314 | + $csv_data['pricelist_id'] = $pricelistID; |
|
| 315 | + $csv_data['trunk_id'] = $trunkid; |
|
| 316 | + $csv_data['pattern'] = "^".$csv_data['pattern'].".*"; |
|
| 317 | + $csv_data['reseller_id'] = $reseller_id; |
|
| 318 | 318 | $csv_data['creation_date'] = gmdate('Y-m-d H:i:s'); |
| 319 | - $new_final_arr[$i]=$csv_data; |
|
| 319 | + $new_final_arr[$i] = $csv_data; |
|
| 320 | 320 | } |
| 321 | 321 | } |
| 322 | 322 | $i++; |
| 323 | 323 | } |
| 324 | - if(!empty($new_final_arr)){ |
|
| 324 | + if ( ! empty($new_final_arr)) { |
|
| 325 | 325 | $result = $this->rates_model->bulk_insert_origination_rate($new_final_arr); |
| 326 | 326 | } |
| 327 | 327 | unlink($full_path.$originationrate_file_name); |
| 328 | - $count=count($invalid_array); |
|
| 329 | - if($count >0){ |
|
| 328 | + $count = count($invalid_array); |
|
| 329 | + if ($count > 0) { |
|
| 330 | 330 | $session_id = "-1"; |
| 331 | 331 | $fp = fopen($full_path.$session_id.'.csv', 'w'); |
| 332 | - foreach($new_final_arr_key as $key=>$value){ |
|
| 333 | - $custom_array[0][$key]=ucfirst($key); |
|
| 332 | + foreach ($new_final_arr_key as $key=>$value) { |
|
| 333 | + $custom_array[0][$key] = ucfirst($key); |
|
| 334 | 334 | } |
| 335 | - $custom_array[0]['error']= "Error"; |
|
| 336 | - $invalid_array =array_merge($custom_array,$invalid_array); |
|
| 337 | - foreach($invalid_array as $err_data){ |
|
| 338 | - fputcsv($fp,$err_data); |
|
| 335 | + $custom_array[0]['error'] = "Error"; |
|
| 336 | + $invalid_array = array_merge($custom_array, $invalid_array); |
|
| 337 | + foreach ($invalid_array as $err_data) { |
|
| 338 | + fputcsv($fp, $err_data); |
|
| 339 | 339 | } |
| 340 | 340 | fclose($fp); |
| 341 | 341 | $this->session->set_userdata('import_origination_rate_csv_error', $session_id.".csv"); |
| 342 | 342 | $data["error"] = $invalid_array; |
| 343 | 343 | $data['pricelistid'] = $pricelistID; |
| 344 | 344 | $data['impoted_count'] = count($new_final_arr); |
| 345 | - $data['failure_count'] = count($invalid_array)-1; |
|
| 345 | + $data['failure_count'] = count($invalid_array) - 1; |
|
| 346 | 346 | $data['page_title'] = 'Origination Rates Import Error'; |
| 347 | - $this->load->view('view_import_error',$data); |
|
| 348 | - } else{ |
|
| 347 | + $this->load->view('view_import_error', $data); |
|
| 348 | + } else { |
|
| 349 | 349 | $this->session->set_flashdata('astpp_errormsg', 'Total '.count($new_final_arr).' Origination rates imported successfully!'); |
| 350 | 350 | redirect(base_url()."rates/origination_rates_list/"); |
| 351 | 351 | } |
| 352 | 352 | } |
| 353 | - function data_validate($csvdata){ |
|
| 354 | - $str=null; |
|
| 353 | + function data_validate($csvdata) { |
|
| 354 | + $str = null; |
|
| 355 | 355 | $alpha_regex = "/^[a-z ,.'-]+$/i"; |
| 356 | 356 | $alpha_numeric_regex = "/^[a-z0-9 ,.'-]+$/i"; |
| 357 | 357 | $email_regex = "/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/"; |
| 358 | - $str.= $csvdata['pattern']!= '' ? null : 'Code,'; |
|
| 359 | - $str=rtrim($str,','); |
|
| 360 | - if(!$str){ |
|
| 361 | - $str.= is_numeric($csvdata['pattern']) ? null : 'Code,'; |
|
| 362 | - |
|
| 363 | - $str.= !empty($csvdata['connectcost']) && is_numeric( $csvdata['connectcost']) ? null :( empty($csvdata['connectcost']) ? null : 'Connect Cost,'); |
|
| 364 | - $str.= !empty($csvdata['includedseconds']) && is_numeric( $csvdata['includedseconds']) ? null :( empty($csvdata['includedseconds']) ? null : 'Included Seconds,'); |
|
| 365 | - |
|
| 366 | - $str.= !empty($csvdata['inc']) && is_numeric( $csvdata['inc']) ? null :( empty($csvdata['inc']) ? null : 'Increment,'); |
|
| 367 | - $str.= !empty($csvdata['precedence']) && is_numeric( $csvdata['precedence']) ? null :( empty($csvdata['precedence']) ? null : 'Precedence,'); |
|
| 368 | - $str.= (isset($csvdata['strip']) && !empty($csvdata['strip'])) ? (is_numeric($csvdata['strip']) ? null :'Strip,') : null; |
|
| 369 | - if($str){ |
|
| 370 | - $str=rtrim($str,','); |
|
| 371 | - $error_field=explode(',',$str); |
|
| 358 | + $str .= $csvdata['pattern'] != '' ? null : 'Code,'; |
|
| 359 | + $str = rtrim($str, ','); |
|
| 360 | + if ( ! $str) { |
|
| 361 | + $str .= is_numeric($csvdata['pattern']) ? null : 'Code,'; |
|
| 362 | + |
|
| 363 | + $str .= ! empty($csvdata['connectcost']) && is_numeric($csvdata['connectcost']) ? null : (empty($csvdata['connectcost']) ? null : 'Connect Cost,'); |
|
| 364 | + $str .= ! empty($csvdata['includedseconds']) && is_numeric($csvdata['includedseconds']) ? null : (empty($csvdata['includedseconds']) ? null : 'Included Seconds,'); |
|
| 365 | + |
|
| 366 | + $str .= ! empty($csvdata['inc']) && is_numeric($csvdata['inc']) ? null : (empty($csvdata['inc']) ? null : 'Increment,'); |
|
| 367 | + $str .= ! empty($csvdata['precedence']) && is_numeric($csvdata['precedence']) ? null : (empty($csvdata['precedence']) ? null : 'Precedence,'); |
|
| 368 | + $str .= (isset($csvdata['strip']) && ! empty($csvdata['strip'])) ? (is_numeric($csvdata['strip']) ? null : 'Strip,') : null; |
|
| 369 | + if ($str) { |
|
| 370 | + $str = rtrim($str, ','); |
|
| 371 | + $error_field = explode(',', $str); |
|
| 372 | 372 | $count = count($error_field); |
| 373 | - $str.= $count > 1 ? ' are not valid' : ' is not Valid'; |
|
| 373 | + $str .= $count > 1 ? ' are not valid' : ' is not Valid'; |
|
| 374 | 374 | return $str; |
| 375 | 375 | } |
| 376 | - else{ |
|
| 376 | + else { |
|
| 377 | 377 | return false; |
| 378 | 378 | } |
| 379 | 379 | } |
| 380 | - else{ |
|
| 381 | - $str=rtrim($str,','); |
|
| 382 | - $error_field=explode(',',$str); |
|
| 380 | + else { |
|
| 381 | + $str = rtrim($str, ','); |
|
| 382 | + $error_field = explode(',', $str); |
|
| 383 | 383 | $count = count($error_field); |
| 384 | - $str.= $count > 1 ? ' are required' : ' is Required'; |
|
| 384 | + $str .= $count > 1 ? ' are required' : ' is Required'; |
|
| 385 | 385 | return $str; |
| 386 | 386 | } |
| 387 | 387 | } |
| 388 | - function origination_rate_error_download(){ |
|
| 388 | + function origination_rate_error_download() { |
|
| 389 | 389 | $this->load->helper('download'); |
| 390 | - $error_data = $this->session->userdata('import_origination_rate_csv_error'); |
|
| 390 | + $error_data = $this->session->userdata('import_origination_rate_csv_error'); |
|
| 391 | 391 | $full_path = $this->config->item('rates-file-path'); |
| 392 | 392 | $data = file_get_contents($full_path.$error_data); |
| 393 | 393 | force_download("Origination_rate_error.csv", $data); |
@@ -417,13 +417,13 @@ discard block |
||
| 417 | 417 | $edit_data = $value; |
| 418 | 418 | } |
| 419 | 419 | $edit_data['connectcost'] = $this->common_model->to_calculate_currency($edit_data['connectcost'], '', '', true, false); |
| 420 | - $edit_data['cost'] = $this->common_model->to_calculate_currency($edit_data['cost'], '', '',true, false); |
|
| 420 | + $edit_data['cost'] = $this->common_model->to_calculate_currency($edit_data['cost'], '', '', true, false); |
|
| 421 | 421 | $edit_data['pattern'] = filter_var($edit_data['pattern'], FILTER_SANITIZE_NUMBER_INT); |
| 422 | 422 | |
| 423 | 423 | $data['form'] = $this->form->build_form($this->rates_form->get_origination_rate_form_fields(), $edit_data); |
| 424 | 424 | $this->load->view('view_origination_rate_add_edit', $data); |
| 425 | 425 | } else { |
| 426 | - redirect(base_url() . 'rates/origination_rate_list/'); |
|
| 426 | + redirect(base_url().'rates/origination_rate_list/'); |
|
| 427 | 427 | } |
| 428 | 428 | } |
| 429 | 429 | |
@@ -471,7 +471,7 @@ discard block |
||
| 471 | 471 | $this->session->set_userdata('origination_rate_list_search', $action); |
| 472 | 472 | } |
| 473 | 473 | if (@$ajax_search != 1) { |
| 474 | - redirect(base_url() . 'rates/origination_rates_list/'); |
|
| 474 | + redirect(base_url().'rates/origination_rates_list/'); |
|
| 475 | 475 | } |
| 476 | 476 | } |
| 477 | 477 | |
@@ -483,13 +483,13 @@ discard block |
||
| 483 | 483 | function termination_rate_delete($id) { |
| 484 | 484 | $this->rates_model->remove_termination_rate($id); |
| 485 | 485 | $this->session->set_flashdata('astpp_notification', 'Termination removed successfully!'); |
| 486 | - redirect(base_url() . '/rates/termination_rates_list/'); |
|
| 486 | + redirect(base_url().'/rates/termination_rates_list/'); |
|
| 487 | 487 | } |
| 488 | 488 | |
| 489 | 489 | function origination_rate_delete($id) { |
| 490 | 490 | $this->rates_model->remove_origination_rate($id); |
| 491 | 491 | $this->session->set_flashdata('astpp_notification', 'Origination rate removed successfully!'); |
| 492 | - redirect(base_url() . 'rates/origination_rates_list/'); |
|
| 492 | + redirect(base_url().'rates/origination_rates_list/'); |
|
| 493 | 493 | } |
| 494 | 494 | |
| 495 | 495 | function origination_rates_list() { |
@@ -528,9 +528,9 @@ discard block |
||
| 528 | 528 | echo json_encode($json_data); |
| 529 | 529 | } |
| 530 | 530 | |
| 531 | - function origination_rates_list_delete($flag='') { |
|
| 531 | + function origination_rates_list_delete($flag = '') { |
|
| 532 | 532 | $json_data = array(); |
| 533 | - $this->session->set_userdata('advance_batch_data_delete',1); |
|
| 533 | + $this->session->set_userdata('advance_batch_data_delete', 1); |
|
| 534 | 534 | $count_all = $this->rates_model->get_origination_rate_list(false); |
| 535 | 535 | echo $count_all; |
| 536 | 536 | } |
@@ -604,7 +604,7 @@ discard block |
||
| 604 | 604 | $this->session->set_userdata('termination_rates_list_search', $action); |
| 605 | 605 | } |
| 606 | 606 | if (@$ajax_search != 1) { |
| 607 | - redirect(base_url() . 'rates/termination_rates_list/'); |
|
| 607 | + redirect(base_url().'rates/termination_rates_list/'); |
|
| 608 | 608 | } |
| 609 | 609 | } |
| 610 | 610 | |
@@ -613,20 +613,20 @@ discard block |
||
| 613 | 613 | $this->session->set_userdata('account_search', ""); |
| 614 | 614 | } |
| 615 | 615 | |
| 616 | - function customer_block_pattern_list($accountid,$accounttype) { |
|
| 616 | + function customer_block_pattern_list($accountid, $accounttype) { |
|
| 617 | 617 | $json_data = array(); |
| 618 | 618 | $where = array('accountid' => $accountid); |
| 619 | - $instant_search=$this->session->userdata('left_panel_search_'.$accounttype.'_pattern'); |
|
| 620 | - $like_str=!empty($instant_search) ? "(blocked_patterns like '%$instant_search%' OR destination like '%$instant_search%' )" :null; |
|
| 621 | - if(!empty($like_str)) |
|
| 619 | + $instant_search = $this->session->userdata('left_panel_search_'.$accounttype.'_pattern'); |
|
| 620 | + $like_str = ! empty($instant_search) ? "(blocked_patterns like '%$instant_search%' OR destination like '%$instant_search%' )" : null; |
|
| 621 | + if ( ! empty($like_str)) |
|
| 622 | 622 | $this->db->where($like_str); |
| 623 | 623 | $count_all = $this->db_model->countQuery("*", "block_patterns", $where); |
| 624 | 624 | $paging_data = $this->form->load_grid_config($count_all, $_GET['rp'], $_GET['page']); |
| 625 | 625 | $json_data = $paging_data["json_paging"]; |
| 626 | - if(!empty($like_str)) |
|
| 626 | + if ( ! empty($like_str)) |
|
| 627 | 627 | $this->db->where($like_str); |
| 628 | 628 | $pattern_data = $this->db_model->getSelect("*", "block_patterns", $where, "id", "ASC", $paging_data["paging"]["page_no"], $paging_data["paging"]["start"]); |
| 629 | - $grid_fields = json_decode($this->rates_form->build_pattern_list_for_customer($accountid,$accounttype)); |
|
| 629 | + $grid_fields = json_decode($this->rates_form->build_pattern_list_for_customer($accountid, $accounttype)); |
|
| 630 | 630 | $json_data['rows'] = $this->form->build_grid($pattern_data, $grid_fields); |
| 631 | 631 | echo json_encode($json_data); |
| 632 | 632 | } |
@@ -649,7 +649,7 @@ discard block |
||
| 649 | 649 | $json_data = array(); |
| 650 | 650 | $account_data = $this->session->userdata("accountinfo"); |
| 651 | 651 | $markup = $this->common->get_field_name('markup', 'pricelists', array('id'=>$account_data["pricelist_id"])); |
| 652 | - $markup = ($markup > 0)?$markup:1; |
|
| 652 | + $markup = ($markup > 0) ? $markup : 1; |
|
| 653 | 653 | |
| 654 | 654 | $count_all = $this->rates_model->get_origination_rate_list_for_user(false); |
| 655 | 655 | $paging_data = $this->form->load_grid_config($count_all, $_GET['rp'], $_GET['page']); |
@@ -659,11 +659,11 @@ discard block |
||
| 659 | 659 | $grid_fields = json_decode($this->rates_form->build_origination_rate_list_for_user()); |
| 660 | 660 | foreach ($query->result_array() as $key => $value) { |
| 661 | 661 | $json_data['rows'][] = array('cell' => array( |
| 662 | - $this->common->get_only_numeric_val("","",$value["pattern"]), |
|
| 662 | + $this->common->get_only_numeric_val("", "", $value["pattern"]), |
|
| 663 | 663 | $value['comment'], |
| 664 | 664 | $value['inc'], |
| 665 | - $this->common_model->calculate_currency(($value['cost'] + ($value['cost']*$markup)/100),'','','',true), |
|
| 666 | - $this->common_model->calculate_currency($value['connectcost'],'','','',true), |
|
| 665 | + $this->common_model->calculate_currency(($value['cost'] + ($value['cost'] * $markup) / 100), '', '', '', true), |
|
| 666 | + $this->common_model->calculate_currency($value['connectcost'], '', '', '', true), |
|
| 667 | 667 | $value['includedseconds'] |
| 668 | 668 | )); |
| 669 | 669 | } |
@@ -682,7 +682,7 @@ discard block |
||
| 682 | 682 | $this->session->set_userdata('origination_rate_list_search', $action); |
| 683 | 683 | } |
| 684 | 684 | if (@$ajax_search != 1) { |
| 685 | - redirect(base_url() . 'user/user_rates_list/'); |
|
| 685 | + redirect(base_url().'user/user_rates_list/'); |
|
| 686 | 686 | } |
| 687 | 687 | } |
| 688 | 688 | |
@@ -690,10 +690,10 @@ discard block |
||
| 690 | 690 | $this->session->set_userdata('advance_search', 0); |
| 691 | 691 | $this->session->set_userdata('account_search', ""); |
| 692 | 692 | } |
| 693 | - function customer_rates_download_sample_file($file_name){ |
|
| 693 | + function customer_rates_download_sample_file($file_name) { |
|
| 694 | 694 | $this->load->helper('download'); |
| 695 | 695 | $full_path = base_url()."assets/Rates_File/".$file_name.".csv"; |
| 696 | - $arrContextOptions=array( |
|
| 696 | + $arrContextOptions = array( |
|
| 697 | 697 | "ssl"=>array( |
| 698 | 698 | "verify_peer"=>false, |
| 699 | 699 | "verify_peer_name"=>false, |
@@ -702,19 +702,19 @@ discard block |
||
| 702 | 702 | $file = file_get_contents($full_path, false, stream_context_create($arrContextOptions)); |
| 703 | 703 | force_download("samplefile.csv", $file); |
| 704 | 704 | } |
| 705 | - function termination_rate_batch_update(){ |
|
| 705 | + function termination_rate_batch_update() { |
|
| 706 | 706 | $batch_update_arr = $this->input->post(); |
| 707 | - $batch_update_arr["cost"]["cost"] = isset($batch_update_arr["cost"]["cost"])?$this->common_model->add_calculate_currency($batch_update_arr["cost"]["cost"], '', '', true, false):"0.0000"; |
|
| 708 | - $batch_update_arr["connectcost"]["connectcost"] = isset($batch_update_arr["connectcost"]["connectcost"])?$this->common_model->add_calculate_currency($batch_update_arr["connectcost"]["connectcost"], '', '', true, false):"0.0000"; |
|
| 707 | + $batch_update_arr["cost"]["cost"] = isset($batch_update_arr["cost"]["cost"]) ? $this->common_model->add_calculate_currency($batch_update_arr["cost"]["cost"], '', '', true, false) : "0.0000"; |
|
| 708 | + $batch_update_arr["connectcost"]["connectcost"] = isset($batch_update_arr["connectcost"]["connectcost"]) ? $this->common_model->add_calculate_currency($batch_update_arr["connectcost"]["connectcost"], '', '', true, false) : "0.0000"; |
|
| 709 | 709 | // $batch_update_arr = array("inc"=> array("inc"=>"1","operator"=>"3"),"cost"=> array("cost"=>"1","operator"=>"4")); |
| 710 | 710 | $result = $this->rates_model->termination_rate_batch_update($batch_update_arr); |
| 711 | 711 | echo json_encode(array("SUCCESS"=> "Termination rates batch updated successfully!")); |
| 712 | 712 | exit; |
| 713 | 713 | } |
| 714 | 714 | |
| 715 | - function origination_rate_batch_update(){ |
|
| 715 | + function origination_rate_batch_update() { |
|
| 716 | 716 | $batch_update_arr = $this->input->post(); |
| 717 | - $batch_update_arr["cost"]["cost"] = isset($batch_update_arr["cost"]["cost"])?$this->common_model->add_calculate_currency($batch_update_arr["cost"]["cost"], '', '', true, false):"0.0000"; |
|
| 717 | + $batch_update_arr["cost"]["cost"] = isset($batch_update_arr["cost"]["cost"]) ? $this->common_model->add_calculate_currency($batch_update_arr["cost"]["cost"], '', '', true, false) : "0.0000"; |
|
| 718 | 718 | // $batch_update_arr = array("inc"=> array("inc"=>"1","operator"=>"3"),"cost"=> array("cost"=>"1","operator"=>"4")); |
| 719 | 719 | $result = $this->rates_model->origination_rate_batch_update($batch_update_arr); |
| 720 | 720 | echo json_encode(array("SUCCESS"=> "Origination rates batch updated successfully!")); |
@@ -723,23 +723,23 @@ discard block |
||
| 723 | 723 | |
| 724 | 724 | function termination_rate_export_cdr_xls() { |
| 725 | 725 | $account_info = $accountinfo = $this->session->userdata('accountinfo'); |
| 726 | - $currency_id=$account_info['currency_id']; |
|
| 727 | - $currency=$this->common->get_field_name('currency', 'currency', $currency_id); |
|
| 726 | + $currency_id = $account_info['currency_id']; |
|
| 727 | + $currency = $this->common->get_field_name('currency', 'currency', $currency_id); |
|
| 728 | 728 | $query = $this->rates_model->get_termination_rate(true, '', '', false); |
| 729 | 729 | $outbound_array = array(); |
| 730 | 730 | ob_clean(); |
| 731 | - $outbound_array[] = array("Code", "Destination", "Connect Cost($currency)", "Included Seconds","Per Minute Cost($currency)","Initial Increment", "Increment","Priority","Strip","Prepend","Trunk","Status","Created Date"); |
|
| 731 | + $outbound_array[] = array("Code", "Destination", "Connect Cost($currency)", "Included Seconds", "Per Minute Cost($currency)", "Initial Increment", "Increment", "Priority", "Strip", "Prepend", "Trunk", "Status", "Created Date"); |
|
| 732 | 732 | if ($query->num_rows() > 0) { |
| 733 | 733 | |
| 734 | 734 | foreach ($query->result_array() as $row) { |
| 735 | 735 | //echo"<pre>";print_r($row);exit; |
| 736 | 736 | $outbound_array[] = array( |
| 737 | - $row['pattern']=$this->common->get_only_numeric_val("","",$row["pattern"]), |
|
| 737 | + $row['pattern'] = $this->common->get_only_numeric_val("", "", $row["pattern"]), |
|
| 738 | 738 | $row['comment'], |
| 739 | - $this->common_model->calculate_currency($row['connectcost'],'','',TRUE,false), |
|
| 739 | + $this->common_model->calculate_currency($row['connectcost'], '', '', TRUE, false), |
|
| 740 | 740 | |
| 741 | 741 | $row['includedseconds'], |
| 742 | - $this->common_model->calculate_currency($row['cost'],'','',TRUE,false), |
|
| 742 | + $this->common_model->calculate_currency($row['cost'], '', '', TRUE, false), |
|
| 743 | 743 | /** |
| 744 | 744 | ASTPP 3.0 |
| 745 | 745 | For Add Initial Increment field |
@@ -751,7 +751,7 @@ discard block |
||
| 751 | 751 | $row['strip'], |
| 752 | 752 | $row['prepend'], |
| 753 | 753 | //$row['trunk_id'], |
| 754 | - $this->common->get_field_name('name','trunks',$row["trunk_id"]), |
|
| 754 | + $this->common->get_field_name('name', 'trunks', $row["trunk_id"]), |
|
| 755 | 755 | $this->common->get_status('export', '', $row['status']), |
| 756 | 756 | $row['creation_date'], |
| 757 | 757 | |
@@ -760,7 +760,7 @@ discard block |
||
| 760 | 760 | } |
| 761 | 761 | $this->load->helper('csv'); |
| 762 | 762 | |
| 763 | - array_to_csv($outbound_array, 'Termination_Rates_' . date("Y-m-d") . '.csv'); |
|
| 763 | + array_to_csv($outbound_array, 'Termination_Rates_'.date("Y-m-d").'.csv'); |
|
| 764 | 764 | |
| 765 | 765 | } |
| 766 | 766 | |
@@ -771,13 +771,13 @@ discard block |
||
| 771 | 771 | $this->load->library('pdf'); |
| 772 | 772 | $this->fpdf = new PDF('P', 'pt'); |
| 773 | 773 | $this->fpdf->initialize('P', 'mm', 'A4'); |
| 774 | - $this->fpdf->tablewidths = array(20, 30, 20, 20, 20, 20, 20,20,20); |
|
| 775 | - $outbound_array[] = array("Code", "Destination", "Connect Cost","Included Seconds","Per Minute Cost","Initial Increment", "Increment","Precedence","Prepend","Strip"); |
|
| 774 | + $this->fpdf->tablewidths = array(20, 30, 20, 20, 20, 20, 20, 20, 20); |
|
| 775 | + $outbound_array[] = array("Code", "Destination", "Connect Cost", "Included Seconds", "Per Minute Cost", "Initial Increment", "Increment", "Precedence", "Prepend", "Strip"); |
|
| 776 | 776 | if ($query->num_rows() > 0) { |
| 777 | 777 | |
| 778 | 778 | foreach ($query->result_array() as $row) { |
| 779 | 779 | $outbound_array[] = array( |
| 780 | - $row['pattern']=$this->common->get_only_numeric_val("","",$row["pattern"]), |
|
| 780 | + $row['pattern'] = $this->common->get_only_numeric_val("", "", $row["pattern"]), |
|
| 781 | 781 | $row['comment'], |
| 782 | 782 | $row['connectcost'], |
| 783 | 783 | $row['includedseconds'], |
@@ -800,7 +800,7 @@ discard block |
||
| 800 | 800 | |
| 801 | 801 | $this->fpdf->SetFont('Arial', '', 15); |
| 802 | 802 | $this->fpdf->SetXY(60, 5); |
| 803 | - $this->fpdf->Cell(100, 10, "Outbound Rates Report " . date('Y-m-d')); |
|
| 803 | + $this->fpdf->Cell(100, 10, "Outbound Rates Report ".date('Y-m-d')); |
|
| 804 | 804 | |
| 805 | 805 | $this->fpdf->SetY(20); |
| 806 | 806 | $this->fpdf->SetFont('Arial', '', 7); |
@@ -808,29 +808,29 @@ discard block |
||
| 808 | 808 | $this->fpdf->lMargin = 2; |
| 809 | 809 | |
| 810 | 810 | $dimensions = $this->fpdf->export_pdf($outbound_array, "7"); |
| 811 | - $this->fpdf->Output('Termination_Rate_' . date("Y-m-d") . '.pdf', "D"); |
|
| 811 | + $this->fpdf->Output('Termination_Rate_'.date("Y-m-d").'.pdf', "D"); |
|
| 812 | 812 | } |
| 813 | 813 | |
| 814 | 814 | |
| 815 | 815 | function origination_rate_export_cdr_xls() { |
| 816 | 816 | $account_info = $accountinfo = $this->session->userdata('accountinfo'); |
| 817 | - $currency_id=$account_info['currency_id']; |
|
| 818 | - $currency=$this->common->get_field_name('currency', 'currency', $currency_id); |
|
| 817 | + $currency_id = $account_info['currency_id']; |
|
| 818 | + $currency = $this->common->get_field_name('currency', 'currency', $currency_id); |
|
| 819 | 819 | $query = $this->rates_model->get_origination_rate(true, '', '', false); |
| 820 | 820 | //echo "<pre>";print_r($query);exit; |
| 821 | 821 | $inbound_array = array(); |
| 822 | 822 | ob_clean(); |
| 823 | - $inbound_array[] = array("Code", "Destination","Connect Cost($currency)","Included Seconds","Per Minute Cost($currency)", "Initial Increment", "Increment","Rate Group","Status","Created Date"); |
|
| 823 | + $inbound_array[] = array("Code", "Destination", "Connect Cost($currency)", "Included Seconds", "Per Minute Cost($currency)", "Initial Increment", "Increment", "Rate Group", "Status", "Created Date"); |
|
| 824 | 824 | if ($query->num_rows() > 0) { |
| 825 | 825 | |
| 826 | 826 | foreach ($query->result_array() as $row) { |
| 827 | 827 | //echo"<pre>";print_r($row);exit; |
| 828 | 828 | $inbound_array[] = array( |
| 829 | - $row['pattern']=$this->common->get_only_numeric_val("","",$row["pattern"]), |
|
| 829 | + $row['pattern'] = $this->common->get_only_numeric_val("", "", $row["pattern"]), |
|
| 830 | 830 | $row['comment'], |
| 831 | - $this->common_model->calculate_currency($row['connectcost'],'','',TRUE,false), |
|
| 831 | + $this->common_model->calculate_currency($row['connectcost'], '', '', TRUE, false), |
|
| 832 | 832 | $row['includedseconds'], |
| 833 | - $this->common_model->calculate_currency($row['cost'],'','',TRUE,false), |
|
| 833 | + $this->common_model->calculate_currency($row['cost'], '', '', TRUE, false), |
|
| 834 | 834 | /** |
| 835 | 835 | ASTPP 3.0 |
| 836 | 836 | For Add Initial Increment field |
@@ -846,7 +846,7 @@ discard block |
||
| 846 | 846 | } |
| 847 | 847 | } |
| 848 | 848 | $this->load->helper('csv'); |
| 849 | - array_to_csv($inbound_array, 'Origination_Rates_' . date("Y-m-d") . '.csv'); |
|
| 849 | + array_to_csv($inbound_array, 'Origination_Rates_'.date("Y-m-d").'.csv'); |
|
| 850 | 850 | } |
| 851 | 851 | function origination_rate_export_cdr_pdf() { |
| 852 | 852 | $query = $this->rates_model->get_origination_rate(true, '', '', false); |
@@ -857,15 +857,15 @@ discard block |
||
| 857 | 857 | $this->fpdf = new PDF('P', 'pt'); |
| 858 | 858 | $this->fpdf->initialize('P', 'mm', 'A4'); |
| 859 | 859 | $this->fpdf->tablewidths = array(20, 20, 20, 20, 20, 20); |
| 860 | - $inbound_array[] = array("Code", "Destination","Connect Cost","Included Seconds","Per Minute Cost","Initial Increment","Increment"); |
|
| 860 | + $inbound_array[] = array("Code", "Destination", "Connect Cost", "Included Seconds", "Per Minute Cost", "Initial Increment", "Increment"); |
|
| 861 | 861 | if ($query->num_rows() > 0) { |
| 862 | 862 | foreach ($query->result_array() as $row) { |
| 863 | 863 | $inbound_array[] = array( |
| 864 | - $row['pattern']=$this->common->get_only_numeric_val("","",$row["pattern"]), |
|
| 864 | + $row['pattern'] = $this->common->get_only_numeric_val("", "", $row["pattern"]), |
|
| 865 | 865 | $row['comment'], |
| 866 | 866 | $row['connectcost'], |
| 867 | 867 | $row['includedseconds'], |
| 868 | - $this->common_model->calculate_currency($row['cost'],'','','',false), |
|
| 868 | + $this->common_model->calculate_currency($row['cost'], '', '', '', false), |
|
| 869 | 869 | /** |
| 870 | 870 | ASTPP 3.0 |
| 871 | 871 | For Add Initial Increment field |
@@ -881,7 +881,7 @@ discard block |
||
| 881 | 881 | |
| 882 | 882 | $this->fpdf->SetFont('Arial', '', 15); |
| 883 | 883 | $this->fpdf->SetXY(60, 5); |
| 884 | - $this->fpdf->Cell(100, 10, "Origination Rates Report " . date('Y-m-d')); |
|
| 884 | + $this->fpdf->Cell(100, 10, "Origination Rates Report ".date('Y-m-d')); |
|
| 885 | 885 | |
| 886 | 886 | $this->fpdf->SetY(20); |
| 887 | 887 | $this->fpdf->SetFont('Arial', '', 7); |
@@ -889,7 +889,7 @@ discard block |
||
| 889 | 889 | $this->fpdf->lMargin = 2; |
| 890 | 890 | |
| 891 | 891 | $dimensions = $this->fpdf->export_pdf($inbound_array, "5"); |
| 892 | - $this->fpdf->Output('Origination_Rate_' . date("Y-m-d") . '.pdf', "D"); |
|
| 892 | + $this->fpdf->Output('Origination_Rate_'.date("Y-m-d").'.pdf', "D"); |
|
| 893 | 893 | } |
| 894 | 894 | |
| 895 | 895 | |
@@ -901,14 +901,14 @@ discard block |
||
| 901 | 901 | $this->fpdf = new PDF('P', 'pt'); |
| 902 | 902 | $this->fpdf->initialize('P', 'mm', 'A4'); |
| 903 | 903 | $this->fpdf->tablewidths = array(20, 20, 20, 20, 20, 20); |
| 904 | - $inbound_array[] = array("Code", "Destination", "Increment","Cost Per Minutes", "Connect Charge", "Included Seconds"); |
|
| 904 | + $inbound_array[] = array("Code", "Destination", "Increment", "Cost Per Minutes", "Connect Charge", "Included Seconds"); |
|
| 905 | 905 | if ($query->num_rows() > 0) { |
| 906 | 906 | foreach ($query->result_array() as $row) { |
| 907 | 907 | $inbound_array[] = array( |
| 908 | - $row['pattern']=$this->common->get_only_numeric_val("","",$row["pattern"]), |
|
| 908 | + $row['pattern'] = $this->common->get_only_numeric_val("", "", $row["pattern"]), |
|
| 909 | 909 | $row['comment'], |
| 910 | 910 | $row['inc'], |
| 911 | - $this->common_model->calculate_currency($row['cost'],'','','',false), |
|
| 911 | + $this->common_model->calculate_currency($row['cost'], '', '', '', false), |
|
| 912 | 912 | $row['connectcost'], |
| 913 | 913 | $row['includedseconds'] |
| 914 | 914 | ); |
@@ -920,7 +920,7 @@ discard block |
||
| 920 | 920 | |
| 921 | 921 | $this->fpdf->SetFont('Arial', '', 15); |
| 922 | 922 | $this->fpdf->SetXY(60, 5); |
| 923 | - $this->fpdf->Cell(100, 10, "Rates Report " . date('Y-m-d')); |
|
| 923 | + $this->fpdf->Cell(100, 10, "Rates Report ".date('Y-m-d')); |
|
| 924 | 924 | |
| 925 | 925 | $this->fpdf->SetY(20); |
| 926 | 926 | $this->fpdf->SetFont('Arial', '', 7); |
@@ -928,12 +928,12 @@ discard block |
||
| 928 | 928 | $this->fpdf->lMargin = 2; |
| 929 | 929 | |
| 930 | 930 | $dimensions = $this->fpdf->export_pdf($inbound_array, "5"); |
| 931 | - $this->fpdf->Output('Rates_' . date("Y-m-d") . '.pdf', "D"); |
|
| 931 | + $this->fpdf->Output('Rates_'.date("Y-m-d").'.pdf', "D"); |
|
| 932 | 932 | } |
| 933 | - function resellersrates_list(){ |
|
| 934 | - $accountinfo=$this->session->userdata('accountinfo'); |
|
| 933 | + function resellersrates_list() { |
|
| 934 | + $accountinfo = $this->session->userdata('accountinfo'); |
|
| 935 | 935 | $data['username'] = $this->session->userdata('user_name'); |
| 936 | - $data['page_title'] = 'My Rates' ; |
|
| 936 | + $data['page_title'] = 'My Rates'; |
|
| 937 | 937 | $data['search_flag'] = true; |
| 938 | 938 | $this->session->set_userdata('advance_search', 0); |
| 939 | 939 | $data['grid_fields'] = $this->rates_form->build_rates_list_for_reseller(); |
@@ -953,11 +953,11 @@ discard block |
||
| 953 | 953 | $grid_fields = json_decode($this->rates_form->build_rates_list_for_reseller()); |
| 954 | 954 | foreach ($query->result_array() as $key => $value) { |
| 955 | 955 | $json_data['rows'][] = array('cell' => array( |
| 956 | - $this->common->get_only_numeric_val("","",$value["pattern"]), |
|
| 956 | + $this->common->get_only_numeric_val("", "", $value["pattern"]), |
|
| 957 | 957 | $value['comment'], |
| 958 | - $this->common_model->calculate_currency($value['connectcost'],'','','true',true), |
|
| 958 | + $this->common_model->calculate_currency($value['connectcost'], '', '', 'true', true), |
|
| 959 | 959 | $value['includedseconds'], |
| 960 | - $this->common_model->calculate_currency(($value['cost'] + ($value['cost']*$markup)/100),'','','true',true), |
|
| 960 | + $this->common_model->calculate_currency(($value['cost'] + ($value['cost'] * $markup) / 100), '', '', 'true', true), |
|
| 961 | 961 | $value['inc'], |
| 962 | 962 | $value['precedence'], |
| 963 | 963 | )); |
@@ -977,7 +977,7 @@ discard block |
||
| 977 | 977 | $this->session->set_userdata('resellerrates_list_search', $action); |
| 978 | 978 | } |
| 979 | 979 | if (@$ajax_search != 1) { |
| 980 | - redirect(base_url() . 'rates/resellersrates_list/'); |
|
| 980 | + redirect(base_url().'rates/resellersrates_list/'); |
|
| 981 | 981 | } |
| 982 | 982 | } |
| 983 | 983 | function resellersrates_list_clearsearchfilter() { |
@@ -1001,7 +1001,7 @@ discard block |
||
| 1001 | 1001 | foreach ($query->result_array() as $row) { |
| 1002 | 1002 | |
| 1003 | 1003 | $customer_array[] = array( |
| 1004 | - $row['pattern']=$this->common->get_only_numeric_val("","",$row["pattern"]), |
|
| 1004 | + $row['pattern'] = $this->common->get_only_numeric_val("", "", $row["pattern"]), |
|
| 1005 | 1005 | $row['comment'], |
| 1006 | 1006 | $row['connectcost'], |
| 1007 | 1007 | $row['includedseconds'], |
@@ -1013,7 +1013,7 @@ discard block |
||
| 1013 | 1013 | } |
| 1014 | 1014 | } |
| 1015 | 1015 | $this->load->helper('csv'); |
| 1016 | - array_to_csv($customer_array, 'My_Own_Rate_' . date("Y-m-d") . '.csv'); |
|
| 1016 | + array_to_csv($customer_array, 'My_Own_Rate_'.date("Y-m-d").'.csv'); |
|
| 1017 | 1017 | exit; |
| 1018 | 1018 | } |
| 1019 | 1019 | /*********** |
@@ -1030,7 +1030,7 @@ discard block |
||
| 1030 | 1030 | $this->session->set_userdata('termination_rates_list_search', $action); |
| 1031 | 1031 | } |
| 1032 | 1032 | if (@$ajax_search != 1) { |
| 1033 | - redirect(base_url() . 'rates/termination_rates_list/'); |
|
| 1033 | + redirect(base_url().'rates/termination_rates_list/'); |
|
| 1034 | 1034 | } |
| 1035 | 1035 | } |
| 1036 | 1036 | function origination_rates_list_batch_delete() { |
@@ -1043,7 +1043,7 @@ discard block |
||
| 1043 | 1043 | $this->session->set_userdata('origination_rate_list_search', $action); |
| 1044 | 1044 | } |
| 1045 | 1045 | if (@$ajax_search != 1) { |
| 1046 | - redirect(base_url() . 'rates/origination_rates_list/'); |
|
| 1046 | + redirect(base_url().'rates/origination_rates_list/'); |
|
| 1047 | 1047 | } |
| 1048 | 1048 | } |
| 1049 | 1049 | |
@@ -1059,14 +1059,14 @@ discard block |
||
| 1059 | 1059 | |
| 1060 | 1060 | function csv_to_array($filename = '', $delimiter = ',') |
| 1061 | 1061 | { |
| 1062 | - if (!file_exists($filename) || !is_readable($filename)) return FALSE; |
|
| 1062 | + if ( ! file_exists($filename) || ! is_readable($filename)) return FALSE; |
|
| 1063 | 1063 | $header = NULL; |
| 1064 | 1064 | $data = array(); |
| 1065 | 1065 | if (($handle = fopen($filename, 'r')) !== FALSE) |
| 1066 | 1066 | { |
| 1067 | 1067 | while (($row = fgetcsv($handle, 1000, $delimiter)) !== FALSE) |
| 1068 | 1068 | { |
| 1069 | - if (!$header) $header = $row; |
|
| 1069 | + if ( ! $header) $header = $row; |
|
| 1070 | 1070 | else $data[] = array_combine($header, $row); |
| 1071 | 1071 | } |
| 1072 | 1072 | |
@@ -1079,9 +1079,9 @@ discard block |
||
| 1079 | 1079 | function utf8_converter($array) |
| 1080 | 1080 | { |
| 1081 | 1081 | array_walk_recursive($array, |
| 1082 | - function (&$item, $key) |
|
| 1082 | + function(&$item, $key) |
|
| 1083 | 1083 | { |
| 1084 | - if (!mb_detect_encoding($item, 'utf-8', true)) |
|
| 1084 | + if ( ! mb_detect_encoding($item, 'utf-8', true)) |
|
| 1085 | 1085 | { |
| 1086 | 1086 | $item = utf8_encode($item); |
| 1087 | 1087 | } |
@@ -1095,9 +1095,9 @@ discard block |
||
| 1095 | 1095 | $check_header = $this->input->post('check_header', true); |
| 1096 | 1096 | $data['page_title'] = 'Import Termination Rates'; |
| 1097 | 1097 | $new_final_arr_key = $this->config->item('Termination-rates-field'); |
| 1098 | - if (empty($_FILES) || !isset($_FILES)) |
|
| 1098 | + if (empty($_FILES) || ! isset($_FILES)) |
|
| 1099 | 1099 | { |
| 1100 | - redirect(base_url() . "rates/termination_rates_list/"); |
|
| 1100 | + redirect(base_url()."rates/termination_rates_list/"); |
|
| 1101 | 1101 | } |
| 1102 | 1102 | |
| 1103 | 1103 | $data['mapto_fields'] = $new_final_arr_key; |
@@ -1117,13 +1117,13 @@ discard block |
||
| 1117 | 1117 | // $csv_data = $this->csvreader->parse_file($uploadedFile, $new_final_arr_key, $check_header); |
| 1118 | 1118 | |
| 1119 | 1119 | $csv_data = $this->utf8_converter($this->csvreader->parse_file($uploadedFile, $field_select, $check_header)); |
| 1120 | - if (!empty($csv_data)) |
|
| 1120 | + if ( ! empty($csv_data)) |
|
| 1121 | 1121 | { |
| 1122 | 1122 | $full_path = $this->config->item('rates-file-path'); |
| 1123 | - $actual_file_name = "ASTPP-TERMINATION-RATES-" . date("Y-m-d H:i:s") . "." . $ext; |
|
| 1123 | + $actual_file_name = "ASTPP-TERMINATION-RATES-".date("Y-m-d H:i:s").".".$ext; |
|
| 1124 | 1124 | $actual_file_name = str_replace(' ', '-', $actual_file_name); |
| 1125 | 1125 | $actual_file_name = str_replace(':', '-', $actual_file_name); |
| 1126 | - if (move_uploaded_file($uploadedFile, $full_path . $actual_file_name)) |
|
| 1126 | + if (move_uploaded_file($uploadedFile, $full_path.$actual_file_name)) |
|
| 1127 | 1127 | { |
| 1128 | 1128 | $data['field_select'] = serialize($field_select); |
| 1129 | 1129 | $data['csv_tmp_data'] = $csv_data; |
@@ -1157,14 +1157,14 @@ discard block |
||
| 1157 | 1157 | if ($invalid_flag) |
| 1158 | 1158 | { |
| 1159 | 1159 | $str = ''; |
| 1160 | - if (!isset($_POST['trunk_id']) || empty($_POST['trunk_id'])) |
|
| 1160 | + if ( ! isset($_POST['trunk_id']) || empty($_POST['trunk_id'])) |
|
| 1161 | 1161 | { |
| 1162 | - $str.= '<br/>Please Create Trunk.'; |
|
| 1162 | + $str .= '<br/>Please Create Trunk.'; |
|
| 1163 | 1163 | } |
| 1164 | 1164 | |
| 1165 | 1165 | if (empty($_FILES['termination_rate_import_mapper']['name'])) |
| 1166 | 1166 | { |
| 1167 | - $str.= '<br/>Please Select File.'; |
|
| 1167 | + $str .= '<br/>Please Select File.'; |
|
| 1168 | 1168 | } |
| 1169 | 1169 | |
| 1170 | 1170 | $data['error'] = $str; |
@@ -1185,7 +1185,7 @@ discard block |
||
| 1185 | 1185 | $new_final_arr = array(); |
| 1186 | 1186 | $invalid_array = array(); |
| 1187 | 1187 | $new_final_arr_key = array(); |
| 1188 | - foreach($filefields as $item) |
|
| 1188 | + foreach ($filefields as $item) |
|
| 1189 | 1189 | { |
| 1190 | 1190 | $new_final_arr_key[$item] = $item; |
| 1191 | 1191 | } |
@@ -1199,30 +1199,30 @@ discard block |
||
| 1199 | 1199 | |
| 1200 | 1200 | $full_path = $this->config->item('rates-file-path'); |
| 1201 | 1201 | $terminationrate_file_name = $this->session->userdata('import_termination_rate_mapper_csv'); |
| 1202 | - $csv_tmp_data = $this->csvreader->parse_file($full_path . $terminationrate_file_name, $new_final_arr_key, $check_header); |
|
| 1202 | + $csv_tmp_data = $this->csvreader->parse_file($full_path.$terminationrate_file_name, $new_final_arr_key, $check_header); |
|
| 1203 | 1203 | $i = 0; |
| 1204 | - foreach($csv_tmp_data as $key => $csv_data) |
|
| 1204 | + foreach ($csv_tmp_data as $key => $csv_data) |
|
| 1205 | 1205 | { |
| 1206 | - if (isset($csv_data[$this->input->post("pattern-select") ]) && $csv_data[$this->input->post("pattern-select") ] != '' && $i != 0) |
|
| 1206 | + if (isset($csv_data[$this->input->post("pattern-select")]) && $csv_data[$this->input->post("pattern-select")] != '' && $i != 0) |
|
| 1207 | 1207 | { |
| 1208 | 1208 | $str = null; |
| 1209 | - $csv_data['pattern'] = ($this->input->post("pattern-prefix")) ? $this->input->post("pattern-prefix") . $csv_data[$this->input->post("pattern-select") ] : $csv_data[$this->input->post("pattern-select") ]; |
|
| 1210 | - $csv_data['cost'] = ($this->input->post("cost-select")) ? $csv_data[$this->input->post("cost-select") ] : ""; |
|
| 1211 | - $csv_data['cost'] = ($this->input->post("cost-prefix")) ? $this->input->post("cost-prefix") . $csv_data['cost'] : $csv_data['cost']; |
|
| 1212 | - $csv_data['prepend'] = ($this->input->post("prepend-select")) ? $csv_data[$this->input->post("prepend-select") ] : ""; |
|
| 1213 | - $csv_data['prepend'] = ($this->input->post("prepend-prefix")) ? $this->input->post("prepend-prefix") . $csv_data['prepend'] : $csv_data['prepend']; |
|
| 1214 | - $csv_data['comment'] = ($this->input->post("comment-select")) ? $csv_data[$this->input->post("comment-select") ] : ""; |
|
| 1215 | - $csv_data['comment'] = ($this->input->post("comment-prefix")) ? $this->input->post("comment-prefix") . $csv_data['comment'] : $csv_data['comment']; |
|
| 1216 | - $csv_data['connectcost'] = ($this->input->post("connectcost-select")) ? $csv_data[$this->input->post("connectcost-select") ] : "0"; |
|
| 1217 | - $csv_data['connectcost'] = ($this->input->post("connectcost-prefix")) ? $this->input->post("connectcost-prefix") . $csv_data['connectcost'] : $csv_data['connectcost']; |
|
| 1218 | - $csv_data['includedseconds'] = ($this->input->post("includedseconds-select")) ? $csv_data[$this->input->post("includedseconds-select") ] : "0"; |
|
| 1219 | - $csv_data['includedseconds'] = ($this->input->post("includedseconds-prefix")) ? $this->input->post("includedseconds-prefix") . $csv_data['includedseconds'] : $csv_data['includedseconds']; |
|
| 1220 | - $csv_data['inc'] = ($this->input->post("inc-select")) ? $csv_data[$this->input->post("inc-select") ] : "0"; |
|
| 1221 | - $csv_data['inc'] = ($this->input->post("inc-prefix")) ? $this->input->post("inc-prefix") . $csv_data['inc'] : $csv_data['inc']; |
|
| 1222 | - $csv_data['precedence'] = ($this->input->post("precedence-select")) ? $csv_data[$this->input->post("precedence-select") ] : ""; |
|
| 1223 | - $csv_data['precedence'] = ($this->input->post("precedence-prefix")) ? $this->input->post("precedence-prefix") . $csv_data['precedence'] : $csv_data['precedence']; |
|
| 1224 | - $csv_data['strip'] = ($this->input->post("strip-select")) ? $csv_data[$this->input->post("strip-select") ] : ""; |
|
| 1225 | - $csv_data['strip'] = ($this->input->post("strip-prefix")) ? $this->input->post("strip-prefix") . $csv_data['strip'] : $csv_data['strip']; |
|
| 1209 | + $csv_data['pattern'] = ($this->input->post("pattern-prefix")) ? $this->input->post("pattern-prefix").$csv_data[$this->input->post("pattern-select")] : $csv_data[$this->input->post("pattern-select")]; |
|
| 1210 | + $csv_data['cost'] = ($this->input->post("cost-select")) ? $csv_data[$this->input->post("cost-select")] : ""; |
|
| 1211 | + $csv_data['cost'] = ($this->input->post("cost-prefix")) ? $this->input->post("cost-prefix").$csv_data['cost'] : $csv_data['cost']; |
|
| 1212 | + $csv_data['prepend'] = ($this->input->post("prepend-select")) ? $csv_data[$this->input->post("prepend-select")] : ""; |
|
| 1213 | + $csv_data['prepend'] = ($this->input->post("prepend-prefix")) ? $this->input->post("prepend-prefix").$csv_data['prepend'] : $csv_data['prepend']; |
|
| 1214 | + $csv_data['comment'] = ($this->input->post("comment-select")) ? $csv_data[$this->input->post("comment-select")] : ""; |
|
| 1215 | + $csv_data['comment'] = ($this->input->post("comment-prefix")) ? $this->input->post("comment-prefix").$csv_data['comment'] : $csv_data['comment']; |
|
| 1216 | + $csv_data['connectcost'] = ($this->input->post("connectcost-select")) ? $csv_data[$this->input->post("connectcost-select")] : "0"; |
|
| 1217 | + $csv_data['connectcost'] = ($this->input->post("connectcost-prefix")) ? $this->input->post("connectcost-prefix").$csv_data['connectcost'] : $csv_data['connectcost']; |
|
| 1218 | + $csv_data['includedseconds'] = ($this->input->post("includedseconds-select")) ? $csv_data[$this->input->post("includedseconds-select")] : "0"; |
|
| 1219 | + $csv_data['includedseconds'] = ($this->input->post("includedseconds-prefix")) ? $this->input->post("includedseconds-prefix").$csv_data['includedseconds'] : $csv_data['includedseconds']; |
|
| 1220 | + $csv_data['inc'] = ($this->input->post("inc-select")) ? $csv_data[$this->input->post("inc-select")] : "0"; |
|
| 1221 | + $csv_data['inc'] = ($this->input->post("inc-prefix")) ? $this->input->post("inc-prefix").$csv_data['inc'] : $csv_data['inc']; |
|
| 1222 | + $csv_data['precedence'] = ($this->input->post("precedence-select")) ? $csv_data[$this->input->post("precedence-select")] : ""; |
|
| 1223 | + $csv_data['precedence'] = ($this->input->post("precedence-prefix")) ? $this->input->post("precedence-prefix").$csv_data['precedence'] : $csv_data['precedence']; |
|
| 1224 | + $csv_data['strip'] = ($this->input->post("strip-select")) ? $csv_data[$this->input->post("strip-select")] : ""; |
|
| 1225 | + $csv_data['strip'] = ($this->input->post("strip-prefix")) ? $this->input->post("strip-prefix").$csv_data['strip'] : $csv_data['strip']; |
|
| 1226 | 1226 | $csv_data['last_modified_date'] = date("Y-m-d H:i:s"); |
| 1227 | 1227 | $str = $this->data_validate($csv_data); |
| 1228 | 1228 | if ($str != "") |
@@ -1233,13 +1233,13 @@ discard block |
||
| 1233 | 1233 | else |
| 1234 | 1234 | { |
| 1235 | 1235 | $new_final_arr[$i]['trunk_id'] = $trunkID; |
| 1236 | - $new_final_arr[$i]['pattern'] = "^" . $csv_data['pattern'] . ".*"; |
|
| 1236 | + $new_final_arr[$i]['pattern'] = "^".$csv_data['pattern'].".*"; |
|
| 1237 | 1237 | $new_final_arr[$i]['prepend'] = $csv_data['prepend']; |
| 1238 | 1238 | $new_final_arr[$i]['last_modified_date'] = $csv_data['last_modified_date']; |
| 1239 | 1239 | $new_final_arr[$i]['comment'] = $csv_data['comment']; |
| 1240 | 1240 | $new_final_arr[$i]['connectcost'] = $csv_data['connectcost']; |
| 1241 | 1241 | $new_final_arr[$i]['includedseconds'] = $csv_data['includedseconds']; |
| 1242 | - $new_final_arr[$i]['cost'] = !empty($csv_data['cost']) && is_numeric($csv_data['cost']) ? $csv_data['cost'] : 0; |
|
| 1242 | + $new_final_arr[$i]['cost'] = ! empty($csv_data['cost']) && is_numeric($csv_data['cost']) ? $csv_data['cost'] : 0; |
|
| 1243 | 1243 | $new_final_arr[$i]['inc'] = isset($csv_data['inc']) ? $csv_data['inc'] : 0; |
| 1244 | 1244 | $new_final_arr[$i]['precedence'] = isset($csv_data['precedence']) ? $csv_data['precedence'] : ''; |
| 1245 | 1245 | $new_final_arr[$i]['strip'] = isset($csv_data['strip']) ? $csv_data['strip'] : ''; |
@@ -1249,7 +1249,7 @@ discard block |
||
| 1249 | 1249 | $i++; |
| 1250 | 1250 | } |
| 1251 | 1251 | |
| 1252 | - if (!empty($new_final_arr)) |
|
| 1252 | + if ( ! empty($new_final_arr)) |
|
| 1253 | 1253 | { |
| 1254 | 1254 | $result = $this->rates_model->bulk_insert_termination_rate($new_final_arr); |
| 1255 | 1255 | } |
@@ -1257,29 +1257,29 @@ discard block |
||
| 1257 | 1257 | { |
| 1258 | 1258 | |
| 1259 | 1259 | $this->session->set_flashdata('astpp_errormsg', 'Error - Nothing selected to import/process!'); |
| 1260 | - redirect(base_url() . 'rates/termination_rates_list/'); |
|
| 1260 | + redirect(base_url().'rates/termination_rates_list/'); |
|
| 1261 | 1261 | } |
| 1262 | 1262 | |
| 1263 | - unlink($full_path . $terminationrate_file_name); |
|
| 1263 | + unlink($full_path.$terminationrate_file_name); |
|
| 1264 | 1264 | $count = count($invalid_array); |
| 1265 | 1265 | if ($count > 0) |
| 1266 | 1266 | { |
| 1267 | 1267 | $session_id = "-1"; |
| 1268 | - $fp = fopen($full_path . $session_id . '.csv', 'w'); |
|
| 1269 | - foreach($new_final_arr_key as $key => $value) |
|
| 1268 | + $fp = fopen($full_path.$session_id.'.csv', 'w'); |
|
| 1269 | + foreach ($new_final_arr_key as $key => $value) |
|
| 1270 | 1270 | { |
| 1271 | 1271 | $custom_array[0][$key] = ucfirst($key); |
| 1272 | 1272 | } |
| 1273 | 1273 | |
| 1274 | 1274 | $custom_array[0]['error'] = "Error"; |
| 1275 | 1275 | $invalid_array = array_merge($custom_array, $invalid_array); |
| 1276 | - foreach($invalid_array as $err_data) |
|
| 1276 | + foreach ($invalid_array as $err_data) |
|
| 1277 | 1277 | { |
| 1278 | 1278 | fputcsv($fp, $err_data); |
| 1279 | 1279 | } |
| 1280 | 1280 | |
| 1281 | 1281 | fclose($fp); |
| 1282 | - $this->session->set_userdata('import_termination_rate_mapper_csv_error', $session_id . ".csv"); |
|
| 1282 | + $this->session->set_userdata('import_termination_rate_mapper_csv_error', $session_id.".csv"); |
|
| 1283 | 1283 | $data["error"] = $invalid_array; |
| 1284 | 1284 | $data['trunkid'] = $trunkID; |
| 1285 | 1285 | $data['impoted_count'] = count($new_final_arr); |
@@ -1289,8 +1289,8 @@ discard block |
||
| 1289 | 1289 | } |
| 1290 | 1290 | else |
| 1291 | 1291 | { |
| 1292 | - $this->session->set_flashdata('astpp_errormsg', 'Total ' . count($new_final_arr) . ' Termination rates imported successfully!'); |
|
| 1293 | - redirect(base_url() . "rates/termination_rate_list/"); |
|
| 1292 | + $this->session->set_flashdata('astpp_errormsg', 'Total '.count($new_final_arr).' Termination rates imported successfully!'); |
|
| 1293 | + redirect(base_url()."rates/termination_rate_list/"); |
|
| 1294 | 1294 | } |
| 1295 | 1295 | } |
| 1296 | 1296 | |
@@ -35,8 +35,9 @@ discard block |
||
| 35 | 35 | ini_set("memory_limit", "2048M"); |
| 36 | 36 | ini_set("max_execution_time", "259200"); |
| 37 | 37 | ini_set("upload_max_filesize", "200M"); |
| 38 | - if ($this->session->userdata('user_login') == FALSE) |
|
| 39 | - redirect(base_url() . '/astpp/login'); |
|
| 38 | + if ($this->session->userdata('user_login') == FALSE) { |
|
| 39 | + redirect(base_url() . '/astpp/login'); |
|
| 40 | + } |
|
| 40 | 41 | } |
| 41 | 42 | |
| 42 | 43 | function termination_rates_list() { |
@@ -110,18 +111,17 @@ discard block |
||
| 110 | 111 | $data['check_header']=$check_header; |
| 111 | 112 | $data['page_title'] = 'Termination Rates Preview'; |
| 112 | 113 | $this->session->set_userdata('import_termination_rate_csv',$actual_file_name); |
| 113 | - }else{ |
|
| 114 | + } else{ |
|
| 114 | 115 | $data['error'] = "File Uploading Fail Please Try Again"; |
| 115 | 116 | } |
| 116 | 117 | } |
| 117 | - } |
|
| 118 | - else{ |
|
| 118 | + } else{ |
|
| 119 | 119 | $data['error']=="File Uploading Fail Please Try Again"; |
| 120 | 120 | } |
| 121 | - }else { |
|
| 121 | + } else { |
|
| 122 | 122 | $data['error'] = "Invalid file format : Only CSV file allows to import records(Can't import empty file)"; |
| 123 | 123 | } |
| 124 | - }else{ |
|
| 124 | + } else{ |
|
| 125 | 125 | $invalid_flag=true; |
| 126 | 126 | } |
| 127 | 127 | if ($invalid_flag) { |
@@ -164,8 +164,7 @@ discard block |
||
| 164 | 164 | if($str != ""){ |
| 165 | 165 | $invalid_array[$i]=$csv_data; |
| 166 | 166 | $invalid_array[$i]['error'] = $str; |
| 167 | - } |
|
| 168 | - else{ |
|
| 167 | + } else{ |
|
| 169 | 168 | $csv_data['trunk_id']=$trunkID; |
| 170 | 169 | $csv_data['pattern'] = "^" . $csv_data['pattern'] . ".*"; |
| 171 | 170 | $new_final_arr[$i]=$csv_data; |
@@ -253,19 +252,17 @@ discard block |
||
| 253 | 252 | $data['page_title'] = "Origination Rates Preview"; |
| 254 | 253 | $data['check_header']=$check_header; |
| 255 | 254 | $this->session->set_userdata('import_origination_rate_csv',$actual_file_name); |
| 256 | - }else{ |
|
| 255 | + } else{ |
|
| 257 | 256 | $data['error'] = "File Uploading Fail Please Try Again"; |
| 258 | 257 | } |
| 259 | 258 | } |
| 260 | - } |
|
| 261 | - else{ |
|
| 259 | + } else{ |
|
| 262 | 260 | $data['error']=="File Uploading Fail Please Try Again"; |
| 263 | 261 | } |
| 264 | - } |
|
| 265 | - else { |
|
| 262 | + } else { |
|
| 266 | 263 | $data['error'] = "Invalid file format : Only CSV file allows to import records(Can't import empty file)"; |
| 267 | 264 | } |
| 268 | - }else{ |
|
| 265 | + } else{ |
|
| 269 | 266 | $invalid_flag=true; |
| 270 | 267 | } |
| 271 | 268 | if ($invalid_flag) { |
@@ -309,8 +306,7 @@ discard block |
||
| 309 | 306 | if($str != ""){ |
| 310 | 307 | $invalid_array[$i]=$csv_data; |
| 311 | 308 | $invalid_array[$i]['error'] = $str; |
| 312 | - } |
|
| 313 | - else{ |
|
| 309 | + } else{ |
|
| 314 | 310 | $csv_data['pricelist_id']=$pricelistID; |
| 315 | 311 | $csv_data['trunk_id']=$trunkid; |
| 316 | 312 | $csv_data['pattern'] = "^" . $csv_data['pattern'] . ".*"; |
@@ -372,12 +368,10 @@ discard block |
||
| 372 | 368 | $count = count($error_field); |
| 373 | 369 | $str.= $count > 1 ? ' are not valid' : ' is not Valid'; |
| 374 | 370 | return $str; |
| 375 | - } |
|
| 376 | - else{ |
|
| 371 | + } else{ |
|
| 377 | 372 | return false; |
| 378 | 373 | } |
| 379 | - } |
|
| 380 | - else{ |
|
| 374 | + } else{ |
|
| 381 | 375 | $str=rtrim($str,','); |
| 382 | 376 | $error_field=explode(',',$str); |
| 383 | 377 | $count = count($error_field); |
@@ -618,13 +612,15 @@ discard block |
||
| 618 | 612 | $where = array('accountid' => $accountid); |
| 619 | 613 | $instant_search=$this->session->userdata('left_panel_search_'.$accounttype.'_pattern'); |
| 620 | 614 | $like_str=!empty($instant_search) ? "(blocked_patterns like '%$instant_search%' OR destination like '%$instant_search%' )" :null; |
| 621 | - if(!empty($like_str)) |
|
| 622 | - $this->db->where($like_str); |
|
| 615 | + if(!empty($like_str)) { |
|
| 616 | + $this->db->where($like_str); |
|
| 617 | + } |
|
| 623 | 618 | $count_all = $this->db_model->countQuery("*", "block_patterns", $where); |
| 624 | 619 | $paging_data = $this->form->load_grid_config($count_all, $_GET['rp'], $_GET['page']); |
| 625 | 620 | $json_data = $paging_data["json_paging"]; |
| 626 | - if(!empty($like_str)) |
|
| 627 | - $this->db->where($like_str); |
|
| 621 | + if(!empty($like_str)) { |
|
| 622 | + $this->db->where($like_str); |
|
| 623 | + } |
|
| 628 | 624 | $pattern_data = $this->db_model->getSelect("*", "block_patterns", $where, "id", "ASC", $paging_data["paging"]["page_no"], $paging_data["paging"]["start"]); |
| 629 | 625 | $grid_fields = json_decode($this->rates_form->build_pattern_list_for_customer($accountid,$accounttype)); |
| 630 | 626 | $json_data['rows'] = $this->form->build_grid($pattern_data, $grid_fields); |
@@ -1059,15 +1055,20 @@ discard block |
||
| 1059 | 1055 | |
| 1060 | 1056 | function csv_to_array($filename = '', $delimiter = ',') |
| 1061 | 1057 | { |
| 1062 | - if (!file_exists($filename) || !is_readable($filename)) return FALSE; |
|
| 1058 | + if (!file_exists($filename) || !is_readable($filename)) { |
|
| 1059 | + return FALSE; |
|
| 1060 | + } |
|
| 1063 | 1061 | $header = NULL; |
| 1064 | 1062 | $data = array(); |
| 1065 | 1063 | if (($handle = fopen($filename, 'r')) !== FALSE) |
| 1066 | 1064 | { |
| 1067 | 1065 | while (($row = fgetcsv($handle, 1000, $delimiter)) !== FALSE) |
| 1068 | 1066 | { |
| 1069 | - if (!$header) $header = $row; |
|
| 1070 | - else $data[] = array_combine($header, $row); |
|
| 1067 | + if (!$header) { |
|
| 1068 | + $header = $row; |
|
| 1069 | + } else { |
|
| 1070 | + $data[] = array_combine($header, $row); |
|
| 1071 | + } |
|
| 1071 | 1072 | } |
| 1072 | 1073 | |
| 1073 | 1074 | fclose($handle); |
@@ -1131,25 +1132,21 @@ discard block |
||
| 1131 | 1132 | $data['check_header'] = $check_header; |
| 1132 | 1133 | $data['page_title'] = 'Map CSV to Termination Rates'; |
| 1133 | 1134 | $this->session->set_userdata('import_termination_rate_mapper_csv', $actual_file_name); |
| 1134 | - } |
|
| 1135 | - else |
|
| 1135 | + } else |
|
| 1136 | 1136 | { |
| 1137 | 1137 | $data['error'] = "File Uploading Fail Please Try Again"; |
| 1138 | 1138 | } |
| 1139 | 1139 | } |
| 1140 | - } |
|
| 1141 | - else |
|
| 1140 | + } else |
|
| 1142 | 1141 | { |
| 1143 | 1142 | $data['error'] == "File Uploading Fail Please Try Again"; |
| 1144 | 1143 | } |
| 1145 | - } |
|
| 1146 | - else |
|
| 1144 | + } else |
|
| 1147 | 1145 | { |
| 1148 | 1146 | $data['error'] = "Invalid file format : Only CSV file allows to import records(Can't import empty file)"; |
| 1149 | 1147 | $data['error'] = var_dump($_FILES); |
| 1150 | 1148 | } |
| 1151 | - } |
|
| 1152 | - else |
|
| 1149 | + } else |
|
| 1153 | 1150 | { |
| 1154 | 1151 | $invalid_flag = true; |
| 1155 | 1152 | } |
@@ -1229,8 +1226,7 @@ discard block |
||
| 1229 | 1226 | { |
| 1230 | 1227 | $invalid_array[$i] = $csv_data; |
| 1231 | 1228 | $invalid_array[$i]['error'] = $str; |
| 1232 | - } |
|
| 1233 | - else |
|
| 1229 | + } else |
|
| 1234 | 1230 | { |
| 1235 | 1231 | $new_final_arr[$i]['trunk_id'] = $trunkID; |
| 1236 | 1232 | $new_final_arr[$i]['pattern'] = "^" . $csv_data['pattern'] . ".*"; |
@@ -1252,8 +1248,7 @@ discard block |
||
| 1252 | 1248 | if (!empty($new_final_arr)) |
| 1253 | 1249 | { |
| 1254 | 1250 | $result = $this->rates_model->bulk_insert_termination_rate($new_final_arr); |
| 1255 | - } |
|
| 1256 | - else |
|
| 1251 | + } else |
|
| 1257 | 1252 | { |
| 1258 | 1253 | |
| 1259 | 1254 | $this->session->set_flashdata('astpp_errormsg', 'Error - Nothing selected to import/process!'); |
@@ -1286,8 +1281,7 @@ discard block |
||
| 1286 | 1281 | $data['failure_count'] = count($invalid_array) - 1; |
| 1287 | 1282 | $data['page_title'] = 'Termination Rates Import Error'; |
| 1288 | 1283 | $this->load->view('view_import_error', $data); |
| 1289 | - } |
|
| 1290 | - else |
|
| 1284 | + } else |
|
| 1291 | 1285 | { |
| 1292 | 1286 | $this->session->set_flashdata('astpp_errormsg', 'Total ' . count($new_final_arr) . ' Termination rates imported successfully!'); |
| 1293 | 1287 | redirect(base_url() . "rates/termination_rate_list/"); |
@@ -487,66 +487,66 @@ discard block |
||
| 487 | 487 | array(gettext('Account Type'), 'posttoexternal', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_account_type_search'), |
| 488 | 488 | array(gettext('Balance'), 'INPUT', array('name' => 'balance[balance]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'balance[balance-integer]', '', '', '', 'search_int_type', ''), |
| 489 | 489 | |
| 490 | - array(gettext('Credit Limit'), 'INPUT', array('name' => 'credit_limit[credit_limit]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'credit_limit[credit_limit-integer]', '', '', '', 'search_int_type', ''), |
|
| 491 | - array(gettext('Status'), 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_search_status'), |
|
| 492 | - array(gettext('Created Date'), 'INPUT', array('name' => 'creation[0]', '', 'size' => '20', 'class' => "text field", 'id' => 'creation'), '', 'tOOL TIP', '', 'creation[creation-date]'), |
|
| 493 | - array('', 'HIDDEN', 'ajax_search', '1', '', '', ''), |
|
| 494 | - array('', 'HIDDEN', 'advance_search', '1', '', '', '') |
|
| 495 | - ); |
|
| 496 | - |
|
| 497 | - $form['button_search'] = array('name' => 'action', 'id' => "account_search_btn", 'content' => gettext('Search'), 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right'); |
|
| 498 | - $form['button_reset'] = array('name' => 'action', 'id' => "id_reset", 'content' => gettext('Clear'), 'value' => 'cancel', 'type' => 'reset', 'class' => 'btn btn-line-sky pull-right margin-x-10'); |
|
| 499 | - |
|
| 500 | - return $form; |
|
| 501 | - } |
|
| 502 | - |
|
| 503 | - function get_admin_search_form() { |
|
| 504 | - $form['forms'] = array("", array('id' => "account_search")); |
|
| 505 | - $form['Search'] = array( |
|
| 506 | - array(gettext('Account'), 'INPUT', array('name' => 'number[number]', '', 'size' => '20', 'class' => "text field"), '', 'tOOL TIP', '1', 'number[number-string]', '', '', '', 'search_string_type', ''), |
|
| 507 | - array(gettext('First Name'), 'INPUT', array('name' => 'first_name[first_name]', '', 'id' => 'first_name', 'size' => '15', 'class' => "text field "), '', 'tOOL TIP', '1', 'first_name[first_name-string]', '', '', '', 'search_string_type', ''), |
|
| 508 | - array(gettext('Last Name'), 'INPUT', array('name' => 'last_name[last_name]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'last_name[last_name-string]', '', '', '', 'search_string_type', ''), |
|
| 509 | - array(gettext('Company'), 'INPUT', array('name' => 'company_name[company_name]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'company_name[company_name-string]', '', '', '', 'search_string_type', ''), |
|
| 510 | - array(gettext('Email'), 'INPUT', array('name' => 'email[email]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'email[email-string]', '', '', '', 'search_string_type', ''), |
|
| 511 | - array(gettext('Entity Type'), 'type', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_entity_type_admin'), |
|
| 512 | - array(gettext('Phone'), 'INPUT', array('name' => 'telephone_1[telephone_1]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'telephone_1[telephone_1-integer]', '', '', '', 'search_int_type', ''), |
|
| 513 | - array(gettext('Country'), 'country_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'country', 'countrycode', 'build_dropdown', '', ''), array('Status', 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_search_status'), |
|
| 514 | - array('', 'HIDDEN', 'ajax_search', '1', '', '', ''), |
|
| 515 | - array('', 'HIDDEN', 'advance_search', '1', '', '', '') |
|
| 516 | - ); |
|
| 517 | - |
|
| 518 | - $form['button_search'] = array('name' => 'action', 'id' => "account_search_btn", 'content' => gettext('Search'), 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right'); |
|
| 519 | - $form['button_reset'] = array('name' => 'action', 'id' => "id_reset", 'content' => gettext('Clear'), 'value' => 'cancel', 'type' => 'reset', 'class' => 'btn btn-line-sky pull-right margin-x-10'); |
|
| 520 | - |
|
| 521 | - return $form; |
|
| 522 | - } |
|
| 523 | - |
|
| 524 | - |
|
| 525 | - function build_account_list_for_admin() { |
|
| 526 | - // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name); |
|
| 527 | - $grid_field_arr = json_encode(array( |
|
| 528 | - array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "", "", "","","false","center"), |
|
| 529 | - array(gettext("Account"), "135", "number", "number", "accounts", "account_number_icon", "EDITABLE","true","left"), |
|
| 530 | - array(gettext("First Name"), "150", "first_name", "", "", "","","true","center"), |
|
| 531 | - array(gettext("Last Name"), "150", "last_name", "", "", "","","true","center"), |
|
| 532 | - array(gettext("Company"), "150", "company_name", "", "", "","","true","center"), |
|
| 533 | - array(gettext("Email"), "170", "email", "", "", "","","true","center"), |
|
| 534 | - array(gettext("Phone"), "150", "telephone_1", "", "", "","","true","center"), |
|
| 535 | - array(gettext("Country"), "110", "country_id", "country", "countrycode", "get_field_name","","true","center"), |
|
| 536 | - array(gettext("Status"), "110", "status", "status", "accounts", "get_status","","true","center"), |
|
| 537 | - /*******************************************************************/ |
|
| 538 | - array(gettext("Action"), "100", "", "", "", array( |
|
| 539 | - "EDIT" => array("url" => "accounts/admin_edit/", "mode" => "single"), |
|
| 540 | - "DELETE" => array("url" => "accounts/admin_delete/", "mode" => "single") |
|
| 541 | - )) |
|
| 542 | - )); |
|
| 543 | - return $grid_field_arr; |
|
| 544 | - } |
|
| 545 | - |
|
| 546 | - function build_account_list_for_customer() { |
|
| 547 | - $account_info = $accountinfo = $this->CI->session->userdata('accountinfo'); |
|
| 548 | - $currency_id=$account_info['currency_id']; |
|
| 549 | - $currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
| 490 | + array(gettext('Credit Limit'), 'INPUT', array('name' => 'credit_limit[credit_limit]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'credit_limit[credit_limit-integer]', '', '', '', 'search_int_type', ''), |
|
| 491 | + array(gettext('Status'), 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_search_status'), |
|
| 492 | + array(gettext('Created Date'), 'INPUT', array('name' => 'creation[0]', '', 'size' => '20', 'class' => "text field", 'id' => 'creation'), '', 'tOOL TIP', '', 'creation[creation-date]'), |
|
| 493 | + array('', 'HIDDEN', 'ajax_search', '1', '', '', ''), |
|
| 494 | + array('', 'HIDDEN', 'advance_search', '1', '', '', '') |
|
| 495 | + ); |
|
| 496 | + |
|
| 497 | + $form['button_search'] = array('name' => 'action', 'id' => "account_search_btn", 'content' => gettext('Search'), 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right'); |
|
| 498 | + $form['button_reset'] = array('name' => 'action', 'id' => "id_reset", 'content' => gettext('Clear'), 'value' => 'cancel', 'type' => 'reset', 'class' => 'btn btn-line-sky pull-right margin-x-10'); |
|
| 499 | + |
|
| 500 | + return $form; |
|
| 501 | + } |
|
| 502 | + |
|
| 503 | + function get_admin_search_form() { |
|
| 504 | + $form['forms'] = array("", array('id' => "account_search")); |
|
| 505 | + $form['Search'] = array( |
|
| 506 | + array(gettext('Account'), 'INPUT', array('name' => 'number[number]', '', 'size' => '20', 'class' => "text field"), '', 'tOOL TIP', '1', 'number[number-string]', '', '', '', 'search_string_type', ''), |
|
| 507 | + array(gettext('First Name'), 'INPUT', array('name' => 'first_name[first_name]', '', 'id' => 'first_name', 'size' => '15', 'class' => "text field "), '', 'tOOL TIP', '1', 'first_name[first_name-string]', '', '', '', 'search_string_type', ''), |
|
| 508 | + array(gettext('Last Name'), 'INPUT', array('name' => 'last_name[last_name]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'last_name[last_name-string]', '', '', '', 'search_string_type', ''), |
|
| 509 | + array(gettext('Company'), 'INPUT', array('name' => 'company_name[company_name]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'company_name[company_name-string]', '', '', '', 'search_string_type', ''), |
|
| 510 | + array(gettext('Email'), 'INPUT', array('name' => 'email[email]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'email[email-string]', '', '', '', 'search_string_type', ''), |
|
| 511 | + array(gettext('Entity Type'), 'type', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_entity_type_admin'), |
|
| 512 | + array(gettext('Phone'), 'INPUT', array('name' => 'telephone_1[telephone_1]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'telephone_1[telephone_1-integer]', '', '', '', 'search_int_type', ''), |
|
| 513 | + array(gettext('Country'), 'country_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'country', 'countrycode', 'build_dropdown', '', ''), array('Status', 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_search_status'), |
|
| 514 | + array('', 'HIDDEN', 'ajax_search', '1', '', '', ''), |
|
| 515 | + array('', 'HIDDEN', 'advance_search', '1', '', '', '') |
|
| 516 | + ); |
|
| 517 | + |
|
| 518 | + $form['button_search'] = array('name' => 'action', 'id' => "account_search_btn", 'content' => gettext('Search'), 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right'); |
|
| 519 | + $form['button_reset'] = array('name' => 'action', 'id' => "id_reset", 'content' => gettext('Clear'), 'value' => 'cancel', 'type' => 'reset', 'class' => 'btn btn-line-sky pull-right margin-x-10'); |
|
| 520 | + |
|
| 521 | + return $form; |
|
| 522 | + } |
|
| 523 | + |
|
| 524 | + |
|
| 525 | + function build_account_list_for_admin() { |
|
| 526 | + // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name); |
|
| 527 | + $grid_field_arr = json_encode(array( |
|
| 528 | + array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "", "", "","","false","center"), |
|
| 529 | + array(gettext("Account"), "135", "number", "number", "accounts", "account_number_icon", "EDITABLE","true","left"), |
|
| 530 | + array(gettext("First Name"), "150", "first_name", "", "", "","","true","center"), |
|
| 531 | + array(gettext("Last Name"), "150", "last_name", "", "", "","","true","center"), |
|
| 532 | + array(gettext("Company"), "150", "company_name", "", "", "","","true","center"), |
|
| 533 | + array(gettext("Email"), "170", "email", "", "", "","","true","center"), |
|
| 534 | + array(gettext("Phone"), "150", "telephone_1", "", "", "","","true","center"), |
|
| 535 | + array(gettext("Country"), "110", "country_id", "country", "countrycode", "get_field_name","","true","center"), |
|
| 536 | + array(gettext("Status"), "110", "status", "status", "accounts", "get_status","","true","center"), |
|
| 537 | + /*******************************************************************/ |
|
| 538 | + array(gettext("Action"), "100", "", "", "", array( |
|
| 539 | + "EDIT" => array("url" => "accounts/admin_edit/", "mode" => "single"), |
|
| 540 | + "DELETE" => array("url" => "accounts/admin_delete/", "mode" => "single") |
|
| 541 | + )) |
|
| 542 | + )); |
|
| 543 | + return $grid_field_arr; |
|
| 544 | + } |
|
| 545 | + |
|
| 546 | + function build_account_list_for_customer() { |
|
| 547 | + $account_info = $accountinfo = $this->CI->session->userdata('accountinfo'); |
|
| 548 | + $currency_id=$account_info['currency_id']; |
|
| 549 | + $currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
| 550 | 550 | |
| 551 | 551 | // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name); |
| 552 | 552 | $grid_field_arr = json_encode(array( |
@@ -577,118 +577,118 @@ discard block |
||
| 577 | 577 | $currency_id=$account_info['currency_id']; |
| 578 | 578 | $currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id); |
| 579 | 579 | |
| 580 | - // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name); |
|
| 581 | - $grid_field_arr = json_encode(array(array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "", "", "","","false","center"), |
|
| 582 | - array(gettext("Account"), "105", "number", "", "", "", "EDITABLE","true","center"), |
|
| 583 | - array(gettext("First Name"), "120", "first_name", "", "", "","","true","center"), |
|
| 584 | - array(gettext("Last Name"), "115", "last_name", "", "", "","","true","center"), |
|
| 585 | - array(gettext("Company"), "130", "company_name", "", "", "","","true","center"), |
|
| 586 | - array(gettext("Rate Group"), "95", "pricelist_id", "name", "pricelists", "get_field_name","","true","center"), |
|
| 587 | - array(gettext("Account Type"), "107", "posttoexternal", "posttoexternal", "posttoexternal", "get_account_type","","true","center"), |
|
| 588 | - array(gettext("Balance")." ($currency)", "100", "balance", "balance", "balance", "convert_to_currency","","true","right"), |
|
| 589 | - array(gettext("Credit Limit")." ($currency)", "120", "credit_limit", "credit_limit", "credit_limit", "convert_to_currency","","true","right"), |
|
| 590 | - array(gettext("Status"), "110", "status", "status", "accounts", "get_status","","true","center"), |
|
| 591 | - array(gettext("Created Date"), "90", "creation", "", "", "","","true","center"), |
|
| 592 | - /**************************************************************/ |
|
| 593 | - array(gettext("Action"), "139", "", "", "", array("PAYMENT" => array("url" => "accounts/customer_payment_process_add/", "mode" => "single"), |
|
| 594 | - "CALLERID" => array("url" => "accounts/customer_add_callerid/", "mode" => 'popup'), |
|
| 595 | - "EDIT" => array("url" => "accounts/reseller_edit/", "mode" => "single"), |
|
| 596 | - "DELETE" => array("url" => "accounts/reseller_delete/", "mode" => "single") |
|
| 597 | - )) |
|
| 598 | - )); |
|
| 599 | - return $grid_field_arr; |
|
| 600 | - } |
|
| 601 | - |
|
| 602 | - |
|
| 603 | - function build_grid_buttons_customer() { |
|
| 604 | - $logintype = $this->CI->session->userdata('userlevel_logintype'); |
|
| 605 | - $provider = null; |
|
| 606 | - if ($logintype != 1) |
|
| 607 | - $provider = array(gettext("Create Provider"), "btn btn-line-blue btn", "fa fa-plus-circle fa-lg", "button_action", "/accounts/provider_add/"); |
|
| 608 | - // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name); |
|
| 609 | - $buttons_json = json_encode(array( |
|
| 610 | - array(gettext("Create Customer"), "btn btn-line-warning btn", "fa fa-plus-circle fa-lg", "button_action", "/accounts/customer_add/"), |
|
| 611 | - array(gettext("Mass Create"), "btn btn-line-warning btn", "fa fa-plus-circle fa-lg", "button_action", "/accounts/customer_bulk_creation/", "popup","medium"), |
|
| 612 | - $provider, |
|
| 613 | - array(gettext("Export"), "btn btn-xing", " fa fa-download fa-lg", "button_action", "/accounts/customer_export_cdr_xls/", 'single'), |
|
| 614 | - array(gettext("Delete"), "btn btn-line-danger", "fa fa-times-circle fa-lg", "button_action", "/accounts/customer_selected_delete/") |
|
| 615 | - )); |
|
| 616 | - return $buttons_json; |
|
| 617 | - } |
|
| 618 | - |
|
| 619 | - function build_grid_buttons_admin() { |
|
| 620 | - $buttons_json = json_encode(array( |
|
| 621 | - array(gettext("Create Admin"), "btn btn-line-warning btn", "fa fa-plus-circle fa-lg", "button_action", "/accounts/admin_add/"), |
|
| 622 | - array(gettext("Create Subadmin"), "btn btn-line-warning btn", "fa fa-plus-circle fa-lg", "button_action", "/accounts/subadmin_add/4"), |
|
| 623 | - array(gettext("Delete"), "btn btn-line-danger", "fa fa-times-circle fa-lg", "button_action", "/accounts/admin_selected_delete/") |
|
| 624 | - )); |
|
| 625 | - return $buttons_json; |
|
| 626 | - } |
|
| 627 | - |
|
| 628 | - function build_grid_buttons_reseller() { |
|
| 629 | - $buttons_json = json_encode(array( |
|
| 630 | - array(gettext("Create"), "btn btn-line-warning btn", "fa fa-plus-circle fa-lg", "button_action", "/accounts/reseller_add/"), |
|
| 631 | - array(gettext("Export"), "btn btn-xing", " fa fa-download fa-lg", "button_action", "/accounts/reseller_export_cdr_xls", 'single'), |
|
| 632 | - array(gettext("Delete"), "btn btn-line-danger", "fa fa-times-circle fa-lg", "button_action", "/accounts/reseller_selected_delete/") |
|
| 633 | - )); |
|
| 634 | - return $buttons_json; |
|
| 635 | - } |
|
| 636 | - |
|
| 637 | - function build_ip_list_for_customer($accountid, $accountype) { |
|
| 638 | - $grid_field_arr = json_encode(array( |
|
| 639 | - array(gettext('Name'), "180", "name", "", "", "","","true","center"), |
|
| 640 | - array(gettext('IP'), "180", "ip", "", "", "","","true","center"), |
|
| 641 | - array(gettext('Prefix'), "180", "prefix", "", "", "","","true","center"), |
|
| 642 | - array(gettext('Created Date'), "174", "created_date", "created_date", "created_date", "convert_GMT_to","","true","center"), |
|
| 643 | - array(gettext('Modified Date'), "160", "last_modified_date", "last_modified_date", "last_modified_date", "convert_GMT_to","","true","center"), |
|
| 644 | - array(gettext('Action'), "150", "", "", "", array("DELETE" => array("url" => "accounts/" . $accountype . "_ipmap_action/delete/$accountid/$accountype/", "mode" => "single"))) |
|
| 645 | - )); |
|
| 646 | - return $grid_field_arr; |
|
| 647 | - } |
|
| 648 | - |
|
| 649 | - function build_animap_list_for_customer($accountid, $accounttype) { |
|
| 650 | - $grid_field_arr = json_encode(array( |
|
| 651 | - array(gettext("Caller ID"), "200", "number", "", "", "","","true","center"), |
|
| 652 | - array(gettext("Status"), "180", "status", "status", "ani_map", "get_status_new","","true","center"), |
|
| 653 | - array(gettext("Created Date"), "200", "creation_date", "creation_date", "creation_date", "convert_GMT_to","","true","center"), |
|
| 654 | - array(gettext("Modified Date"), "170", "last_modified_date", "last_modified_date", "last_modified_date", "convert_GMT_to","","true","center"), |
|
| 655 | - array(gettext("Action"), "200", "", "", "", array("DELETE" => array("url" => "accounts/" . $accounttype . "_animap_action/delete/$accountid/", "mode" => "single"))) |
|
| 656 | - )); |
|
| 657 | - return $grid_field_arr; |
|
| 658 | - } |
|
| 659 | - |
|
| 660 | - function build_sipiax_list_for_customer() { |
|
| 661 | - $grid_field_arr = json_encode(array(array("Tech", "150", "tech", "", "", ""), |
|
| 662 | - array(gettext("Type"), "150", "type", "", "", ""), |
|
| 663 | - array(gettext("User Name"), "150", "username", "sweep", "sweeplist", "get_field_name"), |
|
| 664 | - array(gettext("Password"), "150", "secret", "", "", ""), |
|
| 665 | - array(gettext("Context"), "150", "context", "", "", ""))); |
|
| 666 | - return $grid_field_arr; |
|
| 667 | - } |
|
| 668 | - |
|
| 669 | - function set_block_pattern_action_buttons($id) { |
|
| 670 | - $ret_url = ''; |
|
| 671 | - $ret_url .= '<a href="/did/delete/' . $id . '/" class="icon delete_image" title="Delete" onClick="return get_alert_msg();"> </a>'; |
|
| 672 | - return $ret_url; |
|
| 673 | - } |
|
| 674 | - |
|
| 675 | - function build_animap_list() { |
|
| 676 | - $grid_field_arr = json_encode(array(array("Caller ID", "180", "number", "", "", ""), |
|
| 677 | - array(gettext("status"),"180","status","status","animap","get_status"), |
|
| 678 | - array(gettext("Action"), "130", "", "", "", |
|
| 679 | - array( |
|
| 680 | - "EDIT_ANIMAP" => array("url" => "accounts/callingcards_animap_list_edit/", "mode" => "single"), |
|
| 681 | - "DELETE_ANIMAP" => array("url" => "accounts/callingcards_animap_list_remove/", "mode" => "single") |
|
| 682 | - ) |
|
| 683 | - ))); |
|
| 684 | - return $grid_field_arr; |
|
| 685 | - } |
|
| 686 | - |
|
| 687 | - function build_grid_buttons_destination() { |
|
| 688 | - $buttons_json = json_encode(array( |
|
| 689 | - )); |
|
| 690 | - return $buttons_json; |
|
| 691 | - } |
|
| 580 | + // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name); |
|
| 581 | + $grid_field_arr = json_encode(array(array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "", "", "","","false","center"), |
|
| 582 | + array(gettext("Account"), "105", "number", "", "", "", "EDITABLE","true","center"), |
|
| 583 | + array(gettext("First Name"), "120", "first_name", "", "", "","","true","center"), |
|
| 584 | + array(gettext("Last Name"), "115", "last_name", "", "", "","","true","center"), |
|
| 585 | + array(gettext("Company"), "130", "company_name", "", "", "","","true","center"), |
|
| 586 | + array(gettext("Rate Group"), "95", "pricelist_id", "name", "pricelists", "get_field_name","","true","center"), |
|
| 587 | + array(gettext("Account Type"), "107", "posttoexternal", "posttoexternal", "posttoexternal", "get_account_type","","true","center"), |
|
| 588 | + array(gettext("Balance")." ($currency)", "100", "balance", "balance", "balance", "convert_to_currency","","true","right"), |
|
| 589 | + array(gettext("Credit Limit")." ($currency)", "120", "credit_limit", "credit_limit", "credit_limit", "convert_to_currency","","true","right"), |
|
| 590 | + array(gettext("Status"), "110", "status", "status", "accounts", "get_status","","true","center"), |
|
| 591 | + array(gettext("Created Date"), "90", "creation", "", "", "","","true","center"), |
|
| 592 | + /**************************************************************/ |
|
| 593 | + array(gettext("Action"), "139", "", "", "", array("PAYMENT" => array("url" => "accounts/customer_payment_process_add/", "mode" => "single"), |
|
| 594 | + "CALLERID" => array("url" => "accounts/customer_add_callerid/", "mode" => 'popup'), |
|
| 595 | + "EDIT" => array("url" => "accounts/reseller_edit/", "mode" => "single"), |
|
| 596 | + "DELETE" => array("url" => "accounts/reseller_delete/", "mode" => "single") |
|
| 597 | + )) |
|
| 598 | + )); |
|
| 599 | + return $grid_field_arr; |
|
| 600 | + } |
|
| 601 | + |
|
| 602 | + |
|
| 603 | + function build_grid_buttons_customer() { |
|
| 604 | + $logintype = $this->CI->session->userdata('userlevel_logintype'); |
|
| 605 | + $provider = null; |
|
| 606 | + if ($logintype != 1) |
|
| 607 | + $provider = array(gettext("Create Provider"), "btn btn-line-blue btn", "fa fa-plus-circle fa-lg", "button_action", "/accounts/provider_add/"); |
|
| 608 | + // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name); |
|
| 609 | + $buttons_json = json_encode(array( |
|
| 610 | + array(gettext("Create Customer"), "btn btn-line-warning btn", "fa fa-plus-circle fa-lg", "button_action", "/accounts/customer_add/"), |
|
| 611 | + array(gettext("Mass Create"), "btn btn-line-warning btn", "fa fa-plus-circle fa-lg", "button_action", "/accounts/customer_bulk_creation/", "popup","medium"), |
|
| 612 | + $provider, |
|
| 613 | + array(gettext("Export"), "btn btn-xing", " fa fa-download fa-lg", "button_action", "/accounts/customer_export_cdr_xls/", 'single'), |
|
| 614 | + array(gettext("Delete"), "btn btn-line-danger", "fa fa-times-circle fa-lg", "button_action", "/accounts/customer_selected_delete/") |
|
| 615 | + )); |
|
| 616 | + return $buttons_json; |
|
| 617 | + } |
|
| 618 | + |
|
| 619 | + function build_grid_buttons_admin() { |
|
| 620 | + $buttons_json = json_encode(array( |
|
| 621 | + array(gettext("Create Admin"), "btn btn-line-warning btn", "fa fa-plus-circle fa-lg", "button_action", "/accounts/admin_add/"), |
|
| 622 | + array(gettext("Create Subadmin"), "btn btn-line-warning btn", "fa fa-plus-circle fa-lg", "button_action", "/accounts/subadmin_add/4"), |
|
| 623 | + array(gettext("Delete"), "btn btn-line-danger", "fa fa-times-circle fa-lg", "button_action", "/accounts/admin_selected_delete/") |
|
| 624 | + )); |
|
| 625 | + return $buttons_json; |
|
| 626 | + } |
|
| 627 | + |
|
| 628 | + function build_grid_buttons_reseller() { |
|
| 629 | + $buttons_json = json_encode(array( |
|
| 630 | + array(gettext("Create"), "btn btn-line-warning btn", "fa fa-plus-circle fa-lg", "button_action", "/accounts/reseller_add/"), |
|
| 631 | + array(gettext("Export"), "btn btn-xing", " fa fa-download fa-lg", "button_action", "/accounts/reseller_export_cdr_xls", 'single'), |
|
| 632 | + array(gettext("Delete"), "btn btn-line-danger", "fa fa-times-circle fa-lg", "button_action", "/accounts/reseller_selected_delete/") |
|
| 633 | + )); |
|
| 634 | + return $buttons_json; |
|
| 635 | + } |
|
| 636 | + |
|
| 637 | + function build_ip_list_for_customer($accountid, $accountype) { |
|
| 638 | + $grid_field_arr = json_encode(array( |
|
| 639 | + array(gettext('Name'), "180", "name", "", "", "","","true","center"), |
|
| 640 | + array(gettext('IP'), "180", "ip", "", "", "","","true","center"), |
|
| 641 | + array(gettext('Prefix'), "180", "prefix", "", "", "","","true","center"), |
|
| 642 | + array(gettext('Created Date'), "174", "created_date", "created_date", "created_date", "convert_GMT_to","","true","center"), |
|
| 643 | + array(gettext('Modified Date'), "160", "last_modified_date", "last_modified_date", "last_modified_date", "convert_GMT_to","","true","center"), |
|
| 644 | + array(gettext('Action'), "150", "", "", "", array("DELETE" => array("url" => "accounts/" . $accountype . "_ipmap_action/delete/$accountid/$accountype/", "mode" => "single"))) |
|
| 645 | + )); |
|
| 646 | + return $grid_field_arr; |
|
| 647 | + } |
|
| 648 | + |
|
| 649 | + function build_animap_list_for_customer($accountid, $accounttype) { |
|
| 650 | + $grid_field_arr = json_encode(array( |
|
| 651 | + array(gettext("Caller ID"), "200", "number", "", "", "","","true","center"), |
|
| 652 | + array(gettext("Status"), "180", "status", "status", "ani_map", "get_status_new","","true","center"), |
|
| 653 | + array(gettext("Created Date"), "200", "creation_date", "creation_date", "creation_date", "convert_GMT_to","","true","center"), |
|
| 654 | + array(gettext("Modified Date"), "170", "last_modified_date", "last_modified_date", "last_modified_date", "convert_GMT_to","","true","center"), |
|
| 655 | + array(gettext("Action"), "200", "", "", "", array("DELETE" => array("url" => "accounts/" . $accounttype . "_animap_action/delete/$accountid/", "mode" => "single"))) |
|
| 656 | + )); |
|
| 657 | + return $grid_field_arr; |
|
| 658 | + } |
|
| 659 | + |
|
| 660 | + function build_sipiax_list_for_customer() { |
|
| 661 | + $grid_field_arr = json_encode(array(array("Tech", "150", "tech", "", "", ""), |
|
| 662 | + array(gettext("Type"), "150", "type", "", "", ""), |
|
| 663 | + array(gettext("User Name"), "150", "username", "sweep", "sweeplist", "get_field_name"), |
|
| 664 | + array(gettext("Password"), "150", "secret", "", "", ""), |
|
| 665 | + array(gettext("Context"), "150", "context", "", "", ""))); |
|
| 666 | + return $grid_field_arr; |
|
| 667 | + } |
|
| 668 | + |
|
| 669 | + function set_block_pattern_action_buttons($id) { |
|
| 670 | + $ret_url = ''; |
|
| 671 | + $ret_url .= '<a href="/did/delete/' . $id . '/" class="icon delete_image" title="Delete" onClick="return get_alert_msg();"> </a>'; |
|
| 672 | + return $ret_url; |
|
| 673 | + } |
|
| 674 | + |
|
| 675 | + function build_animap_list() { |
|
| 676 | + $grid_field_arr = json_encode(array(array("Caller ID", "180", "number", "", "", ""), |
|
| 677 | + array(gettext("status"),"180","status","status","animap","get_status"), |
|
| 678 | + array(gettext("Action"), "130", "", "", "", |
|
| 679 | + array( |
|
| 680 | + "EDIT_ANIMAP" => array("url" => "accounts/callingcards_animap_list_edit/", "mode" => "single"), |
|
| 681 | + "DELETE_ANIMAP" => array("url" => "accounts/callingcards_animap_list_remove/", "mode" => "single") |
|
| 682 | + ) |
|
| 683 | + ))); |
|
| 684 | + return $grid_field_arr; |
|
| 685 | + } |
|
| 686 | + |
|
| 687 | + function build_grid_buttons_destination() { |
|
| 688 | + $buttons_json = json_encode(array( |
|
| 689 | + )); |
|
| 690 | + return $buttons_json; |
|
| 691 | + } |
|
| 692 | 692 | |
| 693 | 693 | } |
| 694 | 694 | |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 22 | 22 | ############################################################################### |
| 23 | 23 | |
| 24 | -if (!defined('BASEPATH')) |
|
| 24 | +if ( ! defined('BASEPATH')) |
|
| 25 | 25 | exit('No direct script access allowed'); |
| 26 | 26 | |
| 27 | 27 | class Accounts_form { |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | $type = $entity_type == 'customer' ? 0 : 3; |
| 37 | 37 | $uname = $this->CI->common->find_uniq_rendno_customer(common_model::$global_config['system_config']['cardlength'], 'number', 'accounts'); |
| 38 | 38 | $pin = Common_model::$global_config['system_config']['pinlength']; |
| 39 | - $pin_number=$this->CI->common->find_uniq_rendno($pin, 'pin', 'accounts'); |
|
| 39 | + $pin_number = $this->CI->common->find_uniq_rendno($pin, 'pin', 'accounts'); |
|
| 40 | 40 | $uname_user = $this->CI->common->find_uniq_rendno('10', 'number', 'accounts'); |
| 41 | 41 | $password = $this->CI->common->generate_password(); |
| 42 | 42 | $logintype = $this->CI->session->userdata('logintype'); |
@@ -48,33 +48,33 @@ discard block |
||
| 48 | 48 | } |
| 49 | 49 | $sip_device = null; |
| 50 | 50 | $opensips_device = null; |
| 51 | - if (!$entity_type) { |
|
| 51 | + if ( ! $entity_type) { |
|
| 52 | 52 | $entity_type = 'customer'; |
| 53 | 53 | } |
| 54 | - $params=array('name' => 'number', 'value' => $uname, 'size' => '20', 'class' => "text field medium", 'id' => 'number','readonly'=>true); |
|
| 54 | + $params = array('name' => 'number', 'value' => $uname, 'size' => '20', 'class' => "text field medium", 'id' => 'number', 'readonly'=>true); |
|
| 55 | 55 | |
| 56 | 56 | if ($id > 0) { |
| 57 | 57 | $readable = 'disabled'; |
| 58 | - $val = 'accounts.email.' . $id; |
|
| 59 | - $account_val='accounts.number.'.$id; |
|
| 58 | + $val = 'accounts.email.'.$id; |
|
| 59 | + $account_val = 'accounts.number.'.$id; |
|
| 60 | 60 | $password = array('Password', 'PASSWORD', array('name' => 'password', 'id' => 'password_show', 'onmouseover' => 'seetext(password_show)', 'onmouseout' => 'hidepassword(password_show)', 'size' => '20', 'class' => "text field medium"), 'required|', 'tOOL TIP', ''); |
| 61 | 61 | $balance = array('Balance', 'INPUT', array('name' => 'balance', 'size' => '20', 'readonly' => true, 'class' => "text field medium"), '', 'tOOL TIP', ''); |
| 62 | - $account=array('Account', 'INPUT',$params, 'required|integer|greater_than[0]|is_unique[' . $account_val . ']', 'tOOL TIP', ''); |
|
| 62 | + $account = array('Account', 'INPUT', $params, 'required|integer|greater_than[0]|is_unique['.$account_val.']', 'tOOL TIP', ''); |
|
| 63 | 63 | /* * ******************************** */ |
| 64 | 64 | } else { |
| 65 | 65 | $val = 'accounts.email'; |
| 66 | - $account_val='accounts.number'; |
|
| 66 | + $account_val = 'accounts.number'; |
|
| 67 | 67 | if (common_model::$global_config['system_config']['opensips'] == 0) { |
| 68 | 68 | $sip_device = array('Create Opensips Device', 'opensips_device_flag', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_prorate'); |
| 69 | 69 | } else { |
| 70 | 70 | $sip_device = array('Create SIP Device', 'sip_device_flag', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_prorate'); |
| 71 | 71 | } |
| 72 | - $account = array('Account', 'INPUT',$params, 'required|integer|greater_than[0]|is_unique[' . $account_val . ']', 'tOOL TIP', '', '<i style="cursor:pointer; font-size: 17px; padding-left:10px; padding-top:6px;color: #1bcb61;" title="Generate Account" class="change_number fa fa-refresh" ></i>'); |
|
| 72 | + $account = array('Account', 'INPUT', $params, 'required|integer|greater_than[0]|is_unique['.$account_val.']', 'tOOL TIP', '', '<i style="cursor:pointer; font-size: 17px; padding-left:10px; padding-top:6px;color: #1bcb61;" title="Generate Account" class="change_number fa fa-refresh" ></i>'); |
|
| 73 | 73 | $password = array('Password', 'INPUT', array('name' => 'password', 'value' => $password, 'size' => '20', 'class' => "text field medium", 'id' => 'password'), 'required|', 'tOOL TIP', '', '<i style="cursor:pointer; font-size: 17px; padding-left:10px; padding-top:6px;color: #1bcb61;" title="Reset Password" class="change_pass fa fa-refresh" ></i>'); |
| 74 | - $balance = array('Balance', 'INPUT', array('name' => 'balance', 'size' => '20','class' => "text field medium"), '', 'tOOL TIP', ''); |
|
| 74 | + $balance = array('Balance', 'INPUT', array('name' => 'balance', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', ''); |
|
| 75 | 75 | } |
| 76 | 76 | $pin = array('Pin', 'INPUT', array('name' => 'pin', 'value' => $pin_number, 'size' => '20', 'class' => "text field medium", 'id' => 'change_pin'), 'required|is_numeric', 'tOOL TIP', '', '<i style="cursor:pointer; font-size: 17px; padding-left:10px; padding-top:6px;color: #1bcb61;" title="Generate Pin" class="change_pin fa fa-refresh" ></i>'); |
| 77 | - $form['forms'] = array(base_url() . 'accounts/' . $entity_type . '_save/'.$id."/", array("id" => "customer_form", "name" => "customer_form")); |
|
| 77 | + $form['forms'] = array(base_url().'accounts/'.$entity_type.'_save/'.$id."/", array("id" => "customer_form", "name" => "customer_form")); |
|
| 78 | 78 | $form[gettext('Account Profile')] = array( |
| 79 | 79 | array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''), |
| 80 | 80 | array('', 'HIDDEN', array('name' => 'type', 'value' => $type), '', '', ''), |
@@ -82,16 +82,16 @@ discard block |
||
| 82 | 82 | $password, |
| 83 | 83 | $pin, |
| 84 | 84 | array(gettext('First Name'), 'INPUT', array('name' => 'first_name', 'id' => 'first_name', 'size' => '15', 'class' => "text field medium"), 'required', 'tOOL TIP', ''), |
| 85 | - array(gettext('Last Name'), 'INPUT', array('name' => 'last_name', 'size' => '15', 'class' => "text field medium"), 'trim|xss_clean', 'tOOL TIP', ''), |
|
| 85 | + array(gettext('Last Name'), 'INPUT', array('name' => 'last_name', 'size' => '15', 'class' => "text field medium"), 'trim|xss_clean', 'tOOL TIP', ''), |
|
| 86 | 86 | array(gettext('Company'), 'INPUT', array('name' => 'company_name', 'size' => '15', 'class' => 'text field medium'), 'trim|xss_clean', 'tOOL TIP', ''), |
| 87 | 87 | array(gettext('Phone'), 'INPUT', array('name' => 'telephone_1', 'size' => '15', 'class' => "text field medium"), '', 'tOOL TIP', ''), |
| 88 | 88 | array(gettext('Mobile'), 'INPUT', array('name' => 'telephone_2', 'size' => '15', 'class' => "text field medium"), '', 'tOOL TIP', ''), |
| 89 | - array(gettext('Email'), 'INPUT', array('name' => 'email', 'size' => '50', 'class' => "text field medium"), 'required|valid_email|is_unique[' . $val . ']', 'tOOL TIP', ''), |
|
| 90 | - array(gettext('Address 1'), 'INPUT', array('name' => 'address_1', 'size' => '15', 'class' => "text field medium"), '', 'tOOL TIP', ''), |
|
| 89 | + array(gettext('Email'), 'INPUT', array('name' => 'email', 'size' => '50', 'class' => "text field medium"), 'required|valid_email|is_unique['.$val.']', 'tOOL TIP', ''), |
|
| 90 | + array(gettext('Address 1'), 'INPUT', array('name' => 'address_1', 'size' => '15', 'class' => "text field medium"), '', 'tOOL TIP', ''), |
|
| 91 | 91 | array(gettext('Address 2'), 'INPUT', array('name' => 'address_2', 'size' => '15', 'class' => "text field medium"), '', 'tOOL TIP', ''), |
| 92 | - array(gettext('City'), 'INPUT', array('name' => 'city', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', ''), |
|
| 93 | - array(gettext('Province/State'), 'INPUT', array('name' => 'province', 'size' => '15', 'class' => "text field medium"), '', 'tOOL TIP', ''), |
|
| 94 | - array(gettext('Zip/Postal Code'), 'INPUT', array('name' => 'postal_code', 'size' => '15', 'class' => "text field medium"), 'trim|xss_clean', 'tOOL TIP', ''), |
|
| 92 | + array(gettext('City'), 'INPUT', array('name' => 'city', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', ''), |
|
| 93 | + array(gettext('Province/State'), 'INPUT', array('name' => 'province', 'size' => '15', 'class' => "text field medium"), '', 'tOOL TIP', ''), |
|
| 94 | + array(gettext('Zip/Postal Code'), 'INPUT', array('name' => 'postal_code', 'size' => '15', 'class' => "text field medium"), 'trim|xss_clean', 'tOOL TIP', ''), |
|
| 95 | 95 | array(gettext('Country'), array('name' => 'country_id', 'class' => 'country_id'), 'SELECT', '', array("name" => "country_id", "rules" => "required"), 'tOOL TIP', 'Please Enter account number', 'id', 'country', 'countrycode', 'build_dropdown', '', ''), |
| 96 | 96 | array(gettext('Timezone'), array('name' => 'timezone_id', 'class' => 'timezone_id'), 'SELECT', '', array("name" => "timezone_id", "rules" => "required"), 'tOOL TIP', 'Please Enter account number', 'id', 'gmtzone', 'timezone', 'build_dropdown', '', ''), |
| 97 | 97 | array(gettext('Currency'), array('name' => 'currency_id', 'class' => 'currency_id'), 'SELECT', '', array("name" => "currency_id", "rules" => "required"), 'tOOL TIP', 'Please Enter account number', 'id', 'currencyname,currency', 'currency', 'build_concat_dropdown', '', array()) |
@@ -105,9 +105,9 @@ discard block |
||
| 105 | 105 | array(gettext('Number Translation'), 'INPUT', array('name' => 'dialed_modify', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', ''), |
| 106 | 106 | array(gettext('Concurrent Calls'), 'INPUT', array('name' => 'maxchannels', 'size' => '20', 'class' => "text field medium"), 'numeric', 'tOOL TIP', ''), |
| 107 | 107 | array(gettext('Interval'), 'INPUT', array('name' => 'interval', 'size' => '20', 'class' => "text field medium"), 'numeric', 'tOOL TIP', ''), |
| 108 | - array(gettext('First Used'), 'INPUT', array('name' => 'first_used', 'size' => '20', 'readonly' => true, 'class' => "text field medium", 'value' => '0000-00-00 00:00:00'), '', 'tOOL TIP', ''), |
|
| 108 | + array(gettext('First Used'), 'INPUT', array('name' => 'first_used', 'size' => '20', 'readonly' => true, 'class' => "text field medium", 'value' => '0000-00-00 00:00:00'), '', 'tOOL TIP', ''), |
|
| 109 | 109 | array(gettext('Account Valid Days'), 'INPUT', array('name' => 'validfordays', 'size' => '20', 'class' => "text field medium"), 'trim|numeric|xss_clean', 'tOOL TIP', ''), |
| 110 | - array(gettext('Expiry Date'), 'INPUT', array('name' => 'expiry', 'size' => '20', 'class' => "text field medium", 'value' => $expiry_date, 'id' => 'expiry'), '', 'tOOL TIP', ''), |
|
| 110 | + array(gettext('Expiry Date'), 'INPUT', array('name' => 'expiry', 'size' => '20', 'class' => "text field medium", 'value' => $expiry_date, 'id' => 'expiry'), '', 'tOOL TIP', ''), |
|
| 111 | 111 | ); |
| 112 | 112 | |
| 113 | 113 | $form[gettext('Billing Settings')] = array( |
@@ -121,12 +121,12 @@ discard block |
||
| 121 | 121 | array(gettext('LC Charge / Min'), 'INPUT', array('name' => 'charge_per_min', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', ''), |
| 122 | 122 | array(gettext('Tax'), 'tax_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'taxes_description', 'taxes', 'build_dropdown', 'where_arr', array('status' => 0, "reseller_id" => $loginid), 'multi'), |
| 123 | 123 | ); |
| 124 | - if($id==0){ |
|
| 124 | + if ($id == 0) { |
|
| 125 | 125 | $form[gettext('Alert Threshold')] = array( |
| 126 | 126 | array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''), |
| 127 | 127 | array(gettext('Email Alerts ?'), 'notify_flag', 'SELECT', '', '', 'tOOL TIP', '', '', '', '', 'custom_status'), |
| 128 | - array(gettext('Balance Below'), 'INPUT', array('name' => 'notify_credit_limit', 'size' => '20', 'class' => "text field medium"), 'valid_decimal', 'tOOL TIP', ''), |
|
| 129 | - array(gettext('Email'), 'INPUT', array('name' => 'notify_email', 'size' => '50', 'class' => "text field medium"), 'valid_email', 'tOOL TIP', ''), |
|
| 128 | + array(gettext('Balance Below'), 'INPUT', array('name' => 'notify_credit_limit', 'size' => '20', 'class' => "text field medium"), 'valid_decimal', 'tOOL TIP', ''), |
|
| 129 | + array(gettext('Email'), 'INPUT', array('name' => 'notify_email', 'size' => '50', 'class' => "text field medium"), 'valid_email', 'tOOL TIP', ''), |
|
| 130 | 130 | ); |
| 131 | 131 | } |
| 132 | 132 | $form['button_save'] = array('name' => 'action', 'content' => gettext('Save'), 'value' => 'save', 'type' => 'submit', 'class' => 'btn btn-line-parrot'); |
@@ -138,12 +138,12 @@ discard block |
||
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | function customer_alert_threshold($entity_type) { |
| 141 | - $form['forms'] = array(base_url() . 'accounts/' . $entity_type . '_alert_threshold_save/' . $entity_type . "/", array("id" => "customer_alert_threshold", "name" => "customer_alert_threshold")); |
|
| 141 | + $form['forms'] = array(base_url().'accounts/'.$entity_type.'_alert_threshold_save/'.$entity_type."/", array("id" => "customer_alert_threshold", "name" => "customer_alert_threshold")); |
|
| 142 | 142 | $form[gettext('Alert Threshold')] = array( |
| 143 | 143 | array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''), |
| 144 | 144 | array(gettext('Email Alerts ?'), 'notify_flag', 'SELECT', '', '', 'tOOL TIP', '', '', '', '', 'custom_status'), |
| 145 | - array(gettext('Balance Below'), 'INPUT', array('name' => 'notify_credit_limit', 'size' => '20', 'class' => "text field medium"), 'valid_decimal', 'tOOL TIP', ''), |
|
| 146 | - array(gettext('Email'), 'INPUT', array('name' => 'notify_email', 'size' => '50', 'class' => "text field medium"), 'valid_email', 'tOOL TIP', ''), |
|
| 145 | + array(gettext('Balance Below'), 'INPUT', array('name' => 'notify_credit_limit', 'size' => '20', 'class' => "text field medium"), 'valid_decimal', 'tOOL TIP', ''), |
|
| 146 | + array(gettext('Email'), 'INPUT', array('name' => 'notify_email', 'size' => '50', 'class' => "text field medium"), 'valid_email', 'tOOL TIP', ''), |
|
| 147 | 147 | ); |
| 148 | 148 | $form['button_save'] = array('name' => 'action', 'content' => gettext('Save'), 'value' => 'save', 'type' => 'submit', 'class' => 'btn btn-line-parrot'); |
| 149 | 149 | return $form; |
@@ -164,12 +164,12 @@ discard block |
||
| 164 | 164 | $sip_device = array(gettext('Create SIP Device'), 'sip_device_flag', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'custom_status'); |
| 165 | 165 | } |
| 166 | 166 | } |
| 167 | - $form['forms'] = array(base_url() . 'accounts/customer_bulk_save/', array("id" => "customer_bulk_form", "name" => "customer_bulk_form")); |
|
| 167 | + $form['forms'] = array(base_url().'accounts/customer_bulk_save/', array("id" => "customer_bulk_form", "name" => "customer_bulk_form")); |
|
| 168 | 168 | $form[gettext('General Details')] = array( |
| 169 | - array(gettext('Account Count'), 'INPUT', array('name' => 'count', 'size' => '20', 'class' => "text field medium"), 'trim|required|numeric|xss_clean', 'tOOL TIP', ''), |
|
| 170 | - array(gettext('Start Prefix'), 'INPUT', array('name' => 'prefix', 'size' => '20', 'class' => "text field medium"), 'trim|required|numeric|xss_clean', 'tOOL TIP', ''), |
|
| 171 | - array(gettext('Acc. Number Length'), 'INPUT', array('name' => 'account_length', 'size' => '20', 'class' => "text field medium"), 'trim|required|numeric|xss_clean', 'tOOL TIP', ''), |
|
| 172 | - array(gettext('Company'), 'INPUT', array('name' => 'company_name', 'size' => '15', 'class' => 'text field medium'), 'trim|required|xss_clean', 'tOOL TIP', ''), |
|
| 169 | + array(gettext('Account Count'), 'INPUT', array('name' => 'count', 'size' => '20', 'class' => "text field medium"), 'trim|required|numeric|xss_clean', 'tOOL TIP', ''), |
|
| 170 | + array(gettext('Start Prefix'), 'INPUT', array('name' => 'prefix', 'size' => '20', 'class' => "text field medium"), 'trim|required|numeric|xss_clean', 'tOOL TIP', ''), |
|
| 171 | + array(gettext('Acc. Number Length'), 'INPUT', array('name' => 'account_length', 'size' => '20', 'class' => "text field medium"), 'trim|required|numeric|xss_clean', 'tOOL TIP', ''), |
|
| 172 | + array(gettext('Company'), 'INPUT', array('name' => 'company_name', 'size' => '15', 'class' => 'text field medium'), 'trim|required|xss_clean', 'tOOL TIP', ''), |
|
| 173 | 173 | array(gettext('Country'), array('name' => 'country_id', 'class' => 'country_id'), 'SELECT', '', array("name" => "country_id", "rules" => "required"), 'tOOL TIP', 'Please Enter account number', 'id', 'country', 'countrycode', 'build_dropdown', '', ''), |
| 174 | 174 | array(gettext('Timezone'), array('name' => 'timezone_id', 'class' => 'timezone_id'), 'SELECT', '', array("name" => "timezone_id", "rules" => "required"), 'tOOL TIP', 'Please Enter account number', 'id', 'gmtzone', 'timezone', 'build_dropdown', '', ''), |
| 175 | 175 | array(gettext('Generate Pin'), 'pin', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_pin_allow_customer'), |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | array(gettext('Billing Schedule'), array('name' => 'sweep_id', 'id' => 'sweep_id', 'class' => 'sweep_id'), 'SELECT', '', '', 'tOOL TIP', '', 'id', 'sweep', 'sweeplist', 'build_dropdown', '', ''), |
| 185 | 185 | array(gettext('Billing Day'), array("name" => 'invoice_day', "class" => "invoice_day"), 'SELECT', '', '', 'tOOL TIP', '', '', '', '', 'set_invoice_option'), |
| 186 | 186 | array(gettext('Currency'), array('name' => 'currency_id', 'class' => 'currency_id'), 'SELECT', '', array("name" => "currency_id", "rules" => "required"), 'tOOL TIP', 'Please Enter account number', 'id', 'currencyname,currency', 'currency', 'build_concat_dropdown', '', array()), |
| 187 | - array(gettext('Balance'), 'INPUT', array('name' => 'balance', 'size' => '20', 'class' => "text field medium"), 'trim|numeric|greater_than[0]|currency_decimal|xss_clean', 'tOOL TIP', ''), |
|
| 187 | + array(gettext('Balance'), 'INPUT', array('name' => 'balance', 'size' => '20', 'class' => "text field medium"), 'trim|numeric|greater_than[0]|currency_decimal|xss_clean', 'tOOL TIP', ''), |
|
| 188 | 188 | array(gettext('Credit Limit'), 'INPUT', array('name' => 'credit_limit', 'size' => '20', 'class' => "text field medium"), 'trim|currency_decimal|xss_clean', 'tOOL TIP', ''), |
| 189 | 189 | array(gettext('Valid Days'), 'INPUT', array('name' => 'validfordays', 'size' => '20', 'class' => "text field medium"), 'trim|numeric|xss_clean', 'tOOL TIP', ''), |
| 190 | 190 | array(gettext('Allow Local Calls'), 'local_call', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'custom_status'), |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | function get_customer_callerid_fields() { |
| 199 | - $form['forms'] = array(base_url() . 'accounts/customer_add_callerid/', array("id" => "callerid_form")); |
|
| 199 | + $form['forms'] = array(base_url().'accounts/customer_add_callerid/', array("id" => "callerid_form")); |
|
| 200 | 200 | $form[gettext('Information')] = array( |
| 201 | 201 | array('', 'HIDDEN', array('name' => 'flag'), '', '', '', ''), |
| 202 | 202 | array(gettext('Account'), 'INPUT', array('name' => 'accountid', 'size' => '20', 'readonly' => true, 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter account number'), |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | function get_customer_payment_fields($currency, $number, $currency_id, $id) { |
| 213 | - $form['forms'] = array(base_url() . 'accounts/customer_payment_save/', array('id' => 'acccount_charges_form', 'method' => 'POST', 'name' => 'acccount_charges_form')); |
|
| 213 | + $form['forms'] = array(base_url().'accounts/customer_payment_save/', array('id' => 'acccount_charges_form', 'method' => 'POST', 'name' => 'acccount_charges_form')); |
|
| 214 | 214 | $form['Refill information'] = array( |
| 215 | 215 | array('', 'HIDDEN', array('name' => 'id', 'value' => $id), '', '', '', ''), |
| 216 | 216 | array('', 'HIDDEN', array('name' => 'account_currency', 'value' => $currency_id), '', '', ''), |
@@ -227,11 +227,11 @@ discard block |
||
| 227 | 227 | function get_form_reseller_fields($id = false) { |
| 228 | 228 | $readable = false; |
| 229 | 229 | $invoice_config = null; |
| 230 | - $concurrent_calls=null; |
|
| 230 | + $concurrent_calls = null; |
|
| 231 | 231 | $logintype = $this->CI->session->userdata('logintype'); |
| 232 | 232 | $uname = $this->CI->common->find_uniq_rendno(common_model::$global_config['system_config']['cardlength'], 'number', 'accounts'); |
| 233 | 233 | $password = $this->CI->common->generate_password(); |
| 234 | - $params=array('name' => 'number', 'value' => $uname, 'size' => '20', 'class' => "text field medium", 'id' => 'number','readonly'=>true); |
|
| 234 | + $params = array('name' => 'number', 'value' => $uname, 'size' => '20', 'class' => "text field medium", 'id' => 'number', 'readonly'=>true); |
|
| 235 | 235 | if ($logintype == 1 || $logintype == 5) { |
| 236 | 236 | $account_data = $this->CI->session->userdata("accountinfo"); |
| 237 | 237 | $loginid = $account_data['id']; |
@@ -239,18 +239,18 @@ discard block |
||
| 239 | 239 | $loginid = "0"; |
| 240 | 240 | } |
| 241 | 241 | if ($id > 0) { |
| 242 | - $val = 'accounts.email.' . $id; |
|
| 243 | - $account_val='accounts.number.'.$id; |
|
| 242 | + $val = 'accounts.email.'.$id; |
|
| 243 | + $account_val = 'accounts.number.'.$id; |
|
| 244 | 244 | $readable = 'disabled'; |
| 245 | - $password = array('Password', 'PASSWORD', array('name' => 'password', 'id' => 'password_show', 'onmouseover' => 'seetext(password_show)', 'onmouseout' => 'hidepassword(password_show)', 'size' => '20', 'class' => "text field medium"), 'required|notMatch[number]|', 'tOOL TIP', ''); |
|
| 246 | - $concurrent_calls=array('Concurrent Calls', 'INPUT', array('name' => 'maxchannels', 'size' => '20', 'class' => "text field medium"), 'numeric', 'tOOL TIP', ''); |
|
| 247 | - $account=array('Account', 'INPUT',$params, 'required|integer|greater_than[0]|is_unique[' . $account_val . ']', 'tOOL TIP', ''); |
|
| 245 | + $password = array('Password', 'PASSWORD', array('name' => 'password', 'id' => 'password_show', 'onmouseover' => 'seetext(password_show)', 'onmouseout' => 'hidepassword(password_show)', 'size' => '20', 'class' => "text field medium"), 'required|notMatch[number]|', 'tOOL TIP', ''); |
|
| 246 | + $concurrent_calls = array('Concurrent Calls', 'INPUT', array('name' => 'maxchannels', 'size' => '20', 'class' => "text field medium"), 'numeric', 'tOOL TIP', ''); |
|
| 247 | + $account = array('Account', 'INPUT', $params, 'required|integer|greater_than[0]|is_unique['.$account_val.']', 'tOOL TIP', ''); |
|
| 248 | 248 | } else { |
| 249 | 249 | $val = 'accounts.email'; |
| 250 | - $account_val='accounts.number'; |
|
| 250 | + $account_val = 'accounts.number'; |
|
| 251 | 251 | $invoice_config = array('Use same credential for Invoice Config', 'invoice_config_flag', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_prorate'); |
| 252 | 252 | $password = array('Password', 'INPUT', array('name' => 'password', 'value' => $password, 'size' => '20', 'class' => "text field medium", 'id' => 'password'), 'required|', 'tOOL TIP', '', '<i style="cursor:pointer; font-size: 17px; padding-left:10px; padding-top:6px;color: #1bcb61;" title="Reset Password" class="change_pass fa fa-refresh" ></i>'); |
| 253 | - $account = array('Account', 'INPUT',$params, 'required|integer|greater_than[0]|is_unique[' . $account_val . ']', 'tOOL TIP', '', '<i style="cursor:pointer; font-size: 17px; padding-left:10px; padding-top:6px;color: #1bcb61;" title="Generate Account" class="change_number fa fa-refresh" ></i>'); |
|
| 253 | + $account = array('Account', 'INPUT', $params, 'required|integer|greater_than[0]|is_unique['.$account_val.']', 'tOOL TIP', '', '<i style="cursor:pointer; font-size: 17px; padding-left:10px; padding-top:6px;color: #1bcb61;" title="Generate Account" class="change_number fa fa-refresh" ></i>'); |
|
| 254 | 254 | } |
| 255 | 255 | if ($id == "") { |
| 256 | 256 | $reg_url = array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''); |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | $reg_url = array('Registration URL', 'INPUT', array('name' => 'registration_url', 'size' => '20', 'readonly' => true, 'class' => "text field medium"), 'tOOL TIP', ''); |
| 259 | 259 | } |
| 260 | 260 | /* * ****************************************************************** */ |
| 261 | - $form['forms'] = array(base_url() . 'accounts/reseller_save/', array("id" => "reseller_form", "name" => "reseller_form")); |
|
| 261 | + $form['forms'] = array(base_url().'accounts/reseller_save/', array("id" => "reseller_form", "name" => "reseller_form")); |
|
| 262 | 262 | $form['Client Panel Access'] = array( |
| 263 | 263 | array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''), |
| 264 | 264 | array('', 'HIDDEN', array('name' => 'type', 'value' => '1'), '', '', ''), |
@@ -275,12 +275,12 @@ discard block |
||
| 275 | 275 | array(gettext('Billing Day'), array("name" => 'invoice_day', "class" => "invoice_day"), 'SELECT', '', '', 'tOOL TIP', '', '', '', '', 'set_invoice_option'), |
| 276 | 276 | array(gettext('Currency'), array('name' => 'currency_id', 'class' => 'currency_id'), 'SELECT', '', array("name" => "currency_id", "rules" => "required"), 'tOOL TIP', 'Please Enter account number', 'id', 'currencyname,currency', 'currency', 'build_concat_dropdown', '', array()), |
| 277 | 277 | array(gettext('Account Type'), array('name' => 'posttoexternal', 'disabled' => $readable, 'class' => 'posttoexternal', 'id' => 'posttoexternal'), 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_account_type'), |
| 278 | - array(gettext('Credit Limit'), 'INPUT', array('name' => 'credit_limit', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', ''), |
|
| 278 | + array(gettext('Credit Limit'), 'INPUT', array('name' => 'credit_limit', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', ''), |
|
| 279 | 279 | array(gettext('Tax'), 'tax_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'taxes_description', 'taxes', 'build_dropdown', 'where_arr', array('status' => 0, 'reseller_id' => $loginid), 'multi'), |
| 280 | 280 | ); |
| 281 | 281 | |
| 282 | 282 | } |
| 283 | -else{ |
|
| 283 | +else { |
|
| 284 | 284 | $form[gettext('Billing Information')] = array( |
| 285 | 285 | array(gettext('Rate Group'), 'pricelist_id', 'SELECT', '', array("name" => "pricelist_id", 'rules' => 'required'), 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'pricelists', 'build_dropdown', 'where_arr', array("status" => "0", "reseller_id" => "0")), |
| 286 | 286 | |
@@ -288,31 +288,31 @@ discard block |
||
| 288 | 288 | array(gettext('Billing Day'), array("name" => 'invoice_day', "class" => "invoice_day"), 'SELECT', '', '', 'tOOL TIP', '', '', '', '', 'set_invoice_option'), |
| 289 | 289 | array(gettext('Currency'), array('name' => 'currency_id', 'class' => 'currency_id'), 'SELECT', '', array("name" => "currency_id", "rules" => "required"), 'tOOL TIP', 'Please Enter account number', 'id', 'currencyname,currency', 'currency', 'build_concat_dropdown', '', array()), |
| 290 | 290 | array(gettext('Account Type'), array('name' => 'posttoexternal', 'disabled' => $readable, 'class' => 'posttoexternal', 'id' => 'posttoexternal'), 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_account_type'), |
| 291 | - array(gettext('Credit Limit'), 'INPUT', array('name' => 'credit_limit', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', ''), |
|
| 291 | + array(gettext('Credit Limit'), 'INPUT', array('name' => 'credit_limit', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', ''), |
|
| 292 | 292 | array(gettext('Tax'), 'tax_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'taxes_description', 'taxes', 'build_dropdown', 'where_arr', array('status' => 0, 'reseller_id' => $loginid), 'multi'), |
| 293 | 293 | $invoice_config, |
| 294 | 294 | ); |
| 295 | 295 | } |
| 296 | 296 | $form[gettext('Reseller Profile')] = array( |
| 297 | - array(gettext('First Name'), 'INPUT', array('name' => 'first_name', 'id' => 'first_name', 'size' => '50', 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', ''), |
|
| 298 | - array(gettext('Last Name'), 'INPUT', array('name' => 'last_name', 'size' => '15', 'class' => "text field medium"), 'trim|xss_clean', 'tOOL TIP', ''), |
|
| 299 | - array(gettext('Company'), 'INPUT', array('name' => 'company_name', 'size' => '50', 'class' => 'text field medium'), 'trim|xss_clean', 'tOOL TIP', ''), |
|
| 297 | + array(gettext('First Name'), 'INPUT', array('name' => 'first_name', 'id' => 'first_name', 'size' => '50', 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', ''), |
|
| 298 | + array(gettext('Last Name'), 'INPUT', array('name' => 'last_name', 'size' => '15', 'class' => "text field medium"), 'trim|xss_clean', 'tOOL TIP', ''), |
|
| 299 | + array(gettext('Company'), 'INPUT', array('name' => 'company_name', 'size' => '50', 'class' => 'text field medium'), 'trim|xss_clean', 'tOOL TIP', ''), |
|
| 300 | 300 | array(gettext('Telephone 1'), 'INPUT', array('name' => 'telephone_1', 'size' => '15', 'class' => "text field medium"), '', 'tOOL TIP', ''), |
| 301 | 301 | array(gettext('Telephone 2'), 'INPUT', array('name' => 'telephone_2', 'size' => '15', 'class' => "text field medium"), '', 'tOOL TIP', ''), |
| 302 | - array(gettext('Email'), 'INPUT', array('name' => 'email', 'size' => '50', 'class' => "text field medium"), 'required|valid_email|is_unique[' . $val . ']', 'tOOL TIP', ''), |
|
| 302 | + array(gettext('Email'), 'INPUT', array('name' => 'email', 'size' => '50', 'class' => "text field medium"), 'required|valid_email|is_unique['.$val.']', 'tOOL TIP', ''), |
|
| 303 | 303 | array(gettext('Address 1'), 'INPUT', array('name' => 'address_1', 'size' => '15', 'class' => "text field medium"), '', 'tOOL TIP', ''), |
| 304 | - array(gettext('Address 2'), 'INPUT', array('name' => 'address_2', 'size' => '15', 'class' => "text field medium"), '', 'tOOL TIP', ''), |
|
| 304 | + array(gettext('Address 2'), 'INPUT', array('name' => 'address_2', 'size' => '15', 'class' => "text field medium"), '', 'tOOL TIP', ''), |
|
| 305 | 305 | array(gettext('City'), 'INPUT', array('name' => 'city', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', ''), |
| 306 | 306 | array(gettext('Province/State'), 'INPUT', array('name' => 'province', 'size' => '15', 'class' => "text field medium"), '', 'tOOL TIP', ''), |
| 307 | - array(gettext('Zip/Postal Code'), 'INPUT', array('name' => 'postal_code', 'size' => '15', 'class' => "text field medium"), 'trim|xss_clean', 'tOOL TIP', ''), |
|
| 307 | + array(gettext('Zip/Postal Code'), 'INPUT', array('name' => 'postal_code', 'size' => '15', 'class' => "text field medium"), 'trim|xss_clean', 'tOOL TIP', ''), |
|
| 308 | 308 | array(gettext('Country'), array('name' => 'country_id', 'class' => 'country_id'), 'SELECT', '', array("name" => "country_id", "rules" => "required"), 'tOOL TIP', 'Please Enter account number', 'id', 'country', 'countrycode', 'build_dropdown', '', ''), |
| 309 | 309 | array(gettext('Timezone'), array('name' => 'timezone_id', 'class' => 'timezone_id'), 'SELECT', '', array("name" => "timezone_id", "rules" => "required"), 'tOOL TIP', 'Please Enter account number', 'id', 'gmtzone', 'timezone', 'build_dropdown', '', ''), |
| 310 | 310 | array(gettext('Account Status'), 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_status'), |
| 311 | 311 | ); |
| 312 | - if($id==0){ |
|
| 312 | + if ($id == 0) { |
|
| 313 | 313 | $form[gettext('Alert Threshold')] = array( |
| 314 | 314 | array('Email Alert?', 'notify_flag', 'SELECT', '', '', 'tOOL TIP', '', '', '', '', 'custom_status'), |
| 315 | - array(gettext('Balance Below'), 'INPUT', array('name' => 'notify_credit_limit', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', ''), |
|
| 315 | + array(gettext('Balance Below'), 'INPUT', array('name' => 'notify_credit_limit', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', ''), |
|
| 316 | 316 | array(gettext('Email'), 'INPUT', array('name' => 'notify_email', 'size' => '50', 'class' => "text field medium"), 'valid_email', 'tOOL TIP', ''), |
| 317 | 317 | ); |
| 318 | 318 | } |
@@ -323,24 +323,24 @@ discard block |
||
| 323 | 323 | |
| 324 | 324 | function get_form_admin_fields($entity_type = '', $id = false) { |
| 325 | 325 | $uname = $this->CI->common->find_uniq_rendno(common_model::$global_config['system_config']['cardlength'], 'number', 'accounts'); |
| 326 | - $params=array('name' => 'number', 'value' => $uname, 'size' => '20', 'class' => "text field medium", 'id' => 'number','readonly'=>true); |
|
| 326 | + $params = array('name' => 'number', 'value' => $uname, 'size' => '20', 'class' => "text field medium", 'id' => 'number', 'readonly'=>true); |
|
| 327 | 327 | if ($id > 0) { |
| 328 | - $val = 'accounts.email.' . $id; |
|
| 329 | - $account_val='accounts.number.'.$id; |
|
| 330 | - $password = array('Password', 'PASSWORD', array('name' => 'password', 'id' => 'password_show', 'onmouseover' => 'seetext(password_show)', 'onmouseout' => 'hidepassword(password_show)', 'size' => '20', 'class' => "text field medium"), 'required|notMatch[number]|', 'tOOL TIP', ''); |
|
| 331 | - $account=array('Account', 'INPUT',$params, 'required|is_unique[' . $account_val . ']', 'tOOL TIP', ''); |
|
| 328 | + $val = 'accounts.email.'.$id; |
|
| 329 | + $account_val = 'accounts.number.'.$id; |
|
| 330 | + $password = array('Password', 'PASSWORD', array('name' => 'password', 'id' => 'password_show', 'onmouseover' => 'seetext(password_show)', 'onmouseout' => 'hidepassword(password_show)', 'size' => '20', 'class' => "text field medium"), 'required|notMatch[number]|', 'tOOL TIP', ''); |
|
| 331 | + $account = array('Account', 'INPUT', $params, 'required|is_unique['.$account_val.']', 'tOOL TIP', ''); |
|
| 332 | 332 | } else { |
| 333 | 333 | $val = 'accounts.email'; |
| 334 | - $account_val='accounts.number'; |
|
| 334 | + $account_val = 'accounts.number'; |
|
| 335 | 335 | $password = $this->CI->common->generate_password(); |
| 336 | - $password = array('Password', 'INPUT', array('name' => 'password', 'value' => $password, 'size' => '20','class' => "text field medium", 'id' => 'password'), 'required|', 'tOOL TIP', '', '<i style="cursor:pointer; font-size: 17px; padding-left:10px; padding-top:6px;color: #1bcb61;" title="Reset Password" class="change_pass fa fa-refresh" ></i>'); |
|
| 337 | - $account = array('Account', 'INPUT',$params, 'required|is_unique[' . $account_val . ']', 'tOOL TIP', '', '<i style="cursor:pointer; font-size: 17px; padding-left:10px; padding-top:6px;color: #1bcb61;" title="Generate Account" class="change_number fa fa-refresh" ></i>'); |
|
| 336 | + $password = array('Password', 'INPUT', array('name' => 'password', 'value' => $password, 'size' => '20', 'class' => "text field medium", 'id' => 'password'), 'required|', 'tOOL TIP', '', '<i style="cursor:pointer; font-size: 17px; padding-left:10px; padding-top:6px;color: #1bcb61;" title="Reset Password" class="change_pass fa fa-refresh" ></i>'); |
|
| 337 | + $account = array('Account', 'INPUT', $params, 'required|is_unique['.$account_val.']', 'tOOL TIP', '', '<i style="cursor:pointer; font-size: 17px; padding-left:10px; padding-top:6px;color: #1bcb61;" title="Generate Account" class="change_number fa fa-refresh" ></i>'); |
|
| 338 | 338 | /* * ****************** */ |
| 339 | 339 | } |
| 340 | 340 | |
| 341 | 341 | |
| 342 | 342 | $type = $entity_type == 'admin' ? 2 : 4; |
| 343 | - $form['forms'] = array(base_url() . 'accounts/' . $entity_type . '_save/', array("id" => "admin_form", "name" => "admin_form")); |
|
| 343 | + $form['forms'] = array(base_url().'accounts/'.$entity_type.'_save/', array("id" => "admin_form", "name" => "admin_form")); |
|
| 344 | 344 | $form['Client Panel Access'] = array( |
| 345 | 345 | array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''), |
| 346 | 346 | array('', 'HIDDEN', array('name' => 'type', 'value' => $type), '', '', ''), |
@@ -348,17 +348,17 @@ discard block |
||
| 348 | 348 | $password, |
| 349 | 349 | /* * ********************* */ |
| 350 | 350 | ); |
| 351 | - $form[gettext($entity_type . ' Profile')] = array( |
|
| 351 | + $form[gettext($entity_type.' Profile')] = array( |
|
| 352 | 352 | array(gettext('First Name'), 'INPUT', array('name' => 'first_name', 'id' => 'first_name', 'size' => '15', 'maxlength' => '40', 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', 'Please Enter account number'), |
| 353 | 353 | array(gettext('Last Name'), 'INPUT', array('name' => 'last_name', 'size' => '15', 'class' => "text field medium"), 'trim|xss_clean', 'tOOL TIP', 'Please Enter Password'), |
| 354 | - array(gettext('Company'), 'INPUT', array('name' => 'company_name', 'size' => '15', 'class' => 'text field medium'), 'trim|xss_clean', 'tOOL TIP', ''), |
|
| 355 | - array(gettext('Telephone 1'), 'INPUT', array('name' => 'telephone_1', 'size' => '15', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter Password'), |
|
| 354 | + array(gettext('Company'), 'INPUT', array('name' => 'company_name', 'size' => '15', 'class' => 'text field medium'), 'trim|xss_clean', 'tOOL TIP', ''), |
|
| 355 | + array(gettext('Telephone 1'), 'INPUT', array('name' => 'telephone_1', 'size' => '15', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter Password'), |
|
| 356 | 356 | array(gettext('Telephone 2'), 'INPUT', array('name' => 'telephone_2', 'size' => '15', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter Password'), |
| 357 | - array(gettext('Email'), 'INPUT', array('name' => 'email', 'size' => '50', 'class' => "text field medium"), 'required|valid_email|is_unique[' . $val . ']', 'tOOL TIP', ''), |
|
| 358 | - array(gettext('Address 1'), 'INPUT', array('name' => 'address_1', 'size' => '15','class' => "text field medium"), '', 'tOOL TIP', 'Please Enter Password'), |
|
| 359 | - array(gettext('Address 2'), 'INPUT', array('name' => 'address_2', 'size' => '15', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter Password'), |
|
| 357 | + array(gettext('Email'), 'INPUT', array('name' => 'email', 'size' => '50', 'class' => "text field medium"), 'required|valid_email|is_unique['.$val.']', 'tOOL TIP', ''), |
|
| 358 | + array(gettext('Address 1'), 'INPUT', array('name' => 'address_1', 'size' => '15', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter Password'), |
|
| 359 | + array(gettext('Address 2'), 'INPUT', array('name' => 'address_2', 'size' => '15', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter Password'), |
|
| 360 | 360 | array(gettext('City'), 'INPUT', array('name' => 'city', 'size' => '20', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter Password'), |
| 361 | - array(gettext('Province/State'), 'INPUT', array('name' => 'province', 'size' => '15', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter Password'), |
|
| 361 | + array(gettext('Province/State'), 'INPUT', array('name' => 'province', 'size' => '15', 'class' => "text field medium"), '', 'tOOL TIP', 'Please Enter Password'), |
|
| 362 | 362 | array(gettext('Zip/Postal Code'), 'INPUT', array('name' => 'postal_code', 'size' => '15', 'class' => "text field medium"), 'trim|xss_clean', 'tOOL TIP', 'Please Enter Password'), |
| 363 | 363 | array(gettext('Country'), array('name' => 'country_id', 'class' => 'country_id'), 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'country', 'countrycode', 'build_dropdown', '', ''), |
| 364 | 364 | array(gettext('Timezone'), array('name' => 'timezone_id', 'class' => 'timezone_id'), 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'gmtzone', 'timezone', 'build_dropdown', '', ''), |
@@ -404,7 +404,7 @@ discard block |
||
| 404 | 404 | $form['forms'] = array("accounts/customer_batch_update/", array('id' => "reseller_batch_update")); |
| 405 | 405 | $form[gettext('Batch Update')] = array( |
| 406 | 406 | array(gettext('Rate Group'), array('name' => 'pricelist_id[pricelist_id]', 'id' => 'pricelist_id'), 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'pricelists', 'build_dropdown', 'where_arr', array("status" => "0", "reseller_id" => "0"), array('name' => 'pricelist_id[operator]', 'class' => 'update_drp'), 'update_drp_type'), |
| 407 | - array(gettext('Balance'), 'INPUT', array('name' => 'balance[balance]', 'id' => 'balance', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', array('name' => 'balance[operator]', 'class' => 'update_drp'), '', '', '', 'update_int_type', ''), |
|
| 407 | + array(gettext('Balance'), 'INPUT', array('name' => 'balance[balance]', 'id' => 'balance', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', array('name' => 'balance[operator]', 'class' => 'update_drp'), '', '', '', 'update_int_type', ''), |
|
| 408 | 408 | $status, |
| 409 | 409 | ); |
| 410 | 410 | $form['button_search'] = array('name' => 'action', 'id' => "batch_update_btn", 'content' => gettext('Update'), 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right'); |
@@ -419,7 +419,7 @@ discard block |
||
| 419 | 419 | |
| 420 | 420 | function get_search_customer_form() { |
| 421 | 421 | $logintype = $this->CI->session->userdata('userlevel_logintype'); |
| 422 | - if($logintype != 1){ |
|
| 422 | + if ($logintype != 1) { |
|
| 423 | 423 | $form['forms'] = array("", array('id' => "account_search")); |
| 424 | 424 | $form[gettext('Search')] = array( |
| 425 | 425 | array(gettext('Account'), 'INPUT', array('name' => 'number[number]', '', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '1', 'number[number-string]', '', '', '', 'search_string_type', ''), |
@@ -525,15 +525,15 @@ discard block |
||
| 525 | 525 | function build_account_list_for_admin() { |
| 526 | 526 | // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name); |
| 527 | 527 | $grid_field_arr = json_encode(array( |
| 528 | - array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "", "", "","","false","center"), |
|
| 529 | - array(gettext("Account"), "135", "number", "number", "accounts", "account_number_icon", "EDITABLE","true","left"), |
|
| 530 | - array(gettext("First Name"), "150", "first_name", "", "", "","","true","center"), |
|
| 531 | - array(gettext("Last Name"), "150", "last_name", "", "", "","","true","center"), |
|
| 532 | - array(gettext("Company"), "150", "company_name", "", "", "","","true","center"), |
|
| 533 | - array(gettext("Email"), "170", "email", "", "", "","","true","center"), |
|
| 534 | - array(gettext("Phone"), "150", "telephone_1", "", "", "","","true","center"), |
|
| 535 | - array(gettext("Country"), "110", "country_id", "country", "countrycode", "get_field_name","","true","center"), |
|
| 536 | - array(gettext("Status"), "110", "status", "status", "accounts", "get_status","","true","center"), |
|
| 528 | + array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "", "", "", "", "false", "center"), |
|
| 529 | + array(gettext("Account"), "135", "number", "number", "accounts", "account_number_icon", "EDITABLE", "true", "left"), |
|
| 530 | + array(gettext("First Name"), "150", "first_name", "", "", "", "", "true", "center"), |
|
| 531 | + array(gettext("Last Name"), "150", "last_name", "", "", "", "", "true", "center"), |
|
| 532 | + array(gettext("Company"), "150", "company_name", "", "", "", "", "true", "center"), |
|
| 533 | + array(gettext("Email"), "170", "email", "", "", "", "", "true", "center"), |
|
| 534 | + array(gettext("Phone"), "150", "telephone_1", "", "", "", "", "true", "center"), |
|
| 535 | + array(gettext("Country"), "110", "country_id", "country", "countrycode", "get_field_name", "", "true", "center"), |
|
| 536 | + array(gettext("Status"), "110", "status", "status", "accounts", "get_status", "", "true", "center"), |
|
| 537 | 537 | /*******************************************************************/ |
| 538 | 538 | array(gettext("Action"), "100", "", "", "", array( |
| 539 | 539 | "EDIT" => array("url" => "accounts/admin_edit/", "mode" => "single"), |
@@ -545,24 +545,24 @@ discard block |
||
| 545 | 545 | |
| 546 | 546 | function build_account_list_for_customer() { |
| 547 | 547 | $account_info = $accountinfo = $this->CI->session->userdata('accountinfo'); |
| 548 | - $currency_id=$account_info['currency_id']; |
|
| 549 | - $currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
| 548 | + $currency_id = $account_info['currency_id']; |
|
| 549 | + $currency = $this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
| 550 | 550 | |
| 551 | 551 | // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name); |
| 552 | 552 | $grid_field_arr = json_encode(array( |
| 553 | - array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "","","","","false","center"), |
|
| 554 | - array(gettext("Account"), "125", "number", "number", "accounts", "account_number_icon", "EDITABLE","true","left"), |
|
| 555 | - array(gettext("First Name"), "95", "first_name", "", "", "","","true","center"), |
|
| 556 | - array(gettext("Last Name"), "95", "last_name", "", "", "","","true","center"), |
|
| 557 | - array(gettext("Company"), "85", "company_name", "", "", "","","true","center"), |
|
| 558 | - array(gettext("Rate Group"), "85", "pricelist_id", "name", "pricelists", "get_field_name","","true","center"), |
|
| 559 | - array(gettext("Balance")." ($currency)", "100", "balance", "balance", "balance", "convert_to_currency_account","","true","right"), |
|
| 560 | - array(gettext("Credit Limit")." ($currency)", "120", "credit_limit", "credit_limit", "credit_limit", "convert_to_currency_account","","true","right"), |
|
| 561 | - array(gettext("First Used"), "80", "first_used", "", "", "","","true","center"), |
|
| 562 | - array(gettext("Expiry Date"), "80", "expiry", "", "", "","","true","center"), |
|
| 563 | - array("CC", "45", "maxchannels", "", "", "","","true","center"), |
|
| 564 | - array(gettext("Status"), "90", "status", "status", "accounts", "get_status","","true","center"), |
|
| 565 | - array(gettext("Created Date"), "90", "creation", "", "", "","","true","center"), |
|
| 553 | + array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "", "", "", "", "false", "center"), |
|
| 554 | + array(gettext("Account"), "125", "number", "number", "accounts", "account_number_icon", "EDITABLE", "true", "left"), |
|
| 555 | + array(gettext("First Name"), "95", "first_name", "", "", "", "", "true", "center"), |
|
| 556 | + array(gettext("Last Name"), "95", "last_name", "", "", "", "", "true", "center"), |
|
| 557 | + array(gettext("Company"), "85", "company_name", "", "", "", "", "true", "center"), |
|
| 558 | + array(gettext("Rate Group"), "85", "pricelist_id", "name", "pricelists", "get_field_name", "", "true", "center"), |
|
| 559 | + array(gettext("Balance")." ($currency)", "100", "balance", "balance", "balance", "convert_to_currency_account", "", "true", "right"), |
|
| 560 | + array(gettext("Credit Limit")." ($currency)", "120", "credit_limit", "credit_limit", "credit_limit", "convert_to_currency_account", "", "true", "right"), |
|
| 561 | + array(gettext("First Used"), "80", "first_used", "", "", "", "", "true", "center"), |
|
| 562 | + array(gettext("Expiry Date"), "80", "expiry", "", "", "", "", "true", "center"), |
|
| 563 | + array("CC", "45", "maxchannels", "", "", "", "", "true", "center"), |
|
| 564 | + array(gettext("Status"), "90", "status", "status", "accounts", "get_status", "", "true", "center"), |
|
| 565 | + array(gettext("Created Date"), "90", "creation", "", "", "", "", "true", "center"), |
|
| 566 | 566 | /************************************************************************/ |
| 567 | 567 | array(gettext("Action"), "140", "", "", "", array("PAYMENT" => array("url" => "accounts/customer_payment_process_add/", "mode" => "single"), |
| 568 | 568 | "CALLERID" => array("url" => "accounts/customer_add_callerid/", "mode" => "popup"), |
@@ -574,21 +574,21 @@ discard block |
||
| 574 | 574 | |
| 575 | 575 | function build_account_list_for_reseller() { |
| 576 | 576 | $account_info = $accountinfo = $this->CI->session->userdata('accountinfo'); |
| 577 | - $currency_id=$account_info['currency_id']; |
|
| 578 | - $currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
| 577 | + $currency_id = $account_info['currency_id']; |
|
| 578 | + $currency = $this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
| 579 | 579 | |
| 580 | 580 | // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name); |
| 581 | - $grid_field_arr = json_encode(array(array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "", "", "","","false","center"), |
|
| 582 | - array(gettext("Account"), "105", "number", "", "", "", "EDITABLE","true","center"), |
|
| 583 | - array(gettext("First Name"), "120", "first_name", "", "", "","","true","center"), |
|
| 584 | - array(gettext("Last Name"), "115", "last_name", "", "", "","","true","center"), |
|
| 585 | - array(gettext("Company"), "130", "company_name", "", "", "","","true","center"), |
|
| 586 | - array(gettext("Rate Group"), "95", "pricelist_id", "name", "pricelists", "get_field_name","","true","center"), |
|
| 587 | - array(gettext("Account Type"), "107", "posttoexternal", "posttoexternal", "posttoexternal", "get_account_type","","true","center"), |
|
| 588 | - array(gettext("Balance")." ($currency)", "100", "balance", "balance", "balance", "convert_to_currency","","true","right"), |
|
| 589 | - array(gettext("Credit Limit")." ($currency)", "120", "credit_limit", "credit_limit", "credit_limit", "convert_to_currency","","true","right"), |
|
| 590 | - array(gettext("Status"), "110", "status", "status", "accounts", "get_status","","true","center"), |
|
| 591 | - array(gettext("Created Date"), "90", "creation", "", "", "","","true","center"), |
|
| 581 | + $grid_field_arr = json_encode(array(array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "", "", "", "", "false", "center"), |
|
| 582 | + array(gettext("Account"), "105", "number", "", "", "", "EDITABLE", "true", "center"), |
|
| 583 | + array(gettext("First Name"), "120", "first_name", "", "", "", "", "true", "center"), |
|
| 584 | + array(gettext("Last Name"), "115", "last_name", "", "", "", "", "true", "center"), |
|
| 585 | + array(gettext("Company"), "130", "company_name", "", "", "", "", "true", "center"), |
|
| 586 | + array(gettext("Rate Group"), "95", "pricelist_id", "name", "pricelists", "get_field_name", "", "true", "center"), |
|
| 587 | + array(gettext("Account Type"), "107", "posttoexternal", "posttoexternal", "posttoexternal", "get_account_type", "", "true", "center"), |
|
| 588 | + array(gettext("Balance")." ($currency)", "100", "balance", "balance", "balance", "convert_to_currency", "", "true", "right"), |
|
| 589 | + array(gettext("Credit Limit")." ($currency)", "120", "credit_limit", "credit_limit", "credit_limit", "convert_to_currency", "", "true", "right"), |
|
| 590 | + array(gettext("Status"), "110", "status", "status", "accounts", "get_status", "", "true", "center"), |
|
| 591 | + array(gettext("Created Date"), "90", "creation", "", "", "", "", "true", "center"), |
|
| 592 | 592 | /**************************************************************/ |
| 593 | 593 | array(gettext("Action"), "139", "", "", "", array("PAYMENT" => array("url" => "accounts/customer_payment_process_add/", "mode" => "single"), |
| 594 | 594 | "CALLERID" => array("url" => "accounts/customer_add_callerid/", "mode" => 'popup'), |
@@ -608,7 +608,7 @@ discard block |
||
| 608 | 608 | // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name); |
| 609 | 609 | $buttons_json = json_encode(array( |
| 610 | 610 | array(gettext("Create Customer"), "btn btn-line-warning btn", "fa fa-plus-circle fa-lg", "button_action", "/accounts/customer_add/"), |
| 611 | - array(gettext("Mass Create"), "btn btn-line-warning btn", "fa fa-plus-circle fa-lg", "button_action", "/accounts/customer_bulk_creation/", "popup","medium"), |
|
| 611 | + array(gettext("Mass Create"), "btn btn-line-warning btn", "fa fa-plus-circle fa-lg", "button_action", "/accounts/customer_bulk_creation/", "popup", "medium"), |
|
| 612 | 612 | $provider, |
| 613 | 613 | array(gettext("Export"), "btn btn-xing", " fa fa-download fa-lg", "button_action", "/accounts/customer_export_cdr_xls/", 'single'), |
| 614 | 614 | array(gettext("Delete"), "btn btn-line-danger", "fa fa-times-circle fa-lg", "button_action", "/accounts/customer_selected_delete/") |
@@ -636,23 +636,23 @@ discard block |
||
| 636 | 636 | |
| 637 | 637 | function build_ip_list_for_customer($accountid, $accountype) { |
| 638 | 638 | $grid_field_arr = json_encode(array( |
| 639 | - array(gettext('Name'), "180", "name", "", "", "","","true","center"), |
|
| 640 | - array(gettext('IP'), "180", "ip", "", "", "","","true","center"), |
|
| 641 | - array(gettext('Prefix'), "180", "prefix", "", "", "","","true","center"), |
|
| 642 | - array(gettext('Created Date'), "174", "created_date", "created_date", "created_date", "convert_GMT_to","","true","center"), |
|
| 643 | - array(gettext('Modified Date'), "160", "last_modified_date", "last_modified_date", "last_modified_date", "convert_GMT_to","","true","center"), |
|
| 644 | - array(gettext('Action'), "150", "", "", "", array("DELETE" => array("url" => "accounts/" . $accountype . "_ipmap_action/delete/$accountid/$accountype/", "mode" => "single"))) |
|
| 639 | + array(gettext('Name'), "180", "name", "", "", "", "", "true", "center"), |
|
| 640 | + array(gettext('IP'), "180", "ip", "", "", "", "", "true", "center"), |
|
| 641 | + array(gettext('Prefix'), "180", "prefix", "", "", "", "", "true", "center"), |
|
| 642 | + array(gettext('Created Date'), "174", "created_date", "created_date", "created_date", "convert_GMT_to", "", "true", "center"), |
|
| 643 | + array(gettext('Modified Date'), "160", "last_modified_date", "last_modified_date", "last_modified_date", "convert_GMT_to", "", "true", "center"), |
|
| 644 | + array(gettext('Action'), "150", "", "", "", array("DELETE" => array("url" => "accounts/".$accountype."_ipmap_action/delete/$accountid/$accountype/", "mode" => "single"))) |
|
| 645 | 645 | )); |
| 646 | 646 | return $grid_field_arr; |
| 647 | 647 | } |
| 648 | 648 | |
| 649 | 649 | function build_animap_list_for_customer($accountid, $accounttype) { |
| 650 | 650 | $grid_field_arr = json_encode(array( |
| 651 | - array(gettext("Caller ID"), "200", "number", "", "", "","","true","center"), |
|
| 652 | - array(gettext("Status"), "180", "status", "status", "ani_map", "get_status_new","","true","center"), |
|
| 653 | - array(gettext("Created Date"), "200", "creation_date", "creation_date", "creation_date", "convert_GMT_to","","true","center"), |
|
| 654 | - array(gettext("Modified Date"), "170", "last_modified_date", "last_modified_date", "last_modified_date", "convert_GMT_to","","true","center"), |
|
| 655 | - array(gettext("Action"), "200", "", "", "", array("DELETE" => array("url" => "accounts/" . $accounttype . "_animap_action/delete/$accountid/", "mode" => "single"))) |
|
| 651 | + array(gettext("Caller ID"), "200", "number", "", "", "", "", "true", "center"), |
|
| 652 | + array(gettext("Status"), "180", "status", "status", "ani_map", "get_status_new", "", "true", "center"), |
|
| 653 | + array(gettext("Created Date"), "200", "creation_date", "creation_date", "creation_date", "convert_GMT_to", "", "true", "center"), |
|
| 654 | + array(gettext("Modified Date"), "170", "last_modified_date", "last_modified_date", "last_modified_date", "convert_GMT_to", "", "true", "center"), |
|
| 655 | + array(gettext("Action"), "200", "", "", "", array("DELETE" => array("url" => "accounts/".$accounttype."_animap_action/delete/$accountid/", "mode" => "single"))) |
|
| 656 | 656 | )); |
| 657 | 657 | return $grid_field_arr; |
| 658 | 658 | } |
@@ -668,13 +668,13 @@ discard block |
||
| 668 | 668 | |
| 669 | 669 | function set_block_pattern_action_buttons($id) { |
| 670 | 670 | $ret_url = ''; |
| 671 | - $ret_url .= '<a href="/did/delete/' . $id . '/" class="icon delete_image" title="Delete" onClick="return get_alert_msg();"> </a>'; |
|
| 671 | + $ret_url .= '<a href="/did/delete/'.$id.'/" class="icon delete_image" title="Delete" onClick="return get_alert_msg();"> </a>'; |
|
| 672 | 672 | return $ret_url; |
| 673 | 673 | } |
| 674 | 674 | |
| 675 | 675 | function build_animap_list() { |
| 676 | 676 | $grid_field_arr = json_encode(array(array("Caller ID", "180", "number", "", "", ""), |
| 677 | - array(gettext("status"),"180","status","status","animap","get_status"), |
|
| 677 | + array(gettext("status"), "180", "status", "status", "animap", "get_status"), |
|
| 678 | 678 | array(gettext("Action"), "130", "", "", "", |
| 679 | 679 | array( |
| 680 | 680 | "EDIT_ANIMAP" => array("url" => "accounts/callingcards_animap_list_edit/", "mode" => "single"), |
@@ -21,8 +21,9 @@ discard block |
||
| 21 | 21 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 22 | 22 | ############################################################################### |
| 23 | 23 | |
| 24 | -if (!defined('BASEPATH')) |
|
| 24 | +if (!defined('BASEPATH')) { |
|
| 25 | 25 | exit('No direct script access allowed'); |
| 26 | +} |
|
| 26 | 27 | |
| 27 | 28 | class Accounts_form { |
| 28 | 29 | function __construct($library_name = '') { |
@@ -279,8 +280,7 @@ discard block |
||
| 279 | 280 | array(gettext('Tax'), 'tax_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'taxes_description', 'taxes', 'build_dropdown', 'where_arr', array('status' => 0, 'reseller_id' => $loginid), 'multi'), |
| 280 | 281 | ); |
| 281 | 282 | |
| 282 | -} |
|
| 283 | -else{ |
|
| 283 | +} else{ |
|
| 284 | 284 | $form[gettext('Billing Information')] = array( |
| 285 | 285 | array(gettext('Rate Group'), 'pricelist_id', 'SELECT', '', array("name" => "pricelist_id", 'rules' => 'required'), 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'pricelists', 'build_dropdown', 'where_arr', array("status" => "0", "reseller_id" => "0")), |
| 286 | 286 | |
@@ -442,8 +442,7 @@ discard block |
||
| 442 | 442 | array('', 'HIDDEN', 'advance_search', '1', '', '', '') |
| 443 | 443 | ); |
| 444 | 444 | |
| 445 | - } |
|
| 446 | - else |
|
| 445 | + } else |
|
| 447 | 446 | { |
| 448 | 447 | |
| 449 | 448 | $form['forms'] = array("", array('id' => "account_search")); |
@@ -603,8 +602,9 @@ discard block |
||
| 603 | 602 | function build_grid_buttons_customer() { |
| 604 | 603 | $logintype = $this->CI->session->userdata('userlevel_logintype'); |
| 605 | 604 | $provider = null; |
| 606 | - if ($logintype != 1) |
|
| 607 | - $provider = array(gettext("Create Provider"), "btn btn-line-blue btn", "fa fa-plus-circle fa-lg", "button_action", "/accounts/provider_add/"); |
|
| 605 | + if ($logintype != 1) { |
|
| 606 | + $provider = array(gettext("Create Provider"), "btn btn-line-blue btn", "fa fa-plus-circle fa-lg", "button_action", "/accounts/provider_add/"); |
|
| 607 | + } |
|
| 608 | 608 | // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name); |
| 609 | 609 | $buttons_json = json_encode(array( |
| 610 | 610 | array(gettext("Create Customer"), "btn btn-line-warning btn", "fa fa-plus-circle fa-lg", "button_action", "/accounts/customer_add/"), |