<tr> <td colspan="3"><div class="error" id="err_div" style="display:none;"></div></td> </tr> <tr> <td colspan="3"><div class="success" id="success_div" <?php if($this->session->flashdata('success') == '') { echo 'style="display:none;"'; }?>><?php echo $this->session->flashdata('success');?></div></td> </tr> <tr> <td align="center" height="20" colspan="3"> <table cellspacing="0" cellpadding="0" border="0" width="95%" class="search_col"> <thead> <?php $used_sip_acc_count = restricted_customer_sip_acc_count($customer_id); $limit_of_sip_acc = customer_access_any_cell($customer_id, 'total_sip_accounts'); $remaining = $limit_of_sip_acc - $used_sip_acc_count; if($used_sip_acc_count < $limit_of_sip_acc) { ?> <tr class="main_text" style="background:none;"> <td align="right" colspan="6"> <a href="<?php echo base_url();?>customer/new_sip_access">NEW SIP ACCESS</a> <br/> You can add upto <?php echo $limit_of_sip_acc;?> SIP Accounts (<?php echo $remaining;?> Remaining) </td> </tr> <?php } else {?> <tr class="main_text" style="background:none;">
function new_sip_access() { $customer_id = $this->session->userdata('customer_id'); $used_sip_acc_count = restricted_customer_sip_acc_count($customer_id); $limit_of_sip_acc = customer_access_any_cell($customer_id, 'total_sip_accounts'); if($used_sip_acc_count < $limit_of_sip_acc) { $check = 0; do { $username = rand(1,999).rand(1,999); $check_username_existis = $this->customer_model->check_sip_username_existis($username); if($check_username_existis == 0) { $check = 1; } } while ($check == 0); $data['customer_id'] = $customer_id; $data['username'] = $username; $data['password'] = rand(1,999).rand(1,999).rand(1,99); $data['page_name'] = 'new_sip_access'; $data['selected'] = 'sip_access'; $data['sub_selected'] = ''; $data['page_title'] = 'NEW SIP CREDENTIALS'; $data['main_menu'] = ''; $data['sub_menu'] = ''; $data['main_content'] = 'reseller/reseller_info/new_sip_view'; $data['dont_show_this'] = 1; $this->load->view('default/template',$data); } else { redirect ('customer/sip_access'); } }