Location: PHPKode > projects > QuickTicket > quickticket/quickticket/qti_search.php
<?php

/*
 * PHP versions 4 and 5
 *
 * LICENSE: This source file is subject to version 3.0 of the PHP license
 * that is available through the world-wide-web at the following URI:
 * http://www.php.net/license. If you did not receive a copy of
 * the PHP License and are unable to obtain it through the web, please
 * send a note to hide@address.com so we can mail you a copy immediately.
 *
 * @category   Troubleticket
 * @package    QuickTicket
 * @author     Philippe Vandenberghe <hide@address.com>
 * @copyright  2008-2012 The PHP Group
 * @license    http://www.php.net/license  PHP License 3.0
 * @version    1.9.0.3 build:20081001
 * @link       http://www.qt-cute.org/doc/package/qti
 * @since      File available since Release 1.0.0
 * @deprecated File deprecated in Release 2.0.0
 *
 */

session_start();
require_once('bin/qti_init.php');
if ( !$oVIP->CanAccess('MUV',5,true) ) $oVIP->EndMessage('!',$L['R_member'],$_SESSION[QT]['skin_dir'],0);

// INITIALISE

$oVIP->selfurl = 'qti_search.php';
$oVIP->selfname = $L['Search'];

// --------
// HTML START
// --------

include('qti_p_header.php');

// TOP BUTTONS

echo '<table class="ta_button" cellspacing="0">',N;
echo '<tr class="tr_button">',N;
echo '<td>&nbsp;</td>',N;
echo '<td style="width:25px" class="td_button">',AsImg($_SESSION[QT]['skin_dir'].'/ico_topic_t_0.gif','T',$L['Ico_topic_t_0'],'ico ico_t'),'</td>',N;
echo '<td style="width:120px" class="td_button">&nbsp;<a href="qti_search_ov.php?a=last" class="a_button">',$L['Recent_messages'],'</a>&nbsp;</td>',N;
echo '<td style="width:10px">&nbsp;</td>',N;
echo '<td style="width:25px" class="td_button">',AsImg($_SESSION[QT]['skin_dir'].'/ico_topic_a_0.gif','T',$L['Ico_topic_a_0'],'ico ico_t'),'</td>',N;
echo '<td style="width:120px" class="td_button">&nbsp;<a href="qti_search_ov.php?a=news" class="a_button">',$L['All_news'],'</a>&nbsp;</td>',N;
if ($oVIP->role!='V')
{
echo '<td style="width:10px">&nbsp;</td>',N;
  echo '<td style="width:25px" class="td_button">',AsImg($_SESSION[QT]['skin_dir'].'/ico_user_p_1.gif','T',$L['Ico_user_p_1'],'ico ico_user'),'</td>',N;
echo '<td style="width:120px" class="td_button">&nbsp;<a href="qti_search_ov.php?a=user&amp;id=',$oVIP->id,'&amp;n=',urlencode($oVIP->username),'" class="a_button">',$L['All_my_topics'],'</a>&nbsp;</td>',N;
}
echo '</tr>',N;
echo '</table>',N;

echo '
<script type="text/javascript">
<!--
function ValidateForm(theForm)
{
  if (theForm.title.value.length==0) { alert(html_entity_decode("',$L['E_mandatory'],'")); return false; }
  return null;
}
-->
</script>
';

// SEARCH BY REF

if ( !isset($_GET['ref']) ) $_GET['ref']='';
if ( !isset($_GET['s']) ) $_GET['s']='-1';

if ( isset($_SESSION['qtiGoto']) ) {
if ( count($_SESSION['qtiGoto'])>0 ) { $arrSections = GetSectionTitles($oVIP->role,-1,-1,'numfield<>"N"');
if ( count($arrSections)>0 ) {
  echo '<h2>',$L['Search_by_ref'],'</h2>
  <form method="get" action="qti_search_id.php" onsubmit="return ValidateForm(this);">
  <table class="ta ta_s" cellspacing="0">
  <tr class="tr_t">
  <th class="th_t th_t_first th_t_empty"></th>
  <th class="th_t th_t_empty"></th>
  <th class="th_t th_t_last th_t_empty"></th>
  </tr>
  <tr class="tr_t">
  <td class="td_t" style="text-align:center; width:50px">',AsImg($_SESSION[QT]['skin_dir'].'/ico_section_search.gif','search',$L['Search'],'ico ico_s'),'</td>
  <td class="td_t">
  <select name="s" size="1"><option value="-1"',($_GET['s']=='-1' ? QSEL : ''),'>',$L['In_all_sections'],'</option>',QTastags($arrSections,$L['Section'].': %s',$_GET['s']),'</select>&nbsp;
  <input type="text" id="ref" name="ref" size="5" maxlength="10" value="'.$_GET['ref'].'" onKeyUp="handle_keypress(event,\'okref\')"/>&nbsp;<label for="title">',$L['H_Reference'],'</label></td>
  <td class="td_t" style="padding:7px; text-align:right"><input type="submit" id="okref" name="ok" value="',$L['Search'],'"/></td>
  </tr>
  <tr class="tr_t">
  <td class="tf_t tf_t_first"></td>
  <td class="tf_t"></td>
  <td class="tf_t tf_t_last"></td>
  </tr>
  </table>
  </form>',N;
}}}

// SEARCH BY KEY

if ( !isset($_GET['al']) ) $_GET['al']='';
if ( !isset($_GET['s']) ) $_GET['s']='-1';

echo '
<h2>',$L['Search_by_key'],'</h2>
<form method="get" action="qti_search_kw.php" onsubmit="return ValidateForm(this);">
<table class="ta ta_s" cellspacing="0">
<tr class="tr_t">
<th class="th_t th_t_first th_t_empty"></th>
<th class="th_t th_t_empty"></th>
<th class="th_t th_t_last th_t_empty"></th>
</tr>
<tr class="tr_t">
<td class="td_t" style="text-align:center; width:50px">',AsImg($_SESSION[QT]['skin_dir'].'/ico_section_search.gif','search',$L['Search'],'ico ico_s'),'</td>
<td class="td_t">
<input type="text" name="title" size="40" maxlength="64"',( isset($_GET['title']) ? ' value="'.$_GET['title'].'"':''),' alt="',$L['Keywords'],'" onKeyUp="handle_keypress(event,\'okkey\')"/>&nbsp;<input type="checkbox" id="to" name="to"',(isset($_GET['to']) ? QCHE : ''),' value="1"/><label for="to">',$L['In_title_only'],'</label><br/><br/>
<select name="s" size="1"><option value="-1"',($_GET['s']=='-1' ? QSEL : ''),'>',$L['In_all_sections'],'</option>',N;
if (isset($_SESSION['qtiGoto'])) {
if (count($_SESSION['qtiGoto'])>0) {
  echo QTastags($_SESSION['qtiGoto'],$L['Section'].': %s',$_GET['s']);
}}
echo '</select>&nbsp;
<select name="al" size="1">
<option value="0"',($_GET['al']=='0' ? QSEL : ''),'>',$L['At_least_0'],'</option>
<option value="1"',($_GET['al']=='1' ? QSEL : ''),'>',$L['At_least_1'],'</option>
<option value="2"',($_GET['al']=='2' ? QSEL : ''),'>',$L['At_least_2'],'</option>
<option value="3"',($_GET['al']=='3' ? QSEL : ''),'>',$L['At_least_3'],'</option>
</select>
</td>
<td class="td_t" style="padding:7px; text-align:right"><input type="submit" id="okkey" name="ok" value="',$L['Search'],'"/></td>
</tr>
<tr class="tr_t">
<td class="tf_t tf_t_first"></td>
<td class="tf_t"></td>
<td class="tf_t tf_t_last"></td>
</tr>
</table>
</form>
';

// SEARCH BY STATUS

if ( !isset($_GET['st']) ) $_GET['st']='';
if ( !isset($_GET['s']) ) $_GET['s']='-1';

echo '
<h2>',$L['Search_by_status'],'</h2>
<form method="get" action="qti_search_st.php">',N,'
<table class="ta ta_s" cellspacing="0">
<tr class="tr_t">
<th class="th_t th_t_first th_t_empty"></th>
<th class="th_t th_t_empty"></th>
<th class="th_t th_t_last th_t_empty"></th>
</tr>
<tr class="tr_t">
<td class="td_t" style="text-align:center; width:50px">',AsImg($_SESSION[QT]['skin_dir'].'/ico_section_search.gif','search',$L['Search'],'ico ico_s'),'</td>
<td class="td_t">',$L['Status'],' <select name="st" size="1">',QTastags($_SESSION['qtiTstatus'],null,$_GET['st']),'</select>&nbsp;
<select name="s" size="1"><option value="-1"',($_GET['s']=='-1' ? QSEL : ''),'>',$L['In_all_sections'],'</option>';
if (isset($_SESSION['qtiGoto'])) {
if (count($_SESSION['qtiGoto'])>0) {
  echo QTastags($_SESSION['qtiGoto'],$L['Section'].': %s',$_GET['s']);
}}
echo '</select></td>
<td class="td_t" style="padding:7px; text-align:right"><input type="submit" id="okstatus" name="ok" value="',$L['Search'],'"/></td>
</tr>
<tr class="tr_t">
<td class="tf_t tf_t_first"></td>
<td class="tf_t"></td>
<td class="tf_t tf_t_last"></td>
</tr>
</table>
</form>
';

// SEARCH BY DATE

if ( !isset($_GET['ti']) ) $_GET['ti']='w';
if ( !isset($_GET['s']) ) $_GET['s']='-1';

echo '
<h2>',$L['Search_by_date'],'</h2>
<form method="get" action="qti_search_ti.php">',N,'
<table class="ta ta_s" cellspacing="0">
<tr class="tr_t">
<th class="th_t th_t_first th_t_empty"></th>
<th class="th_t th_t_empty"></th>
<th class="th_t th_t_last th_t_empty"></th>
</tr>
<tr class="tr_t">
<td class="td_t" style="text-align:center; width:50px">',AsImg($_SESSION[QT]['skin_dir'].'/ico_section_search.gif','search',$L['Search'],'ico ico_s'),'</td>
<td class="td_t"><select name="ti" size="1">
<option value="w"',($_GET['ti']=='w' ? QSEL : ''),'>',$L['This_week'],'</option>
<option value="m"',($_GET['ti']=='m' ? QSEL : ''),'>',$L['This_month'],'</option>
<option value="y"',($_GET['ti']=='y' ? QSEL : ''),'>',$L['This_year'],'</option>
<option value="-" disabled="disabled">-----------</option>
',QTastags($L['dateMMM'],null,$_GET['ti']),'
</select>&nbsp;
<select name="s" size="1"><option value="-1"',($_GET['s']=='-1' ? QSEL : ''),'>',$L['In_all_sections'],'</option>';
if (isset($_SESSION['qtiGoto'])) {
if (count($_SESSION['qtiGoto'])>0) {
  echo QTastags($_SESSION['qtiGoto'],$L['Section'].': %s',$_GET['s']);
}}
echo '</select><input type="hidden" name="y" value="',date('Y'),'"/></td>
<td class="td_t" style="padding:7px; text-align:right"><input type="submit" id="oktime" name="ok" value="',$L['Search'],'"/></td>
</tr>
<tr class="tr_t">
<td class="tf_t tf_t_first"></td>
<td class="tf_t"></td>
<td class="tf_t tf_t_last"></td>
</tr>
</table>
</form>
';

// HTML END

echo '<script type="text/javascript">
<!--
document.getElementById("title").focus();
-->
</script>';

include('qti_p_footer.php');
?>
Return current item: QuickTicket