What do you do after ".submit"? - Joomla! Forum - community, help and support


i've got small problem here - have set of form submit buttons in backend view in order individually select specific object - order id - , transfer view load whole order can seen administration.

this relevant view:

code: select all

<?php
defined('_jexec') or die('restricted access');

jhtml::_('behavior.tooltip');
?>
<style type="text/css">
#adminform th, td {
   text-align:center;
   font-size:16px;
}
</style>

<div id="adminbox">
    <form action="<?php echo jroute::_('index.php?option=com_ordergenerator'); ?>" method="post" name="adminform" id="adminform">
                <table width="100%" border="0" class="adminlist">
                    <tr class="tr">
                        <th>id</th>
                        <th>order id</th>
                        <th>price</th> 
                        <th>status</th>
                        <th>generated by</th>
                       
                        <th  width="20">edit</th>             
                    </tr>
                    <? foreach ($this->items $i => $item) { ?>
                   
                      <tr class="row<?php echo $i % 2; ?>">
                            <td><?php echo $item->id; ?></td>     
                            <td><?php echo $item->orderid; ?></td>   
                            <td><?php echo $item->price; ?></td>   
                            <td><?php echo $item->status; ?></td>
                            <td><?php echo $item->username; ?></td>

                            <td width="20"><input type="hidden" name="oid[]" value="<?php echo $item->orderid; ?>" /><input name="order" type="submit" value="price order" /></td>       
                      </tr>
                     
                    <? } ?>
                   
                    <tr>
                           <td colspan="7"><?php echo $this->pagination->getlistfooter(); ?></td>
                    </tr>         
                </table>
            <input type="hidden" name="task" value="invoices.submit" />
        <?php echo jhtml::_('form.token'); ?>
    </form>
</div>


here .submit function - should transfer $data new view?

code: select all

        public function submit()
        {
            // initialise variables.
            $app    = jfactory::getapplication();
            $model  = $this->getmodel('invoice');   
         // data form post
         $data = jrequest::getvar('oid');
   
         // update loaded data database via function in model
         $transfer = $model->getitems($data);
      
         $view =& $this->getview( 'invoice', 'html' );
         $view->display();   
        }      

code: select all

$view->assignref('data', $data);

just put line after getview , 'data' available in invoice layout. may retrieve data value using

code: select all

$this->data





Comments

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

After Effect warning: A problem occurred when processing OpenGL commands

Preconditions Failed. - Joomla! Forum - community, help and support