<?php require_once 'class/classPeopleDatabase.php'; $PersonalCode = $_POST['PersonalCode1'] . "-" . $_POST['PersonalCode2']; $select1 = "SELECT id FROM people_personal_code WHERE personal_code = '{$PersonalCode}'"; $obj_select = new PeopleDatabase(); $select1_result = $obj_select->MySQLquery($select1); $select1_array = mysql_fetch_array($select1_result); $select2 = "SELECT name, surname, phone_number FROM people_list WHERE id = '{$select1_array['0']}'"; $select2_result = $obj_select->MySQLquery($select2); $select2_array = mysql_fetch_array($select2_result); echo "<h4>Vārds</h4>"; echo "<input type=\"text\" readonly class=\"GeneralBlockCentralContentBlockInputText\" value=\""; echo $select2_array[0] . "\">"; echo "<br>"; echo "<h4>Uzvārds</h4>"; echo "<input type=\"text\" readonly class=\"GeneralBlockCentralContentBlockInputText\" value=\""; echo $select2_array[1] . "\">"; echo "<br>"; echo "<h4>Personas kods</h4>"; echo "<input type=\"text\" readonly id=\"GeneralBlockCentralContentBlockInputPersonalCode1\">-<input type=\"text\" readonly id=\"GeneralBlockCentralContentBlockInputPersonalCode2\">"; echo "<br>"; echo "<h4>Telefona numurs</h4>"; echo "<input type=\"text\" readonly class=\"GeneralBlockCentralContentBlockInputText\" value=\""; echo $select2_array[2] . "\">";
<head> <title>Personu datubāze</title> <link rel="stylesheet" type="text/css" href="update_styles.css"> <link rel="icon" type="image/png" href="../img/people_database_icon.png"> <meta charset="utf-8"> </head> <body> <div id="GeneralBlock"> <div id="GeneralBlockHeader"> <h1>Personu datubāze</h1> </div> <div id="GeneralBlockLeft"> <div id="GeneralBlockLeftInsideBlock"> <?php require_once '../php/class/classPeopleDatabase.php'; $objDate = new PeopleDatabase(); $objDate->Date(); ?> </div> </div> <div id="GeneralBlockCentral"> <div id="GeneralBlockCentralHeader"> <ul> <li id="GeneralBlockCentralHeaderFirstLi"><a href="../insert/insert.php">Ievadīt</a></li> <li id="GeneralBlockCentralHeaderSecondLi" class="GeneralBlockCentralHeaderLi"><a href="../delete/delete.php">Dzēst</a></li> <li id="GeneralBlockCentralHeaderThirdLi" class="GeneralBlockCentralHeaderLi">Rediģēt</li> <li id="GeneralBlockCentralHeaderFourLi" class="GeneralBlockCentralHeaderLi"><a href="../select/select.php">Izvēlēties</a></li> </ul> </div> <img src="../img/bloknot.png"> <div id="GeneralBlockCentralContentBlock">
<?php require_once 'class/classPeopleDatabase.php'; $Login = trim($_POST['Login']); $Password = sha1(md5(trim($_POST['Password']))); $select = "SELECT login, password FROM authorization WHERE login = '******'"; $objAuthorization = new PeopleDatabase(); $array = mysql_fetch_array($objAuthorization->MySQLquery($select)); if ($Login == $array[0] && $Password == $array[1]) { header('Location: http://mysite/PeopleDatabase/insert/insert.php'); } else { header('Location: http://mysite/PeopleDatabase/wrong_authorization/wrong_authorization.php'); }
<?php require_once 'class/classPeopleDatabase.php'; $Name = $_POST['Name']; $Surname = $_POST['Surname']; $PhoneNumber = $_POST['PhoneNumber']; $PersonalCode = $_POST['PersonalCode1'] . "-" . $_POST['PersonalCode2']; $query1 = "INSERT INTO people_list (name,surname,phone_number) VALUES ('{$Name}','{$Surname}','{$PhoneNumber}')"; $obj_from_insert = new PeopleDatabase(); $obj_from_insert->MySQLquery($query1); $LastInsertID = mysql_insert_id(); $query2 = "INSERT INTO people_personal_code (id,personal_code) VALUES ('{$LastInsertID}','{$PersonalCode}')"; $obj_from_insert->MySQLquery($query2); header('Location: http://mysite/PeopleDatabase/inserted/inserted.php');