Example #1
0
$path_items = explode('/', $short_path);
$current_path = $racine_start;
$path_items_filtred = array();
foreach ($path_items as $folder) {
    if ($folder == ".." || $folder == "." || $folder == "") {
        continue;
    }
    $current_path .= $folder . "/";
    $path_items_filtred[$current_path] = htmlspecialchars($folder);
}
$smarty->assign("path_items_filtred", $path_items_filtred);
$smarty->assign("search", $search);
// file table
$smarty->assign("getOrderLink_KEY_NAME", getOrderLink(File_List::KEY_NAME));
$smarty->assign("getOrderLink_KEY_DATE", getOrderLink(File_List::KEY_DATE));
$smarty->assign("getOrderLink_KEY_SIZE", getOrderLink(File_List::KEY_SIZE));
// Iterate over the items in this folder
if ($file_list->getLastItemCount()) {
    $real_path = str_replace("../", "", $path);
    $xx = 0;
    $listing_filtred = array();
    foreach ($listing as $item) {
        $xx++;
        $datas = array();
        if ($item[File_List::KEY_TYPE] == File_List::TYPE_FILE) {
            // si c'est un fichier
            if (!in_array($item[File_List::KEY_EXT], $extensionsAuthorized)) {
                continue;
            }
            if ($search != "" && strpos(strtolower($item[File_List::KEY_NAME]), strtolower($search)) === false) {
                continue;
Example #2
0
    public function orders()
    {
        $per_page = 50;
        $Register = Register::getInstance();
        $this->pageTitle = __('Shop') . ' / ' . __('Orders management');
        $this->pageNav = __('Shop') . ' / ' . __('Orders management');
        $content = '';
        $popups = '';
        $model = $Register['ModManager']->getModelInstance('shopOrders');
        $total = $model->getTotal();
        list($pages, $page) = pagination($total, Config::read($per_page, $this->module), $this->getCurrentUrl('page'));
        $filters = $this->__getOrdersFilters();
        $where = array();
        if (!empty($_GET['filters']) && is_array($_GET['filters'])) {
            foreach ($_GET['filters'] as $k => $v) {
                $where[$k] = $v;
            }
        }
        $model->bindModel('author');
        $model->bindModel('delivery_type');
        $model->bindModel('products');
        $params = array('page' => $page, 'limit' => $per_page, 'order' => $model->getOrderParam());
        $orders = $model->getCollection($where, $params);
        $content .= "<div class=\"list\">\n\t\t\t<div class=\"title\">" . __('Orders management') . "</div>\n\t\t\t<div class=\"add-cat-butt\" onClick=\"window.location.href='" . $this->getUrl('order_edit') . "';\"><div class=\"add\"></div>" . __('Add order') . "</div>\n\t\t\t<table cellspacing=\"0\" style=\"width:100%;\" class=\"grid\"><tr>\n\t\t\t<th width=\"13%\">" . getOrderLink(array('date', __('Date'))) . "</th>\n\t\t\t<th width=\"7%\">" . getOrderLink(array('user', __('User'))) . "</th>\n\t\t\t<th width=\"5%\">" . getOrderLink(array('status', __('Status'))) . "</th>\n\t\t\t<th width=\"7%\">" . getOrderLink(array('total', __('Total'))) . "</th>\n\t\t\t<th width=\"15%\">" . getOrderLink(array('delivery_type', __('Delivery type'))) . "</th>\n\t\t\t<th width=\"\">" . __('Products') . "</th>\n\t\t\t<th width=\"7%\">" . getOrderLink(array('first_name', __('First name'))) . "</th>\n\t\t\t<th width=\"7%\">" . getOrderLink(array('last_name', __('Last name'))) . "</th>\n\t\t\t<th width=\"110px\" colspan=\"\">" . __('Action') . "</th></tr>";
        if (count($orders) > 0) {
            foreach ($orders as $row) {
                $popups .= '<div id="' . $row->getId() . '_edit" class="popup">
					<div class="top">
						<div class="title">' . __('View order') . '</div>
						<div onClick="closePopup(\'' . $row->getId() . '_edit\');" class="close"></div>
					</div>
					<form action="' . $this->getUrl('orders/' . $row->getId()) . '" method="POST" enctype="multipart/form-data">
					<div class="items">
						<div class="item">
							<div class="left">
								' . __('Date') . ':
							</div>
							<div class="right">' . AtmDateTime::getDate($row->getDate(), 'Y-m-d H:i:s') . '</div>
							<div class="clear"></div>
						</div>
						<div class="item">
							<div class="left">
								' . __('User') . ':
							</div>
							<div class="right">' . h($row->getAuthor() ? $row->getAuthor()->getName() : '-') . '</div>
							<div class="clear"></div>
						</div>
						<div class="item">
							<div class="left">
								' . __('Status') . ':
							</div>
							<div class="right">' . $row->getStatus() . '</div>
							<div class="clear"></div>
						</div>
						<div class="item">
							<div class="left">
								' . __('Total') . ':
							</div>
							<div class="right">' . number_format($row->getTotal(), 2, ',', ' ') . '</div>
							<div class="clear"></div>
						</div>
						<div class="item">
							<div class="left">
								' . __('Delivery type') . ':
							</div>
							<div class="right">' . h($row->getDelivery_type() ? $row->getDelivery_type()->getTitle() : '-') . '</div>
							<div class="clear"></div>
						</div>
						<div class="item">
							<div class="left">
								' . __('First name') . ':
							</div>
							<div class="right">' . h($row->getFirst_name()) . '</div>
							<div class="clear"></div>
						</div>
						<div class="item">
							<div class="left">
								' . __('Last name') . ':
							</div>
							<div class="right">' . h($row->getLast_name()) . '</div>
							<div class="clear"></div>
						</div>
						<div class="item">
							<div class="left">
								' . __('Telephone') . ':
							</div>
							<div class="right">' . h($row->getTelephone()) . '</div>
							<div class="clear"></div>
						</div>
						<div class="item">
							<div class="left">
								' . __('Delivery address') . ':
							</div>
							<div class="right">' . h($row->getDelivery_address()) . '</div>
							<div class="clear"></div>
						</div>
						<div class="item">
							<div class="left">
								' . __('Comment') . ':
							</div>
							<div class="right"><textarea disabled="disabled">' . h($row->getComment()) . '</textarea></div>
							<div class="clear"></div>
						</div>
						<div class="item submit">
							<div class="left"></div>
							<div class="right" style="float:left;">
								<input type="submit" value="' . __('Save') . '" name="send" class="save-button" />
							</div>
							<div class="clear"></div>
						</div>
					</div>
					</form>
				</div>';
                $content .= "<tr>\n\t\t\t\t\t\t\t<td>" . AtmDateTime::getDate($row->getDate(), 'Y-m-d H:i:s') . "</td>\n\t\t\t\t\t\t\t<td>" . h($row->getAuthor() ? $row->getAuthor()->getName() : '-') . "</td>\n\t\t\t\t\t\t\t<td align=\"center\">" . $row->getStatus() . "</td>\n\t\t\t\t\t\t\t<td align=\"center\">" . number_format($row->getTotal(), 2, ',', ' ') . "</td>\n\t\t\t\t\t\t\t<td>" . h($row->getDelivery_type() ? $row->getDelivery_type()->getTitle() : '-') . "</td>\n\t\t\t\t\t\t\t<td>";
                if ($row->getProducts()) {
                    $randColor = function () {
                        $colors = array('d60100', 'd85700', 'cda902', 'd6d700', '8cd304', '00d402', '23579d', '5b84ba');
                        return $colors[array_rand($colors)];
                    };
                    foreach ($row->getProducts() as $product) {
                        $content .= '<a href="' . $this->getUrl('edit_product/' . $product->getId()) . '" style="text-shadow:none; color:#' . $randColor() . '">' . h($product->getTitle()) . '</a><br>';
                    }
                    $content = substr($content, 0, -4);
                } else {
                    $content .= '-';
                }
                $content .= "</td>\n\t\t\t\t\t\t\t<td>" . h($row->getFirst_name()) . "</td>\n\t\t\t\t\t\t\t<td>" . h($row->getLast_name()) . "</td>\n\t\t\t\t\t\t\t<td colspan=\"\">\n\t\t\t\t\t\t\t<a class=\"view\" title=\"" . __('View') . "\" href=\"javascript:void(0);\" onClick=\"openPopup('" . $row->getId() . "_edit');\"></a>\n\t\t\t\t\t\t\t<a class=\"edit\" title=\"" . __('Edit') . "\" href=\"" . $this->getUrl('order_edit/' . $row->getId()) . "\"></a>\n\t\t\t\t\t\t\t<a class=\"delete\" title=\"" . __('Delete') . "\" href='" . $this->getUrl('order_delete/' . $row->getId()) . "'></a>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>";
            }
        }
        $content .= '</table></div>';
        return $popups . $filters . $content . $filters;
    }
Example #3
0
/**
 * getPagination
 * Returns HTML of Pagination links
 *
 * @access public
 * @param  int    $total_items
 * @param  int    $offset
 * @param  int    $rows_per_page
 * @return string
 */
function getPagination($total_items, $offset, $rows_per_page)
{
    global $path;
    $html = 'Page: ';
    $pages = ceil($total_items / $rows_per_page);
    for ($page = 0; $page < $pages; $page++) {
        $html .= ' &nbsp; <a href="' . getOrderLink(false, false) . '&start=' . $rows_per_page * $page . '&path=' . $path . '">' . ($page + 1) . '</a>';
    }
    return $html;
}