value minus value

More
10 years 5 months ago #42748 by ggppdk
Replied by ggppdk on topic value minus value
Hello

this is very easy to do for a developer

it is a calculation inside a loop and display of it, after loop ends

inside ITEM (row) loop do
(and just after the loop that creates the columns of a each row), thus after:
<?php foreach ($columns as $name => $label) : ?>
<th id="field_<?php echo $name; ?>" scope="col"><?php echo $label; ?></th>
<?php endforeach; ?>


add:
Code:
if ( !isset($earn_sum) ) $earn_sum = (int)$flds_arr[$field_id2][0] - (int)$flds_arr[$field_id1][0]; else $earn_sum += (int)$flds_arr[$field_id2][0] - (int)$flds_arr[$field_id1][0];

and after foreach of item loop (will look like):
Code:
<?php endforeach; ?> </tbody> </table>
alter above to insert a:
Code:
<?php endforeach; ?> <tr> <td colspan="<?php echo count($columns)+1;?>"></td> <td><?php echo $earn_sum; ?></td> </tr> </tbody> </table>

just such questions,
despite not being difficult it takes some time to answer, and are neither bug nor configuration questions , but we will have a special subscription soon for everything,

except for bug reporting (and fixing which will be free)

Regards


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
10 years 5 months ago #42751 by days of summer
Replied by days of summer on topic value minus value
thanks for your reply Mr ggppdk

i don't know what to do
these codes will replace the codes we used before ?
or i should put them with it ?

i tried to follow the steps
it showed a new row in the bottom of the table
but with no results inside it :s

and i tried to write a new text echo it appeared normally !

i have made so edits to the code
i add
<?php ?> tag to
Code:
if ( !isset($earn_sum) ) $earn_sum = (int)$flds_arr[$field_id2][0] - (int)$flds_arr[$field_id1][0]; else $earn_sum += (int)$flds_arr[$field_id2][0] - (int)$flds_arr[$field_id1][0];

and added it just after
Code:
<?php foreach ($columns as $name => $label) : ?> <th id="field_<?php echo $name; ?>" scope="col"><?php echo $label; ?></th> <?php endforeach; ?>

and before this line
Code:
<th scope="col"><?php echo JText::_('My column title'); ?></th>

is that right ?

and i am really thankful Mr ggppdk
and i hope the subscription is not very expensive so that i can join it

by the way
i have made some custom templates for flexicontent category and i will share them as soon as possible

thanks :)

Please Log in or Create an account to join the conversation.

More
10 years 5 months ago #42763 by ggppdk
Replied by ggppdk on topic value minus value
Hello

please answer my PM with a PM,

(you seem to have forgotten to add this)
Code:
<tr> <td colspan="<?php echo count($columns)+1;?>"></td> <td><?php echo $earn_sum; ?></td> </tr>

the above code should work, it might need a correction but it is what you need

Regards


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
10 years 5 months ago #42765 by days of summer
Replied by days of summer on topic value minus value
i have replied
thanks Mr ggppdk

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.273 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline