Location: PHPKode > projects > Netautor Professional > netautor/napro4/admin/layout/layoutmgr_search.php
<?php
/* +----------------------------------------------------------------------+
   | Netautor Professional Application Server                             |
   +----------------------------------------------------------------------+
   | Copyright (C) 1998-2005 digiconcept GmbH. <www.digiconcept.net>      |
   +----------------------------------------------------------------------+
   | This file is subject to license, that is bundled with this package   |
   | in the file LICENSE.TXT, and is available at through the             |
   | world-wide-web at http://www.netautor.com/license/                   |
   |                                                                      |
   | If you did not receive a copy of the license and are unable to       |
   | obtain it through the world-wide-web, please send a note to          |
   | hide@address.com so we can mail you a copy.                      |
   +----------------------------------------------------------------------+
   | Authors: Stefan Rottensteiner <hide@address.com>    |
   |          Marek  Kadziela      <hide@address.com>	      |
   |          Gregor Wollner                                              |
   |          Christian Unger                                             |
   |          Helli  Kleinhans  									      |
   +----------------------------------------------------------------------+
   | @version	$Revision: 1.21 $										  |
   +----------------------------------------------------------------------+*/

/**
 * Search layouts.
 */

require_once('../../include/init.inc');
if(!$GLOBALS['USER']->check_feature('Admin') && !$GLOBALS['USER']->check_feature('ac_layout'))
{
	$GLOBALS['USER']->login_call();
}

includeNaPro('form,string,array,mdb');

$GLOBALS['LOCALE']->textdomain('layout');

?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
	<title>/digiconcept/netautor/layoutmanager/search layout</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="Expires" content="0">
	<meta name="robots" content="nofollow">	
	<link rel=stylesheet type="text/css" href="../../include/netautor.css">
	<script language="JavaScript">
	/**
	* Sort result by user defined criteria
	*/
		function newSort(criterium){
			order_old = '<?php echo(empty($order) ? '' : $order); ?>';
			order_dir_old = '<?php echo(empty($order_dir) ? '' : $order_dir); ?>';
			order_dir_new = 'asc';
			if(order_dir_old == 'asc')
			{
				order_dir_new = 'desc';
			}
			else if(order_dir_old == 'desc')
			{
				order_dir_new = 'asc';
			}
			
			if(order_old != criterium+' '+order_dir_old)
			{
				order_dir_new = 'asc';
			}
			document.forms[0].elements['order'].value = criterium+' '+order_dir_new;
			document.forms[0].elements['order_dir'].value = order_dir_new;
			searchLayout();
		}
	/**
	* Brings desired layout into editor formular
	*/
		function editLayout(lay_id){
			if (window.opener){
				window.opener.document.location.href="layoutmgr.php?mlay_id="+lay_id;
				if (window.opener.focus) window.opener.focus();
				window.close();
			}
			else
			{
				parent.frames['layoutmain'].document.location.href = "layoutmgr.php?mlay_id="+lay_id;
				parent.document.getElementById('f_editor').rows="*,0,24,24,24";
				document.location.href = '#top';
			}
		}
	/**
	* Search Layouts
	*/
		function searchLayout()
		{
			document.forms[0].elements['search'].value = 'yes';
			if(document.forms[0].elements['mlay_name0'].value != '')
			{
				document.forms[0].elements['mlay_name'].value = '%'+document.forms[0].elements['mlay_name0'].value+'%';
			}
			if(document.forms[0].elements['mlay_remark0'].value != '')
			{
				document.forms[0].elements['mlay_remark'].value = '%'+document.forms[0].elements['mlay_remark0'].value+'%';
			}
			setTimeout('document.forms[0].submit()',200);
		}
	/**
	* Clear From
	*/
		function clearForm()
		{
			document.forms[0].elements['mlay_name0'].value = '';
			document.forms[0].elements['mlay_remark0'].value = '';
			top.main.document.getElementById('f_editor').rows='*,0,24,24,24';
			setTimeout('document.forms[0].submit()',200);
		}
	</script>
</head>
<body class="grey">

<?php 

	if(isset($mlay_default) && $mlay_default==0)	unset($mlay_default);

	//$GLOBALS['search']='yes';
	if (empty($order)) $order='mlay_name';

	$pre='<table width="100%" border="0" cellspacing="0" cellpadding="3">
			<tr>
				<td align="left" valign="top" class="textgrey"><a class="textgrey" href="javascript:newSort(\'mlay_id\');"> '.$GLOBALS['LOCALE']->gettext('layout_id').'</a><br></td>
				<td align="left" valign="top" class="textgrey"><a class="textgrey" href="javascript:newSort(\'mlay_default\');">'.$GLOBALS['LOCALE']->gettext('default').'</a><br></td>
				<td align="left" valign="top" class="textgrey"><a class="textgrey" href="javascript:newSort(\'mlay_name\');">'.$GLOBALS['LOCALE']->gettext('name').'</a><br></td>
				<td align="left" valign="top" class="textgrey"><a class="textgrey" href="javascript:newSort(\'mlay_remark\');">'.$GLOBALS['LOCALE']->gettext('remark').'</a><br></td>
			</tr>';

	$view = array('mlay_id','mlay_id','mlay_default','mlay_name','mlay_remark','mlay_mn_naid','mlay_typ');

	$loop ="<tr class='bglistgrey'>
				<td align='left' valign='top' class='text'><a href='javascript:editLayout(%s);' class='link'>%s</a></td>
				<td align='left' valign='top' class='text'>%s</td>
				<td align='left' valign='top' class='text'>%s</td>
				<td align='left' valign='top' class='text'>%s</td>
			<tr>";

	$post 	='</table>';
	$trans 	= array(
					'mlay_default' => array(  	'1'	=>$GLOBALS['LOCALE']->gettext('yes'),
							  					'0'	=>$GLOBALS['LOCALE']->gettext('no'),
												''	=>$GLOBALS['LOCALE']->gettext('no')
												)
				 );
?>

<table width="520" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td width="457" align="left" valign="center" class="text">
			<img src="../../grafik/pixel.gif" width="457" height="4"><br>
			<img src="../../grafik/pixel.gif" width="4" height="1"><a href="#" class="text" onClick="javascript:if(parent.document.getElementById('f_editor').rows=='*,0,24,24,24'){parent.document.getElementById('f_editor').rows='10,0,*,24,24';}else{parent.document.getElementById('f_editor').rows='*,0,24,24,24';};top.scrollFrames('layoutdb');"><?php echo( $GLOBALS['LOCALE']->gettext('layout_search') ); ?></a><br>
		</td>
		<td width="63" align="left" valign="top">
			<img src="../../grafik/updown_grey.gif" width="63" height="21" border="0" usemap="#updown"><br>
			<map name="updown">
				<area shape="circle" coords="12,9,9" href="#" onClick="javascript:parent.document.getElementById('f_editor').rows='10,0,*,24,24';top.getFrameByName('layoutdb').scrollTo(0,0);">
				<area shape="circle" coords="50,9,9" href="#" onClick="javascript:parent.document.getElementById('f_editor').rows='*,0,24,24,24';top.getFrameByName('layoutdb').scrollTo(0,0);">
			</map>
		</td>
	</tr>
</table>

<table width="975" border="0" cellspacing="0" cellpadding="4">
	<form name="Search" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
	<input type="hidden" name="order" value="<?php echo($order);?>">
	<input type="hidden" name="order_dir" value="<?php echo($order_dir);?>">
	<input type="hidden" name="search" value="">
	<tr>
		<td width="755" align="left" valign="top" class="head">
			<?php echo( $GLOBALS['LOCALE']->gettext('layout_hits') ); ?><br>
			<img src="../../grafik/pixel.gif" width="747" height="12"><br>
			<?php 
				show_results($pre,$view,$loop,$post,$trans,'mlayouts',$order,$order_dir);
			?>
		</td>
		<td width="10"></td>
		<td width="210" align="left" valign="top" class="head">
			<?php echo( $GLOBALS['LOCALE']->gettext('layout_search_what') ); ?><br>
			<img src="../../grafik/pixel.gif" width="202" height="12"><br>
			<span class="text">
			<?php echo( $GLOBALS['LOCALE']->gettext('name') ); ?><br>
			<input type="text" name="mlay_name0" value="<?php echo($mlay_name0); ?>" class="select202"><br>
			<input type="hidden" name="mlay_name" value="">
			<img src="../../grafik/pixel.gif" width="1" height="4"><br>
			
			<?php echo( $GLOBALS['LOCALE']->gettext('remark') ); ?><br>
			<input type="text" name="mlay_remark0" value="<?php echo($mlay_remark0); ?>" class="select202"><br>
			<input type="hidden" name="mlay_remark" value="">
			<img src="../../grafik/pixel.gif" width="1" height="4"><br>
			
			<?php echo( $GLOBALS['LOCALE']->gettext('table') ); ?><br>
			<select name="mlay_mn_naid" size="1" class="select202">
				<option></option>
<?php
				echo(db_selection('mnames',' order by mn_name','mn_naid','mn_name',isset($mlay_mn_naid)?$mlay_mn_naid:"",'false','','',''));
?>
			</select><br>
			
			<img src="../../grafik/spacer_grey.gif" width="202" height="15"><br>
			
			</span>
			
			<input type="button" value="<?php echo( $GLOBALS['LOCALE']->gettext('button_search') ); ?>" class="create" onClick="searchLayout();">
			<input type="button" value="<?php echo( $GLOBALS['LOCALE']->gettext('button_new') ); ?>" class="new" onClick="clearForm();"><br>
		</td>
	</tr>
	<tr>
		<td width="755"><img src="../../grafik/pixel.gif" width="747" height="1"><br></td>
		<td width="10"><img src="../../grafik/pixel.gif" width="2" height="1"><br></td>
		<td width="210"><img src="../../grafik/pixel.gif" width="202" height="1"><br></td>
	</tr>
</table>

<br>

</form>

</body>

</html>
Return current item: Netautor Professional