query($count); $db->next_record(); $num_rows = $db->f("num_rows"); // Create the Page Navigation $pageNav = new vmPageNav( $num_rows, $limitstart, $limit ); // Create the List Object with page navigation $listObj = new listFactory( $pageNav ); // print out the search field and a list heading $listObj->writeSearchHeader($VM_LANG->_PHPSHOP_FILEMANAGER_LIST, IMAGEURL."ps_image/mediamanager.png", $modulename, "filemanager"); // start the list table $listObj->startTable(); // these are the columns in the table $columns = Array( "#" => "width=\"20\"", $VM_LANG->_PHPSHOP_PRODUCT_LIST_NAME => '', $VM_LANG->_PHPSHOP_PRODUCT_LIST_SKU => '', $VM_LANG->_PHPSHOP_FILEMANAGER_ADD => '', $VM_LANG->_PHPSHOP_FILEMANAGER_IMAGES => '', $VM_LANG->_PHPSHOP_FILEMANAGER_DOWNLOADABLE => '', $VM_LANG->_PHPSHOP_FILEMANAGER_FILES => '', $VM_LANG->_PHPSHOP_FILEMANAGER_PUBLISHED => '' ); $listObj->writeTableHeader( $columns ); $db->query($list); $i = 0; $dbp = new ps_DB; while ($db->next_record()) { $listObj->newRow(); $tmp_cell = ""; // The row number $listObj->addCell( $pageNav->rowNumber( $i ) ); // Is the product downloadable? $dbp->setQuery( "SELECT attribute_name FROM #__{sc}_product_attribute WHERE product_id='" . $db->f("product_id") . "' AND attribute_name='download'" ); $dbp->loadObject( $downloadable ); // What Images does the product have ? $dbp->setQuery( "SELECT count(file_id) as images FROM #__{sc}_product_files WHERE file_product_id='" . $db->f("product_id") . "' AND file_is_image='1' " ); $images = array(); $dbp->loadObject($images); // What Files does the product have ? $dbp->setQuery( "SELECT count(file_id) as files FROM #__{sc}_product_files WHERE file_product_id='" . $db->f("product_id") . "' AND file_is_image='0' " ); $files = array(); $dbp->loadObject($files); if( $db->f("product_parent_id")) { $tmp_cell = "    "; } $tmp_cell .= $db->f("product_name"); $listObj->addCell( $tmp_cell ); $listObj->addCell( $db->f("product_sku") ); $url = $_SERVER['PHP_SELF']."?page=$modulename.file_list&product_id=" . $db->f("product_id"); $tmp_cell = "  url($url) . "\">[ ".$VM_LANG->_PHPSHOP_FILEMANAGER_ADD." ]"; $listObj->addCell( $tmp_cell ); $tmp_cell = empty($images->images) ? "0" : $images->images; $listObj->addCell( $tmp_cell ); if (empty($downloadable)) { $tmp_cell = 'Publish'; } else { $tmp_cell = 'Unpublish'; } $listObj->addCell( $tmp_cell ); unset( $downloadable ); $tmp_cell = empty($files->files) ? "0" : $files->files; $listObj->addCell( $tmp_cell ); if ($db->f("product_publish")=="N") { $tmp_cell = 'Publish'; } else { $tmp_cell = 'Unpublish'; } $listObj->addCell( $tmp_cell ); $i++; } $listObj->writeTable(); $listObj->endTable(); $listObj->writeFooter( $keyword, "&task=list" ); ?>