Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getAmoCallerData(mess, callback) {
- var text = '',
- dataS = {};
- $.get('//' + window.location.host + '/private/api/contact_search.php?SEARCH=' + mess.calleridnum,
- function(res) {
- dataS.id = $(res).find('contact > id').eq(0).text();
- dataS.name = $(res).find('contact > name').eq(0).text();
- dataS.company = $(res).find('contact > company > name').eq(0).text();
- callback(dataS, mess);
- if (dataS.id == '') {
- console.log('1');
- text = 'Вам звонит новый клиент ' + mess.calleridnum + '<br><a href="/contacts/add/?phone=' + mess.calleridnum + '" class="js-navigate-link notification-call-link">Добавить контакт</a>';
- } else if (dataS.company == '') {
- console.log('2');
- text = 'Вам звонит ' + dataS.name + '<br><a href="/contacts/detail/?phone=' + mess.calleridnum + '" class="js-navigate-link notification-call-link">Открыть контакт</a>';
- } else {
- console.log('3');
- text = 'Вам звонит ' + dataS.name + '<br>из компании ' + dataS.company + '<br><a href="/contacts/detail/?phone=' + mess.calleridnum + '" class="js-navigate-link notification-call-link">Открыть контакт</a>'
- }
- // console.log(status);
- })
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement