2016-10-05 9 views
0

私は大幅に変更したJoomlaコンポーネントで動作するフォームを持っています。今私はまた、フォームの前に支払い統合を追加したいと思います。 私は、ページから申請書を隠しておき、支払いからのリダイレクトが成功した後にのみ表示する予定です。これについてどうすればいいですか? コード:div内のフォームを非表示にして、リダイレクト後にのみ表示

<!-- Hide this agent form until page redirect(successful payment) --> 
<?php if($this->agent){ ?> 
      <section id="contact-agent"> 
       <header><h2>APPLY FOR THIS DESIGN</h2></header> 
       <div class="row"> 
        <section id="contact-agent"> 
       <header><h2>APPLY FOR THIS DESIGN</h2></header> 
       <div class="row"> 
        <section class="agent-form"> 
        <div class="col-md-5 col-sm-12"> 
         <div class="agent-form"> 
          <form role="form" id="form-contact-agent" method="post" action="<?php echo JRoute::_("index.php?option=com_bt_property"); ?>" class="clearfix"> 
           <div class="form-group"> 
            <label for="form-contact-agent-name"><?php echo JText::_('COM_BT_PROPERTY_YOUR_NAME');?><em>*</em></label> 
            <input type="text" class="form-control2" id="form-contact-agent-name" name="name" value="<?php echo $this->user->name; ?>" required> 
           </div><!-- /.form-group --> 
           <div class="form-group"> 
            <label for="form-contact-agent-email"><?php echo JText::_('COM_BT_PROPERTY_YOUR_EMAIL');?><em>*</em></label> 
            <input type="email" class="form-control2" id="form-contact-agent-email" name="email" value="<?php echo $this->user->email; ?>" required> 
           </div><!-- /.form-group --> 
           <div class="form-group"> 
            <label for="form-contact-agent-phone"><?php echo JText::_('COM_BT_PROPERTY_YOUR_PHONE');?><em>*</em></label> 
            <input type="text" class="form-control2" id="form-contact-agent-phone" name="phone" value="<?php echo $this->user->phone; ?>" required> 
           </div><!-- /.form-group --> 
           <div class="form-group"> 
            <label for="form-contact-agent-location"><em>Your Current Location*</em></label> 
            <input type="text" class="form-control2" id="form-contact-agent-location" name="location" value="<?php echo $this->user->location; ?>" required> 
           </div><!-- /.form-group --> 
           <div class="form-group"> 
            <label for="form-contact-agent-proposed-location"><em>Proposed Property Location*</em></label> 
            <input type="text" class="form-control2" id="form-contact-agent-proposed-location" name="proposedlocation" value="<?php echo $this->user->proposedlocation; ?>" required> 
           </div><!-- /.form-group --> 
           <div class="form-group"> 
            <label for="form-contact-agent-docs"><em>What documents are you applying for?*</em></label><br/> 
            <input type="checkbox" class="form-control" name="ArchitecturalDrawing" value="<?php echo $this->user->ArchitecturalDrawing; ?>" />Architectural Drawing<br/> 
            <input type="checkbox" class="form-control" name="StructuralDrawing" value="<?php echo $this->user->StructuralDrawing; ?>" />Structural Drawing<br/> 
            <input type="checkbox" class="form-control" name="MechanicalDrawing" value="<?php echo $this->user->MechanicalDrawing; ?>" />Mechanical Drawing<br/> 
            <input type="checkbox" class="form-control" name="ElectricalDrawing" value="<?php echo $this->user->ElectricalDrawing; ?>" />Electrical Drawing<br/> 
            <input type="checkbox" class="form-control" name="boq" value="<?php echo $this->user->boq; ?>" />Bill of quantities (BOQ)<br/> 
            <input type="checkbox" class="form-control" name="construction" value="<?php echo $this->user->construction; ?>" />Construction of building<br/> 
           </div><!-- /.form-group --> 
           <br/> 
           <div class="form-group"> 
           <input type="checkbox" class="form-control" name="terms" value="<?php echo $this->user->terms; ?>" required/>I agree to the Tcs and Cs 
           </div><!-- /.form-group --> 
           <div class="form-group"> 
            <button type="submit" class="btn pull-right btn-default" id="form-contact-agent-submit">Apply Now</button> 
           </div><!-- /.form-group --> 
           <div id="form-contact-agent-status"></div> 

           <input type="hidden" name="agent_id" value="<?php echo $this->agent->id ?>"> 
           <input type="hidden" name="task" value="agent.sendmsg" /> 
           <input type="hidden" name="return" value="<?php echo base64_encode($this->uri->toString(array('path', 'query', 'fragment'))) ?>"> 
           <?php echo JHtml::_('form.token'); ?> 
          </form><!-- /#form-contact --> 
         </div><!-- /.agent-form --> 
        </div><!-- /.col-md-5 --> 
       </section><!-- /.agent-form --> 
      </div><!-- /.row --> 
     </section><!-- /#contact-agent --> 

支払いボタン 申し込みフォーム>フォーム

<form role="form" id="pay" method="post" action="<https://www.voguepay.com/pay"> 
<!-- Payment button (hide after successful redirect, show only agent form?) --> 
     <div class="pay"> 
     <input type='hidden' name='v_merchant_id' value='demo' /> 
<input type='hidden' name='merchant_ref' value='SC-CommitmentFee' /> 
<input type='hidden' name='memo' value='SC- Design Commitment Fee' /> 

<input type='hidden' name='developer_code' value='500000d1c' /> 
<input type='hidden' name='store_id' value='1' /> 
<input type='hidden' name='success_url' value='' /> 
<input type='hidden' name='fail_url' value='' /> 

<input type='hidden' name='total' value='1500' /> 
<input type='image' align="right" src='http://voguepay.com/images/buttons/make_payment_green.png' alt='Submit' /> 
</div> 
</form> 

答えて

1

のGETパラメータを使用してフォームに戻ってリダイレクトする必要があります成功URL "支払-成功= 1"フォームをカプセル化する条件を作成することができます。

$jinput = JFactory::getApplication()->input; 
$paymentSuccess = $jinput->get('payment-success', '0', 'BOOL'); 
if ($paymentSuccess){ 
    /* Display the form */ 
} 
+0

逆の処理を行い、最初にフォームを表示してからエントリを保存すると、支払いが成功し、支払いフォームページからリダイレクトすると、申請書が提出されます。 –

関連する問題