forked from WWBN/AVideo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontact.php
143 lines (134 loc) · 6.33 KB
/
contact.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<?php
global $global, $config;
if (!isset($global['systemRootPath'])) {
require_once '../videos/configuration.php';
}
$email = '';
$name = '';
if (User::isLogged()) {
$name = User::getNameIdentification();
$email = User::getEmail_();
}
$metaDescription = " Contact Form";
$_page = new Page(array('Contact Us'));
?>
<style>
.form-control:focus {
border-color: #5cb85c;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(92, 184, 92, .6);
}
</style>
<div class="container">
<div class="panel panel-default">
<div class="panel-body">
<form class="form-horizontal" action=" " method="post" id="contact_form">
<input type="hidden" name="contactForm" value="1" />
<div class="panel panel-default">
<div class="panel-heading">
<h1>
<i class="fa-solid fa-envelope-open-text"></i>
<?php echo __("Contact Us Today!"); ?>
</h1>
</div>
<div class="panel-body">
<!-- Text input-->
<div class="form-group">
<label class="col-md-3 control-label"><?php echo __("Name"); ?></label>
<div class="col-md-9 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span>
<input name="first_name" placeholder="<?php echo __("Name"); ?>" class="form-control" value="<?php echo $name; ?>" type="text" required="true">
</div>
</div>
</div>
<!-- Text input-->
<div class="form-group">
<label class="col-md-3 control-label"><?php echo __("E-mail"); ?></label>
<div class="col-md-9 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-envelope"></i></span>
<input name="email" id="formEmail" placeholder="<?php echo __("E-mail Address"); ?>" class="form-control" value="<?php echo $email; ?>" type="email" required="true">
</div>
</div>
</div>
<!-- Text input-->
<div class="form-group <?php echo empty($advancedCustom->doNotShowWebsiteOnContactForm) ? "" : "hidden" ?>">
<label class="col-md-3 control-label"><?php echo __("Website"); ?></label>
<div class="col-md-9 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-globe"></i></span>
<input name="website" placeholder="<?php echo __("Website"); ?>" class="form-control" type="text">
</div>
</div>
</div>
<!-- Text area -->
<div class="form-group">
<label class="col-md-3 control-label"><?php echo __("Message"); ?></label>
<div class="col-md-9 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-pencil"></i></span>
<textarea class="form-control" name="comment" placeholder="<?php echo __("Message"); ?>" required="true"></textarea>
</div>
</div>
</div>
<div class="form-group">
<label class="col-md-3 control-label"><?php echo __("Type the code"); ?></label>
<div class="col-md-9 inputGroupContainer">
<?php
$capcha = getCaptcha();
echo $capcha['content'];
?>
</div>
</div>
</div>
<div class="panel-footer">
<button type="submit" class="btn btn-primary btn-lg btn-block">
<i class="fa-solid fa-envelope-circle-check"></i>
<?php echo __("Send"); ?>
</button>
<div style="display: none;" id="messageSuccess">
<div class="alert alert-success clear clearfix">
<h1 class="text-center">
<i class="fa-solid fa-envelope-circle-check"></i>
<?php echo __("Your message has been sent!"); ?>
</h1>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function() {
$('#contact_form').submit(function(evt) {
evt.preventDefault();
if (!this.checkValidity()) {
return false;
}
modal.showPleaseWait();
$.ajax({
url: webSiteRootURL + 'sendEmail',
data: $('#contact_form').serializeArray(),
type: 'post',
success: function(response) {
modal.hidePleaseWait();
if (!response.error) {
avideoAlertSuccess(__("Your message has been sent!"));
$("#contact_form").hide();
$("#messageSuccess").fadeIn();
} else {
avideoAlertError(response.error);
}
<?php echo $capcha['btnReloadCapcha']; ?>
}
});
return false;
});
});
</script>
<?php
$_page->print();
?>