$temple = $temples[0];
$temple_id = $temple->id;
$image = $temple->image;
$thumimage = $image;
$accomodation = $temple->accomodation;
$accomodats = unserialize($accomodation);
$urchavar = Templeoption($temple_id, 'urchavar');
$mother = Templeoption($temple_id, 'mother');
$sacredtree = Templeoption($temple_id, 'sacredtree');
$tirtha = Templeoption($temple_id, 'tirtha');
$ecclesiasticus_pooja = Templeoption($temple_id, 'ecclesiasticus_pooja');
$creepy = Templeoption($temple_id, 'creepy');
$legendary_name = Templeoption($temple_id, 'legendary_name');
$trail = Templeoption($temple_id, 'trail');
$states = Statedetail($temple->state_id);
$cities = Citydetail($temple->city_id);
$templegalleries = templegallery($temple_id);
$radius = 100;
$cond = " and id!='{$temple_id}'";
$nearbytemples = nearbytemples($temple->latitude, $temple->longitude, $radius, $cond, 0, 20);
$showimage = '';
if (trim($image) != '' && file_exists('wp-content/uploads/temples/' . $image)) {
    list($imgwidth) = getimagesize('wp-content/uploads/temples/' . $image);
    /*if($imgwidth>781){
    	$imagepath=get_option('home').'/wp-content/plugins/temple/imagecrope.php?width=781&maxw=781&height=330&maxh=330&file='.get_option('home').'/wp-content/uploads/temples/'.$image;
    	}
    	else
    	{*/
    $imagepath = get_option('home') . '/wp-content/uploads/temples/' . $image;
    //}
    $showimage = '<div class="detail_img"><img src="' . $imagepath . '" alt="' . $temple->name . '" width="781" /></div>';
<?php

global $wpdb, $signature;
$prefix = $wpdb->base_prefix;
$error = array();
$id = $_REQUEST['id'];
$city = Citydetail($id);
$city_name = $city[0]->city;
$state_id = $city[0]->state_id;
$st = Statedetail($state_id);
$state = $st[0]->state;
$link = '&ho=listcity&state_id=' . $state_id;
$url = get_option('home') . '/wp-admin/admin.php?page=TempleState' . $link;
if (isset($_POST['registration'])) {
    $city = $_POST['city'];
    if (trim($city) == '') {
        array_push($error, 'Please enter city.');
    }
    if (count($error) <= 0) {
        $sql = "UPDATE `" . $prefix . "temple_city` set city='{$city}' where id='{$id}'";
        $result = $wpdb->query($sql);
        $url = $url . '&update=succ';
        echo "<script>window.location='" . $url . "'</script>";
    }
}
?>
<link href="<?php 
echo get_option('home');
?>
/wp-content/plugins/temple/css/pagedesign.css" rel="stylesheet" />
<script type="text/javascript" src="<?php 
        _e("City");
        ?>
</th>
            <th valign="top" align="left" style="border-left:1px solid #ccc;"><?php 
        _e("Action");
        ?>
</th>
		</tr>
	<?php 
        $cnt = $limitstart + 1;
        foreach ($temples as $temple) {
            $stateid = $temple->state_id;
            $st = Statedetail($stateid);
            $state = $st[0]->state;
            $cityid = $temple->city_id;
            $city = Citydetail($cityid);
            $city = $city[0]->city;
            ?>
	  <tr>
		<td valign="top" align="left" style="border-top:1px solid #ccc;">&nbsp;<?php 
            _e($cnt);
            ?>
</td>
		<td valign="top" align="left" style="border-top:1px solid #ccc; border-left:1px solid #ccc;"><?php 
            _e($temple->name);
            ?>
</td>
        <td valign="top" align="left" style="border-top:1px solid #ccc; border-left:1px solid #ccc;"><?php 
            _e($state);
            ?>
</td>