-
Notifications
You must be signed in to change notification settings - Fork 0
/
contact.php
151 lines (149 loc) · 6.55 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
144
145
146
147
148
149
150
151
<?php osc_current_web_theme_path( 'head.php' ); ?>
<body>
<?php osc_current_web_theme_path( 'header.php' ); ?>
<div class="col-md-12 tfc-item">
<div class="col-md-8">
<h3 class="tfc-title"><?php _e( 'Contact us' , 'shopclass' ); ?></h3>
<div class="well well-sm">
<form action="<?php echo osc_base_url( true ); ?>" method="post" name="contact_form" id="contact">
<fieldset>
<input type="hidden" name="page" value="contact"/>
<input type="hidden" name="action" value="contact_post"/>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="yourName">
<?php _e( 'Your name' , 'shopclass' ); ?></label>
<div class="input-group">
<span class="input-group-addon"><span class="fa fa-user"></span>
</span>
<input class="form-control" id="yourName"
placeholder="<?php echo osc_esc_html( __( 'Enter name' , 'shopclass' ) ); ?>"
type="text" name="yourName" value=""/>
</div>
</div>
<div class="form-group">
<label for="yourEmail">
<?php _e( 'E-mail address' , 'shopclass' ); ?></label>
<div class="input-group">
<span class="input-group-addon"><span class="fa fa-envelope"></span>
</span>
<input id="yourEmail" type="text" name="yourEmail" class="form-control"
placeholder="<?php echo osc_esc_html( __( 'Enter E-mail' , 'shopclass' ) ); ?>"
value=""/>
</div>
</div>
<div class="form-group">
<label for="subject">
<?php _e( 'Subject' , 'shopclass' ); ?></label>
<div class="input-group">
<span class="input-group-addon"><span class="fa fa-inbox"></span>
</span>
<input class="form-control" id="subject" type="text" name="subject"
placeholder="<?php echo osc_esc_html( __( 'Enter Subject' , 'shopclass' ) ); ?>"
value=""/>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="message">
<?php _e( 'Message' , 'shopclass' ); ?></label>
<textarea id="message" name="message" class="form-control" rows="9" cols="25"
placeholder="<?php echo osc_esc_html( __( 'Enter your message' , 'shopclass' ) ); ?>"></textarea>
</div>
</div>
<div class="col-md-6">
<?php osc_run_hook( 'tf_after_form' ); ?>
<?php osc_show_recaptcha(); ?>
<?php osc_run_hook( 'admin_contact_form' ); ?>
<hr>
<button type="submit" class="btn btn-primary col-md-offset-3">
<?php _e( 'Send Message' , 'shopclass' ); ?></button>
</div>
</div>
</fieldset>
</form>
</div>
</div>
<div class="col-md-4 padding-top">
<?php if ( ! tfc_getPref( 'tfc-address' ) ) {
?>
<address>
<strong>ShopClass.com</strong>
234- Local Street, Bareilly
Just Location, INDIA 243xxx
<abbr title="Phone">
P:</abbr>
(+91 581) 258-xxxx
</address>
<div>
<strong>Full Name</strong><br>
Navjot Tomer
</div>
<?php } else {
echo tfc_getPref( 'tfc-address' );
}
?>
</div>
</div>
<?php osc_current_web_theme_path( 'footer.php' ); ?>
<script>
$(document).ready(function () {
$("form[name=contact_form]").validate({
rules: {
message: {
required: true,
minlength: 20
},
yourEmail: {
required: true,
email: true
},
yourName: {
required: true,
minlength: 5
},
subject: {
required: true,
minlength: 5
}
},
messages: {
yourEmail: {
required: "<?php _e( "This field is required" ); ?>.",
email: "<?php _e( "Invalid email address" ); ?>."
},
message: {
required: "<?php _e( "This field is required" ); ?>.",
minlength: "<?php _e( "Your Message is too short" ); ?>."
},
yourName: {
required: "<?php _e( "This field is required" ); ?>.",
minlength: "<?php _e( "Your Name is too short" ); ?>."
},
subject: {
required: "<?php _e( "This field is required" ); ?>.",
minlength: "<?php _e( "Your Subject is too short" ); ?>."
}
},
highlight: function (element) {
$(element).closest('.form-group').addClass('has-error');
},
unhighlight: function (element) {
$(element).closest('.form-group').removeClass('has-error');
},
errorElement: 'span',
errorClass: 'help-block',
errorPlacement: function (error, element) {
if (element.parent('.input-group').length) {
error.insertAfter(element.parent());
} else {
error.insertAfter(element);
}
}
});
});
</script>
</body>
</html>