Location: PHPKode > projects > Changelog > changelog/admin/changelog.php
<?php
/*
	Changelog
	~~~~~~~~~~
	Author	: Thomas Whitecotton
	Email	: hide@address.com
	Website	: http://www.ciamosbase.com

*/
include("admin_header.php");

global $db, $sysConfig, $sysModule, $myts;

if((isset($folderid)) AND ($folderid == '0')) {
	redirect_header("index.php", 0, _MD_TOPLEVEL);
	exit();
} 

sys_cp_header();
OpenTable();

if($folderid) { 
	
	$sql = $db->query("SELECT name,folder FROM ".$db->prefix("changelog_folders")." WHERE fid ='" .$folderid. "'");
	list($fname,$up) = $db->fetch_row($sql); 

	echo "<h4>Files & Folders</h4>
	<table  width='100%' border='0' cellpadding='0' cellspacing='0'>
		<tr class='bg2' align='center'>
			<td align='center'>
				<table width='100%' border='0' cellpadding='4' cellspacing='1' align='center'>
					<form name='editfolder' action='index.php?op=editfolder' method='post'>
						<tr class='bg3'>
							<td nowrap>
								"._MT_ADD_FILE2DIR."
							</td>
							<td nowrap>
								"._MT_ADD_SUBDIR."
							</td>
							<td nowrap>
								"._MT_FILE_DIR_NAME."
							</td>
							<td nowrap>
								"._MT_EDIT_FILE_DIR."
							</td>
						</tr>						
						<tr class='bg3'>
							<td nowrap>
							</td>
							<td nowrap>
							</td>
							<td nowrap>
								<img src=".SYS_URL._MT_OFOLDER_IMAGE." alt='[ ]' title='Up a level'>
								<a href='changelog.php?folderid=$up' title='Up a level'> 
									Up a level
								</a>
							</td>
							<td nowrap>
							</td>
						</tr>
						<tr class='bg3'>
							<td class='bg1' nowrap>
								<a href='index.php?op=add&fid=$folderid&name=$fname' title='Add a File'>
										<img src=".SYS_URL._MT_ADD_IMAGE." alt='+' title='Add a File'>
										Add File
								</a>
							</td>
							<td class='bg1' nowrap>
								<a href='index.php?op=addfolder&fid=$folderid&name=$fname' title='Add a Directory'>
										<img src=".SYS_URL._MT_ADD_IMAGE." alt='+' title='Add a Directory'>
										Add Directory
								</a>
							</td>
							<td class='bg1' nowrap>
								<img src=".SYS_URL._MT_OFOLDER_IMAGE." title=".$fname.">
								<a href='changelog.php?folderid=$up' alt='[ ]' title=".$fname."> 
									".$fname."
								</a>
							</td>
							<td class='bg1' nowrap>
							</td>
						</tr>";
						// FOLDERS
								$query = $db->query("SELECT fid,name FROM ".$db->prefix("changelog_folders")." WHERE folder ='" .$folderid. "'");
								while (list($fid,$name)=$db->fetch_row($query)) {
								print('
						<tr class="bg3">
							<td class="bg1" nowrap>
								<a href="index.php?op=add&fid='.$fid.'&name='.$name.'" title="Add a File">
									<img src="' . SYS_URL .'/modules/changelog/images/plus.gif" alt="+" title="Add a File">
									Add File
								</a>
							</td>
							<td class="bg1" nowrap>
								<a href="index.php?op=addfolder&fid='.$fid.'&name='.$name.'" title="Add a Sub-Folder">
									<img src="' . SYS_URL .'/modules/changelog/images/plus.gif" alt="+" title="Add a Sub-Folder">
									Add Sub-Directory
								</a>
							</td>
							<td class="bg1" nowrap>						
								<a href="changelog.php?folderid='.$fid.'" title='.$name.'>
									<img src="' . SYS_URL .'/modules/changelog/images/folderc.gif" alt="[ ]" title='.$name.'> '.$name.'
								</a>
							</td>
							<td class="bg1" nowrap>
								<img alt="Edit" title="Edit" src="' . SYS_URL .'/modules/contact/images/editicon.gif" onclick=\'location="index.php?op=editfolder&fid='.$fid.'&fname='.$fname.'"\'>
								<a title="Edit" href="index.php?op=editfolder&fid='.$fid.'&fname='.$fname.'">
									Edit
								</a>
							</td>
						</tr>');
	} 
					// FILES
						$query = $db->query("SELECT cid,name FROM ".$db->prefix("changelog_files")." WHERE folder ='" .$folderid ."'");
						$fid = $folderid;
						while (list($cid,$name)=$db->fetch_row($query)) {
							print('
						<tr class="bg3">
							<td class="bg1" nowrap>
							</td>
							<td class="bg1" nowrap>
							</td>
							<td class="bg1" nowrap>
								<img src="'.SYS_URL._MT_SUBFILES.'" alt="|~|" title='.$name.'> '.$name.'
								<br>
							</td>
							<td class="bg1" nowrap>
 								<img alt="Edit" title="Edit" src="' . SYS_URL .'/modules/contact/images/editicon.gif" onclick=\'location="index.php?op=edit&cid='.$cid.'"\'>
								<a href="index.php?op=edit&cid='.$cid.'&fid='.$fid.'&fname='.$fname.'" title="Edit">
									Edit
								</a>
							</td>
						</tr>');
						}
			echo "	</form>
				</table>
			</td>
		</tr>
	</table>";
}

CloseTable();
sys_cp_footer();
?>
Return current item: Changelog