Example #1
0
 public function form()
 {
     $q = "select p.id from pictures p, album_pictures ap where p.id=ap.picture_id and ap.album_id={$this->id} order by ap.sortorder ASC, p.storage_id asc";
     $rs = $this->db->query($q);
     echo "<h2>Album</h2>";
     echo "<div id=\"albumForm_" . $this->id . "\" class=\"albumForm\">";
     if ($rs && $this->db->numRowS($rs)) {
         while ($o = $this->db->fetchObject($rs)) {
             // include Template::file('forms/album-editpicture' );
             echo $this->formItem($o->id);
         }
     }
     echo "</div>";
     echo "<div class=\"ui-dialog\" id=\"pictureDeleteConfirm\" title=\"Delete picture?\"><p>Are you sure you want to delete this picture?</p></div>";
     include Template::file('forms/album-newpicture');
     return;
     // UNUSED
     $q = "select hash,extension from storage where id not in (select storage_id from pictures)";
     $rs = $this->db->query($q);
     if ($rs && $this->db->numRowS($rs)) {
         while ($o = $this->db->fetchObject($rs)) {
             echo "<pre>" . print_r($o, true) . "</pre>" . PHP_EOL;
             echo "<img src=\"/storage/" . $o->hash . ".100x100.c." . $o->extension . "\" style=\"width: 100px; height: 100px; float: left;\">";
         }
         echo "<br class=\"spacer\">";
     }
 }