Advertisement
Advertisement
| 07.12.2008 at 05:15AM PDT, ID: 23559512 |
|
[x]
Attachment Details
|
||
|
[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! |
||
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: 125: 126: 127: 128: 129: 130: 131: |
<?php
session_start();
?>
<html>
<body>
<?php include "Menu.php"; ?>
<!--<form action="action.php" method="post">-->
<?php
define("DB_HOST","server");
define("DB_USER","usename");
define("DB_PASS","password");
define("DB_NAME","database");
$db_connection = mssql_connect(DB_HOST, DB_USER, DB_PASS) or die ("Could not connect to MSSQL host:<br>".mssql_get_last_message());
$result = mssql_select_db(DB_NAME, $db_connection);
if(!$result) exit("Could not select MSSQL DB:<br>".mssql_get_last_message());
$cost_code = $_POST['branch'];
$query = "SELECT BranchID FROM Branch WHERE branchcostcode= '$cost_code'";
$result = mssql_query($query, $db_connection);
if(!$result) exit("Could not execute query:<br>$query");
if(mssql_num_rows($result) == 0) exit("Cost code not found:<br>$query<br>Cost code var:$cost_code");
$_SESSION['cost_code'] = $_POST['branch'];
$row = mssql_fetch_assoc($result);
$get_assets = "SELECT AssetID FROM Asset_Branch_Link WHERE BranchID = ".$row['BranchID']."";
$get_assets_result = mssql_query($get_assets, $db_connection);
if(!$get_assets_result) exit("Could not execute query:<br>$get_assets<br>".mssql_get_last_message());
if(mssql_num_rows($get_assets_result) == 0) exit("No assets found for branch");
echo "<table border=\"2\" cellspacing=\"1\">";
echo "<tr>";
echo "<th>Select</th>";
echo "<th>DeviceType</th>";
echo "<th>DeviceMake</th>";
echo "<th>DeviceModel</th>";
echo "<th>Serial</th>";
echo "<th>Cost Code</th>";
echo "<th>Domain User</th>";
echo "<th>Date Modified</th>";
echo "<th>Date Created</th>";
echo "<th>Status</th>";
echo "<th>Change Order</th>";
//echo "<th>Change Order</th>";
//echo "<th>Select and Update</th>";
//echo "<th>Move Asset</th>";
echo "</tr>";
while($row = mssql_fetch_assoc($get_assets_result))
{
$asset_details = " select
c.TypeName,
d.MakeName,
e.ModelName,
a.AssetSerial,
DomainUser,
convert(varchar,a.Datemodified,111) As DateModified,
convert(varchar,a.DateCreated,111) As DateCreated,
b.Statusname,
a.AssetID,
g.branchcostcode,
g.changeorder
from
dbo.Asset a left join dbo.Status b
ON a.statusid = b.statusid
left join dbo.AssetType c
ON c.typeid = a.typeid
left join dbo.AssetMake d
on d.makeid = a.makeid
left join dbo.MakeModel e
on e.modelid = a.modelid
left join Asset_branch_link f
on f.assetid = a.assetid
left join branch g
on g.branchid = f.branchid
WHERE a.AssetID = '".$row['AssetID']."'";
$asset_details_result = mssql_query($asset_details, $db_connection);
if(!$asset_details_result) exit("Could not execute query:<br>$asset_details<br>".mssql_get_last_message());
if(mssql_num_rows($asset_details_result) == 0) exit("Could not find asset ".$row['Asset_id']." in Assets table:<br>$asset_details<br>".mssql_get_last_message());
$row = mssql_fetch_assoc($asset_details_result);
echo "<tr>";
echo "<td><input name='changeCheck' type='radio' value='".$row['AssetID']."'/></td>";
echo "<td>".$row['TypeName']."</td>";
echo "<td>".$row['MakeName']."</td>";
echo "<td>".$row['ModelName']."</td>";
echo "<td>".$row['AssetSerial']."</td>";
echo "<td>".$row['branchcostcode']."</td>";
echo "<td>".$row['DomainUser']."</td>";
echo "<td>".$row['DateModified']."</td>";
echo "<td>".$row['DateCreated']."</td>";
echo "<td>".$row['Statusname']."</td>";
echo "<td>".$row['changeorder']."</td>";
//echo "<td>".$row['Incident']."</td>";
//echo "<td>".$row['changeorder']."</td>";
//echo "<td><a href='action.php?id=".$row['AssetID']."'>Action Asset</a></td>";
//echo "<td><a href='asset_move.php?id=".$row['AssetID']."'>MOVE ASSET</a></td>";
echo "</tr>";
} // end while
echo "</table>";
echo "<br>";
?>
<!--<input type="submit" value="Action">
</form>-->
<?php
if(isset($_POST["submit_action"])){
switch ($_POST["submit_action"]) {
case "Register a Transfer": header("Location: asset_move.php"); break;
case "Place into storage": header("Location: place_into_storage.php"); break;
case "Register as Broken": header("Location: register_as_broken.php"); break;
case "Decommission": header("Location: decommission.php"); break;
}
}
?>
<form action="#" method="post">
<input type="submit" value="Register a Transfer" name="submit_action" />
<input type="submit" value="Place into storage" name="submit_action"/>
<input type="submit" value="Register as Broken" name="submit_action"/>
<input type="submit" value="Decommission" name="submit_action"/>
</form>
</body>
</html>
|