Skip to content

Instantly share code, notes, and snippets.

@ivanscm
Forked from anonymous/gist:2881303
Created June 6, 2012 11:11
Show Gist options
  • Select an option

  • Save ivanscm/2881306 to your computer and use it in GitHub Desktop.

Select an option

Save ivanscm/2881306 to your computer and use it in GitHub Desktop.
<?php
defined( '_JEXEC' ) or die( 'Restricted access' );
include_once(JPATH_ROOT . "/templates/" . $this->template . '/vtemtools/default.php');
include_once(JPATH_ROOT . "/templates/" . $this->template . '/vtemtools/switcher.php');
include_once(JPATH_ROOT . "/templates/" . $this->template . '/vtemtools/css_browser_selector.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" class="<?php echo css_browser_selector() ?>" >
<head>
<jdoc:include type="head" />
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<link rel="stylesheet" href="<?php echo $this->baseurl ;?>/templates/system/css/system.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ;?>/templates/system/css/general.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ;?>/templates/<?php echo $this->template ;?>/css/template.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ;?>/templates/<?php echo $this->template ;?>/css/styles/<?php echo $TemplateStyle;?>.css" type="text/css" />
<script type="text/javascript" src="jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="jquery.color.js"></script>
<script type="text/javascript" src="jquery-ui-1.8.18.custom.min.js"></script>
<!--[if lte IE 6]>
<script src="<?php echo $this->baseurl ;?>/templates/<?php echo $this->template ;?>/vtemtools/warning.js"></script>
<script>window.onload=function(){e("<?php echo $this->baseurl ;?>/templates/<?php echo $this->template ;?>/images/")}</script>
<![endif]-->
</head>
<body id="vtem" style="font-size:<?php echo $this->params->get('Font_Size','12px'); ?>">
<div id="vt_wapper">
<div id="vt_header">
<div id="vt_logo"><a href="<?php echo $this->baseurl ;?>"><img src="templates/<?php echo $this->template ?>/images/logo_<?php echo $TemplateStyle;?>.png" alt="logo" /></a></div>
<?php if($this->countModules('user4')) : ?>
<div id="vt_search"><jdoc:include type="modules" name="user4" style="none" /></div>
<?php endif; ?>
<div class="clr"></div>
</div>
<div id="vt_main_top">
<div id="vt_main_bottom">
<div id="vt_main_middle">
<?php if($this->countModules('breadcrumb')) : ?>
<div id="vt_pathway">
<jdoc:include type="modules" name="breadcrumb" style="none" />
</div>
<?php endif; ?>
<?php if($this->countModules('menu')) : ?>
<div id="vt_main_menu">
<jdoc:include type="modules" name="menu" style="none" />
</div>
<?php endif; ?>
<div id="vt_main_item_top">
<div id="vt_main_item_bottom">
<div id="vt_main_item_middle">
<?php if($Layout == "lbr") : ?>
<?php if($this->countModules('left')) : ?>
<div id="dateSite">
<script type="text/javascript">
today = new Date();
NDat = new Array(
"Воскресенье",
"Понедельник",
"Вторник",
"Среда",
"Четверг",
"Пятница",
"Суббота");
Nmonth = new Array (
"Январь",
"Фефраль","Марта",
"АПРЕЛЬ","МАЙ","ИЮНЬ",
"ИЮЛЬ","АВГУСТ","СЕНТЯБРЬ",
"ОКТЯБРЬ","НОЯБРЬ","Декабря");
document.write("Сегодня: "+today.getDate()+" "+Nmonth[today.getMonth()]+" "+NDat[today.getDay()]+" "+today.getFullYear());
</script>
</div>
<div id="vt_nav_left" class="vt_auto_height">
<jdoc:include type="modules" name="left" style="vt_xhtml" />
</div>
<?php endif; ?>
<div id="vt_main_content_wapper" class="vt_auto_height">
<?php if($this->countModules('slide')) : ?>
<div id="vt_main_slide">
<jdoc:include type="modules" name="slide" style="none" />
</div>
<?php endif; ?>
<div id="vt_main_content">
<div id="vt_main_com" class="<?php echo $contentwidth;?>">
<jdoc:include type="component" />
<?php if($this->countModules('inset')) : ?>
<jdoc:include type="modules" name="inset" style="xhtml" />
<?php endif; ?>
</div>
<?php if($this->countModules('right')) : ?>
<div id="vt_nav_right" class="<?php echo $navright;?>">
<jdoc:include type="modules" name="right" style="vt_rounded" />
</div>
<?php endif; ?>
<div class="clr"></div>
</div>
</div>
<div class="clr"></div>
<?php else : ?>
<div id="vt_wapper_full_content">
<jdoc:include type="modules" name="wapper" style="none" />
</div>
<?php endif; ?>
</div>
</div>
</div>
<div id="vt_main_item_footer_top">
<div id="vt_main_item_footer_bottom">
<div id="vt_main_item_footer_middle">
<?php if ($this->countModules('footer1 + footer2 + footer3 + footer4 ')) : ?>
<div class="vt_footer_wrapper">
<?php if ($this->countModules('footer1')) { ?>
<div class="<?php echo $footermodulewidth; ?> <?php echo $footermodsep1; ?> floatleft">
<jdoc:include type="modules" name="footer1" style="xhtml" />
</div>
<?php } ?>
<?php if ($this->countModules('footer2')) { ?>
<div class="<?php echo $footermodulewidth; ?> <?php echo $footermodsep2; ?> floatleft">
<jdoc:include type="modules" name="footer2" style="xhtml" />
</div>
<?php } ?>
<?php if ($this->countModules('footer3')) { ?>
<div class="<?php echo $footermodulewidth; ?> <?php echo $footermodsep3; ?> floatleft">
<jdoc:include type="modules" name="footer3" style="xhtml" />
</div>
<?php } ?>
<?php if ($this->countModules('footer4')) { ?>
<div class="<?php echo $footermodulewidth; ?> floatleft">
<jdoc:include type="modules" name="footer4" style="xhtml" />
</div>
<?php } ?>
<div class="clr"></div>
</div>
<?php endif; ?>
</div>
</div>
</div>
<div id="vt_footer_menu_copyright">
<?php if ($this->countModules('footer_menu')) { ?>
<div id="vt_menu_footer"><jdoc:include type="modules" name="footer_menu" style="none" /></div>
<?php } ?>
<?php if ($this->countModules('footer')) { ?>
<div id="vt_copyright"><jdoc:include type="modules" name="footer" style="xhtml" /></div>
<?php } ?>
<div class="clr"></div>
</div>
</div>
</div>
</div>
<div id="vt_footer_transparent_left">
<div id="vt_footer_transparent_right">
<div id="vt_footer_transparent_center">
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(window).addEvent('load', function(){
(function(){
var vtMaxHeight = 0;
$ES('#vt_main_item_middle').each(function( item ){
if( item.offsetHeight.toInt() > vtMaxHeight ){
vtMaxHeight = item.offsetHeight.toInt();
}
});
if( vtMaxHeight > 0 ) { $ES('#vt_main_item_middle div.vt_auto_height').setStyle('height', vtMaxHeight);}
}).delay(100);
});
</script>
<script type="text/javascript">
$(document).ready(function(){
$("#Winalert").draggable().css("cursor","move");
$("#message").addClass("OpenOrder");
$("#sp_qc_submit").val("Отправить заказ");
$(":text").css("color","black");
$(":text").eq(4).css("color","green");
$('input').click(function() {
// $(this).css("color","black")
$(this).val("");
});
//$(this).focusout(function() {
//$('#FormName').val('Ваше имя');
//$('#FormNamber').val('Ваш контактный телефон');
//$('#FormEmail').val('Ваш Email');
//$('#NamUsl').val($('#Winalert span.head').text());
//});
$("#vt_menu ul li a span").hover(
function(){
$(this).stop().animate({color:"#FFFAF0",}, 500 )},
function(){
$(this).stop().animate({color:"#555",}, 500 )});
//-----Table action
$(".uslugi tr td").click(function(){
$("#Winalert div.info").text($(this).attr('title'));
$("#Winalert span.head").text($(this).text());
$("#FormName").val('Ваше имя');
$("#FormNamber").val('Ваш контактный телефон');
$("#FormEmail").val('Ваш Email');
$("#NamUsl").val($(this).text());
$("#message textarea").text("+380 ___ ___ __ __");
$("#Winalert").fadeIn();
});
$("#close").click(function(){
$("#Winalert").fadeOut();
});//Кнопка закрыть
//-----END Table action
$("#order").click(function(){
$("#message").toggleClass("OpenOrder");
});
});
</script>
<script type="text/javascript">
/*
код для таблицы
*/
var stripe = function() {
var tables = document.getElementsByTagName("table");
for(var x=0;x!=tables.length;x++){
var table = tables[x];
if (! table) { return; }
var tbodies = table.getElementsByTagName("tbody");
for (var h = 0; h < tbodies.length; h++) {
var even = true;
var trs = tbodies[h].getElementsByTagName("tr");
for (var i = 0; i < trs.length; i++) {
trs[i].onmouseover=function(){
this.className += " ruled"; return false
}
trs[i].onmouseout=function(){
this.className = this.className.replace("ruled", ""); return false
}
if(even)
trs[i].className += " even";
even = !even;
}
}
}
}
window.onload = stripe;
</script><!--Код табли-->
<div id="Winalert">
<div id="close">X</div>
<span class="head">www</span>
<div class="info">Нет информации</div>
<div id="order"><p>Заказать услугу</p></div>
<div id="logo"></div>
<div id="message">
<jdoc:include type="modules" name="Winalert" />
<?
error_reporting(0);
function show_form()
{
?>
<form action="" method=post>
<div align="left">
<input type="text" id="FormName" name="name" size="35" value="<?=substr(htmlspecialchars(trim($_POST['input_name'][0])), 0, 500);?>">*
<input type="hidden" name="check[]" value="2">
<input type="text" id="FormEmail" name="Email" size="35" value="<?=substr(htmlspecialchars(trim($_POST['input_name'][1])), 0, 500);?>">*
<input type="hidden" name="check[]" value="2">
<input type="text" id="FormNamber" name="Namber" size="35" value="<?=substr(htmlspecialchars(trim($_POST['input_name'][2])), 0, 500);?>">
<input type="hidden" name="check[]" value="2">
<input type="text" id="NamUsl" name="NameUsl" size="35" disabled value="<?=substr(htmlspecialchars(trim($_POST['input_name'][3])), 0, 500);?>">*
<input type="hidden" name="check[]" value="2">
</br><input class="Button" type="submit" value="Оформить заказ" name="submit">
</div>
</form><div align="center">* Помечены поля, которые необходимо заполнить</div>
<?
}
function complete_mail() {
echo '<meta charset="utf8">';
$empty_input[] = 'Имя';
$empty_input[] = 'Email';
$empty_input[] = 'Контактный телефон';
$empty_input[] = 'Название услуги';
for ($i=0; $i<count($_POST['input_name']); $i++) {
$_POST['input_name'][$i] = substr(htmlspecialchars(trim($_POST['input_name'][$i])), 0, 100000);
if(substr(htmlspecialchars(trim($_POST['check'][$i])), 0, 1) == 1) {
if(empty($_POST['input_name'][$i])) {
$sendemail = 'No';
echo '<br /><b>Необходимо заполнить поле '.$empty_input[$i].'!</b>';
}
}
}
if($sendemail == 'No') show_form();
echo '<h1>Ваше письмо не отправлено.</h1>';
alert($empty_input[$i]);
header("Location: services");
$mess .= '<b>Имя: </b>'.$_POST['input_name'][0].'<br />';
$mess .= '<b>Email: </b>'.$_POST['input_name'][1].'<br />';
$mess .= '<b>Контактный телефон: </b>'.$_POST['input_name'][2].'<br />';
$mess .= '<b>Название услуги: </b>'.$_POST['input_name'][3].'<br />';
// подключаем файл класса для отправки почты
require 'class.phpmailer.php';
$mail = new PHPMailer();
$mail->CharSet = 'utf-8';
$mail->From = 'Email'; // от кого email
$mail->FromName = 'Имя'; // от кого имя
$mail->AddAddress('[email protected]', '[email protected]'); // кому - адрес, Имя
$mail->IsHTML(true); // выставляем формат письма HTML
$mail->Subject = 'Тема'; // тема письма
$mail->Body = $mess;
if($sendemail != 'No'){
// отправляем наше письмо
if (!$mail->Send()) die ('Mailer Error: '.$mail->ErrorInfo);
echo '<h1>Спасибо! Ваше письмо отправлено.</h1>';
}
}
if (!empty($_POST['submit'])) complete_mail();
else show_form();
?>
</div> <!-- message -->
<div class="footer_K">Контактная информация
Телефон: +380 (50) 937-75-00
+380 (62) 345-01-81
+380 (62) 345-01-82
+380 (62) 345-19-69, факс
Адрес: ул. Розы Люксембург, 26 а, Донецк, Донецкая область, 83050, Украина</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment