ruạṛ
<?php /** * List galleries * @version 0.9 * @author Robert Urquhart <programmer@activatedesign.co.nz> * @package WEP-CMS */ session_start(); require_once $_SERVER['DOCUMENT_ROOT'].'/admin/scripts-includes/universal.php'; require_once $_SERVER['DOCUMENT_ROOT'].'/admin/scripts-includes/display.php'; $connID = connect_to_db(); $galleries = mysql_query(" select g.* , ( select count(*) from image_data as i where i.image_type = 'gallery' and i.container_id = g.gallery_id ) as num_images from gallery_data as g order by gallery_name "); if(!$galleries || mysql_num_rows($galleries)<1) { $table = '<p class="center">No galleries found</p>'; } else { $table = '<p class="center">To include a gallery in your page copy and paste the gallery code onto a line by itself in the page editor.</p> <table class="control_panel"> <thead> <tr> <th class="pad"> </th> <th>Gallery</th> <th>Code</th> <th class="control">Active</th> <th class="control">Images</th> <th class="control">Manage</th> <th class="control">Delete</th> <th class="pad"> <th> </tr> </thead> <tfoot></tfoot> <tbody class="gallery"> '; while($g = mysql_fetch_assoc($galleries)) { $gid = $g['gallery_id']; $table .= '<tr> <td> </td> <td>'.$g['gallery_name'].'</td> <td> %%GALLERY-'.$gid.'%% </td> <td><a href="processes/process-switch.php?f=active&gallery='.$gid.'" class="toggle">'.onOrOff($g['active']).'</a></td> <td>'.$g['num_images'].'</td> <td><a href="edit-gallery.php?gallery='.$gid.'">Manage</a></td> <td><a href="processes/process-gallery-delete.php?gallery='.$gid.'" onClick="if(confirm(\'Delete gallery and images?\')){return true}else{return false}" class="delete"><img src="images/img-del.png" alt="Delete"></a></td> <td> </td> </tr> '; } $table .= '</tbody> </table>'; } head('gallery','Galleries'); ?> <form name="add_gallery" id="add_gallery" action="processes/process-gallery-new.php" method="post" enctype="multipart/form-data"> <p class="center"> <label for="gallery_name">Create a new gallery named: <input name="gallery_name" id="gallery_name" type="text" size="30" maxlength="50" /></label> <input name="add" type="submit" value="New gallery" /> </p> </form> <hr /> <?php echo $table; footer(); exit; ?>
cải xoăn