<!DOCTYPE html>
<html lang="id">
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<head>
        <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    
    <TITLE><?= $db->config("title"); ?></TITLE>
<META NAME="Keywords" content="<?= $db->config("keyword"); ?>">
<META NAME="Description" content="<?= $db->config("description"); ?>">
    <meta name="author" content="" />
    <link rel="shortcut icon" href="templates/bootstrap2-responsive/assets/img/favicon.html" type="image/png" />
    <link rel="image_src" href="templates/bootstrap2-responsive/assets/img/logo.html" />
    
    <link rel="alternate" type="application/rss+xml" title="RSS" href="indexc0c0.php?/api/rss/id" />
    
        <meta property="og:image" content="templates/bootstrap2-responsive/assets/img/logo-transparent-og.html" />
        
    
    <!-- Le styles -->
    <link href="templates/bootstrap2-responsive/assets/css/bootstrap.min.css" rel="stylesheet">
    
        <link href="templates/bootstrap2-responsive/assets/css/bootstrap-responsive.min.css" rel="stylesheet">
    
    <link href="templates/bootstrap2-responsive/assets/css/styles.css" rel="stylesheet">
    
        <link href="templates/bootstrap2-responsive/assets/css/enable-responsive.css" rel="stylesheet">
        
    <link href="templates/bootstrap2-responsive/assets/css/bootstrap-select.min.css" rel="stylesheet">
    <link href="templates/bootstrap2-responsive/assets/css/blueimp-gallery.min.css" rel="stylesheet">
    <link href="templates/bootstrap2-responsive/assets/css/jquery.cleditor.css" rel="stylesheet">
    <link href="templates/bootstrap2-responsive/assets/css/bootstrap-datetimepicker.min.css" rel="stylesheet">
    
    
    <link href="templates/bootstrap2-responsive/assets/css/styles_red.css" rel="stylesheet">
    
    
            
    <link href="templates/bootstrap2-responsive/assets/css/custom.css" rel="stylesheet">
    
    
    <script src="templates/bootstrap2-responsive/assets/js/jquery-1.8.3.min.js" type="text/javascript"></script>
    <script src="templates/bootstrap2-responsive/assets/js/bootstrap.min.js"></script>
    <script src="templates/bootstrap2-responsive/assets/js/gmap3.js"></script>
    <script src="templates/bootstrap2-responsive/assets/js/bootstrap-select.js"></script>
    <script src="templates/bootstrap2-responsive/assets/js/bootstrap-datetimepicker.min.js"></script>
    <script src="templates/bootstrap2-responsive/assets/js/blueimp-gallery.min.js"></script>
    <script src="templates/bootstrap2-responsive/assets/js/jquery.helpers.js"></script>
    <script src="templates/bootstrap2-responsive/assets/js/jquery.placeholder.min.js"></script>
    
    <script type="text/javascript" src="templates/bootstrap2-responsive/assets/js/jquery.number.js"></script>
    <script type="text/javascript" src="templates/bootstrap2-responsive/assets/js/jquery.h5validate.js"></script>
    
        <script src="templates/bootstrap2-responsive/assets/js/dpejes/dpe.js"></script>
        
    
    
    
    
        
        
        
    <script src="templates/bootstrap2-responsive/assets/js/jquery.custom.js"></script>
    
    <script language="javascript">
        
        var timerMap;
        var ad_galleries;
        var firstSet = false;
        var mapRefresh = true;
        var loadOnTab = true;
        var zoomOnMapSearch = 9;
        var clusterConfig = null;
        var markerOptions = null;
        var mapDisableAutoPan = false;
        var mapStyle = null;
        var rent_inc_id = '55';
        var scrollWheelEnabled = false;
        var myLocationEnabled = true;
        var rectangleSearchEnabled = true;
        var c_mapTypeId = "style1"; // google.maps.MapTypeId.ROADMAP;
        var c_mapTypeIds = ["style1",
                            google.maps.MapTypeId.ROADMAP,
                            google.maps.MapTypeId.HYBRID];          
        //google.maps.MapTypeId.ROADMAP
        //google.maps.MapTypeId.SATELLITE
        //google.maps.MapTypeId.HYBRID
        //google.maps.MapTypeId.TERRAIN
        
        var selectorResults = '.results-properties-list';

        $(document).ready(function()
        {
            // Cluster config start //
            clusterConfig = {
              radius: 60,
              // This style will be used for clusters with more than 2 markers
//              2: {
//                content: "<div class='cluster cluster-1'>CLUSTER_COUNT</div>",
//                width: 53,
//                height: 52
//              },
              // This style will be used for clusters with more than 5 markers
              5: {
                content: "<div class='cluster cluster-1'>CLUSTER_COUNT</div>",
                width: 53,
                height: 52
              },
              // This style will be used for clusters with more than 20 markers
              20: {
                content: "<div class='cluster cluster-2'>CLUSTER_COUNT</div>",
                width: 56,
                height: 55
              },
              // This style will be used for clusters with more than 50 markers
              50: {
                content: "<div class='cluster cluster-3'>CLUSTER_COUNT</div>",
                width: 66,
                height: 65
              },
              events: {
                click:function(cluster, event, object) {
                    try {
                        var same_address = true;
                        var adr = '';
                        $.each(object.data.markers, function(item) {
                            
                            if(adr == '')
                                adr = object.data.markers[item].adr;
                            
                            if(adr != object.data.markers[item].adr)
                                same_address = false;
                        });
                        
                        if(same_address)
                        {
                            cluster.main.map.panTo(object.data.latLng);
                            cluster.main.map.setZoom(19);
                        }
                        else
                        {
                            cluster.main.map.panTo(object.data.latLng);
                            cluster.main.map.setZoom(cluster.main.map.getZoom()+1);
                        }
                    }
                    catch(err) {
                        cluster.main.map.panTo(object.data.latLng);
                        cluster.main.map.setZoom(cluster.main.map.getZoom()+1);
                    }
                }
              }
            };
            // Cluster config end //
            
            // Map style start //
            
            //mapStyle = [{"featureType":"water","stylers":[{"color":"#46bcec"},{"visibility":"on"}]},{"featureType":"landscape","stylers":[{"color":"#f2f2f2"}]},{"featureType":"road","stylers":[{"saturation":-100},{"lightness":45}]},{"featureType":"road.highway","stylers":[{"visibility":"simplified"}]},{"featureType":"road.arterial","elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"administrative","elementType":"labels.text.fill","stylers":[{"color":"#444444"}]},{"featureType":"transit","stylers":[{"visibility":"off"}]},{"featureType":"poi","stylers":[{"visibility":"off"}]}];
            //mapStyle = [{"featureType":"water","elementType":"geometry","stylers":[{"color":"#a2daf2"}]},{"featureType":"landscape.man_made","elementType":"geometry","stylers":[{"color":"#f7f1df"}]},{"featureType":"landscape.natural","elementType":"geometry","stylers":[{"color":"#d0e3b4"}]},{"featureType":"landscape.natural.terrain","elementType":"geometry","stylers":[{"visibility":"off"}]},{"featureType":"poi.park","elementType":"geometry","stylers":[{"color":"#bde6ab"}]},{"featureType":"poi","elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"poi.medical","elementType":"geometry","stylers":[{"color":"#fbd3da"}]},{"featureType":"poi.business","stylers":[{"visibility":"off"}]},{"featureType":"road","elementType":"geometry.stroke","stylers":[{"visibility":"off"}]},{"featureType":"road","elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"road.highway","elementType":"geometry.fill","stylers":[{"color":"#ffe15f"}]},{"featureType":"road.highway","elementType":"geometry.stroke","stylers":[{"color":"#efd151"}]},{"featureType":"road.arterial","elementType":"geometry.fill","stylers":[{"color":"#ffffff"}]},{"featureType":"road.local","elementType":"geometry.fill","stylers":[{"color":"black"}]},{"featureType":"transit.station.airport","elementType":"geometry.fill","stylers":[{"color":"#cfb2db"}]}];
            mapStyle = [{"featureType":"landscape","stylers":[{"hue":"#FFA800"},{"saturation":0},{"lightness":0},{"gamma":1}]},{"featureType":"road.highway","stylers":[{"hue":"#53FF00"},{"saturation":-73},{"lightness":40},{"gamma":1}]},{"featureType":"road.arterial","stylers":[{"hue":"#FBFF00"},{"saturation":0},{"lightness":0},{"gamma":1}]},{"featureType":"road.local","stylers":[{"hue":"#00FFFD"},{"saturation":0},{"lightness":30},{"gamma":1}]},{"featureType":"water","stylers":[{"hue":"#00BFFF"},{"saturation":6},{"lightness":8},{"gamma":1}]},{"featureType":"poi","stylers":[{"hue":"#679714"},{"saturation":33.4},{"lightness":-25.4},{"gamma":1}]}];

            // Map style end //
            
            // Map Marker options start //
            markerOptions = {
              draggable: false
            };
            // Map Marker options  end //

            // Calendar translation start //
            
            var translated_cal = {
    			days: ["Minggu", "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Saptu", "Minggu"],
    			daysShort: ["Mng", "Sen", "Sel", "Rab", "Kam", "Jum", "Sap", "Mng"],
    			daysMin: ["Mg", "Se", "Sl", "Ra", "Ka", "Ju", "Sa", "Mg"],
    			months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
    			monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
    		};
            
            if(typeof(DPGlobal) != 'undefined'){
                DPGlobal.dates = translated_cal;
            }
            
            if($(selectorResults).length <= 0)
                selectorResults = '.wrap-content .container';
            
            // Calendar translation End //
            
            // Slider range Start //   
            // Slider range End //
            
            // [START] Save search //  
            
            $("#search-save").click(function(){
                manualSearch(0, '#content', true);
                
                return false;
            });
            
            // [END] Save search //
            
                        // Popup form End //      
            
                              
            
            // Filters Start //
            
            $(".checkbox_am").click((function(){
                var option_id = $(this).attr('option_id');
                
                if($(this).prop('checked'))
                {
                    $("#search_option_"+option_id).prop('checked', true);
                }
                else
                {
                    $("#search_option_"+option_id).prop('checked', false);
                }
                //console.log(option_id);
            }));
            
            $(".input_am").focusout((function(){
                var option_id = $(this).attr('option_id');
                
                $("#search_option_"+option_id).val($(this).val());
                //console.log(option_id);
            }));
            
            $(".input_am_from").focusout((function(){
                var option_id = $(this).attr('option_id');
                $("#search_option_"+option_id+"_from").val($(this).val());


                //console.log(option_id);
            }));
            
            $(".input_am_to").focusout((function(){
                var option_id = $(this).attr('option_id');
                
                $("#search_option_"+option_id+"_to").val($(this).val());
                //console.log(option_id);
            }));
            
                        $(".checkbox_am, .search-form .advanced-form-part label.checkbox input").prop('checked', false);
            $(".input_am, .input_am_from, .input_am_to, .search-form input[type=text], .search-form select").val('');
                        
            $('.search-form select.selectpicker').selectpicker('render');
            
            $("button.refresh_filters").click(function () { 
                manualSearch(0);
                return false;
            });
            
            // Filters End //            
            
                        
            /*
            $('#your_button_id').click(function(){
                $("#wrap-map").gmap3({
                 map:{
                    options:{
                     center: [2.09174725, 96.8182074],
                     zoom: 5
                    }
                 }});
               return false; 
            });
            */
            
            //Init carousel
            
            $('#myCarousel').carousel();        
            
            $('#search-start-map').click(function () { 
                $('#wrap-map-1').attr('id', 'wrap-map');
              manualSearch(0, false);
              return false;
            });
            
            /*
            $(".scroll").click(function(event){
                 event.preventDefault();
                 //calculate destination place
                 var dest=0;
                 if($(this.hash).offset().top > $(document).height()-$(window).height()){
                      dest=$(document).height()-$(window).height();
                 }else{
                      dest=$(this.hash).offset().top;
                 }
                 //go to destination
                 $('html,body').animate({scrollTop:dest}, 2000,'swing');
             });
             
             */

            /* Search start */

            $('.menu-onmap li a').click(function () { 
              if(!$(this).parent().hasClass('list-property-button'))
              {
                  $(this).parent().parent().find('li').removeClass("active");
                  $(this).parent().addClass("active");
                  
                  if(loadOnTab) manualSearch(0);
                  return false;
              }
            });
            
                        if($('.menu-onmap li.active').length == 0)
            {
                $('.menu-onmap li.all-button').addClass('active');
            }
                        
            $('#search-start').click(function () { 
              manualSearch(0);
              return false;
            });
            /* Search end */
            
                        
            /* Date picker */
            var nowTemp = new Date();
            
            var now = new Date(nowTemp.getFullYear(), nowTemp.getMonth(), nowTemp.getDate(), 0, 0, 0, 0);

            $('.datetimepicker_standard').datepicker().on('changeDate', function(ev) {
                $(this).datepicker('hide');
            });

            var checkin = $('#datetimepicker1').datepicker({
                onRender: function(date) {
                    
                    //console.log(date.valueOf());
                    //console.log(date.toString());
                    //console.log(now.valueOf());
                    
                    var dd = date.getDate();
                    var mm = date.getMonth()+1;//January is 0!`
                    
                    var yyyy = date.getFullYear();



                    if(dd<10){dd='0'+dd}
                    if(mm<10){mm='0'+mm}
                    var today_formated = yyyy+'-'+mm+'-'+dd;
                    
                    
                    if(date.valueOf() < now.valueOf()) // Just for performance
                    {
                        return 'disabled';
                    }
                                        return '';
                                    }
            }).on('changeDate', function(ev) {
                if (ev.date.valueOf() > checkout.date.valueOf()) {
                    var newDate = new Date(ev.date)
                    newDate.setDate(newDate.getDate() + 7);
                    checkout.setValue(newDate);
                }
                checkin.hide();
                $('#datetimepicker2')[0].focus();
            }).data('datepicker');
                var checkout = $('#datetimepicker2').datepicker({
                onRender: function(date) {

                    var dd = date.getDate();
                    var mm = date.getMonth()+1;//January is 0!`
                    
                    var yyyy = date.getFullYear();
                    if(dd<10){dd='0'+dd}
                    if(mm<10){mm='0'+mm}
                    var today_formated = yyyy+'-'+mm+'-'+dd;
                    
                    
                    if(date.valueOf() <= checkin.date.valueOf()) // Just for performance
                    {
                        return 'disabled';
                    }                    
                                        return '';
                                }
            }).on('changeDate', function(ev) {
                checkout.hide();
            }).data('datepicker');
            
                        
            $('a.available.selectable').click(function(){
                $('#datetimepicker1').val($(this).attr('ref'));
                $('#datetimepicker2').val($(this).attr('ref_to'));
                $('div.property-form form input:first').focus();
                
                var nowTemp = new Date($(this).attr('ref'));
                var date_from = new Date(nowTemp.getFullYear(), nowTemp.getMonth(), nowTemp.getDate(), 0, 0, 0, 0);

                checkin.setValue(date_from);
                date_from.setDate(date_from.getDate() + 7);
                checkout.setValue(date_from);
            });
            
            
            /* Date picker end */
            
            /* Edit property */
            
            // If alredy selected
            if($('#inputGps').length && $('#inputGps').val() != '')
            {
                savedGpsData = $('#inputGps').val().split(", ");
                
                $("#mapsAddress").gmap3({
                    map:{
                      options:{
                        center: [parseFloat(savedGpsData[0]), parseFloat(savedGpsData[1])],
                        zoom: 14
                      }
                    },
                    marker:{
                    values:[
                      {latLng:[parseFloat(savedGpsData[0]), parseFloat(savedGpsData[1])]},
                    ],
                    options:{
                      draggable: true
                    },
                    events:{
                        dragend: function(marker){
                          if($("#inputAddress").attr("readonly"))
                          {
                            alert('Location change disabled');
                            return false;
                          }
                          else
                          {
                            $('#inputGps').val(marker.getPosition().lat()+', '+marker.getPosition().lng());
                          }
                        }
                  }}});
                
                firstSet = true;
            }
            else
            {
                $("#mapsAddress").gmap3({
                    map:{
                      options:{
                        center: [-6.175919, 106.791571],
                        zoom: 12
                      },
                    },
                marker:{
                    values:[
                      {latLng:[-6.175919, 106.791571]},
                    ],
                    options:{
                      draggable: true
                    },
                    events:{
                        dragend: function(marker){
                          if($("#inputAddress").attr("readonly"))
                          {
                            alert('Location change disabled');
                            return false;
                          }
                          else
                          {
                            $('#inputGps').val(marker.getPosition().lat()+', '+marker.getPosition().lng());
                          }
                        }
                  }}
                  });
                  
                  firstSet = true;
            }
                
            $('#inputAddress').keyup(function (e) {
                clearTimeout(timerMap);
                timerMap = setTimeout(function () {
                    
                    $("#mapsAddress").gmap3({
                      getlatlng:{
                        address:  $('#inputAddress').val(),
                        callback: function(results){
                          if ( !results ){
                            ShowStatus.show('Address not found!');
                            return;
                          } 
                          
                            if(firstSet){
                                $(this).gmap3({
                                    clear: {
                                      name:["marker"],
                                      last: true
                                    }
                                });
                            }
                          
                          // Add marker
                          $(this).gmap3({
                            marker:{
                              latLng:results[0].geometry.location,
                               options: {
                                  id:'searchMarker',
                                  draggable: true
                              },
                              events: {
                                dragend: function(marker){
                                  if($("#inputAddress").attr("readonly"))
                                  {
                                    alert('Location change disabled');
                                    return false;
                                  }
                                  else
                                  {
                                    $('#inputGps').val(marker.getPosition().lat()+', '+marker.getPosition().lng());
                                  }
                                }
                              }
                            }
                          });
                          
                          // Center map
                          $(this).gmap3('get').setCenter( results[0].geometry.location );
                          
                          $('#inputGps').val(results[0].geometry.location.lat()+', '+results[0].geometry.location.lng());
                          
                          firstSet = true;
    
                        }
                      }
                    });
                }, 2000);
                
            });
            
            //Typeahead
            
            $('#search_option_smart').typeahead({
                minLength: 1,
                source: function(query, process) {
                    $.post('index831e.html?/frontend/typeahead/id/1/smart', { q: query, limit: 8 }, function(data) {
                        process(JSON.parse(data));
                    });
                }
            });
            
            
            
        $('.zoom-button').bind("click touchstart", function()
        {
            var myLinks = new Array();
            var current = $(this).attr('href');
            var curIndex = 0;
            
            $('.files-list-u .zoom-button').each(function (i) {
                var img_href = $(this).attr('href');
                myLinks[i] = img_href;
                if(current == img_href)
                    curIndex = i;
            });

            options = {index: curIndex}
            
            blueimp.Gallery(myLinks, options);
            
            return false;
        });
            
            reloadElements(); 
            
              
            
            // palceholder fix for IE 9
            $('input, textarea').placeholder();
            
            // Universal pagination solution
            reloadPaginationUniversal();
        });
        
        function reloadElements()
        {            
            $('.selectpicker-small').selectpicker({
                style: 'btn-default'
            });
            
            $('.selectpicker-small').change(function() {
                manualSearch(0);
                return false;
            });
            
            $('.view-type').click(function () { 
              $(this).parent().find('.view-type').removeClass("active");
              $(this).addClass("active");
              manualSearch(0);
              return false;
            });
            
            $('.pagination.properties a').click(function () { 
              var page_num = $(this).attr('href');
              var n = page_num.lastIndexOf("index.php?m=depan&id=<?=$id?>"); 
              page_num = page_num.substr(n+1);
              
              manualSearch(page_num);
              return false;
            });
            
            $('.pagination.news a').click(function () { 
                var page_num = $(this).attr('href');
                var n = page_num.lastIndexOf("index.php?m=depan&id=<?=$id?>"); 
                page_num = page_num.substr(n+1);
                
                $.post($(this).attr('href'), {search: $('#search_showroom').val()}, function(data){
                    $('.property_content_position').html(data.print);
                    
                    reloadElements();
                }, "json");
                
                return false;
            });
        }
        
        function reloadPaginationUniversal()
        {
            $('.pagination-ajax-results a').click(function () { 
                var page_num = $(this).attr('href');
                var n = page_num.lastIndexOf("index.php?m=depan&id=<?=$id?>"); 
                page_num = page_num.substr(n+1);
                
                var results_dom_id = '#'+$(this).parent().parent().parent().attr('rel');
                
                $.post($(this).attr('href'), {'page_num':page_num}, function(data){
                    $(results_dom_id).html(data.print);
                    
                    reloadPaginationUniversal();
                }, "json");
                
                return false;
            });
        }
        
        function manualSearch(v_pagenum, scroll_enabled, onlysave)
        {
            if (typeof scroll_enabled === 'undefined') scroll_enabled = "#content";
            if (typeof onlysave === 'undefined') onlysave = false;
            
            // Order ASC/DESC
            var v_order = $('.selectpicker-small').val();
            
            // View List/Grid
            var v_view = $('.view-type.active').attr('ref');          
            
            //Define default data values for search
            var data = {
                order: v_order,
                view: v_view,
                page_num: v_pagenum
            };
            
            if($('#booking_date_from').length > 0)
            {
                if($('#booking_date_from').val() != '')
                    data['v_booking_date_from'] = $('#booking_date_from').val();
            }
            
            if($('#booking_date_to').length > 0)
            {
                if($('#booking_date_to').val() != '')
                    data['v_booking_date_to'] = $('#booking_date_to').val();
            }
            
            // Purpose, "for custom tabbed selector"
            /*
            if($('#search_option_4 .active a').length > 0)
            {
                data['v_search_option_4'] = $('#search_option_4 .active a').html();
            }
            */
            
            // Improved tabbed selector code
            $(".tabbed-selector").each(function() {
              var selected_text = $(this).find(".active:not(.all-button) a").html();
              data['v_'+$(this).attr('id')] = selected_text;
            });
            
            // Add custom data values, automatically by fields inside search-form
            $('.search-form form input, .search-form form select').each(function (i) {
                if($(this).attr('type') == 'checkbox')
                {
                    if ($(this).attr('checked'))
                    {
                        data['v_'+$(this).attr('id')] = $(this).val();
                    }
                }
                else if($(this).hasClass('tree-input'))
                {
                    if($(this).val() != '')
                    {
                        var tre_id_split = $(this).attr('id').split('_');
                        //console.log($(this).find("option:selected").attr('value'));
                        //console.log(tre_id_split);
                        if(data['v_search_option_'+tre_id_split[2]] == undefined)
                            data['v_search_option_'+tre_id_split[2]] = '';
                        
                        data['v_search_option_'+tre_id_split[2]]+= $(this).find("option:selected").text()+' - ';
                    }
                }
                else
                {
                    data['v_'+$(this).attr('id')] = $(this).val();
                }
            });
            
            // Custom tags filter Start
            if($('#tags-filters').length > 0)
            {
                var tags_html = '';
                
                // Add custom data values, automatically by fields inside search-form
                $('.search-form form input, .search-form form select').each(function (i) {
                    if($(this).attr('type') == 'checkbox')
                    {
                        if ($(this).attr('checked'))
                        {
                            data['v_'+$(this).attr('id')] = $(this).val();
                            
                            var option_name = '';
                            //var attr = $(this).attr('placeholder');
                            var attr = $(this).attr('value').substring(4);
                            if(typeof attr !== 'undefined' && attr !== false)
                            {
                                option_name = attr;
                            }
                            
                            if($(this).val() != '')
                                tags_html+='<button class="btn btn-small btn-warning filter-tag ck" rel="'+$(this).attr('id')+'" type="button"><span class="icon-remove icon-white"></span> '+option_name+'</button>&nbsp;';
                        
                        }
                    }
                    else if($(this).hasClass('tree-input'))
                    {
                        // different way
                    }
                    else
                    {
                        data['v_'+$(this).attr('id')] = $(this).val();
                        
                        var option_name = '';
                        var attr = $(this).attr('placeholder');
                        if(typeof attr !== 'undefined' && attr !== false)
                        {
                            option_name = attr+': ';
                        }
                        
                        if($(this).val() != '')
                            tags_html+='<button class="btn btn-small btn-primary filter-tag" rel="'+$(this).attr('id')+'" type="button"><span class="icon-remove icon-white"></span> '+option_name+$(this).val()+'</button>&nbsp;';
                    
                    }
                });
                
                if(typeof data['v_search_option_4'] != 'undefined')
                if(data['v_search_option_4'].length > 0)
                    tags_html+='<button class="btn btn-small btn-danger filter-tag" rel="4" type="button"><span class="icon-remove icon-white"></span> '+data['v_search_option_4']+'</button>&nbsp;';
                
                if(tags_html != '')
                {
                    $("#tags-filters").css('display', 'block');
                    
                    $("#tags-filters").html(tags_html);
                    
                    $(".filter-tag").click(function(){
                        var m_id = $(this).attr('rel').substring(14);
                        
                        if($(this).hasClass('ck'))
                        {
                            $('#'+$(this).attr('rel')).prop('checked', false);
                        }
                        else
                        {
                            $("input.id_"+m_id).val('');
                            $("input#"+$(this).attr('rel')).val('');
                            
                            $("select#"+$(this).attr('rel')).val('');
                            $("select.id_"+m_id).val('');
                            $("select#"+$(this).attr('rel')+".selectpicker").selectpicker('render');
                            $("select.id_"+m_id+".selectpicker").selectpicker('render');
                        }
                        
                        $(this).remove();
                        
                        
                        if($(this).attr('rel') == '4')
                        {
                            $('#search_option_4 .active').removeClass('active');
                        }
                        
                        if($(this).hasClass('ck'))
                        {
                            $("input.checkbox_am[option_id='"+m_id+"']").prop('checked', false);
                        }
                        
                        manualSearch(0);
                    });
                }
                else
                {
                    $("#tags-filters").css('display', 'none');
                }
            }
            // Custom tags filter End
            
            /* suctom field infinity scale */
            /*
            if(/\+$/.test(data['v_search_option_36_to'])) {
                data['v_search_option_36_to']='';
            }
            
            if($('#search_option_36_to').length)
            data['v_search_option_36_to']=parseInt($.number(data['v_search_option_36_to'].replace("IDR", "").replace("", "")).replace(",", ""));
            
            if($('#search_option_36_from').length)
            data['v_search_option_36_from']=parseInt($.number(data['v_search_option_36_from'].replace("IDR", "").replace("", "")).replace(",", ""));
            
            if(data['v_search_option_36_to']=='0')
                 data['v_search_option_36_to']='';
            if(data['v_search_option_36_from']=='0')
                 data['v_search_option_36_from']='';
             */
            
             $('.scale-input').each(function(i){
                var _prefix='',_suffix='';
                
                var self = $(this);
                var _option= 'v_'+self.attr('id'); // search key
                
                if(self.attr('data-prefix'))
                    _prefix = self.attr('data-prefix');
                
                if(self.attr('data-suffix'))
                    _suffix = self.attr('data-suffix');
                
                if(/\+$/.test(self)) {
                    data[_option]='';
                }
            
                if(self.length)
                    data[_option]=parseInt($.number(data[_option].replace(_prefix, "").replace(_prefix, "")).replace(",", ""));
                
                if(data[_option]=='0')
                 data[_option]='';
             })
             
            /* end suctom field infinity scale */
            
            
            
            
            
            $("#ajax-indicator-1").show();
            
            if(onlysave == true)
            {
                $.post("index5ab3.json?/privateapi/save_search/id", data, 
                       function(data){
                    //console.log(data);
                    //console.log(data.message);
                    
                    ShowStatus.show(data.message);
                                    
                    $("#ajax-indicator-1").hide();
                });
                
                return;
            }
            
                        
            $.post("indexd41d.html?/frontend/ajax/id/1/"+v_pagenum, data,
            function(data){
                
                if(mapRefresh)
                {
                    //Remove all markers
                    $("#wrap-map").gmap3({
                        clear: {
                            name:["marker"]
                        }
                    });
                    
                    if(data.results.length > 0)
                    {
                        //Add new markers
                        $("#wrap-map").gmap3({
                            map:{
                              options:{
                                                                center: data.results_center,
                                                                zoom: 5,
                                 mapTypeId: c_mapTypeId,
                                 mapTypeControlOptions: {
                                   mapTypeIds: c_mapTypeIds,
                                   position: google.maps.ControlPosition.TOP_RIGHT
                                 }
                                }
                             },
                            styledmaptype:{
                              id: "style1",
                              options:{
                                name: "Peta Kustom"
                              },
                              styles: mapStyle
                            },
                            marker:{
                            values: data.results,
                            cluster: clusterConfig,
                            options: markerOptions,
                        events:{
                          click: function(marker, event, context){
                            var map = $(this).gmap3("get"),
                              infowindow = $(this).gmap3({get:{name:"infowindow"}});
                            if (infowindow){
                              infowindow.open(map, marker);
                              infowindow.setContent('<div style="width:400px;display:inline;">'+context.data+'</div>');
                            } else {
                              $(this).gmap3({
                                infowindow:{
                                  anchor:marker,
                                  options:{disableAutoPan: mapDisableAutoPan, content: '<div style="width:400px;display:inline;">'+context.data+'</div>'}
                                }
                              });
                            }
                          }
                        }}
                        });
                        
                        if($('#pac-input').length==0)
                        {
                            // Add SearchBox
                            $('#wrap-map').before('<input id="pac-input" class="controls" type="text" placeholder="Cari" />');
                            init_gmap_searchbox();
                        }
                    }
                }
                
                $(selectorResults).html(data.print);
                    reloadElements();
                
                $("#ajax-indicator-1").hide();
                if(scroll_enabled != false)
                    $(document).scrollTop( $(scroll_enabled).offset().top );
                
//                $(selectorResults).hide(1000,function(){
//                    $(selectorResults).html(data.print);
//                    reloadElements();
//                    $(selectorResults).show(1000);
//                });
            }, "json");
            return false;
        }
        
    $.fn.startLoading = function(data){
        //$('#saveAll, #add-new-page, ol.sortable button, #saveRevision').button('loading');
    }
    
    $.fn.endLoading = function(data){
        //$('#saveAll, #add-new-page, ol.sortable button, #saveRevision').button('reset');       
                    //ShowStatus.show('');
            }
    
        
        function init_gmap_searchbox()
        {
            if( $('#pac-input').length==0 || $('#wrap-map').length==0 )return;
            
            var map = $("#wrap-map").gmap3({
                get: { name:"map" }
            });    
            
            var markers = [];

            // Create the search box and link it to the UI element.
            var input = /** @type {HTMLInputElement} */(
              document.getElementById('pac-input'));
            map.controls[google.maps.ControlPosition.TOP_LEFT].push(input);
            
            var searchBox = new google.maps.places.SearchBox(
            /** @type {HTMLInputElement} */(input));
            
            // [START region_getplaces]
            // Listen for the event fired when the user selects an item from the
            // pick list. Retrieve the matching places for that item.
            google.maps.event.addListener(searchBox, 'places_changed', function() {
            var places = searchBox.getPlaces();
            
            for (var i = 0, marker; marker = markers[i]; i++) {
              marker.setMap(null);
            }
            
            // For each place, get the icon, place name, and location.
            markers = [];
            var bounds = new google.maps.LatLngBounds();
            for (var i = 0, place; place = places[i]; i++) {
              var image = {
                url: place.icon,
                size: new google.maps.Size(71, 71),
                origin: new google.maps.Point(0, 0),
                anchor: new google.maps.Point(17, 34),
                scaledSize: new google.maps.Size(25, 25)
              };
            
              // Create a marker for each place.
              var marker = new google.maps.Marker({
                map: map,
                icon: image,
                title: place.name,
                position: place.geometry.location
              });
            
              markers.push(marker);
            
              bounds.extend(place.geometry.location);
            }
            
            map.fitBounds(bounds);
            var zoom = map.getZoom();
            map.setZoom(zoom > zoomOnMapSearch ? zoomOnMapSearch : zoom);
            });
            // [END region_getplaces]
            
            if(myLocationEnabled){
                // [START gmap mylocation]
                
                // Construct your control in whatever manner is appropriate.
                // Generally, your constructor will want access to the
                // DIV on which you'll attach the control UI to the Map.
                var controlDiv = document.createElement('div');
                
                // We don't really need to set an index value here, but
                // this would be how you do it. Note that we set this
                // value as a property of the DIV itself.
                controlDiv.index = 1;
                
                // Add the control to the map at a designated control position
                // by pushing it on the position's array. This code will
                // implicitly add the control to the DOM, through the Map
                // object. You should not attach the control manually.
                map.controls[google.maps.ControlPosition.RIGHT_TOP].push(controlDiv);
                
                HomeControl(controlDiv, map)
    
                // [END gmap mylocation]
            }
            
            if(rectangleSearchEnabled)
            {
                var controlDiv2 = document.createElement('div');
                controlDiv2.index = 2;
                map.controls[google.maps.ControlPosition.RIGHT_TOP].push(controlDiv2);
                RectangleControl(controlDiv2, map)
            }
            
        }
        
        function HomeControl(controlDiv, map) {
        
          // Set CSS styles for the DIV containing the control
          // Setting padding to 5 px will offset the control
          // from the edge of the map.
          controlDiv.style.padding = '5px';
        
          // Set CSS for the control border.
          var controlUI = document.createElement('div');
          controlUI.style.backgroundColor = 'white';
          controlUI.style.borderStyle = 'solid';
          controlUI.style.borderWidth = '2px';
          controlUI.style.cursor = 'pointer';
          controlUI.style.textAlign = 'center';
          controlUI.title = 'Lokasi saya';
          controlDiv.appendChild(controlUI);
        
          // Set CSS for the control interior.
          var controlText = document.createElement('div');
          controlText.style.fontFamily = 'Arial,sans-serif';
          controlText.style.fontSize = '12px';
          controlText.style.paddingLeft = '4px';
          controlText.style.paddingRight = '4px';
          controlText.innerHTML = '<strong>Lokasi saya</strong>';
          controlUI.appendChild(controlText);
        
          // Setup the click event listeners: simply set the map to Chicago.
          google.maps.event.addDomListener(controlUI, 'click', function() {
            var myloc = new google.maps.Marker({
                clickable: false,
                icon: new google.maps.MarkerImage('../maps.gstatic.com/mapfiles/mobile/mobileimgs2.png',
                                                                new google.maps.Size(22,22),
                                                                new google.maps.Point(0,18),
                                                                new google.maps.Point(11,11)),
                shadow: null,
                zIndex: 999,
                map: map
            });
            
            if (navigator.geolocation) navigator.geolocation.getCurrentPosition(function(pos) {
                var me = new google.maps.LatLng(pos.coords.latitude, pos.coords.longitude);
                myloc.setPosition(me);
                
                // Zoom in
                var bounds = new google.maps.LatLngBounds();
                bounds.extend(me);
                map.fitBounds(bounds);
                var zoom = map.getZoom();
                map.setZoom(zoom > zoomOnMapSearch ? zoomOnMapSearch : zoom);
            }, function(error) {
                console.log(error);
            });
          });
        }
        
        var rectangle;
        var infoWindow_rectangle;
        var map_rectangle;
        
        function RectangleControl(controlDiv2, map) {
          
          map_rectangle = map;
          
          // Set CSS styles for the DIV containing the control
          // Setting padding to 5 px will offset the control
          // from the edge of the map.
          controlDiv2.style.padding = '5px';
        
          // Set CSS for the control border.
          var controlUI = document.createElement('div');
          controlUI.style.backgroundColor = 'white';
          controlUI.style.borderStyle = 'solid';
          controlUI.style.borderWidth = '2px';
          controlUI.style.cursor = 'pointer';
          controlUI.style.textAlign = 'center';
          controlUI.title = 'Draw Rectangle';
          controlDiv2.appendChild(controlUI);
        
          // Set CSS for the control interior.
          var controlText = document.createElement('div');
          controlText.style.fontFamily = 'Arial,sans-serif';
          controlText.style.fontSize = '12px';
          controlText.style.paddingLeft = '4px';
          controlText.style.paddingRight = '4px';
          controlText.innerHTML = '<strong>Draw Rectangle</strong>';
          controlUI.appendChild(controlText);
        
          // Setup the click event listeners: simply set the map to Chicago.
          google.maps.event.addDomListener(controlUI, 'click', function() {
              
              if(rectangle != null)return;
              
              var map_zoom = map.getZoom();
              var map_center = map.getCenter();
                
              var size_index = 0.4;
              
              if(map_zoom > 11)
                size_index = 0.02
                
              var bounds = new google.maps.LatLngBounds(
                  map_center,
                  new google.maps.LatLng(map_center.lat()+size_index, map_center.lng()+size_index*2)
              );
            
              // Define the rectangle and set its editable property to true.
              rectangle = new google.maps.Rectangle({
                bounds: bounds,
                editable: true,
                draggable: true
              });
            
              rectangle.setMap(map);
            
              // Add an event listener on the rectangle.
              google.maps.event.addListener(rectangle, 'bounds_changed', showNewRect);
            
              // Define an info window on the map.
              infoWindow_rectangle = new google.maps.InfoWindow();
              
              // define first rectangle dimension
              var ne = rectangle.getBounds().getNorthEast();
              var sw = rectangle.getBounds().getSouthWest();
              $('#rectangle_ne').val(ne.lat() + ', ' + ne.lng());
              $('#rectangle_sw').val(sw.lat() + ', ' + sw.lng());
            
          });
        }
        
        // Show the new coordinates for the rectangle in an info window.
        
        /** @this {google.maps.Rectangle} */
        function showNewRect(event) {
          var ne = rectangle.getBounds().getNorthEast();
          var sw = rectangle.getBounds().getSouthWest();
        
          var contentString = '<b>Rectangle moved:</b><br>' +
              'New north-east corner: ' + ne.lat() + ', ' + ne.lng() + '<br>' +
              'New south-west corner: ' + sw.lat() + ', ' + sw.lng();
          
          $('#rectangle_ne').val(ne.lat() + ', ' + ne.lng());
          $('#rectangle_sw').val(sw.lat() + ', ' + sw.lng());
          
          // Set the info window's content and position.
          infoWindow_rectangle.setContent(contentString);
          infoWindow_rectangle.setPosition(ne);
        
          infoWindow_rectangle.open(map_rectangle);
        }


        /* [START] NumericFields */
        
        $(function() {
                        
            $('input.DECIMAL').number( true, 2 );
            $('input.INTEGER').number( true, 0 );
            
                    });
    
        /* [END] NumericFields */
        
        /* [START] ValidateFields */
        
        $(function() {
            $('form.form-estate').h5Validate();
        });
        
        /* [END] ValidateFields */
        
    </script>
    <!-- [START] scale -->
    <link rel="stylesheet"  href="templates/bootstrap2-responsive/assets/js/nouislider/nouislider.css">
    <script src="templates/bootstrap2-responsive/assets/js/nouislider/nouislider.js"></script>
    <link rel="stylesheet"  href="templates/bootstrap2-responsive/assets/js/nouislider/nouislider.pips.css">
    <link rel="stylesheet"  href="templates/bootstrap2-responsive/assets/js/nouislider/nouislider.tooltips.css">
    <!-- [END] scale -->    <script language="javascript">
    $(document).ready(function(){


    });
    </script>
  </head>

  <body>
  
<a name="top-page"></a>
<div class="always-top">


<div class="top-wrapper">
      <div class="container">
        <div class="masthead">
        
        <ul class="nav pull-right top-small">
          <!--<li><span><i class="icon-phone"></i> (021) 29119028 - 29119029</span></li>
          <li><a href="mailto:cs@magnetpro.co.id"><i class="icon-envelope"></i> cs@magnetpro.co.id</a></li>-->
                    <li><a href="index3.php?m=masuk&id=<?=$id?>"><span class="label alert-danger"><i class="icon-user"></i> LOGIN</span></a></li>
		  <li><a href="index2.php?m=join&id=<?= $id; ?>"><span class="label label-success"><i class="icon-pencil"></i> MENDAFTAR</span></a></li>
          </ul>
        
                
        
                <ul class="breadcrumb nav pull-right"><li><a href='index.php?m=depan&id=<?=$id?>'>Beranda</a></li></ul>        </div>
      </div> <!-- /.container -->
</div><div class="head-wrapper">
    <div class="container">
        <div class="row">
            <div class="span12"> 
               <a class="logo pull-left" href="#"><img src="gambar/logo.png" alt="Logo" /></a> 
                <a class="logo-over pull-left" href="#"><img src="templates/bootstrap2-responsive/assets/img/logo-over.html" alt="Logo" /></a>
                
                                <div class="pull-right">
                <div class="lang_menu_wrapper">
                   <div class="btn-group">
                  </div>
                </div>
                </div>
                                
                <div class="navbar pull-left">
                    <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target="#main-top-menu">
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                
                    <ul class="nav navbar-nav nav-collapse collapse navbar-main" id="main-top-menu" role="navigation">
<li class="active"><a href="index.php?m=depan&id=<?=$id?>" ><img src="templates/bootstrap2-responsive/assets/img/home-icon.png" alt="Beranda" /></a></li>
<li><a href="index2.php?m=tentang-kami&id=<?=$id?>" >Tentang Kami</a></li>
<li><a href="produk.php?m=produk&id=<?=$id?>" >Produk</a></li>
<li><a href="index2.php?m=system&id=<?=$id?>" >Marketing Plan</a></li>
<li><a href="index2.php?m=testimony&id=<?=$id?>" >Testimony</a></li>
<li><a href="index2.php?m=contact&id=<?=$id?>" >Kontak</a></li>
<li><a href="index2.php?m=join&id=<?= $id; ?>" >Daftar</a></li>
</ul>

                </div><!-- /.navbar -->
            </div>  
        </div> 
        
    </div>  
</div>



</div>
<div class="wrap-map" id="wrap-map-1">
    <div id="myCarousel" class="carousel slide">
        
    <div class="container">
    <ol class="carousel-thumbs carousel-indicators">
    
        <li data-target="#myCarousel" data-slide-to="0" class="active"><a href="#"><img src="gambar/slide1.jpg" /></a></li>
    
        <li data-target="#myCarousel" data-slide-to="1" class=""><a href="#"><img src="gambar/slide2.jpg" /></a></li>
    
        <li data-target="#myCarousel" data-slide-to="2" class=""><a href="#"><img src="gambar/slide3.jpg" /></a></li>
    
        <li data-target="#myCarousel" data-slide-to="3" class=""><a href="#"><img src="gambar/slide4.jpg" /></a></li>
    
    </ol>
    </div>
    
    <!-- Carousel items -->
    <div class="carousel-inner">
            <div class="item active">
        <div class="cont">
            <img alt="" src="gambar/slide1.jpg" />
              </div>
        </div>
            <div class="item ">
        <div class="cont">
            <img alt="" src="gambar/slide2.jpg" />
              </div>
        </div>
            <div class="item ">
        <div class="cont">
            <img alt="" src="gambar/slide3.jpg" />
              </div>
        </div>
            <div class="item ">
        <div class="cont">
            <img alt="" src="gambar/slide4.jpg" />
              </div>
        </div>
      </div>
    <!-- Carousel nav -->
    <a class="carousel-control left" href="#myCarousel" data-slide="prev">&lsaquo;</a>
    <a class="carousel-control right" href="#myCarousel" data-slide="next">&rsaquo;</a>
    </div>
</div>

<div class="wrap-search">
    <div class="container">
 
        
        <div class="search-form">
            <form action="cari-produk.php?m=&id=<?=$id?>" method="post">
                <input id="rectangle_ne" type="text" class="hide" />
                <input id="rectangle_sw" type="text" class="hide" />
            
                <!-- [START] TreeSearch -->
                                <!-- [END] TreeSearch -->
            
                <select id="search_option_2" class="span3 selectpicker" name="kategorynya" placeholder="Kategory Produk">
                    <option value="">Kategory</option><option value="57" >Product Best Seller</option><option value="58" >Peralatan rumah tangga</option><option value="59" >Kesehatan dan Kecantikan</option><option value="60" >Peralatan Olahraga</option><option value="61" >Peralatan elektronik</option><option value="62" >Komputer dan Laptop</option><option value="63" >Fashion</option><option value="64" >Lifestyle</option><option value="65" >Handphone dan Tablet</option>
                </select>
            <!--<select id="search_option_3" class="span3 selectpicker nomargin" placeholder="Luas Bangunan">
                    <option value="">Luas Bangunan</option><option value="" selected="selected"></option>
                </select>-->
			
			  <div class="advanced-form-part">

                 <button id="search-start" type="submit" class="btn btn-info btn-medium">&nbsp;&nbsp;Lihat Produk&nbsp;&nbsp;<!--<input id="search_option_19" type="text" class="span3 Bathrooms INTEGER" placeholder="Kamar Mandi"  value="" />
                <input id="search_option_20" type="text" class="span3 INTEGER" placeholder="Kamar Tidur"  value="" />
                <div class="form-row-space"></div>
                                                <label class="checkbox">
                <input id="search_option_11" type="checkbox" class="span1" value="true{options_name_11}" />{options_name_11}
                </label>
                <label class="checkbox">
                <input id="search_option_22" type="checkbox" class="span1" value="true{options_name_22}" />{options_name_22}
                </label>
                <label class="checkbox">
                <input id="search_option_25" type="checkbox" class="span1" value="true{options_name_25}" />{options_name_25}
                </label>
                <label class="checkbox">
                <input id="search_option_27" type="checkbox" class="span1" value="true{options_name_27}" />{options_name_27}
                </label>
                <label class="checkbox">
                <input id="search_option_28" type="checkbox" class="span1" value="true{options_name_28}" />{options_name_28}
                </label>
                <label class="checkbox">
                <input id="search_option_29" type="checkbox" class="span1" value="true{options_name_29}" />{options_name_29}
                </label>
                <label class="checkbox">
                <input id="search_option_32" type="checkbox" class="span1" value="true{options_name_32}" />{options_name_32}
                </label>
                <label class="checkbox">
                <input id="search_option_30" type="checkbox" class="span1" value="true{options_name_30}" />{options_name_30}
                </label>
                <label class="checkbox">
                <input id="search_option_33" type="checkbox" class="span1" value="true{options_name_33}" />{options_name_33}
                </label>-->
                </button>
                </div>
				
                <br style="clear:both;" />
                <!--<div id="tags-filters">
                </div>-->
				<!--<button id="search-start" type="submit" class="btn btn-info btn-large">&nbsp;&nbsp;Cari&nbsp;&nbsp;</button>
                <a id="search-start-map" href="#wrap-map" class="scroll"><button type="button" class="btn btn-success btn-large">Tunjukkan di peta</button></a>
                <img id="ajax-indicator-1" src="http://www.magnetpro.co.id/templates/bootstrap2-responsive/assets/img/ajax-loader.gif" />-->
				
				
				
                                
                <img id="ajax-indicator-1" src="templates/bootstrap2-responsive/assets/img/ajax-loader.gif" />
            </form>
        </div>


        </div>
    </div>
</div>




<div class="wrap-content">
<div class="container">
    <div class="row-fluid">
        <div class="span12">
            <div class="results-properties-list with-sidebar">
    

    <br style="clear:both;" />

    <div class="row-fluid">
        

                <ul class="thumbnails">       
				     

<?
$batas   = 12;
$halaman = $_GET['halaman'];
if(empty($halaman)){
	$posisi  = 0;
	$halaman = 1;
}
else{
	$posisi = ($halaman-1) * $batas;
}

$db->select("id, catid, kode, nama, deskripsi, harga, gambar, published, created, file, hit, expire", "product",  "published=1", "id desc LIMIT $posisi,$batas");

if($db->num_rows() > 0) {
	//echo $db->result(0, "maintext");
	while($row = $db->fetch_row()) {
	$adafoto = $row[6];
	    echo "<li class='span3 li-grid'>";
	    echo "<div class='thumbnail f_-'>";
		
		
		//echo "<div class='author'><em>Oleh: $row[2]</em></div>";
		echo "<div class='isi'><font color='#282D3A'><a href=index2.php?m=best-seller&nid=$row[0]&id=$id><h3>$row[3]</h3></a></font></div>";
		if ($adafoto !=''){
		echo "<img alt='Image' data-src='holder.js/300x200' src='images/news/".$row[6]."'  alt=''/>";
		}
		else
		{
		echo "<a href=index2.php?m=best-seller&amp;page=detil&amp;pid=<?= $data[0]; ?>&amp;id=<?= $id; ?><div class='img'><img src='images/noimage.jpg' width=300 height=200 border=0></a></div>";
		} 
		// Tampilkan hanya sebagian isi berita 
		echo "<div class='purpose-badget fea_-'>Rp. $row[5]</div>";
				echo "<a href='index2.php?m=best-seller&page=detil&pid=$row[0]&id=$id' class='over-image'> </a>";
		echo "<div class='caption'>";
		echo "<a class='btn btn-info' href='index2.php?m=best-seller&page=detil&pid=$row[0]&id=$id'>Detail </span>";
		
		echo "<a class='btn btn-info' href='index3.php?m=masuk&pid=$row[0]&id=$id'>Beli</a></p>";

			}	
} else {
	echo "<p>&nbsp;</p><p align=center>Belum ada Produk <?= $db->dataku('nama', $id); ?></p><p>&nbsp;</p>";
}	

?>                            
      </div>
    </div>
  </li>        </ul><ul class="thumbnails"></ul>        
      </div>
<div align="center">  
     <? 
	 $tampil2 = mysql_query("SELECT * FROM product WHERE published='1'");
$jmldata = mysql_num_rows($tampil2);
$jmlhal  = ceil($jmldata/$batas);
	 echo "<div class=paging>";
echo "</div>";
if($halaman > 1){
	$prev=$halaman-1;
	echo "<span class=prevnext><a href=$_SERVER[PHP_SELF]?m=best-seller&halaman=$prev&id=$id>Prev</a></span> ";
}
else{ 
	echo "<span class=disabled>Prev</span> ";
}

// Tampilkan link halaman 1,2,3 ...
for($i=1;$i<=$jmlhal;$i++)
if ($i != $halaman){
	echo " <a href=$_SERVER[PHP_SELF]?m=best-seller&halaman=$i&id=$id>$i</a> ";
}
else{
	echo " <span class=current>$i</span> ";
}

// Link kehalaman berikutnya (Next)
if($halaman < $jmlhal){
	$next=$halaman+1;
	echo "<span class=prevnext><a href=$_SERVER[PHP_SELF]?m=best-seller&halaman=$next&id=$id>Next</a></span>";
}
else{ 
	echo "<span class=disabled>Next</span>";
}
echo "</div>";
echo "<br>";
echo "<div align='center'>Total : <b>$jmldata</b> Produk</div></p>";
?>
</div>	
    </div>
</div>        </div>
    </div>
</div>
</div>
<div class="wrap-content2">
    <div class="container defaultcontent">
        <br>
    </div>
</div>

    
<div class="wrap-bottom">
    <div class="container">
      <div class="row-fluid footer-row">
          <div class="span3">
    <div class="logo-transparent">
     <a class="logo" href="#"><img src="gambar/logo.png" alt="Logo Footer" /></a>  
    </div>
    <div class="sketch-bottom visible-desktop">
    </div>
</div>          <div class="span3">
    <br />
    <table>
        <tr>
            <td></td>
            <td>
                <b>INFO TERBARU</b><br />
<marquee direction="up" height="150" loop="true" scrollamount="3" style="CURSOR:default" onMouseOver="this.stop()" onMouseOut="this.start()">
                      <span class="mbr-contacts__text"><span class="cc01 style19  style15">
                      <?
$batas   = 2;
$halaman = $_GET['halaman'];
if(empty($halaman)){
	$posisi  = 0;
	$halaman = 1;
}
else{
	$posisi = ($halaman-1) * $batas;
}

$db->select("id_berita, id_user, judul, isi_berita, gambar, tanggal, counter, published", "berita", "published=1", "id_berita desc LIMIT $posisi,$batas");

if($db->num_rows() > 0) {
	//echo $db->result(0, "maintext");
	while($row = $db->fetch_row()) {
	$adafoto = $row[4];
	    echo "<table>";
	    echo "<tr><td>";
		echo "<div class='isi'><font color='#FFF' size='2'>post: $row[5]</font></div>";
		echo "<div class='isi'><font color='#FFF'size='2'>berita ini telah dibaca: $row[6] kali</font></div>";
		//echo "<div class='author'><em>Oleh: $row[2]</em></div>";
		echo "<br>";
		echo "<div class='isi'><font color='#FFF'size='2'><a href=index2.php?m=detailberita&nid=$row[0]&id=$id><font color='#FFF'size='2'>$row[2]</a></font></div>";
		echo "<br>";
		if ($adafoto !=''){
		echo "<a href=index2.php?m=detailberita&nid=$row[0]&id=$id><img class='img' src='images/news/".$row[4]."' width=40 height=40 hspace=10 border=0 align=left></a></div>";
		}
		else
		{
		echo "<a href=index2.php?m=detailberita&nid=$row[0]&id=$id><div class='img'><img src='images/noimage.jpg' width=40 height=40 hspace=10 border=0 align=left></a></div>";
		} 
		// Tampilkan hanya sebagian isi berita 
  	  	$isi_berita = nl2br($row[3]);
    	$isi = substr($isi_berita,0,400); // ambil sebanyak 410 karakter
   		 $isi = substr($isi_berita,0,strrpos($isi," ")); // spasi antar kalimat 
		echo "<div class='isi'><font color='#FFF'size='2'>$isi ...</font color='#FFF'size='2'><a href=index2.php?m=detailberita&nid=$row[0]&id=$id><font color='#FFF'size='2'>Selengkapnya</a></div>";
		echo "</td></tr></table>";
		echo "<div><hr width=100% size=1 color=#FFF size='2'></div>";
			}	
} else {
	echo "<p>&nbsp;</p><p align=center>Belum ada berita</p><p>&nbsp;</p>";
}	
$tampil2 = mysql_query("SELECT * FROM berita");
$jmldata = mysql_num_rows($tampil2);
$jmlhal  = ceil($jmldata/$batas);
echo "<div class=paging>";
echo "</div>";
if($halaman > 1){
	$prev=$halaman-1;
	echo "<span class=prevnext><a href=$_SERVER[PHP_SELF]?m=berita&halaman=$prev&id=$id>Prev</a></span> ";
}
else{ 
	echo "<span class=disabled>Prev</span> ";
}

// Tampilkan link halaman 1,2,3 ...
for($i=1;$i<=$jmlhal;$i++)
if ($i != $halaman){
	echo " <a href=$_SERVER[PHP_SELF]?m=berita&halaman=$i&id=$id>$i</a> ";
}
else{
	echo " <span class=current>$i</span> ";
}

// Link kehalaman berikutnya (Next)
if($halaman < $jmlhal){
	$next=$halaman+1;
	echo "<span class=prevnext><a href=$_SERVER[PHP_SELF]?m=berita&halaman=$next&id=$id>Next</a></span>";
}
else{ 
	echo "<span class=disabled>Next</span>";
}
echo "</div>";
echo "<br>";
echo "<p align=center><div class='isi1'>Total : <b>$jmldata</b> Berita</div></p>";
?>
                      </span></span>
                      </marquee>
        </tr>
    </table>
</div>     
<div class="span3">
    <br />
    <table>
        <tr>
            <td></i></td>
            <td>
                <b>MEMBER BARU</b><br />
<marquee direction="up" height="150" loop="true" scrollamount="3" class="style6" style="CURSOR:default" onMouseOver="this.stop()" onMouseOut="this.start()">
                    <span class="mbr-contacts__text">
                    <?= $db->newmember(1, "home"); ?>
                    </span>                    </marquee>
        </tr>
    </table>
</div>         
 <div class="span3">
    <a class="to-top" href="#top-page">SPONSOR</a>
	<br /><br /><br />
<ul>
                      <li>Username: <span class="bank"><span class="style5">
                        <?= $db->dataku("username", $ref); ?>
                      </span></span> </li>
                      <li>Nama: 
                        <?= $db->dataku("nama", $id); ?> 
                      </li>
                      <li>Kota: 
                        <?= $db->dataku("kota", $id); ?> 
                      </li>
                      <li>Telp/hp: 
                        <?= $db->dataku("hp", $id); ?>
                    </ul>
					
<script type="text/javascript">var addthis_config = {"data_track_addressbar":false};</script>
<script type="text/javascript" src="../s7.addthis.com/js/300/addthis_widget.js#pubid=sandiwinter"></script>

    </div>
</div>      </div>
    </div>
    <!-- Generate time: 3.4575259685516, version: 1.5.8 -->
</div>






<style>
.wrap-search {
    background-image: url('gambar/bg_atas.jpg');   
}
</style>



<!-- The Gallery as lightbox dialog, should be a child element of the document body -->
<div id="blueimp-gallery" class="blueimp-gallery blueimp-gallery-controls">
    <div class="slides"></div>
    <h3 class="title"></h3>
    <a class="prev">‹</a>
    <a class="next">›</a>
    <a class="close">×</a>
    <a class="play-pause"></a>
    <ol class="indicator"></ol>
</div>

<script type="text/javascript">  var _gaq = _gaq || [];  _gaq.push(['_setAccount', 'UA-683342-5']);  _gaq.push(['_trackPageview']);  (function() {    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);  })();</script> 
  </body>
</html>