Пример #1
0
function search_items($dir)
{
    // search for item
    if (isset($GLOBALS['__POST']["searchitem"])) {
        $searchitem = stripslashes($GLOBALS['__POST']["searchitem"]);
        $subdir = !empty($GLOBALS['__POST']["subdir"]);
        $list = make_list($dir, $searchitem, $subdir);
    } else {
        $searchitem = NULL;
        $subdir = true;
    }
    if (!empty($searchitem)) {
        $msg = $GLOBALS["messages"]["actsearchresults"];
        $msg .= ": (/" . get_rel_item($dir, $searchitem) . ")";
    } else {
        $msg = $GLOBALS["messages"]["searchlink"];
    }
    // Search Box
    $response = '		<div>
	    <div class="x-box-tl"><div class="x-box-tr"><div class="x-box-tc"></div></div></div>
	    <div class="x-box-ml"><div class="x-box-mr"><div class="x-box-mc">
	
	        <h3 style="margin-bottom:5px;">' . $msg . '</h3>
	        <div id="adminForm">
	
	        </div>
	    </div></div></div>
	    <div class="x-box-bl"><div class="x-box-br"><div class="x-box-bc"></div></div></div>
	</div>
	<script type="text/javascript">
	var form = new Ext.form.Form({
	    labelWidth: 125, // label settings here cascade unless overridden
	    url:\'' . basename($GLOBALS['script_name']) . '\'
	});
	form.add(
	    new Ext.form.TextField({
	        fieldLabel: \'' . ext_Lang::msg('nameheader', true) . '\',
	        name: \'searchitem\',
	        width:175,
	        allowBlank:false
	    }),
		new Ext.form.Checkbox({
			fieldLabel: \'' . ext_Lang::msg('miscsubdirs', true) . '?\',
			name: \'subdir\',
			checked: true
		})
	);
	form.addButton({ text: "' . ext_Lang::msg('btnsearch', true) . '", type: "submit" }, function() {
	    form.submit({
	        waitMsg: \'' . ext_Lang::msg('search_processing', true) . '\',
	        //reset: true,
	        reset: false,
	        success: function(form, action) {
	    		dialog_panel.setContent( action.result.message, true );
	        },
	        failure: function(form, action) {Ext.MessageBox.alert(\'' . ext_Lang::err('error') . '!\', action.result.error);},
	        scope: form,
	        // add some vars to the request, similar to hidden fields
	        params: {
	        	option: \'com_extplorer\', 
	        	action: \'search\', 
	        	dir: \'' . $GLOBALS['__POST']["dir"] . '\'
	        }
	    });
	});
	form.addButton("' . ext_Lang::msg('btncancel', true) . '", function() { dialog.hide();dialog.destroy(); } );

	form.render("adminForm");
	</script>';
    // Results
    if ($searchitem != NULL) {
        $response .= "<table width=\"95%\"><tr><td colspan=\"2\"><hr></td></tr>\n";
        if (count($list) > 0) {
            // table header
            $response .= "<tr>\n<td width=\"42%\" class=\"header\"><b>" . $GLOBALS["messages"]["nameheader"];
            $response .= "</b></td>\n<td width=\"58%\" class=\"header\"><b>" . $GLOBALS["messages"]["pathheader"];
            $response .= "</b></td></tr>\n<tr><td colspan=\"2\"><hr></td></tr>\n";
            // make & print table of found items
            $response .= get_result_table($list);
            $response .= "<tr><td colspan=\"2\"><hr></td></tr>\n<tr><td class=\"header\">" . count($list) . " ";
            $response .= $GLOBALS["messages"]["miscitems"] . ".</td><td class=\"header\"></td></tr>\n";
        } else {
            $response .= "<tr><td>" . $GLOBALS["messages"]["miscnoresult"] . "</td></tr>";
        }
        $response .= "<tr><td colspan=\"2\"><hr></td></tr></table>\n";
    }
    if (empty($searchitem)) {
        echo $response;
    } else {
        while (@ob_end_clean()) {
        }
        ext_Result::sendResult('search', true, $response);
    }
}
Пример #2
0
<?php

header('Content-type: text/plain; charset=utf-8');
ini_set('session.save_path', realpath(dirname($_SERVER['DOCUMENT_ROOT']) . '/../session'));
session_start();
require_once dirname(__FILE__) . "/functions.php";
if (isset($_GET["year"])) {
    $yr = $_GET["year"];
} else {
    $yr = NULL;
}
$sk_table = get_result_table(1, $yr);
$open_table = get_result_table(0, $yr);
if ($sk_table == "" && $open_table == "") {
    echo "<p class='center' data-trans-key='results-not-available'></p>";
} else {
    echo $sk_table;
    echo $open_table;
}
?>
    <script>
        dict.translateElement(null, "#results");
    </script>
Пример #3
0
// display the output from isql
if (isset($isql_flag) || isset($plan_flag)) {
    array_shift($binary_output);
    // discard the first line
    foreach ($binary_output as $line) {
        $line = str_replace(' ', '&nbsp;', $line);
        $line = nl2br($line);
        echo $line . "<br>\n";
    }
} elseif (isset($results)) {
    ob_start();
    foreach ($results as $idx => $result) {
        if (!is_array($result) || empty($result)) {
            continue;
        }
        echo get_result_table($result, $fieldinfo[$idx], $idx);
        echo sql_export_button($idx);
    }
    $s_sql['buffer'] = ob_get_contents();
    ob_end_flush();
} elseif ($s_sql['buffer'] != '') {
    echo $s_sql['buffer'];
    echo '(' . $sql_strings['DisplBuf'] . ')';
}
echo "    </td>\n  </tr>\n";
if ($s_sql['more'] === TRUE) {
    ?>
  <tr>
    <td>
      <input type="submit" name="sql_display_all" value="<?php 
    echo $button_strings['DisplAll'];