function updatetempleoption($temple_id, $field, $value) { global $wpdb; $prefix = $wpdb->base_prefix; $templeoption = Templeoption($temple_id, $field, true); if ($templeoption == '-0') { $sql = "INSERT INTO `" . $prefix . "temple_options` (`temple_id`, `option_key`, `option_value`) VALUES ('{$temple_id}', '{$field}', '{$value}')"; $result = $wpdb->query($sql); } else { $sql = "UPDATE `" . $prefix . "temple_options` set option_value='{$value}' where temple_id='{$temple_id}' and option_key='{$field}'"; $result = $wpdb->query($sql); } }
$location = $temple[0]->location; $nearrailway = $temple[0]->nearrailway; $nearairport = $temple[0]->nearairport; $accomodation = $temple[0]->accomodation; $post_id = $temple[0]->post_id; $accomodats = unserialize($accomodation); $stars = Stardetail(); $categories = Categorydetail(); $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'); $querystr = "SELECT * FROM " . $prefix . "temple_state"; $states = $wpdb->get_results($querystr, OBJECT); $querystr1 = "SELECT * FROM " . $prefix . "temple_city"; $cities = $wpdb->get_results($querystr1, OBJECT); $querystr2 = "SELECT * FROM " . $prefix . "temple_god"; $gods = $wpdb->get_results($querystr2, OBJECT); $packagetypes = packagetypedetail(); $packages = packagedetail("", " order by package_type_id asc"); $templeprices = templeprices($temple_id); $package_type_id = $templeprices[0]->package_type_id; if (isset($_POST['registration'])) { $name = $_POST['name']; if (trim($name) == '') { array($error, 'Please enter temple name.'); }