| Server IP : 103.48.194.25 / Your IP : 216.73.216.74 Web Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.33 System : Linux VMHostDefault 3.10.0-1160.42.2.el7.x86_64 #1 SMP Tue Sep 7 14:49:57 UTC 2021 x86_64 User : sieuthimay ( 1016) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/zomuaban.com/public_html/site/views/backend-old/crawl/ |
Upload File : |
<table class="table table-hover">
<thead>
<tr>
<!--th>Hình</th-->
<th>Tin đăng</th>
<th>Khu vực</th>
<th>Ngày đăng</th>
</tr>
</thead>
<tbody>
<?php foreach($list as $ad){ ?>
<tr class="ad-item" id="<?=$ad->id?>">
<!--td><img src="<?=$ad->thumb?>" style="width:80px;max-height:60px"/></td-->
<td><a class="title" href="<?=$ad->href?>"><?=$ad->title?></a> <input id="thumb" class="hidden" value="<?=$ad->thumb?>"></td>
<td><?=$ad->location?></td>
<td><?=$ad->date?></td>
</tr>
<?php } ?>
</tbody>
</table>
<script>
$(document).ready(function(){
// deactive all item has cookie
$('.ad-item').each(function(i){
var itemId = $(this).attr('id');
var hasCookie = $.cookie(itemId);
if(hasCookie){
$(this).addClass('disabled');
}
})
$('.ad-item').click(function(e){
e.preventDefault();
$('.ad-item').removeClass('active');
if($(this).hasClass('disabled')==false){
$(this).addClass('active');
$current_item = $(this);
parse_content_ad($(this));
}
})
})
parse_content_ad = function($item){
//console.log('parse content',$item.find('img').attr('src')); return;
jQuery.ajax({
type:"POST",
url:$conf.base_url('backend/crawler/ajax_parse_link_content'),
data:{ link :$item.find('a.title').attr('href'),
thumb :$item.find('#thumb').val(),
title :$item.find('a.title').text()
},
success:function(result){
var data = $.parseJSON(result);
console.log('parse complete', data);
$('.create-ad-form').animate({right:0 });
$('.create-ad-form').html(data.content);
if(data.success){
// Active nút đăng
$('#header #submit').removeClass('disabled');
}else{
// Deacive nút đăng
$('#header #submit').addClass('disabled');
}
}
});
}
</script>