require_once "photo-setup.inc";
GLM_TOOLBOX::top("Photo Albums (List Photos)", HELP_BASE."photo.phtml?key=list");
$lnav = array(
- "Add A New Photo" => "edit_photo.phtml?catid=$catid",
- "List Photos" => "list_photo.phtml?catid=$catid",
- "List Albums" => "list_photo_category.phtml"
- );
+ "Add A New Photo" => "edit_photo.phtml?catid=$catid",
+ "List Photos" => "list_photo.phtml?catid=$catid",
+ "List Albums" => "list_photo_category.phtml"
+);
GLM_TOOLBOX::html_nav_table($lnav, 5);
$query = "select * from photo_category_bus;";
if ($res2 = $DB->db_exec($query)) {
$data2[$row2['photocat_id']] = $row2['buscat_id'];
}
}
-$qs2 = "SELECT id,title,pos
- FROM photo
- WHERE catid = $catid
- ORDER BY pos";
+$qs2 = "
+ SELECT id,title,pos
+ FROM photo
+ WHERE catid = $catid
+ORDER BY pos";
$res = $DB->db_exec($qs2);
if (!$res) {
GLM_TOOLBOX::html_error(DB_ERROR_MSG, 1);
<th> Function </th>
<th> Title </th>
</tr>
-<?
-for($i = 0; $i < $DB->db_numrows($res); $i++)
-{
- $row = $DB->db_fetch_array($res,$i, PGSQL_ASSOC);
- if(!$row[id])
- {
- GLM_TOOLBOX::html_error(DB_ERROR_MSG,1);
+<?php
+for ($i = 0; $i < $DB->db_numrows($res); $i++) {
+ $row = $DB->db_fetch_array($res, $i, PGSQL_ASSOC);
+ if (!$row['id']) {
+ GLM_TOOLBOX::html_error(DB_ERROR_MSG, 1);
}
- if(!$row[id])
- {
- GLM_TOOLBOX::html_error(DB_ERROR_MSG,1);
+ if (!$row['id']) {
+ GLM_TOOLBOX::html_error(DB_ERROR_MSG, 1);
}
?>
<tr>
<td align="left" nowrap="nowrap">
- <a href="edit_photo.phtml?id=<?echo $row[id]?>&catid=<?echo $catid?>">[Edit/Delete]</a>
- <?
+ <a href="edit_photo.phtml?id=<?echo $row[id]?>&catid=<?php echo $catid;?>">[Edit/Delete]</a>
+ <?php
$qs = "SELECT MAX(pos) as maxpos
FROM photo
WHERE catid = $catid";
- if(!$maxresult = $DB->db_exec($qs))
- {
+ if (!$maxresult = $DB->db_exec($qs)) {
GLM_TOOLBOX::html_error(DB_ERROR_MSG.$qs,0);
}
$max_data = $DB->db_fetch_array($maxresult,0,PGSQL_ASSOC);
$pos = "<font size=-4><select name=pos
onChange=location.href=this[this.selectedIndex].value;
size=1>";
- for($newpos=1;$newpos<=$maxpos;$newpos++)
- {
+ for ($newpos=1;$newpos<=$maxpos;$newpos++) {
$string = "Command=Move&id=$row[id]&catid=$catid&newpos=$newpos";
$pos .= "<option value=\"update_photo.phtml?$string\"";
- if($newpos == $row[pos])
- {
+ if ($newpos == $row[pos]) {
$pos .= " selected";
}
$pos .= ">$newpos\n";
echo $pos;
?>
</td>
- <td align=left> <b><?echo $row[title]?></b> </td>
+ <td align=left> <b><?php echo $row['title'];?></b> </td>
</tr>
- <?
+ <?php
}
echo '</table>
</form>
<?php
require_once "../../setup.phtml";
require_once "photo-setup.inc";
-$query = "select * from photo_category_bus order by buscat_id;";
$sql = "
SELECT pcb.buscat_id,pcb.photocat_id
FROM photo_category pc
}
GLM_TOOLBOX::top("Photo Albums (List Categories)", HELP_BASE."photocat.phtml?key=list");
$lnav["Add A New Album"] = "edit_photo_category.phtml";
-//$lnav["Default Text"] = "edit-default.php";
-//$lnav["List Albums"] = "list_photo_category.phtml";
GLM_TOOLBOX::html_nav_table($lnav, 7);
echo ' <form action="update_photo_category.phtml" method="POST">
<table id="admin-list-table" style="width:500px;">';
from photo_category pc left outer join photo_category_bus pcb on (pcb.photocat_id = pc.id)
where pcb.buscat_id = ".$buscat." order by pcb.pos;";
if (!$res = $DB->db_exec($qs)) {
- GLM_TOOLBOX::html_error(DB_ERROR_MSG.$qs,1);
+ GLM_TOOLBOX::html_error(DB_ERROR_MSG.$qs, 1);
}
echo '<tr>
<td colspan="2" style="background-color:#003366;color:#fff;text-align:left;">