Documente Academic
Documente Profesional
Documente Cultură
Login
<?php
include 'includes/not_auth.php';
include 'includes/functions.php';
include 'configs/db_open.php';
$error_message = null;
if( isset($_POST['username']) && $_POST['password'] ){
if ($result = $mysqli->query( 'SELECT * FROM `admin` WHERE username = "'.
$_POST['username'].'" AND password = "'.md5($_POST['password']).'" LIMIT 1 ' )) {
if( $result->num_rows ){
$kolom_db = $result->fetch_assoc();
$_SESSION['user_id'] = $kolom_db['id'];
header ("Location: index.php");
die();
}
}
$error_message = 'Login Gagal.User Tidak Dikenal';
}
/* template */
include 'templates/login.php';
include 'configs/db_close.php';
LogOut
<?php
include 'includes/auth.php';
include 'includes/functions.php';
include 'configs/db_open.php';
unset($_SESSION['user_id']);
header ("Location: login.php");
die();
<?php
include 'includes/auth.php';
include 'includes/functions.php';
include 'configs/db_open.php';
/* template */
include 'templates/index-admin.php';
include 'configs/db_close.php';
Add Admin
<?php
include 'includes/auth.php';
include 'includes/functions.php';
include 'configs/db_open.php';
$error = null;
$post = [];
$post['username'] = null;
$post['password'] = null;
if( isset($_POST['submit']) ){
$post['username'] = $_POST['username'];
/* template */
include 'templates/add-admin.php';
include 'configs/db_close.php';
Edit Admin
<?php
include 'includes/auth.php';
include 'includes/functions.php';
include 'configs/db_open.php';
$error = null;
if( isset($_POST['submit']) ){
$post['username'] = $_POST['username'];
if( !empty($_POST['password']) ){
if ($result = $mysqli->query( ' UPDATE `admin` SET username = "'.
$_POST['username'].'", password = "'.md5($_POST['password']).'" WHERE id = "'.
$_POST['id'].'" ' )) {
header('Location: index-admin.php?msg=success&type=edit');
die();
}
else
$error = 'Gagal Menyimpan Silahkan Cek Kembali Data Anda.';
}
else{
if ($result = $mysqli->query( ' UPDATE `admin` SET username = "'.
$_POST['username'].'" WHERE id = "'.$_POST['id'].'" ' )) {
header('Location: index-admin.php?msg=success&type=edit');
die();
}
else
$error = 'Gagal Menyimpan Silahkan Cek Kembali Data Anda.';
}
/* template */
include 'templates/edit-admin.php';
include 'configs/db_close.php';
<?php
include 'includes/auth.php';
include 'includes/functions.php';
include 'configs/db_open.php';
/* template */
include 'templates/index.php';
include 'configs/db_close.php';
Print Barcode
<?php
';
}
else
echo 'Silahkan isi text';
AddKunci
<?php
include 'includes/auth.php';
include 'includes/functions.php';
include 'configs/db_open.php';
$error = null;
$post = [];
$post['kode'] = null;
$post['keterangan'] = null;
$post['status'] = null;
if( isset($_POST['submit']) ){
$post['kode'] = $_POST['kode'];
$post['keterangan'] = $_POST['keterangan'];
$post['status'] = $_POST['status'];
if ($result = $mysqli->query( ' INSERT INTO `kunci` (`id`, `kode`, `keterangan`,
`status`) VALUES (NULL, \''.$_POST['kode'].'\', \''.$_POST['keterangan'].'\', \''.
$_POST['status'].'\') ' )) {
header('Location: add-kunci.php?msg=success');
die();
}
else
$error = 'Gagal Menyimpan Silahkan Cek Kembali Data Anda.';
/* template */
include 'templates/add-kunci.php';
include 'configs/db_close.php';
Pengembalian
<?php
include 'includes/auth.php';
include 'includes/functions.php';
include 'configs/db_open.php';
/* template */
include 'templates/index-pengembalian.php';
include 'configs/db_close.php';
Peminjaman
<?php
include 'includes/auth.php';
include 'includes/functions.php';
include 'configs/db_open.php';
Lihat Status
<?php
include 'includes/auth.php';
include 'includes/functions.php';
include 'configs/db_open.php';
if( isset($_POST['kode_kunci']) ){
$total_row = $mysqli->query( 'SELECT * FROM `kunci` WHERE kode = "'.
$_POST['kode_kunci'].'" LIMIT 1 ' );
if ( $total_row->num_rows ) {
$kunci = $total_row->fetch_assoc();
echo '<h4 style="text-align: center;"> Status Kunci</h4>
<div class="form-group">
<label>Kode Kunci</label>
<p>'.$kunci['kode'].'</p>
</div>
<div class="form-group">
<label>Keterangan</label>
<p>'.$kunci['keterangan'].'</p>
</div>
<div class="form-group">
<label>Status</label>
<p>'.$kunci['status'].'</p>
</div>';
if( $kunci['status'] == 'Dipinjam' ){
$pj = $mysqli->query( 'SELECT * FROM `peminjaman` WHERE
kode_kunci = "'.$_POST['kode_kunci'].'" AND status = "Belum Di Kembalikan" LIMIT 1 ' );
if ( $pj->num_rows ) {
$peminjaman = $pj->fetch_assoc();
echo '<div class="form-group">
<label>Tanggal Peminjaman</label>
<p>'.$peminjaman['tanggal_pinjam'].'</p>
</div>
<div class="form-group">
<label>Tanggal Kembali</label>
<p>'.$peminjaman['tanggal_kembali'].'</p>
</div>
<div class="form-group">
<label>Nama Peminjam</label>
<p>'.$peminjaman['nama_peminjam'].'</p>
</div>
<div class="form-group">
<label>Perusahaan</label>
<p>'.$peminjaman['perusahaan'].'</p>
</div>
<div class="form-group">
<label>NIK</label>
<p>'.$peminjaman['nik'].'</p>
</div>';
}
}
}
else{
echo '<div class="alert alert-danger alert-dismissible" role="alert">
<strong>Error!</strong> Kode Kunci Tidak Ditemukan
</div>';
}
exit;
}
/* template */
include 'templates/lihat-status.php';
include 'configs/db_close.php';
Not-Auth
<?php
session_start();
if( isset($_SESSION['user_id']) && !empty($_SESSION['user_id']) ) {
header ("Location: index.php");
die();
}
Functions
<?php
$limit_per_page = 20;
date_default_timezone_set('Asia/Jakarta');
if ($page_count > 1)
return '<ul class="pagination pull-right">'.$previous_page.$first_page.implode('',
$pages).$last_page.$next_page.'</ul>';
}
Navbar
<?php
$user_login = $mysqli->query( 'SELECT * FROM `admin` WHERE id = "'.
$_SESSION['user_id'].'" LIMIT 1 ' );
$user_login = $user_login->fetch_assoc();
echo '
<!-- Fixed navbar -->
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-
target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.php">Tel-Key</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-
haspopup="true" aria-expanded="false">Admin <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="index-admin.php">Daftar Admin</a></li>
<li><a href="add-admin.php">Tambah Admin</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-
haspopup="true" aria-expanded="false">Kunci <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="index-kunci.php">Daftar Kunci</a></li>
<li><a href="add-kunci.php">Tambah Kunci</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-
haspopup="true" aria-expanded="false">Peminjaman <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="index-peminjaman.php">Daftar Peminjaman</a></li>
<li><a href="add-peminjaman.php">Tambah Peminjaman</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-
haspopup="true" aria-expanded="false">Pengembalian <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="index-pengembalian.php">Daftar Pengembalian</a></li>
<li><a href="add-pengembalian.php">Tambah Pengembalian</a></li>
</ul>
</li>
<li>
<a href="lihat-status.php" >Cek Status Kunci</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="#" class="dropdown-toggle" data-toggle="dropdown"
role="button" aria-haspopup="true" aria-expanded="false">'.$user_login['username'].'<span
class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="logout.php">Keluar</a></li>
</ul>
</li>
</ul>
</div><!--/.nav-collapse -->
</div>
</nav>
';
Footer
<?php
echo '
<!-- Placed at the end of the document so the pages load faster -->
<script src="assets/js/jquery.min.js"></script>
<!-- Latest compiled and minified JavaScript -->
<script src="assets/bootstrap/js/bootstrap.min.js"></script>
<script src="assets/bootflat/js/icheck.min.js"></script>
<script src="assets/bootflat/js/jquery.fs.selecter.min.js"></script>
<script src="assets/bootflat/js/jquery.fs.stepper.min.js"></script>
<script src="assets/bootstrap-datetimepicker/js/moment.min.js"></script>
<script src="assets/bootstrap-datetimepicker/js/bootstrap-
datetimepicker.min.js"></script>
<script src="assets/bootstrap-datetimepicker/js/id.js"></script>
<!-- <script src="assets/jsqrcode/jsqrcode-combined.min.js"></script>
<script src="assets/jsqrcode/html5-qrcode.min.js"></script> -->
<script type="text/javascript" src="assets/lazarqr/grid.js"></script>
<script type="text/javascript" src="assets/lazarqr/version.js"></script>
<script type="text/javascript" src="assets/lazarqr/detector.js"></script>
<script type="text/javascript" src="assets/lazarqr/formatinf.js"></script>
<script type="text/javascript" src="assets/lazarqr/errorlevel.js"></script>
<script type="text/javascript" src="assets/lazarqr/bitmat.js"></script>
<script type="text/javascript" src="assets/lazarqr/datablock.js"></script>
<script type="text/javascript" src="assets/lazarqr/bmparser.js"></script>
<script type="text/javascript" src="assets/lazarqr/datamask.js"></script>
<script type="text/javascript" src="assets/lazarqr/rsdecoder.js"></script>
<script type="text/javascript" src="assets/lazarqr/gf256poly.js"></script>
<script type="text/javascript" src="assets/lazarqr/gf256.js"></script>
<script type="text/javascript" src="assets/lazarqr/decoder.js"></script>
<script type="text/javascript" src="assets/lazarqr/qrcode.js"></script>
<script type="text/javascript" src="assets/lazarqr/findpat.js"></script>
<script type="text/javascript" src="assets/lazarqr/alignpat.js"></script>
<script type="text/javascript" src="assets/lazarqr/databr.js"></script>
<script src="assets/js/app3.js"></script>
';
FovBar
<?php
echo '
</div>
<div class="modal-footer ">
<button type="button" class="btn btn-success" id="approve-yes" ><span class="glyphicon
glyphicon-ok-sign"></span> Yes</button>
<button type="button" class="btn btn-default" data-dismiss="modal"><span
class="glyphicon glyphicon-remove"></span> No</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
</div>
<div class="modal-footer ">
<button type="button" class="btn btn-success" id="delete-yes" ><span class="glyphicon
glyphicon-ok-sign"></span> Yes</button>
<button type="button" class="btn btn-default" data-dismiss="modal"><span
class="glyphicon glyphicon-remove"></span> No</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
';
Head
<?php
echo '
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come
*after* these tags -->
<meta name="description" content="">
<meta name="author" content="">
<!-- Just for debugging purposes. Don\'t actually copy these 2 lines! -->
<!--[if lt IE 9]><script src="assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
<script src="assets/js/ie-emulation-modes-warning.js"></script>
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
QrSpec
<?php
/*
* PHP QR Code encoder
*
* QR Code specifications
*
* Based on libqrencode C library distributed under LGPL 2.1
* Copyright (C) 2006, 2007, 2008, 2009 Kentaro Fukuchi <fukuchi@megaui.net>
*
* PHP QR Code is distributed under LGPL 3
* Copyright (C) 2010 Dominik Dzienia <deltalab at poczta dot fm>
*
* The following data / specifications are taken from
* "Two dimensional symbol -- QR-code -- Basic Specification" (JIS X0510:2004)
* or
* "Automatic identification and data capture techniques --
* QR Code 2005 bar code symbology specification" (ISO/IEC 18004:2006)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
define('QRSPEC_VERSION_MAX', 40);
define('QRSPEC_WIDTH_MAX', 177);
define('QRCAP_WIDTH', 0);
define('QRCAP_WORDS', 1);
define('QRCAP_REMINDER', 2);
define('QRCAP_EC', 3);
class QRspec {
//----------------------------------------------------------------------
public static function getDataLength($version, $level)
{
return self::$capacity[$version][QRCAP_WORDS] - self::$capacity[$version]
[QRCAP_EC][$level];
}
//----------------------------------------------------------------------
public static function getECCLength($version, $level)
{
return self::$capacity[$version][QRCAP_EC][$level];
}
//----------------------------------------------------------------------
public static function getWidth($version)
{
return self::$capacity[$version][QRCAP_WIDTH];
}
//----------------------------------------------------------------------
public static function getRemainder($version)
{
return self::$capacity[$version][QRCAP_REMINDER];
}
//----------------------------------------------------------------------
public static function getMinimumVersion($size, $level)
{
return -1;
}
//######################################################################
//----------------------------------------------------------------------
public static function lengthIndicator($mode, $version)
{
if ($mode == QR_MODE_STRUCTURE)
return 0;
if ($version <= 9) {
$l = 0;
} else if ($version <= 26) {
$l = 1;
} else {
$l = 2;
}
return self::$lengthTableBits[$mode][$l];
}
//----------------------------------------------------------------------
public static function maximumWords($mode, $version)
{
if($mode == QR_MODE_STRUCTURE)
return 3;
if($version <= 9) {
$l = 0;
} else if($version <= 26) {
$l = 1;
} else {
$l = 2;
}
$bits = self::$lengthTableBits[$mode][$l];
$words = (1 << $bits) - 1;
if($mode == QR_MODE_KANJI) {
$words *= 2; // the number of bytes is required
}
return $words;
}
//----------------------------------------------------------------------
// CACHEABLE!!!
$b1 = self::$eccTable[$version][$level][0];
$b2 = self::$eccTable[$version][$level][1];
$data = self::getDataLength($version, $level);
$ecc = self::getECCLength($version, $level);
if($b2 == 0) {
$spec[0] = $b1;
$spec[1] = (int)($data / $b1);
$spec[2] = (int)($ecc / $b1);
$spec[3] = 0;
$spec[4] = 0;
} else {
$spec[0] = $b1;
$spec[1] = (int)($data / ($b1 + $b2));
$spec[2] = (int)($ecc / ($b1 + $b2));
$spec[3] = $b2;
$spec[4] = $spec[1] + 1;
}
}
/** --------------------------------------------------------------------
* Put an alignment marker.
* @param frame
* @param width
* @param ox,oy center coordinate of the pattern
*/
public static function putAlignmentMarker(array &$frame, $ox, $oy)
{
$finder = array(
"\xa1\xa1\xa1\xa1\xa1",
"\xa1\xa0\xa0\xa0\xa1",
"\xa1\xa0\xa1\xa0\xa1",
"\xa1\xa0\xa0\xa0\xa1",
"\xa1\xa1\xa1\xa1\xa1"
);
$yStart = $oy-2;
$xStart = $ox-2;
for($y=0; $y<5; $y++) {
QRstr::set($frame, $xStart, $yStart+$y, $finder[$y]);
}
}
//----------------------------------------------------------------------
public static function putAlignmentPattern($version, &$frame, $width)
{
if($version < 2)
return;
$d = self::$alignmentPattern[$version][1] - self::$alignmentPattern[$version][0];
if($d < 0) {
$w = 2;
} else {
$w = (int)(($width - self::$alignmentPattern[$version][0]) / $d + 2);
}
if($w * $w - 3 == 1) {
$x = self::$alignmentPattern[$version][0];
$y = self::$alignmentPattern[$version][0];
self::putAlignmentMarker($frame, $x, $y);
return;
}
$cx = self::$alignmentPattern[$version][0];
for($x=1; $x<$w - 1; $x++) {
self::putAlignmentMarker($frame, 6, $cx);
self::putAlignmentMarker($frame, $cx, 6);
$cx += $d;
}
$cy = self::$alignmentPattern[$version][0];
for($y=0; $y<$w-1; $y++) {
$cx = self::$alignmentPattern[$version][0];
for($x=0; $x<$w-1; $x++) {
self::putAlignmentMarker($frame, $cx, $cy);
$cx += $d;
}
$cy += $d;
}
}
// size: [QRSPEC_VERSION_MAX - 6]
//----------------------------------------------------------------------
public static function getVersionPattern($version)
{
if($version < 7 || $version > QRSPEC_VERSION_MAX)
return 0;
return self::$formatInfo[$level][$mask];
}
// Frame ---------------------------------------------------------------
// Cache of initial frames.
//----------------------------------------------------------------------
public static function createFrame($version)
{
$width = self::$capacity[$version][QRCAP_WIDTH];
$frameLine = str_repeat ("\0", $width);
$frame = array_fill(0, $width, $frameLine);
// Finder pattern
self::putFinderPattern($frame, 0, 0);
self::putFinderPattern($frame, $width - 7, 0);
self::putFinderPattern($frame, 0, $width - 7);
// Separator
$yOffset = $width - 7;
QRstr::set($frame, 0, 7, $setPattern);
QRstr::set($frame, $width-8, 7, $setPattern);
QRstr::set($frame, 0, $width - 8, $setPattern);
// Format info
$setPattern = str_repeat("\x84", 9);
QRstr::set($frame, 0, 8, $setPattern);
QRstr::set($frame, $width - 8, 8, $setPattern, 8);
$yOffset = $width - 8;
// Timing pattern
// Alignment pattern
self::putAlignmentPattern($version, $frame, $width);
// Version information
if($version >= 7) {
$vinf = self::getVersionPattern($version);
$v = $vinf;
$v = $vinf;
for($y=0; $y<6; $y++) {
for($x=0; $x<3; $x++) {
$frame[$y][$x+($width - 11)] = chr(0x88 | ($v & 1));
$v = $v >> 1;
}
}
}
return $frame;
}
//----------------------------------------------------------------------
public static function debug($frame, $binary_mode = false)
{
if ($binary_mode) {
?>
<style>
.m { background-color: white; }
</style>
<?php
echo '<pre><tt><br/ ><br/ ><br/
> ';
echo join("<br/ > ",
$frame);
echo '</tt></pre><br/ ><br/ ><br/ ><br/ ><br/ ><br/ >';
} else {
?>
<style>
.p { background-color: yellow; }
.m { background-color: #00FF00; }
.s { background-color: #FF0000; }
.c { background-color: aqua; }
.x { background-color: pink; }
.f { background-color: gold; }
</style>
<?php
echo "<pre><tt>";
echo join("<br/ >", $frame);
echo "</tt></pre>";
}
}
//----------------------------------------------------------------------
public static function serial($frame)
{
return gzcompress(join("\n", $frame), 9);
}
//----------------------------------------------------------------------
public static function unserial($code)
{
return explode("\n", gzuncompress($code));
}
//----------------------------------------------------------------------
public static function newFrame($version)
{
if($version < 1 || $version > QRSPEC_VERSION_MAX)
return null;
if(!isset(self::$frames[$version])) {
$fileName = QR_CACHE_DIR.'frame_'.$version.'.dat';
if (QR_CACHEABLE) {
if (file_exists($fileName)) {
self::$frames[$version] = self::unserial(file_get_contents($fileName));
} else {
self::$frames[$version] = self::createFrame($version);
file_put_contents($fileName, self::serial(self::$frames[$version]));
}
} else {
self::$frames[$version] = self::createFrame($version);
}
}
if(is_null(self::$frames[$version]))
return null;
return self::$frames[$version];
}
//----------------------------------------------------------------------
public static function rsBlockNum($spec) { return $spec[0] + $spec[3]; }
public static function rsBlockNum1($spec) { return $spec[0]; }
public static function rsDataCodes1($spec) { return $spec[1]; }
public static function rsEccCodes1($spec) { return $spec[2]; }
public static function rsBlockNum2($spec) { return $spec[3]; }
public static function rsDataCodes2($spec) { return $spec[4]; }
public static function rsEccCodes2($spec) { return $spec[2]; }
public static function rsDataLength($spec) { return ($spec[0] * $spec[1]) + ($spec[3] *
$spec[4]); }
public static function rsEccLength($spec) { return ($spec[0] + $spec[3]) * $spec[2]; }
}
Qrtcode
class QRrsItem {
//----------------------------------------------------------------------
public function modnn($x)
{
while ($x >= $this->nn) {
$x -= $this->nn;
$x = ($x >> $this->mm) + ($x & $this->nn);
}
return $x;
}
//----------------------------------------------------------------------
public static function init_rs_char($symsize, $gfpoly, $fcr, $prim, $nroots, $pad)
{
// Common code for intializing a Reed-Solomon control block (char or int symbols)
// Copyright 2004 Phil Karn, KA9Q
// May be used under the terms of the GNU Lesser General Public License (LGPL)
$rs = null;
if($sr != 1){
// field generator polynomial is not primitive!
$rs = NULL;
return $rs;
}
$rs->fcr = $fcr;
$rs->prim = $prim;
$rs->nroots = $nroots;
$rs->gfpoly = $gfpoly;
return $rs;
}
//----------------------------------------------------------------------
public function encode_rs_char($data, &$parity)
{
$MM =& $this->mm;
$NN =& $this->nn;
$ALPHA_TO =& $this->alpha_to;
$INDEX_OF =& $this->index_of;
$GENPOLY =& $this->genpoly;
$NROOTS =& $this->nroots;
$FCR =& $this->fcr;
$PRIM =& $this->prim;
$IPRIM =& $this->iprim;
$PAD =& $this->pad;
$A0 =& $NN;
for($j=1;$j<$NROOTS;$j++) {
$parity[$j] ^= $ALPHA_TO[$this->modnn($feedback +
$GENPOLY[$NROOTS-$j])];
}
}
// Shift
array_shift($parity);
if($feedback != $A0) {
array_push($parity, $ALPHA_TO[$this->modnn($feedback + $GENPOLY[0])]);
} else {
array_push($parity, 0);
}
}
}
}
//##########################################################################
class QRrs {
//----------------------------------------------------------------------
public static function init_rs($symsize, $gfpoly, $fcr, $prim, $nroots, $pad)
{
foreach(self::$items as $rs) {
if($rs->pad != $pad) continue;
if($rs->nroots != $nroots) continue;
if($rs->mm != $symsize) continue;
if($rs->gfpoly != $gfpoly) continue;
if($rs->fcr != $fcr) continue;
if($rs->prim != $prim) continue;
return $rs;
}
return $rs;
}
}