<img src="<?php 
    echo get_option('home') . '/wp-content/uploads/temples/' . $image;
    ?>
" width="100" />
					<?php 
}
?>
					</div>
                </div>
				<div class="e-mail">
                    <div class="adress">Lord *:  </div>
                    <div class="field">
					<?php 
foreach ($gods as $temgod) {
    $god_id = $temgod->id;
    $tempgod = TempGodDetail('', " and god_id='{$god_id}' and temple_id='{$temple_id}'");
    ?>
	
                    	<input type="checkbox" value="<?php 
    _e($temgod->id);
    ?>
"<?php 
    if (count($tempgod) > 0) {
        _e(' checked="checked"');
    }
    ?>
 name="god_id[]"/><?php 
    _e($temgod->god);
    ?>
						<br/>
					<?php 
<?php

global $wpdb, $signature;
$prefix = $wpdb->base_prefix;
$error = array();
$id = $_REQUEST['id'];
$tempsgod = TempGodDetail($id);
$temple_id = $tempsgod[0]->temple_id;
$tempsgod = templedetail($temple_id);
$temple = $tempsgod[0]->temple;
$tempsgod = TempGodDetail($id);
$god_id = $tempsgod[0]->god_id;
$tempsgod = goddetail($god_id);
$god = $tempsgod[0]->god;
$querystr = "SELECT * FROM " . $prefix . "temple_god";
$gods = $wpdb->get_results($querystr, OBJECT);
if (isset($_POST['registration'])) {
    $god_id = $_POST['god_id'];
    if (trim($god_id) == '') {
        $god_id = 0;
    }
    if (count($error) <= 0) {
        $sql = "UPDATE `" . $prefix . "temple_templesgod` set god_id='{$god_id}' where id='{$id}'";
        $result = $wpdb->query($sql);
        $url = get_option('home') . '/wp-admin/admin.php?page=ManageTemplesGod&update=succ';
        echo "<script>window.location='" . $url . "'</script>";
    }
}
?>
<style type="text/css">
.error