<? include "top.php"; ?>
<!DOCTYPE html>
<html>
<head>
	<?php include('include/head.php'); ?>
	<title>Add Cable Customer</title>
	<link rel="stylesheet" type="text/css" href="src/plugins/datatables/media/css/jquery.dataTables.css">
	<link rel="stylesheet" type="text/css" href="src/plugins/datatables/media/css/dataTables.bootstrap4.css">
	<link rel="stylesheet" type="text/css" href="src/plugins/datatables/media/css/responsive.dataTables.css">
	<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
</head>
<body>
	<?php include('include/header.php'); ?>
	<?php include('include/sidebar.php'); 

	$action=$_REQUEST['action'];
	 if($action=='save'){
		 if($psave==1){
	 $cid=$_REQUEST['cid'];
    $name=addslashes($_POST['name']);
    $dob=addslashes($_POST['dob']);
    $gender=addslashes($_POST['gender']);
    $email=addslashes($_POST['email']);
    $custid=addslashes($_POST['custid']);
    $phone=addslashes($_POST['phone']);
    $price=addslashes($_POST['price']);
    $address=addslashes($_POST['address']);
    $pay_ch=addslashes($_POST['pay_ch']);
    $vc=addslashes($_POST['vc']);
    $stb=addslashes($_POST['stb']);
    $area_id=$_POST['area_id'];
	$lineman=$_POST['lineman'];

    $getarea=f(q("select * from tbl_area where arid='$area_id'"));
    $area_name=$getarea['arname'];

    $l_uid=addslashes($_POST['l_uid']);
    $l_pass=addslashes($_POST['l_pass']);
    $actv=addslashes($_POST['actv']);
    $mso=addslashes($_POST['mso']);
    $sdhd=addslashes($_POST['sdhd']);
    $boxdate=addslashes($_POST['boxdate']);
    $com_id=addslashes($_POST['com_id']);
	$msoacno=$_POST['msoacno'];
	$landmark=$_POST['landmark'];
	$houseno=$_POST['houseno'];
	$discounts=$_POST['discounts'];
	$note=addslashes($_POST['note']);
	$phone_off=addslashes($_POST['phone_off']);
	$safno=addslashes($_POST['safno']);
	$father_name=addslashes($_POST['father_name']);


	// $normalstb_pr=$_POST['normalstb_pr'];
	// $normalstb_free=$_POST['normalstb_free'];
	// $normalstb_disc=$_POST['normalstb_disc'];
	// $normalstb_amt=$_POST['normalstb_amt'];
	// $hdbox_pr=$_POST['hdbox_pr'];
	// $hdbox_free=$_POST['hdbox_free'];
	// $hdbox_disc=$_POST['hdbox_disc'];
	// $hdbox_amt=$_POST['hdbox_amt'];
	// $rg_pr=$_POST['rg_pr'];
	// $rg_free=$_POST['rg_free'];
	// $rg_disc=$_POST['rg_disc'];
	// $rg_amt=$_POST['rg_amt'];
	// $nut_pr=$_POST['nut_pr'];
	// $nut_free=$_POST['nut_free'];
	// $nut_disc=$_POST['nut_disc'];
	// $nut_amt=$_POST['nut_amt'];
	// $inst_pr=$_POST['inst_pr'];
	// $inst_free=$_POST['inst_free'];
	// $inst_disc=$_POST['inst_disc'];
	// $inst_amt=$_POST['inst_amt'];
	// $cage=$_POST['cage'];
		




    $slisql="INSERT INTO `adduser` SET 
    `name`='$name',
    `dob`='$dob',
    `gender`='$gender',
    `email`='$email',
    `custid`='$custid',
    `phone`='$phone',
    `address`='$address',
    `price`='$price',pay_ch='$pay_ch',is_cable=1,vc='$vc',stb='$stb',area_id='$area_id',area_name='$area_name',pexpiry='$dob',actv='$actv',mso='$mso',sdhd='$sdhd',boxdate='$boxdate',com_id='$com_id',msoacno='$msoacno',line_ids='$lineman',landmark='$landmark',houseno='$houseno',discounts='$discounts'";
    
    //echo $slisql;
    $res=mysqli_query($con,$slisql);
    $user_id=mysqli_insert_id($con);
    if($res){
    	if($l_pass==''){

    			$l_pass=$phone;

    	}

    	$chks=f(q("SELECT * FROM tbl_login WHERE l_read='$l_uid'"));

    	if($chks['l_read']==''){
    		 mysqli_query($con,"INSERT INTO tbl_login SET l_pass=md5('$l_pass'),l_uid=md5('$l_uid'),l_name='$name',l_read='$l_uid',l_type='3',l_act='1',user_id='$user_id'");

    	}else{

    		$uidd=$l_uid.$custid;

    		 mysqli_query($con,"INSERT INTO tbl_login SET l_pass=md5('$l_pass'),l_uid=md5('$uidd'),l_name='$name',l_read='$uidd',l_type='3',l_act='1',user_id='$user_id'");
    	}
		?>
    <script type="text/javascript">
  swal({ title: "Cable Billing",
 text: "Data Saved !!!",
 type: "success"}).then(okay => {
   if (okay) {
    window.location.href = "cablecust.php";
  }
});
</script>
        
    <?php }else{?>
 <script type="text/javascript">
            Swal.fire('Data Save Error','','error')
             </script>
	<!-- <script type="text/javascript">
  swal({ title: "Cable Billing",
 text: "Data Save Error",
 type: "error"}).then(okay => {
   if (okay) {
    window.location.href = "cablecust.php";
  }
});
</script> -->

    <? }

	}else{

		?>
		<!-- <script type="text/javascript">
			Swal.fire('Permission Denied','','error')
			 </script> -->
			 <script type="text/javascript">
  swal({ title: "Cable Billing",
 text: "Permission Denied",
 type: "error"}).then(okay => {
   if (okay) {
    window.location.href = "cablecust.php";
  }
});
</script>
		<?php

	}
    
    }elseif($action=='update'){

		if($pupdate==1){
    $cid=$_REQUEST['cid'];
    $name=addslashes($_POST['name']);
    $dob=addslashes($_POST['dob']);
    $gender=addslashes($_POST['gender']);
    $email=addslashes($_POST['email']);
    $custid=addslashes($_POST['custid']);
    $phone=addslashes($_POST['phone']);
    $price=addslashes($_POST['price']);
    $address=addslashes($_POST['address']);
    $pay_ch=addslashes($_POST['pay_ch']);
    $vc=addslashes($_POST['vc']);
    $stb=addslashes($_POST['stb']);
    $area_id=$_POST['area_id'];
    $actv=addslashes($_POST['actv']);
	$l_uid=addslashes($_POST['l_uid']);
	$l_pass=addslashes($_POST['l_pass']);
	 $mso=addslashes($_POST['mso']);
    $sdhd=addslashes($_POST['sdhd']);
    $boxdate=addslashes($_POST['boxdate']);
    $com_id=addslashes($_POST['com_id']);
	$msoacno=$_POST['msoacno'];
	$lineman=$_POST['lineman'];
	$landmark=$_POST['landmark'];
	$houseno=$_POST['houseno'];
	$discounts=$_POST['discounts'];
	$note=addslashes($_POST['note']);
	$phone_off=addslashes($_POST['phone_off']);
	$father_name=addslashes($_POST['father_name']);		
	$safno=addslashes($_POST['safno']);

	// $normalstb_pr=$_POST['normalstb_pr'];
	// $normalstb_free=$_POST['normalstb_free'];
	// $normalstb_disc=$_POST['normalstb_disc'];
	// $normalstb_amt=$_POST['normalstb_amt'];
	// $hdbox_pr=$_POST['hdbox_pr'];
	// $hdbox_free=$_POST['hdbox_free'];
	// $hdbox_disc=$_POST['hdbox_disc'];
	// $hdbox_amt=$_POST['hdbox_amt'];
	// $rg_pr=$_POST['rg_pr'];
	// $rg_free=$_POST['rg_free'];
	// $rg_disc=$_POST['rg_disc'];
	// $rg_amt=$_POST['rg_amt'];
	// $nut_pr=$_POST['nut_pr'];
	// $nut_free=$_POST['nut_free'];
	// $nut_disc=$_POST['nut_disc'];
	// $nut_amt=$_POST['nut_amt'];
	// $inst_pr=$_POST['inst_pr'];
	// $inst_free=$_POST['inst_free'];
	// $inst_disc=$_POST['inst_disc'];
	// $inst_amt=$_POST['inst_amt'];	
	// $cage=$_POST['cage'];	



    $getarea=f(q("select * from tbl_area where arid='$area_id'"));
    $area_name=$getarea['arname'];

    $slisql="UPDATE `adduser` SET 
    `name`='$name',
    `dob`='$dob',
    `gender`='$gender',
    `email`='$email',
    `custid`='$custid',
    `phone`='$phone',
    `address`='$address',
	father_name='$father_name',
	note='$note',
	`phone_off`='$phone_off',
	safno='$safno',		
    `price`='$price',pay_ch='$pay_ch',vc='$vc',stb='$stb',area_id='$area_id',area_name='$area_name',pexpiry='$dob',actv='$actv',mso='$mso',sdhd='$sdhd',boxdate='$boxdate',com_id='$com_id',msoacno='$msoacno',line_ids='$lineman',landmark='$landmark',houseno='$houseno',discounts='$discounts' WHERE id='$cid'";
    
    echo $slisql;
    $res=mysqli_query($con,$slisql);
    if(!$res){
        //echo mysql_error();
		
    }else{ 
		
		if($l_pass!=''){
         mysqli_query($con,"UPDATE tbl_login SET l_pass=md5('$l_pass') WHERE l_read='$l_uid'");
		}	
		
		?>

<script type="text/javascript">
  swal({ title: "Cable Billing",
 text: "Data Updated !!!",
 type: "success"}).then(okay => {
   if (okay) {
    window.location.href = "cablecust.php";
  }
});
</script>


    <? }

	}else{
		
		?>
		<script type="text/javascript">
			Swal.fire('Permission Denied','','error')
			 </script>
		<?php


	}




      
    }elseif($action=='edit'){

          $cid=$_REQUEST['cid'];
          $edit=f(q("SELECT * FROM `adduser` WHERE `id`='$cid'"));
          $getuids=f(q("SELECT * FROM tbl_login WHERE user_id='$cid'"));




    }elseif($action=='delete'){

		if($pdelete==1){

          $cid=$_REQUEST['cid'];
          $edit=f(q("UPDATE `adduser` SET actv=0 WHERE `id`='$cid'"));
          ?>
          <script type="text/javascript">
  swal({ title: "Cable Billing",
 text: "Data Deleted !!!",
 type: "success"}).then(okay => {
   if (okay) {
    window.location.href = "cablecust.php";
  }
});
</script>

   <?php

		}else{
			?>
			<script type="text/javascript">
				Swal.fire('Permission Denied','','error')
				 </script>
			<?php

		}

	}	

	$getmaxid=f(q("SELECT MAX(id) as maxid FROM adduser"));
	$maxid=$getmaxid['maxid'];
	$newid=floatval($maxid)+1;
	$custid=getzeroserials($newid,4);

	$uids="nvn".$newid;

    
?>
<?php 
	
	include "ajax.php";
	
?>
	<div class="main-container">
		<div class="pd-ltr-20 customscroll customscroll-10-p height-100-p xs-pd-20-10">
			<div class="min-height-200px">
				<div class="page-header">
					<div class="row">
						<div class="col-md-6 col-sm-12">
							<div class="title">
								<h4>Add New Cable Customer</h4>
							</div>
							<nav aria-label="breadcrumb" role="navigation">
								<ol class="breadcrumb">
									<li class="breadcrumb-item"><a href="index.php">Home</a></li>
									<li class="breadcrumb-item active" aria-current="page">Add Customer</li>
								</ol>
							</nav>
						</div>
						<div class="col-md-6 col-sm-12 text-right">
							<!-- <div class="dropdown">
								<a class="btn btn-secondary dropdown-toggle" href="#" role="button" data-toggle="dropdown">
									January 2018
								</a>
								<div class="dropdown-menu dropdown-menu-right">
									<a class="dropdown-item" href="#">Export List</a>
									<a class="dropdown-item" href="#">Policies</a>
									<a class="dropdown-item" href="#">View Assets</a>
								</div>
							</div> -->
						</div>
					</div>
				</div>
				<!-- Default Basic Forms Start -->
				<div class="pd-20 bg-white border-radius-4 box-shadow mb-30" style="padding:10%;">
					<small style="color: red;"><?=$msg?></small>
					<form action="<?=$_SERVER['PHP_SELF']?>?action=<? if($action=='edit'){?>update&cid=<?=$cid?><? }else{?>save<?} ?>" method="POST">
					<div class="row">
						<div class="col-md-6">

							
									<div class="form-group row">
									<label class="col-sm-12 col-md-2 col-form-label">Select Company</label>
									<div class="col-sm-12 col-md-10">
										<select name="com_id" class="form-control">
											<option value="0">Choose Company</option>
											<?
												$company=mysqli_query($con,"SELECT * FROM tbl_company");
												while($arrcom=mysqli_fetch_array($company)){
											?>
											<option value="<?=$arrcom['c_id']?>" <? if($edit['com_id']==$arrcom['c_id']){?> selected <? } ?>><?=$arrcom['c_name']?></option>
		
											<? } ?>
										</select>
									</div>
								</div>
								<div class="form-group row">
									<label class="col-sm-12 col-md-2 col-form-label">Select MSO</label>
									<div class="col-sm-12 col-md-10">
										<select name="mso" class="form-control">
											<option value="0">Choose MSO</option>
											<?
												$areas=mysqli_query($con,"SELECT * FROM tbl_mso");
												while($arrr=mysqli_fetch_array($areas)){
											?>
											<option value="<?=$arrr['m_id']?>" <? if($edit['mso']==$arrr['m_id']){?> selected <? } ?>><?=$arrr['m_name']?></option>
		
											<? } ?>
										</select>
									</div>
								</div>
								<div class="form-group row">
									<label class="col-sm-12 col-md-2 col-form-label">Select Area</label>
									<div class="col-sm-12 col-md-10">
										<select name="area_id" class="form-control">
											<option value="0">Choose Area</option>
											<?
												$areas=mysqli_query($con,"SELECT * FROM tbl_area");
												while($arrr=mysqli_fetch_array($areas)){
											?>
											<option value="<?=$arrr['arid']?>" <? if($edit['area_id']==$arrr['arid']){?> selected <? } ?>><?=$arrr['arname']?></option>
		
											<? } ?>
										</select>
									</div>
								</div>
								<div class="form-group row">
									<label class="col-sm-12 col-md-2 col-form-label">House No</label>
									<div class="col-sm-12 col-md-10">
										<input class="form-control" type="text" name="houseno" placeholder="enter House No" value="<?=$edit['houseno']?>" required>
									</div>
								</div>					
								<div class="form-group row">
									<label class="col-sm-12 col-md-2 col-form-label">Name</label>
									<div class="col-sm-12 col-md-10">
										<input class="form-control" type="text" name="name" placeholder="enter Full name" value="<?=$edit['name']?>" required>
									</div>
								</div>
								<div class="form-group row">
									<label class="col-sm-12 col-md-2 col-form-label">Fathers Name</label>
									<div class="col-sm-12 col-md-10">
										<input class="form-control" type="text" name="father_name" placeholder="enter Fathers Name" value="<?=$edit['father_name']?>">
									</div>
								</div>
								<div class="form-group row">
									<label class="col-sm-12 col-md-2 col-form-label">A/C No</label>
									<div class="col-sm-12 col-md-4">
										<input class="form-control" type="text" name="custid" placeholder="enter Acno" value="<?php if($action=='edit'){?><?=$edit['custid']?><?php }else{ echo $custid; }?>" required>
									</div>
									<!-- <label class="col-sm-12 col-md-2 col-form-label text-right">Age</label>
									<div class="col-sm-12 col-md-4">
										<input class="form-control" type="text" name="cage" placeholder="enter Age" value="<?php if($action=='edit'){?><?=$edit['cage']?><?php }else{ echo ""; }?>" required>
									</div> -->
								</div>
								<div class="form-group row">
									<label class="col-sm-12 col-md-2 col-form-label">MSO AC No</label>
									<div class="col-sm-12 col-md-10">
										<input class="form-control" type="text" name="msoacno" placeholder="enter MSO Acno" value="<?php if($action=='edit'){?><?=$edit['msoacno']?><?php }?>" required>
									</div>
								</div>
								<div class="form-group row">
									<label class="col-sm-12 col-md-2 col-form-label">Address</label>
									<div class="col-sm-12 col-md-10">
										<textarea class="form-control" name="address" rows="2">
											<?=$edit['address']?>

										</textarea>
									</div>
								</div>
								<div class="form-group row">
									<label class="col-sm-12 col-md-2 col-form-label">Nearest Landmark</label>
									<div class="col-sm-12 col-md-10">
										<input class="form-control" type="text" name="landmark" placeholder="Enter Landmark" value="<?=$edit['landmark']?>" id="landmark">
									</div>
								</div>
								<div class="form-group row">
									<label class="col-sm-12 col-md-2 col-form-label">Email</label>
									<div class="col-sm-12 col-md-10">
										<input class="form-control" type="text" name="email" placeholder="enter Email" value="<?=$edit['email']?>">
									</div>
								</div>
								<div class="form-group row">
									<label class="col-sm-12 col-md-2 col-form-label">Mobile</label>
									<div class="col-sm-12 col-md-10">
										<input class="form-control" type="text" name="phone" placeholder="enter Phone" value="<?=$edit['phone']?>" required>
									</div>
								</div>
								<div class="form-group row">
									<label class="col-sm-12 col-md-2 col-form-label">Phone Off</label>
									<div class="col-sm-12 col-md-10">
										<input class="form-control" type="text" name="phone_off" placeholder="enter Phone Office" value="<?=$edit['phone_off']?>">
									</div>
								</div>
								<div class="form-group row">
									<label class="col-sm-12 col-md-2 col-form-label">Discount Amount</label>
									<div class="col-sm-12 col-md-10">
										<input class="form-control" type="text" name="discounts" placeholder="enter Discount" value="<?=$edit['discounts']?>">
									</div>
								</div>
							

						</div>
						<div class="col-md-6">
						<div class="form-group row">
							<label class="col-sm-12 col-md-2 col-form-label">MRP (without Tax)</label>
							<div class="col-sm-12 col-md-10">
								<input class="form-control" type="text" name="price" placeholder="enter MRP" value="<?=$edit['price']?>" required>
							</div>
						</div>
						<div class="form-group row">
							<label class="col-sm-12 col-md-2 col-form-label">Select Box Type</label>
							<div class="col-sm-12 col-md-10">
								<select name="sdhd" class="form-control">
									<option value="0">Choose Type</option>
									
									<option value="SD" <? if($edit['sdhd']=='SD'){?> selected <? } ?>>SD</option>
 									<option value="HD" <? if($edit['sdhd']=='HD'){?> selected <? } ?>>HD</option>
									
								</select>
							</div>
						</div>
						<div class="form-group row">
							<label class="col-sm-12 col-md-2 col-form-label">Box Issue Date</label>
							<div class="col-sm-12 col-md-10">
								<input class="form-control" type="date" name="boxdate" value="<?php echo $edit['boxdate']?>" required>
							</div>
						</div>
						<div class="form-group row">
							<label class="col-sm-12 col-md-2 col-form-label">VC</label>
							<div class="col-sm-12 col-md-10">
								<input class="form-control" type="text" name="vc" placeholder="enter VC" value="<?=$edit['vc']?>" required id="vcno" onblur="getstb(this.value)">
							</div>
						</div>
						<div class="form-group row">
							<label class="col-sm-12 col-md-2 col-form-label">STB</label>
							<div class="col-sm-12 col-md-10">
								<input class="form-control" type="text" name="stb" placeholder="enter STB" value="<?=$edit['stb']?>" required id="stbno"  onblur="getvc(this.value)">
							</div>
						</div>
						<div class="form-group row">
							<label class="col-sm-12 col-md-2 col-form-label">SAFNO</label>
							<div class="col-sm-12 col-md-10">
								<input class="form-control" type="text" name="safno" placeholder="enter SAFNO" value="<?=$edit['safno']?>">
							</div>
						</div>
						<div class="form-group row">
							<label class="col-sm-12 col-md-2 col-form-label">Details</label>
							<div class="col-sm-12 col-md-10">
								<textarea class="form-control" name="pay_ch">
									<?=$edit['pay_ch']?>

								</textarea>
							</div>
						</div>
						<div class="form-group row">
							<label class="col-sm-12 col-md-2 col-form-label">Expiry Date</label>
							<div class="col-sm-12 col-md-10">
								<input class="form-control" type="date" name="dob" placeholder="" value="<? if($action=='edit'){?><?=$edit['pexpiry']?><? }else{ ?><? echo date('Y-m-d');?><? } ?>" required>
							</div>
						</div>
						<div class="form-group row">
							<label class="col-sm-12 col-md-2 col-form-label">Username</label>
							<div class="col-sm-12 col-md-10">
								<input class="form-control" type="text" name="l_uid" placeholder="Enter Username" value="<?php if($action=='edit'){?> <?=$getuids['l_read']?> <?php }else{ echo $uids; } ?>">
							</div>
						</div>
						<div class="form-group row">
							<label class="col-sm-12 col-md-2 col-form-label">Password</label>
							<div class="col-sm-12 col-md-10">
								<input class="form-control" type="password" name="l_pass" placeholder="Enter Password" value="" >
							</div>
						</div>
						<div class="form-group row">
							<label class="col-sm-12 col-md-2 col-form-label">GST</label>
							<div class="col-sm-12 col-md-10">
								<input class="form-control" type="text" name="gender" placeholder="Enter Value" value="<?=$edit['gender']?>">
							</div>
						</div>
						<div class="form-group row">
							<label class="col-sm-12 col-md-2 col-form-label">Remarks / Note</label>
							<div class="col-sm-12 col-md-10">
								<input class="form-control" type="text" name="note" placeholder="Enter Note/Remarks" value="<?php if($action=='edit'){ echo $edit['note']; } ?>">
							</div>
						</div>
						<div class="form-group row">
							<label class="col-sm-12 col-md-2 col-form-label">Lineman</label>
							<div class="col-sm-12 col-md-10">
							<select name="lineman" class="form-control" id="lineman">
											<?php 

													$ql=mysqli_query($con,"SELECT * FROM tbl_login WHERE l_type=2 ORDER BY l_name");
													while($arrcl=mysqli_fetch_array($ql)){
											
											?>
				<option value="<?php echo $arrcl['l_id']?>" <?php if($edit['line_ids']==$arrcl['l_id']){?>selected<?php } ?>><?php echo $arrcl['l_name']?></option>

<?php } ?>
								</select>
													</div>
						</div>
						<div class="form-group row">
							<label class="col-sm-12 col-md-2 col-form-label">Active</label>
							<div class="col-sm-12 col-md-10">
								<select class="form-control" name="actv">
									<option value="1" <?php if($edit['actv']==1){?> selected <?php } ?>>Active</option>
									<option value="0" <?php if($edit['actv']==0){?> selected <?php } ?>>Inactive</option>
									
								</select>
							</div>
						</div>						
														


						</div>

					</div>
					<!-- <div class="row">
						<div class="col-md-4">
						<div class="form-group row">
							<label class="col-sm-12 col-md-6 col-form-label"><b>Normal SetTop Box Setup</b></label>
							<div class="col-sm-12 col-md-6">
								<input class="form-control" type="text" name="normalstb_pr" placeholder="Enter Value" value="<?=$edit['normalstb_pr']?>">
							</div>
						</div>
						</div>
						<div class="col-md-2">
						<div class="form-group row">
							<label class="col-sm-12 col-md-2 col-form-label">free</label>
							<div class="col-sm-12 col-md-10">
								<select class="form-control" name="normalstb_free">
									<option value="0" <?php if($edit['normalstb_free']==0){?>selected <?php } ?>>No</option>
									<option value="1" <?php if($edit['normalstb_free']==1){?>selected <?php } ?>>Yes</option>
								</select>
							</div>
						</div>
						</div>
						<div class="col-md-3">
						<div class="form-group row">
							<label class="col-sm-12 col-md-6 col-form-label text-right">Discount</label>
							<div class="col-sm-12 col-md-6">
							<input class="form-control" type="text" name="normalstb_disc" placeholder="Enter Value" value="<?=$edit['normalstb_disc']?>">
							</div>
						</div>
						</div>
						<div class="col-md-3">
						<div class="form-group row">
							<label class="col-sm-12 col-md-6 col-form-label text-right">Amount</label>
							<div class="col-sm-12 col-md-6">
							<input class="form-control" type="text" name="normalstb_amt" placeholder="Enter Value" value="<?=$edit['normalstb_amt']?>">
							</div>
						</div>
						</div>
					</div>
					<div class="row">
						<div class="col-md-4">
						<div class="form-group row">
							<label class="col-sm-12 col-md-6 col-form-label"><b>HD Box Rs.</b></label>
							<div class="col-sm-12 col-md-6">
								<input class="form-control" type="text" name="hdbox_pr" placeholder="Enter Value" value="<?=$edit['hdbox_pr']?>">
							</div>
						</div>
						</div>
						<div class="col-md-2">
						<div class="form-group row">
							<label class="col-sm-12 col-md-2 col-form-label">free</label>
							<div class="col-sm-12 col-md-10">
								<select class="form-control" name="hdbox_free">
								<option value="0" <?php if($edit['hdbox_free']==0){?>selected <?php } ?>>No</option>
									<option value="1" <?php if($edit['hdbox_free']==1){?>selected <?php } ?>>Yes</option>
								</select>
							</div>
						</div>
						</div>
						<div class="col-md-3">
						<div class="form-group row">
							<label class="col-sm-12 col-md-6 col-form-label text-right">Discount</label>
							<div class="col-sm-12 col-md-6">
							<input class="form-control" type="text" name="hdbox_disc" placeholder="Enter Value" value="<?=$edit['hdbox_disc']?>">
							</div>
						</div>
						</div>
						<div class="col-md-3">
						<div class="form-group row">
							<label class="col-sm-12 col-md-6 col-form-label text-right">Amount</label>
							<div class="col-sm-12 col-md-6">
							<input class="form-control" type="text" name="hdbox_amt" placeholder="Enter Value" value="<?=$edit['hdbox_amt']?>">
							</div>
						</div>
						</div>
					</div>
					<div class="row">
						<div class="col-md-4">
						<div class="form-group row">
							<label class="col-sm-12 col-md-6 col-form-label"><b>RG 6 COAX Cable Rs.</b></label>
							<div class="col-sm-12 col-md-6">
								<input class="form-control" type="text" name="rg_pr" placeholder="Enter Value" value="<?=$edit['rg_pr']?>">
							</div>
						</div>
						</div>
						<div class="col-md-2">
						<div class="form-group row">
							<label class="col-sm-12 col-md-2 col-form-label">free</label>
							<div class="col-sm-12 col-md-10">
								<select class="form-control" name="rg_free">
								<option value="0" <?php if($edit['rg_free']==0){?>selected <?php } ?>>No</option>
									<option value="1" <?php if($edit['rg_free']==1){?>selected <?php } ?>>Yes</option>
								</select>
							</div>
						</div>
						</div>
						<div class="col-md-3">
						<div class="form-group row">
							<label class="col-sm-12 col-md-6 col-form-label text-right">Discount</label>
							<div class="col-sm-12 col-md-6">
							<input class="form-control" type="text" name="rg_disc" placeholder="Enter Value" value="<?=$edit['rg_disc']?>">
							</div>
						</div>
						</div>
						<div class="col-md-3">
						<div class="form-group row">
							<label class="col-sm-12 col-md-6 col-form-label text-right">Amount</label>
							<div class="col-sm-12 col-md-6">
							<input class="form-control" type="text" name="rg_amt" placeholder="Enter Value" value="<?=$edit['rg_amt']?>">
							</div>
						</div>
						</div>
					</div>
					<div class="row">
						<div class="col-md-4">
						<div class="form-group row">
							<label class="col-sm-12 col-md-6 col-form-label"><b>NUT & RING Rs.</b></label>
							<div class="col-sm-12 col-md-6">
								<input class="form-control" type="text" name="nut_pr" placeholder="Enter Value" value="<?=$edit['nut_pr']?>">
							</div>
						</div>
						</div>
						<div class="col-md-2">
						<div class="form-group row">
							<label class="col-sm-12 col-md-2 col-form-label">free</label>
							<div class="col-sm-12 col-md-10">
								<select class="form-control" name="nut_free">
								<option value="0" <?php if($edit['nut_free']==0){?>selected <?php } ?>>No</option>
									<option value="1" <?php if($edit['nut_free']==1){?>selected <?php } ?>>Yes</option>
								</select>
							</div>
						</div>
						</div>
						<div class="col-md-3">
						<div class="form-group row">
							<label class="col-sm-12 col-md-6 col-form-label text-right">Discount</label>
							<div class="col-sm-12 col-md-6">
							<input class="form-control" type="text" name="nut_disc" placeholder="Enter Value" value="<?=$edit['nut_disc']?>">
							</div>
						</div>
						</div>
						<div class="col-md-3">
						<div class="form-group row">
							<label class="col-sm-12 col-md-6 col-form-label text-right">Amount</label>
							<div class="col-sm-12 col-md-6">
							<input class="form-control" type="text" name="nut_amt" placeholder="Enter Value" value="<?=$edit['nut_amt']?>">
							</div>
						</div>
						</div>
					</div>
					<div class="row">
						<div class="col-md-4">
						<div class="form-group row">
							<label class="col-sm-12 col-md-6 col-form-label"><b>Installation Rs.</b></label>
							<div class="col-sm-12 col-md-6">
								<input class="form-control" type="text" name="inst_pr" placeholder="Enter Value" value="<?=$edit['inst_pr']?>">
							</div>
						</div>
						</div>
						<div class="col-md-2">
						<div class="form-group row">
							<label class="col-sm-12 col-md-2 col-form-label">free</label>
							<div class="col-sm-12 col-md-10">
								<select class="form-control" name="inst_free">
								<option value="0" <?php if($edit['inst_free']==0){?>selected <?php } ?>>No</option>
									<option value="1" <?php if($edit['inst_free']==1){?>selected <?php } ?>>Yes</option>
								</select>
							</div>
						</div>
						</div>
						<div class="col-md-3">
						<div class="form-group row">
							<label class="col-sm-12 col-md-6 col-form-label text-right">Discount</label>
							<div class="col-sm-12 col-md-6">
							<input class="form-control" type="text" name="inst_disc" placeholder="Enter Value" value="<?=$edit['inst_disc']?>">
							</div>
						</div>
						</div>
						<div class="col-md-3">
						<div class="form-group row">
							<label class="col-sm-12 col-md-6 col-form-label text-right">Amount</label>
							<div class="col-sm-12 col-md-6">
							<input class="form-control" type="text" name="inst_amt" placeholder="Enter Value" value="<?=$edit['inst_amt']?>">
							</div>
						</div>
						</div>
					</div> -->
					<div class="clearfix" style="min-height: 30px;"></div>
						
						
						
						<div class="clearfix">
						<div class="pull-left">
							<!-- <h4 class="text-blue">Default Basic Forms</h4>
							<p class="mb-30 font-14">All bootstrap element classies</p> -->
						</div>
						<div class="pull-right">
							<button type="submit" class="btn btn-primary btn-sm"><i class="fa fa-save"></i> Save</button>
							<!-- <a href="#basic-form1" class="btn btn-primary btn-sm scroll-click" rel="content-y"  data-toggle="collapse" role="button"><i class="fa fa-code"></i> Source Code</a> -->
						</div>
					</div>
					</form>
					<div class="collapse collapse-box" id="basic-form1" >
						
					</div>
				</div>
				<!-- <div class="pd-20 bg-white border-radius-4 box-shadow mb-30">
					<div class="clearfix mb-20">
						<div class="pull-left">
							<h5 class="text-blue">Lane List</h5>
						</div>
					</div>
					<div class="row">
						<table class="stripe hover multiple-select-row data-table-export nowrap">
							<thead>
								<tr>
									<th class="table-plus datatable-nosort">Name</th>
									<th>Area Name</th>	
									
									<th>Action</th>	
								</tr>
							</thead>
							<tbody>
								<?
									$getc=mysqli_query($con,"SELECT * FROM tbl_lane ORDER BY lnname");
									while($arr=mysqli_fetch_array($getc)){

										$getar=f(q("SELECT * FROM tbl_area WHERE arid='$arr[lnarid]'"));
								?>
								<tr>
									<td class="table-plus"><?=$arr['lnname']?></td>
									<td><?=$getar['arname']?></td>	
									
									<td>
									<a href="<?=$_SERVER['PHP_SELF']?>?action=edit&cid=<?=$arr['lnid']?>">EDIT</a><br>
									<a href="<?=$_SERVER['PHP_SELF']?>?action=delete&cid=<?=$arr['lnid']?>" onclick="return confirm('Are you sure you want to delete this item?');">DELETE</a><br>
									

									</td>
								</tr>
								<? } ?>	
							</tbody>
						</table>
					</div>
				</div> -->
				

			</div>
			<?php include('include/footer.php'); ?>
		</div>
	</div>
	<?php include('include/script.php'); ?>

	<script src="src/plugins/datatables/media/js/jquery.dataTables.min.js"></script>
	<script src="src/plugins/datatables/media/js/dataTables.bootstrap4.js"></script>
	<script src="src/plugins/datatables/media/js/dataTables.responsive.js"></script>
	<script src="src/plugins/datatables/media/js/responsive.bootstrap4.js"></script>
	<!-- buttons for Export datatable -->
	<script src="src/plugins/datatables/media/js/button/dataTables.buttons.js"></script>
	<script src="src/plugins/datatables/media/js/button/buttons.bootstrap4.js"></script>
	<script src="src/plugins/datatables/media/js/button/buttons.print.js"></script>
	<script src="src/plugins/datatables/media/js/button/buttons.html5.js"></script>
	<script src="src/plugins/datatables/media/js/button/buttons.flash.js"></script>
	<script src="src/plugins/datatables/media/js/button/pdfmake.min.js"></script>
	<script src="src/plugins/datatables/media/js/button/vfs_fonts.js"></script>
	<script>
		$('document').ready(function(){
			$('.data-table').DataTable({
				scrollCollapse: true,
				autoWidth: false,
				responsive: true,
				columnDefs: [{
					targets: "datatable-nosort",
					orderable: false,
				}],
				"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],
				"language": {
					"info": "_START_-_END_ of _TOTAL_ entries",
					searchPlaceholder: "Search"
				},
			});
			$('.data-table-export').DataTable({
				scrollCollapse: true,
				autoWidth: false,
				responsive: true,
				columnDefs: [{
					targets: "datatable-nosort",
					orderable: false,
				}],
				"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],
				"language": {
					"info": "_START_-_END_ of _TOTAL_ entries",
					searchPlaceholder: "Search"
				},
				dom: 'Bfrtip',
				buttons: [
				'copy', 'csv', 'pdf', 'print'
				]
			});
			var table = $('.select-row').DataTable();
			$('.select-row tbody').on('click', 'tr', function () {
				if ($(this).hasClass('selected')) {
					$(this).removeClass('selected');
				}
				else {
					table.$('tr.selected').removeClass('selected');
					$(this).addClass('selected');
				}
			});
			var multipletable = $('.multiple-select-row').DataTable();
			$('.multiple-select-row tbody').on('click', 'tr', function () {
				$(this).toggleClass('selected');
			});
		});
	</script>
</body>
</html>