ssp class array mathematical operation

ssp class array mathematical operation

hasanserhanhasanserhan Posts: 4Questions: 1Answers: 0
edited May 2023 in Free community support
$table = 'tbl'; 
 

$primaryKey = 'g'; 



$columns = array( 

    array( 'db' => 'bl', 'dt' => 0 ), 
      array( 
        'db'        => 'od', 
        'dt'        => 1, 
        'formatter' => function( $d, $row ) { 
            return ($d == 'Ödendi')?'<span class="badge badge-primary">Ödendi</span>':'<span class="badge badge-danger">Ödenmedi</span>'; 
        } 
    ) ,
    array( 'db' => 'ad',      'dt' => 2 ), 
    array( 'db' => 'do',     'dt' => 3 ), 
    array( 'db' => 'ge',    'dt' => 4 ),
    array( 
        'db'        => 't', 
        'dt'        => 5, 
        'formatter' => function( $d, $row ) { 
            return number_format($d,2, ',', ''); 
        } 
    ),
    array( 
        'db'        => 'to', 
        'dt'        => 6, 
        'formatter' => function( $d, $row ) { 
            return number_format($d,2, ',', ''); 
        } 
    ),
    array( 
        'db'        => 'toplam', 
        'dt'        => 7, 
        'formatter' => function( $d, $row ) { 
            return number_format($d,2, ',', ''); 
        } 
    ),
array( 
        'db'        => 'g', 
        'dt'        => 8, 
        'formatter' => function( $d, $row ) { 
            return ' 
                <a href="TahsilatSil.php?Del=**'.($d*(date("Ymd"))).**'"  class="btn btn-danger btn-sm" title="Sil" ><span class="fa fa-trash"></span></a>; 
          
            '; 
        } 
    ) 
    
    
    

); 



Del='.($d*(date("Ymd"))).'"   

how can I do it

Edited by Colin - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    How can you do what? Could you explain a little more, please.

    Colin

  • hasanserhanhasanserhan Posts: 4Questions: 1Answers: 0

    a href="TahsilatSil.php?Del='.($d*(date("Ymd"))).'"

    how can I do it

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin

    Still don't know what you want to do! Are you looking to add a query to the SQL statement based on your Del parameter?

    Allan

  • hasanserhanhasanserhan Posts: 4Questions: 1Answers: 0
    edited May 2023

    hello colin. Thanks for coming back.

    array(
            'db' => 'g',
            'dt' => 8,
            'formatter' => function( $d, $row ) {
                return '
                    <a href="CollectionDelete.php?Del=**'.($d*(date("Ymd"))).**'" class="btn btn-danger btn-sm" title="Delete" > <span class="fa fa-trash"></span></a>;
    

    I want to multiply data by day.

    **'.($d*(date("Ymd"))).**'" 
    

    it will be like this
    or
    can it be like this

    Sorry, my english is a bit bad, :)

    Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin

    $d (or g in the database) is presumably a number? And date("Ymd") will give you a string that contains a number such as 20230522. You could parse that as an integer (intval()) and then multiple the to together. What happens when you try that - are you getting an error message or anything?

    Allan

  • hasanserhanhasanserhan Posts: 4Questions: 1Answers: 0
    edited May 2023

    :wink: thanks allan

Sign In or Register to comment.