<?php
session_start();
error_reporting(1);
include('includes/config.php');
include('includes/db.php');



if (strlen($_SESSION['adminlogin']) == 0) {
	header('location:index.php');
} else {

	if (isset($_POST['submit1'])) {
		$notice = $_POST['notice1'];
		$id = 1;
	} else if (isset($_POST['submit2'])) {
		$notice = $_POST['notice2'];
		$id = 2;
	} else if (isset($_POST['submit3'])) {
		$notice = $_POST['notice3'];
		$id = 3;
	} else if (isset($_POST['submit4'])) {
		$notice = $_POST['notice4'];
		$id = 4;
	} else if (isset($_POST['submit5'])) {
		$notice = $_POST['notice5'];
		$id = 5;
	} else if (isset($_POST['submit6'])) {
		$notice = $_POST['notice6'];
		$id = 6;
	} else if (isset($_POST['submit7'])) {
		$notice = $_POST['notice7'];
		$id = 7;
	} else if (isset($_POST['submit8'])) {
		$notice = $_POST['notice8'];
		$id = 8;
	} else if (isset($_POST['submit9'])) {
		$notice = $_POST['notice9'];
		$id = 9;
	} else if (isset($_POST['submit10'])) {
		$notice = $_POST['notice10'];
		$id = 10;
	} else {
		// echo "failed";
	}



	if (isset($_POST['update1'])) {
		$update = $_POST['notice1'];
		$id = 1;
	} else if (isset($_POST['update2'])) {
		$update = $_POST['notice2'];
		$id = 2;
	} else if (isset($_POST['update3'])) {
		$update = $_POST['notice3'];
		$id = 3;
	} else if (isset($_POST['update4'])) {
		$update = $_POST['notice4'];
		$id = 4;
	} else if (isset($_POST['update5'])) {
		$update = $_POST['notice5'];
		$id = 5;
	} else if (isset($_POST['update6'])) {
		$update = $_POST['notice6'];
		$id = 6;
	} else if (isset($_POST['update7'])) {
		$update = $_POST['notice7'];
		$id = 7;
	} else if (isset($_POST['update8'])) {
		$update = $_POST['notice8'];
		$id = 8;
	} else if (isset($_POST['update9'])) {
		$update = $_POST['notice9'];
		$id = 9;
	} else if (isset($_POST['update10'])) {
		$update = $_POST['notice10'];
		$id = 10;
	} else {
		// echo "failed";
	}

	if (isset($notice)) {

		$sql2 = "UPDATE notice SET notice='$notice' WHERE id = 1";
		if ($result = mysqli_query($link, $sql2)) {

			$msg = "Notice publish Successfully";
		}
	} else if (isset($update)) {

		$sql2 = "UPDATE notice SET notice='$update' WHERE id ='$id'";
		if ($result = mysqli_query($link, $sql2)) {

			$msg = "Notice Update Successfully";
		}
	} else {
		// echo "failed";
	}

	//---------------------------
	
	if (isset($_POST['cc_bio_on'])) {
        $sql2 = 'UPDATE control SET cc_bio_control=1 WHERE id = 1';
        if ($result = mysqli_query($link, $sql2)) {
            $msg1 = 'Turned ON';
        }
    } elseif (isset($_POST['cc_bio_off'])) {
        $sql2 = 'UPDATE control SET cc_bio_control=0 WHERE id = 1';
        if ($result = mysqli_query($link, $sql2)) {
            $msg1 = 'Turned OFF';
        }
    }

    if (isset($_POST['cc_sign_on'])) {
        $sql2 = 'UPDATE control SET cc_sign_control=1 WHERE id = 1';
        if ($result = mysqli_query($link, $sql2)) {
            $msg1 = 'Turned ON';
        }
    } elseif (isset($_POST['cc_sign_off'])) {
        $sql2 = 'UPDATE control SET cc_sign_control=0 WHERE id = 1';
        if ($result = mysqli_query($link, $sql2)) {
            $msg1 = 'Turned OFF';
        }
    }
    
    if (isset($_POST['cc_tin_on'])) {
        $sql2 = 'UPDATE control SET cc_sign_control=1 WHERE id = 1';
        if ($result = mysqli_query($link, $sql2)) {
            $msg1 = 'Turned ON';
        }
    } elseif (isset($_POST['cc_tin_off'])) {
        $sql2 = 'UPDATE control SET cc_sign_control=0 WHERE id = 1';
        if ($result = mysqli_query($link, $sql2)) {
            $msg1 = 'Turned OFF';
        }
    }



    if (isset($_POST['cc_server_on'])) {
        $sql2 = 'UPDATE control SET cc_server_control=1 WHERE id = 1';
        if ($result = mysqli_query($link, $sql2)) {
            $msg1 = 'Turned ON';
        }
    } elseif (isset($_POST['cc_server_off'])) {
        $sql2 = 'UPDATE control SET cc_server_control=0 WHERE id = 1';
        if ($result = mysqli_query($link, $sql2)) {
            $msg1 = 'Turned OFF';
        }
    }

    if (isset($_POST['cc_card_on'])) {
        $sql2 = 'UPDATE control SET cc_card_control=1 WHERE id = 1';
        if ($result = mysqli_query($link, $sql2)) {
            $msg1 = 'Turned ON';
        }
    } elseif (isset($_POST['cc_card_off'])) {
        $sql2 = 'UPDATE control SET cc_card_control=0 WHERE id = 1';
        if ($result = mysqli_query($link, $sql2)) {
            $msg1 = 'Turned OFF';
        }
    }


	// Price Update Settings by KD (START). 
	
    if (isset($_POST['cc_card_make_control'])) {
        $price = $_POST['cc_card_make_price'];
        $sql = "UPDATE control SET cc_card_make_price=$price WHERE id = 1";
        if ($result = mysqli_query($link, $sql)) {
            $msg1 = "Price seted to $price";
        }
    }

	if (isset($_POST['cc_sign2server_control'])) {
        $price = $_POST['cc_sign2server_price'];
        $sql = "UPDATE control SET cc_sign2server_price=$price WHERE id = 1";
        if ($result = mysqli_query($link, $sql)) {
            $msg1 = "Price seted to $price";
        }
    }

	if (isset($_POST['cc_server_unofficial_control'])) {
        $price = $_POST['cc_server_unofficial_price'];
        $sql = "UPDATE control SET cc_server_unofficial_price=$price WHERE id = 1";
        if ($result = mysqli_query($link, $sql)) {
            $msg1 = "Price seted to $price";
        }
    }
    
    if (isset($_POST['cc_bio_control'])) {
        $price = $_POST['cc_bio_price'];
        $sql = "UPDATE control SET cc_bio_price=$price WHERE id = 1";
        if ($result = mysqli_query($link, $sql)) {
            $msg1 = "Price seted to $price";
        }
    }


	if (isset($_POST['cc_sign_control'])) {
        $price = $_POST['cc_sign_price'];
        $sql = "UPDATE control SET cc_sign_price=$price WHERE id = 1";
        if ($result = mysqli_query($link, $sql)) {
            $msg1 = "Price seted to $price";
        }
    }
    
    if (isset($_POST['cc_tin_control'])) {
        $price = $_POST['cc_tin_price'];
        $sql = "UPDATE control SET cc_tin_price=$price WHERE id = 1";
        if ($result = mysqli_query($link, $sql)) {
            $msg1 = "Price seted to $price";
        }
    }

    if (isset($_POST['cc_server_control'])) {
        $price = $_POST['cc_server_price'];
        $sql = "UPDATE control SET cc_server_price=$price WHERE id = 1";
        if ($result = mysqli_query($link, $sql)) {
            $msg1 = "Price seted to $price";
        }
    }

    if (isset($_POST['cc_card_control'])) {
        $price = $_POST['cc_card_price'];
        $sql = "UPDATE control SET cc_card_price=$price WHERE id = 1";
        if ($result = mysqli_query($link, $sql)) {
            $msg1 = "Price seted to $price";
        }
    }

	if (isset($_POST['tin_control'])) {
        $price = $_POST['tin'];
        $sql = "UPDATE control SET tin=$price WHERE id = 1";
        if ($result = mysqli_query($link, $sql)) {
            $msg1 = "Price seted to $price";
        }
    }

    // Price Update Settings by KD (END).


	// Services Turn ON/OFF (Start)
	
	if (isset($_POST['cc_bio_on'])) {
        $sql2 = 'UPDATE control SET cc_bio_control=1 WHERE id = 1';
        if ($result = mysqli_query($link, $sql2)) {
            $msg1 = 'Turned ON';
        }
    } elseif (isset($_POST['cc_bio_off'])) {
        $sql2 = 'UPDATE control SET cc_bio_control=0 WHERE id = 1';
        if ($result = mysqli_query($link, $sql2)) {
            $msg1 = 'Turned OFF';
        }
    }


    if (isset($_POST['cc_sign_on'])) {
        $sql2 = 'UPDATE control SET cc_sign_control=1 WHERE id = 1';
        if ($result = mysqli_query($link, $sql2)) {
            $msg1 = 'Turned ON';
        }
    } elseif (isset($_POST['cc_sign_off'])) {
        $sql2 = 'UPDATE control SET cc_sign_control=0 WHERE id = 1';
        if ($result = mysqli_query($link, $sql2)) {
            $msg1 = 'Turned OFF';
        }
    }

    if (isset($_POST['cc_server_on'])) {
        $sql2 = 'UPDATE control SET cc_server_control=1 WHERE id = 1';
        if ($result = mysqli_query($link, $sql2)) {
            $msg1 = 'Turned ON';
        }
    } elseif (isset($_POST['cc_server_off'])) {
        $sql2 = 'UPDATE control SET cc_server_control=0 WHERE id = 1';
        if ($result = mysqli_query($link, $sql2)) {
            $msg1 = 'Turned OFF';
        }
    }

    if (isset($_POST['cc_card_on'])) {
        $sql2 = 'UPDATE control SET cc_card_control=1 WHERE id = 1';
        if ($result = mysqli_query($link, $sql2)) {
            $msg1 = 'Turned ON';
        }
    } elseif (isset($_POST['cc_card_off'])) {
        $sql2 = 'UPDATE control SET cc_card_control=0 WHERE id = 1';
        if ($result = mysqli_query($link, $sql2)) {
            $msg1 = 'Turned OFF';
        }
    }
    
    if (isset($_POST['cc_bio_control'])) {
        $price = $_POST['cc_bio_price'];
        $sql = "UPDATE control SET cc_bio_price=$price WHERE id = 1";
        if ($result = mysqli_query($link, $sql)) {
            $msg1 = "Price seted to $price";
        }
    }

    if (isset($_POST['cc_sign_control'])) {
        $price = $_POST['cc_sign_price'];
        $sql = "UPDATE control SET cc_sign_price=$price WHERE id = 1";
        if ($result = mysqli_query($link, $sql)) {
            $msg1 = "Price seted to $price";
        }
    }

    if (isset($_POST['cc_server_control'])) {
        $price = $_POST['cc_server_price'];
        $sql = "UPDATE control SET cc_server_price=$price WHERE id = 1";
        if ($result = mysqli_query($link, $sql)) {
            $msg1 = "Price seted to $price";
        }
    }

    if (isset($_POST['cc_card_control'])) {
        $price = $_POST['cc_card_price'];
        $sql = "UPDATE control SET cc_card_price=$price WHERE id = 1";
        if ($result = mysqli_query($link, $sql)) {
            $msg1 = "Price seted to $price";
        }
    }

	// Services Turn ON/OFF (End)



	if (isset($_POST['signServerSettings'])) {
		$serverAndSignCharge = $_POST['serverAndSignCharge'];
		$sql2 = "UPDATE control SET serverAndSign=$serverAndSignCharge WHERE id = 1";
		if ($result = mysqli_query($link, $sql2)) {

			$msg1 = "Price seted to $serverAndSignCharge";
		}
	} 
	
	if (isset($_POST['nid2numbersSettings'])) {
		$serverAndSignCharge = $_POST['nid2numbersCharge'];
		$sql2 = "UPDATE control SET nid2numbers=$serverAndSignCharge WHERE id = 1";
		if ($result = mysqli_query($link, $sql2)) {

			$msg1 = "Price seted to $serverAndSignCharge";
		}
	} 
	
	if (isset($_POST['biomatricSettings'])) {
		$serverAndSignCharge = $_POST['biomatricCharge'];
		$sql2 = "UPDATE control SET biomatric=$serverAndSignCharge WHERE id = 1";
		if ($result = mysqli_query($link, $sql2)) {

			$msg1 = "Price seted to $serverAndSignCharge";
		}
	} 
	
	if (isset($_POST['tinSettings'])) {
		$serverAndSignCharge = $_POST['tinCharge'];
		$sql2 = "UPDATE control SET tin=$serverAndSignCharge WHERE id = 1";
		if ($result = mysqli_query($link, $sql2)) {

			$msg1 = "Price seted to $serverAndSignCharge";
		}
	} 
	

	if (isset($_POST['ton'])) {
		$sql2 = "UPDATE control SET reg=1 WHERE id = 1";
		if ($result = mysqli_query($link, $sql2)) {

			$msg1 = "Turned ON";
		}
	} else if (isset($_POST['toff'])) {
		$sql2 = "UPDATE control SET reg=0 WHERE id = 1";
		if ($result = mysqli_query($link, $sql2)) {

			$msg1 = "Turned OFF";
		}
	}

	if (isset($_POST['tonss'])) {
		$sql2 = "UPDATE control SET ssorder=1 WHERE id = 1";
		if ($result = mysqli_query($link, $sql2)) {

			$msg1 = "Turned ON";
		}
	} else if (isset($_POST['toffss'])) {
		$sql2 = "UPDATE control SET ssorder=0 WHERE id = 1";
		if ($result = mysqli_query($link, $sql2)) {

			$msg1 = "Turned OFF";
		}
	}
	
	
	if (isset($_POST['onreg'])) {
		$sql2 = "UPDATE control SET reg=1 WHERE id = 1";
		if ($result = mysqli_query($link, $sql2)) {

			$msg1 = "Turned ON";
		}
	} else if (isset($_POST['offreg'])) {
		$sql2 = "UPDATE control SET reg=0 WHERE id = 1";
		if ($result = mysqli_query($link, $sql2)) {

			$msg1 = "Turned OFF";
		}
	}


	if (isset($_POST['rmsg'])) {
		$rmsg = $_POST['rmsg'];
		$sql2 = "UPDATE control SET msg='$rmsg' WHERE id = 1";
		if ($result = mysqli_query($link, $sql2)) {

			$msg1 = "Succesfully updated Recharge msg";
		}
	}
	if (isset($_POST['minr'])) {
		$minr = $_POST['minr'];
		$sql2 = "UPDATE control SET minr='$minr' WHERE id = 1";
		if ($result = mysqli_query($link, $sql2)) {

			$msg1 = "Succesfully updated Minmum Recharge Amount";
		}
	}
	if (isset($_POST['charge'])) {
		$cost = $_POST['charge'];
		$sql2 = "UPDATE control SET cost='$cost' WHERE id = 1";
		if ($result = mysqli_query($link, $sql2)) {

			$msg1 = "Succesfully updated Charge";
		}
	}
	
	
	
	
	if (isset($_POST['serverUnOffCostUpdate'])) {
		$serverUnOffCost = $_POST['serverUnOffCost'];
		$sql2 = "UPDATE control SET serverUnOffCost='$serverUnOffCost' WHERE id = 1";
		if ($result = mysqli_query($link, $sql2)) {

			$msg1 = "Succesfully updated Charge $serverUnOffCost";
		}
	}
	
	if (isset($_POST['birthCardCostUpdate'])) {
		$birthCardCost = $_POST['birthCardCost'];
		$sql2 = "UPDATE control SET birthCardCost='$birthCardCost' WHERE id = 1";
		if ($result = mysqli_query($link, $sql2)) {

			$msg1 = "Succesfully updated Charge $birthCardCost ";
		}
	}
}




?>

<!doctype html>
<html lang="en" class="no-js">

<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
	<meta name="description" content="">
	<meta name="author" content="">
	<meta name="theme-color" content="#3e454c">

	<title>Notice Bord</title>

	<!-- Font awesome -->
	<link rel="stylesheet" href="css/font-awesome.min.css">
	<!-- Sandstone Bootstrap CSS -->
	<link rel="stylesheet" href="css/bootstrap.min.css">
	<!-- Admin Stye -->
	<link rel="stylesheet" href="css/style.css">

	<script type="text/javascript" src="../vendor/countries.js"></script>
	<style>
		.errorWrap {
			padding: 10px;
			margin: 0 0 20px 0;
			background: #dd3d36;
			color: #fff;
			-webkit-box-shadow: 0 1px 1px 0 rgba(0, 0, 0, .1);
			box-shadow: 0 1px 1px 0 rgba(0, 0, 0, .1);
		}

		.succWrap {
			padding: 10px;
			margin: 0 0 20px 0;
			background: #5cb85c;
			color: #fff;
			-webkit-box-shadow: 0 1px 1px 0 rgba(0, 0, 0, .1);
			box-shadow: 0 1px 1px 0 rgba(0, 0, 0, .1);
		}

		.btn {
			padding: 13px 46px;
		}
	</style>


</head>

<body>
	<?php
	$sql = "SELECT * from users;";
	$query = $dbh->prepare($sql);
	$query->execute();
	$result = $query->fetch(PDO::FETCH_OBJ);
	$cnt = 1;
	?>
	<?php include('includes/header.php'); ?>
	<div class="ts-main-content">
		<?php include('includes/leftbar.php'); ?>
		<div class="content-wrapper">
			<div class="container-fluid">
				<div class="row">
					<div class="col-md-12">
						<div class="row">

							<div class="col-md-12">
								<h2>Control Panel</h2>
								<div class="panel panel-default">
									<div class="panel-heading">Edit Info</div>
									<?php if ($error) { ?><div class="errorWrap"><strong>ERROR</strong>:<?php echo htmlentities($error); ?> </div><?php } else if ($msg1) { ?><div class="succWrap"><strong>SUCCESS</strong>:<?php echo htmlentities($msg1); ?> </div><?php } ?>

									<div class="panel-body">

										<!-- Card Making Charge Start -->
										<?php
											$sql = "SELECT * FROM control WHERE id='1'";
											if ($result = mysqli_query($link, $sql)) {
												if (mysqli_num_rows($result) > 0) {
													while ($row = mysqli_fetch_array($result)) {
														$cc_card_make_price = $row['cc_card_make_price'];
													}
												}
											} 
										?>
										
										<form method="post" class="form-horizontal" enctype="multipart/form-data">
											<div class="form-group">
												<label class="col-sm-2 control-label">Card Making Price</label>
												<div class="col-sm-6">
													<input type="number" name="cc_card_make_price" class="form-control" value="<?php echo $cc_card_make_price; ?>">
												</div>
												<div class="col-sm-8 col-lg-2  ">
													<button class="btn btn-primary" name="cc_card_make_control" type="submit">Save</button>
												</div>
												<div class="col-sm-8 col-lg-2  "> </div>
											</div>
											<input type="hidden" name="editid" class="form-control" required value="<?php echo htmlentities($result->id); ?>">
										</form>

										<!-- Card Making Charge End -->
										
										<!-- Sign to Server Price Start -->

										<?php
											$sql = "SELECT * FROM control WHERE id='1'";
											if ($result = mysqli_query($link, $sql)) {
												if (mysqli_num_rows($result) > 0) {
													while ($row = mysqli_fetch_array($result)) {
														$cc_sign2server_price = $row['cc_sign2server_price'];
													}
												}
											} 
										?>
										<form method="post" class="form-horizontal" enctype="multipart/form-data">
											<div class="form-group">
												<label class="col-sm-2 control-label">Nid Search Price</label>
												<div class="col-sm-6">
													<input type="number" name="cc_sign2server_price" class="form-control" value="<?php echo $cc_sign2server_price; ?>">
												</div>
												<div class="col-sm-8 col-lg-2  ">
													<button class="btn btn-primary" name="cc_sign2server_control" type="submit">Save</button>
												</div>
												<div class="col-sm-8 col-lg-2  "> </div>
											</div>
											<input type="hidden" name="editid" class="form-control" required value="<?php echo htmlentities($result->id); ?>">
										</form>

										<!---Sign to Server Price End -->

										<!-- Server (Un Official) Price Start -->

										<?php
											$sql = "SELECT * FROM control WHERE id='1'";
											if ($result = mysqli_query($link, $sql)) {
												if (mysqli_num_rows($result) > 0) {
													while ($row = mysqli_fetch_array($result)) {
														$cc_server_unofficial_price = $row['cc_server_unofficial_price'];
													}
												}
											} 
										?>
										
										<form method="post" class="form-horizontal" enctype="multipart/form-data">
											<div class="form-group">
												<label class="col-sm-2 control-label">Server Copy Price</label>
												<div class="col-sm-6">
													<input type="number" name="cc_server_unofficial_price" class="form-control" value="<?php echo $cc_server_unofficial_price; ?>">
												</div>
												<div class="col-sm-8 col-lg-2  ">
													<button class="btn btn-primary" name="cc_server_unofficial_control" type="submit">Save</button>
												</div>
												<div class="col-sm-8 col-lg-2  "> </div>
											</div>
											<input type="hidden" name="editid" class="form-control" required value="<?php echo htmlentities($result->id); ?>">
										</form>

										<!-- Server (Un Official) Price End -->
										
										<!-- SIGN ON/OFF (Start) -->
										<?php 
											$sql = "SELECT * FROM control WHERE id='1'";
											if ($result = mysqli_query($link, $sql)) {
												if (mysqli_num_rows($result) > 0) {
													while ($row = mysqli_fetch_array($result)) {
														$apr = $row['cc_sign_control'];
														if ($apr == 1) {
															$st = "Sign ON";
														} else {
															$st = "Sign OFF";
														}
													}
												}
											} 
										?>
										<!--
										<form method="post" class="form-horizontal" enctype="multipart/form-data">

											<div class="form-group">
												<label class="col-sm-2 control-label">Sign</label>
												<div class="col-sm-6">
													<input type="text" name="sign_on_off" class="form-control" disabled style=" background: none;" value="<?php echo $st; ?>">
												</div>
												<div class="col-sm-8 col-lg-2  ">
													<?php $sql = "SELECT * FROM control WHERE id='1'";
													if ($result = mysqli_query($link, $sql)) {
														if (mysqli_num_rows($result) > 0) {
															while ($row = mysqli_fetch_array($result)) {
																$apr = $row['cc_sign_control'];
																if ($apr == 0) {
																	echo "<button class='btn btn-success'  name='cc_sign_on' type='submit'>Turn ON</button>";
																} else {
																	echo "<button class='btn btn-danger'  name='cc_sign_off' type='submit'>Turn OFF</button>";
																}
															}
														}
													}  ?>
												</div>
											</div>

											<input type="hidden" name="editid" class="form-control" required value="<?php echo htmlentities($result->id); ?>">
										</form>
										
										<!-- SIGN ON/OFF (END) -->

										<!-- Sign Copy Price Start -->

										<?php
											$sql = "SELECT * FROM control WHERE id='1'";
											if ($result = mysqli_query($link, $sql)) {
												if (mysqli_num_rows($result) > 0) {
													while ($row = mysqli_fetch_array($result)) {
														$cc_sign_price = $row['cc_sign_price'];
													}
												}
											} 
										?>
										<!--
										<form method="post" class="form-horizontal" enctype="multipart/form-data">
											<div class="form-group">
												<label class="col-sm-2 control-label">Sign Price</label>
												<div class="col-sm-6">
													<input type="number" name="cc_sign_price" class="form-control" value="<?php echo $cc_sign_price; ?>">
												</div>
												<div class="col-sm-8 col-lg-2  ">
													<button class="btn btn-primary" name="cc_sign_control" type="submit">Save</button>
												</div>
												<div class="col-sm-8 col-lg-2  "> </div>
											</div>
											<input type="hidden" name="editid" class="form-control" required value="<?php echo htmlentities($result->id); ?>">
										</form>

										<!-- Sign Copy Price End -->

										<!-- Server ON/OFF (Start) -->
										<?php 
											$sql = "SELECT * FROM control WHERE id='1'";
											if ($result = mysqli_query($link, $sql)) {
												if (mysqli_num_rows($result) > 0) {
													while ($row = mysqli_fetch_array($result)) {
														$apr = $row['cc_sign_control'];
														if ($apr == 1) {
															$st = "server ON";
														} else {
															$st = "server OFF";
														}
													}
												}
											} 
										?>
										<!--
										<form method="post" class="form-horizontal" enctype="multipart/form-data">

											<div class="form-group">
												<label class="col-sm-2 control-label">Server</label>
												<div class="col-sm-6">
													<input type="text" name="server_on_off" class="form-control" disabled style=" background: none;" value="<?php echo $st; ?>">
												</div>
												<div class="col-sm-8 col-lg-2  ">
													<?php $sql = "SELECT * FROM control WHERE id='1'";
													if ($result = mysqli_query($link, $sql)) {
														if (mysqli_num_rows($result) > 0) {
															while ($row = mysqli_fetch_array($result)) {
																$apr = $row['cc_server_control'];
																if ($apr == 0) {
																	echo "<button class='btn btn-success'  name='cc_server_on' type='submit'>Turn ON</button>";
																} else {
																	echo "<button class='btn btn-danger'  name='cc_server_off' type='submit'>Turn OFF</button>";
																}
															}
														}
													}  ?>
												</div>
											</div>

											<input type="hidden" name="editid" class="form-control" required value="<?php echo htmlentities($result->id); ?>">
										</form>
										
										<!-- server ON/OFF (END) -->

										<!-- server Copy Price Start -->

										<?php
											$sql = "SELECT * FROM control WHERE id='1'";
											if ($result = mysqli_query($link, $sql)) {
												if (mysqli_num_rows($result) > 0) {
													while ($row = mysqli_fetch_array($result)) {
														$cc_server_price = $row['cc_server_price'];
													}
												}
											} 
										?>
										<!--
										<form method="post" class="form-horizontal" enctype="multipart/form-data">
											<div class="form-group">
												<label class="col-sm-2 control-label">Server Price</label>
												<div class="col-sm-6">
													<input type="number" name="cc_server_price" class="form-control" value="<?php echo $cc_server_price; ?>">
												</div>
												<div class="col-sm-8 col-lg-2  ">
													<button class="btn btn-primary" name="cc_server_control" type="submit">Save</button>
												</div>
												<div class="col-sm-8 col-lg-2  "> </div>
											</div>
											<input type="hidden" name="editid" class="form-control" required value="<?php echo htmlentities($result->id); ?>">
										</form>

										<!-- server Copy Price End -->

										<!-- card ON/OFF (Start) -->
										<?php 
											$sql = "SELECT * FROM control WHERE id='1'";
											if ($result = mysqli_query($link, $sql)) {
												if (mysqli_num_rows($result) > 0) {
													while ($row = mysqli_fetch_array($result)) {
														$apr = $row['cc_sign_control'];
														if ($apr == 1) {
															$st = "card ON";
														} else {
															$st = "card OFF";
														}
													}
												}
											} 
										?>
										<!--
										<form method="post" class="form-horizontal" enctype="multipart/form-data">

											<div class="form-group">
												<label class="col-sm-2 control-label">Card</label>
												<div class="col-sm-6">
													<input type="text" name="card_on_off" class="form-control" disabled style=" background: none;" value="<?php echo $st; ?>">
												</div>
												<div class="col-sm-8 col-lg-2  ">
													<?php $sql = "SELECT * FROM control WHERE id='1'";
													if ($result = mysqli_query($link, $sql)) {
														if (mysqli_num_rows($result) > 0) {
															while ($row = mysqli_fetch_array($result)) {
																$apr = $row['cc_card_control'];
																if ($apr == 0) {
																	echo "<button class='btn btn-success'  name='cc_card_on' type='submit'>Turn ON</button>";
																} else {
																	echo "<button class='btn btn-danger'  name='cc_card_off' type='submit'>Turn OFF</button>";
																}
															}
														}
													}  ?>
												</div>
											</div>

											<input type="hidden" name="editid" class="form-control" required value="<?php echo htmlentities($result->id); ?>">
										</form>
										
										<!-- card ON/OFF (END) -->

										<!-- card Copy Price Start -->

										<?php
											$sql = "SELECT * FROM control WHERE id='1'";
											if ($result = mysqli_query($link, $sql)) {
												if (mysqli_num_rows($result) > 0) {
													while ($row = mysqli_fetch_array($result)) {
														$cc_card_price = $row['cc_card_price'];
													}
												}
											} 
										?>
										
										<form method="post" class="form-horizontal" enctype="multipart/form-data">
											<div class="form-group">
												<label class="col-sm-2 control-label">Birth Registrar Price</label>
												<div class="col-sm-6">
													<input type="number" name="cc_card_price" class="form-control" value="<?php echo $cc_card_price; ?>">
												</div>
												<div class="col-sm-8 col-lg-2  ">
													<button class="btn btn-primary" name="cc_card_control" type="submit">Save</button>
												</div>
												<div class="col-sm-8 col-lg-2  "> </div>
											</div>
											<input type="hidden" name="editid" class="form-control" required value="<?php echo htmlentities($result->id); ?>">
										</form>

										<!-- card Copy Price End -->
										
											<!-- bio ON/OFF (Start) -->
										<?php 
											$sql = "SELECT * FROM control WHERE id='1'";
											if ($result = mysqli_query($link, $sql)) {
												if (mysqli_num_rows($result) > 0) {
													while ($row = mysqli_fetch_array($result)) {
														$apr = $row['cc_bio_control'];
														if ($apr == 1) {
															$st = "bio ON";
														} else {
															$st = "bio OFF";
														}
													}
												}
											} 
										?>
										
										
										
										<form method="post" class="form-horizontal" enctype="multipart/form-data">

											<div class="form-group">
												<label class="col-sm-2 control-label">bio</label>
												<div class="col-sm-6">
													<input type="text" name="bio_on_off" class="form-control" disabled style=" background: none;" value="<?php echo $st; ?>">
												</div>
												<div class="col-sm-8 col-lg-2  ">
													<?php $sql = "SELECT * FROM control WHERE id='1'";
													if ($result = mysqli_query($link, $sql)) {
														if (mysqli_num_rows($result) > 0) {
															while ($row = mysqli_fetch_array($result)) {
																$apr = $row['cc_bio_control'];
																if ($apr == 0) {
																	echo "<button class='btn btn-success'  name='cc_bio_on' type='submit'>Turn ON</button>";
																} else {
																	echo "<button class='btn btn-danger'  name='cc_bio_off' type='submit'>Turn OFF</button>";
																}
															}
														}
													}  ?>
												</div>
											</div>

											<input type="hidden" name="editid" class="form-control" required value="<?php echo htmlentities($result->id); ?>">
										</form>
										
										<!-- bio ON/OFF (END) -->

										
										<!-- Bio Price Start -->

										<?php
											$sql = "SELECT * FROM control WHERE id='1'";
											if ($result = mysqli_query($link, $sql)) {
												if (mysqli_num_rows($result) > 0) {
													while ($row = mysqli_fetch_array($result)) {
														$cc_bio_price = $row['cc_bio_price'];
													}
												}
											} 
										?>
										
										<form method="post" class="form-horizontal" enctype="multipart/form-data">
											<div class="form-group">
												<label class="col-sm-2 control-label">Bio Price</label>
												<div class="col-sm-6">
													<input type="number" name="cc_bio_price" class="form-control" value="<?php echo $cc_bio_price; ?>">
												</div>
												<div class="col-sm-8 col-lg-2  ">
													<button class="btn btn-primary" name="cc_bio_control" type="submit">Save</button>
												</div>
												<div class="col-sm-8 col-lg-2  "> </div>
											</div>
											<input type="hidden" name="editid" class="form-control" required value="<?php echo htmlentities($result->id); ?>">
										</form>

										<!-- Bio Price End -->
										
										
																				<!-- SIGN ON/OFF (Start) -->
										<?php 
											$sql = "SELECT * FROM control WHERE id='1'";
											if ($result = mysqli_query($link, $sql)) {
												if (mysqli_num_rows($result) > 0) {
													while ($row = mysqli_fetch_array($result)) {
														$apr = $row['cc_sign_control'];
														if ($apr == 1) {
															$st = "Sign ON";
														} else {
															$st = "Sign OFF";
														}
													}
												}
											} 
										?>
										
										<form method="post" class="form-horizontal" enctype="multipart/form-data">

											<div class="form-group">
												<label class="col-sm-2 control-label">Sign</label>
												<div class="col-sm-6">
													<input type="text" name="sign_on_off" class="form-control" disabled style=" background: none;" value="<?php echo $st; ?>">
												</div>
												<div class="col-sm-8 col-lg-2  ">
													<?php $sql = "SELECT * FROM control WHERE id='1'";
													if ($result = mysqli_query($link, $sql)) {
														if (mysqli_num_rows($result) > 0) {
															while ($row = mysqli_fetch_array($result)) {
																$apr = $row['cc_sign_control'];
																if ($apr == 0) {
																	echo "<button class='btn btn-success'  name='cc_sign_on' type='submit'>Turn ON</button>";
																} else {
																	echo "<button class='btn btn-danger'  name='cc_sign_off' type='submit'>Turn OFF</button>";
																}
															}
														}
													}  ?>
												</div>
											</div>

											<input type="hidden" name="editid" class="form-control" required value="<?php echo htmlentities($result->id); ?>">
										</form>
										
										<!-- SIGN ON/OFF (END) -->

										<!-- Sign Copy Price Start -->

										<?php
											$sql = "SELECT * FROM control WHERE id='1'";
											if ($result = mysqli_query($link, $sql)) {
												if (mysqli_num_rows($result) > 0) {
													while ($row = mysqli_fetch_array($result)) {
														$cc_sign_price = $row['cc_sign_price'];
													}
												}
											} 
										?>
										
										<form method="post" class="form-horizontal" enctype="multipart/form-data">
											<div class="form-group">
												<label class="col-sm-2 control-label">Sign Price</label>
												<div class="col-sm-6">
													<input type="number" name="cc_sign_price" class="form-control" value="<?php echo $cc_sign_price; ?>">
												</div>
												<div class="col-sm-8 col-lg-2  ">
													<button class="btn btn-primary" name="cc_sign_control" type="submit">Save</button>
												</div>
												<div class="col-sm-8 col-lg-2  "> </div>
											</div>
											<input type="hidden" name="editid" class="form-control" required value="<?php echo htmlentities($result->id); ?>">
										</form>

										<!-- Sign Copy Price End -->
										

										<!-- TIN Price Start -->

										<?php
											$sql = "SELECT * FROM control WHERE id='1'";
											if ($result = mysqli_query($link, $sql)) {
												if (mysqli_num_rows($result) > 0) {
													while ($row = mysqli_fetch_array($result)) {
														$tin = $row['tin'];
													}
												}
											} 
										?>
										<!--
										<form method="post" class="form-horizontal" enctype="multipart/form-data">
											<div class="form-group">
												<label class="col-sm-2 control-label">TIN Price</label>
												<div class="col-sm-6">
													<input type="number" name="tin" class="form-control" value="<?php echo $tin; ?>">
												</div>
												<div class="col-sm-8 col-lg-2  ">
													<button class="btn btn-primary" name="tin_control" type="submit">Save</button>
												</div>
												<div class="col-sm-8 col-lg-2  "> </div>
											</div>
											<input type="hidden" name="editid" class="form-control" required value="<?php echo htmlentities($result->id); ?>">
										</form>

										<!-- TIN Price End -->

									</div>
								</div>
							</div>

							<div class="col-md-12">
								<h2>Broadcast Notice</h2>
								<div class="panel panel-default">
									<div class="panel-heading">Edit Info</div>
									<?php if ($error) { ?><div class="errorWrap"><strong>ERROR</strong>:<?php echo htmlentities($error); ?> </div><?php } else if ($msg) { ?><div class="succWrap"><strong>SUCCESS</strong>:<?php echo htmlentities($msg); ?> </div><?php } ?>

									<div class="panel-body">
										<form method="post" class="form-horizontal" enctype="multipart/form-data">

											<div class="form-group">
												<label class="col-sm-2 control-label">Notice 1</label>
												<div class="col-sm-6">
													<input style="background: #673ab778;border: 2px solid #00f7be;" type="text" name="notice1" class="form-control" value="<?php $sql = "SELECT * FROM notice WHERE id='1'";
															if ($result = mysqli_query($link, $sql)) {
																if (mysqli_num_rows($result) > 0) {
																	while ($row = mysqli_fetch_array($result)) {
																		echo $row['notice'];
																	}
																}
															}  ?>">
												</div>
												<div class="col-sm-8 col-lg-2  ">
													<button class="btn btn-primary" name="update1" type="submit"> Update</button>
												</div>
												<div class="col-sm-8 col-lg-2  "> </div>
												<!--<div class="col-sm-8 col-lg-2  ">
													<button class="btn btn-primary" name="submit1" type="submit">Publish</button>
												</div>-->
											</div>

											<input type="hidden" name="editid" class="form-control" required value="<?php echo htmlentities($result->id); ?>">



										</form>
<!--
										<form method="post" class="form-horizontal" enctype="multipart/form-data">

											<div class="form-group">
												<label class="col-sm-2 control-label">Notice 2</label>
												<div class="col-sm-6">
													<input type="text" name="notice2" class="form-control" value="<?php $sql = "SELECT * FROM notice WHERE id='2'";
																													if ($result = mysqli_query($link, $sql)) {
																														if (mysqli_num_rows($result) > 0) {
																															while ($row = mysqli_fetch_array($result)) {
																																echo $row['notice'];
																															}
																														}
																													}  ?>">
												</div>
												<div class="col-sm-8 col-lg-2  ">
													<button class="btn btn-primary" name="update2" type="submit"> Update</button>
												</div>
												<div class="col-sm-8 col-lg-2  ">
													<button class="btn btn-primary" name="submit2" type="submit">Publish</button>
												</div>
											</div>


											<input type="hidden" name="editid" class="form-control" required value="<?php echo htmlentities($result->id); ?>">

										</form>

										<form method="post" class="form-horizontal" enctype="multipart/form-data">

											<div class="form-group">
												<label class="col-sm-2 control-label">Notice 3</label>
												<div class="col-sm-6">
													<input type="text" name="notice3" class="form-control" value="<?php $sql = "SELECT * FROM notice WHERE id='3'";
																													if ($result = mysqli_query($link, $sql)) {
																														if (mysqli_num_rows($result) > 0) {
																															while ($row = mysqli_fetch_array($result)) {
																																echo $row['notice'];
																															}
																														}
																													}  ?>">
												</div>
												<div class="col-sm-8 col-lg-2  ">
													<button class="btn btn-primary" name="update3" type="submit"> Update</button>
												</div>
												<div class="col-sm-8 col-lg-2  ">
													<button class="btn btn-primary" name="submit3" type="submit">Publish</button>
												</div>
											</div>


											<input type="hidden" name="editid" class="form-control" required value="<?php echo htmlentities($result->id); ?>">


										</form>

										<form method="post" class="form-horizontal" enctype="multipart/form-data">

											<div class="form-group">
												<label class="col-sm-2 control-label">Notice 4</label>
												<div class="col-sm-6">
													<input type="text" name="notice4" class="form-control" value="<?php $sql = "SELECT * FROM notice WHERE id='4'";
																													if ($result = mysqli_query($link, $sql)) {
																														if (mysqli_num_rows($result) > 0) {
																															while ($row = mysqli_fetch_array($result)) {
																																echo $row['notice'];
																															}
																														}
																													}  ?>">
												</div>
												<div class="col-sm-8 col-lg-2  ">
													<button class="btn btn-primary" name="update4" type="submit"> Update</button>
												</div>
												<div class="col-sm-8 col-lg-2  ">
													<button class="btn btn-primary" name="submit4" type="submit">Publish</button>
												</div>
											</div>


											<input type="hidden" name="editid" class="form-control" required value="<?php echo htmlentities($result->id); ?>">



										</form>

										<form method="post" class="form-horizontal" enctype="multipart/form-data">

											<div class="form-group">
												<label class="col-sm-2 control-label">Notice 5</label>
												<div class="col-sm-6">
													<input type="text" name="notice5" class="form-control" value="<?php $sql = "SELECT * FROM notice WHERE id='5'";
																													if ($result = mysqli_query($link, $sql)) {
																														if (mysqli_num_rows($result) > 0) {
																															while ($row = mysqli_fetch_array($result)) {
																																echo $row['notice'];
																															}
																														}
																													}  ?>">
												</div>
												<div class="col-sm-8 col-lg-2  ">
													<button class="btn btn-primary" name="update5" type="submit"> Update</button>
												</div>
												<div class="col-sm-8 col-lg-2  ">
													<button class="btn btn-primary" name="submit5" type="submit">Publish</button>
												</div>
											</div>


											<input type="hidden" name="editid" class="form-control" required value="<?php echo htmlentities($result->id); ?>">


										</form>

										<form method="post" class="form-horizontal" enctype="multipart/form-data">

											<div class="form-group">
												<label class="col-sm-2 control-label">Notice 6</label>
												<div class="col-sm-6">
													<input type="text" name="notice6" class="form-control" value="<?php $sql = "SELECT * FROM notice WHERE id='6'";
																													if ($result = mysqli_query($link, $sql)) {
																														if (mysqli_num_rows($result) > 0) {
																															while ($row = mysqli_fetch_array($result)) {
																																echo $row['notice'];
																															}
																														}
																													}  ?>">
												</div>
												<div class="col-sm-8 col-lg-2  ">
													<button class="btn btn-primary" name="update6" type="submit"> Update</button>
												</div>
												<div class="col-sm-8 col-lg-2  ">
													<button class="btn btn-primary" name="submit6" type="submit">Publish</button>
												</div>

											</div>

											<input type="hidden" name="editid" class="form-control" required value="<?php echo htmlentities($result->id); ?>">


										</form>

										<form method="post" class="form-horizontal" enctype="multipart/form-data">

											<div class="form-group">
												<label class="col-sm-2 control-label">Notice 7</label>
												<div class="col-sm-6">
													<input type="text" name="notice7" class="form-control" value="<?php $sql = "SELECT * FROM notice WHERE id='7'";
																													if ($result = mysqli_query($link, $sql)) {
																														if (mysqli_num_rows($result) > 0) {
																															while ($row = mysqli_fetch_array($result)) {
																																echo $row['notice'];
																															}
																														}
																													}  ?>">
												</div>
												<div class="col-sm-8 col-lg-2  ">
													<button class="btn btn-primary" name="update7" type="submit"> Update</button>
												</div>
												<div class="col-sm-8 col-lg-2  ">
													<button class="btn btn-primary" name="submit7" type="submit">Publish</button>
												</div>
											</div>

											<input type="hidden" name="editid" class="form-control" required value="<?php echo htmlentities($result->id); ?>">


										</form>

										<form method="post" class="form-horizontal" enctype="multipart/form-data">

											<div class="form-group">
												<label class="col-sm-2 control-label">Notice 8</label>
												<div class="col-sm-6">
													<input type="text" name="notice8" class="form-control" value="<?php $sql = "SELECT * FROM notice WHERE id='8'";
																													if ($result = mysqli_query($link, $sql)) {
																														if (mysqli_num_rows($result) > 0) {
																															while ($row = mysqli_fetch_array($result)) {
																																echo $row['notice'];
																															}
																														}
																													}  ?>">
												</div>
												<div class="col-sm-8 col-lg-2  ">
													<button class="btn btn-primary" name="update8" type="submit"> Update</button>
												</div>
												<div class="col-sm-8 col-lg-2  ">
													<button class="btn btn-primary" name="submit8" type="submit">Publish</button>
												</div>
											</div>


											<input type="hidden" name="editid" class="form-control" required value="<?php echo htmlentities($result->id); ?>">


										</form>

										<form method="post" class="form-horizontal" enctype="multipart/form-data">

											<div class="form-group">
												<label class="col-sm-2 control-label">Notice 9</label>
												<div class="col-sm-6">
													<input type="text" name="notice9" class="form-control" value="<?php $sql = "SELECT * FROM notice WHERE id='9'";
																													if ($result = mysqli_query($link, $sql)) {
																														if (mysqli_num_rows($result) > 0) {
																															while ($row = mysqli_fetch_array($result)) {
																																echo $row['notice'];
																															}
																														}
																													}  ?>">
												</div>
												<div class="col-sm-8 col-lg-2  ">
													<button class="btn btn-primary" name="update9" type="submit"> Update</button>
												</div>
												<div class="col-sm-8 col-lg-2  ">
													<button class="btn btn-primary" name="submit9" type="submit">Publish</button>
												</div>
											</div>


											<input type="hidden" name="editid" class="form-control" required value="<?php echo htmlentities($result->id); ?>">


										</form>

										<form method="post" class="form-horizontal" enctype="multipart/form-data">

											<div class="form-group">
												<label class="col-sm-2 control-label">Notice 10</label>
												<div class="col-sm-6">
													<input type="text" name="notice10" class="form-control" value="<?php $sql = "SELECT * FROM notice WHERE id='10'";
																													if ($result = mysqli_query($link, $sql)) {
																														if (mysqli_num_rows($result) > 0) {
																															while ($row = mysqli_fetch_array($result)) {
																																echo $row['notice'];
																															}
																														}
																													}  ?>">
												</div>
												<div class="col-sm-8 col-lg-2  ">
													<button class="btn btn-primary" name="update10" type="submit"> Update</button>
												</div>
												<div class="col-sm-8 col-lg-2  ">
													<button class="btn btn-primary" name="submit10" type="submit">Publish</button>
												</div>
											</div>


											<input type="hidden" name="editid" class="form-control" required value="<?php echo htmlentities($result->id); ?>">


										</form>
--->
									</div>
								</div>
							</div>
						</div>
								<div class="panel panel-default">
									<div class="panel-heading">Server Copy API</div>
									<div class="panel-body">
										<form method="post" class="form-horizontal" enctype="multipart/form-data">

											<div class="form-group">
												<label class="col-sm-2 control-label">API Balance</label>
												<div class="col-sm-6">
													<input style="background: #00bcd438;bo;border: 2px solid #e91e63ab;font-weight: bold;" readonly type="text" name="notice1" class="form-control" value="<?php $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, 'https://api.friend-wel.xyz/al1NpR1yA7.txt'); curl_setopt($curl, CURLOPT_TIMEOUT, 30); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); echo $contents = curl_exec($curl); curl_close($curl); ?>">
												</div>
											</div>
										</form>
            				</div>
            			</div>
					</div>
				</div>
			</div>
		</div>
	</div>

	<!-- Loading Scripts -->
	<script src="js/jquery.min.js"></script>
	<script src="js/bootstrap.min.js"></script>
	<script src="js/main.js"></script>
	<script type="text/javascript">
		$(document).ready(function() {
			setTimeout(function() {
				$('.succWrap').slideUp("slow");
			}, 3000);
		});
	</script>
</body>

</html>
<?php  ?>