Ver código fonte

Index lapa top. Instalācijas lapa pabeigta

master
Vitalijss 5 anos atrás
pai
commit
1b77d48cab
3 arquivos alterados com 47 adições e 14 exclusões
  1. BIN
      img/briketes.png
  2. +20
    -14
      include/install.php
  3. +27
    -0
      index.php

BIN
img/briketes.png Ver arquivo

Antes Depois
Largura: 512  |  Altura: 470  |  Tamanho: 230KB

+ 20
- 14
include/install.php Ver arquivo

@@ -48,18 +48,24 @@ echo '<input type="submit" class="w3-button w3-green" name="db_saglabat" value="
//skripts, kurš iveidos tabulas iekš dBase
//saglabājam DB
$tabulabriketes = "CREATE TABLE `Briketes` (
`BrikID` bigint(5) NOT NULL AUTO_INCREMENT DEFAULT '0',
`BrikNopirktas` bigint(5) NOT NULL DEFAULT '0',
`BrikAtlicis` bigint(5) NOT NULL DEFAULT '0',
PRIMARY KEY (`BrikID`)
);" ;
$tabulapaterins = "CREATE TABLE `Paterins` (
`PatID` bigint(5) NOT NULL AUTO_INCREMENT,
`PatDaudzums` bigint(5) NOT NULL,
`PatDatums` bigint(5) NOT NULL,
PRIMARY KEY (`PatID`)
);";

/*$tabulaamats = "CREATE TABLE IF NOT EXISTS tbAmats (
AID int(5) NOT NULL AUTO_INCREMENT,
AmatsNos text COLLATE utf8_bin NOT NULL,
PRIMARY KEY (AID)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=1;" ;
*/

$tabulabriketes = "CREATE TABLE IF NOT EXISTS Briketes (
BrikID bigint(5) NOT NULL AUTO_INCREMENT,
BrikNopirktas bigint(5) NOT NULL DEFAULT 0,
BrikAtlicis bigint(5) NOT NULL DEFAULT 0,
PRIMARY KEY (BrikID));" ;
$tabulapaterins = "CREATE TABLE IF NOT EXISTS Paterins (
PatID bigint(5) NOT NULL AUTO_INCREMENT,
PatDaudzums bigint(5) NOT NULL,
PatDatums bigint(5) NOT NULL,
PRIMARY KEY (PatID));";

//Darīšana
@@ -69,7 +75,7 @@ echo '<input type="submit" class="w3-button w3-green" name="db_saglabat" value="
//Izveidojam db.php failu
//pārbadam vai var rakstīt failus
$newFileName = 'include/db.php';
$newFileName = 'db.php';

if ( ! is_writable(dirname($newFileName))) {

@@ -92,7 +98,7 @@ echo '<input type="submit" class="w3-button w3-green" name="db_saglabat" value="
' ;
file_put_contents($newFileName, $rakstam);
echo '<h2>Instalācija ir veiksmīga! <a href=index.php>Sākums</a></h2>';
echo '<h2>Instalācija ir veiksmīga! <a href=/index.php>Sākums</a></h2>';
}
}


+ 27
- 0
index.php Ver arquivo

@@ -0,0 +1,27 @@
<!DOCTYPE html>
<html>
<title>Uzskaitam briketes</title>
<meta charset="UTF-8" name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/include/css/w3.css">
<?php
include('include/db.php');
?>
<div class="w3-container w3-center">
<form action="" method="POST">
<h2>Reģistrēt iztērētās briketes</h2>
<img src="/img/briketes.png" alt="Briketes">
<br>
<input type="submit" name="pievienot" class="w3-button w3-jumbo w3-green" value="+1">
</form>
</div>

<?php
//Ja ir isset +1
if(isset($_POST['pievineot']))
{
$pievienot = 1;
echo '<h2>Poga nospiesta! Pievienota klāt'.$pievienot.' Nrikešu paka!</h2>';

}



Carregando…
Cancelar
Salvar

Powered by TurnKey Linux.