public function getBuat() { $cheklist = Checklist::all(); $actifity = actifity::all(); $jenis = sub_jenis_dokumen::all(); $unit = unit::all(); return view('checklist.buat_checklist', compact('actifity', 'jenis', 'unit')); }
<?php session_start(); require_once '../../bootstrap.php'; require '../../services/UserService.php'; require '../../services/ItemService.php'; UserService::withRole(UserService::$CONTRIBUTOR, function () { $unit = new unit(); $unit->setName($_POST["name"]); $saved = ItemService::saveWithValidation($unit, 200); if ($saved == true) { $id = $unit->getId(); $result = array("id" => $id); echo json_encode($result); } });
public static function listUnits() { $units = unit::all(); View::make('/waybill/new.html', array('units' => $units)); }
unset($_POST[$key]); } } } break; case 'delete_entry': // Check for dependencies $administration_unit = new unit($_POST['units_id']); if ($administration_unit->has_dependencies()) { $error_level = 2; // Related tariff(s) exist $_POST['action'] = ''; } break; case 'delete_entry_confirmed': $administration_unit = new unit($_POST['units_id']); $administration_unit->delete(); unset($_POST['units_id']); $_POST['action'] = ''; break; } // Create a new unit object with id == 0 (default) $_SESSION['unit'] = new unit(); // header // require DIR_WS_INCLUDES . 'header.php'; ?> <!-- body //--> <table border="0" width="100%" cellspacing="3" cellpadding="3"> <tr> <td width="<?php echo BOX_WIDTH;
fseek($unitFile, ($newId)*$defaultBlockSize); // Basic parameters fwrite($unitFile, pack("i*", $startLocation[0],$startLocation[1],1,$typeParams[3],$pGameID, $pGameID,1,$postVals[1],0)); // Secondary information fwrite($unitFile, pack("i*", 6, 0, $townID)); fseek($unitFile, ($newId)*$defaultBlockSize+$unitBlockSize-4); fwrite($unitFile, pack("i", 9990)); */ $newId = $unitIndex; $unitIndex += 4; echo 'Make unit type 6 at unit #' . $newId . '<br>'; $thisDtl = explode('<-->', $unitInf[6]); $typeParams = explode(",", $thisDtl[1]); fseek($unitFile, $newId * $defaultBlockSize + $unitBlockSize - 4); fwrite($unitFile, pack("i", 0)); $newUnit = new unit($newId, [], $unitFile); $newUnit->unitDat[1] = $startLocation[0]; // X Loc $newUnit->unitDat[2] = $startLocation[1]; // Y Loc $newUnit->unitDat[3] = 1; // Icon $newUnit->unitDat[4] = $typeParams[3]; // Unit Type $newUnit->unitDat[5] = $pGameID; // Owner $newUnit->unitDat[6] = $pGameID; // Controller $newUnit->unitDat[7] = 1; // Status $newUnit->unitDat[8] = $postVals[1];
function __construct($id, $dat, $file) { parent::__construct($id, $dat, $file); $this->attrList['energy'] = 16; }