wisest owl (wisest_owl) wrote in changelog,
wisest owl
wisest_owl
changelog

[ljcom] r9867: LJSUP-7508. Userheads statistic and admi...

Committer: gprochaev
LJSUP-7508. Userheads statistic and admin tool updates

U   trunk/htdocs/admin/userheads/manage.bml
U   trunk/htdocs/admin/userheads/stat.bml
Modified: trunk/htdocs/admin/userheads/manage.bml
===================================================================
--- trunk/htdocs/admin/userheads/manage.bml	2010-12-20 08:22:57 UTC (rev 9866)
+++ trunk/htdocs/admin/userheads/manage.bml	2010-12-20 08:38:14 UTC (rev 9867)
@@ -117,10 +117,12 @@
     },
 );
 
+$ret .= "<table><tr><td valign='top'>";
+
 $ret .= "<form method='POST'>";
 $ret .= "<table border=0 cellspacing=1 cellpadding=4>";
 $ret .= "<tr><td>Id</td><td>Img</td><td>Cost</td><td>&nbsp;</td><td>Author</td><td>Description</td><td>Description SUP</td></tr>";
-foreach my $uh (@$uhs) {
+foreach my $uh (grep { $_->get_visibility ne 'D' } @$uhs) {
     $ret .= "<tr>\n";
     $ret .= "<td><input type='hidden' name='".$uh->get_uh_id."-uh_id' value='".$uh->get_uh_id."'>".$uh->get_uh_id."</td>\n";
     $ret .= "<td><img src='".$uh->get_uh_img."'></td>\n";
@@ -138,6 +140,31 @@
 $ret .= "<tr><td colspan='5'><input type='submit' name='save' value='Save'></td></tr>\n";
 $ret .= "</table>";
 $ret .= "</form>";
+
+$ret .= "</td><td valign='top'>";
+
+$ret .= "<table border=0 cellspacing=1 cellpadding=4>";
+$ret .= "<tr><td>Id</td><td>Img</td><td>Cost</td><td>&nbsp;</td><td>Author</td><td>Description</td><td>Description SUP</td></tr>";
+foreach my $uh (grep { $_->get_visibility eq 'D' } @$uhs) {
+    $ret .= "<tr>\n";
+    $ret .= "<td><input type='hidden' name='".$uh->get_uh_id."-uh_id' value='".$uh->get_uh_id."'>".$uh->get_uh_id."</td>\n";
+    $ret .= "<td><img src='".$uh->get_uh_img."'></td>\n";
+    $ret .= "<td><input type='text' name='".$uh->get_uh_id."-price' size='5' value='".$uh->get_price."'></td>\n";
+    $ret .= "<td><select name='".$uh->get_uh_id."-visibility'>\n";
+    foreach my $sel (@selects) {
+        $ret .= "\t<option value='".$sel->{'value'}."'".($uh->get_visibility eq $sel->{'value'} ? " selected='selected' " : "").">".$sel->{'name'}."</option>\n";
+    }
+    $ret .= "</select></td>\n";
+    $ret .= "<td><input type='text' name='".$uh->get_uh_id."-author' value='".$uh->get_uh_author."'></td>\n";
+    $ret .= "<td><input type='text' name='".$uh->get_uh_id."-desc' value='".$uh->get_uh_desc."'></td>\n";
+    $ret .= "<td><input type='text' name='".$uh->get_uh_id."-desc-sup' value='".$uh->get_uh_desc_sup."'></td>\n";
+    $ret .= "</tr>\n";
+}
+$ret .= "<tr><td colspan='5'><input type='submit' name='save' value='Save'></td></tr>\n";
+$ret .= "</table>";
+
+$ret .= "</td></tr></table>";
+
 $ret .= "<hr>";
 
 $ret .= "<form method='POST'>";

Modified: trunk/htdocs/admin/userheads/stat.bml
===================================================================
--- trunk/htdocs/admin/userheads/stat.bml	2010-12-20 08:22:57 UTC (rev 9866)
+++ trunk/htdocs/admin/userheads/stat.bml	2010-12-20 08:38:14 UTC (rev 9867)
@@ -83,7 +83,7 @@
 
     $ret .= "<table border='1'>";
     $ret .= "<tr><td>id</td><td>img</td><td>price</td><td>author</td><td>quantity</td><td>amount</td></tr>";
-    foreach my $item (keys %uh_stat) {
+    foreach my $item (sort { $uh_stat{$b}{qty} <=> $uh_stat{$a}{qty} } keys %uh_stat) {
         my ($uh_id) = $item =~ m#uh-(\d+)#;
         next unless $uh_id;
         my $uh = LJ::UserHead->get_userhead ($uh_id);

Tags: bml, ljcom, wisest-owl
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments