Location: PHPKode > projects > Kwalbum > kwalbum/pages/EditMultiplePage.html.php
<?php
/**
 * @package kwalbum
 * @version 2.1.1
 * @since 2.0
 */
require_once 'include/funcGetImageCode.php';
?>
<big><b><?=$title?>  =Edit Multiple Mode=</b></big>
<br/>
<a href="<?=$extendedURL?>n=<?=$URLP->GetPageNumber()?>">Back to Regular Edit Mode</a>
<br/>
<table border='0' width='100%'><tr>
<td align='left'><?=$prevLinks?></td>
<td align='center'><?=$pageNumberLinks?></td>
<td align='right'><?=$nextPageLinks?></td>
</tr></table>
<?
if ($numPics > 0)
{
	$c = 0;
	$r = 0;
	$p = 0;
?>
<form action='<?=$extendedURL?>n=<?=$URLP->GetPageNumber()?>&amp;p=EditMultiple' id='theForm' method='post'>
<br/>
<b>Information for "all" selected items</b>
<small><i>Fields are ignored if left blank.</i></small>
<br/>
Location: <input type="text" class="text" name="loc" id="loc" size="40" autocomplete="off" />
<span id='allLocHint' class='autocomplete'"></span>
<br/>
Tags: <input type="text" class="text" name="tags" id="tags" size="44" /><small><i>Added to existing tag lists</i></small>
<span id='allTagsHint' class='autocomplete'"></span>
<br/>
People: <input type="text" class="text" name="people" id="people" size="44" /><small><i>Added to existing people lists</i></small>
<span id='allPeopleHint' class='autocomplete'"></span>
<br/>
Date: <input type="text" class="text" name="allDate" id="allDate" size="8" />
Time: <input type="text" class="text" name="allTime" id="allTime" size="6" /> <small><i>(yyyy-mm-dd and hr:min:sec)</i></small>
<br/>
Visibility: <select name='allVis'>
	<option value='-1'></option>
	<option value='0'>Public</option>
	<option value='1'>Members Only</option>
	<option value='2'>Privileged Only</option>
	<?=(USER_IS_ADMIN ? "<option value='3'>Admin Only</option>" : null)?>
	</select>
<br/>
<br/>
<input type='submit' name='act' value='Save Changes'/>
<br/>
<br/>
<b>Information for individual items</b>
<small><i>Checked items will have values set above</i></small>
<br/><input type='button' onClick='toggleChecks();' value='toggle "all" checkboxes' />
<table>
<tr><th class='cell'>"all"</th><th class='cell'>Location/Thumbnail</th><th class='cell'>Date &amp; Time</th>
<th class='cell'>Description</th><th class='cell'>Visibility</th><?=(USER_IS_ADMIN ? "<th class='cell'>Contributor</th>" : null)?>
<th class='cell'>Delete?</th></tr>
<?
$i = 0;
do
{
	$highlight = $i++ % 2;
	if (0 == $c)
		echo '<tr>';
	if ($row = $result->fetch_array(MYSQLI_ASSOC))
	{
		$id = $row['ItemId'];
		echo "\n<td ".($highlight ? "class='cell'" : "align='center'")."><input type='hidden' name='id[]' value='$id'".((!USER_IS_ADMIN and USER_ID != $row['ItemUserIdFk']) ? ' disabled' : null)."/>" .
		"<input type='checkbox' name='all[$id]' id='all[$id]' value='1'".((!USER_IS_ADMIN and USER_ID != $row['ItemUserIdFk']) ? ' disabled' : null)."/></td>".
		"<td ".($highlight ? "class='cell'" : "align='center'").">$row[Location]<br/><a href='$extendedURL&amp;i=$row[ItemId]' target='_blank'>".GetImageCode($row['ItemPath'], $row['ItemFilename'], $row['ItemTypeId'], $id).
		"</a><br/>$row[ItemFilename]</td>\n".
		"<td ".($highlight ? "class='cell'" : "align='left'").">"
		."<small>Displayed:</small><br/><input type='text' name='date[$id]' value='$row[ItemDate]' size='8'".((!USER_IS_ADMIN and USER_ID != $row['ItemUserIdFk']) ? ' disabled' : null)."/>".
		" <input type='text' name='time[$id]' value='$row[ItemTime]' size='6'".((!USER_IS_ADMIN and USER_ID != $row['ItemUserIdFk']) ? ' disabled' : null)."/>\n".
		"<br/><small>Arranged By:</small><br/><input type='text' name='orderby[$id]' value='$row[ItemOrderBy]' size='16'".((!USER_IS_ADMIN and USER_ID != $row['ItemUserIdFk']) ? ' disabled' : null)."/><br/><small>(usually can ignore this)</small></td>\n".
		"<td ".($highlight ? "class='cell'" : "align='center'")."><textarea name='desc[$id]' cols='60' rows='6'".((!USER_IS_ADMIN and USER_ID != $row['ItemUserIdFk']) ? ' disabled' : null).">$row[ItemDescription]</textarea></td>\n".
		"<td ".($highlight ? "class='cell'" : "align='center'")."><select name='vis[$id]'".((!USER_IS_ADMIN and USER_ID != $row['ItemUserIdFk']) ? ' disabled' : null).">" .
			"<option value='0'".(0 == $row['ItemIsHidden'] ? ' selected' : null).">Public</option>" .
			"<option value='1'".(1 == $row['ItemIsHidden'] ? ' selected' : null).">Members Only</option>" .
			"<option value='2'".(2 == $row['ItemIsHidden'] ? ' selected' : null).">Privileged Only</option>".
			(USER_IS_ADMIN ? "<option value='3'".(3 == $row['ItemIsHidden'] ? ' selected' : null).">Admin Only</option>" : null)."</select></td>";
		if (USER_IS_ADMIN)
		{
			echo "<td ".($highlight ? "class='cell'" : "align='center'")."><select name='cont[$id]'>";
			foreach ($contributors as $contId => $name)
			{
				echo "<option value='$contId'".($row['ItemUserIdFk'] == $contId ? ' selected' : null).">$name</option>";
			}
			echo "</select></td>";
		}
		echo "\n<td ".($highlight ? "class='cell'" : "align='center'")."><input type='checkbox' name='del[$id]' value='1'".((!USER_IS_ADMIN and USER_ID != $row['ItemUserIdFk']) ? ' disabled' : null)."/></td>";
	}
	else if ($r > 0)
		echo "<td></td>";
	$c++;
	$p++;
    if ($numColumns == $c)
    {
    	echo '</tr>';
    	if ($p == $numPics or !$row)
    		break;
    	$r++;
    	$c = 0;
    }
} while($r < $numRows);
?>
</table>
<input type='submit' name='act' value='Save Changes'/>
</form>

<table border='0' width='100%'><tr>
<td align='left'><?=$prevLinks?></td>
<td align='center'><?=$pageNumberLinks?></td>
<td align='right'><?=$nextPageLinks?></td>
</tr></table>

<script type='text/javascript'>
	new Ajax.Autocompleter("loc", "allLocHint", "ajax/getLocations.php", {frequency: 0.1});
	new Ajax.Autocompleter("tags", "allTagsHint", "ajax/getTags.php", {frequency: 0.1});
	new Ajax.Autocompleter("people", "allPeopleHint", "ajax/getPeople.php", {frequency: 0.1});

	function toggleChecks()
	{
		var ids = document.getElementsByName("id[]");
		for (i = 0; i < ids.length; i++)
		{
			var all = document.getElementById('all['+ids[i].value+']');
			all.checked = !all.checked;
		}
	}
</script>
<?
}
else
{
	echo 'No items were found that match your search and that you have permission to edit.';
}
?>
Return current item: Kwalbum