File: /home/cafsindia/refimac_cafsjobs_com/apx_sss_insert.php
<div id="contentwrapper">
<div class="main_content">
<?php
$up=$_REQUEST['up'];
$id=$_REQUEST['id'];
if($up==1)
{
$sql="select * from serviceapp_apx where apx_modelid=".$id." and status='1'";
//echo $sql; die;
$qu=mysql_query($sql);
$r=mysql_fetch_array($qu);
$apx_modelid=$r['apx_modelid'];
$apx_model=$r['apx_model'];
$sss_model=$r['sss_model'];
}
?>
<div class="page-head">
<div class="container">
<!-- BEGIN PAGE TITLE -->
<div class="page-title">
<h1>Apx/SSS model Master <small>Manage your Model.</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="form2" action="<?php if($up==1)echo "ad"; else echo "ad";?>d_details.php?mid=<?php echo $mid;?>&smid=<?php echo $smid;?>&pid=<?php echo $pid;?>" method="post">
<div class="portlet light">
<div class="row">
<div class="col-md-12">
<div class="col-md-3">
<label>Apx Model <span class="f_req">*</span></label>
<input name="apx_model" type="text" class="form-control" id="apx_model" value="<?php echo $apx_model;?>" />
<input type="hidden" id="apx_modelid" name="apx_modelid" value=<?php echo $apx_modelid?>>
<span class="help-block">Please enter model </span>
</div>
<div class="col-md-3">
<label>SSS model <span class="f_req">*</span></label>
<input name="sss_model" type="text" class="form-control" id="sss_model" value="<?php echo $sss_model;?>" />
<span class="help-block">Please enter model </span>
</div>
</div>
</div>
<?php if($r['EMP_CODE']!=""){ ?>
<div class="row">
<div class="col-md-12">
<div class="col-md-3">
<label>Employee Code<span class="f_req">*</span></label>
<input name="apx_modelid" type="hidden" class="form-control" id="apx_modelid" value="<?php echo $apx_modelid;?>" />
</div>
</div>
</div>
<?php } ?>
<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 Employee </h3>
<table class="table table-striped table-bordered table-hover dt-responsive" id="sample">
<thead>
<tr>
<th>S.No.</th>
<th>Apx Model</th>
<th>SSS Model </th>
<th>Update</th>
<th>Delete</th>
</tr>
</thead>
<tbody>
<?php
$sql1="select * from serviceapp_apx where status='1'";
$qu1=mysql_query($sql1);
$i=1;
while($rd=mysql_fetch_array($qu1))
{
?>
<tr>
<td><?php echo $i;?></td>
<td><?php echo $rd['apx_model'];?></td>
<td><?php echo $rd['sss_model'];?></td>
<td class="center"><a href="landing.php?mid=<?php echo $mid;?>&smid=<?php echo $smid;?>&pid=<?php echo $pid;?>&id=<?php echo $rd['apx_modelid'];?>&up=1" class="sepV_a" title="Edit"><i class="icon-pencil"></i></a></td>
<td class="center"><a href="del_detail.php?mid=<?php echo $mid;?>&smid=<?php echo $smid;?>&pid=<?php echo $pid;?>&id=<?php echo $rd['apx_modelid'];?>" onclick="return confirm('Are you sure you wish to delete this record ?')" title="Delete"><i class="icon-trash"></i></a></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='form2']").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>