Пример #1
0
 public static function generateEntityList($query)
 {
     $ttab = "";
     $result = mysql_query($query) or die("Error in query: {$query}. " . mysql_error());
     if (mysql_num_rows($result) == 0) {
         return $ttab;
     }
     while ($row = mysql_fetch_assoc($result)) {
         $entityObjs[$row['id']] = Entity::reincarnate($row['id']);
     }
     //Header Table
     $ttab .= "<div class='eList'>";
     $ttab .= "<table>";
     $ttab .= "<tr>";
     //type
     $size = 3 * UNIT;
     $ttab .= "<td rowspan=2 width='{$size}' align='center' ><u><i> Type </i></u></td>";
     //id
     $size = 2 * UNIT;
     $ttab .= "<td width='{$size}' align='center' ><u><i> Id </i></u></td>";
     //title
     $ttab .= "<td align='center' ><u><i> Title </i></u></td>";
     //updated
     $size = 6 * UNIT;
     $ttab .= "<td width='{$size}' align='center' ><u><i> Updated </i></u></td>";
     //level
     $size = 2 * UNIT;
     $ttab .= "<td width='{$size}' align='center' ><u><i> Lvl </i></u></td>";
     //rating
     $ttab .= "<td width='{$size}' align='center' ><u><i> Rate </i></u></td>";
     //status
     $size = 3 * UNIT;
     $ttab .= "<td width='{$size}' align='center' ><u><i> Status </i></u></td>";
     $ttab .= "</tr>";
     $ttab .= "</table>";
     $ttab .= "</div>";
     //Content Table
     foreach ($entityObjs as $entity) {
         $class = $entity->special ? "special" : "eList";
         $ttab .= "<div class='{$class}' title='{$entity->description}' >";
         $ttab .= "<table>";
         $ttab .= "<tr >";
         //type
         $type = $entity->type;
         $size = 3 * UNIT;
         $ttab .= "<td rowspan=2 width='{$size}' > <img src='img/{$type}.png' width='{$size}' height='{$size}' /> </td>";
         //id
         $size = 2 * UNIT;
         $ttab .= "<td rowspan=2 width='{$size}' align='center' > {$entity->id} </td>";
         //title
         $ttab .= "<td style='text-transform:uppercase; ' > <a href='Post_Central.php?id={$entity->id}' ><b> {$entity->title} </b></a> </td>";
         //updated
         $size = 6 * UNIT;
         $up = getFmtdDate($entity->updated, 'jS M Y');
         $ttab .= "<td width='{$size}' align='center' > {$up} </td>";
         //level
         $size = 2 * UNIT;
         $ttab .= "<td width='{$size}' align='center' > {$entity->level} </td>";
         //rating
         $ttab .= "<td width='{$size}' align='center' > {$entity->rating} </td>";
         //status
         $status = $entity->status;
         $size = UNIT;
         $tdSize = 3 * UNIT;
         $ttab .= "<td width='{$tdSize}' align='center' > <img src='img/{$status}.png' width='{$size}' height='{$size}' /> </td>";
         $ttab .= "</tr>";
         $ttab .= "<tr>";
         //tags
         $ttab .= "<td colspan=7>";
         $tags = $entity->getTags();
         foreach ($tags as $tag) {
             $ttab .= "<div class='tag' ><a href='Search_Engine.php?tags={$tag}'> {$tag} </a></div>";
         }
         $ttab .= "</td>";
         $ttab .= "</tr>";
         $ttab .= "</table>";
         $ttab .= "</div>";
     }
     return $ttab;
 }
Пример #2
0
$ctab = "";
for ($i = 1; $i < $entity->nxtSeqNo; $i++) {
    /*Comment table setup*/
    $Cid = $com[$i]->id;
    $class = $com[$i]->special ? "special" : "cList";
    $ctab .= "<div class='{$class}' >";
    $ctab .= "<table>";
    //delete
    $size = UNIT;
    $ctab .= "<tr><td colspan=7 align='right' ><form action='Delete.php' method='POST' onsubmit='return confirmReq()'>\n\t\t\t\t<button type='submit' name='cid' value='{$Cid}' style='background-color:inherit; border:0; cursor:pointer;' >\n\t\t\t\t\t<img src='img/delete.png' width='{$size}' height='{$size}' />\n\t\t\t\t</button>\n\t\t\t  </form></td></tr>\n\t\t\t  ";
    //seqNo
    $ctab .= "<tr>";
    $seqNo = $com[$i]->seqNo;
    $ctab .= "<td align='center' style='font-size:{$font}' ><div class='edit' id='c-{$Cid}-seqNo'> {$seqNo} </div></td>";
    //timeStamp
    $updated = getFmtdDate($com[$i]->timeStamp, 'g:ia \\o\\n l jS F Y');
    $ctab .= "<td align='right' > Updated: </td><td> {$updated} </td>";
    //special
    $special = $com[$i]->special;
    $ctab .= "<td align='right' > Special: </td><td><div class='edit' id='c-{$Cid}-special'> {$special} </div></td>";
    //rating
    $rating = $com[$i]->rating;
    $ctab .= "<td align='right' > Rating: </td><td align='center' style='font-size:{$font}' ><div class='edit' id='c-{$Cid}-rating'> {$rating} </div></td>";
    $ctab .= "</tr>";
    //image
    $img = $com[$i]->image;
    if ($img != "") {
        $ctab .= "<tr>";
        $ctab .= "<td colspan=7  align='center' >";
        $size = 30 * UNIT;
        $ctab .= "<div style='float:left; margin-left:100px; ' >";