Forum Sementara Putera.com

Would you like to react to this message? Create an account in a few clicks or log in to continue.
Forum Sementara Putera.com

Bersama kita perkemaskan forum ini sementara forum asal dalam pemulihan.

Forum putera dah kembali. Masalah sudah berjaya diselesaikan. Sila lawati http://forum.putera.com/tanya


2 posters

    Simple order form component for Joomla! 1.5

    avatar
    anyss
    Ahli Baharu
    Ahli Baharu


    Number of posts : 9
    Registration date : 17/07/2009

    Simple order form component for Joomla! 1.5 Empty Simple order form component for Joomla! 1.5

    Post by anyss Tue Jul 21, 2009 6:13 pm

    salam,

    sy dlm proses membuat order form...setakat ni sy telah membuat order form tanpa mengikut kategori..bagaimana sy nak modified order form ini mengikut kategori?

    sila bantu sy kawan-kawan...
    OngBok
    OngBok
    Moderators
    Moderators


    Gender : Male Number of posts : 729
    Location : Dungun Terengganu
    Job/hobbies : Pesara JKR
    Registration date : 18/02/2009

    Simple order form component for Joomla! 1.5 Empty Re: Simple order form component for Joomla! 1.5

    Post by OngBok Tue Jul 21, 2009 8:12 pm

    kategori yang macamana tu
    avatar
    anyss
    Ahli Baharu
    Ahli Baharu


    Number of posts : 9
    Registration date : 17/07/2009

    Simple order form component for Joomla! 1.5 Empty Re: Simple order form component for Joomla! 1.5

    Post by anyss Wed Jul 22, 2009 10:48 am

    sy tengah buat order form barang makanan tanpa mengikut kategori...sy nk list kn barang2 yg ada terbahagi kepada 3 kategori..Cthnya:

    1)Frozen Food:
    - Chicken Chop
    - Chicken Maryland

    2)Sauce:
    - Brown Sauce

    3)Soup:
    - Beef Soup
    - Mushroom Soup


    Macam mana sy nk wt order form mengikut kategori seperti di atas?

    Harap boleh bantu sy..Thank you..
    OngBok
    OngBok
    Moderators
    Moderators


    Gender : Male Number of posts : 729
    Location : Dungun Terengganu
    Job/hobbies : Pesara JKR
    Registration date : 18/02/2009

    Simple order form component for Joomla! 1.5 Empty Re: Simple order form component for Joomla! 1.5

    Post by OngBok Wed Jul 22, 2009 12:08 pm

    Form nie dalam html kemudian action ke php script?
    avatar
    anyss
    Ahli Baharu
    Ahli Baharu


    Number of posts : 9
    Registration date : 17/07/2009

    Simple order form component for Joomla! 1.5 Empty Re: Simple order form component for Joomla! 1.5

    Post by anyss Wed Jul 22, 2009 12:33 pm

    form ni dlm php script..

    ada tak cara mcm ne nk wt?
    OngBok
    OngBok
    Moderators
    Moderators


    Gender : Male Number of posts : 729
    Location : Dungun Terengganu
    Job/hobbies : Pesara JKR
    Registration date : 18/02/2009

    Simple order form component for Joomla! 1.5 Empty Re: Simple order form component for Joomla! 1.5

    Post by OngBok Wed Jul 22, 2009 1:46 pm

    Nie contoh borang orderform.html

    Simple order form component for Joomla! 1.5 Orderform-1
    <html>
    <head>
    <title>Order Form</title>
    </head>
    <body>
    <form method="POST" action="order.php">
    <table>
    <tr>
    <td width="50%" align="right" bgcolor="#FFFF00">1) Frozen Food:</td>
    <td width="50%" bgcolor="#FFFF00">
    <input type="radio" value="Chicken Chop" name="FF" checked>Chicken Chop<p>
    <input type="radio" name="FF" value="Chicken Maryland">Chicken Maryland</td>
    </tr>
    <tr>
    <td width="50%" align="right">&nbsp;</td>
    <td width="50%">&nbsp;</td>
    </tr>
    <tr>
    <td width="50%" align="right" bgcolor="#FFFF00">2) Sauce:<br>
    &nbsp;</td>
    <td width="50%" bgcolor="#FFFF00">
    <input type="checkbox" name="Sauce" value="BrownSauce" checked>Brown Sauce<br>
    &nbsp;</td>
    </tr>
    <tr>
    <td width="50%" align="right" bgcolor="#FFFF00">3) Soup ::<br>
    &nbsp;</td>
    <td width="50%" bgcolor="#FFFF00">
    <input type="radio" name="Soup" value="Beef Soup" checked>Beef Soup<br>
    <input type="radio" name="Soup" value="Mushroom Soup">Mushroom Soup<br>
    &nbsp;</td>
    </tr>
    <tr>
    <td width="50%" align="right" bgcolor="#008000">&nbsp;</td>
    <td width="50%" bgcolor="#008000">
    <input type="submit" value="Submit" name="B2"></td>
    </tr>
    <tr>
    <td width="50%" align="right">&nbsp;</td>
    <td width="50%">&nbsp;</td>
    </tr>
    <tr>
    <td width="50%" align="right">&nbsp;</td>
    <td width="50%">&nbsp;</td>
    </tr>
    <tr>
    <td width="50%" align="right">&nbsp;</td>
    <td width="50%">&nbsp;</td>
    </tr>
    <tr>
    <td width="50%" align="right">&nbsp;</td>
    <td width="50%">&nbsp;</td>
    </tr>
    </table>
    </p>
    </form>

    </body>

    </html>

    =====================================
    Nie script order.php

    <?php
    # ----------------------------------------------------
    # -----
    # ----- This script was generated by PHP-Form Wizard 1.2.5 on 8/9/2003 at 1:20:28 AM
    # -----
    # ----- http://www.tools4php.com
    # -----
    # ----------------------------------------------------


    // Receiving variables
    @$pfw_ip= $_SERVER['REMOTE_ADDR'];
    @$FF = addslashes($_POST['FF']);
    @$Sauce = addslashes($_POST['Sauce']);
    @$Soup = addslashes($_POST['Soup']);

    // Validation
    if (strlen($FF) == 0 )
    {
    header("Location: error.html");
    exit;
    }

    if (strlen($Sauce) == 0 )
    {
    header("Location: error.html");
    exit;
    }

    if (strlen($Soup) == 0 )
    {
    header("Location: error.html");
    exit;
    }

    //Sending Email to form owner
    $pfw_header = "From: $FF\n"
    . "Reply-To: $FF\n";
    $pfw_subject = "OrderForm";
    $pfw_email_to = "yourmail@gmail.com";
    $pfw_message = "Visitor's IP: $pfw_ip\n"
    . "FF: $FF\n"
    . "Sauce: $Sauce\n"
    . "Soup: $Soup\n";
    @mail($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;

    header("Location: thank.html");

    ?>
    avatar
    anyss
    Ahli Baharu
    Ahli Baharu


    Number of posts : 9
    Registration date : 17/07/2009

    Simple order form component for Joomla! 1.5 Empty Re: Simple order form component for Joomla! 1.5

    Post by anyss Mon Jul 27, 2009 5:37 pm

    actually,sy dh wt order form tanpa mengikut kategori dan codenya:

    <h1 class="contentheading"><?=JText::_('Order form');?></h1>

    <script language="JavaScript" type="text/javascript">

    window.onload=updatePrice;
    function updatePrice() {
    price = 0;
    <?
    foreach ($this->rows as $row) {
    $price = $row->price;
    $vat = $row->vat_percent;
    if($row->vat_included == 0)
    {
    $price_without = $price;
    $price = round( $price +($price/100)*$vat ,2);
    $jsCalc = "quantity * ".$price_without." + ( quantity * ".$price_without.")/100 *".$vat;
    } else {
    $price_without = round($price/(1+$vat/100), 2);
    $jsCalc = "quantity * ".$price;
    }
    ?>

    if (!isNaN(document.forms["orderForm"].quantity_<?=$row->id;?>.value)) {
    quantity = document.forms["orderForm"].quantity_<?=$row->id;?>.value;
    price += <?=$jsCalc;?>;
    }
    <?
    } //end foreach
    ?>
    price_total=document.getElementById("total");
    //round to 2 decimals
    price = Math.round(price*Math.pow(10,2))/Math.pow(10,2);
    price_total.innerHTML=price;

    }



    </script>
    <? if(!empty($this->error)) { ?>
    <dl id="system-message">
    <dt class="error">Error</dt>
    <dd class="error message fade">
    <ul>
    <?
    foreach ($this->error as $err) {
    echo "<li>";
    echo $err;
    echo "</li>";
    }
    ?>
    </ul>
    </dd>
    </dl>
    <? } //end if error ?>
    <form method="post" action="<?=$_SERVER['REQUEST_URI']?>" id="orderForm" name="orderForm">

    <table>
    <tr>
    <td><input type="text" value="<?=$this->data['name'];?>" name="name" class="inputbox" size="50" /></td>
    <td><?=JText::_('NAME');?> *</td>
    </tr>
    <tr>
    <td><input type="text" value="<?=$this->data['surname'];?>" name="surname" class="inputbox" size="50" /></td>
    <td><?=JText::_('SURNAME');?> *</td>
    </tr>
    <tr>
    <td><input type="text" value="<?=$this->data['company'];?>" name="company" class="inputbox" size="50" /></td>
    <td><?=JText::_('COMPANY');?></td>
    </tr>
    <tr>
    <td style="height:5px;"></td>
    <td></td>
    </tr>
    <tr>
    <td><input type="text" value="<?=$this->data['address'];?>" name="address" class="inputbox" size="50" /></td>
    <td><?=JText::_('ADDRESS');?> *</td>
    </tr>
    <tr>
    <td><input type="text" value="<?=$this->data['zip_code'];?>" name="zip_code" class="inputbox" size="50" /></td>
    <td><?=JText::_('ZIP');?> *</td>
    </tr>
    <tr>
    <td><input type="text" value="<?=$this->data['city'];?>" name="city" class="inputbox" size="50" /></td>
    <td><?=JText::_('CITY');?> *</td>
    </tr>
    <tr>
    <td style="height:5px;"></td>
    <td></td>
    </tr>
    <tr>
    <td><input type="text" value="<?=$this->data['email'];?>" name="email" class="inputbox" size="50" /></td>
    <td><?=JText::_('EMAIL');?> *</td>
    </tr>
    <tr>
    <td><input type="text" value="<?=$this->data['phone'];?>" name="phone" class="inputbox" /></td>
    <td><?=JText::_('PHONE');?></td>
    </tr>
    </table>
    <hr />
    <table width="451">
    <thead>
    <tr>
    <th width="223"><?=JText::_('PRODUCT');?></th>
    <th width="112"><?=JText::_('PRICE');?></th>
    <th width="48"><?=JText::_('QUANTITY');?></th>
    <th width="48"><?=JText::_('TOTAL PRICE');?></th>
    </tr>
    </thead>
    <tbody>
    <?
    foreach ($this->rows as $row) {
    $price = $row->price;
    $vat = $row->vat_percent;
    if($row->vat_included == 0)
    {
    $price_without = $price;
    $price = round( $price +($price/100)*$vat ,2);
    } else {
    $price_without = round($price/(1+$vat/100), 2);
    }

    ?>
    <tr class="" onmouseout="this.className=''" onmouseover="this.className='product_hover'">
    <td style="width:200px;"><?=$row->title;?></td>
    <td style="width:100px;">RM <?=$price;?></td>
    <td><input type="text" value="<?=$this->data['quantity_'.$row->id];?>" name="quantity_<?=$row->id;?>" class="inputbox" size="5" onkeyup="updatePrice()" /></td>
    <td>&nbsp;</td>
    </tr>
    <?
    } //end foreach
    ?>
    </tbody>
    </table>
    <p>&nbsp;</p>
    <hr />
    <div style="padding-left:420px;">
    <?=JText::_('ORDER TOTAL PRICE');?>: RM <span id="total">0.00</span></div>
    <hr />
    <?=JText::_('NOTES');?>:<br/>
    <textarea name="notes" class="inputbox" style="width:300px; height:100px;"><?=$this->data['notes'];?></textarea><br/><br/>
    <input class="button" type="submit" value="<?=JText::_('SEND ORDER');?>" name="Submit"/>
    <input type="hidden" name="task" value="add" />
    </form><br/><br/><br/><br/>


    sy still lagi takdpt nk wt order form mengikut kategori...
    ada tak sesiapa boleh bantu sy berdasarkn code di atas spy order sy mengikut kategori...

    terima kasih..
    avatar
    anyss
    Ahli Baharu
    Ahli Baharu


    Number of posts : 9
    Registration date : 17/07/2009

    Simple order form component for Joomla! 1.5 Empty Re: Simple order form component for Joomla! 1.5

    Post by anyss Wed Jul 29, 2009 12:12 pm

    ada tak sesiapa boleh bantu sy...
    sy taktau nk wt order form ni ikut kategori...
    dh byk kali cuba buat tak dpt...
    tolong laa saya...

    Sponsored content


    Simple order form component for Joomla! 1.5 Empty Re: Simple order form component for Joomla! 1.5

    Post by Sponsored content


      Current date/time is Mon Nov 18, 2024 10:33 am