Topic: How do i add clickable link for table cell?

im trying to add gl_budget.php from table column Amount into a clickable link how do it ?


gl.budget.php
label_cell(number_format2($d, 0), "nowrap align=right",get_budget_view_str($myrow["id"]));

ui.view code

function get_budget_view_str($type, $trans_no, $label="", $force=false, $class='', $id='')
{
    if (!$force && !user_show_gl_info())
        return "";

    $icon = false;
    if ($label == "")
    {
        $label = _("GL");
        $icon = ICON_GL;
    }
    $url = ($type == ST_WORKORDER) ? "manufacturing/view/wo_costs_view.php?trans_no=$trans_no"
        : "gl/view/gl_budget_view.php?type_id=$type&trans_no=$trans_no";

    return viewer_link($label, $url, $class, $id, $icon);
}



<a href="https://ibb.co/pKq6ST1"><img src="https://i.ibb.co/pKq6ST1/67.png" alt="67" border="0"></a>

Re: How do i add clickable link for table cell?

if ($showdims)
        $th = array(_("Period"), _("Amount") => array('fun'=>'trans_view', 'ord'=>'', 'align'=>'right'), _("Dim. incl."), _("Last Year"));
    else
        $th = array(_("Period"), _("Amount") => array('fun'=>'trans_view', 'ord'=>'', 'align'=>'right'),  _("Last Year"));

already add the link to direct  to the database now  what did i do wrong ?

Array to string conversion in file: C:\xampp\htdocs\erp\includes\ui\ui_input.inc at line 421 when i tried to add this lines   => array('fun'=>'trans_view', 'ord'=>'', 'align'=>'right'),

3 (edited by ryanayao 03/13/2019 08:13:24 am)

Re: How do i add clickable link for table cell?

what do i do with this function to enabled or add hyperlink

function label_cell($label, $params="", $id=null)
{
    global $Ajax;

    if(isset($id))
    {
        $params .= " id='$id'";
        $Ajax->addUpdate($id, $id, $label);
    }
    echo "<td $params>$label</td>\n";


    return $label;
}

Re: How do i add clickable link for table cell?

function budget_amount_cells1($id, $parms='')
{
    global $path_to_root;
   
    label_cell(
        "<a target='_blank' " . ($bank_acc<0 ? 'class="redfg"' : '')
        ."href=''$path_to_root/purchasing/inquiry/"budget_detail_entry.php?id=".$id."'"
        ." onclick=\"javascript:openWindow(this.href,this.target); return false;\" >"
        . price_format($id)
        ."</a>", $parms);
}

already created function so it would direct link to my database but my problem now keep redirecting to supplier_inquiry page how do i change to my budget_detail_entry.php

Re: How do i add clickable link for table cell?

How do I make table cell amount into clickable link already click it but it won't point id in the database?

Re: How do i add clickable link for table cell?

function budget_amount_cells1($id, $parms='')
{
    global $path_to_root;
   
    label_cell(
        "<a target='_blank' " . ($bank_acc<0 ? 'class="redfg"' : '')
        ."href=''$path_to_root/purchasing/inquiry/"budget_detail_entry.php?id=".$id."'"
        ." onclick=\"javascript:openWindow(this.href,this.target); return false;\" >"
        . price_format($id)
        ."</a>", $parms);
}

how do i make this function point into budget id instead of amount id ? keep pointing into amount id