<?php 
include("../connection.php");
include("../user.php");
$cur_date=date('Y-m-d H:i:s');
$user=$_SESSION['user'];

$id=$_REQUEST['id'];
$editass=mysqli_fetch_array(mysqli_query($con,"select  * from asset_master cm where cm.id='$id'"));	
?>
<!doctype html>
 <html class="no-js" lang=""> 
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title><?php echo TITLE;?></title>
    <meta name="description" content="Ela Admin - HTML5 Admin Template">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="apple-touch-icon" href="../images/bluebase.png">
    <link rel="shortcut icon" href="../images/bluebase.png">
    <!-- <script type="text/javascript" src="https://cdn.jsdelivr.net/html5shiv/3.7.3/html5shiv.min.js"></script> -->
	<style>
input[type=text] 
{
	text-transform:uppercase;
}
</style> 

</head>
<body>
  
		<div class="col-lg-8">
	<div class="card">
		<div class="card-header">
		<strong>Edit Asset</strong>
			<a href="asset_master.php"><button class="btn btn-primary" style="width:50px;margin-left:900px;"onclick=""><i class="fa fa-backward"></i></button></a>			

		</div>
	<div class="card-body card-block">
	<form  method="post" enctype="multipart/form-data" class="form-horizontal" action="asset_update.php">
	    <input type="hidden" id="id" name="id" value="<?php echo $editass['id'];?>">
		<div class="row form-group">
		<div class="col col-md-3"><label for="text-input" class=" form-control-label">Description</label><span style="color: red;">*</span></div>
		<div class="col-12 col-md-9"><input type="text" id="description" name="description" placeholder="Enter your Description" class="form-control" autocomplete="off" value="<?php echo $editass['description'];?>" required></div>
		</div>
		<div class="row form-group">
		<div class="col col-md-3"><label for="text-input" class=" form-control-label">Outgoing To</label></div>
		<div class="col-12 col-md-9"><input type="text" id="outgoingto" name="outgoingto" placeholder="Enter your Outgoing To" class="form-control" autocomplete="off" value="<?php echo $editass['outgoingto'];?>"></div>
		</div>
		<div class="row form-group">
			<div class="col col-md-3"><label for="text-input" class=" form-control-label">LOCATION</label></div>
			<div class="col-12 col-md-9">
				<select class="form-control select-search" name="location" id="location">
					<?php
					$location = mysqli_query($con, "SELECT * FROM location_master where status='0'");
					?><option value="">SELECT LOCATION</option><?php
									while ($location_det = mysqli_fetch_array($location)) { ?>
						<option value="<?php echo $location_det['id']; ?>" <?php if($editass['location'] == $location_det['id']){ echo "selected";}?>  ><?php echo strtoupper($location_det['location']); ?></option>
					<?php	}	?>
				</select>
			</div>
		</div>
		<div class="row form-group">
		<div class="col col-md-3"><label for="text-input" class=" form-control-label">Make</label></div>
		<div class="col-12 col-md-9"><input type="text" id="make" name="make" placeholder="Enter your make" class="form-control" autocomplete="off" value="<?php echo $editass['make'];?>"></div>
		</div>
		<div class="row form-group">
		<div class="col col-md-3"><label for="text-input" class=" form-control-label">Serial No</label></div>
		<div class="col-12 col-md-9"><input type="text" id="serialno" name="serialno" placeholder="Enter your Serial No" class="form-control" autocomplete="off" value="<?php echo $editass['serialno'];?>"></div>
		</div>
		<div class="row form-group">
		<div class="col col-md-3"><label for="email-input" class=" form-control-label">Model/Type </label></div>
		<div class="col-12 col-md-9"><input type="text" id="model" name="model" placeholder="Enter your  Email" class="form-control"autocomplete="off" value="<?php echo $editass['model'];?>"></div>
		</div>
		<div class="row form-group">
		<div class="col col-md-3"><label for="password-input" class=" form-control-label">Capacity</label></div>
		<div class="col-12 col-md-9"><input type="text" id="capacity" name="capacity" placeholder=" Enter your Capacity" class="form-control"autocomplete="off" value="<?php echo $editass['capacity'];?>">
        </div>
		</div>
		<div class="row form-group">
		<div class="col col-md-3"><label for="password-input" class=" form-control-label">Equipment Id</label></div>
		<div class="col-12 col-md-9"><input type="text" id="equipment_id" name="equipment_id" placeholder=" Enter your Equipment Id" class="form-control"autocomplete="off" value="<?php echo $editass['equipment_id'];?>">
        </div>
		</div>
		<div class="row form-group">
		<div class="col col-md-3"><label for="password-input" class=" form-control-label">Type Of Maintenanace</label></div>
		<div class="col-12 col-md-9"><input type="text" id="maintenance" name="maintenance" placeholder=" Enter your Maintenance Type" class="form-control"autocomplete="off" value="<?php echo $editass['maintenance'];?>">
        </div>
		</div>
		<div class="row form-group">
		<div class="col col-md-3"><label for="password-input" class=" form-control-label">Asset Value</label></div>
		<div class="col-12 col-md-9"><input type="text" id="asset_value" name="asset_value" placeholder=" Enter your Asset Value" class="form-control"autocomplete="off" value="<?php echo $editass['value'];?>">
        </div>
		</div>
		<div style="">
		<button type="submit" name="submit" id="submit"  class="btn btn-success" ><i class="fa fa-dot-circle-o"></i>Submit</button>
		</div>
	</form>
	</div>
	</div>
    <div class="clearfix"></div>

    <footer class="site-footer">
        
    </footer>

</div><!-- /#right-panel -->

<!-- Right Panel -->

<!-- Scripts -->

 


</body>
</html>
<?php require("../mainjavascript.js");?>
<script>
    // Initialize Select2
    $(document).ready(function() {
        $('.select-search').select2({
            placeholder: "-- SELECT --",  // Optional placeholder text
            allowClear: true                // Optional: allows clearing the selection
        });
    });
</script>