Guest User

Untitled

a guest
Jun 30th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.22 KB | None | 0 0
  1. <?php //Template Name: Contact Page
  2. get_header();
  3. get_template_part('weblizar','breadcrumbs');
  4. $wl_theme_options = chronicle_contact_options(); ?>
  5. <div class="clearfix margin_top3"></div>
  6. <div class="container">
  7. <div class="content_fullwidth lessmar">
  8. <div class="one_half">
  9. <?php the_post();
  10. the_content();?>
  11. <br /><br />
  12. <div class="cforms">
  13. <form action="#" method="POST" id="weblizar_form" class="sky-form">
  14. <header><?php _e('Contact','weblizar') ;?> <strong><?php _e('Form','weblizar') ;?></strong></header>
  15. <fieldset>
  16. <div class="row">
  17. <section class="col col-6">
  18. <label class="label"><?php _e('Name','weblizar');?></label>
  19. <label class="input"> <i class="icon-append icon-user"></i>
  20. <input type="text" name="user_name" id="user_name">
  21. </label>
  22. <span id="contact_name_error" style="display:none;"><?php _e('Fill your name','weblizar'); ?></span>
  23. </section>
  24. <section class="col col-6">
  25. <label class="label"><?php _e('E-mail','weblizar');?></label>
  26. <label class="input"> <i class="icon-append icon-envelope-alt"></i>
  27. <input type="email" name="user_email" id="user_email">
  28. </label>
  29. <span id="contact_email_error" style="display:none;"><?php _e('Fill your Email','weblizar'); ?></span>
  30. </section>
  31. </div>
  32. <section>
  33. <label class="label"><?php _e('Subject','weblizar');?></label>
  34. <label class="input"> <i class="icon-append icon-tag"></i>
  35. <input type="text" name="subject" id="subject">
  36. </label>
  37. </section>
  38. <section>
  39. <label class="label"><?php _e('Message','weblizar');?></label>
  40. <label class="textarea"> <i class="icon-append icon-comment"></i>
  41. <textarea rows="4" name="user_message" id="user_message"></textarea>
  42. </label>
  43. <span id="contact_user_massage_error" style="display:none;"><?php _e('Fill your Text massage','weblizar'); ?></span>
  44. </section>
  45. <section>
  46. <input type="checkbox" name="data_protection" value="data_protection" required> consent to processing the personal data <br>
  47. </section>
  48. </fieldset>
  49. <footer>
  50. <button name="query_submit" id="query_submit" type="submit" class="button"><?php _e('Send message','weblizar');?></button>
  51. </footer>
  52. </form>
  53. <div id="enquiry_send_massage" class="message" style="display:none;">
  54. <p><?php _e('Your message was successfully sent!','weblizar');?></p>
  55. </div>
  56. </div>
  57. </div>
  58. <?php if(isset($_POST['query_submit']))
  59. { if($_POST['user_name']==''){
  60. echo "<script>jQuery('#contact_name_error').show();</script>";
  61. } else
  62. if($_POST['user_email']=='') {
  63. echo "<script>jQuery('#contact_email_error').show();</script>";
  64. } else
  65. if(!preg_match("/^[_\.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z-]+\.)+[a-zA-Z]{2,6}$/i", $_POST['user_email'])) {
  66. echo "<script>jQuery('#contact_email_error').show();</script>";
  67. } else
  68. if($_POST['user_message'] ==''){
  69. echo "<script>jQuery('#contact_user_massage_error').show();</script>";
  70. }
  71. else
  72. { $email = get_option('admin_email');
  73. $subject = "You have new enquiry form".get_option("blogname");
  74. $massage = stripslashes(trim($_POST['user_message']))."<br>Message sent from <br> Name:" . trim($_POST['user_name']). "<br>Email :". trim($_POST['user_email']);
  75. $headers = "From: ".trim($_POST['user_name'])." <".trim($_POST['user_email']).">\r\nReply-To:".trim($_POST['user_email']);
  76. add_filter( 'wp_mail_content_type', 'wl_html_content_type' );
  77. function wl_html_content_type() {
  78. return 'text/html';
  79. }
  80. $enquerysend =wp_mail( $email, $subject, $massage, $headers);
  81. echo "<script>jQuery('#weblizar_form').hide();</script>";
  82. echo "<script>jQuery('#enquiry_send_massage').show();</script>";
  83. }
  84. }
  85. ?>
  86. <div class="one_half last">
  87. <div class="address_info">
  88. <?php if($wl_theme_options['contact_heading'] !='') { ?>
  89. <h4><?php echo $wl_theme_options['contact_heading']; ?></h4>
  90. <?php } ?>
  91. <ul>
  92. <li><?php
  93. if($wl_theme_options['contact_address_text'] !='') {
  94. echo $wl_theme_options['contact_address_text']; ?> <br />
  95. <?php }
  96. if($wl_theme_options['contact_address'] !='') {
  97. echo $wl_theme_options['contact_address']; ?><br />
  98. <?php }
  99. if($wl_theme_options['contact_phone_no'] !='') {
  100. echo $wl_theme_options['phone_number_text']; ?>: <?php echo $wl_theme_options['contact_phone_no']; ?><br />
  101. <?php
  102. }
  103. if($wl_theme_options['fax_number'] !='') {
  104. echo $wl_theme_options['fax_number_text']; ?>: <?php echo $wl_theme_options['fax_number']; ?><br />
  105. <?php
  106. }
  107. if($wl_theme_options['contact_email'] !='') {
  108. echo $wl_theme_options['contact_email_text']; ?>: <a href="mailto:<?php echo $wl_theme_options['contact_email']; ?>"><?php echo $wl_theme_options['contact_email']; ?></a><br />
  109. <?php
  110. }
  111. if($wl_theme_options['website_address'] !='') {
  112. echo $wl_theme_options['website_address_text']; ?>: <a href="<?php echo $wl_theme_options['website_address']; ?>"><?php echo $wl_theme_options['website_address']; ?></a>
  113. <?php } ?>
  114. </li>
  115. </ul>
  116. </div>
  117. <div class="clearfix"></div>
  118. <?php if($wl_theme_options['google_map_on_contact'] =='on' ) { ?>
  119. <h4><?php _e('Find the','weblizar') ;?> <strong><?php _e('Address','weblizar') ;?></strong></h4>
  120. <?php if($wl_theme_options['google_maps'] !='') { ?>
  121. <iframe src="<?php echo $wl_theme_options['google_maps']; ?>" width="100%" scrolling="no" height="500" frameborder="0" marginheight="0" marginwidth="0"></iframe>
  122. <?php } ?>
  123. <br />
  124. <?php } ?>
  125. </div>
  126. </div>
  127. </div><!-- end content area -->
  128. <div class="margin_top5"></div>
  129. <?php get_footer(); ?>
Add Comment
Please, Sign In to add comment