$result = json_decode ( file_get_contents ( $jsonurl ), true );
if (1 == $result [‘status’]) {
$data = $result [‘data’];
$total = $data [‘total’];
$promotions = $data [‘promotions’];
echo ‘ Tổng số có ‘ . $total . ‘ khuyến mãi ‘;
echo ‘
‘;
if ($total > 0) {
$value = $promotions [0];
$title = $value [‘title’];
$content = $value [‘content’];
$description = $value [‘description’];
$id = $value [‘id’];
$aff_url = $value [‘aff_url’];
$original_url = $value [‘original_url’];
$publisher_id = ‘jacky2512’;
$aff_url = str_replace ( ‘{publisher_id}’, $publisher_id, $aff_url );
$temStr = ‘/?mo_proid=’ . $id;
$repStr = substr ( $original_url, 0, strlen ( $original_url ) – strlen ( $temStr ) );
$content = str_replace ( $repStr, $aff_url, $content );
$content = str_replace ( ‘<img ‘, ‘
echo ‘
‘;echo ‘
‘;
echo ‘
‘;
echo ‘1. ‘ . $title . ‘‘;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
echo ” . $description . ”;
echo ‘ Xem Thông Tin Chi Tiết ‘;
echo ” . $content . ”;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
}
echo ‘
‘;
echo ‘
‘;
if ($total > 1) {
$value = $promotions [1];
$title = $value [‘title’];
$content = $value [‘content’];
$description = $value [‘description’];
$id = $value [‘id’];
$aff_url = $value [‘aff_url’];
$original_url = $value [‘original_url’];
$publisher_id = ‘jacky2512’;
$aff_url = str_replace ( ‘{publisher_id}’, $publisher_id, $aff_url );
$temStr = ‘/?mo_proid=’ . $id;
$repStr = substr ( $original_url, 0, strlen ( $original_url ) – strlen ( $temStr ) );
$content = str_replace ( $repStr, $aff_url, $content );
$content = str_replace ( ‘<img ‘, ‘
echo ‘
‘;echo ‘
‘;
echo ‘
‘;
echo ‘2. ‘ . $title . ‘‘;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
echo ” . $description . ”;
echo ‘ Xem Thông Tin Chi Tiết ‘;
echo ” . $content . ”;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
}
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;echo ‘
‘;
if ($total > 2) {
$value = $promotions [2];
$title = $value [‘title’];
$content = $value [‘content’];
$description = $value [‘description’];
$id = $value [‘id’];
$aff_url = $value [‘aff_url’];
$original_url = $value [‘original_url’];
$publisher_id = ‘jacky2512’;
$aff_url = str_replace ( ‘{publisher_id}’, $publisher_id, $aff_url );
$temStr = ‘/?mo_proid=’ . $id;
$repStr = substr ( $original_url, 0, strlen ( $original_url ) – strlen ( $temStr ) );
$content = str_replace ( $repStr, $aff_url, $content );
$content = str_replace ( ‘<img ‘, ‘
echo ‘
‘;echo ‘
‘;
echo ‘
‘;
echo ‘‘;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
echo ” . $description . ”;
echo ‘ Xem Thông Tin Chi Tiết ‘;
echo ” . $content . ”;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
}
echo ‘
‘;
echo ‘
‘;
if ($total > 3) {
$value = $promotions [3];
$title = $value [‘title’];
$content = $value [‘content’];
$description = $value [‘description’];
$id = $value [‘id’];
$aff_url = $value [‘aff_url’];
$original_url = $value [‘original_url’];
$publisher_id = ‘jacky2512’;
$aff_url = str_replace ( ‘{publisher_id}’, $publisher_id, $aff_url );
$temStr = ‘/?mo_proid=’ . $id;
$repStr = substr ( $original_url, 0, strlen ( $original_url ) – strlen ( $temStr ) );
$content = str_replace ( $repStr, $aff_url, $content );
$content = str_replace ( ‘<img ‘, ‘
echo ‘
‘;echo ‘
‘;
echo ‘
‘;
echo ‘4. ‘ . $title . ‘‘;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
echo ” . $description . ”;
echo ‘ Xem Thông Tin Chi Tiết ‘;
echo ” . $content . ”;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
}
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;echo ‘
‘;
if ($total > 4) {
$value = $promotions [4];
$title = $value [‘title’];
$content = $value [‘content’];
$description = $value [‘description’];
$id = $value [‘id’];
$aff_url = $value [‘aff_url’];
$original_url = $value [‘original_url’];
$publisher_id = ‘jacky2512’;
$aff_url = str_replace ( ‘{publisher_id}’, $publisher_id, $aff_url );
$temStr = ‘/?mo_proid=’ . $id;
$repStr = substr ( $original_url, 0, strlen ( $original_url ) – strlen ( $temStr ) );
$content = str_replace ( $repStr, $aff_url, $content );
$content = str_replace ( ‘<img ‘, ‘
echo ‘
‘;echo ‘
‘;
echo ‘
‘;
echo ‘5. ‘ . $title . ‘‘;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
echo ” . $description . ”;
echo ‘ Xem Thông Tin Chi Tiết ‘;
echo ” . $content . ”;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
}
echo ‘
‘;
echo ‘
‘;
if ($total > 5) {
$value = $promotions [5];
$title = $value [‘title’];
$content = $value [‘content’];
$description = $value [‘description’];
$id = $value [‘id’];
$aff_url = $value [‘aff_url’];
$original_url = $value [‘original_url’];
$publisher_id = ‘jacky2512’;
$aff_url = str_replace ( ‘{publisher_id}’, $publisher_id, $aff_url );
$temStr = ‘/?mo_proid=’ . $id;
$repStr = substr ( $original_url, 0, strlen ( $original_url ) – strlen ( $temStr ) );
$content = str_replace ( $repStr, $aff_url, $content );
$content = str_replace ( ‘<img ‘, ‘
echo ‘
‘;echo ‘
‘;
echo ‘
‘;
echo ‘6. ‘ . $title . ‘‘;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
echo ” . $description . ”;
echo ‘ Xem Thông Tin Chi Tiết ‘;
echo ” . $content . ”;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
}
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;echo ‘
‘;
if ($total > 6) {
$value = $promotions [6];
$title = $value [‘title’];
$content = $value [‘content’];
$description = $value [‘description’];
$id = $value [‘id’];
$aff_url = $value [‘aff_url’];
$original_url = $value [‘original_url’];
$publisher_id = ‘jacky2512’;
$aff_url = str_replace ( ‘{publisher_id}’, $publisher_id, $aff_url );
$temStr = ‘/?mo_proid=’ . $id;
$repStr = substr ( $original_url, 0, strlen ( $original_url ) – strlen ( $temStr ) );
$content = str_replace ( $repStr, $aff_url, $content );
$content = str_replace ( ‘<img ‘, ‘
echo ‘
‘;echo ‘
‘;
echo ‘
‘;
echo ‘7. ‘ . $title . ‘‘;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
echo ” . $description . ”;
echo ‘ Xem Thông Tin Chi Tiết ‘;
echo ” . $content . ”;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
}
echo ‘
‘;
echo ‘
‘;
if ($total > 7) {
$value = $promotions [7];
$title = $value [‘title’];
$content = $value [‘content’];
$description = $value [‘description’];
$id = $value [‘id’];
$aff_url = $value [‘aff_url’];
$original_url = $value [‘original_url’];
$publisher_id = ‘jacky2512’;
$aff_url = str_replace ( ‘{publisher_id}’, $publisher_id, $aff_url );
$temStr = ‘/?mo_proid=’ . $id;
$repStr = substr ( $original_url, 0, strlen ( $original_url ) – strlen ( $temStr ) );
$content = str_replace ( $repStr, $aff_url, $content );
$content = str_replace ( ‘<img ‘, ‘
echo ‘
‘;echo ‘
‘;
echo ‘
‘;
echo ‘8. ‘ . $title . ‘‘;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
echo ” . $description . ”;
echo ‘ Xem Thông Tin Chi Tiết ‘;
echo ” . $content . ”;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
}
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;echo ‘
‘;
if ($total > 8) {
$value = $promotions [8];
$title = $value [‘title’];
$content = $value [‘content’];
$description = $value [‘description’];
$id = $value [‘id’];
$aff_url = $value [‘aff_url’];
$original_url = $value [‘original_url’];
$publisher_id = ‘jacky2512’;
$aff_url = str_replace ( ‘{publisher_id}’, $publisher_id, $aff_url );
$temStr = ‘/?mo_proid=’ . $id;
$repStr = substr ( $original_url, 0, strlen ( $original_url ) – strlen ( $temStr ) );
$content = str_replace ( $repStr, $aff_url, $content );
$content = str_replace ( ‘<img ‘, ‘
echo ‘
‘;echo ‘
‘;
echo ‘
‘;
echo ‘9. ‘ . $title . ‘‘;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
echo ” . $description . ”;
echo ‘ Xem Thông Tin Chi Tiết ‘;
echo ” . $content . ”;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
}
echo ‘
‘;
echo ‘
‘;
if ($total > 9) {
$value = $promotions [9];
$title = $value [‘title’];
$content = $value [‘content’];
$description = $value [‘description’];
$id = $value [‘id’];
$aff_url = $value [‘aff_url’];
$original_url = $value [‘original_url’];
$publisher_id = ‘jacky2512’;
$aff_url = str_replace ( ‘{publisher_id}’, $publisher_id, $aff_url );
$temStr = ‘/?mo_proid=’ . $id;
$repStr = substr ( $original_url, 0, strlen ( $original_url ) – strlen ( $temStr ) );
$content = str_replace ( $repStr, $aff_url, $content );
$content = str_replace ( ‘<img ‘, ‘
echo ‘
‘;echo ‘
‘;
echo ‘
‘;
echo ‘10. ‘ . $title . ‘‘;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
echo ” . $description . ”;
echo ‘ Xem Thông Tin Chi Tiết ‘;
echo ” . $content . ”;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
}
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;echo ‘
‘;
if ($total > 10) {
$value = $promotions [10];
$title = $value [‘title’];
$content = $value [‘content’];
$description = $value [‘description’];
$id = $value [‘id’];
$aff_url = $value [‘aff_url’];
$original_url = $value [‘original_url’];
$publisher_id = ‘jacky2512’;
$aff_url = str_replace ( ‘{publisher_id}’, $publisher_id, $aff_url );
$temStr = ‘/?mo_proid=’ . $id;
$repStr = substr ( $original_url, 0, strlen ( $original_url ) – strlen ( $temStr ) );
$content = str_replace ( $repStr, $aff_url, $content );
$content = str_replace ( ‘<img ‘, ‘
echo ‘
‘;echo ‘
‘;
echo ‘
‘;
echo ‘11. ‘ . $title . ‘‘;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
echo ” . $description . ”;
echo ‘ Xem Thông Tin Chi Tiết ‘;
echo ” . $content . ”;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
}
echo ‘
‘;
echo ‘
‘;
if ($total > 11) {
$value = $promotions [11];
$title = $value [‘title’];
$content = $value [‘content’];
$description = $value [‘description’];
$id = $value [‘id’];
$aff_url = $value [‘aff_url’];
$original_url = $value [‘original_url’];
$publisher_id = ‘jacky2512’;
$aff_url = str_replace ( ‘{publisher_id}’, $publisher_id, $aff_url );
$temStr = ‘/?mo_proid=’ . $id;
$repStr = substr ( $original_url, 0, strlen ( $original_url ) – strlen ( $temStr ) );
$content = str_replace ( $repStr, $aff_url, $content );
$content = str_replace ( ‘<img ‘, ‘
echo ‘
‘;echo ‘
‘;
echo ‘
‘;
echo ‘12. ‘ . $title . ‘‘;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
echo ” . $description . ”;
echo ‘ Xem Thông Tin Chi Tiết ‘;
echo ” . $content . ”;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
}
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;echo ‘
‘;
if ($total > 12) {
$value = $promotions [12];
$title = $value [‘title’];
$content = $value [‘content’];
$description = $value [‘description’];
$id = $value [‘id’];
$aff_url = $value [‘aff_url’];
$original_url = $value [‘original_url’];
$publisher_id = ‘jacky2512’;
$aff_url = str_replace ( ‘{publisher_id}’, $publisher_id, $aff_url );
$temStr = ‘/?mo_proid=’ . $id;
$repStr = substr ( $original_url, 0, strlen ( $original_url ) – strlen ( $temStr ) );
$content = str_replace ( $repStr, $aff_url, $content );
$content = str_replace ( ‘<img ‘, ‘
echo ‘
‘;echo ‘
‘;
echo ‘
‘;
echo ‘13. ‘ . $title . ‘‘;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
echo ” . $description . ”;
echo ‘ Xem Thông Tin Chi Tiết ‘;
echo ” . $content . ”;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
}
echo ‘
‘;
echo ‘
‘;
if ($total > 13) {
$value = $promotions [13];
$title = $value [‘title’];
$content = $value [‘content’];
$description = $value [‘description’];
$id = $value [‘id’];
$aff_url = $value [‘aff_url’];
$original_url = $value [‘original_url’];
$publisher_id = ‘jacky2512’;
$aff_url = str_replace ( ‘{publisher_id}’, $publisher_id, $aff_url );
$temStr = ‘/?mo_proid=’ . $id;
$repStr = substr ( $original_url, 0, strlen ( $original_url ) – strlen ( $temStr ) );
$content = str_replace ( $repStr, $aff_url, $content );
$content = str_replace ( ‘<img ‘, ‘
echo ‘
‘;echo ‘
‘;
echo ‘
‘;
echo ‘14. ‘ . $title . ‘‘;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
echo ” . $description . ”;
echo ‘ Xem Thông Tin Chi Tiết ‘;
echo ” . $content . ”;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
}
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;echo ‘
‘;
if ($total > 14) {
$value = $promotions [14];
$title = $value [‘title’];
$content = $value [‘content’];
$description = $value [‘description’];
$id = $value [‘id’];
$aff_url = $value [‘aff_url’];
$original_url = $value [‘original_url’];
$publisher_id = ‘jacky2512’;
$aff_url = str_replace ( ‘{publisher_id}’, $publisher_id, $aff_url );
$temStr = ‘/?mo_proid=’ . $id;
$repStr = substr ( $original_url, 0, strlen ( $original_url ) – strlen ( $temStr ) );
$content = str_replace ( $repStr, $aff_url, $content );
$content = str_replace ( ‘<img ‘, ‘
echo ‘
‘;echo ‘
‘;
echo ‘
‘;
echo ‘15. ‘ . $title . ‘‘;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
echo ” . $description . ”;
echo ‘ Xem Thông Tin Chi Tiết ‘;
echo ” . $content . ”;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
}
echo ‘
‘;
echo ‘
‘;
if ($total > 15) {
$value = $promotions [15];
$title = $value [‘title’];
$content = $value [‘content’];
$description = $value [‘description’];
$id = $value [‘id’];
$aff_url = $value [‘aff_url’];
$original_url = $value [‘original_url’];
$publisher_id = ‘jacky2512’;
$aff_url = str_replace ( ‘{publisher_id}’, $publisher_id, $aff_url );
$temStr = ‘/?mo_proid=’ . $id;
$repStr = substr ( $original_url, 0, strlen ( $original_url ) – strlen ( $temStr ) );
$content = str_replace ( $repStr, $aff_url, $content );
$content = str_replace ( ‘<img ‘, ‘
echo ‘
‘;echo ‘
‘;
echo ‘
‘;
echo ‘16. ‘ . $title . ‘‘;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
echo ” . $description . ”;
echo ‘ Xem Thông Tin Chi Tiết ‘;
echo ” . $content . ”;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
}
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;echo ‘
‘;
if ($total > 16) {
$value = $promotions [16];
$title = $value [‘title’];
$content = $value [‘content’];
$description = $value [‘description’];
$id = $value [‘id’];
$aff_url = $value [‘aff_url’];
$original_url = $value [‘original_url’];
$publisher_id = ‘jacky2512’;
$aff_url = str_replace ( ‘{publisher_id}’, $publisher_id, $aff_url );
$temStr = ‘/?mo_proid=’ . $id;
$repStr = substr ( $original_url, 0, strlen ( $original_url ) – strlen ( $temStr ) );
$content = str_replace ( $repStr, $aff_url, $content );
$content = str_replace ( ‘<img ‘, ‘
echo ‘
‘;echo ‘
‘;
echo ‘
‘;
echo ‘17. ‘ . $title . ‘‘;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
echo ” . $description . ”;
echo ‘ Xem Thông Tin Chi Tiết ‘;
echo ” . $content . ”;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
}
echo ‘
‘;
echo ‘
‘;
if ($total > 17) {
$value = $promotions [17];
$title = $value [‘title’];
$content = $value [‘content’];
$description = $value [‘description’];
$id = $value [‘id’];
$aff_url = $value [‘aff_url’];
$original_url = $value [‘original_url’];
$publisher_id = ‘jacky2512’;
$aff_url = str_replace ( ‘{publisher_id}’, $publisher_id, $aff_url );
$temStr = ‘/?mo_proid=’ . $id;
$repStr = substr ( $original_url, 0, strlen ( $original_url ) – strlen ( $temStr ) );
$content = str_replace ( $repStr, $aff_url, $content );
$content = str_replace ( ‘<img ‘, ‘
echo ‘
‘;echo ‘
‘;
echo ‘
‘;
echo ‘18. ‘ . $title . ‘‘;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
echo ” . $description . ”;
echo ‘ Xem Thông Tin Chi Tiết ‘;
echo ” . $content . ”;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
}
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;echo ‘
‘;
if ($total > 18) {
$value = $promotions [18];
$title = $value [‘title’];
$content = $value [‘content’];
$description = $value [‘description’];
$id = $value [‘id’];
$aff_url = $value [‘aff_url’];
$original_url = $value [‘original_url’];
$publisher_id = ‘jacky2512’;
$aff_url = str_replace ( ‘{publisher_id}’, $publisher_id, $aff_url );
$temStr = ‘/?mo_proid=’ . $id;
$repStr = substr ( $original_url, 0, strlen ( $original_url ) – strlen ( $temStr ) );
$content = str_replace ( $repStr, $aff_url, $content );
$content = str_replace ( ‘<img ‘, ‘
echo ‘
‘;echo ‘
‘;
echo ‘
‘;
echo ‘19. ‘ . $title . ‘‘;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
echo ” . $description . ”;
echo ‘ Xem Thông Tin Chi Tiết ‘;
echo ” . $content . ”;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
}
echo ‘
‘;
echo ‘
‘;
if ($total > 19) {
$value = $promotions [19];
$title = $value [‘title’];
$content = $value [‘content’];
$description = $value [‘description’];
$id = $value [‘id’];
$aff_url = $value [‘aff_url’];
$original_url = $value [‘original_url’];
$publisher_id = ‘jacky2512’;
$aff_url = str_replace ( ‘{publisher_id}’, $publisher_id, $aff_url );
$temStr = ‘/?mo_proid=’ . $id;
$repStr = substr ( $original_url, 0, strlen ( $original_url ) – strlen ( $temStr ) );
$content = str_replace ( $repStr, $aff_url, $content );
$content = str_replace ( ‘<img ‘, ‘
echo ‘
‘;echo ‘
‘;
echo ‘
‘;
echo ‘20. ‘ . $title . ‘‘;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
echo ” . $description . ”;
echo ‘ Xem Thông Tin Chi Tiết ‘;
echo ” . $content . ”;
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
}
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
} else {
echo ‘Không có khuyên mãi’;
}
[/insert_php]