hjkhghopjkertteerterterterertertrtoirh
bnmbertsurhetertertertertertertertpdf'tdfg
/
home
/
easy3158
/
domains
/
ekwiatki.pl
/
public_html
/
Upload FileeE
HOME
<?php include("inc/head.php"); //----------------------------- if(empty($_SESSION['user_id'])){header("Location: login");exit;} ?> <body> <!-- header start --> <?php include("inc/top.php"); ?> <!--====================================================--> <div class="breadcrumb-area gray-bg"> <div class="container"> <div class="breadcrumb-content"> <ul> <li><a href="index">ekwiatki.pl</a></li> <li class="active">Książka adresowa</li> </ul> </div> </div> </div> <!-- my account start --> <div class="shop-page-area pt-75 pb-75"> <div class="container"> <div class="row flex-row-reverse"> <div class="col-lg-12"> <div class="grid-list-product-wrapper"> <div class="product-grid product-view pb-20"> <!--====================================--> <div class="row"> <div class="col-lg-8 col-md-6" style="margin-bottom: 20px;"> <div class="cart-tax"> <div class="title-wrap"> <h4 class="cart-bottom-title section-bg-gray"><?php if($_GET['edit'] != "1"){echo "Dodaj osobę do książki";} else {echo "Edytuj kontakt";} ?></h4> </div> <div class="tax-wrapper"> <div id="odbiorcaForm"> <?php if($_GET['edit'] != "1"){ //=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=# $try = trim(addslashes(strip_tags($_POST['try']))); $imie = trim(addslashes(strip_tags($_POST['imie']))); $nazwisko = trim(addslashes(strip_tags($_POST['nazwisko']))); $nazwa_firmy = trim(addslashes(strip_tags($_POST['nazwa_firmy']))); $ulica = trim(addslashes(strip_tags($_POST['ulica']))); $nr_domu = trim(addslashes(strip_tags($_POST['nr_domu']))); $zip = trim(addslashes(strip_tags($_POST['zip']))); $miasto = trim(addslashes(strip_tags($_POST['miasto']))); $telefon = trim(addslashes(strip_tags($_POST['telefon']))); $email = trim(addslashes(strip_tags($_POST['email']))); if(!empty($try) AND $try == "1"){ mysqli_query($connect,"INSERT INTO `book` (`user_id`,`imie`,`nazwisko`,`firma`,`ulica`,`nr_domu`,`zip`,`miasto`,`telefon`,`email`) VALUES ('".$_SESSION['user_id']."','$imie','$nazwisko','$nazwa_firmy','$ulica','$nr_domu','$zip','$miasto','$telefon','$email')"); echo ' <CENTER> <h4 style="margin-bottom: 20px;">Zapisano kontakt!</h4> </CENTER> '; } ?> <form action="" method="post"> <div class="row"> <div class="col-md-6" style="margin-bottom: 12px;"> <input type="text" name="imie" placeholder="Imię odbiorcy" style="background: #fff;" required> </div> <div class="col-md-6" style="margin-bottom: 12px;"> <input type="text" name="nazwisko" placeholder="Nazwisko odbiorcy" style="background: #fff;" required> </div> </div> <div class="row"> <div class="col-md-12" style="margin-bottom: 12px;"> <input type="text" name="nazwa_firmy" placeholder="*Nazwa firmy" style="background: #fff;"> </div> </div> <div class="row"> <div class="col-md-8" style="margin-bottom: 12px;"> <input type="text" name="ulica" placeholder="Nazwa ulicy" style="background: #fff;" required> </div> <div class="col-md-4" style="margin-bottom: 12px;"> <input type="text" name="nr_domu" placeholder="Numer domu / lokalu" style="background: #fff;" required> </div> </div> <div class="row"> <div class="col-md-4" style="margin-bottom: 12px;"> <input type="text" name="zip" placeholder="Kod pocztowy" style="background: #fff;" required> </div> <div class="col-md-8" style="margin-bottom: 12px;"> <input type="text" name="miasto" placeholder="Miejscowość" style="background: #fff;" required> </div> </div> <div class="row"> <div class="col-md-6" style="margin-bottom: 12px;"> <input type="text" name="telefon" placeholder="*Numer telefonu" style="background: #fff;"> </div> <div class="col-md-6" style="margin-bottom: 12px;"> <input type="text" name="email" placeholder="*Adres e-mail" style="background: #fff;"> </div> </div> <div style="text-align: right;"> <input type="hidden" name="try" value="1"> <button type='submit' class='btn btn-primary' style='border-radius: 5px; padding: 5px 15px 5px 15px; cursor: pointer; background: #e93c01; color: #fff; border: 1px solid #de3801; height: auto;'>Dodaj</button> </div> </form> <?php } //=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=# else { $id3 = trim(addslashes(strip_tags($_GET['id']))); //=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=# $try = trim(addslashes(strip_tags($_POST['try']))); $imie = trim(addslashes(strip_tags($_POST['imie']))); $nazwisko = trim(addslashes(strip_tags($_POST['nazwisko']))); $nazwa_firmy = trim(addslashes(strip_tags($_POST['nazwa_firmy']))); $ulica = trim(addslashes(strip_tags($_POST['ulica']))); $nr_domu = trim(addslashes(strip_tags($_POST['nr_domu']))); $zip = trim(addslashes(strip_tags($_POST['zip']))); $miasto = trim(addslashes(strip_tags($_POST['miasto']))); $telefon = trim(addslashes(strip_tags($_POST['telefon']))); $email = trim(addslashes(strip_tags($_POST['email']))); if(!empty($try) AND $try == "1"){ mysqli_query($connect,"UPDATE `book` SET `imie` = '$imie' WHERE `id` = $id3"); mysqli_query($connect,"UPDATE `book` SET `nazwisko` = '$nazwisko' WHERE `id` = $id3"); mysqli_query($connect,"UPDATE `book` SET `firma` = '$nazwa_firmy' WHERE `id` = $id3"); mysqli_query($connect,"UPDATE `book` SET `ulica` = '$ulica' WHERE `id` = $id3"); mysqli_query($connect,"UPDATE `book` SET `nr_domu` = '$nr_domu' WHERE `id` = $id3"); mysqli_query($connect,"UPDATE `book` SET `zip` = '$zip' WHERE `id` = $id3"); mysqli_query($connect,"UPDATE `book` SET `miasto` = '$miasto' WHERE `id` = $id3"); mysqli_query($connect,"UPDATE `book` SET `telefon` = '$telefon' WHERE `id` = $id3"); mysqli_query($connect,"UPDATE `book` SET `email` = '$email' WHERE `id` = $id3"); echo ' <CENTER> <h4 style="margin-bottom: 20px;">Zapisano zmiany!</h4> </CENTER> '; } //========================================================= $q3 = mysqli_query($connect,"SELECT * FROM `book` WHERE `id` = $id3 AND `user_id` = ".$_SESSION['user_id']); $n3 = mysqli_num_rows($q3); if($n3 > 0){ $s3 = mysqli_fetch_array($q3); $imie3 = $s3['imie']; $nazwisko3 = $s3['nazwisko']; $nazwa_firmy3 = $s3['firma']; $ulica3 = $s3['ulica']; $nr_domu3 = $s3['nr_domu']; $zip3 = $s3['zip']; $miasto3 = $s3['miasto']; $telefon3 = $s3['telefon']; $email3 = $s3['email']; ?> <form action="" method="post"> <div class="row"> <div class="col-md-6" style="margin-bottom: 12px;"> <input type="text" name="imie" placeholder="Imię odbiorcy" value="<?=$imie3;?>" style="background: #fff;" required> </div> <div class="col-md-6" style="margin-bottom: 12px;"> <input type="text" name="nazwisko" placeholder="Nazwisko odbiorcy" value="<?=$nazwisko3;?>" style="background: #fff;" required> </div> </div> <div class="row"> <div class="col-md-12" style="margin-bottom: 12px;"> <input type="text" name="nazwa_firmy" placeholder="*Nazwa firmy" value="<?=$nazwa_firmy3;?>" style="background: #fff;"> </div> </div> <div class="row"> <div class="col-md-8" style="margin-bottom: 12px;"> <input type="text" name="ulica" placeholder="Nazwa ulicy" value="<?=$ulica3;?>" style="background: #fff;" required> </div> <div class="col-md-4" style="margin-bottom: 12px;"> <input type="text" name="nr_domu" placeholder="Numer domu / lokalu" value="<?=$nr_domu3;?>" style="background: #fff;" required> </div> </div> <div class="row"> <div class="col-md-4" style="margin-bottom: 12px;"> <input type="text" name="zip" placeholder="Kod pocztowy" value="<?=$zip3;?>" style="background: #fff;" required> </div> <div class="col-md-8" style="margin-bottom: 12px;"> <input type="text" name="miasto" placeholder="Miejscowość" value="<?=$miasto3;?>" style="background: #fff;" required> </div> </div> <div class="row"> <div class="col-md-6" style="margin-bottom: 12px;"> <input type="text" name="telefon" placeholder="*Numer telefonu" value="<?=$telefon3;?>" style="background: #fff;"> </div> <div class="col-md-6" style="margin-bottom: 12px;"> <input type="text" name="email" placeholder="*Adres e-mail" value="<?=$email3;?>" style="background: #fff;"> </div> </div> <div style="text-align: right;"> <input type="hidden" name="try" value="1"> <button type='submit' class='btn btn-primary' style='border-radius: 5px; padding: 5px 15px 5px 15px; cursor: pointer; background: #e93c01; color: #fff; border: 1px solid #de3801; height: auto;'>Zapisz zmiany</button> </div> </form> <?php } else {header("Location: contactBook");exit;} //=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=# } ?> </div> </div> </div> </div> <div class="col-lg-4 col-md-6"> <div class="grand-totall"> <div class="title-wrap"> <h4 class="cart-bottom-title section-bg-gary-cart">Książka adresowa</h4> </div> <div style="height: 20px;"></div> <?php $q = mysqli_query($connect,"SELECT * FROM `book` WHERE `user_id` = ".$_SESSION['user_id']." ORDER BY `nazwisko` ASC"); $n = mysqli_num_rows($q); if($n > 0){ $i = 0; echo "<table class='table table-striped'>"; while($s = mysqli_fetch_array($q)){ $i++; $imieS = $s['nazwisko']." ".$s['imie']; $id = $s['id']; echo " <tr> <td style='width: 1%;' nowrap='nowrap'>$i.</td> <td>$imieS</td> <td style='width: 1%; text-align: right;' nowrap='nowrap'> <a href='editContact-$id'><i class='la la-edit'></i></a> <a href='delContact-$id'><i class='la la-trash'></i></a> </td> </tr> "; } echo "</table>"; } else {echo "<CENTER><B>Twoja książka jest pusta!</B></CENTER>";} ?> </div> </div> </div> <!--====================================--> </div> </div> </div> </div> </div> </div> <!--====================================================--> <?php include("inc/footer.php"); ?> <!-- all js here --> <?php include("inc/footerScripts.php"); ?> </body> </html>