Advertisement
konyakov

Bitrix Form Template

Feb 25th, 2016
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.22 KB | None | 0 0
  1. <?
  2. if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();
  3. ?>
  4.  
  5. <?if ($arResult["isFormErrors"] == "Y"):?><div class="form_error_field"><?=$arResult["FORM_ERRORS"];?></div><?endif;?>
  6.  
  7. <?=$arResult["FORM_NOTE"]?>
  8.  
  9. <?if ($arResult["isFormNote"] != "Y")
  10. {
  11. ?>
  12. <?//=$arResult["FORM_HEADER"]?>
  13.  
  14. <form name="<?=$arResult["WEB_FORM_NAME"]?>" action="<?=POST_FORM_ACTION_URI?>" method="POST" enctype="multipart/form-data" class="form-ptct" novalidate="novalidate">
  15. <input type="hidden" name="WEB_FORM_ID" value="<?=$arParams["WEB_FORM_ID"]?>">
  16. <?=bitrix_sessid_post()?>
  17.  
  18. <!--<table>
  19. <?
  20. if ($arResult["isFormDescription"] == "Y" || $arResult["isFormTitle"] == "Y" || $arResult["isFormImage"] == "Y")
  21. {
  22. ?>
  23.     <tr>
  24.         <td><?
  25. /***********************************************************************************
  26.                     form header
  27. ***********************************************************************************/
  28. if ($arResult["isFormTitle"])
  29. {
  30. ?>
  31.     <h1><?=$arResult["FORM_TITLE"]?></h1>
  32. <?
  33. } //endif ;
  34.  
  35.     if ($arResult["isFormImage"] == "Y")
  36.     {
  37.     ?>
  38.     <a href="<?=$arResult["FORM_IMAGE"]["URL"]?>" target="_blank" alt="<?=GetMessage("FORM_ENLARGE")?>"><img src="<?=$arResult["FORM_IMAGE"]["URL"]?>" <?if($arResult["FORM_IMAGE"]["WIDTH"] > 300):?>width="300"<?elseif($arResult["FORM_IMAGE"]["HEIGHT"] > 200):?>height="200"<?else:?><?=$arResult["FORM_IMAGE"]["ATTR"]?><?endif;?> hspace="3" vscape="3" border="0" /></a>
  39.     <?//=$arResult["FORM_IMAGE"]["HTML_CODE"]?>
  40.     <?
  41.     } //endif
  42.     ?>
  43.  
  44.             <p><?=$arResult["FORM_DESCRIPTION"]?></p>
  45.         </td>
  46.     </tr>
  47.     <?
  48. } // endif
  49.     ?>
  50. </table>
  51. <br />-->
  52. <?
  53. /***********************************************************************************
  54.                         form questions
  55. ***********************************************************************************/
  56. ?>
  57. <!--<table class="form-table data-table">
  58.     <thead>
  59.         <tr>
  60.             <th colspan="2">&nbsp;</th>
  61.         </tr>
  62.     </thead>
  63.     <tbody>-->
  64.     <?
  65.     foreach ($arResult["QUESTIONS"] as $FIELD_SID => $arQuestion)
  66.     {
  67.     ?>
  68.         <div class="form-ptct_l">
  69.             <div class="form-ptct_field-text-l"><span class="form-ptct_field-text<?if ($arQuestion["REQUIRED"] == "Y"):?><?echo ' -req';?><?endif;?>">
  70.                 <?=$arQuestion["CAPTION"]?><?//if ($arQuestion["REQUIRED"] == "Y"):?><?//=$arResult["REQUIRED_SIGN"];?><?//endif;?>
  71.                 <?=$arQuestion["IS_INPUT_CAPTION_IMAGE"] == "Y" ? "<br />".$arQuestion["IMAGE"]["HTML_CODE"] : ""?>
  72.             </span></div>
  73.             <div class="form-ptct_input-l"><?=$arQuestion["HTML_CODE"]?></div>
  74.         </div>
  75.     <?
  76.     } //endwhile
  77.     ?>
  78. <?
  79. if($arResult["isUseCaptcha"] == "Y")
  80. {
  81. ?>
  82.         <div class="form-ptct_l"><div class="form-ptct_field-text-l"><span class="form-ptct_field-text"><b><?=GetMessage("FORM_CAPTCHA_TABLE_TITLE")?></b></span></div><div class="form-ptct_input-l"></div></div>
  83.        
  84.         <div class="form-ptct_l">
  85.               <div class="form-ptct_field-text-l"><input type="hidden" name="captcha_sid" value="<?=htmlspecialchars($arResult["CAPTCHACode"]);?>" />
  86.               <span class="form-ptct_field-text<?if ($arQuestion["REQUIRED"] == "Y"):?><?echo ' -req';?><?endif;?>"><?=GetMessage("FORM_CAPTCHA_FIELD_TITLE")?></span></div>
  87.               <div class="form-ptct_input-l">
  88.                 <div class="form-ptct_capcha"><a class="reload" href="javascript:refreshCaptcha('capchaHolder')"><img src="/bitrix/tools/captcha.php?captcha_sid=<?=htmlspecialchars($arResult["CAPTCHACode"]);?>" width="180" height="40"  id="capchaHolder" align="middle"/></a></div>
  89.                 <input type="text" name="captcha_word" size="30" maxlength="50" value=""  class="form-ptct_input -capcha-offset" required />
  90.               </div>
  91.             </div>
  92. <?
  93. } // isUseCaptcha
  94. ?>
  95.     <!--</tbody>
  96.     <tfoot>
  97.         <tr>
  98.             <th colspan="2"><div align="center">-->
  99.                
  100.                 <div class="form-ptct_l -align-right"><span class="form-ptct_field-text -req-front -offset"> - <?=GetMessage("FORM_REQUIRED_FIELDS")?></span>
  101.                 <input class="btn-form" <?=(intval($arResult["F_RIGHT"]) < 10 ? "disabled=\"disabled\"" : "");?> type="submit" name="web_form_submit" value="<?=strlen(trim($arResult["arForm"]["BUTTON"])) <= 0 ? GetMessage("FORM_ADD") : $arResult["arForm"]["BUTTON"];?>" />
  102.                 </div>
  103.             <!--</div></th>
  104.         </tr>
  105.     </tfoot>
  106. </table>-->
  107. <?=$arResult["FORM_FOOTER"]?>
  108. <?
  109. } //endif (isFormNote)
  110. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement