echo lang("NAV_MY_LIST"); ?> </h2> <div id='left-nav'> <?php include "{$path}/common/left-nav.php"; ?> </div> <div id='main'> <?php echo resultBlock($errors, $successes); ?> <?php echo Item::table($items); ?> <div id='regbox' class='add-item-box'> <div class="small_title"><?php echo lang("BOX_ITEM_ADD_NAME"); ?> </div> <form name='addItem' action='<?php echo $_SERVER['PHP_SELF']; ?> ' method='post'> <input type='hidden' name='form' value='addItem' />
/** * POST /item * */ public function s003() { $req = App::request(); if ($req->isPost()) { $post = $req->post(); if (!empty($post["item_kode"])) { $attributes = array("item_kode" => $post["item_kode"], "item_nama" => $post["item_nama"], "keterangan" => $post["keterangan"], "item_uom" => $post["item_uom"], "item_principal" => $post["item_principal"], "item_grup" => $post["item_grup"], "barcode" => $post["barcode"], "default_gudang" => $post["default_gudang"], "min_order_qty" => $post["min_order_qty"], "re_order_qty" => $post["re_order_qty"], "re_order_level" => $post["re_order_level"], "has_batch_no" => 0, "is_obat" => ZiUtil::check_bool_int($post["is_obat"]), "disabled" => ZiUtil::check_bool_int($post["disabled"])); $table = Item::table(); if (is_null($post["gen_id"]) || $post["gen_id"] == "") { $attributes["id"] = "ITEM-" . ZiUtil::GetNowID(); $table->insert($attributes); } else { $where = "id = '" . $post["gen_id"] . "'"; $table->update($attributes, $where); } App::flash('info', 'Data Tersimpan.'); App::redirect('item.index'); } } App::flash('error', 'Terjadi kesalahan pada inputan anda.'); App::redirect('item.a001'); }