2016-12-02 3 views
0

Dank im Voraus, tatsächlich habe ich ein Formular mit Name der Prüfung, Veranstaltungsort, Datum der Prüfung, Preis/Kurs, Anzahl der Prüfungen und Add to Cart senden Taste und unten habe ich eine <div id="division"></div>. Nachdem Sie die Details in das Formularfeld eingegeben und das Formular abgeschickt haben, sollten die Formularfeldwerte an den folgenden Tag übergeben werden: <div id="division"></div>. Für jeden Eintrag des Formulars sollten die Werte zum Tag <div id="division"></div> hinzugefügt werden. Und ich möchte das Element entfernen, das ich früher hinzugefügt habe. Wie kann ich das mit der Sitzung in CakePHP tun. Etwas wie das Hinzufügen von Artikeln zum Einkaufswagen im Einkaufswagen.wie Formularfeld Werte in Sitzung übergeben und Anzeige innerhalb der div-Tag in CakePHP

My index.ctp view page 
    <table><thead> 
      <th>Exam Name</th> 
      <th>Venue Name</th> 
      <th>Date of Exam</th> 
      <!--<th>Documents</th> --> 
      <th>Price/Course</th> 
      <th>Number of Exams</th> 
      <th style="display:none">Document</th> 
      <th>Add to Cart</th> 
     </thead> 
     <tbody> 
      <tr> 
    <form name="cartTable" id="cartTable" method="post" action="<?php echo $this->webroot ?>users/cartData/?>"> 
      <td><?php echo $k; ?></td> 
       <td id="examCart"> 
       <span id="errname"></span> 
       <select name="course" id="course" required="required"> 
       <option value="">--Select--</option> 
       <!--<option>Prince 2 Foundation</option> 
       <option>Prince 2 Practitioner</option> 
       <option>ITIL Foundation</option> 
       <option>COBIT Foundation</option> --> 
       <?php foreach($userexams as $userexam): 
        $cmbExams = $userexam['exams']['exam'];  
        $newtest = explode(',',$cmbExams);     
        for($i=0;$i<count($newtest);$i++) 
        { 
        ?> 
       <option value="<?php echo $newtest[$i];?>"><?php echo $newtest[$i];?></option> 
       <?php 
        } 
        endforeach; ?> 

       </select>   
       </td>  
       <td id="examvenue"><span id="errVenue"></span><input type="text" name="venue" id="venue" required="required"></td>   
      <td><span id="errDate"></span><input type="text" name="Userdate" id="Userdate" required="required"></td> 
      <!--<td><?php //echo $alldata['e']['document']; ?></td>--> 
      <td id="priceCart"><?php echo "$0"; //echo "$0 ".$alldata['e']['price']; ?></td> 

      <td> 
       <span id="errNoExam"></span> 
       <select required="required" class="create-user" name="data[Exam][orderexam]" id="orderCart" onchange="change()"> 
       <option value="">-- Select --</option>      
       <?php 
       for($i=1;$i<=10000;$i++) 
       { 
       ?> 
       <option value="<?php echo $i; ?>"><?php echo $i; ?></option>      
      <?php } ?>   

      </td> 
      <td style="display:none"><input type="text" name="hide" value="<?php echo $alldata['e']['document']?>"></td> 
      <td><input type="submit" name="btnAddCart" value="Add to Cart" class="cartbtn"><!--<button type="button" class="btn btn-success btn-xs cartbtn">Add to Cart</button>--></td> 
      </form> 
     </tr></tbody> 
    <div class="container cartdetails"> 
     <div class="row"> 
     <div class="col-md-10"> 
     <p style="font-size:25px;text-align:center;">Cart Details</p> 

      <div id="division"> 

     ////// I Have to pass the session values here ///////  

      </div> 
     <form action="https://www.paypal.com/cgi-bin/webscr" method="post"> 
      <input type="hidden" name="cmd" value="_cart"> 
      <input type="hidden" name="business" value="[email protected]"> 
      <input type="hidden" name="upload" value="1"> 

      <input type="hidden" name="item_number_" value="" id="itm_no">  
      <input type="hidden" name="item_name_" value="" id="item_name"> 
      <input type="hidden" name="amount_" value="" id="eprice"> 
      <input type="hidden" name="shipping_" value="sdssddd" > 
      <input type="hidden" name="quantity_" value="3" id="eorder"> 

      <input type="hidden" name="currency_code" value="USD" >  

      <input type="hidden" name="amount" value="" id="payTotal"> 

      <!--<input type="image" src="http://www.paypal.com/en_US/i/btn/x-click-but03.gif" name="submit" id="placeOrder"> --> 
     </form> 
    </div> 
    </div> 
    </div> 

    My UsersController.php page code as below 

    <?php 
    App::uses('CakeEmail', 'Network/Email'); 
    class UsersController extends AppController 
    { 

     public function cartData() 
     { 



     } 

    } 

Antwort

Verwandte Themen