
PK 
<?php
ob_start();
//error_reporting(E_ALL ^ E_NOTICE);
@session_start();
ini_set('allow_url_include',1);
date_default_timezone_set("Asia/Kolkata");
set_time_limit(600);
ini_set('max_execution_time',600);
include '../includes/settings/constant.php';
//include '../includes/settings/db.php';
require_once '../includes/settings/PDODB.php';
include '../includes/modules/functions.php';
$function = new FUNCTIONS();
if (!empty($_SESSION['adminId']) && !empty($_SESSION['admin_role_id'])) {
if($_SESSION['admin_role_id']==1){
//header("Location: index.php");
}elseif($_SESSION['admin_role_id']==2){
header("Location: ../dashboard/index.php");
}
}else{
header("Location: ../index.php");
exit();
}
$vehicle_id = $_GET['id']; //exit;
$vehicles = $function->getVehicleDetails(NULL,1,$vehicle_id);
if(isset($_POST['btnAddvehicle'])){
//print_r($_POST); exit;
$vehicle_no = !empty($_POST['vehicle_no'])?trim($_POST['vehicle_no']):"";
$vehicle_type = !empty($_POST['vehicle_type'])?trim($_POST['vehicle_type']):"";
$vehicle_company = !empty($_POST['vehicle_company'])?trim($_POST['vehicle_company']):"";
$vehicle_modelname = !empty($_POST['vehicle_modelname'])?trim($_POST['vehicle_modelname']):"";
$vehicle_color = !empty($_POST['vehicle_color'])?trim($_POST['vehicle_color']):"";
$house_no = !empty($_POST['house_no'])?trim($_POST['house_no']):"";
$plot_owner_name = !empty($_POST['plot_owner_name'])?trim($_POST['plot_owner_name']):"";
$plot_owner_mobile = !empty($_POST['plot_owner_mobile'])?trim($_POST['plot_owner_mobile']):"";
$error_msg = "";
$ipaddress = $function->getRealIpAddr();
$pdodb = PDODB::getInstance();
$sql = "UPDATE vehicles SET vehicle_no='".$vehicle_no."',vehicle_type='".$vehicle_type."',vehicle_company='".$vehicle_company."',vehicle_modelname='".$vehicle_modelname."',vehicle_color='".$vehicle_color."',house_no='".$house_no."',plot_owner_name='".$plot_owner_name."',plot_owner_mobile='".$plot_owner_mobile."',ipaddress='".$ipaddress."' WHERE vehicle_id='$vehicle_id'";
//print_r($sql); exit;
//echo "mdscmsdmc"; exit;
$result = $pdodb->query($sql);
//echo $result; exit;
PDODB::closeInstance();
$result = Array();
if(!empty($pdodb)){
$result = $pdodb->query($sql);
PDODB::closeInstance();
header("Location: vehicle-details.php?id=$vehicle_id");
}else{
$error_msg = "Sorry! Unable to connect to the database server.";
echo "<script>tossterMsgAlert('".$error_msg."','Success');</script>";
}
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>INSPINIA | Basic Form</title>
<?php include_once '../layout/style.php'; ?>
</head>
<body>
<div id="wrapper">
<?php include_once '../layout/side-bar.php'; ?>
<div id="page-wrapper" class="gray-bg">
<div class="row border-bottom">
<nav class="navbar navbar-static-top" role="navigation" style="margin-bottom: 0">
<div class="navbar-header">
<a class="navbar-minimalize minimalize-styl-2 btn btn-primary " href="#"><i class="fa fa-bars"></i> </a>
<form role="search" class="navbar-form-custom" action="search_results.html">
<div class="form-group">
<input type="text" placeholder="Search for something..." class="form-control" name="top-search" id="top-search">
</div>
</form>
</div>
<ul class="nav navbar-top-links navbar-right">
<li>
<span class="m-r-sm text-muted welcome-message">Welcome to INSPINIA+ Admin Theme.</span>
</li>
<li class="dropdown">
<a class="dropdown-toggle count-info" data-toggle="dropdown" href="#">
<i class="fa fa-envelope"></i> <span class="label label-warning">16</span>
</a>
<ul class="dropdown-menu dropdown-messages">
<li>
<div class="dropdown-messages-box">
<a href="profile.html" class="pull-left">
<img alt="image" class="img-circle" src="../img/a7.jpg">
</a>
<div class="media-body">
<small class="pull-right">46h ago</small>
<strong>Mike Loreipsum</strong> started following <strong>Monica Smith</strong>. <br>
<small class="text-muted">3 days ago at 7:58 pm - 10.06.2014</small>
</div>
</div>
</li>
<li class="divider"></li>
<li>
<div class="dropdown-messages-box">
<a href="profile.html" class="pull-left">
<img alt="image" class="img-circle" src="../img/a4.jpg">
</a>
<div class="media-body ">
<small class="pull-right text-navy">5h ago</small>
<strong>Chris Johnatan Overtunk</strong> started following <strong>Monica Smith</strong>. <br>
<small class="text-muted">Yesterday 1:21 pm - 11.06.2014</small>
</div>
</div>
</li>
<li class="divider"></li>
<li>
<div class="dropdown-messages-box">
<a href="profile.html" class="pull-left">
<img alt="image" class="img-circle" src="../img/profile.jpg">
</a>
<div class="media-body ">
<small class="pull-right">23h ago</small>
<strong>Monica Smith</strong> love <strong>Kim Smith</strong>. <br>
<small class="text-muted">2 days ago at 2:30 am - 11.06.2014</small>
</div>
</div>
</li>
<li class="divider"></li>
<li>
<div class="text-center link-block">
<a href="mailbox.html">
<i class="fa fa-envelope"></i> <strong>Read All Messages</strong>
</a>
</div>
</li>
</ul>
</li>
<li class="dropdown">
<a class="dropdown-toggle count-info" data-toggle="dropdown" href="#">
<i class="fa fa-bell"></i> <span class="label label-primary">8</span>
</a>
<ul class="dropdown-menu dropdown-alerts">
<li>
<a href="mailbox.html">
<div>
<i class="fa fa-envelope fa-fw"></i> You have 16 messages
<span class="pull-right text-muted small">4 minutes ago</span>
</div>
</a>
</li>
<li class="divider"></li>
<li>
<a href="profile.html">
<div>
<i class="fa fa-twitter fa-fw"></i> 3 New Followers
<span class="pull-right text-muted small">12 minutes ago</span>
</div>
</a>
</li>
<li class="divider"></li>
<li>
<a href="grid_options.html">
<div>
<i class="fa fa-upload fa-fw"></i> Server Rebooted
<span class="pull-right text-muted small">4 minutes ago</span>
</div>
</a>
</li>
<li class="divider"></li>
<li>
<div class="text-center link-block">
<a href="notifications.html">
<strong>See All Alerts</strong>
<i class="fa fa-angle-right"></i>
</a>
</div>
</li>
</ul>
</li>
<li>
<a href="login.html">
<i class="fa fa-sign-out"></i> Log out
</a>
</li>
</ul>
</nav>
</div>
<div class="row wrapper border-bottom white-bg page-heading">
<div class="col-lg-10">
<h2>Add Family Member Form</h2>
<ol class="breadcrumb">
<li>
<a href="index.html">Home</a>
</li>
<li>
<a>Forms</a>
</li>
<li class="active">
<strong>Add Family Member Form</strong>
</li>
</ol>
</div>
<div class="col-lg-2">
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>All form elements</h5>
<div class="ibox-tools">
<a class="collapse-link">
<i class="fa fa-chevron-up"></i>
</a>
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
<i class="fa fa-wrench"></i>
</a>
<ul class="dropdown-menu dropdown-user">
<li><a href="#">Config option 1</a>
</li>
</ul>
<a class="close-link">
<i class="fa fa-times"></i>
</a>
</div>
</div>
<div class="ibox-content">
<form method="POST" class="form-horizontal" action="">
<div class="form-group">
<label class="col-sm-2 control-label">Vehicle Number</label>
<div class="col-sm-4"><input type="text" name="vehicle_no" id="vehicle_no" class="form-control" value="<?=!empty($vehicles[0]['vehicle_no'])?$vehicles[0]['vehicle_no']:'';?>"></div>
<label class="col-sm-2 control-label">Vehicle type</label>
<div class="col-sm-4"><input type="text" name="vehicle_type" id="vehicle_type" class="form-control" value="<?=!empty($vehicles[0]['vehicle_type'])?$vehicles[0]['vehicle_type']:'';?>"></div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Vehicle Company</label>
<div class="col-sm-4"><input type="text" name="vehicle_company" id="vehicle_company" class="form-control" value="<?=!empty($vehicles[0]['vehicle_company'])?$vehicles[0]['vehicle_company']:'';?>"></div>
<label class="col-sm-2 control-label">Vehicle Model Name</label>
<div class="col-sm-4"><input type="text" name="vehicle_modelname" id="vehicle_modelname" class="form-control" value="<?=!empty($vehicles[0]['vehicle_modelname'])?$vehicles[0]['vehicle_modelname']:'';?>"></div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Vehicle Colour</label>
<div class="col-sm-4"><input type="text" name="vehicle_color" id="vehicle_color" class="form-control" value="<?=!empty($vehicles[0]['vehicle_color'])?$vehicles[0]['vehicle_color']:'';?>"></div>
<label class="col-sm-2 control-label">house No</label>
<div class="col-sm-4"><input type="text" name="house_no" id="house_no" class="form-control" value="<?=!empty($vehicles[0]['house_no'])?$vehicles[0]['house_no']:'';?>"></div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Plot Owner name</label>
<div class="col-sm-4"><input type="text" name="plot_owner_name" id="plot_owner_name" class="form-control" value="<?=!empty($vehicles[0]['plot_owner_name'])?$vehicles[0]['plot_owner_name']:'';?>"></div>
<label class="col-sm-2 control-label">Plot Owner's Mobile</label>
<div class="col-sm-4"><input type="text" name="plot_owner_mobile" id="plot_owner_mobile" class="form-control" value="<?=!empty($vehicles[0]['plot_owner_mobile'])?$vehicles[0]['plot_owner_mobile']:'';?>"></div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group">
<div class="col-sm-4 col-sm-offset-2">
<input type="hidden" name="member_id" value="<?=$_GET['id']?>">
<button class="btn btn-white" type="submit">Cancel</button>
<button class="btn btn-primary" name="btnAddvehicle" id="btnAddvehicle" type="submit">Update</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<?php include_once '../layout/script.php'; ?>
<script>
function tossterMsgAlert(msg='Welcome',title='') {
toastr.options = {
closeButton: true,
//debug: false,
newestOnTop: false,
//progressBar: false,
positionClass: 'toast-top-center',
preventDuplicates: true,
//onclick: null,
//showDuration: 300,
//hideDuration: 1000,
timeOut: 2000,
//extendedTimeOut: 1000,
//showEasing: 'swing',
//hideEasing: 'linear',
//showMethod: 'fadeIn',
hideMethod: 'fadeOut'
};
toastr.warning(title,msg);
}
</script>
</body>
</html>


PK 99