include "../lib/smarty.php"; if (!has_rights(ACX_MISC)) { Header("HTTP/1.0 401 Unauthorized"); Header("Location: PP_error.php?c=accessdenied"); die; } getpost_ifset(array('id', 'languages', 'subject', 'mailtext', 'translate_data', 'id_language')); $handle = DbConnect(); $instance_table = new Table(); /***********************************************************************************/ // #### HEADER SECTION $smarty->display('main.tpl'); if (isset($translate_data) && $translate_data == 'translate') { //print check_translated($id, $languages); if (check_translated($id, $languages)) { update_translation($id, $languages, $subject, $mailtext); } else { insert_translation($id, $languages, $subject, $mailtext); } } // Query to get mail template information $QUERY = "SELECT id,mailtype,subject,messagetext,id_language from cc_templatemail where id = {$id}"; if (isset($languages)) { $QUERY .= " and id_language = '{$languages}'"; } $mail = $instance_table->SQLExec($handle, $QUERY); // #### HELP SECTION echo $CC_help_list_misc; // Query to get all languages with ids $QUERY = "SELECT code,name from cc_iso639 order by code"; $result = $instance_table->SQLExec($handle, $QUERY);
if (!update_translation("UPDATE `translation` SET `text`='" . $hotel2 . "' WHERE `lang`='ro' and `title`='" . $found['hotel'] . "'")) { exit("Error"); } if (!update_translation("UPDATE `translation` SET `text`='" . $message . "' WHERE `lang`='ru' and `title`='" . $found['description'] . "'")) { exit("Error"); } if (!update_translation("UPDATE `translation` SET `text`='" . $message2 . "' WHERE `lang`='ro' and `title`='" . $found['description'] . "'")) { exit("Error"); } if (!update_translation("UPDATE `translation` SET `text`='" . $food_ru . "' WHERE `lang`='ru' and `title`='" . $found['food'] . "'")) { exit("Error"); } if (!update_translation("UPDATE `translation` SET `text`='" . $food_ro . "' WHERE `lang`='ro' and `title`='" . $found['food'] . "'")) { exit("Error"); } if (!update_translation("UPDATE `translation` SET `text`='" . $bus . "' WHERE `lang`='ru' and `title`='" . $found['autocar'] . "'")) { exit("Error"); } if (!update_translation("UPDATE `translation` SET `text`='" . $bus2 . "' WHERE `lang`='ro' and `title`='" . $found['autocar'] . "'")) { exit("Error"); } $upd = mysql_query("UPDATE `tour` SET `type_number`='{$number}',`price`='{$price}',`category`='{$cat}' WHERE `id`='{$id}'"); if ($upd) { redirect($admin_page . 'edit'); } else { echo mysql_error(); } } } else { echo 'Не найден ID'; }