Tuesday, December 30, 2014

Remove index.php from url YII

Standard



create .htaccess under www-->yiisitename 

add following code on .htaccess


Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on

# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# otherwise forward it to index.php
RewriteRule . index.php

http://localhost/sitename/index.php   - default yii url

http://localhost/sitename/  - now run like this

Wednesday, December 17, 2014

datetime - How to Minus & pluse two dates in php

Standard

How do I return the  date as pulse & Minus?

add days


 
                    $date=date_create(date("Y-m-d"));
                    date_add($date,date_interval_create_from_date_string("10 days"));
                    echo date_format($date,"Y-m-d"); 
Minus days
 
                   $mydate = date("Y-m-d");

$lastday = strtotime("-1 days", strtotime($mydate));

echo date("Y-m-d", $lastday);

Tuesday, December 16, 2014

create CSV report in DB data YII

Standard

hi guys this is my testing code about yii  CSV report i created data table name as deal  and i created Deal control & crud

this is my data table



CREATE TABLE IF NOT EXISTS `deals` (
  `DealId` int(11) NOT NULL AUTO_INCREMENT,
  `DealName` varchar(255) NOT NULL,
  `Dealdescription` text NOT NULL,
  `Price` int(11) NOT NULL,
  `Discount` float NOT NULL,
  `StartingDate` varchar(50) NOT NULL,
  `EndingDate` varchar(50) NOT NULL,
  `DealCategory` varchar(45) NOT NULL,
  `DriverId` int(11) NOT NULL,
  `CreateDate` datetime NOT NULL,
  `ModifiedDate` datetime NOT NULL,
  `Status` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`DealId`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

this is my report funtion in deal controller


condition = "DealId=".$DealId;
                                    $models=  Deals::model()->findAll($criteria);
                                   // echo '
'.  print_r($models,1).'
'; // die(); // Pick a filename and destination directory for the file // Remember that the folder where you want to write the file has to be writable $filename =Yii::getPathOfAlias('webroot').'/report/'.$DealId.'_report_by_'.$DealId.".csv"; // Actually create the file // The w+ parameter will wipe out and overwrite any existing file with the same name $handle = fopen($filename, 'w+'); // Write the spreadsheet column titles / labels fputcsv($handle, array( 'Dea lId', 'Deal Name', 'Deal description', 'Price', 'Discount', 'Start Date', 'EndDate', 'Deal Category', 'Driver Name', 'Status', )); foreach($models as $row) { fputcsv($handle, array ( $row['DealId'], $row['DealName'], $row['Dealdescription'], $row['Price'], $row['Discount'], $row['StartingDate'], $row['EndingDate'], $row['DealCategory'], $row['DriverId'], $row['Status'], )); } // Finish writing the file fclose($handle); $this->redirect(Yii::app()->getBaseUrl(true).'/report/'.$DealId.'_report_by_'.$DealId.'.csv', array('target'=>'_blank')); } $this->render('report',array( 'report'=>$report, )); } }
then i add report.php in view deal folder
add following code in report.php
actionReport(1);

?>
now you can get csv file

thank

Monday, December 8, 2014

YII ACCESS RULES from data base

Standard

this is represent haw add user access for specific users in to page

i have 2 table 

  1. 1.user table
  2. 2.user level table

user table


CREATE TABLE IF NOT EXISTS `users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `username` varchar(20) NOT NULL,
  `password` varchar(128) NOT NULL,
  `email` varchar(128) NOT NULL,
  `Telephone` varchar(12) NOT NULL,
  `create_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `ModifiedDate` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `lastvisit_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `superuser` int(1) NOT NULL DEFAULT '0',
  `UserLevel` int(1) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `username` (`username`),
  UNIQUE KEY `email` (`email`),
  KEY `status` (`status`),
  KEY `superuser` (`superuser`)
);

Userlevel table

CREATE TABLE IF NOT EXISTS `userlevels` (
  `UserLevelId` int(11) NOT NULL AUTO_INCREMENT,
  `UserLevels` varchar(45) DEFAULT NULL,
  `CreateDate` datetime NOT NULL,
  `ModifiedDate` datetime NOT NULL,
  `Status` enum('0','1') NOT NULL DEFAULT '0',
  PRIMARY KEY (`UserLevelId`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ;

--
-- Dumping data for table `userlevels`
--

INSERT INTO `userlevels` (`UserLevelId`, `UserLevels`, `CreateDate`, `ModifiedDate`, `Status`) VALUES
(0, 'Guest', '0000-00-00 00:00:00', '0000-00-00 00:00:00', '0'),
(1, 'Admin', '2014-06-16 09:10:23', '0000-00-00 00:00:00', '1'),
(2, 'Staff', '2014-12-10 00:00:00', '0000-00-00 00:00:00', '1');

i created Userrule.php file under protect -> components folder


class Userrule extends CWebModule
{
 

 static private $_getaccess;
        
        public static function getAccess($userlevel) {
            
            if(is_array($userlevel))
                {
                 if (!self::$_getaccess) 
                 {
                $criteria = new CDbCriteria;
               $criteria->addInCondition('UserLevel',$userlevel,true); 


//                $criteria->params = array(':userlevel' => $userlevel);
                //Apply To Model
                $usernames = Users::model()->findAll($criteria);
//                echo '
'.  print_r($usernames,1).'
'; // die(); $Access_name = array(); foreach ($usernames as $username) array_push($Access_name,$username->username); self::$_getaccess = $Access_name; } return self::$_getaccess; } else { if (!self::$_getaccess) { $criteria = new CDbCriteria; $criteria->condition = 'UserLevel='.$userlevel; //Apply To Model $usernames = Users::model()->findAll($criteria); $Access_name = array(); foreach ($usernames as $username) array_push($Access_name,$username->username); self::$_getaccess = $Access_name; } return self::$_getaccess; } } }

in above param function  define which user should be access

now you can call this function  in to accessRules() in every controller & add which user level will be access


public function accessRules()
 {
  return array(
   array('allow',  // allow all users to perform 'index' and 'view' actions
    'actions'=>array('index','view'),
    'users'=>  Userrule::getAccess(array(0,1,6)),//send as array
   ),
                        array('allow',  // allow all users to perform 'index' and 'view' actions
    'actions'=>array('create'),
//    'users'=>  Userrule::getAccess(1),
                                'users'=>  Userrule::getAccess(array(1,6)),//send as array
//                            'users'=>array('admin','channa'),
   ),
   array('allow', // allow admin user to perform 'admin' and 'delete' actions
//    'actions'=>array('admin','delete'),
    'actions'=>array('delete','update'),
                            'users'=>  Userrule::getAccess(1),//send as variable
   ),
   array('deny',  // deny all users
    'users'=>array('*'),
   ),
  );
 }

sd

Friday, December 5, 2014

Yii User access rules

Standard



this for YII USER MODULE
Load and store the user's data every time a page is requested. To do this, modify the Controller class as follows:
i added this on  compound controller becouse  All controller classes for this application should extend from this base class.





          public function isGuest() {
            $user=User::model()->active()->findbyPk(Yii::app()->user->id);
//            print_r($user->superuser);
            if($user->superuser==0)
            {throw new CHttpException(403, 'You have no permission to view this content');}
           
            return UserModule::isAdmin();
        }

add this expression for all accessRules

 public function accessRules()
 {
            return array(

            array('allow', // allow admin user to perform 'admin' and 'delete' actions
                        'actions'=>array('index','view','delete', 'admin'),
                        'expression'=> $this->isAdmin(),
                        ),
                       
            );
 }



Thursday, December 4, 2014

YII Send Email & get Template content from database Part -2

Standard



i created template folder on view & create file name as user_registation.php


sample email template by channa smcs

add add this site controll In code comment u can get basic undestand about what i did

public function actionEmail()
 { 
//            echo '
'.(print_r($_POST,1)).'
'; if(isset($_POST)) { // get data on variable by channa $variables=array( '{fname}'=>'channa', '{lname}'=>'bandara', '{email}'=>'channasmcs@gmail.com', '{dob}'=>'1989-01-01', '{password}'=>'thisiamy password', ); // get template using template name by channa $templatedata= self::getemailtemple('User Registration Template') ;// function in controller(configuration) // get template data in to variable by channa $description=$templatedata->description; $subject=$templatedata->subject; // send $description $description to VariableReplaceArray by channa $emailbody= $this->VariableReplaceArray($description, $variables) ; //function in controller(configuration) // send email detail to templte using renderPartial by channa $emailbodydetail=array( 'emailbodydetail'=>$emailbody, ); // send message detail to template by channa $messageUser = $this->renderPartial('/template/user_register',$emailbodydetail,true); // set up email configuration by channa $name = 'channa'; $email = 'hellochannasmcs@gmail.com'; $Telephone = '0715977097'; $to = 'hellochannasmcs@hotmail.com'; $subject = $subject; $messageAdmin = "Deal Admin"; self::email($name, $email, $subject, $messageUser); self::email($name, $email, $subject, $messageAdmin, TRUE); // // echo '
'.(print_r($messageUser,1)).'
'; // echo '
'.(print_r($messageAdmin,1)).'
'; } // $this->renderPartial('/template/view'); $this->render('email'); } }
i added  this on controoler file in configuration folder


//        get email template from database by channa
         public static function getemailtemple($temppalatename) {
            
             return $templatedetail=  Emailtemplate::model()->find("name='".$temppalatename."'");
            
        }
  // repalce variable syntex related with initialz input by channa
        
                public function VariableReplaceArray($message,$variables) 
                {
//                    print_r($variable);
                    
                     $getvariableArray=array_keys($variables);
                     $replacevariableArray=array_values($variables);
                     return str_replace($getvariableArray,$replacevariableArray,$message);
                }
        

YII Send Email & get Template content from database Part -1

Standard


in priviouse blog  make send user email & admin email .
in this blog i coding sent email using email template  & get email content from data base .

1.create email template table to insert email data




CREATE TABLE IF NOT EXISTS `emailtemplate` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(55) NOT NULL,
  `variables` varchar(255) NOT NULL,
  `subject` varchar(255) NOT NULL,
  `description` text NOT NULL,
  `status` enum('1','0') NOT NULL DEFAULT '1' COMMENT '0=inactive,1=active',
  PRIMARY KEY (`id`),
  KEY `id` (`id`)
);

then  i created back end data manage option in my web site back end ..pretty cool



insert data like this 



INSERT INTO `emailtemplate` (`id`, `name`, `variables`, `subject`, `description`, `status`) VALUES
(1, 'User Registration Template', '{fname},{lname},{email},{dob}{password}', 'User Registration', '\r\n Thank You Regiter With Us ....

\r\n\r\n After you register, your request will be sent to the site administrator for approval. You will then receive an email with further instructions.

\r\n
\r\n Your name : {fname} {lname}
\r\n
\r\n Email : {email}
\r\n
\r\n DOB: {dob}
\r\n
\r\n Password: {password}
\r\n
\r\n Thank you
\r\n
\r\n Stream line staff
\r\n', '1');
now back end look like this


i initialize variable for uni q detail variable is static & we can use it globally

                   please see        Part -2



send email YII

Standard



In this tutorial, how to send user email & admin email .most developers are doesn't like  use extension i think that is good because that extension may be  have unnecessary things we need .but extension  is very helpful for reduce our coding time  .for this complete mr. gayan senjeewa  help  & i really appreciate for that .thanks 

here code

i used to controller file on components folder because.All controller classes for this application should extend from this base class.

this is main email sending function .add this on  controller 



 
//Controller in confuguration
 public static function email($userName, $userEmail, $subject, $message, $toAdmin = FALSE, $isCC = FALSE) {
            $subject='=?UTF-8?B?'.base64_encode($subject).'?=';
            $to = '';
            $from = '';
            $cc = '';
            
            if ($toAdmin) {
                $to = 'admin@mail.com';//admin Email
                $from = 'supportemail@mail.com'; //support user email for 

                
            } else {
                $to = $userEmail;
                $from =  'admin@mail.com';//admin Email
            }
            
            if($isCC) {
                $headers="From: <{$from}>\r\n".
                        "Cc: {$from}\r\n".
                        "Reply-To: {$from}\r\n".
                        "MIME-Version: 1.0\r\n".
                        "Content-Transfer-Encoding: 8bit\r\n".
                        "Content-Type: text/html; charset=ISO-8859-1\r\n";
            } else {
                $headers="From: <{$from}>\r\n".
                        "Reply-To: {$from}\r\n".
                        "MIME-Version: 1.0\r\n".
                        "Content-Transfer-Encoding: 8bit\r\n".
                        "Content-Type: text/html; charset=ISO-8859-1\r\n";
            }
            
            return mail($to, $subject,$message,$headers);
        }

i update actionContact funtion


 public function actionContact()
 {
  $model=new ContactForm;
  if(isset($_POST['ContactForm']))
  {

//   $model->attributes=$_POST['ContactForm'];
   if($model->validate())
   {
//    $name='=?UTF-8?B?'.base64_encode($model->name).'?=';
//    $subject='=?UTF-8?B?'.base64_encode($model->subject).'?=';
//    $headers="From: $name <{$model->email}>\r\n".
//     "Reply-To: {$model->email}\r\n".
//     "MIME-Version: 1.0\r\n".
//     "Content-Type: text/plain; charset=UTF-8";
//
//    mail(Yii::app()->params['adminEmail'],$subject,$model->body,$headers);
//    
                $name = $model->name;
                $email = $model->email;
                $Telephone = '0715977097';
                $to = 'admin@mail.com';
                $subject = $model->subject;
                    
                $messageUser = "Thank you for contacting us";
                      
                $messageAdmin = "
                Deal Admin,   
                
                you have email from   $model->name from $model->email
        
                $model->body
                thank you
                    
                ";
                self::email($name, $email, $subject, $messageUser);//send mail to user
                self::email($name, $email, $subject, $messageAdmin, TRUE);//send mail to admin  
    Yii::app()->user->setFlash('contact','Thank you for contacting us. We will respond to you as soon as possible.');
    $this->refresh();
   }
  }
  $this->render('contact',array('model'=>$model));
 }

Monday, December 1, 2014

get image on Gridview YII

Standard




in this  you can call image view on YII grid view


<!--
 

 widget('zii.widgets.grid.CGridView', array( 
                'id'=>'modelname-grid',
                'dataProvider'=>$media->search(),
                'filter'=>$media,
                'columns'=>array(
//          'id',
                        array(       
                                    'name'=>'url',
                                    'header'=>'url ',
                                    'value'=>'CHtml::image(Yii::app()->request->baseUrl."/images/media/".$data->url,
                                     "",
                                     array(\'width\'=>100, \'height\'=>60))',
                                     'type'=>'raw',
                                ),
  'name',
  'createdate',
                        array(
                                'class'=>'CButtonColumn',
                                'template'=>'{delete}',
                        ),
                ),
        )); ?>





Thursday, November 27, 2014

Yii Gridview CButton style

Standard




This  code shows about how to add a custom button with your own icon for your CGridView of Yii framework.“view”, “update”, “delete” button and it have corresponding actions. We can change it using CButtonColumn properties.




 widget('zii.widgets.grid.CGridView', array(
                'id'=>'modelname-grid',
                'dataProvider'=>$model->search(),
                'filter'=>$model,
                'columns'=>array(
          'rowname1',
  'rowname2',  
                        array(
                                'class'=>'CButtonColumn',
                                'template'=>'{view}{update}{delete}',
                            'deleteButtonImageUrl' => Yii::app()->theme->baseUrl .'/images/'.'close-button.png',
                            'deleteButtonOptions'=>array(
                                    'class'=>'delete_class',
                                    'id'=>'delete_id',
                                    ),
                            'updateButtonImageUrl' => Yii::app()->theme->baseUrl .'/images/'.'edit-button.png',
                            'updateButtonOptions'=>array(
                                    'class'=>'update_class',
                                    'id'=>'update_id',
                                    ),
                            'viewButtonImageUrl' => Yii::app()->theme->baseUrl .'/images/'.'view-button.png',
                            'viewButtonOptions'=>array(
                                    'class'=>'view_class',
                                    'id'=>'view_id',
                                    ),

                        ),
                ),
        )); ?>


 

if you want add this in YII framework follow this

open \CButtonColumn.php

..\yii\framework\zii\widgets\grid\CButtonColumn.php

defult code[line 215] function initDefaultButtons()

 


protected function initDefaultButtons()
 {
  if($this->viewButtonLabel===null)
   $this->viewButtonLabel=Yii::t('zii','View');
  if($this->updateButtonLabel===null)
   $this->updateButtonLabel=Yii::t('zii','Update');
  if($this->deleteButtonLabel===null)
   $this->deleteButtonLabel=Yii::t('zii','Delete');
  if($this->viewButtonImageUrl===null)
   $this->viewButtonImageUrl=$this->grid->baseScriptUrl.'/view.png';
  if($this->updateButtonImageUrl===null)
   $this->updateButtonImageUrl=$this->grid->baseScriptUrl.'/update.png';
  if($this->deleteButtonImageUrl===null)
   $this->deleteButtonImageUrl=$this->grid->baseScriptUrl.'/delete.png';
   
   
}   


 


update code function initDefaultButtons()

 


protected function initDefaultButtons()
 {
  if($this->viewButtonLabel===null)
   $this->viewButtonLabel=Yii::t('zii','View');
  if($this->updateButtonLabel===null)
   $this->updateButtonLabel=Yii::t('zii','Update');
  if($this->deleteButtonLabel===null)
   $this->deleteButtonLabel=Yii::t('zii','Delete');
  if($this->viewButtonImageUrl===null)
   $this->viewButtonImageUrl=Yii::app()->theme->baseUrl .'/images/'.'view-button.png';                
  if($this->updateButtonImageUrl===null)
   $this->updateButtonImageUrl=Yii::app()->theme->baseUrl .'/images/'.'edit-button.png';
  if($this->deleteButtonImageUrl===null)
   $this->deleteButtonImageUrl=Yii::app()->theme->baseUrl .'/images/'.'close-button.png';
   
   
}   



Sharp AQUOS Android Smartphone

Standard


Sharp Corporation collaborated with frog's team of designers and technologists to create “Feel UX”, a new Android smartphone experience that is easy to use, highly personalized, and visually stunning.










STUNNING 3D REALISM ON SCREENThe AQUOS Phone's parallax barrier system—which imitates the parallax difference between our right and left eye—enables the display of vivid three-dimensional HD images without the need for glasses. The phone recognises if content is 2D or 3D at playback, and adjusts accordingly. You can even convert 2D images into 3D, and vice versa, simply by switching the parallax barrier on or off.


Experience a new level of brilliance with Sharp's 4.2-inch LCD and ProPix image processor—technology derived from our line of AQUOS TVs. Boasting 540 x 960p qHD resolution—a quarter that of full 1920 x 1080p HD—the wide screen gives greater dynamic impact to movies and gameplay.
You'll no longer need to zoom in when browsing the internet, with the LCD's outstanding resolution making small text easier to read.




Software features
Some of the Aquos Crystal's unique software features include a gesture motion called "Clip Now." In addition to holding the bottom volume key and power button to take a screenshot, users can swipe the top edge of the display and save screenshots into a Clip Now image folder.














Get Country of IP Address with PHP

Standard





I'm trying to put together a PHP script that I can query from any web browser and it returns the Country of the IP address that accessed the PHP script


There are various web APIs that will do this for you. Here's an example using http://ipinfo.io:


          $ip = $_SERVER['REMOTE_ADDR'];
$details = json_decode(file_get_contents("http://ipinfo.io/{$ip}"));
echo $details;

  








 Here's an example using http://www.geoplugin.net/json.gp





$ip = $_SERVER['REMOTE_ADDR'];
$details = json_decode(file_get_contents("http://www.geoplugin.net/json.gp?ip={$ip}"));
echo $details;

      







Wednesday, November 26, 2014

YII Add Loading IMAGE on ajex

Standard



beginWidget('CActiveForm', array(
                                        'id'=>'listings-getdata_Ajax',                                    
                                        'enableAjaxValidation'=>FALSE,
                                )); ?>
             
                   params['Radius'],
                             array(
                               'ajax'=>array(
                                 'type'=>'POST',
                                  'url'=>CController::createUrl('listings/getdata_Ajax'),                            
                                    'update'=>'#getdata',
                                   'data' => array(
                                        'Getdata[radius]'=>'js:this.value',
                                        'Getdata[city]'=>$model->PhysicalCity,
                                             )
                                     ),
                                    'class'=>'form-control input-sm',
                                     'empty'=>'Select Province',
                                    'required'=>TRUE,
                                     )
                                    );
                        ?>
                        clientScript->registerScript('loaderScript', '
                             $("#loader")
                             .hide()
                             .ajaxStart(function() {
                                 $(this).show();
                             })
                             .ajaxStop(function() {
                                 $(this).hide();
                             });', CClientScript::POS_END);
                         ?>

                    theme->baseUrl.'/images/loader.gif', '', array('id' => 'loader', 'style' => ''));?>
             


 public function actionGetdata_Ajax()
             
 {
      echo 'hello';
        }
             

      

create div stick to top when scrolled

Standard
There are times when you would want to display a DIV bar at the top of the page when your scrolls on the page top or down  and it should go back to its original position when the user scrolls back up.
jQuery code:

/ executed when the viewr scrolls the page.
$(window).scroll(function(e) {
    // Get the position of the location where the scroller starts.
    var scroller_anchor = $(".scroller_anchor").offset().top;
     
    // Check if the user has scrolled and the current position is after the scroller start location and if its not already fixed at the top
    if ($(this).scrollTop() >= scroller_anchor && $('.scroller').css('position') != 'fixed')
    {    // Change the CSS of the scroller to hilight it and fix it at the top of the screen.
        $('.scroller').css({
            'background': '#CCC',
            'border': '1px solid #000',
            'position': 'fixed',
            'top': '0px'
        });
        // Changing the height of the scroller anchor to that of scroller so that there is no change in the overall height of the page.
        $('.scroller_anchor').css('height', '50px');
    }
    else if ($(this).scrollTop() < scroller_anchor && $('.scroller').css('position') != 'relative')
    {    // If the user has scrolled back to the location above the scroller anchor place it back into the content.
         
        // Change the height of the scroller anchor to 0 and now we will be adding the scroller back to the content.
        $('.scroller_anchor').css('height', '0px');
         
        // Change the CSS and put it back to its original position.
        $('.scroller').css({
            'background': '#FFF',
            'border': '1px solid #CCC',
            'position': 'relative'
        });
    }
});

             

      
HTML Code:
What if drugs were legal? Could you imagine what it would do to our society? Well according to John E. LeMoult, a lawyer with twenty years of experience on the subject, feels we should at least consider it. I would like to comment on his article "Legalize Drugs" in the June 15, 1984, issue of the New York Times. I disagree with LeMoult's idea of legalizing drugs to cut the cost of crime.
This is the scrollable bar
What if drugs were legal? Could you imagine what it would do to our society? Well according to John E. LeMoult, a lawyer with twenty years of experience on the subject, feels we should at least consider it. I would like to comment on his article "Legalize Drugs" in the June 15, 1984, issue of the New York Times. I disagree with LeMoult's idea of legalizing drugs to cut the cost of crime.
CSSCode:

.container{font-size:14px; margin:0 auto; width:960px}
.test_content{margin:10px 0;}
.scroller_anchor{height:0px; margin:0; padding:0;}

.scroller{background:#FFF; border:1px solid #CCC; margin:0 0 10px; z-index:100; height:50px; font-size:18px; font-weight:bold; text-align:center; width:960px;}

      

website's content on the Twitter wall Yii

Standard



Add buttons to your website to help your visitors share content and connect on Twitter.

 

		
	
      

website's content on the faebook wall Yii

Standard





post my website's content on the faebook wall. who want to share it.

<pre class="java" name="code"><div id="fb-root">
</div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

<div class="fb-share-button" data-href="&lt;?php echo Yii::app()-&gt;theme-&gt;baseUrl;?&gt;/index.php/listings/&lt;?php echo $model-&gt;ListingId; ?&gt;" data-type="button_count" data-width="200">
</div>
&lt;!--<div class="fb-share-button" data-href="http://channasmcs.blogspot.com/2014/09/onclick-selected-value-in-input-box.html" data-type="button_count" data-width="200">
</div>
<div class="fb-share-button" data-href="https://developers.facebook.com/docs/plugins/" data-type="box_count">
</div>
</pre>


Sunday, November 16, 2014

GRID & LIST Switch by Using Bootstrap

Standard




HTML Code:
Category Title

Product title

Product description... Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.

$21.000

Product title

Product description... Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.

$21.000

Product title

Product description... Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.

$21.000

Product title

Product description... Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.

$21.000

Product title

Product description... Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.

$21.000

Product title

Product description... Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.

$21.000


CSS Code:

      

JQ Code:

      

                                                                              GRID




LIST






Thursday, October 30, 2014

map directions when add address Google map

Standard



HTML Code:

CSS Code:

    
      

JS Code:




      


Friday, October 24, 2014

Rating star html & JS

Standard



html Code:


JS Code:
 


      

b>CSS Code:
  

      
// ------------------- show rate only -----------------------------------------


 // ------------------- show rate only -----------------------------------------
 
   

Thursday, October 23, 2014

Wednesday, October 22, 2014

Nearest-location finder radius for MySQL

Standard



CREATE TABLE IF NOT EXISTS `location` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `iso` varchar(50) DEFAULT NULL,
  `local_name` varchar(255) DEFAULT NULL,
  `type` char(2) DEFAULT NULL,
  `in_location` int(11) unsigned DEFAULT NULL,
  `geo_lat` double(18,11) DEFAULT NULL,
  `geo_lng` double(18,11) DEFAULT NULL,
  `db_id` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=108477 ;


 INTO `location` (`id`, `iso`, `local_name`, `type`, `in_location`, `geo_lat`, `geo_lng`, `db_id`) VALUES
(244, 'ZA', 'South Africa\r\n', 'CO', NULL, -29.00000000000, 24.00000000000, 'ZA'),
(4379, 'ZA-05', 'Eastern Cape\r', 'RE', 244, NULL, NULL, '4322'),
(4380, 'ZA-03', 'Free State\r', 'RE', 244, NULL, NULL, '4323'),
(4381, 'ZA-06', 'Gauteng\r', 'RE', 244, NULL, NULL, '4324'),
(4382, 'ZA-02', 'KwaZulu-Natal\r', 'RE', 244, NULL, NULL, '4325'),
(4383, 'ZA-09', 'Limpopo\r', 'RE', 244, NULL, NULL, '4326'),
(4384, 'ZA-07', 'Mpumalanga\r', 'RE', 244, NULL, NULL, '4327'),
(4385, 'ZA-10', 'North-West\r', 'RE', 244, NULL, NULL, '4328'),
(4386, 'ZA-08', 'Northern Cape\r', 'RE', 244, NULL, NULL, '4329'),
(4387, 'ZA-11', 'Western Cape\r', 'RE', 244, NULL, NULL, '4330'),
(8689, 'ZA-11-104061', 'Cape Town', 'CI', 4387, -33.91670000000, 18.41670000000, '104061'),
(8690, 'ZA-06-104062', 'Pretoria', 'CI', 4381, -25.70690000000, 28.22940000000, '104062'),
(8691, 'ZA-02-104063', 'Pietermaritzburg', 'CI', 4382, -29.61670000000, 30.38330000000, '104063'),
(8692, 'ZA-10-104064', 'Potchefstroom', 'CI', 4385, -26.71670000000, 27.10000000000, '104064'),
(8693, 'ZA-03-104065', 'Bloemfontein', 'CI', 4380, -29.13330000000, 26.20000000000, '104065'),
(8694, 'ZA-02-104066', 'Durban', 'CI', 4382, -29.85000000000, 31.01670000000, '104066'),
(8695, 'ZA-05-104067', 'Grahamstown', 'CI', 4379, -33.30000000000, 26.53330000000, '104067'),
(8696, 'ZA-11-104068', 'Stellenbosch', 'CI', 4387, -33.93330000000, 18.85000000000, '104068'),
(8697, 'ZA-06-104069', 'Sandton', 'CI', 4381, -26.05000000000, 27.96670000000, '104069'),
(8698, 'ZA-06-104070', 'Johannesburg', 'CI', 4381, -26.20000000000, 28.08330000000, '104070'),
(8699, 'ZA-05-104071', 'Uitenhage', 'CI', 4379, -33.76530000000, 25.40220000000, '104071'),
(8700, 'ZA-06-104072', 'Parkview', 'CI', 4381, -26.16670000000, 28.03330000000, '104072'),
(8701, 'ZA-11-104073', 'Wynberg', 'CI', 4387, -33.98330000000, 18.40000000000, '104073'),
(8702, 'ZA-06-104074', 'Bedfordview', 'CI', 4381, -26.16670000000, 28.15000000000, '104074'),
(8703, 'ZA-11-104075', 'Parow', 'CI', 4387, -33.90000000000, 18.60000000000, '104075'),
(8704, 'ZA-06-104076', 'Vanderbijlpark', 'CI', 4381, -26.70000000000, 27.81670000000, '104076'),
(8705, 'ZA-07-104077', 'Middelburg', 'CI', 4384, -25.78330000000, 29.46670000000, '104077'),
(8706, 'ZA-06-104078', 'Marshalltown', 'CI', 4381, -26.20000000000, 28.08330000000, '104078'),
(8707, 'ZA-05-104079', 'East London', 'CI', 4379, -33.03330000000, 27.91670000000, '104079'),
(8708, 'ZA-06-104080', 'Olifantsfontein', 'CI', 4381, -25.96390000000, 28.23940000000, '104080'),
(8709, 'ZA-06-104081', 'Lynnwood', 'CI', 4381, -25.76170000000, 28.27750000000, '104081'),
(8710, 'ZA-06-104082', 'Rosslyn', 'CI', 4381, -25.62420000000, 28.09420000000, '104082'),
(8711, 'ZA-06-104083', 'Houghton', 'CI', 4381, -26.15000000000, 28.05000000000, '104083'),
(8712, 'ZA-06-104084', 'Silverton', 'CI', 4381, -25.73170000000, 28.33470000000, '104084'),
(8713, 'ZA-11-104085', 'Roggebaai', 'CI', 4387, -33.91670000000, 18.43330000000, '104085'),
(8714, 'ZA-06-104086', 'Midrand', 'CI', 4381, -25.96360000000, 28.13780000000, '104086'),
(8715, 'ZA-05-104087', 'Braamfontein', 'CI', 4379, -31.40000000000, 26.48330000000, '104087'),
(8717, 'ZA-11-104089', 'Waverley', 'CI', 4387, -33.41670000000, 19.23330000000, '104089'),
(8718, 'ZA-06-104090', 'Parktown', 'CI', 4381, -26.16670000000, 28.03330000000, '104090'),
(8719, 'ZA-05-104091', 'Hogsback', 'CI', 4379, -32.58330000000, 26.95000000000, '104091'),
(8720, 'ZA-08-104092', 'Modderfontein', 'CI', 4386, -28.81670000000, 17.16670000000, '104092'),
(8721, 'ZA-02-104093', 'Umhlanga Rocks', 'CI', 4382, -29.71670000000, 31.06670000000, '104093'),
(8726, 'ZA-11-104098', 'Faure', 'CI', 4387, -34.03330000000, 18.73330000000, '104098'),
(8727, 'ZA-05-104099', 'Alice', 'CI', 4379, -32.78330000000, 26.83330000000, '104099'),
(8728, 'ZA-10-104100', 'Medunsa', 'CI', 4385, -25.61890000000, 28.02280000000, '104100'),
(8729, 'ZA-05-104101', 'Port Elizabeth', 'CI', 4379, -33.96670000000, 25.58330000000, '104101'),
(8730, 'ZA-11-104102', 'Elsenburg', 'CI', 4387, -33.85000000000, 18.83330000000, '104102'),
(8731, 'ZA-06-104103', 'Craighall', 'CI', 4381, -26.11670000000, 28.01670000000, '104103'),
(8732, 'ZA-06-104104', 'Randburg', 'CI', 4381, -26.10000000000, 27.98330000000, '104104'),
(8733, 'ZA-06-104105', 'Rivonia', 'CI', 4381, -26.05000000000, 28.05000000000, '104105'),
(8734, 'ZA-11-104106', 'Claremont', 'CI', 4387, -33.98330000000, 18.46670000000, '104106'),
(8735, 'ZA-06-104107', 'Honeydew', 'CI', 4381, -26.06670000000, 27.93330000000, '104107'),
(8736, 'ZA-06-104108', 'Halfway House', 'CI', 4381, -25.98330000000, 28.11670000000, '104108'),
(8737, 'ZA-06-104109', 'Centurion', 'CI', 4381, -25.87440000000, 28.17060000000, '104109'),
(8738, 'ZA-05-104110', 'Umtata', 'CI', 4379, -31.58330000000, 28.78330000000, '104110'),
(8739, 'ZA-02-104111', 'Westville', 'CI', 4382, -29.83330000000, 30.93330000000, '104111'),
(8740, 'ZA-06-104112', 'Boksburg', 'CI', 4381, -26.21670000000, 28.25000000000, '104112'),
(8741, 'ZA-02-104113', 'Pinetown', 'CI', 4382, -29.81670000000, 30.85000000000, '104113'),
(8742, 'ZA-05-104114', 'Doornfontein', 'CI', 4379, -33.10000000000, 24.26670000000, '104114'),
(8743, 'ZA-06-104115', 'Onderstepoort', 'CI', 4381, -25.65060000000, 28.18420000000, '104115'),
(8744, 'ZA-02-104116', 'Greytown', 'CI', 4382, -29.06670000000, 30.58330000000, '104116'),
(8745, 'ZA-02-104117', 'Overport', 'CI', 4382, -29.83330000000, 31.00000000000, '104117'),
(8746, 'ZA-06-104118', 'Krugersdorp', 'CI', 4381, -26.10000000000, 27.76670000000, '104118'),
(8747, 'ZA-06-104119', 'Menlo Park', 'CI', 4381, -25.77110000000, 28.30780000000, '104119'),
(8748, 'ZA-05-104120', 'Korsten', 'CI', 4379, -33.91670000000, 25.56670000000, '104120'),
(8749, 'ZA-11-104121', 'Sunnyside', 'CI', 4387, -33.96670000000, 18.51670000000, '104121'),
(8750, 'ZA-03-104122', 'Roodepoort', 'CI', 4380, -27.16670000000, 28.16670000000, '104122'),
(8791, 'ZA-06-104163', 'Kempton Park', 'CI', 4381, -26.10000000000, 28.25000000000, '104163'),
(8792, 'ZA-05-104164', 'Trust', 'CI', 4379, -31.43330000000, 27.60000000000, '104164'),
(8793, 'ZA-05-104165', 'Walmer', 'CI', 4379, -33.98330000000, 25.58330000000, '104165'),
(8794, 'ZA-11-104166', 'Elandsfontein', 'CI', 4387, -33.16670000000, 19.33330000000, '104166'),
(8795, 'ZA-06-104167', 'Maraisburg', 'CI', 4381, -26.16670000000, 27.93330000000, '104167'),
(8796, 'ZA-06-104168', 'Edenvale', 'CI', 4381, -26.13330000000, 28.18330000000, '104168'),
(8799, 'ZA-05-104171', 'Butterworth', 'CI', 4379, -32.33330000000, 28.15000000000, '104171'),
(8800, 'ZA-11-104172', 'Bellville', 'CI', 4387, -33.90000000000, 18.63330000000, '104172'),
(8801, 'ZA-03-104173', 'Welkom', 'CI', 4380, -27.98330000000, 26.73330000000, '104173'),
(8808, 'ZA-06-104180', 'Isando', 'CI', 4381, -26.15000000000, 28.20000000000, '104180'),
(8810, 'ZA-10-104182', 'Ga-Rankuwa', 'CI', 4385, -25.58830000000, 28.00780000000, '104182'),
(8811, 'ZA-10-104183', 'Mmabatho', 'CI', 4385, -25.85000000000, 25.63330000000, '104183'),
(8812, 'ZA-09-104184', 'Thohoyandou', 'CI', 4383, -22.95000000000, 30.48330000000, '104184'),
(8813, 'ZA-06-104185', 'Ferndale', 'CI', 4381, -26.08330000000, 27.98330000000, '104185'),
(8814, 'ZA-02-104186', 'New Germany', 'CI', 4382, -29.80000000000, 30.88330000000, '104186'),
(8815, 'ZA-02-104187', 'Empangeni', 'CI', 4382, -28.75000000000, 31.90000000000, '104187'),
(8816, 'ZA-06-104188', 'Vereeniging', 'CI', 4381, -26.66670000000, 27.93330000000, '104188'),
(8817, 'ZA-02-104189', 'Martin', 'CI', 4382, -30.85000000000, 30.06670000000, '104189'),
(8818, 'ZA-11-104190', 'Somerset West', 'CI', 4387, -34.08330000000, 18.85000000000, '104190'),
(8819, 'ZA-05-104191', 'Bedford', 'CI', 4379, -32.68330000000, 26.08330000000, '104191'),
(8820, 'ZA-06-104192', 'Bryanston', 'CI', 4381, -26.05000000000, 28.03330000000, '104192'),
(8821, 'ZA-02-104193', 'Kloof', 'CI', 4382, -29.78330000000, 30.83330000000, '104193'),
(8822, 'ZA-11-104194', 'Pinelands', 'CI', 4387, -33.91670000000, 18.50000000000, '104194'),
(8823, 'ZA-06-104195', 'Germiston', 'CI', 4381, -26.21670000000, 28.18330000000, '104195'),
(8824, 'ZA-11-104196', 'Stilbaai', 'CI', 4387, -34.36670000000, 21.41670000000, '104196'),
(8826, 'ZA-09-104198', 'Pietersburg', 'CI', 4383, -23.90000000000, 29.45000000000, '104198'),
(8827, 'ZA-02-104199', 'Newcastle', 'CI', 4382, -27.75000000000, 29.93330000000, '104199'),
(8828, 'ZA-05-104200', 'Beacon Bay', 'CI', 4379, -32.96670000000, 27.95000000000, '104200'),
(8829, 'ZA-05-104201', 'Westering', 'CI', 4379, -33.93780000000, 25.47560000000, '104201'),
(8831, 'ZA-06-104203', 'Waverly', 'CI', 4381, -26.13330000000, 28.08330000000, '104203'),
(8832, 'ZA-07-104204', 'Witbank', 'CI', 4384, -25.86670000000, 29.23330000000, '104204'),
(8833, 'ZA-06-104205', 'Morningside', 'CI', 4381, -26.06670000000, 28.05000000000, '104205'),
(8834, 'ZA-06-104206', 'Primrose', 'CI', 4381, -26.18330000000, 28.16670000000, '104206'),
(8835, 'ZA-11-104207', 'Hout Bay', 'CI', 4387, -34.03330000000, 18.35000000000, '104207'),
(8836, 'ZA-05-104208', 'Lyndhurst', 'CI', 4379, -30.73330000000, 26.50000000000, '104208'),
(8837, 'ZA-11-104209', 'Muizenberg', 'CI', 4387, -34.11670000000, 18.46670000000, '104209'),
(8839, 'ZA-06-104211', 'Monument Park', 'CI', 4381, -25.80000000000, 28.23330000000, '104211'),
(8903, 'ZA-05-104275', 'Peninsula', 'CI', 4379, -31.91670000000, 26.83330000000, '104275'),
(8904, 'ZA-06-104276', 'Soshanguve', 'CI', 4381, -25.51470000000, 28.10810000000, '104276'),
(8907, 'ZA-11-104279', 'Newlands', 'CI', 4387, -33.96670000000, 18.48330000000, '104279'),
(8908, 'ZA-10-104280', 'Atlanta', 'CI', 4385, -25.20000000000, 27.56670000000, '104280'),
(8910, 'ZA-06-104282', 'Parkhurst', 'CI', 4381, -26.13330000000, 28.01670000000, '104282'),
(8911, 'ZA-11-104283', 'New Horizons', 'CI', 4387, -34.05000000000, 23.33330000000, '104283'),
(8912, 'ZA-06-104284', 'Springs', 'CI', 4381, -26.25000000000, 28.46670000000, '104284'),
(8913, 'ZA-11-104285', 'Constantia', 'CI', 4387, -34.01670000000, 18.45000000000, '104285'),
(8916, 'ZA-11-104288', 'Malmesbury', 'CI', 4387, -33.45000000000, 18.73330000000, '104288'),
(8917, 'ZA-11-104289', 'Woodlands', 'CI', 4387, -34.10000000000, 18.38330000000, '104289'),
(8920, 'ZA-09-104292', 'Tzaneen', 'CI', 4383, -23.83330000000, 30.16670000000, '104292'),
(8921, 'ZA-11-104293', 'Mowbray', 'CI', 4387, -33.93330000000, 18.46670000000, '104293'),
(8922, 'ZA-11-104294', 'Rosebank', 'CI', 4387, -33.95000000000, 18.46670000000, '104294'),
(8923, 'ZA-05-104295', 'Riebeek', 'CI', 4379, -31.66670000000, 25.91670000000, '104295'),
(8924, 'ZA-11-104296', 'Oudtshoorn', 'CI', 4387, -33.58330000000, 22.20000000000, '104296'),
(8925, 'ZA-11-104297', 'Edgemead', 'CI', 4387, -33.88330000000, 18.53330000000, '104297'),
(8926, 'ZA-06-104298', 'Hatfield', 'CI', 4381, -25.74670000000, 28.22310000000, '104298'),
(8927, 'ZA-06-104299', 'Capital Park', 'CI', 4381, -25.72750000000, 28.20170000000, '104299'),
(8928, 'ZA-07-104300', 'Nelspruit', 'CI', 4384, -25.46670000000, 30.96670000000, '104300'),
(8929, 'ZA-03-104301', 'Fichardtpark', 'CI', 4380, -29.13330000000, 26.18330000000, '104301'),
(8930, 'ZA-06-104302', 'Northcliff', 'CI', 4381, -26.13330000000, 27.95000000000, '104302'),
(8931, 'ZA-11-104303', 'Bishopscourt', 'CI', 4387, -33.98330000000, 18.45000000000, '104303'),
(8932, 'ZA-06-104304', 'Laudium', 'CI', 4381, -25.78330000000, 28.10000000000, '104304'),
(8933, 'ZA-06-104305', 'Garsfontein', 'CI', 4381, -25.80080000000, 28.29560000000, '104305'),
(8934, 'ZA-03-104306', 'Lusaka', 'CI', 4380, -29.15000000000, 26.76670000000, '104306'),
(8935, 'ZA-08-104307', 'Campbell', 'CI', 4386, -28.80000000000, 23.70000000000, '104307'),
(8936, 'ZA-07-104308', 'Weltevreden', 'CI', 4384, -25.33330000000, 30.56670000000, '104308'),
(8937, 'ZA-06-104309', 'Westdene', 'CI', 4381, -26.16670000000, 27.98330000000, '104309'),
(8938, 'ZA-09-104310', 'Messina', 'CI', 4383, -22.35000000000, 30.05000000000, '104310'),
(8939, 'ZA-06-104311', 'Benoni', 'CI', 4381, -26.18330000000, 28.31670000000, '104311'),
(8940, 'ZA-02-104312', 'Mount Edgecombe', 'CI', 4382, -29.70000000000, 31.03330000000, '104312'),
(8941, 'ZA-11-104313', 'Sauer', 'CI', 4387, -32.85000000000, 18.56670000000, '104313'),
(8942, 'ZA-10-104314', 'Rustenburg', 'CI', 4385, -25.66670000000, 27.25000000000, '104314'),
(8943, 'ZA-05-104315', 'North End', 'CI', 4379, -33.93330000000, 25.60000000000, '104315'),
(8944, 'ZA-05-104316', 'Emerald Hill', 'CI', 4379, -34.00000000000, 25.55000000000, '104316'),
(8945, 'ZA-02-104317', 'Mobeni', 'CI', 4382, -29.95000000000, 30.95000000000, '104317'),
(8946, 'ZA-05-104318', 'Huguenot', 'CI', 4379, -31.08330000000, 26.60000000000, '104318'),
(8947, 'ZA-10-104319', 'Brits', 'CI', 4385, -25.63330000000, 27.78330000000, '104319'),
(8948, 'ZA-02-104320', 'Port Shepstone', 'CI', 4382, -30.75000000000, 30.45000000000, '104320'),
(8949, 'ZA-05-104321', 'Kwa-Zulu', 'CI', 4379, -31.43330000000, 29.40000000000, '104321'),
(8950, 'ZA-02-104322', 'La Lucia', 'CI', 4382, -29.73330000000, 31.05000000000, '104322'),
(8952, 'ZA-07-104324', 'London', 'CI', 4384, -24.76670000000, 30.86670000000, '104324'),
(8954, 'ZA-03-104326', 'Juta', 'CI', 4380, -30.25000000000, 26.66670000000, '104326'),
(8955, 'ZA-03-104327', 'Florida', 'CI', 4380, -29.93330000000, 26.15000000000, '104327'),
(8968, 'ZA-06-104340', 'Brakpan', 'CI', 4381, -26.23330000000, 28.36670000000, '104340'),
(8969, 'ZA-05-104341', 'Zwartkop', 'CI', 4379, -33.86670000000, 25.60000000000, '104341'),
(8970, 'ZA-06-104342', 'Fairland', 'CI', 4381, -26.13330000000, 27.90000000000, '104342'),
(8971, 'ZA-07-104343', 'Ermelo', 'CI', 4384, -26.53330000000, 29.98330000000, '104343'),
(8999, 'ZA-06-104371', 'Sandhurst', 'CI', 4381, -26.11670000000, 28.05000000000, '104371'),
(9006, 'ZA-11-104378', 'Green Point', 'CI', 4387, -33.91670000000, 18.40000000000, '104378'),
(9016, 'ZA-10-104388', 'Klerksdorp', 'CI', 4385, -26.86670000000, 26.66670000000, '104388'),
(9017, 'ZA-11-104389', 'Lansdowne', 'CI', 4387, -33.98330000000, 18.50000000000, '104389'),
(9018, 'ZA-02-104390', 'Point', 'CI', 4382, -29.86670000000, 31.05000000000, '104390'),
(9019, 'ZA-06-104391', 'Sandown', 'CI', 4381, -26.10000000000, 28.06670000000, '104391'),
(19801, 'ZA-11-115173', 'Mossel Bay', 'CI', 4387, -34.18330000000, 22.13330000000, '115173'),
(22309, 'ZA-11-117681', 'Paarl', 'CI', 4387, -33.73330000000, 18.96670000000, '117681'),
(22943, 'ZA-02-118315', 'Richards Bay', 'CI', 4382, -28.80000000000, 32.10000000000, '118315'),
(22944, 'ZA-11-118316', 'Brooklyn', 'CI', 4387, -33.91670000000, 18.48330000000, '118316'),
(22945, 'ZA-11-118317', 'Montana', 'CI', 4387, -33.41670000000, 19.21670000000, '118317'),
(22946, 'ZA-06-118318', 'Alberton', 'CI', 4381, -26.23330000000, 28.13330000000, '118318'),
(25264, 'ZA-05-120636', 'Waterkloof', 'CI', 4379, -31.68330000000, 26.05000000000, '120636'),
(25319, 'ZA-11-120691', 'Rawsonville', 'CI', 4387, -33.68330000000, 19.31670000000, '120691'),
(29957, 'ZA-11-125329', 'Wellington', 'CI', 4387, -33.63330000000, 19.00000000000, '125329'),
(30097, 'ZA-02-125469', 'Sherwood', 'CI', 4382, -29.83330000000, 30.98330000000, '125469'),
(30219, 'ZA-03-125591', 'Arlington', 'CI', 4380, -28.03330000000, 27.85000000000, '125591'),
(30583, 'ZA-09-125955', 'Windhoek', 'CI', 4383, -24.41670000000, 30.03330000000, '125955'),
(30842, 'ZA-05-126214', 'Melrose', 'CI', 4379, -33.43330000000, 25.95000000000, '126214'),
(30849, 'ZA-06-126221', 'Dunkeld', 'CI', 4381, -26.13330000000, 28.05000000000, '126221'),
(30879, 'ZA-02-126251', 'Jacobs', 'CI', 4382, -29.91670000000, 30.98330000000, '126251'),
(31026, 'ZA-05-126398', 'Horton', 'CI', 4379, -33.10000000000, 27.01670000000, '126398'),
(32666, 'ZA-06-128038', 'Alrode', 'CI', 4381, -26.30000000000, 28.13330000000, '128038'),
(32677, 'ZA-01-128049', 'Content', 'CI', 244, -28.23330000000, 24.85000000000, '128049'),
(33200, 'ZA-03-128572', 'Alfa', 'CI', 4380, -29.56670000000, 25.60000000000, '128572'),
(33267, 'ZA-08-128639', 'Upington', 'CI', 4386, -28.45000000000, 21.25000000000, '128639'),
(33294, 'ZA-11-128666', 'Saldanha', 'CI', 4387, -33.01670000000, 17.95000000000, '128666'),
(34003, 'ZA-05-129375', 'Union', 'CI', 4379, -31.40000000000, 28.15000000000, '129375'),
(34717, 'ZA-11-130089', 'Caledon', 'CI', 4387, -34.21670000000, 19.41670000000, '130089'),
(34915, 'ZA-03-130287', 'Villiers', 'CI', 4380, -27.03330000000, 28.60000000000, '130287'),
(35167, 'ZA-08-130539', 'Jackson', 'CI', 4386, -29.33330000000, 21.06670000000, '130539'),
(36182, 'ZA-11-131554', 'Brackenfell', 'CI', 4387, -33.86670000000, 18.68330000000, '131554'),
(36207, 'ZA-06-131579', 'Randfontein', 'CI', 4381, -26.16670000000, 27.70000000000, '131579'),
(36444, 'ZA-06-131816', 'Booysens', 'CI', 4381, -26.23330000000, 28.01670000000, '131816'),
(36989, 'ZA-05-132361', 'Outspan', 'CI', 4379, -30.71670000000, 26.76670000000, '132361'),
(38428, 'ZA-07-133800', 'Loding', 'CI', 4384, -25.10000000000, 28.76670000000, '133800'),
(41024, 'ZA-02-136396', 'Merebank', 'CI', 4382, -29.96670000000, 30.96670000000, '136396'),
(41479, 'ZA-05-136851', 'Main', 'CI', 4379, -31.90000000000, 27.95000000000, '136851'),
(43106, 'ZA-11-138478', 'Tokai', 'CI', 4387, -34.06670000000, 18.43330000000, '138478'),
(45030, 'ZA-06-140402', 'Cullinan', 'CI', 4381, -25.67560000000, 28.52220000000, '140402'),
(46865, 'ZA-11-142237', 'Milnerton', 'CI', 4387, -33.86670000000, 18.48330000000, '142237'),
(49808, 'ZA-08-145180', 'Sishen', 'CI', 4386, -27.78330000000, 22.98330000000, '145180'),
(49809, 'ZA-03-145181', 'Grootgeluk', 'CI', 4380, -29.43330000000, 25.98330000000, '145181'),
(51762, 'ZA-11-147134', 'Kaapstad', 'CI', 4387, -33.91670000000, 18.41670000000, '147134'),
(52560, 'ZA-05-147932', 'Bell', 'CI', 4379, -33.25000000000, 27.35000000000, '147932'),
(62618, 'ZA-02-157990', 'Hammarsdale', 'CI', 4382, -29.80000000000, 30.65000000000, '157990'),
(62794, 'ZA-10-158166', 'Avon', 'CI', 4385, -26.53330000000, 22.96670000000, '158166'),
(65181, 'ZA-02-160553', 'Victoria', 'CI', 4382, -29.58330000000, 31.13330000000, '160553'),
(85694, 'ZA-11-181066', 'Lakeside', 'CI', 4387, -34.08330000000, 18.45000000000, '181066'),
(85696, 'ZA-07-181068', 'Nooitgedacht', 'CI', 4384, -25.03330000000, 30.43330000000, '181068'),
(85721, 'ZA-06-181093', 'Kew', 'CI', 4381, -26.11670000000, 28.08330000000, '181093'),
(85963, 'ZA-06-181335', 'Northdene Estate', 'CI', 4381, -26.03330000000, 28.08330000000, '181335'),
(85970, 'ZA-11-181342', 'Danga', 'CI', 4387, -33.95000000000, 18.51670000000, '181342'),
(85987, 'ZA-03-181359', 'Langlaagte', 'CI', 4380, -29.88330000000, 26.11670000000, '181359'),
(88785, 'ZA-06-184157', 'Bronkhorstspruit', 'CI', 4381, -25.80830000000, 28.74060000000, '184157'),
(88800, 'ZA-11-184172', 'Steenberg', 'CI', 4387, -34.06670000000, 18.46670000000, '184172'),
(88801, 'ZA-11-184173', 'Knysna', 'CI', 4387, -34.03330000000, 23.03330000000, '184173'),
(88802, 'ZA-06-184174', 'Verwoerdburg', 'CI', 4381, -25.87440000000, 28.17060000000, '184174'),
(88832, 'ZA-11-184204', 'Atlantis', 'CI', 4387, -33.56670000000, 18.48330000000, '184204'),
(88833, 'ZA-06-184205', 'Westonaria', 'CI', 4381, -26.31670000000, 27.65000000000, '184205'),
(88834, 'ZA-11-184206', 'George', 'CI', 4387, -33.96670000000, 22.45000000000, '184206'),
(88835, 'ZA-06-184207', 'Lyttelton', 'CI', 4381, -25.83330000000, 28.21670000000, '184207'),
(88836, 'ZA-11-184208', 'Melkbosstrand', 'CI', 4387, -33.73060000000, 18.43610000000, '184208'),
(88837, 'ZA-06-184209', 'Tembisa', 'CI', 4381, -25.99890000000, 28.22690000000, '184209'),
(88838, 'ZA-07-184210', 'Delmas', 'CI', 4384, -26.15000000000, 28.68330000000, '184210'),
(88839, 'ZA-11-184211', 'Worcester', 'CI', 4387, -33.65000000000, 19.43330000000, '184211'),
(88840, 'ZA-11-184212', 'Grabouw', 'CI', 4387, -34.15000000000, 19.01670000000, '184212'),
(88841, 'ZA-11-184213', 'Kingfisher Creek', 'CI', 4387, -34.01670000000, 22.80000000000, '184213'),
(88842, 'ZA-11-184214', 'Velddrift', 'CI', 4387, -32.78330000000, 18.16670000000, '184214'),
(88843, 'ZA-07-184215', 'Balfour', 'CI', 4384, -26.65000000000, 28.58330000000, '184215'),
(88844, 'ZA-06-184216', 'Soweto', 'CI', 4381, -26.26670000000, 27.86670000000, '184216'),
(88845, 'ZA-10-184217', 'Fochville', 'CI', 4385, -26.48330000000, 27.50000000000, '184217'),
(88846, 'ZA-02-184218', 'Escombe', 'CI', 4382, -29.86670000000, 30.90000000000, '184218'),
(88847, 'ZA-02-184219', 'Umkomaas', 'CI', 4382, -30.20000000000, 30.80000000000, '184219'),
(88848, 'ZA-02-184220', 'Situndu', 'CI', 4382, -29.88330000000, 30.81670000000, '184220'),
(88849, 'ZA-02-184221', 'Scottsburgh', 'CI', 4382, -30.28330000000, 30.75000000000, '184221'),
(88850, 'ZA-02-184222', 'Vryheid', 'CI', 4382, -27.76670000000, 30.80000000000, '184222'),
(88851, 'ZA-02-184223', 'Emberton', 'CI', 4382, -29.78330000000, 30.80000000000, '184223'),
(88852, 'ZA-02-184224', 'Forest Hills', 'CI', 4382, -29.75000000000, 30.81670000000, '184224'),
(88853, 'ZA-02-184225', 'KwaNdengezi', 'CI', 4382, -29.85000000000, 30.78330000000, '184225'),
(88854, 'ZA-02-184226', 'Hillcrest', 'CI', 4382, -29.76670000000, 30.76670000000, '184226'),
(88855, 'ZA-02-184227', 'Droogdal', 'CI', 4382, -28.11670000000, 29.88330000000, '184227'),
(88856, 'ZA-02-184228', 'Gillitts', 'CI', 4382, -29.80000000000, 30.80000000000, '184228'),
(88857, 'ZA-02-184229', 'Gologodo', 'CI', 4382, -29.98330000000, 30.83330000000, '184229'),
(88858, 'ZA-02-184230', 'Glencoe', 'CI', 4382, -28.18330000000, 30.15000000000, '184230'),
(88859, 'ZA-02-184231', 'Chatsworth 1', 'CI', 4382, -29.91670000000, 30.90000000000, '184231'),
(88860, 'ZA-02-184232', 'Matatiele', 'CI', 4382, -30.33330000000, 28.80000000000, '184232'),
(88861, 'ZA-05-184233', 'Queenstown', 'CI', 4379, -31.90000000000, 26.88330000000, '184233'),
(88862, 'ZA-07-184234', 'Witrivier', 'CI', 4384, -25.31670000000, 31.01670000000, '184234'),
(88863, 'ZA-11-184235', 'Hermanus', 'CI', 4387, -34.41670000000, 19.23330000000, '184235'),
(88864, 'ZA-03-184236', 'Deneysville', 'CI', 4380, -26.88330000000, 28.10000000000, '184236'),
(88865, 'ZA-03-184237', 'Brandfort', 'CI', 4380, -28.70000000000, 26.46670000000, '184237'),
(88866, 'ZA-03-184238', 'Bethlehem', 'CI', 4380, -28.23330000000, 28.30000000000, '184238'),
(88867, 'ZA-07-184239', 'Kriel', 'CI', 4384, -26.26670000000, 29.23330000000, '184239'),
(88868, 'ZA-10-184240', 'Hartbeespoort', 'CI', 4385, -25.73330000000, 27.85000000000, '184240'),
(88869, 'ZA-10-184241', 'Temba', 'CI', 4385, -25.36500000000, 28.21890000000, '184241'),
(88870, 'ZA-07-184242', 'Rietkuil', 'CI', 4384, -25.95000000000, 29.78330000000, '184242'),
(88871, 'ZA-07-184243', 'Komatipoort', 'CI', 4384, -25.43330000000, 31.93330000000, '184243'),
(88872, 'ZA-02-184244', 'Sundumbili', 'CI', 4382, -29.13330000000, 31.40000000000, '184244'),
(88873, 'ZA-02-184245', 'Umlazi', 'CI', 4382, -29.96670000000, 30.88330000000, '184245'),
(88874, 'ZA-02-184246', 'Ballitoville', 'CI', 4382, -29.55000000000, 31.20000000000, '184246'),
(88875, 'ZA-02-184247', 'Empembeni', 'CI', 4382, -28.83330000000, 31.98330000000, '184247'),
(88876, 'ZA-02-184248', 'Stanger', 'CI', 4382, -29.33330000000, 31.30000000000, '184248'),
(88877, 'ZA-02-184249', 'Eshowe', 'CI', 4382, -28.88330000000, 31.46670000000, '184249'),
(88878, 'ZA-02-184250', 'Malukaze', 'CI', 4382, -29.98330000000, 30.88330000000, '184250'),
(88879, 'ZA-02-184251', 'Tongaat', 'CI', 4382, -29.58330000000, 31.13330000000, '184251'),
(88880, 'ZA-06-184252', 'Nigel', 'CI', 4381, -26.41670000000, 28.46670000000, '184252'),
(88881, 'ZA-05-184253', 'Bisho', 'CI', 4379, -32.86670000000, 27.43330000000, '184253'),
(88882, 'ZA-11-184254', 'Sedgefield', 'CI', 4387, -34.01670000000, 22.80000000000, '184254'),
(88883, 'ZA-11-184255', 'Bothastrand', 'CI', 4387, -34.05000000000, 22.26670000000, '184255'),
(88884, 'ZA-11-184256', 'Heroldsbaai', 'CI', 4387, -34.05000000000, 22.38330000000, '184256'),
(92964, 'ZA-07-188336', 'Malelane', 'CI', 4384, -25.48330000000, 31.51670000000, '188336'),
(106354, 'ZA-06-201726', 'Weltevredenpark', 'CI', 4381, -26.11670000000, 27.93330000000, '201726'),
(106560, 'ZA-07-201932', 'Standerton', 'CI', 4384, -26.95000000000, 29.25000000000, '201932'),
(106561, 'ZA-03-201933', 'Kroonstad', 'CI', 4380, -27.65000000000, 27.23330000000, '201933'),
(106562, 'ZA-03-201934', 'Reitz', 'CI', 4380, -27.80000000000, 28.43330000000, '201934'),
(106563, 'ZA-08-201935', 'Kimberley', 'CI', 4386, -28.73330000000, 24.76670000000, '201935'),
(106564, 'ZA-08-201936', 'Warrenton', 'CI', 4386, -28.11670000000, 24.85000000000, '201936'),
(106565, 'ZA-08-201937', 'Springbok', 'CI', 4386, -29.66670000000, 17.88330000000, '201937'),
(106566, 'ZA-02-201938', 'Winklespruit', 'CI', 4382, -30.10000000000, 30.85000000000, '201938'),
(106567, 'ZA-11-201939', 'Bovenfontein', 'CI', 4387, -33.13330000000, 18.33330000000, '201939'),
(106568, 'ZA-05-201940', 'Stutterheim', 'CI', 4379, -32.56670000000, 27.41670000000, '201940'),
(106569, 'ZA-05-201941', 'Graaff-Reinet', 'CI', 4379, -32.25000000000, 24.55000000000, '201941'),
(106570, 'ZA-05-201942', 'Kruisfontein', 'CI', 4379, -34.00000000000, 24.73330000000, '201942'),
(106571, 'ZA-05-201943', 'Kirkwood', 'CI', 4379, -33.41560000000, 25.44360000000, '201943'),
(106572, 'ZA-11-201944', 'Swellendam', 'CI', 4387, -34.03330000000, 20.43330000000, '201944'),
(106573, 'ZA-09-201945', 'Giyani', 'CI', 4383, -23.31670000000, 30.71670000000, '201945'),
(106574, 'ZA-09-201946', 'Duiwelskloof', 'CI', 4383, -23.70000000000, 30.13330000000, '201946'),
(106575, 'ZA-09-201947', 'Thabazimbi', 'CI', 4383, -24.60000000000, 27.40000000000, '201947'),
(106576, 'ZA-07-201948', 'Secunda', 'CI', 4384, -26.55000000000, 29.16670000000, '201948'),
(106577, 'ZA-07-201949', 'Belfast', 'CI', 4384, -25.68330000000, 30.03330000000, '201949'),
(106578, 'ZA-07-201950', 'De Hoop', 'CI', 4384, -24.96670000000, 29.95000000000, '201950'),
(106579, 'ZA-02-201951', 'Utrecht', 'CI', 4382, -27.65000000000, 30.33330000000, '201951'),
(106580, 'ZA-02-201952', 'Margate', 'CI', 4382, -30.85000000000, 30.36670000000, '201952'),
(106581, 'ZA-02-201953', 'Richmond', 'CI', 4382, -29.86670000000, 30.26670000000, '201953'),
(106582, 'ZA-02-201954', 'Ladysmith', 'CI', 4382, -28.55000000000, 29.78330000000, '201954'),
(106583, 'ZA-02-201955', 'Estcourt', 'CI', 4382, -29.00000000000, 29.88330000000, '201955'),
(106584, 'ZA-07-201956', 'Moolman', 'CI', 4384, -27.15000000000, 30.86670000000, '201956'),
(106585, 'ZA-07-201957', 'Piet Retief', 'CI', 4384, -27.00000000000, 30.80000000000, '201957'),
(106666, 'ZA-10-202038', 'Leeudoringstad', 'CI', 4385, -27.23330000000, 26.23330000000, '202038'),
(106726, 'ZA-03-202098', 'Virginia', 'CI', 4380, -28.11670000000, 26.90000000000, '202098'),
(106727, 'ZA-03-202099', 'Kraalfontein', 'CI', 4380, -30.35000000000, 26.05000000000, '202099'),
(106754, 'ZA-02-202126', 'Botha''s Hill', 'CI', 4382, -29.71670000000, 30.73330000000, '202126'),
(106755, 'ZA-11-202127', 'Durbanville', 'CI', 4387, -33.83330000000, 18.65000000000, '202127'),
(106756, 'ZA-06-202128', 'Strathavon', 'CI', 4381, -26.10000000000, 28.06670000000, '202128'),
(106757, 'ZA-05-202129', 'Cambridge', 'CI', 4379, -32.96670000000, 27.88330000000, '202129'),
(106758, 'ZA-11-202130', 'Bothasig', 'CI', 4387, -33.85000000000, 18.55000000000, '202130'),
(106759, 'ZA-11-202131', 'Still Bay', 'CI', 4387, -34.36670000000, 21.41670000000, '202131'),
(106760, 'ZA-11-202132', 'Melkhoutfontein', 'CI', 4387, -34.30000000000, 21.81670000000, '202132'),
(106762, 'ZA-06-202134', 'Boskruin', 'CI', 4381, -26.08330000000, 27.95000000000, '202134'),
(106763, 'ZA-03-202135', 'Ladybrand', 'CI', 4380, -29.20000000000, 27.45000000000, '202135'),
(106764, 'ZA-06-202136', 'Little Falls', 'CI', 4381, -26.11670000000, 27.88330000000, '202136'),
(106765, 'ZA-11-202137', 'Kensington', 'CI', 4387, -33.91670000000, 18.50000000000, '202137'),
(106766, 'ZA-11-202138', 'Strand', 'CI', 4387, -34.11670000000, 18.83330000000, '202138'),
(106767, 'ZA-11-202139', 'Goodwood', 'CI', 4387, -33.90000000000, 18.55000000000, '202139'),
(106768, 'ZA-05-202140', 'Doringkloof', 'CI', 4379, -33.61670000000, 26.00000000000, '202140'),
(108328, 'ZA-06-203700', 'Wingate Park', 'CI', 4381, -25.83330000000, 28.25000000000, '203700'),
(108329, 'ZA-02-203701', 'Mtubatuba', 'CI', 4382, -28.41670000000, 32.18330000000, '203701'),
(108330, 'ZA-11-203702', 'Elsiesrivier', 'CI', 4387, -33.91670000000, 18.56670000000, '203702'),
(108331, 'ZA-01-203703', 'Barkly West', 'CI', 244, -28.53330000000, 24.51670000000, '203703'),
(108376, 'ZA-02-203748', 'KwaPheshe', 'CI', 4382, -29.88330000000, 30.01670000000, '203748'),
(108377, 'ZA-07-203749', 'Bethal', 'CI', 4384, -26.43330000000, 29.46670000000, '203749'),
(108378, 'ZA-05-203750', 'Cliffdale', 'CI', 4379, -30.93330000000, 29.46670000000, '203750'),
(108379, 'ZA-02-203751', 'Colenso', 'CI', 4382, -28.73330000000, 29.81670000000, '203751'),
(108380, 'ZA-02-203752', 'Winston Park', 'CI', 4382, -29.81670000000, 30.78330000000, '203752'),
(108381, 'ZA-06-203753', 'Ekangala', 'CI', 4381, -25.69440000000, 28.74830000000, '203753'),
(108382, 'ZA-10-203754', 'Lichtenburg', 'CI', 4385, -26.15000000000, 26.16670000000, '203754'),
(108383, 'ZA-09-203755', 'Nylstroom', 'CI', 4383, -24.70000000000, 28.40000000000, '203755'),
(108384, 'ZA-09-203756', 'Xanthia', 'CI', 4383, -24.83330000000, 31.15000000000, '203756'),
(108385, 'ZA-05-203757', 'Aliwal North', 'CI', 4379, -30.70000000000, 26.70000000000, '203757'),
(108386, 'ZA-02-203758', 'Pinelands', 'CI', 4382, -29.83330000000, 30.85000000000, '203758'),
(108387, 'ZA-11-203759', 'Wilderness', 'CI', 4387, -33.96670000000, 22.56670000000, '203759'),
(108388, 'ZA-02-203760', 'Bergville', 'CI', 4382, -28.73330000000, 29.36670000000, '203760'),
(108389, 'ZA-03-203761', 'Allanridge', 'CI', 4380, -27.75000000000, 26.66670000000, '203761'),
(108390, 'ZA-06-203762', 'Fontainbleau', 'CI', 4381, -26.08330000000, 27.96670000000, '203762'),
(108391, 'ZA-09-203763', 'Hoedspruit', 'CI', 4383, -24.35000000000, 30.96670000000, '203763'),
(108392, 'ZA-02-203764', 'Shelly Beach', 'CI', 4382, -30.80000000000, 30.41670000000, '203764'),
(108393, 'ZA-06-203765', 'Roosevelt Park', 'CI', 4381, -26.15000000000, 27.98330000000, '203765'),
(108394, 'ZA-03-203766', 'Wesselsbron', 'CI', 4380, -27.85000000000, 26.36670000000, '203766'),
(108395, 'ZA-02-203767', 'Howick', 'CI', 4382, -29.46670000000, 30.23330000000, '203767'),
(108396, 'ZA-02-203768', 'Nottingham Road', 'CI', 4382, -29.35000000000, 29.98330000000, '203768'),
(108422, 'ZA-11-203794', 'Ceres', 'CI', 4387, -33.36670000000, 19.31670000000, '203794'),
(108423, 'ZA-11-203795', 'Cravenby', 'CI', 4387, -33.91670000000, 18.60000000000, '203795'),
(108424, 'ZA-11-203796', 'Kuils River', 'CI', 4387, -33.93330000000, 18.66670000000, '203796'),
(108425, 'ZA-02-203797', 'Mpumalanga', 'CI', 4382, -27.88330000000, 31.53330000000, '203797'),
(108426, 'ZA-09-203798', 'Letsitele', 'CI', 4383, -23.88330000000, 30.40000000000, '203798'),
(108427, 'ZA-11-203799', 'Vredendal', 'CI', 4387, -31.66670000000, 18.50000000000, '203799'),
(108428, 'ZA-02-203800', 'Inanda Seminary', 'CI', 4382, -29.71670000000, 30.91670000000, '203800'),
(108429, 'ZA-02-203801', 'Phoenix', 'CI', 4382, -29.71670000000, 31.01670000000, '203801'),
(108430, 'ZA-11-203802', 'Bayview', 'CI', 4387, -34.13330000000, 22.10000000000, '203802'),
(108431, 'ZA-11-203803', 'Hermon', 'CI', 4387, -33.43330000000, 18.96670000000, '203803'),
(108432, 'ZA-11-203804', 'Plettenberg Bay', 'CI', 4387, -34.05000000000, 23.36670000000, '203804'),
(108433, 'ZA-07-203805', 'Graskop', 'CI', 4384, -24.93330000000, 30.83330000000, '203805'),
(108443, 'ZA-09-203815', 'Phalaborwa', 'CI', 4383, -23.95000000000, 31.11670000000, '203815'),
(108448, 'ZA-07-203820', 'Damwal', 'CI', 4384, -25.40000000000, 29.35000000000, '203820'),
(108449, 'ZA-11-203821', 'Napier', 'CI', 4387, -34.46670000000, 19.90000000000, '203821'),
(108450, 'ZA-03-203822', 'Harrismith', 'CI', 4380, -28.28330000000, 29.13330000000, '203822'),
(108451, 'ZA-05-203823', 'Port Alfred', 'CI', 4379, -33.60000000000, 26.90000000000, '203823'),
(108452, 'ZA-02-203824', 'Didini', 'CI', 4382, -30.01670000000, 30.68330000000, '203824'),
(108453, 'ZA-03-203825', 'Petrus Steyn', 'CI', 4380, -27.65000000000, 28.13330000000, '203825'),
(108454, 'ZA-03-203826', 'Heilbron', 'CI', 4380, -27.28330000000, 27.96670000000, '203826'),
(108455, 'ZA-10-203827', 'Hellsgate', 'CI', 4385, -25.88330000000, 25.75000000000, '203827'),
(108471, 'ZA-02-203843', 'Umzumbe', 'CI', 4382, -30.61670000000, 30.55000000000, '203843'),
(108476, 'ZA-06-203848', 'Elsburg', 'CI', 4381, -26.23330000000, 28.20000000000, '203848');



SELECT *, ( 3959 * acos(
  cos( radians(-29.0) )
 * cos( radians( geo_lat ) )
 * cos( radians( geo_lng ) - radians(24.0) )
 + sin( radians(-29.0) )
 * sin( radians( geo_lat ) )
) ) AS distance FROM location HAVING distance < 100
 ORDER BY distance LIMIT 0 , 20

//                 SELECT ListingId, ( 3959 * acos(  
//  cos( radians(6.936088854160977) )  
// * cos( radians( Latitude ) )  
// * cos( radians( Longitude ) - radians(79.8515602254563) )  
// + sin( radians(6.936088854160977) )  
// * sin( radians( Latitude ) )  
//) ) AS distance FROM listings HAVING distance < 100
//ORDER BY `distance` LIMIT 0 , 10

change HAVING distance < 100 to get defferent out put