Advertisement
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: |
<html>
<head>
<script type="text/javascript" src="extjs/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="extjs/ext-all-debug.js"></script>
<script type="text/javascript">
Ext.onReady(function() {
var myData =
<?php
mssql_connect("UKSQLDEV2", "sa", "") or
die("Could not connect: ");
mssql_select_db("Logininfo") or die("No such DB Exists! ");
$task = '';
if ( isset($_POST['task'])){
$task = $_POST['task']; // Get this from Ext
}
switch($task){
case "LISTING": // Give the entire list
break;
default:
break;
};
getlist();
function getList()
{
$query = "SELECT * FROM tbllogininfo";
$result = mssql_query($query);
$nbrows = mssql_num_rows($result);
If ( $nbrows > 0)
{
while($rec = mssql_fetch_array($result))
{
$arr[] = $rec;
}
$jsonresult = JEncode($arr);
echo $jsonresult;
}
else
{
echo '({"total":"0", "results":""})';
}
};
function JEncode($arr){
if (version_compare(PHP_VERSION,"5.2","<"))
{
require_once("./JSON.php"); //if php<5.2 need JSON class
$json = new Services_JSON(); //instantiate new json object
$data=$json->encode($arr); //encode the data in json format
} else
{
$data = json_encode($arr); //encode the data in json format
}
return $data;
}
?>
var myReader = new Ext.data.ArrayReader({}, [
{name: 'ID'},
{name: 'Username'},
{name: 'IP'},
{name: 'Hostname'},
{name: 'DateX'}
]);
var grid = new Ext.grid.GridPanel({
store: new Ext.data.Store({
data: myData,
reader: myReader
}),
columns: [{header: 'ID', width: 30, sortable: true, dataIndex: 'ID'},
{header: 'Username', width: 120, sortable: true, dataIndex: 'Username'},
{header: 'IP', width: 100, sortable: true, dataIndex: 'IP'},
{header: 'Hostname', width: 80, sortable: true, dataIndex: 'Hostname'},
{header: 'Date', width: 75, sortable: true, dataIndex: 'DateX'}
],
viewConfig: {
forceFit: true,
},
renderTo: 'content',
title: 'Logins',
width: 825,
frame: true
});
grid.getSelectionModel().selectFirstRow();
this.linkpage = function(grid, row, column, e)
{
var humanFieldName = grid.colModel.getColumnHeader(column);
var fieldName = grid.colModel.getDataIndex(column);
var record = grid.store.getAt(row)
var b = record.get(fieldName);
window.open('http://ukit005/Link2.php?a='+b+'');
}
grid.on(
'cellclick',
this.linkpage
// function(this._grid, row, column, e) { }
);
});
</script>
<!-- Include Ext stylesheets here: -->
<link rel="stylesheet" type="text/css" href="extjs/resources/css/ext-all.css"></link>
<link rel="stylesheet" type="text/css" href="ExtStart.css"></link>
</head>
<body>
<h1>Logininfo</h1>
<br/>
<div id='content'>
</div>
</body>
</html>
|
|
[x]
The Solution Rating System
|
||
|
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
|
Loading Advertisement... |