コード例 #1
0
ファイル: edit.php プロジェクト: ASeptiadi/TugasBesar
<?php

include "../inc/class_senyawa.php";
$edit = new senyawa();
?>
 
 
 <html>
<head>
    <title> Daftar </title>
    <link href="../inc/materialize.css" rel="stylesheet" type="text/css" />
</head>
<body>
<fieldset>
    <legend><b>Edit senyawa</b></legend>
    
    <?php 
$Id = @$_GET['Id'];
$sql = mysql_query("select * from senyawa where Id = '{$Id}'") or die(mysql_error());
$data = mysql_fetch_array($sql);
?>
    <form action="" method="post" enctype="multipart/form-data">
        <table>
            <tr>
                <td>Id</td>
                <td>:</td>
                <td><input type="text" name="Id"  value="<?php 
echo $data['Id'];
?>
" disabled="disabled" /> </td>
            </tr>
コード例 #2
0
ファイル: tambah.php プロジェクト: ASeptiadi/TugasBesar
<?php

include "../inc/class_senyawa.php";
$tambah = new senyawa();
?>
<html>
<head>
    <title> Daftar </title>
    <link href="../inc/materialize.css" rel="stylesheet" type="text/css" />
</head>
<body>

<fieldset>
    <legend><b>Tambah Senyawa</b></legend>
    
    <?php 
$cariid = mysql_query("select max(Id) from senyawa") or die(mysql_error());
$dataid = mysql_fetch_array($cariid);
if ($dataid) {
    $nilaiid = substr($dataid[0], 2);
    $id = (int) $nilaiid;
    $id = $id + 1;
    $hasilid = "SN" . str_pad($id, 3, "0", STR_PAD_LEFT);
} else {
    $hasilid = "SN01";
}
?>
    
    
    <form class="form-horizontal" method="post" action="" name="frmBerita" enctype="multipart/form-data">