<?php
require_once('functions.php');
//require_once('conf.php');


  $dbc=mysqli_connect('localhost','wqvsodvt_porr','@@W!QSER765VBlkj@@@!!','wqvsodvt_point');
							if (isset($_GET['id']))
							{
					
						
						$id = $_GET['id'];
						$result = mysqli_query($dbc,("SELECT * FROM accounts WHERE id = '$id'"));
						
						$row = mysqli_fetch_array($result);
						$id=$row["id"];
						$name=$row["name"];
						$phone=$row["phone"];
						$rate=$row["descc"];
					$results = mysqli_query($dbc,("SELECT credit FROM ledgers WHERE froms= '$id' and description='OPENING BALANCE'"));
					     $nj=mysqli_fetch_array($results);
						    $opening=$nj['credit'];
						mysqli_close($dbc);
						}
						
						?>




<form action="edit_cc.php" method="post">
<input name="id" type="hidden" value="<?php echo $id; ?>"/>

<b>Customer Name:<br />
<input name="name" type="text" value="<?php echo $name; ?>" size="50" required="required"/><br />


Customer Phone:<br />
<input name="phone" type="text" value="<?php echo $phone; ?>" size="50" required="required" />
<br />
Credit Limit:<br />
<input name="limit" type="text" value="<?php echo $rate; ?>"size="40"  required="required"/><br />
<br />

Opening Balance:<br />
<input name="opening" type="text" value="<?php echo $opening; ?>"size="40"  required="required"/><br />
<br />

<input name="submit" type="submit" value="save">
</form>
