Advertisement
| Hall of Fame |
|
[x]
Posted via EE Mobile
|
||
Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
||
| Question |
|
[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: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: 147: 148: 149: 150: 151: 152: 153: 154: 155: 156: 157: 158: 159: 160: 161: 162: 163: 164: 165: 166: 167: 168: 169: 170: 171: 172: 173: 174: 175: 176: 177: 178: 179: 180: 181: 182: 183: 184: 185: 186: 187: 188: 189: 190: 191: 192: 193: 194: 195: 196: 197: 198: 199: 200: 201: 202: 203: 204: 205: 206: 207: 208: 209: 210: 211: 212: 213: 214: 215: 216: 217: 218: 219: 220: 221: 222: 223: 224: 225: 226: 227: 228: 229: 230: 231: 232: 233: 234: 235: 236: 237: 238: 239: 240: 241: 242: 243: |
<?php
// make sure the user is authenticated
@session_start();
if ((isset($_SESSION['user'])) && (isset($_SESSION['pass'])))
{
require_once('connect_info.php');
$result = @mysql_query("
SELECT username, userpassword
FROM users
WHERE username='".mysql_real_escape_string($_SESSION['user'])."'
AND userpassword='".mysql_real_escape_string($_SESSION['pass'])."'
AND userlevel=1");
// if a record was not found, which means the user is not authenticated
if (@mysql_num_rows($result) == 0)
{
header("location: ../index.php");
}
}
else // else, the user is not authenticated
{
header("location: ../index.php");
}
// default vars
$m_a = '';
$d = '';
$a_v_d = '';
$a = '';
$nc = '';
$cr = '';
$m_as = '';
$message = '';
if (isset($_POST['submit']))
{
$m_a = $_POST['m_a'];
$d = $_POST['d'];
$a_v_d = $_POST['a_v_d'];
$a = $_POST['areatext'];
$nc = $_POST['nc'];
$cr = $_POST['cr'];
$adminuser = $_SESSION['user'];
$caseno = $_POST['caseno'];
$FinalDate = $_POST['FinalDate'];
$message = "";
if (empty($m_a)) { $message .= '<font color=red>*Error 1<br></font>'; }
if (empty($d)) { $message .= '<font color=red>*Error 2<br></font>'; }
if (empty($a_v_d)) { $message .= '<font color=red>*Error 3<br></font>'; }
if (empty($a)) { $message .= '<font color=red>*Error 4<br></font>'; }
if (empty($nc)) { $message .= '<font color=red>*Error 5<br></font>'; }
if (empty($cr)) { $message .= '<font color=red>*Error 6<br></font><br>'; }
if(empty($message)) {
session_start();
$_SESSION['setd'] = $d;
$result = @mysql_query("
INSERT INTO compform
(
d,
a_v_d,
mas,
nc,
cr,
user,
area,
caseno,
FinalDate
)
VALUES
(
'".mysql_real_escape_string($d)."',
'".mysql_real_escape_string($a_v_d)."',
'".mysql_real_escape_string($m_a)."',
'".mysql_real_escape_string($nc)."',
'".mysql_real_escape_string($cr)."',
'".mysql_real_escape_string($adminuser)."',
'".mysql_real_escape_string($a)."',
'".mysql_real_escape_string($caseno)."',
'".mysql_real_escape_string($FinalDate)."'
)") or die(mysql_error());
$id = mysql_insert_id();
}
if ($result && empty($message)) // if the query was successfull
{
$message .= "Successfully inserted new record<br> <a href=\"../../../../form2.php?idre=$id\" target=\"_blank\"></a>";
$m_a = '';
$d = '';
$a_v_d = '';
$nc = '';
$cr = '';
$m_as = '';
}
else // else if the query was not successfull
{
$message .= '*Error New<br>';
}
@session_start();
$_SESSION["msg"] = $message;
header("Location: " . $_SERVER['PHP_SELF']);
exit();
}
else {
@session_start();
if(isset($_SESSION["msg"]))
{
$message = $_SESSION['msg'];
$_SESSION['msg'] = ''; // reset the message after using it
}
else
{
$message="";
}
}
// create a drop down box code in an appendable php variable
$m_as = '<select name="m_a">';
$m_as .= '<option value="">-Select-</option>';
// query the database and return a list of options for the select box
$result = @mysql_query("SELECT mid, mas FROM m_as_c");
// check to see if a result was returned - this is good error prevention
if (@mysql_num_rows($result) > 0)
{
// now, loop through the result set and build the html options tags
while($nt = mysql_fetch_array($result))
{
if ($monitoring_area == $nt['mid'])
{
$m_as .= '<option value="'.$nt['mas'].'" selected>"'.$nt['mas'].'"</option>';
}
else
{
$m_as .= '<option value="'.$nt['mas'].'">"'.$nt['mas'].'"</option>';
}
}
}
else // else if the above query fails, then display it as an option
{
$m_as .= '<option value="">No Options Available</option>';
}
?>
<html>
<head>
<script language="javascript" type="text/javascript" src="datetimepicker.js"></script>
<style type="text/css">
<!--
.style1 {color: #FFFFFF}
-->
</style>
</head>
<body>
<style type="text/css">
<!--
.txtBlack14 {
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
}
-->
</style>
<form name="form1" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<table width="654" border="0">
<tr>
<td width="233" class="txtBlack14">User: <b><?php echo $_SESSION['user']; ?></b><br><br></td>
<td width="1" class="txtBlack14"> </td>
<td class="txtBlack14"> </td>
</tr>
<tr>
<td colspan="3" class="txtBlack14"><center><?php echo $message; ?> </td>
</tr>
<tr>
<td colspan="2">D:</td>
<td><select name="d" id="d">
<option>2001</option>
<option>2002</option>
</select></td>
</tr>
<tr>
<td colspan="2">CNo:</td>
<td><input name="cno" type="text" id="cno" size="32" value="<?php echo strval($_REQUEST['cno']); ?>"></td>
</tr>
<tr>
<td colspan="2"></td>
<td><?php echo $m_as; ?> </td>
</tr>
<tr>
<td colspan="2"> </td>
<td rowspan="3"><textarea name="nc" id="nc" cols="55" rows="4"><?php echo $nc; ?></textarea></td>
</tr>
<tr>
<td colspan="2"></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2"> </td>
<td rowspan="3"><textarea name="cr" id="cr" cols="55" rows="4"><?php echo $cr; ?></textarea></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2"></td>
<td width="406"><input name="areatext" type="text" id="atext" size="32"></td>
</tr>
</tr>
<tr>
<td colspan="2"> </td>
<td><input type="submit" name="submit" id="submit1" value="Submit"/></td>
</tr>
</table>
</form>
</body>
</html>
|