<?php
session_start();
if($_SESSION["username"]=="")
{
 	echo "You are not Logged in Please <a href='index.html'>Sign in </a> First ";
}
else
{

include 'dbc.php';
date_default_timezone_set("Asia/Karachi");
$today=date("Y-m-d");
$month = date("m",strtotime($today));
		$year = date("Y",strtotime($today));
		 $month_name = date("F", mktime(0, 0, 0, $month, 10));
		 $my=$month_name . " " . $year;
$userid=$_SESSION["userid"];
$id=$_REQUEST["id"];
$sql = "SELECT * FROM vendor where id = '$id' and user_id='$userid'";
$result=$conn->query($sql);
$row = $result->fetch_assoc();
$vno=$row['vno'] ;
$ven_name=$row['ven_name'] ;
$phone_no=$row['phone_no'] ;
$cell_no=$row['cell_no'] ;
$address=$row['address'] ;
$bal=$row['bal'] ;



//$rows3=$result1 ->fetch_assoc();
?>
<!doctype html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang=""> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8" lang=""> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9" lang=""> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js" lang="en">
<!--<![endif]-->

<head>
   <?php include("includes/header.php") ?>
</head>

<body>


    <!-- Left Panel -->

    <?php include("includes/menu.php") ?><!-- /#left-panel -->

    <!-- Left Panel -->

    <!-- Right Panel -->

    <div id="right-panel" class="right-panel">

        <!-- Header-->
        <header id="header" class="header">

             <?php include("includes/headermenu.php") ?>

        </header><!-- /header -->
        <!-- Header-->

        <div class="breadcrumbs">
            <div class="col-sm-6">
                <div class="page-header float-left">
                    <div class="page-title">
                        <h1><? echo "" . $_SESSION["userid"]; ?></h1>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="page-header float-right">
                    <div class="page-title">
                        <ol class="breadcrumb text-right">
                            <li class="active"><? echo "" . $_SESSION["username"]; ?></li>
                        </ol>
                    </div>
                </div>
            </div>
        </div>

        <div class="content mt-3">

           


          <div class="col-lg-12">
                                                <div class="card">
                                                    <div class="card-header">
                                                        <strong>Edit Vendor</strong> Form
                                                    </div>
                                                    <div class="card-body card-block">
                                                        <form action="Update_Vendor.php" method="post" enctype="multipart/form-data" class="form-horizontal">
                                                          <div class="row form-group">
                                                                <div class="col col-md-3"><label for="text-input" class=" form-control-label">V Id</label></div>
                                                                <div class="col-12 col-md-4"><input type="text" id="id" name="id" placeholder="Vendor ID" class="form-control" value=" <? echo $id ?>" readonly><small class="form-text text-muted">This is Id</small></div>
                                                            </div>
																<div class="row form-group">
                                                                <div class="col col-md-3"><label for="text-input" class=" form-control-label">Vendor Name</label></div>
                                                                <div class="col-12 col-md-6"><input type="text" id="ven_name" name="ven_name" placeholder="Vendor Name" class="form-control" value=" <? echo $ven_name ?>"><small class="form-text text-muted">This is Vendor Name</small></div>
                                                            </div>
																
																
																
																<div class="row form-group">
                                                                <div class="col col-md-3"><label for="text-input" class=" form-control-label">Phone No</label></div>
                                                                <div class="col-12 col-md-4"><input type="text" id="phone_no" name="phone_no" placeholder="phone no" class="form-control" value=" <? echo $phone_no ?>"><small class="form-text text-muted">This is phone no</small></div>
                                                            </div>
																
																
																<div class="row form-group">
                                                                <div class="col col-md-3"><label for="text-input" class=" form-control-label">Cell No</label></div>
                                                                <div class="col-12 col-md-4"><input type="text" id="cell_no" name="cell_no" placeholder="Cell No" class="form-control" value=" <? echo $cell_no ?>"><small class="form-text text-muted">This is Cell No</small></div>
                                                            </div>
															<div class="row form-group">
                                                                <div class="col col-md-3"><label for="text-input" class=" form-control-label">Address</label></div>
                                                                <div class="col-12 col-md-6"><input name="address" type="text" class="form-control" id="address" size="70" placeholder="Address" value=" <? echo $address ?>">
                                                                <small class="form-text text-muted">Address</small></div>
                                                            </div>
															<div class="row form-group">
                                                                <div class="col col-md-3"><label for="text-input" class=" form-control-label">Opening Bal</label></div>
                                                                <div class="col-12 col-md-3"><input type="text" id="bal" name="bal" placeholder="Opening Bal" class="form-control" value=" <? echo $bal ?>"><small class="form-text text-muted" >This is Opening Bal</small></div>
                                                            </div>
															
                                                                
                                                       
                                                    </div>
                                                    <div class="card-footer">
                                                        <button type="submit" class="btn btn-primary btn-sm">
                                                            <i class="fa fa-dot-circle-o"></i> Submit
                                                        </button>
                                                        <button type="reset" class="btn btn-danger btn-sm">
                                                            <i class="fa fa-ban"></i> Reset
                                                        </button>
                                                    </div>
													 </form>
                                                </div>
                                                
                                            </div>

            


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

    <!-- Right Panel -->

   <?php include("includes/footermenu.php") ?>

</body>

</html>
<?php
}

?>