function showBasket() { $db = JFactory::getDBO(); $user = JFactory::getUser(); require JPATH_COMPONENT_ADMINISTRATOR . DS . 'config.datsogallery.php'; require_once JPATH_COMPONENT_ADMINISTRATOR . DS . 'images.datsogallery.php'; $db->setQuery('SELECT a.*, c.image_id' . ' FROM #__datsogallery AS a,' . ' #__datsogallery_basket AS c' . ' WHERE a.id = c.image_id' . ' AND c.user_id = ' . (int) $user->id . ' GROUP BY a.id' . ' ORDER BY c.id ASC'); $rows = $db->loadObjectList(); $out = ""; ?> <script type="text/javascript"> datso(document).ready(function() { datso(".dg_item_id").click(function () { var id = datso(this).attr("id"); var data = 'id=' + id; var parent = datso(this); datso(this).css({ opacity: '1.0' }, 50); datso.ajax({ type: "post", url: siteurl + 'index.php?option=com_datsogallery&task=addtobasket&format=raw', data: data, cache: false, success: function (response) { parent.animate({ opacity: '0' }, 300).hide(1); datso(".dg_slider").html(response); update_subtotal(); update_total(); } }); return false; }); }); </script> <?php if (count($rows) > 0) { foreach ($rows as $row) { $out .= "<div class=\"dg_basket\">\n"; $out .= " <ul>\n"; $out .= " <li id=\"image\"><img src=\"" . resize($row->imgoriginalname, $ad_thumbwidth1, $ad_thumbheight1, $ad_crop, '1:1', 0, $row->catid) . "\" " . get_width_height($row->imgoriginalname, $ad_thumbwidth1, $ad_thumbheight1, $row->catid, '1:1') . " class=\"dgimg\" alt=\"\" /></li>\n"; $out .= " <li id=\"item\">" . shortName($row->imgtitle, 10) . "</li>\n"; $out .= " <li id=\"cost\"><span>" . JText::_('COM_DATSOGALLERY_PRICE') . ":</span> " . currencySymbol($ad_pp_currency) . $row->imgprice . "</li><br />\n"; $out .= " <li class=\"dg_basket_box\">\n"; $out .= " <span class=\"dg_item_id\" id=\"" . $row->id . "\">\n"; $out .= " <span title=\"" . JText::_('COM_DATSOGALLERY_REMOVE_FROM_BASKET') . "\"><span class=\"remove_from_basket\"></span></span>\n"; $out .= " </span>\n"; $out .= " </li>\n"; $out .= " </ul>\n"; $out .= "</div>\n"; } $out .= "<div class=\"dg_clear\"></div>\n"; } else { $out .= "<div style=\"font-size:16px;text-align:center;\">" . JText::_('COM_DATSOGALLERY_EMPTY_BASKET') . "</div>"; $out .= "<div class=\"dg_clear\"></div>"; } return $out; }
echo md5($contato["id"]); ?> "> <a href="javascript:;"> <div class="pull-left img-user-chat"> <img src="<?php echo base_url(); ?> imagem-usuario/<?php echo md5($contato["id"]); ?> " class="img-circle" alt="User Image"> </div> <div class="menu-info"> <h4 class="control-sidebar-subheading"><i class="fa fa-circle text-success"></i> <?php echo shortName($contato["nome"]); ?> </h4> <p><?php echo ucwords(strtolower($contato["cargo"]["descricao"])); ?> </p> </div> </a> </li> <?php } ?> </ul>
*/ header("content-type: application/x-javascript"); /* * function to shorten usernames * change value for $newLength */ function shortName($name) { $newLength = 12; if (strlen(urldecode($name)) > $newLength) { $name = substr($name, 0, $newLength) . "..."; } return $name; } /* * show photos * */ echo "function showGallery(){ "; echo 'var galleryHTML = ""; '; echo 'galleryHTML += "<div class=\'loginUserTableHeader\'><span class=\'loginUserTable\'>:: Recent Logins</span></div>"; '; echo 'galleryHTML += "<div style=\'width:520px;padding-top:10px;\'>"; '; while ($i = mysql_fetch_array($tmp)) { echo 'galleryHTML += "<div style=\'float: left; text-align: center; padding: 5px 5px 5px 5px; \' >"; '; echo 'galleryHTML += "<span class=\'loginUserTable\'><img src=profiles/view.php?id=' . $i['id'] . ' height=\'78\' width=\'90\' alt=\'"+decodeURI(\'' . $i['username'] . '\')+"\' title=\'"+decodeURI(\'' . $i['username'] . '\')+"\'><br>"+decodeURI(\'' . shortName($i['username']) . '\')+"</span>"; '; echo 'galleryHTML += "</div>"; '; } echo 'galleryHTML += "<div>"; '; echo 'document.getElementById(\'latestMembers\').innerHTML = galleryHTML; '; echo "} "; echo "window.onload = function(){showGallery();}";