File: /home/cafsindia/refimac_cafsjobs_com/amc_price.php
<div id="contentwrapper">
<div class="main_content">
<?php
$up=$_REQUEST['up'];
$id=$_REQUEST['id'];
if($up==1)
{
$sql="select model_no,make,product,tonage,lamount,excomp,comp,wlamount,wexamount from amc_model_list where model_list_id=".$id."";
$qu=mysql_query($sql);
$r=mysql_fetch_array($qu);
$model_no=$r['model_no'];
$make=$r['make'];
$product=$r['product'];
//echo $product; die;
$Tonage=$r['tonage'];
$lamount=$r['lamount'];
$excomp=$r['excomp'];
$comp=$r['comp'];
$wlamount=$r['wlamount'];
$wexamount=$r['wexamount'];
}
?>
<div class="page-head">
<div class="container">
<!-- BEGIN PAGE TITLE -->
<div class="page-title">
<h1>AMC Price Update <small>Update your price.</small></h1>
</div>
</div>
</div>
<div class="page-content">
<div class="container">
<div class="row-fluid">
<div class="span12">
<?php
if($nav=="1"||$nav=="3")
echo "<div class='alert alert-success'>
<span>Given information successfully updated !</span>
</div>";
elseif($nav=="2"||$nav=="4"||$nav=="6")
echo "<div class='alert alert-warning'>
<span>sorry, given information not updated, please try again !</span>
</div>";
elseif($nav=="5")
echo "<div class='alert alert-danger'>
<span>Selected Record successfully deleted !</span>
</div>";
?>
</div>
</div>
<div class="page-content-inner">
<form name="form1" action="<?php if($up==1)echo "up"; else echo "ad";?>d_details.php?mid=<?php echo $mid;?>&smid=<?php echo $smid;?>&pid=<?php echo $pid;?>&id=<?php echo $id;?>" method="post">
<div class="portlet light">
<div class="row">
<div class="col-md-12">
<div class="col-md-3">
<label>Model Name<span class="f_req">*</span></label>
<select name="model_name" class="form-control select2 uppercase" id="model_name" style="max-height:400px;" >
<option value="select">Select</option>
<?php
$sql="select MODEL_ID,MODEL_NAME from model where status=1";
$qu=mysql_query($sql);
while($r=mysql_fetch_array($qu))
{
?>
<option <?php if($model_no==$r['MODEL_NAME']) echo "selected='selected'";?> value="<?php echo $r['MODEL_NAME'];?>"><?php echo $r['MODEL_NAME'];?></option>
<?php }?>
</select>
<input name="model_list_id" type="hidden" class="form-control" id="model_list_id" value="<?php echo $MODEL_ID;?>" />
<span class="help-block">Please enter model name</span>
</div>
<div class="col-md-3">
<label>Make <span class="f_req">*</span></label>
<select name="MAKE_ID" class="form-control select2" id="MAKE_ID" >
<option value="Select">Select</option>
<?php
$sql1="select MAKE_NAME,MAKE_ID from make";
$qu1=mysql_query($sql1);
while($r1=mysql_fetch_array($qu1))
{
?>
<option <?php if($make==$r1['MAKE_NAME']) echo "Selected='Selected'";?> value="<?php echo $r1['MAKE_NAME'];?>"><?php echo $r1['MAKE_NAME'];?></option>
<?php } ?>
</select>
<span class="help-block">Please enter make name</span>
</div>
<div class="col-md-3">
<label>Product Name<span class="f_req">*</span></label>
<select name="product_name" class="form-control select2" id="product_name" >
<option value="Select">Select </option>
<?php
$sql1="select product_id,product_name from serviceapp_product where status=1";
$qu1=mysql_query($sql1);
while($r1=mysql_fetch_array($qu1))
{
?>
<option <?php if($product==$r1['product_name']) echo "Selected='Selected'";?> value="<?php echo $r1['product_name'];?>"><?php echo $r1['product_name'];?></option>
<?php } ?>
</select>
<span class="help-block">Please enter product name</span>
</div>
<div class="col-md-3">
<label>Tonage<span class="f_req">*</span></label>
<input name="tonage" type="text" class="form-control" id="tonage" value="<?php echo $Tonage;?>" />
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="col-md-3">
<label>L Amount<span class="f_req">*</span></label>
<input name="lamount" type="text" class="form-control" id="lamount" value="<?php echo $lamount;?>" />
</div>
<div class="col-md-3">
<label>ExComp Amount<span class="f_req">*</span></label>
<input name="excomp" type="text" class="form-control" id="excomp" value="<?php echo $excomp;?>" />
</div>
<div class="col-md-2">
<label>Comp<span class="f_req">*</span></label>
<input name="comp" type="text" class="form-control" id="comp" value="<?php echo $comp;?>" />
</div>
<div class="col-md-2">
<label>WL Amount<span class="f_req">*</span></label>
<input name="wlamount" type="text" class="form-control" id="wlamount" value="<?php echo $wlamount;?>" />
</div>
<div class="col-md-2">
<label>Wexc Amount<span class="f_req">*</span></label>
<input name="wexamount" type="text" class="form-control" id="wexamount" value="<?php echo $wexamount;?>" />
</div>
</div>
</div>
<div class="form-actions">
<div class="row">
<div class="col-md-offset-3 col-md-9">
<button type="submit" class="btn green">Submit</button>
<button type="button" class="btn grey-salsa btn-outline cancel">Cancel</button>
</div>
</div>
</div>
</div>
</form>
<div class="row portlet light">
<div class="col-md-12">
<h3 class="heading">View / Search / Update </h3>
<table class="table table-striped table-bordered table-hover dt-responsive" id="sample">
<thead>
<tr>
<th>S.No.</th>
<th>Action</th>
<th>Model no </th>
<th>make name </th>
<th>Product Name </th>
<th>Tonage</th>
<th>lamount </th>
<th>excomp </th>
<th>comp</th>
<th>wlamount</th>
<th>wexamount</th>
</tr>
</thead>
<tbody>
<?php
$sql1="select model_list_id,model_no,make,product,tonage,lamount,excomp,comp,wlamount,wexamount from amc_model_list where status='Y'";
//echo $sql1; die;
$qu1=mysql_query($sql1);
$i=1;
while($rd=mysql_fetch_array($qu1))
{
?>
<tr>
<td><?php echo $i;?></td>
<td><a href="landing.php?mid=<?php echo $mid;?>&smid=<?php echo $smid;?>&pid=<?php echo $pid;?>&id=<?php echo $rd['model_list_id'];?>&up=1" class="sepV_a" title="Edit"><i class="icon-pencil"></i></a>
<a href="del_detail.php?mid=<?php echo $mid;?>&smid=<?php echo $smid;?>&pid=<?php echo $pid;?>&id=<?php echo $rd['model_list_id'];?>" onclick="return confirm('Are you sure you wish to delete this record ?')" title="Delete"><i class="icon-trash"></i></a></td>
<td><?php echo $rd['model_no'];?></td>
<td><?php echo $rd['make'];?></td>
<td><?php echo $rd['product'];?></td>
<td><?php echo $rd['tonage'];?></td>
<td><?php echo $rd['lamount'];?></td>
<td><?php echo $rd['excomp'];?></td>
<td><?php echo $rd['comp'];?></td>
<td><?php echo $rd['wlamount'];?></td>
<td><?php echo $rd['wexamount'];?></td>
</tr>
<?php $i++; }?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function()
{
if ( $.fn.dataTable.isDataTable( '#sample' ) ) {
table = $('#sample').DataTable();
}
else {
table = $('#sample').DataTable( {
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print','pageLength'
], lengthMenu: [
[ 10, 25, 50, -1 ],
[ '10 rows', '25 rows', '50 rows', 'Show all' ]
]
} );
}
$('.cancel').click(function()
{
location.reload();
});
});
// Wait for the DOM to be ready
$(function() {
// Initialize form validation on the registration form.
// It has the name attribute "registration"
$("form[name='form1']").validate({
// Specify validation rules
rules: {
// The key name on the left side is the name attribute
// of an input field. Validation rules are defined
// on the right side
EMP_NAME: "required",
EMP_MOBILE: "required",
EMP_DOJ: {
required: true,
// Specify that email should be validated
// by the built-in "email" rule
//email: true
}
},
// Specify validation error messages
messages: {
EMP_NAME: "Please enter employee name",
EMP_MOBILE: "Please enter employee mobile",
page_name: "Please select doj"
},
// Make sure the form is submitted to the destination defined
// in the "action" attribute of the form when valid
submitHandler: function(form) {
form.submit();
}
});
});
</script>