-
Notifications
You must be signed in to change notification settings - Fork 0
/
createequipment.php
158 lines (141 loc) · 7.11 KB
/
createequipment.php
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
<?php
session_start();
include_once 'utils.php';
$db_conn = real_db_connect($_db_server, $_db_username, $_db_password, $_db_name);
real_check_valid_session($db_conn, $_SESSION['UID'], session_id(), $_SERVER['REMOTE_ADDR']);
$_POST['page-title'] = "Create New Equipment Profile";
$_POST['page-link1'] = "<link rel='stylesheet' type='text/css' href='styles/index.css' />";
$_POST['page-link2'] = "<link href='styles/style1.css' rel='stylesheet' type='text/css' />";
$_POST['page-link3'] = "<link href='styles/list.css' rel='stylesheet' type='text/css' />";
$_POST['page-script1'] = "<script language='JavaScript' type='text/javascript' src='scripts/findprofile.js'></script>";
$_POST['page-script2'] = "<script language='JavaScript' type='text/javascript' src='scripts/section_and_menu.js'></script>";
$_POST['page-include-page-top2'] = "true";
include_once 'includes/page-top.php';
include_once 'includes/page-top2.php';
?>
<script type="text/javascript">
<!--
var timer;
startList = function()
{
if (document.all&&document.getElementById)
{
navRoot = document.getElementById("nav");
for (i=0; i<navRoot.childNodes.length; i++)
{
node = navRoot.childNodes[i];
if (node.nodeName=="LI")
{
node.onmouseover=function()
{
this.className+=" over";
}
node.onmouseout=function()
{
this.className=this.className.replace(" over", "");
}
}
}
}
}
window.onload=function()
{
startList();
}
//-->
</script>
<table width="100%" border="0">
<tr><td colspan="2"> </td></tr>
<tr><!-- Main Content -->
<td colspan="2">
<!-- InstanceBeginEditable name="content" -->
<script type="text/javascript" language="javascript">
//validation function for the form fields
function validatefields()
{
if( document.frmNewProfile.eqp_general_info_login_id != null )
{
if ( document.frmNewProfile.eqp_general_info_login_id.value == "" )
{
//changed...........................................
document.frmNewProfile.eqp_general_info_login_id.value =
document.frmNewProfile.eqp_general_info_login_name.value;
/*alert( "Please find the person from the user directory." );
document.frmNewProfile.eqp_general_info_login_id.focus();
return false;*/
}
}
if ( document.frmNewProfile.eqp_general_info_name.value == "" )
{
alert( "Please enter name for the Equipment Profile." );
document.frmNewProfile.eqp_general_info_name.focus();
return false;
}
return true;
}
</script>
<form action="createnew.php" method="post" name="frmNewProfile" enctype='multipart/form-data' onSubmit='return validatefields()'>
<?php
print( "<input name='profiletype' type='hidden' value='equipment' />");
$readonly = "readonly=true";
print( "<table width='100%' cellspacing='1' cellpadding='1'>");
if (real_check_user_groupid($db_conn, "admin") == true) {
print( "<input class='form_elements_text' type='hidden' id='eqp_general_info_login_id' name='eqp_general_info_login_id' />");
print( "<tr>");
//print( "<td> <span class='form_elements_text'><B>Owner Name *</B></span></td>");
print( "<td> <span class='form_elements_text'><B>Owner Login ID *</B></span></td>");
print( "<td> <input class='form_elements_edit' type='text' id='eqp_general_info_login_name' name='eqp_general_info_login_name' size='30' maxlength='255' value=''> ");
print( " <!--script language=\"JavaScript\" type=\"text/javascript\">");
print( "createFindProfileRow('new_equipment_find', 'ppl', 'new_equipment_enter_info', 0, 1, 'dir' );");
print( "</script-->");
print( "</td>");
print( "</tr>");
}else {
print( "<input class='form_elements_text' type='hidden' value='" . $_SESSION['UID'] . "' id='eqp_general_info_login_id' name='eqp_general_info_login_id' />");
}
print( "<tr>");
print( "<td> <span class='form_elements_text'><B>Equipment Name</B></span></td>");
print( "<td> <input class='form_elements_text' type='text' " .
"name='eqp_general_info_name' size='100' maxlength='255'> </td>");
print( "</tr>");
print( "<tr>");
print( "<td> <span class='form_elements_text'><B>Equipment Description</B></span></td>");
print( "<td> <textarea name='eqp_general_info_description' cols='100' rows='10' class='form_elements_text'>" . "</textarea>" .
"</td>");
print( "</tr>");
print( "<tr><td colspan='2'><hr></td></tr>");
print( "<tr><td colspan='2'>
<input name='Submit' type='submit' class='form_elements' value='Create' style='margin-left:200px'/>
<input name='cancel' type='button' class='form_elements' value='Cancel' onclick='location.href=\"researchspace.php?#createnew\"'/>
</td></tr>");
?>
</form>
<script type='text/javascript'>
function new_equipment_enter_info( boxname, results )
{
if( results.length > 0 )
{
document.getElementById( 'eqp_general_info_login_name' ).value = results[0][0];
document.getElementById( 'eqp_general_info_login_id' ).value = results[0][3];
}
cancelFindProfile( boxname );
}
</script>
<!-- InstanceEndEditable -->
</td>
</tr>
<tr><td colspan="2"> </td></tr>
<tr><td colspan="2"> </td></tr>
<tr><td colspan="2"> </td></tr>
<tr><!-- Page footer -->
<td colspan="2" align="center">
<p align="center"><img src="images/line.jpg" alt="" width="700" height="1"/></p>
<p>
<a href="http://www.uta.edu/collaborate" target="_blank" class="rsp">powering - The Partnership</a><br />
© 2010 <a href="http://www.txstate.edu/" target="www.txstate.edu">Texas State University-San Marcos</a> | Questions or Comments about this site? | Email: <a href="feedback.php">webmaster</a> <br /><br />
</p>
</td>
</tr>
</table>
</body>
</html>