Absolut Engine PHP Cross Reference Web Portal Systems

Source: /admin/admin.php - 266 lines - 9904 bytes - Summary - Text - Print

   1  <?
   2  $condition=" 1 ";
   3  @include ("coreclass.php");
   4  $ae=new CArticles();
   5  $ae->RequestVariables();
   6  $ae->EngineInitialize();
   7  // Logs user in
   8  if ($ae->action==1)
   9     {
  10     $ae->RequestVariables(1);
  11     $ae->UserLogin($ae->user,$ae->pass);
  12     }
  13  $ae->UserVerifySession();
  14  // Logs user out
  15  if ($ae->action==2)
  16     {
  17     $ae->RequestVariables(1);
  18     $ae->UserLogout();
  19     }
  20  if ($ae->filtdatefrom) $ae->filtdatefrom=$ae->DateConversion($ae->filtdatefrom);
  21  if ($ae->filtdateto) $ae->filtdateto=$ae->DateConversion($ae->filtdateto);
  22  setcookie('filtarticlenumber',$ae->filtarticlenumber,time()+999999999,'/');
  23  setcookie('filttitle',$ae->filttitle,time()+999999999,'/');
  24  // setcookie('filtuserID',$ae->filtuserID,time()+999999999,'/');
  25  if ($ae->filtdatefrom) setcookie('filtdatefrom',$ae->filtdatefrom,time()+999999999,'/');
  26  if ($ae->filtdateto) setcookie('filtdateto',$ae->filtdateto,time()+999999999,'/');
  27  if ($ae->filttitle)
  28     {
  29     $condition.=" AND title LIKE '%".$ae->filttitle."%'";
  30     }
  31  if ($ae->filtuserID)
  32     {
  33     $condition.=" AND authorID='".$ae->filtuserID."'";
  34     }
  35  if ($ae->filtdatefrom)
  36     {
  37     $condition.=" AND adate>='".$ae->filtdatefrom."'";
  38     }
  39  if ($ae->filtdateto)
  40     {
  41     $condition.=" AND adate<='".$ae->filtdateto."'";
  42     }
  43  if ($ae->filtsectionID)
  44     {
  45     $condition.=" AND sec.sectionID='".$ae->filtsectionID."'";
  46     }
  47  $condition.=" GROUP BY art.ID ORDER BY ";
  48  if ($ae->sortby=="date")
  49     {
  50     setcookie('sortby','date',time()+999999999,'/');
  51     setcookie('sortorder',$ae->sortorder,time()+999999999,'/');
  52     if ($ae->sortorder=="asc") $ae->sortorder="desc"; else $ae->sortorder="asc";
  53     $condition.="adate ".$ae->sortorder.",atime ".$ae->sortorder;
  54     }
  55  elseif ($ae->sortby=="title")
  56     {
  57     setcookie('sortby','title',time()+999999999,'/');
  58     setcookie('sortorder',$ae->sortorder,time()+999999999,'/');
  59     if ($ae->sortorder=="asc") $ae->sortorder="desc"; else $ae->sortorder="asc";
  60     $condition.="title ".$ae->sortorder;
  61     }
  62  elseif ($ae->sortby=="section")
  63     {
  64     setcookie('sortby','section',time()+999999999,'/');
  65     setcookie('sortorder',$ae->sortorder,time()+999999999,'/');
  66     if ($ae->sortorder=="asc") $ae->sortorder="desc"; else $ae->sortorder="asc";
  67     $condition.="sectionID ".$ae->sortorder;
  68     }
  69  elseif ($ae->sortby=="priority")
  70     {
  71     setcookie('sortby','priority',time()+999999999,'/');
  72     setcookie('sortorder',$ae->sortorder,time()+999999999,'/');
  73     if ($ae->sortorder=="asc") $ae->sortorder="desc"; else $ae->sortorder="asc";
  74     $condition.="priority ".$ae->sortorder;
  75     }
  76  elseif ($ae->sortby=="status")
  77     {
  78     setcookie('sortby','status',time()+999999999,'/');
  79     setcookie('sortorder',$ae->sortorder,time()+999999999,'/');
  80     if ($ae->sortorder=="asc") $ae->sortorder="desc"; else $ae->sortorder="asc";
  81     $condition.="status ".$ae->sortorder;
  82     }
  83  elseif ($ae->sortby=="author")
  84     {
  85     setcookie('sortby','author',time()+999999999,'/');
  86     setcookie('sortorder',$ae->sortorder,time()+999999999,'/');
  87     if ($ae->sortorder=="asc") $ae->sortorder="desc"; else $ae->sortorder="asc";
  88     $condition.="authorID ".$ae->sortorder;
  89     }
  90  else
  91     {
  92     $condition.="adate DESC, atime DESC";
  93     }
  94  @include ("header.php");
  95  
  96  @include ("menu.php");
  97  
  98  echo '<div id="content">';
  99  
 100  if ($ae->currentuserposition<=3) @include ('filter.php');
 101  
 102  //$ae->DisplayEngineModuleParts();
 103  
 104  if ($ae->currentuserposition<=3)
 105     {
 106     if (!$ae->filtarticlenumber) $ae->filtarticlenumber=20;
 107     $condition.=" LIMIT ".$ae->filtarticlenumber;
 108     $ae->DBQuery("SELECT * FROM ".$ae->table[3]." AS art LEFT JOIN ".$ae->table[9]." AS sec ON art.ID=sec.articleID WHERE ".$condition);
 109     echo '<table width="98%">';
 110     echo '<thead>';
 111     echo '<tr>';
 112     echo '<td width="18%">';
 113     if ($ae->sortby=="date" OR !$ae->sortby) echo '<span class="help" title="',$ae->textbasic[88],'">*</span>';
 114     echo '<h2>',$ae->textbasic[22],'</h2> <a href="admin.php?sortby=date&sortorder=',$ae->sortorder,'&username=',$ae->username,'&session=',$ae->session,'" title="',$ae->textbasic[87],'">';
 115     if ($ae->sortorder=="asc")
 116        {
 117        echo '<img src="images/asc.gif" alt="',$ae->textbasic[87],'" />';
 118        }
 119     else
 120        {
 121        echo '<img src="images/desc.gif" alt="',$ae->textbasic[87],'" />';
 122        }
 123     echo '</a></td>';
 124     echo '<td width="45%">';
 125     if ($ae->sortby=="title") echo '<span title="',$ae->textbasic[88],'">*</span>';
 126     echo '<h2>',$ae->textbasic[23],'</h2> <a href="admin.php?sortby=title&sortorder=',$ae->sortorder,'&username=',$ae->username,'&session=',$ae->session,'" title="',$ae->textbasic[87],'">';
 127     if ($ae->sortorder=="asc")
 128        {
 129        echo '<img src="images/asc.gif" alt="',$ae->textbasic[87],'" />';
 130        }
 131     else
 132        {
 133        echo '<img src="images/desc.gif" alt="',$ae->textbasic[87],'" />';
 134        }
 135     echo '</a></td>';
 136     echo '<td width="20%">';
 137     if ($ae->sortby=="author") echo '<span title="',$ae->textbasic[88],'">*</span>';
 138     echo '<h2>',$ae->textbasic[33],'</h2> <a href="admin.php?sortby=author&sortorder=',$ae->sortorder,'&username=',$ae->username,'&session=',$ae->session,'" title="',$ae->textbasic[87],'">';
 139     if ($ae->sortorder=="asc")
 140        {
 141        echo '<img src="images/asc.gif" alt="',$ae->textbasic[87],'" />';
 142        }
 143     else
 144        {
 145        echo '<img src="images/desc.gif" alt="',$ae->textbasic[87],'" />';
 146        }
 147     echo '</a></td>';
 148     echo '<td width="1%">';
 149     if ($ae->sortby=="priority") echo '<span title="',$ae->textbasic[88],'">*</span>';
 150     echo '<a href="admin.php?sortby=priority&sortorder=',$ae->sortorder,'&username=',$ae->username,'&session=',$ae->session,'" title="',$ae->textbasic[87],'">';
 151     if ($ae->sortorder=="asc")
 152        {
 153        echo '<img src="images/asc.gif" alt="',$ae->textbasic[87],'" />';
 154        }
 155     else
 156        {
 157        echo '<img src="images/desc.gif" alt="',$ae->textbasic[87],'" />';
 158        }
 159     echo '</a></td>';
 160     echo '<td width="1%">';
 161     if ($ae->sortby=="status") echo '<span title="',$ae->textbasic[88],'">*</span>';
 162     echo '<a href="admin.php?sortby=status&sortorder=',$ae->sortorder,'&username=',$ae->username,'&session=',$ae->session,'" title="',$ae->textbasic[87],'">';
 163     if ($ae->sortorder=="asc")
 164        {
 165        echo '<img src="images/asc.gif" alt="',$ae->textbasic[87],'" />';
 166        }
 167     else
 168        {
 169        echo '<img src="images/desc.gif" alt="',$ae->textbasic[87],'" />';
 170        }
 171     echo '</a></td>';
 172     echo '<td>&nbsp;</td>';
 173     echo '<td>&nbsp;</td>';
 174     echo '</tr>';
 175     echo '</thead>';
 176     echo '<tbody>';
 177     while ($ae->DBGetRow())
 178           {
 179           $temp=$ae->outcome;
 180           $articleID=$ae->access["ID"];
 181           $adate=$ae->access["adate"];
 182           $atime=$ae->access["atime"];
 183           $title=$ae->access["title"];
 184           $authorID=$ae->access["authorID"];
 185           $priority=$ae->access["priority"];
 186           $status=$ae->access["status"];
 187           echo '<td>';
 188           echo $ae->DateConversion($adate,2);
 189           echo ' ';
 190           echo $atime;
 191           echo '</td><td>';
 192           echo '<a href="../showarticle.php?articleID=',$articleID,'" target="preview" onclick="window.open(\'../showarticle.php.?articleID=',$articleID,'\',\'preview\',\'resizable=yes,scrollbars=yes,width=720,height=400\');">';
 193           echo $ae->access["title"];
 194           echo '</a>';
 195           echo '</td><td>';
 196           $ae->GetArticleAuthor($authorID);
 197           $ae->GetAuthorName();
 198           echo '</td><td>';
 199           if ($ae->currentuserposition<=2)
 200              {
 201              if ($priority)
 202                 {
 203                 echo '<a href="modify.php?command=36&articleID=',$articleID,'&username=',$ae->username,'&session=',$ae->session,'" class="priority" title="',$ae->textbasic[17],'">&nbsp;</a>';
 204                 }
 205              else
 206                 {
 207                 echo '<a href="modify.php?command=35&articleID=',$articleID,'&username=',$ae->username,'&session=',$ae->session,'" class="nopriority" title="',$ae->textbasic[16],'">&nbsp;</a>';
 208                 }
 209              }
 210           else
 211              {
 212              if ($priority)
 213                 {
 214                 echo '<span class="priority">&nbsp;</a>';
 215                 }
 216              else
 217                 {
 218                 echo '<span class="nopriority">&nbsp;</a>';
 219                 }
 220              }
 221           echo '</td><td>';
 222           if ($ae->currentuserposition<=2)
 223              {
 224              if ($status)
 225                 {
 226                 echo '<a href="modify.php?command=38&articleID=',$articleID,'&username=',$ae->username,'&session=',$ae->session,'" class="published" title="',$ae->textbasic[86],'">&nbsp;</a>';
 227                 }
 228              else
 229                 {
 230                 echo '<a href="modify.php?command=37&articleID=',$articleID,'&username=',$ae->username,'&session=',$ae->session,'" class="onhold" title="',$ae->textbasic[45],'">&nbsp;</a>';
 231                 }
 232              }
 233           else
 234              {
 235              if ($status)
 236                 {
 237                 echo '<span class="published">&nbsp;</span>';
 238                 }
 239              else
 240                 {
 241                 echo '<span class="onhold">&nbsp;</span>';
 242                 }
 243              }
 244           echo '</td><td>';
 245           if (($authorID==$ae->currentuserID AND $status==0) OR $ae->currentuserposition<=2)
 246              {
 247              echo '<a href="editarticle.php?articleID=',$articleID,'&username=',$ae->username,'&session=',$ae->session,'">',$ae->textbasic[106],'</a>';
 248              }
 249           else echo '&nbsp;';
 250           echo '</td>';
 251           echo '<td>';
 252           if (($ae->authorID==$ae->currentuserID AND $ae->status==0) OR $ae->currentuserposition<=2)
 253              {
 254              echo '<a href="modify.php?command=1&articleID=',$articleID,'&username=',$ae->username,'&session=',$ae->session,'" onclick="return confirm(\'',$ae->textbasic[53],'\')">',$ae->textbasic[110],'</a>';
 255              }
 256           else echo '&nbsp;';
 257           echo '</td>';
 258           echo '</tr>';
 259           $ae->outcome=$temp;
 260           }
 261     echo '</tbody>';
 262     echo '</table>';
 263     }
 264  echo '</div>';
 265  @include ("footer.php");
 266  ?>

title

Description

title

Description

title

Description

title

title

Body