akhlesh_nagar

Untitled

Mar 17th, 2016
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.32 KB | None | 0 0
  1. <?php // Template Name: Contact Page ?>
  2. <?php get_template_part('banner','strip');
  3. $image_uri= WEBRITI_TEMPLATE_DIR_URI. '/images' ;
  4. $rambo_pro_theme_options = theme_data_setup();
  5. $current_options = wp_parse_args( get_option( 'rambo_pro_theme_options', array() ), $rambo_pro_theme_options );
  6. $mapsrc= $current_options['rambo_contact_google_map_url'];
  7. $mapsrc=$mapsrc.'&amp;output=embed';
  8. ?>
  9.  
  10.  
  11. <!-- Container -->
  12. <div class="container">
  13. <!-- Contact Container -->
  14. <div class="row-fluid">
  15. <!-- Contact -->
  16. <div class="span8">
  17. <!-- Contact Form -->
  18. <div id="myformdata">
  19. <div class="row-fluid leave_comment_section">
  20. <?php if($current_options['contact_form_heading']!='') { ?>
  21. <div class="blog_single_post_head_title"><h3><?php echo esc_attr($current_options['contact_form_heading']); ?></h3></div>
  22. <?php } ?>
  23. <form id="contactus_form" method="post" action="">
  24. <?php wp_nonce_field('rambo_name_nonce_check','rambo_name_nonce_field'); ?>
  25. <fieldset>
  26. <label><?php _e('Name','rambo'); ?><span>*</span></label>
  27. <input class="span9 leave_comment_field" id="yourname" name="yourname" type="text">
  28. <label><?php _e('Email','rambo'); ?><span>*</span></label>
  29. <input class="span9 leave_comment_field" type="text" id="email" name="email">
  30. <label><?php _e('Website','rambo'); ?></label>
  31. <input class="span9 leave_comment_field" type="text" id="website" name="website">
  32. <label><?php _e('Comment','rambo') ?><span>*</span></label>
  33. <textarea rows="7" class="span12 leave_comment_field" id="message" name="message"></textarea>
  34. </fieldset>
  35.  
  36. <button type="submit" class="comment_btn pull-left" id="contact_submit" name="contact_submit"><?php _e('Send Message','rambo'); ?></button>
  37.  
  38. <div class="span4" style="padding-top:10px;">
  39. <span style="display:none; color:red" id="contact_user_name_error"><?php _e('Please Enter Your Name','rambo'); ?> </span>
  40. <span style="display:none; color:red" id="contact_email_error"><?php _e('Please Enter valid email','rambo'); ?> </span>
  41. <span style="display:none; color:red" id="contact_massage_error"><?php _e('Please Enter your contact message','rambo'); ?></span>
  42. <span style="display:none; color:red" id="contact_nonce_error"><?php _e('Sorry, your nonce did not verify','rambo');?></span>
  43. </div>
  44. </form>
  45. </div>
  46. </div>
  47. <div id="mailsentbox" style="display:none">
  48. <div class="alert alert-success" >
  49. <strong><?php _e('Thank you!','rambo');?></strong> <?php _e('You successfully sent contact information...','rambo');?>
  50. </div>
  51. </div>
  52. <!-- /Contact Form -->
  53. </div>
  54. <!-- /Contact -->
  55. <!-- Sidebar Widget -->
  56. <div class="span4 sidebar">
  57. <!--Get in Touch-->
  58. <?php if($current_options['rambo_get_in_touch_enabled'] == true){?>
  59. <div class="sidebar_widget">
  60. <div class="sidebar_widget_title"><h2><?php if($current_options['rambo_get_in_touch']!='') { echo esc_attr($current_options['rambo_get_in_touch']); } else { echo _e('Get in Touch','rambo'); } ?></h2></div>
  61. <!-- Google Map -->
  62. <?php if($current_options['contact_google_map_enabled'] == true){?>
  63. <div class="Contact_google_map">
  64. <iframe width="100%" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="<?php echo $mapsrc ?>"></iframe><br /><small><a href="<?php echo $mapsrc; ?>" style="color:#0000FF;text-align:left"><?php _e( "View Larger Map", 'rambo' ); ?> </a></iframe>
  65. </div>
  66. <?php } ?>
  67. <!-- /Google Map -->
  68. <div class="row-fluid">
  69. <p class="sidebar_con_detail">
  70. <i class="fa fa-map-marker icon-spacing"></i><span>
  71. <?php _e('Address:','rambo'); ?> <small><?php if($current_options['rambo_contact_address']!='') { echo esc_attr($current_options['rambo_contact_address']); } else { echo _('New York City, USA','rambo'); } ?>
  72. </small></span>
  73. </p>
  74. </div>
  75. </div>
  76. <?php } ?>
  77. <!--/Get in Touch-->
  78.  
  79. <!--Contact Detail-->
  80. <?php if($current_options['rambo_our_office_enabled'] == true){?>
  81. <div class="sidebar_widget">
  82. <div class="sidebar_widget_title"><h2><?php if($current_options['rambo_our_office']!='') { echo esc_attr($current_options['rambo_our_office']); } else { echo _e('Our Office','rambo'); } ?></h2></div>
  83. <div class="row-fluid">
  84.  
  85. <p class="sidebar_con_detail">
  86. <i class="fa fa-envelope icon-spacing"></i><span><?php _e('Email:','rambo'); ?> <small>
  87. <?php if($current_options['rambo_contact_email']!='') { echo esc_attr($current_options['rambo_contact_email']); } else { echo __('themes@webriti.com','rambo'); } ?>
  88. </small></span>
  89. </p>
  90. <p class="sidebar_con_detail">
  91. <i class="fa fa-phone icon-spacing"></i><span><?php _e('Phone:','rambo'); ?> <small>
  92. <?php if($current_options['rambo_contact_phone_number']!='') { echo esc_attr($current_options['rambo_contact_phone_number']); } else { echo _('420-300-3850','rambo'); } ?>
  93. </small></span>
  94. </p>
  95. <p class="sidebar_con_detail">
  96. <span>Fax: <small>
  97. 420-300-3850</small></span>
  98. </p>
  99. </div>
  100. </div>
  101. <?php } ?>
  102.  
  103. <div class="sidebar_widget">
  104. <div class="sidebar_widget_title"><h2>Technical Support Help desk</h2></div>
  105. <div class="row-fluid">
  106.  
  107. <p class="sidebar_con_detail">
  108. <i class="fa fa-envelope icon-spacing"></i><span>Email: <small>
  109. themes@webriti.com </small></span>
  110. </p>
  111. <p class="sidebar_con_detail">
  112. <i class="fa fa-phone icon-spacing"></i><span>Phone: <small>
  113. 420-300-3850</small></span>
  114. </p>
  115. </div>
  116. </div>
  117.  
  118. <!--/Contact Detail-->
  119. <!--Sidebar Social Icons-->
  120. <?php if($current_options['social_media_in_contact_page_enabled'] == true){?>
  121. <div class="sidebar_widget">
  122. <div class="sidebar_widget_title"><h2><?php _e('Get Connected','rambo'); ?></h2></div>
  123. <div class="sidebar_social">
  124. <a href="<?php if($current_options['social_media_facebook_link']!='') { echo esc_attr($current_options['social_media_facebook_link']); } else { echo "#"; } ?>" class="facebook">&nbsp;</a>
  125. <a href="<?php if($current_options['social_media_twitter_link']!='') { echo esc_attr($current_options['social_media_twitter_link']); } else { echo "#"; } ?>" class="twitter">&nbsp;</a>
  126. <a href="<?php if($current_options['social_media_linkedin_link']!='') { echo esc_attr($current_options['social_media_linkedin_link']); } else { echo "#"; } ?>" class="linked-in">&nbsp;</a>
  127. <a href="<?php if($current_options['social_media_google_plus']!='') { echo esc_attr($current_options['social_media_google_plus']); } else { echo "#"; } ?>" class="google_plus">&nbsp;</a>
  128. </div>
  129. </div><!--/Sidebar Social Icons-->
  130. <?php } ?>
  131. </div>
  132. <!-- /Sidebar Widget -->
  133. <?php
  134. if(isset($_POST['contact_submit']))
  135. { $flag=1;
  136. if(empty($_POST['yourname']))
  137. {
  138. $flag=0;
  139. echo "<script>jQuery('#contact_user_name_error').show();</script>";
  140. }else
  141. if($_POST['email']=='')
  142. {
  143. $flag=0;
  144. echo "<script>jQuery('#contact_email_error').show();</script>";
  145. }else
  146. if(!preg_match("/^[_\.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z-]+\.)+[a-zA-Z]{2,6}$/i",$_POST['email']))
  147. {
  148. $flag=0;
  149. echo "<script>jQuery('#contact_email_error').show();</script>";
  150. }else
  151. if($_POST['message']=='')
  152. {
  153. $flag=0;
  154. echo "<script>jQuery('#contact_massage_error').show();</script>";
  155. }else
  156. if(empty($_POST) || !wp_verify_nonce($_POST['rambo_name_nonce_field'],'rambo_name_nonce_check') )
  157. {
  158. echo "<script>jQuery('#contact_nonce_error').show();</script>";
  159. exit;
  160. }
  161. else
  162. { if($flag==1)
  163. {
  164. $to = get_option('admin_email');
  165. $subject = trim($_POST['yourname'])." sent you a message from ".get_option("blogname");
  166. $massage = stripslashes(trim($_POST['message']))."Message sent from:: ".trim($_POST['email']);
  167. $headers = "From: ".trim($_POST['yourname'])." <".trim($_POST['email']).">\r\nReply-To:".trim($_POST['email']);
  168. $maildata =wp_mail($to, $subject, $massage, $headers);
  169. if($maildata){
  170. echo "<script>jQuery('#myformdata').hide();</script>";
  171. echo "<script>jQuery('#mailsentbox').show();</script>";
  172. }
  173.  
  174. }
  175. }
  176. }
  177. ?>
  178. </div>
  179. <!-- /Contact Container -->
  180. </div>
  181. <?php get_footer();?>
Add Comment
Please, Sign In to add comment