<?php

	$cid=$_GET['cid'];

	$result = mysqli_query($conn, "SELECT * FROM clean WHERE c_id=$cid") or die (mysql_error());

	$row = mysqli_fetch_array($result);

?>



<div class="right_col" role="main">

    <div class="">

        <div class="row">

            <div class="col-md-12 col-sm-12 col-xs-12">

                <div class="x_panel">

					<div class="x_title">

						<h2>Cleaning</h2>

						<div class="clearfix"></div>

					</div>

					<div class="x_content">



						<form class="form-horizontal form-label-left" method="post">

							<div class="item form-group">

								<label class="control-label col-md-3 col-sm-3 col-xs-12" for="collectmoney">Collect amount : <span class="required">*</span>

								</label>

								<div class="col-md-6 col-sm-6 col-xs-12">

									<input id="collectmoney" class="form-control col-md-7 col-xs-12" name="collectmoney" type="text" 

									value="<?php echo $row['c_amount'];?>" required>

								</div>

							</div>

							<div class="item form-group">

								<label class="control-label col-md-3 col-sm-3 col-xs-12" for="note">Note

								</label>

								<div class="col-md-6 col-sm-6 col-xs-12">

									<textarea id="note" name="note" class="form-control col-md-7 col-xs-12"><?php echo $row['c_note'];?></textarea>

								</div>

							</div>

							<div class="ln_solid"></div>

							<div class="form-group">

								<div class="col-md-6 col-md-offset-3">

									<button id="send" type="submit" class="btn btn-success" name="submit">Submit</button>

									<button type="submit" class="btn btn-primary" onclick="javascript:window.location='index.php?pagecontent=cleaninglist'">Cancel</button>

								</div>

							</div>

						</form>

					</div>

                </div>

            </div>

        </div>

    </div>

</div>



<?php 

	if (isset($_POST['submit']))

	{

		$collectmoney=$_POST['collectmoney'];

		$note=$_POST['note'];

		

		mysqli_query($conn, "UPDATE clean SET c_amount='$collectmoney', c_note='$note' WHERE c_id=$cid") or die (mysql_error());

		

		header('Location: index.php?pagecontent=cleaninglist');

	}

?>



