<?php session_start(); $page_title = "Tambah Purchase"; include_once $_SERVER['DOCUMENT_ROOT'] . '/pages/header.php'; include_once $_SERVER['DOCUMENT_ROOT'] . '/config/database.php'; include_once $_SERVER['DOCUMENT_ROOT'] . '/objects/purchase.php'; include_once $_SERVER['DOCUMENT_ROOT'] . '/objects/purchasedetail.php'; echo "\t\t\t\t<div class='col-md-3'>"; include_once $_SERVER['DOCUMENT_ROOT'] . '/pages/sidebarmenu.php'; echo "\t\t\t\t</div>"; $database = new database(); $db = $database->getConnection(); $purchase = new purchase($db); $purchasedetail = new purchasedetail($db); $purchase->purchase_id = $purchase->AutoNumber(); include_once $_SERVER['DOCUMENT_ROOT'] . '/objects/supplier.php'; $supplier = new supplier($db); $purchase->supplier_kode = !empty($_SESSION['current_supplier']) ? $_SESSION['current_supplier'] : '-'; $statement = $purchasedetail->ShowTemp($purchase->purchase_id); echo "\t\t\t\t<div class='col-md-9'>"; //echo "<div class='container'>"; echo "<div class='panel panel-default'>"; echo "<div class='panel-body'>"; echo "\t\t\t<div class='row' style='border-bottom: none;'>"; echo "\t\t\t\t<div class='col-md-2'>"; echo "\t\t\t\t\t<label>Purchase ID</label>"; echo "\t\t\t\t</div>"; echo "\t\t\t\t<div class='col-md-2'>"; echo "\t\t\t\t\t<label id='purchase_id' value=" . $purchase->purchase_id . ">: " . $purchase->purchase_id . "</label>"; echo "\t\t\t\t</div>";
<?php // Includng configuration file include 'config/config.php'; //Check user is already login or not checkAuthentication(); $id = $_SESSION['adminid']; $purchase = new purchase(); if (isset($_GET['action']) && $_GET['action'] == 'new') { $smarty->assign('content', $smarty->fetch('addpurchase.tpl')); } elseif (isset($_GET['action']) && $_GET['action'] == 'edit') { $id = $_GET['id']; $purchasebill = $purchase->getPurchase($id); $purchaseitems = $purchase->getPurchaseItems($id); $smarty->assign('purchase', $purchasebill); $smarty->assign('purchaseitem', $purchaseitems); $smarty->assign('content', $smarty->fetch('editpurchase.tpl')); } elseif (isset($_POST['action']) && $_POST['action'] == 'add') { $data = $_POST; if ($purchase->addPurchaseBill($data)) { header('Location: ' . FRONTEND . 'purchasebills.php'); exit; } } elseif (isset($_POST['action']) && $_POST['action'] == 'update') { $data = $_POST; if ($purchase->updatePurchaseBill($data)) { header('Location: ' . FRONTEND . 'purchasebills.php'); exit; } } elseif (isset($_GET['action']) && $_GET['action'] == 'deletepurchase') { $id = $_GET['id'];
function init() { $p = new purchase(""); $pUIDs = $p->backAllUID(); $this->purchases = array(); $i = 1; foreach ($pUIDs as $pUID) { $this->purchases[] = new purchaseviewer($this->_fullname . $i++); end($this->purchases)->bookUID($pUID); } }
<?php if ($_POST) { session_start(); include_once $_SERVER['DOCUMENT_ROOT'] . '/config/database.php'; include_once $_SERVER['DOCUMENT_ROOT'] . '/objects/purchase.php'; include_once $_SERVER['DOCUMENT_ROOT'] . '/objects/purchasedetail.php'; $database = new database(); $db = $database->getConnection(); $purchase = new purchase($db); $purchasedetail = new purchasedetail($db); $purchase->purchase_id = $_POST['purchase_id']; $purchase->purchase_date = $_POST['purchase_date']; $purchase->supplier_kode = $_POST['supplier_kode']; $purchase->username = $_POST['username']; $purchasedetail->username = $purchase->username; if ($purchase->Insert()) { if ($purchasedetail->InsertData()) { $purchasedetail->clearTemp(); echo "Berhasil di proses"; } else { echo "anak cacat"; } } else { echo "gagal di proses"; } }
var restorepage = document.body.innerHTML; var printcontent = document.getElementById(el).innerHTML; document.body.innerHTML = printcontent; window.print(); document.body.innerHTML = restorepage; } </script> <?php $page_title = "Struk Purchase"; include_once $_SERVER['DOCUMENT_ROOT'] . '/config/database.php'; include_once $_SERVER['DOCUMENT_ROOT'] . '/objects/purchase.php'; include_once $_SERVER['DOCUMENT_ROOT'] . '/objects/purchasedetail.php'; $database = new database(); $db = $database->getConnection(); $purchase = new purchase($db); $purchasedetail = new purchasedetail($db); $struk_purchaseid = !empty($struk_purchaseid) ? $struk_purchaseid : $_GET['id']; $row = $purchase->ShowPurchase($struk_purchaseid); echo "<div id='Print'>"; //division untuk di print echo "<p>SALON & SPA KECANTIKA</p>"; // echo"-------------------------------------------------------------------"; echo "_______________________________________"; echo "<p>purchase ID : {$row['purchase_id']} </p>"; echo "<p>Date : {$row['purchase_date']} </p>"; echo "<p>Supplier : {$row['supplier_nama']} </p>"; echo "\t\t\t\t<table class='table table-hover table-responsive table-bordered' style='border-top: 1px solid black'>"; echo "\t\t\t\t\t<tr>"; echo "\t\t\t\t\t\t<th style='border-bottom: 1px solid black'>No </th>"; echo "\t\t\t\t\t\t<th style='border-bottom: 1px solid black'>Nama Item </th>";