| 
									
										
										
										
											2009-09-07 11:07:59 +00:00
										 |  |  | <?php | 
					
						
							| 
									
										
										
										
											2008-11-05 13:11:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-13 20:10:26 +02:00
										 |  |  | $pagetitle[] = 'Inventory'; | 
					
						
							| 
									
										
										
										
											2011-10-18 14:41:19 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-04-02 18:05:24 +01:00
										 |  |  | ?>
 | 
					
						
							| 
									
										
										
										
											2009-01-06 15:04:49 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-04-02 18:05:24 +01:00
										 |  |  | <div class="panel panel-default panel-condensed"> | 
					
						
							|  |  |  |     <div class="panel-heading"> | 
					
						
							|  |  |  |         <strong>Inventory</strong> | 
					
						
							|  |  |  |     </div> | 
					
						
							|  |  |  |     <table id="inventory" class="table table-hover table-condensed table-striped"> | 
					
						
							|  |  |  |         <thead> | 
					
						
							|  |  |  |             <tr> | 
					
						
							|  |  |  |                 <th data-column-id="hostname" data-order="asc">Hostname</th> | 
					
						
							|  |  |  |                 <th data-column-id="description">Description</th> | 
					
						
							|  |  |  |                 <th data-column-id="name">Name</th> | 
					
						
							|  |  |  |                 <th data-column-id="model">Part No</th> | 
					
						
							|  |  |  |                 <th data-column-id="serial">Serial No</th> | 
					
						
							|  |  |  |             </tr> | 
					
						
							|  |  |  |         </thead> | 
					
						
							|  |  |  |     </table> | 
					
						
							|  |  |  | </div> | 
					
						
							| 
									
										
										
										
											2008-11-05 13:11:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-04-02 18:05:24 +01:00
										 |  |  | <script> | 
					
						
							| 
									
										
										
										
											2008-11-05 13:11:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-04-02 18:05:24 +01:00
										 |  |  | var grid = $("#inventory").bootgrid({ | 
					
						
							|  |  |  |     ajax: true, | 
					
						
							| 
									
										
										
										
											2017-06-09 04:10:30 +01:00
										 |  |  |     rowCount: [50, 100, 250, -1], | 
					
						
							| 
									
										
										
										
											2015-04-02 19:28:39 +01:00
										 |  |  |     templates: { | 
					
						
							|  |  |  |         header: "<div id=\"{{ctx.id}}\" class=\"{{css.header}}\"><div class=\"row\">"+ | 
					
						
							|  |  |  |                 "<div class=\"col-sm-9 actionBar\"><span class=\"pull-left\"><form method=\"post\" action=\"\" class=\"form-inline\" role=\"form\">"+ | 
					
						
							| 
									
										
										
										
											2019-07-17 07:20:26 -05:00
										 |  |  |                 "<?php echo addslashes(csrf_field()) ?>"+ | 
					
						
							| 
									
										
										
										
											2015-04-02 19:28:39 +01:00
										 |  |  |                 "<div class=\"form-group\">"+ | 
					
						
							| 
									
										
										
										
											2016-02-17 13:59:58 +00:00
										 |  |  |                 "<input type=\"text\" name=\"string\" id=\"string\" value=\"<?php echo $_POST['string']; ?>\" placeholder=\"Description\" class=\"form-control input-sm\" />"+ | 
					
						
							| 
									
										
										
										
											2015-04-02 19:28:39 +01:00
										 |  |  |                 "</div>"+ | 
					
						
							|  |  |  |                 "<div class=\"form-group\">"+ | 
					
						
							|  |  |  |                 "<strong> Part No </strong>"+ | 
					
						
							|  |  |  |                 "<select name=\"part\" id=\"part\" class=\"form-control input-sm\">"+ | 
					
						
							|  |  |  |                 "<option value=\"\">All Parts</option>"+ | 
					
						
							|  |  |  | <?php | 
					
						
							| 
									
										
										
										
											2015-07-13 20:10:26 +02:00
										 |  |  | foreach (dbFetchRows('SELECT `entPhysicalModelName` FROM `entPhysical` GROUP BY `entPhysicalModelName` ORDER BY `entPhysicalModelName`') as $data) { | 
					
						
							|  |  |  |     echo '"<option value=\"'.$data['entPhysicalModelName'].'\""+'; | 
					
						
							| 
									
										
										
										
											2015-04-02 19:28:39 +01:00
										 |  |  |     if ($data['entPhysicalModelName'] == $_POST['part']) { | 
					
						
							| 
									
										
										
										
											2015-07-13 20:10:26 +02:00
										 |  |  |         echo '" selected"+'; | 
					
						
							| 
									
										
										
										
											2015-04-02 19:28:39 +01:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2015-07-13 20:10:26 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     echo '">'.$data['entPhysicalModelName'].'</option>"+'; | 
					
						
							| 
									
										
										
										
											2015-04-02 19:28:39 +01:00
										 |  |  | } | 
					
						
							|  |  |  | ?>
 | 
					
						
							|  |  |  |                  "</select>"+ | 
					
						
							|  |  |  |                  "</div>"+ | 
					
						
							|  |  |  |                  "<div class=\"form-group\">"+ | 
					
						
							| 
									
										
										
										
											2016-02-17 13:59:58 +00:00
										 |  |  |                  "<input type=\"text\" name=\"serial\" id=\"serial\" value=\"<?php echo $_POST['serial']; ?>\" placeholder=\"Serial\" class=\"form-control input-sm\"/>"+ | 
					
						
							| 
									
										
										
										
											2015-04-02 19:28:39 +01:00
										 |  |  |                  "</div>"+ | 
					
						
							|  |  |  |                  "<div class=\"form-group\">"+ | 
					
						
							|  |  |  |                  "<strong> Device </strong>"+ | 
					
						
							|  |  |  |                  "<select name=\"device\" id=\"device\" class=\"form-control input-sm\">"+ | 
					
						
							|  |  |  |                  "<option value=\"\">All Devices</option>"+ | 
					
						
							|  |  |  | <?php | 
					
						
							| 
									
										
										
										
											2015-07-13 20:10:26 +02:00
										 |  |  | foreach (dbFetchRows('SELECT * FROM `devices` ORDER BY `hostname`') as $data) { | 
					
						
							| 
									
										
										
										
											2015-04-22 20:55:43 +01:00
										 |  |  |     if (device_permitted($data['device_id'])) { | 
					
						
							| 
									
										
										
										
											2015-07-13 20:10:26 +02:00
										 |  |  |         echo '"<option value=\"'.$data['device_id'].'\""+'; | 
					
						
							| 
									
										
										
										
											2015-04-22 20:55:43 +01:00
										 |  |  |         if ($data['device_id'] == $_POST['device']) { | 
					
						
							| 
									
										
										
										
											2015-07-13 20:10:26 +02:00
										 |  |  |             echo '" selected"+'; | 
					
						
							| 
									
										
										
										
											2015-04-22 20:55:43 +01:00
										 |  |  |         } | 
					
						
							| 
									
										
										
										
											2015-07-13 20:10:26 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-05-05 12:25:58 +01:00
										 |  |  |         echo '">'.format_hostname($data, $data['hostname']).'</option>"+'; | 
					
						
							| 
									
										
										
										
											2015-04-02 19:28:39 +01:00
										 |  |  |     } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | ?>
 | 
					
						
							|  |  |  |                  "</select>"+ | 
					
						
							|  |  |  |                  "</div>"+ | 
					
						
							|  |  |  |                  "<div class=\"form-group\">"+ | 
					
						
							| 
									
										
										
										
											2015-07-19 23:10:45 +01:00
										 |  |  |                  "<input type=\"text\" size=24 name=\"device_string\" id=\"device_string\" value=\""+ | 
					
						
							| 
									
										
										
										
											2015-07-13 20:10:26 +02:00
										 |  |  |                     <?php | 
					
						
							|  |  |  |                     if ($_POST['device_string']) { | 
					
						
							| 
									
										
										
										
											2016-02-17 13:59:58 +00:00
										 |  |  |                         echo $_POST['device_string']; | 
					
						
							| 
									
										
										
										
											2015-07-13 20:10:26 +02:00
										 |  |  |                     }; | 
					
						
							| 
									
										
										
										
											2020-04-03 08:41:24 -05:00
										 |  |  |                     ?>
 | 
					
						
							| 
									
										
										
										
											2015-07-19 23:10:45 +01:00
										 |  |  |                  "\" placeholder=\"Description\" class=\"form-control input-sm\"/>"+ | 
					
						
							| 
									
										
										
										
											2015-04-02 19:28:39 +01:00
										 |  |  |                  "</div>"+ | 
					
						
							|  |  |  |                  "<button type=\"submit\" class=\"btn btn-default input-sm\">Search</button>"+ | 
					
						
							|  |  |  |                  "</form></span></div>"+ | 
					
						
							|  |  |  |                  "<div class=\"col-sm-3 actionBar\"><p class=\"{{css.actions}}\"></p></div></div></div>" | 
					
						
							|  |  |  |     }, | 
					
						
							| 
									
										
										
										
											2015-04-02 18:05:24 +01:00
										 |  |  |     post: function () | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         return { | 
					
						
							|  |  |  |             id: "inventory", | 
					
						
							| 
									
										
										
										
											2016-02-17 13:59:58 +00:00
										 |  |  |             device: '<?php echo htmlspecialchars($_POST['device']); ?>', | 
					
						
							|  |  |  |             string: '<?php echo mres($_POST['string']); ?>', | 
					
						
							|  |  |  |             device_string: '<?php echo mres($_POST['device_string']); ?>', | 
					
						
							|  |  |  |             part: '<?php echo mres($_POST['part']); ?>', | 
					
						
							|  |  |  |             serial: '<?php echo mres($_POST['serial']); ?>' | 
					
						
							| 
									
										
										
										
											2015-04-02 18:05:24 +01:00
										 |  |  |         }; | 
					
						
							|  |  |  |     }, | 
					
						
							| 
									
										
										
										
											2015-08-11 14:54:05 -07:00
										 |  |  |     url: "ajax_table.php" | 
					
						
							| 
									
										
										
										
											2015-04-02 18:05:24 +01:00
										 |  |  | }); | 
					
						
							| 
									
										
										
										
											2008-11-05 13:11:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-04-02 18:05:24 +01:00
										 |  |  | </script> |