Guest User

Untitled

a guest
Mar 24th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.24 KB | None | 0 0
  1. <?php
  2. /**
  3. Template Name: Contact
  4. */
  5. get_header();
  6. get_template_part('index','banner');
  7.  
  8. $appointment_options=theme_setup_data();
  9. $contact_setting = wp_parse_args( get_option( 'appointment_options', array() ), $appointment_options );
  10. $about_setting = wp_parse_args( get_option( 'appointment_options', array() ), $appointment_options );
  11. //echo "<pre>"; print_r($contact_setting); wp_die();
  12. $mapsrc= $contact_setting['contact_google_map_url'];
  13. $mapsrc=$mapsrc.'&amp;output=embed';
  14. ?>
  15. <!-- Contact Section -->
  16. <div class="page-builder">
  17. <div class="container">
  18. <div class="row">
  19. <div class="col-md-12">
  20. <?php
  21. the_post();
  22. the_content();?>
  23. </div>
  24. </div>
  25.  
  26. <div class="row">
  27.  
  28. <!--Contact Form-->
  29. <?php if( $contact_setting['contact_google_map_enabled'] == 1) { ?>
  30. <div class="col-md-12"><?php } else { ?><div class="col-md-8"><?php } ?>
  31. <div id="mailsentbox" style="display:none">
  32. <div class="alert alert-success" >
  33. <strong><?php _e('Thank you','appointment');?></strong> <?php _e('Your information has been sent.','appointment');?>
  34. </div>
  35. </div>
  36.  
  37. <div class="contact-title"><h2><?php echo $contact_setting['send_usmessage']; ?></h2></div>
  38.  
  39.  
  40. <div class="contact-form-section" id="myformdata">
  41. <form class="form-inline" role="form" method="post" action="#">
  42. <?php wp_nonce_field('appointment_name_nonce_check','appointment_name_nonce_field'); ?>
  43. <div class="contact-form-group">
  44. <input type="name" name="user_name" id="user_name" placeholder="<?php _e('Name','appointment'); ?>" class="contact-form-control">
  45. <span style="display:none; color:red" id="contact_user_name_error"><?php _e('Name','appointment'); ?> </span>
  46. </div>
  47. <div class="contact-form-group">
  48. <input type="email" name="user_email" id="user_email" placeholder="<?php _e('Email','appointment'); ?>" class="contact-form-control">
  49. <span style="display:none; color:red" id="contact_user_email_error"><?php _e('Email','appointment'); ?> </span>
  50. </div>
  51. <div class="contact-form-group-textarea">
  52. <textarea placeholder="<?php _e('Message','appointment'); ?>" name="user_massage" id="user_massage" class="contact-form-control-textarea" rows="7"></textarea>
  53. <span style="display:none; color:red" id="contact_user_massage_error"><?php _e('Message','appointment'); ?></span>
  54. </div>
  55. <button class="blogdetail-btn" id="contact_submit" name="contact_submit" type="submit"><?php _e('Send Message', 'appointment'); ?></button>
  56. </form>
  57. </div>
  58. </div>
  59. <!--/Contact Form-->
  60. <?php
  61. if(isset($_POST['contact_submit']))
  62. {
  63. $flag=1;
  64. if(empty($_POST['user_name']))
  65. {
  66.  
  67. $flag=0;
  68. echo "<script>jQuery('#contact_user_name_error').show();</script>";
  69. } else
  70. if($_POST['user_email']=='')
  71. {
  72. $flag=0;
  73. echo "<script>jQuery('#contact_user_email_error').show();</script>";
  74. } else
  75. if(!preg_match("/^[_\.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z-]+\.)+[a-zA-Z]{2,6}$/i",$_POST['user_email']))
  76. {
  77. $flag=0;
  78. echo "<script>jQuery('#contact_user_email_error').show();</script>";
  79. } else
  80. if($_POST['user_massage']=='')
  81. {
  82. $flag=0;
  83. echo "<script>jQuery('#contact_user_massage_error').show();</script>";
  84. }else
  85. if(empty($_POST) || !wp_verify_nonce($_POST['appointment_name_nonce_field'],'appointment_name_nonce_check') )
  86. {
  87. echo "<script>jQuery('#contact_nonce_error').show();</script>";
  88. exit;
  89. }
  90. else
  91. {
  92.  
  93. if($flag==1)
  94. {
  95. $to = get_option('admin_email');
  96. //print_r($to);
  97. $subject = trim($_POST['user_name']) . get_option("blogname");
  98. $massage = stripslashes(trim($_POST['user_massage']))."Message sent from:: ".trim($_POST['user_email']);
  99. $headers = "From: ".trim($_POST['user_name'])." <".trim($_POST['user_email']).">\r\nReply-To:".trim($_POST['user_email']);
  100. $maildata =wp_mail($to, $subject, $massage, $headers);
  101. if($maildata){
  102. echo "<script>jQuery('#myformdata').hide();</script>";
  103. echo "<script>jQuery('#mailsentbox').show();</script>";
  104. }
  105. }
  106. }
  107. }
  108. ?>
  109.  
  110. <!--Google Map-->
  111. <?php if( $contact_setting['contact_google_map_enabled'] == 0) { ?>
  112. <div class="col-md-4">
  113. <div class="contact-title"><h2><?php echo $contact_setting['contact_google_title'];?></h2></div>
  114. <div class="google-map">
  115. <iframe width="100%" scrolling="no" height="285" frameborder="0" marginheight="0" marginwidth="0" src="<?php echo esc_url($mapsrc); ?>"></iframe>
  116. </div>
  117. </div>
  118. <?php } ?>
  119. <!--Google Map-->
  120.  
  121.  
  122. </div>
  123.  
  124. </div>
  125. </div>
  126. <!-- /Contact Section -->
  127.  
  128. <div class="clearfix"></div>
  129.  
  130. <!-- Contact Detail Section -->
  131. <?php if( $contact_setting['contact-callout-enable'] == 0) { ?>
  132. <div class="contact-detail-section" style="background: url('<?php echo $contact_setting['contact_callout_back']; ?>') repeat <?php echo $contact_setting['contact_attachment']; ?> 0 0 rgba(0, 0, 0, 0); background-size:cover;">
  133. <div class="overlay" style="background: none repeat scroll 0 0 <?php echo ($contact_setting['contact_overlay']!=true?'transparent':'rgba(0, 0, 0, 0.2)'); ?>;">
  134. <div class="container">
  135. <!-- Section Title -->
  136. <div class="row">
  137. <div class="col-md-12">
  138.  
  139. <div class="section-heading-title">
  140. <h1 class="text-color"><?php echo $contact_setting['contact_title']; ?></h1>
  141. <p class="text-color"><?php echo $contact_setting['contact_description']; ?></p>
  142. </div>
  143. </div>
  144. </div>
  145. <!-- /Section Title -->
  146.  
  147. <!-- Contact Area -->
  148. <div class="row">
  149. <div class="col-md-4">
  150. <div class="contact-detail-area">
  151.  
  152. <i class="fa <?php echo $contact_setting['contact_call_icon'];?>"></i>
  153. <h6><?php echo $contact_setting['contact_call_title']; ?></h6>
  154. <address><?php echo $contact_setting['contact_call_description'];?></address>
  155.  
  156. </div>
  157. </div>
  158. <div class="col-md-4">
  159. <div class="contact-detail-area">
  160.  
  161. <i class="fa <?php echo $contact_setting['contact_add_icon']; ?>"></i>
  162. <h6><?php echo $contact_setting['contact_add_title']; ?></h6>
  163. <address><?php echo $contact_setting['contact_add_description']; ?></address>
  164. </div>
  165. </div>
  166. <div class="col-md-4">
  167. <div class="contact-detail-area">
  168. <i class="fa <?php echo $contact_setting['contact_mail_icon']; ?>"></i>
  169. <h6><?php echo $contact_setting['contact_mail_title']; ?></h6>
  170. <address><?php echo $contact_setting['contact_mail_description']; ?></address>
  171. </div>
  172. </div>
  173. </div>
  174.  
  175. <!-- /Contact Area -->
  176. </div>
  177.  
  178. </div>
  179. </div>
  180. <?php } ?>
  181. <!-- /Contact Detail Section -->
  182.  
  183. <div class="clearfix"></div>
  184.  
  185. <!-- Horizontal Callout Section -->
  186.  
  187.  
  188. <div class="hrtl-callout-section">
  189. <div class="container">
  190.  
  191. <div class="row">
  192. <div class="col-md-9">
  193. <h2><?php echo $contact_setting['contact_callout_title']; ?></h2>
  194. <p><?php echo $contact_setting['contact_callout_description']; ?></p>
  195.  
  196. </div>
  197. <div class="col-md-3">
  198. <div class="hrtl-btn-area">
  199. <a href="<?php echo $contact_setting['contact_callout_button_link']; ?>" <?php if( $contact_setting['contact_callout_link_target'] == 1) { echo "target='_blank'"; } ?> class="hrtl-btn"><?php echo $contact_setting['contact_callout_button']; ?></a>
  200. </div>
  201. </div>
  202. </div>
  203. </div>
  204. </div>
  205.  
  206. <!-- /Horizontal Callout Section -->
  207.  
  208.  
  209.  
  210. <!-- Team Section -->
  211. <?php if( $about_setting['team_section_enable' ] == '') { ?>
  212. <div class="team-section">
  213. <div class="container">
  214.  
  215. <!-- Section Title -->
  216. <div class="row">
  217. <div class="col-md-12">
  218. <div class="section-heading-title">
  219. <h1><?php echo $about_setting['about_team_title']; ?></h3>
  220. <p><?php echo $about_setting['about_team_description']; ?></p>
  221.  
  222. </div>
  223. </div>
  224. </div>
  225. <!-- /Section Title -->
  226.  
  227.  
  228. <!-- Team Area -->
  229. <div class="row"> <!-- id="team_scroll" -->
  230. <?php
  231. $count_posts = wp_count_posts( 'appointment_team')->publish;
  232. $arg = array( 'post_type' => 'appointment_team','posts_per_page' =>$count_posts);
  233. $team = new WP_Query( $arg );
  234. $i=1;
  235. if($team->have_posts())
  236. { while($team->have_posts() ) : $team->the_post();
  237.  
  238. $designation_meta_save = sanitize_text_field( get_post_meta( get_the_ID(), 'designation_meta_save', true ));
  239. $description_meta_save = sanitize_text_field( get_post_meta( get_the_ID(), 'description_meta_save', true ));
  240. $fb_meta_save = sanitize_text_field( get_post_meta( get_the_ID(), 'fb_meta_save', true ));
  241. $fb_meta_save_chkbx = sanitize_text_field( get_post_meta( get_the_ID(), 'fb_meta_save_chkbx', true ));
  242. $lnkd_meta_save = sanitize_text_field( get_post_meta( get_the_ID(), 'lnkd_meta_save', true ));
  243. $lnkd_meta_save_chkbx = sanitize_text_field( get_post_meta( get_the_ID(), 'lnkd_meta_save_chkbx', true ));
  244. $twt_meta_save = sanitize_text_field( get_post_meta( get_the_ID(), 'twt_meta_save', true ));
  245. $twt_meta_save_chkbx = sanitize_text_field( get_post_meta( get_the_ID(), 'twt_meta_save_chkbx', true ));
  246.  
  247. ?>
  248. <div class="col-md-3 team-area">
  249. <?php
  250. $defalt_arg =array('class' => "img-responsive");
  251. if(has_post_thumbnail()){
  252. ?>
  253. <div class="team-image">
  254. <?php the_post_thumbnail('', $defalt_arg); ?>
  255. <?php } else { echo '<div class="team-image">'; } ?>
  256. <div class="team-showcase-overlay">
  257. <div class="team-showcase-overlay-inner">
  258. <div class="team-showcase-icons">
  259. <?php
  260. if($fb_meta_save){
  261. if($fb_meta_save_chkbx)
  262. { $target ="_blank"; } else { $target ="_self"; } ?>
  263. <a href="<?php if($fb_meta_save){ echo esc_html($fb_meta_save); } ?>" target="<?php echo $target; ?>" class="hover_thumb"><i class="fa fa-facebook"></i></a>
  264. <?php } ?>
  265. <?php
  266. if($twt_meta_save){
  267. if($twt_meta_save_chkbx)
  268. { $target ="_blank"; } else { $target ="_self"; } ?>
  269. <a href="<?php if($twt_meta_save){ echo esc_html($twt_meta_save); } ?>" target="<?php echo $target; ?>" class="hover_thumb" ><i class="fa fa-twitter"></i></a>
  270. <?php } ?>
  271. <?php
  272. if($lnkd_meta_save){
  273. if($lnkd_meta_save_chkbx)
  274. { $target ="_blank"; } else { $target ="_self"; } ?>
  275. <a href="<?php if($lnkd_meta_save){ echo esc_html($lnkd_meta_save); } ?>" target="<?php echo $target; ?>" class="hover_thumb"><i class="fa fa-linkedin"></i></a> <?php } ?>
  276. </div>
  277. </div>
  278. </div>
  279. <?php
  280. if(has_post_thumbnail()){
  281. ?>
  282. </div> <?php } ?>
  283. <div class="team-caption"><h5><?php if(!empty($designation_meta_save)){
  284. echo $designation_meta_save; } ?></h5><h3><?php the_title(); ?></h3></div>
  285. </div> <?php if(!has_post_thumbnail()) { echo '</div>'; } ?>
  286. <?php if($i%4==0)
  287. { echo "<div class='clearfix'></div>"; }
  288. $i++; endwhile;
  289. } else {
  290. $team_title = array('John Doe', 'Sarah Culan', 'Chao Kang', 'Megan Sheryl');
  291. $team_designation = array(__('FOUNDER','appointment'), __('DESIGNER','appointment'),__('DEVELOPER','appointment'),__('DESIGNER'));
  292. for($i=1 ; $i<=4 ; $i++ )
  293. { ?>
  294.  
  295. <div class="col-md-3 team-area">
  296. <div class="team-image">
  297. <img class="img-responsive" src="<?php echo WEBRITI_TEMPLATE_DIR_URI; ?>/images/team/team<?php echo $i; ?>.jpg">
  298. <div class="team-showcase-overlay">
  299. <div class="team-showcase-overlay-inner">
  300. <div class="team-showcase-icons">
  301. <a href="#" title="Facebook" class="hover_thumb"><i class="fa fa-facebook"></i></a>
  302. <a href="#" title="Twitter" class="hover_thumb"><i class="fa fa-twitter"></i></a>
  303. <a href="#" title="Linkedin" class="hover_thumb"><i class="fa fa-linkedin"></i></a>
  304. </div>
  305. </div>
  306. </div>
  307. </div>
  308. <div class="team-caption"><h5><?php echo $team_designation[$i-1];?></h5><h3><?php echo $team_title[$i-1];?></h3></div>
  309. </div>
  310. <?php } } ?>
  311. </div>
  312. <!-- /Team Area -->
  313. </div>
  314. </div>
  315. <!-- /Team Section -->
  316. <div class="clearfix"></div>
  317. <?php } ?>
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324. <div class="clearfix"></div>
  325. <!-- Footer Section -->
  326. <?php get_footer(); ?>
  327. <!-- /Footer Section -->
Add Comment
Please, Sign In to add comment