<?php
session_start();
$connect = mysqli_connect("localhost", "root", "", "phppos");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CTP-LOGIN</title>
<link rel="stylesheet" href="assets/css/main.css">
<script src="assets/js/jquery-2.1.1.min.js"></script>
</head>
<body>
<form action="" class="login-form" method="post">
<img src="img/logo.png" alt="">
<div class="txt">
<input type="text" name="username">
<span data-placeholder="Username"></span>
</div>
<div class="txt">
<input type="password" name="password">
<span data-placeholder="Password"></span>
</div>
<input type="submit" name="login" class="logbtn" value="Login">
</form>
<?php
if (isset($_POST["login"])) {
$username = $_POST["username"];
$password = $_POST["password"];
$ambil = $connect->query("SELECT * FROM tbl_users WHERE username='$username' AND password='$password'");
$akunyangcocok = $ambil->num_rows;
if ($akunyangcocok == 1) {
$akun = $ambil->fetch_assoc();
$_SESSION["users"] = $akun;
echo "<script>location='index.php';</script>";
} else {
echo "<script>alert('GAGAL LOGIN');</script>";
echo "<script>location='login.php';</script>";
}
} ?>
<script type="text/javascript">
$(".txt input").on("focus",function(){
$(this).addClass("focus");
});
$(".txt input").on("blur",function(){
if($(this).val() == "")
$(this).removeClass("focus");
});
</script>
</body>
</html>
<?php
session_start();
$level = $_SESSION['users']['level'];
$username = $_SESSION['users']['username'];
if (!isset($_SESSION['users'])) {
echo "<script>location='login.php';</script>";
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CTP-Dashboard</title>
<link rel="shortcut icon" href="img/logo.png">
<link rel="stylesheet" href="assets/css/main-base.css">
<link rel="stylesheet" href="assets/css/font-awesome.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<style>
.navbar-light .navbar-toggler-icon {
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='white' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}
.navbar-toggler {
border: 1px solid white !important;
border-radius: 0;
}
a.navbar-brand,
.navbar-nav a {
color: white !important;
}
.flex-container {
margin-top: 10px;
display: flex;
}
.flex-container>div {
margin: 10px;
padding: 20px;
font-size: 30px;
}
.box {
margin: 0 auto;
width: 150px;
}
</style>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light bg-dark">
<a class="navbar-brand" href="#">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavAltMarkup" aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon">
</button>
<div class="collapse navbar-collapse" id="navbarNavAltMarkup">
<div class="navbar-nav mx-auto">
<center><a href="index.php"><img width="400px" src="img/logo2.png" alt=""></a></center>
</div>
<form class="form-inline my-2 my-lg-0">
<a class="btn btn-outline-light btn-sm my-2 my-sm-0 rounded-0" href="logout.php">Logout
</form>
</div>
</nav>
<div class="flex-container">
<a class="btn btn-lg btn-info box" href="page/customer/customer.php">Customer
<a class="btn btn-lg btn-info box" href="page/produk/produk.php">Input Produk
<a class="btn btn-lg btn-info box" href="page/penjualan/penjualan.php">Penjualan
<a class="btn btn-lg btn-info box" href="page/laporan/laporan.php">Laporan
<a class="btn btn-lg btn-info box" href="page/produk/check_produk.php">Stok Produk
<a class="btn btn-lg btn-info box" href="page/penjualan/penjualan.php">Hitung Gaji
<a class="btn btn-lg btn-info box" href="page/user/user.php">User
<a class="btn btn-lg btn-info box" href="../../biometricattendance/index.php">Absensi
</div>
</body>
</html>
<?php
$id = $_GET['id'];
$con = mysqli_connect("localhost", "root", "", "phppos");
$value="True";
$sq3="UPDATE tbl_invoice SET printstatus = '$value' WHERE id ='$id' ";
?>
<?php
require('../../assets/fpdf/fpdf.php');
include_once'../../koneksi.php';
$id = $_GET['id'];
$select = $pdo->prepare("SELECT * FROM tbl_invoice LEFT JOIN tbl_customer ON tbl_invoice.id_pelanggan = tbl_customer.id_pelanggan WHERE id='$id'");
$select->execute();
$row = $select->fetch(PDO::FETCH_OBJ);
$pdf = new FPDF('P','mm', array(104,165));
$pdf->AddPage();
$pdf->SetFont('Arial','B',16);
$pdf->Cell(86,7,'LANCARMAKMUR',0,1,'C');
// $pdf->Line(10,18,12,18);
$pdf->SetFont('Arial','',9);
$pdf->Cell(86,3,'Kalibaru Timur III No.32A - Jakarta Pusat',0,1,'C');
$pdf->SetFont('Arial','',9);
$pdf->Cell(86,4,'Telp : (021) 4245011 | WA : 0877-8165-5611 ',0,1,'C');
$pdf->SetFont('Arial','',9);
$pdf->Cell(86,3,'Email : lancarctp1@gmail.com | BCA : 870.5212.712 a.n Clarine',0,1,'C');
//$pdf->SetFont('Arial','',9);
//$pdf->Cell(153,4,'BCA : 870.5212.712 a.n Clarine Diana',0,1,'C');
$pdf->Line(8,28,98,28);
$pdf->SetFont('Courier','B',9);
$pdf->Cell(20,7 ,'No. Nota :',0,0,'L');
$pdf->SetFont('Courier','BI',9);
$pdf->Cell(110,7 ,$row->id.' '.$row->order_date .'('.$row->time_order.')' ,0,1,'L');
$pdf->SetFont('Courier','B',9);
$pdf->Cell(20,5 ,'Customer :',0,0,'L');
$pdf->SetFont('Courier','BI',11);
$pdf->Cell(20,5 ,$row->nama,0,1,'L');
$pdf->SetFont('Courier','B',9);
$pdf->Cell(20,5 ,'No Telp :',0,0,'L');
$pdf->SetFont('Courier','BI',9);
$pdf->Cell(20,5 ,$row->no_hp,0,1,'L');
//$pdf->SetFont('Courier','BI',9);
//$pdf->Cell(20,5 ,$row->order_date,0,0,'L');
//$pdf->SetFont('Courier','BI',9);
//$pdf->Cell(20,5,'('.$row->time_order.')',0,0 ,'R');
//////////////////////////////////////////////
$pdf->SetY(43);
$pdf->Line(10,44,96,44);
$pdf->Line(10,50,96,50);
$pdf->SetX(6);
$pdf->SetFont('Arial','B',9);
$pdf->Cell(30,8 ,'Produk',0,0,'C');
$pdf->SetFont('Arial','B',9);
$pdf->Cell(15,8 ,'Qty',0,0,'L');
$pdf->SetFont('Arial','B',9);
$pdf->Cell(25,8 ,'Harga',0,0,'L');
$pdf->SetFont('Arial','B',9);
$pdf->Cell(40,8 ,'Total',0,1,'L');
$select = $pdo->prepare("SELECT * FROM tbl_i WHERE id='$id'");
$select->execute();
while($item = $select->fetch(PDO::FETCH_OBJ)){
$pdf->SetX(10);
$pdf->SetFont('Arial','B',9);
$pdf->Cell(28,5,$item->nama_produk,0,0,'L');
$pdf->SetFont('Arial','B',11);
$pdf->Cell(13,5,$item->jml,0,0,'L');
$pdf->SetFont('Arial','B',10);
$pdf->Cell(14,5,'Rp '.number_format($item->price),0,0,'R');
$pdf->Cell(25,5,'Rp '.number_format($item->subtotal),0,1,'R');
$pdf->Cell(5,3,$item->deskripsi,0,1,'L');
}
//////////////////////////////////////////////
$pdf->SetX(56);
//$pdf->Line(10,60,152,60);
$pdf->SetFont('Arial','Bi',9);
$pdf->Cell(25,8 ,'Total :',0,0,'L');
$pdf->SetFont('Arial','BI',10);
$pdf->Cell(1,8 ,'Rp ' . number_format($row->total),0,1,'C');
$pdf->SetX(56);
$pdf->SetFont('Arial','BI',9);
$pdf->Cell(25,4 ,'Bayar :',0,0,'L');
$pdf->SetFont('Arial','BI',10);
$pdf->Cell(1,4 ,'Rp '. number_format($row->paid),0,1,'C');
$pdf->SetX(56);
$pdf->SetFont('Arial','BI',9);
$pdf->Cell(25,8 ,'Kembali :',0,0,'L');
$pdf->SetFont('Arial','BI',10);
$pdf->Cell(1,8 ,'Rp '. number_format($row->due),0,1,'C');
//////////////////////////////////////////////
$pdf->SetY(56);
$pdf->SetX(7);
$pdf->Output();