/** * Finds the Salesorder model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param string $id * @return Salesorder the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = Salesorder::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
/** * @return \yii\db\ActiveQuery */ public function getSalesorders() { return $this->hasMany(Salesorder::className(), ['Kode_Barang' => 'Kode_Barang']); }
<?php include 'config.php'; $dbBean = new DatabaseBean(); $general = new General($dbBean); $Salesorder = new Salesorder($dbBean); if ($_REQUEST['FLAG'] == 'ADD_SALES') { if (trim($_REQUEST['product']) == "") { $_SESSION['msg'] = 'Please select product'; $num = 'danger'; $url = ADMIN_URL . "/salesorders/add.php"; $general->redirectUrl($url, $num); exit; } else { $record = $Salesorder->getproductById($_REQUEST['product']); if ($record->current_stock == "" || $record->current_stock == "0") { $_SESSION['msg'] = 'Stock not available for "' . $record->productname . '" product'; $num = 'danger'; $url = ADMIN_URL . "/salesorders/add.php"; $general->redirectUrl($url, $num); exit; } } if (trim($_REQUEST['productqty']) == "") { $_SESSION['msg'] = 'Please enter product quantity'; $num = 'danger'; $url = ADMIN_URL . "/salesorders/add.php"; $general->redirectUrl($url, $num); exit; } else { $pattern = '/^[0-9]+$/';
<?php include_once 'config.php'; include_once '../checkAdminPagePermissions.php'; $dbBean = new DatabaseBean(); $general = new General($dbBean); $menu_id = empty($_REQUEST['menu_id']) ? $_SESSION['menu_id'] : $_REQUEST['menu_id']; $heading = $general->getPageHeading($menu_id); $Salesorder = new Salesorder($dbBean); $rows = $Salesorder->getLastSalesordersId(); $v = VOUCHER_NO_CONST; if (count($rows) > 0) { $lastvoucherid = $rows[0]['id'] + 1; } else { $lastvoucherid = ''; } if ($lastvoucherid == '') { $voucherno = $v + 1; } else { $voucherno = $v + $lastvoucherid; } ?> <!DOCTYPE html> <!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]--> <!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]--> <!--[if !IE]><!--> <html lang="en"> <!--<![endif]--> <!-- BEGIN HEAD --> <head> <?php
/** * @return \yii\db\ActiveQuery */ public function getSalesorders() { return $this->hasMany(Salesorder::className(), ['Kemasan_ID' => 'Kemasan_ID']); }
<?php include_once 'config.php'; include_once '../checkAdminPagePermissions.php'; $dbBean = new DatabaseBean(); $general = new General($dbBean); $menu_id = empty($_REQUEST['menu_id']) ? $_SESSION['menu_id'] : $_REQUEST['menu_id']; $heading = $general->getPageHeading($menu_id); $Salesorder = new Salesorder($dbBean); $rows = $Salesorder->getSalesorderById($_REQUEST['id']); ?> <!DOCTYPE html> <!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]--> <!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]--> <!--[if !IE]><!--> <html lang="en"> <!--<![endif]--> <!-- BEGIN HEAD --> <head> <?php include '../common.php'; ?> <!-- BEGIN PAGE LEVEL STYLES --> <link rel="stylesheet" type="text/css" href="<?php echo ADMIN_URL; ?> /assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.css"/> <!-- END PAGE LEVEL STYLES --> <?php
<table class="table table-striped table-bordered table-hover" id="sample_1"> <thead> <tr> <!-- <th class="table-checkbox"><input type="checkbox" class="group-checkable" data-set="#sample_1 .checkboxes"/></th> --> <th>Voucher No</th> <th>Product</th> <th>Quantity</th> <th>Voucher Date</th> <th>Saler/Purchaser Name</th> <th>Date Created</th> <th>Action</th> </tr> </thead> <tbody> <?php $results = Salesorder::getSalesorders(); if (count($results) > 0) { for ($index = 0; $index < count($results); $index++) { $rows = $results[$index]; ?> <tr class="<?php echo ($index + 1) % 2 == 0 ? 'even' : 'odd'; ?> gradeX"> <!-- <td> <input name="delete[]" type="checkbox" id="delete[]" value="<?php echo $rows['id']; ?> " class="checkboxes" /> </td> --> <td><?php echo $rows['voucherno']; ?>
/** * @return \yii\db\ActiveQuery */ public function getIDSO() { return $this->hasOne(Salesorder::className(), ['ID_SO' => 'ID_SO']); }