Hide div according user ID or user group ID? - Joomla! Forum - community, help and support
hello.
i need hiding table columns specific users or user group i've assigned them.
currently, i'm using this(php , javascript):
though, not working. there wrong code? i'm telling if user id not 42, must "hide" class "londonstore"; if user 42 logged in, must "show" class "londonstore".
a group better.
thanks , appreciate help.
i need hiding table columns specific users or user group i've assigned them.
currently, i'm using this(php , javascript):
code: select all
<div class="londonstore"
<?php
$user =& jfactory::getuser();
$userid = $user->get('id')
if (!$userid == '42' )
{ echo ' <script type="text/javascript">
$(document).ready(function(){
$(".londonstore").hide();</script>
})' ;
}
else
{ echo ' <script type="text/javascript">
$(".londonstore").show();</script>'; }
?>>
<th>london store delivered</th>
<th>london store deviated</th>
<th>london store balance</th>
</div>
though, not working. there wrong code? i'm telling if user id not 42, must "hide" class "londonstore"; if user 42 logged in, must "show" class "londonstore".
a group better.
thanks , appreciate help.
here's updated code, though it's still not working:
code: select all
<?php
$user = jfactory::getuser();
$userid = $user->get('id');
if ($userid == '42') { ?>
<script type='text/javascript'>
$('.londonstore').show();
</script>
<?php } else { ?>
<script type='text/javascript'>
$('.londonstore').hide();
</script>
<?php }; ?>
Comments
Post a Comment