Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function(form) {
- var select = form.find('[name=mt_mt_to_pseudo]');
- console.log(form, select);
- var pseudoTable = $('#pseudo_rates tbody');
- var r=[];
- var phones = SMSKA.siteMaster.getBillingUrlOptions(); phones = phones[0];console.log('phones=',phones);
- pseudoTable.find('tr:gt(0)').each(function() {
- var row = $(this), dataTd = row.find('td:first');
- var schemaId = $.trim(dataTd.find('[name^=outpseudo_subscription_id]').val());
- if (schemaId === '') {
- schemaId = 'NEW';
- }
- var pi = parseInt($.trim(pseudoTable.find('[name^=outpseudo_initial_number]').val()));
- var str = '#' + schemaId + ' (' + phones[pi] + ' &rarr ';
- var authCount = parseInt($.trim(dataTd.find('[name^=outpseudo_authorized_count]').val()));
- if (authCount<1 || authCount>3) { throw 'parsing error - pseudo authority number for #' + schemaId; }
- if (authCount >= 1) { pi = parseInt($.trim(dataTd.find('[name^=outpseudo_success_number]').val())); str+= phones[pi]; }
- if (authCount >= 2) { pi = parseInt($.trim(dataTd.find('[name^=outpseudo_response_number_1]').val())); str+= ', ' + phones[pi]; }
- if (authCount == 3) { pi = parseInt($.trim(dataTd.find('[name^=outpseudo_response_number_2]').val())); str+= ', ' + phones[pi] }
- r.push(str + ')');
- });
- return r;
- })($('#ctrl_mt_addEdit'))
Advertisement
Add Comment
Please, Sign In to add comment