<?php
  /**
   * Contact Form
   *
   * @package Digital Downloads Pro
   * @author wojoscripts.com
   * @copyright 2010
   * @version $Id: contact.php, v2.00 2011-07-10 10:12:05 gewa Exp $
   */
  if (!defined("_VALID_PHP"))
      die('. دسترسی مستقیم به این محل مجاز نمی باشد');
	  
?>
<!-- Start Contact Form-->
<div style="position:relative">
<span id="loader" style="display:none"></span>
  <div id="msgholder"></div>
</div>
<div class="box2">
    <form action="" method="post" id="admin_form" name="admin_form">
      <table cellpadding="0" cellspacing="0" class="display">
        <thead>
          <tr>
            <th colspan="2" class="right">&nbsp;درخـواسـت تـمـاس</th>
          </tr>
        </thead>
        <tfoot>
          <tr>
            <td colspan="2"><input id="submit" name="submit" class="button shadow" value="ثـبـت درخـواسـت" type="submit" /></td>
          </tr>
        </tfoot>
        <tbody>
          <tr>
            <th width="200"><strong>نـام شـمـا : <?php echo required();?></strong></th>
            <td><span class="inputwrap">
              <input name="name" id="name" class="inputbox" size="45" value="<?php if ($user->logged_in) echo $user->name;?>" type="text" style="width:300px"/>
              </span></td>
          </tr>
          <tr>
            <th><strong>
              <label for="email">ایـمیـل : <?php echo required();?></label>
              </strong></th>
            <td><span class="inputwrap">
              <input name="email" id="email" class="inputbox" size="45" value="<?php if ($user->logged_in) echo $user->email;?>" type="text" style="width:300px"/>
              </span></td>
          </tr>
          <tr>
            <th><strong>مـوضـوع :</strong></th>
            <td><span class="inputwrap">
              <select name="subject" class="select" style="width:310px">
                <option value="">--- انتـخـاب مـوضـوع ---</option>
                <option value="Compliment">تـعـریـف</option>
                <option value="Criticism">انتـقـاد</option>
                <option value="Suggestion">پیـشـنهـاد</option>
                <option value="Advertise">تبلـیـغـات</option>
                <option value="Support">پشتـیـبـانـی</option>
                <option value="Other">مـوارد دیـگـر</option>
              </select>
              </span></td>
          </tr>
          <tr>
            <th><strong>پـیـام شـمـا : <?php echo required();?></strong></th>
            <td><span class="inputwrap">
              <textarea name="message" cols="55" rows="8" class="inputbox" style="height: 100px; width: 300px;"></textarea>
              </span></td>
          </tr>
          <tr>
            <th><strong> 3 + 5 =: <?php echo required();?></strong></th>
            <td><span class="inputwrap">
              <input name="code" type="text" class="inputbox" id="code" size="5" maxlength="1" />
              </span></td>
          </tr>
        </tbody>
      </table>
    </form>
  </div>
<script type="text/javascript">
// <![CDATA[
  function showLoader() {
      $("#loader").fadeIn(200);
  }

  function hideLoader() {
      $("#loader").fadeOut(200);
  };

  $(document).ready(function () {
      $("#admin_form").submit(function () {
          var str = $(this).serialize();
          showLoader();
          $.ajax({
              type: "POST",
              url: SITEURL + "/ajax/sendmail.php",
              data: str,
              success: function (msg) {
                  $("#msgholder").ajaxComplete(function (event, request, settings) {
                      if (msg == 1) {
                          hideLoader();
                          result = '<div class="msgOk"><span>!متشکـریـم<\/span>.پیـام شمـا با موفقیـت ارسـال شـد<\/div>';
                          $(".box2").hide();
                      } else {
                          hideLoader();
                          result = msg;
                      }
                      $(this).html(result);
                  });
              }
          });
          return false;
      });
  });
// ]]>
</script> 
<!-- End Contact Form/--> 