Jump to content

LeonLatex

Members
  • Posts

    404
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by LeonLatex

  1. Do not quite know how to present it, but I have a div that I call menu. It is located on the left side of the page. Then I have a content div that is centered on the page. The problem is when the page is scaled. on fairly large screens then there is no problem. Then the website looks normal as I have set it up, but on smaller screens and when scaling, content div is placed under menu div. I have tried a bit with different css properties to lock them. but it seems like it does not work. I have also tried with position properties, but it seems impossible. Actually, they should stay calm and scale their size as the rest of the page scales. As usual, I have completely messed up again and can no longer see the forest for just trees. I attach the two css blocks. Can you see what's wrong? div.menu_box { color: #008833; position: fixed; margin-top: 0px; margin-left: 10px; width: 165px; /*max-height; 100px;*/ height: 300px; /*border: solid 1px;*/ /*border-color: #ffcc99;*/ /*border-radius: 5px;*/ } div.content_box { display: block; margin-left: auto; margin-right: auto; /*width: 50%;*/ /*position: fixed;*/ margin-top: 5px; width: 950px; max-height: 100%; margin: auto; border: solid 1px; border-color: #ffcc99; border-radius: 5px; }
  2. This center the text: h3.content { font-family: "Helvetica, Ariel"; text-align: center; font-weight: normal; font-size: 15px; /*display: list-item;*/ } This is not: h4.headline_bold { display: inline; font-family: "Helvetica, Ariel"; text-align: center; font-weight: bold; font-size: 15px; color: #000000; } Can someone tell me why, please?
  3. I got two DIV boxes. One for menu box on the left margin and one centered div for the content. To make these position themselves on the same line next to each other. have I used a position: fixed; on the DIV box menu. The problem is when I try to scale the site. The menu does not scale as it should, but it stays in place, but it builds on content that does not scale at all, I send with both CSS and HTML. I hope there is someone here who can look at it. I have worked a lot with this, it may therefore seem a bit messy, but it is not difficult to understand the composition.Thanks a lot guys, and happy new year. 1: index.php file 2: header.php 3: mnu.php 4: footer.php 5: nav.css <?php require_once("header.php") ?> <body class="base"> <div class="wrapper"> <?php require_once("mnu.php") ?> <!--Conten Boxt Start--> <div class="w3-content w3-card-4 w3-margin-top w3-padding w3-light-gray"> <!-- Content Start --> <div class="main_content"> <h4 class="headline_bold"></h4> <h3 class="content"> <!-- Content slutt --> </div> <!-- content box slutt --> </div> <!-- Footer Start --> <?php require_once("footer.php") ?> <?php require_once("header.php") ?> <body class="base"> <div class="wrapper"> <?php require_once("mnu.php") ?> <!--Conten Boxt Start--> <div class="w3-content w3-card-4 w3-margin-top w3-padding w3-light-gray"> <!-- Content Start --> <div class="main_content"> <h4 class="headline_bold"></h4> <h3 class="content"> <!-- Content slutt --> </div> <!-- content box slutt --> </div> <!-- Footer Start --> <?php require_once("footer.php") ?> <div class="menu_box w3-content w3-card-4 w3-padding w3-light-gray" style="line-height: 6px"> <h4 class="headline_bold">Naviger</h4><br> <p><a class="mnu_link" href="index.php" title="Tilbake til Start">Hjem </a></p> <p><a href="contact.php" title="Kontakt">Kontakt </a></p> <p><a href="std_org.php" title="Historie">Historie </a></p> </div> <div class="copyright_box"><br> <?php echo "<class='copyright_box'>Copyright &copy; 1999-"; $year = date("Y"); echo $year ?> <!-- slutt copyright_box --> </div> <!-- slutt wrapper --> </div> </body> </html> /*CSS Document*/ html.size { height: 100%; width: 100%; } body.base { background-color: #ffffff; height: 100%; width: 100%; margin: auto; margin-top: 10px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-family: "Helvetica, Ariel"; } div.wrapper { height: 100%; width: 100%; display: block; margin: auto; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; /*border: solid 1px; border-color: #ffcc99; border-radius: 5px;*/ } div.logo_box { background-image: url("../img/logo.png"); margin: auto; height: 110px; width: 538px; /*border: solid 1px; border-color: #999966; border-radius: 5px;*/ } div.menu_box { color: #008833; position: fixed; margin-top: 0px; margin-left: 10px; width: 165px; /*max-height; 100px;*/ height: 300px; /*border: solid 1px;*/ /*border-color: #ffcc99;*/ /*border-radius: 5px;*/ } div.content_box { display: block; margin-left: auto; margin-right: auto; /*width: 50%;*/ /*position: fixed;*/ margin-top: 5px; width: 950px; max-height: 100%; margin: auto; border: solid 1px; border-color: #ffcc99; border-radius: 5px; } /*img.stamp { margin-top: 20px; display: block; margin-right: auto; margin-left: auto; align: center; height: 172px; width: 222px; opacity: 0.4; }*/ div.main_content { margin-top: 5px; width: 630px; max-height:100%; margin: 35px auto; font-weight: normal; /*background-color: #cc9966;*/ } p.bold{ font-family: "Helvetica, Ariel"; font-weight: bold; font-size: 18px; } a.bold{ font-family: "Helvetica, Ariel"; font-weight: bold; color: #000000; } h1.headline { display: inline; font-family: "Helvetica, Ariel" ; font-weight: bold; font-size: 14px; color: #000000; } h1.headline_bold { display: inline; font-family: "Helvetica, Ariel" ; font-weight: bold; font-size: 14px; color: #000000; } h1.headline_bolder { display: inline; text-align: center; font-family: "Helvetica, Ariel"; font-weight: bolder; font-size: 18px; /*line-height: 1;*/ /*letter-spacing: 5px;*/ } h2.headline { font-family: "Helvetica, Ariel"; font-weight: bold; font-size: 14px; color: #000000; } h3.content { font-family: "Helvetica, Ariel"; text-align: center; font-weight: normal; font-size: 15px; display: list-item; } h3.content_link { font-family: "Helvetica, Ariel"; text-align: center; font-weight: normal; font-size: 15px; display: list-item; } h3.contact_link { font-family: "Helvetica, Ariel"; text-align: center; font-weight: normal; font-size: 16px; } div.content { max-height: 100%; font-family: "Helvetica, Ariel"; text-align: left; font-weight: normal; font-size: 17px; /*display: list-item;*/ } div.copyright_box { width: 100%; height: 100%; font-family: "Helvetica, Ariel"; font-size: 11px; text-align: center; color: #000000; /*border: solid 1px; border-color: #000000; border-radius: 5px;*/ }
  4. I wish you all a merry christamas. Eat well, enjeoy with family and friends and be happy. (we say so in norwegian. I dont know how it sounds for the english speaking people)
      • 1
      • Like
  5. Spot on Kevin I have already seen many of the benefits. Thanks 😁👍
  6. Great, thanks. I will check it out.
  7. yes, I am aware of this gizmola. And I got it all ready in my mind and thoughts. Or, as much as I can have is more correct. The servers are running on Ubuntu / Debian Linux platform like when I was one of the owners (CEO). Web server SW is Apache, DB is MySQL/MariaDB. Server-side script for developing dynamic web pages is PHP. So I have control over most things.
  8. I am running Win11 Home on my local laptop with i7 processor 16 GB RAM. Possibly I have been on it or asked about it further up. But right now it's hard to read through all the posts to see. Therefore, I rather ask again and possibly once too much, but ..... So I will set up a testing server. I started with this, but then it never happened. Got lots of work and do, and in the end it was forgotten. So thus I did as before and tested directly on www-server where my domain is hosted. I am running WIN11 on my local laptop with an i7 processor with 16 GB RAM. Is it to recommend running it in the default directory or is it the same shit which directory I use. I would still like to download AMPPS or WAMP or XAMPP, but (maybe I remember wrong) something tells me that AMPPS and WAMP or XAMPP do not like other directories other than the default one suggested by the developer / web server itself. The reason I want to install it like a all in all package is to save time, I am not so good to do it manually anymore and it is complete with PHP and MySQL. I can do that, but I need some sharp heads used to do this manually. And from where to download the versions I want: Apache 2.4.6 PHP 7.4 MySQL 5.7.23 These are the same versions my web hotel is running. So I need some tips, tricks, and suggestions all from where I can download what I need and how to implement it manually. Is it understood what my need is, do you want to help me send me some tips, tricks, and suggestions? Please 😄
  9. Hello, and good evening DevonZeb. I was new here in February 2021. I know exactly what you are talking about. Self i have bean away from programming for over 10 years. woke up a spring morning 1,5 years ago. Couldnt do anything. It was like blown away. And it wasnt in my imagination it was so hard learning again. It is like i was writing in another thread here. It is like waking up from coma and cant do anything. Got to learn everything up again. And that is not easy at the age of 50.
  10. Good evening Sprig 🙂 I am like you and manny others here "of the old school". I was new here in February 2021.I have bean away from Programming and the life inside the IT univers for more than 10 years. So i know exactly what you are talking about. When i started programing again i thought i would be a easy match. I was so wrong. It was like waking up from coma and have to learn every thing up up up and up again. Good luck Sprig, and welcome 🙂 Leon (Norway)
  11. Nice and a smart move barand, wery! As the person you are, of all, YOU, you go out public to mark me and throwing all the blame on me? It's ok. I let you do that. But... I know you have frinds and like-minded in here on PHP Freaks. You have bean here since 2002 or something. You are well known among the other once her. PHP Freaks is a site i came over by chance, and it was a lucky shot that I did so. Here I also found "my" like-minded people. People who needed help. I did it because I've been away from the "subject programming" for over ten years (since 2010/11). Things I could do were totally gone. I had to learn everything again. There are also "several reasons" for this. Blue. a stroke in 2014. But I'm also 50 years old in January, so everything is not so good and functional anymore , by the case learning. These are things I've told barand about before he knows a lot of me and my future as a self developed and a businessman and one of the persons and owners behind the biggest webhosting and data center in Norway. That is a story back to 1998/99 (actual in 1995, but that is a longer story). So he knows about it, about me. There are also some other incidences as a traffic accident in 1988 with major head injuries that make memory and earning not my biggest "thing" in life. soooo ...... maxxd, then you have heard a little of the one side of the story. I never felt for explain or tell others about what happened between me and barand, or other things for that mather. And still barand is trying to put me in a place i dont belong. Remember there is always two sides of a story, two sides of whats true. Here is the rest of my version. (And i have never tried to hide that this script was something barand had done) Just go back and look up in this tread. I never feel to put a stamp on or blame other people. I let them do their things. As long.........as long as it is not unfair and not goes over head of me or any of mine. I am concerned about justice and that everyone including myself is treated with respect. Now i feel for saying. (never thought i would go SOOOO in to discuss OT on a internet forum). Me and barand was skyping and working on the "marian project" one nigh(i think it was in june)t, like we had done since around February. Me in Norway and him in GB. That day i had tried to do some adjustments and corrections on the site barand has made for me, and. In that matter i removed hes signature. I tried out a few things. Some were luckyly put back the way barand did it Part of the reason why barand should help me with this was that I could use it to learn / practice. That was not a agrement among us from the beginning. But along the way, it became more and more clear that this was what this project was about, and that I would be able to use it later for what it was intended for. A gift from me to my marina where I live. They have had problems for a long time with running the marina association for several years due to lack of time, and that the marina is run on a voluntary basis (unpaid). all with manny problems, like a surgery that went wery wrong, eating heavy medications and a loss of a friend (barand knows all of this) i now felt like stating to go realy in to study and learn barands code. So the whole day i was doing this and sudenly some time in the evening/night barand showed up. And i was actualy waiting for him because i was exited see him on Skype. Like i throw all in my hands away i contacted him/or he was contacting me. I had a lot of questions to ask him. So now i forgot all about what i had done and put them back the way they was. I had the signature/copyright text in the footer file from another site i was working on. Where i forgot to change the text and implement barands information. It still had my name and e-mail, and my intension was to put in barands name and e-mail. Hard to explain and be belived. You got to know me to to understand(me). So, over to the core of the marina.php file where all begun. I tried to learn the PHP and AJAX he set up in this file. He realy did a great job. I comment out hes signature and I commented out part of hes scripts and blocks, just to see what the diferent functions in the script(s)works/do, among other things. If I had the intention to remove it (take advantage of), then I had not just commented it away. I would totally remove it in the source code. There were many things up there that had been commented out, but that he had not seen. besides the one thing that was visually visible in the browser. Until this we had a good collaboration on both mic and writing on Skype. When he became aware of this, he totally turned on his heels and I have never seen a person turn so completely on mood, situation and not least receptivity to listen to what is an explanation. No, barry has since made his own version and locked me out. I tried then as now to explain what had happened. Both in writing by email, on Skype and on pm here at PHP Freaks. Lately I have been trying to sell the script since I do not want to finish it. I have received several stakeholders for it. There is one offer in particular from Denmark that seems to be serious enough. When I got an answer from Denmark a few days ago, I contacted barand the same day / evening and told him about it, and that I would divide the sum 50/50, but now I do not know if it works either. Since I contact Denmark, I wanted to clean up and make the code more readable. That's why I've now messed up the whole script and rendered it useless. Why would I make myself an enemy with someone I depended on to move on? I know that with this I am in danger of not receiving help anymore here on PHP Freaks or being banned. Of course I hope we can all be friends, but ... how far are you willing to go? I also feel unfairly treated. Again, sorry for what I did that seemed like taking your credit for the work I will forever be grateful for. For that is what you accuse me of, and who have not been willing to listen to me. Sorry.... (i had a backup of the scripts/site, but deleted it when i was about delete the web root files and put in the backup).
  12. <?php session_start(); $ROOT = str_replace('\\', '/', $_SERVER['DOCUMENT_ROOT']) . '/'; $HOST = 'http://' . $_SERVER['HTTP_HOST'] . '/'; if (!isset($_SESSION['isadmin'])) { header("Location: {$HOST}marina.php"); exit; } include $ROOT.'db_inc.php'; $pdo = pdoConnect(); const PAGETITLE = 'BÄtplasskart og Venteliste'; const HELPBUTTON = "<span id='info_btn' class='w3-badge w3-small w3-white w3-border w3-border-white w3-right' title='Hjelp'>?</span>"; ////////////////////////////////////////////////////////////////////////// // HANDLE AJAX REQUEST // if (isset($_GET['ajax'])) { if ($_GET['ajax']=='getberth') { $res = $pdo->prepare("SELECT m.fname , m.lname , m.mobile , m.email , b.name as bname , b.make , b.model , COALESCE(be.berth_no, '') as berth_no , CASE WHEN be.berth_no IS NULL THEN CONCAT('(Ventet siden ' , date_format(bb.date_from, '%M %D %Y') , ')') ELSE '' END as since FROM member m JOIN boat b USING (member_id) JOIN boat_berth bb ON b.boat_id = bb.boat_id AND curdate() BETWEEN bb.date_from AND COALESCE(bb.date_until, '9999-12-31') LEFT JOIN berth be USING (berth_id) WHERE b.boat_id = ? "); $res->execute( [ $_GET['boat'] ] ); $row = $res->fetch(); $today = date('Y-m-d'); if (!isset($_SESSION['member_id'])) { $row['fname'] = $row['lname'] = $row['mobile'] = $row['email'] = ''; // member info redacted for non-members } $datefield = isset($_SESSION['isadmin']) ? "<label>Endret dato</label><input class='' type='date' id='reberth_date' value='$today'>" : "&nbsp;<input type='hidden' id='reberth_date' value='$today'>"; $resp = <<<RESP <div class='w3-panel w3-blue-gray'> <h3>BÄtplass ID: {$row['berth_no']} {$row['since']} <span class="w3-right w3-margin-right" onclick="hideInfo();"><i class='fas fa-times'></i></span> </h3> </div> <div class='w3-row-padding'> <div class='w3-third'> <label>BÄtnavn</label>{$row['bname']}<br> <label>Fabrikat</label>{$row['make']}<br> <label>Type/Modell</label>{$row['model']}<br> </div> <div class='w3-third'> <label>Eier</label>{$row['fname']} {$row['lname']}<br> <label>Mobilnummer</label>{$row['mobile']}<br> <label>E-mail</label>{$row['email']} </div> <div class='w3-third'> $datefield </div> </div> RESP; exit($resp); } elseif ($_GET['ajax'] == 'reberth') { if (!isset($_SESSION['isadmin'])) { exit(marina($pdo)); } $pdo->beginTransaction(); try { $stmt = $pdo->prepare("UPDATE boat_berth SET date_until = ? - INTERVAL 1 DAY WHERE boat_id = ? AND date_until IS NULL "); $stmt->execute( [ $_GET['date'], $_GET['boat'] ] ); $stmt = $pdo->prepare("INSERT INTO boat_berth(boat_id, berth_id, date_from, date_until) VALUES (? , ?, ?, null) "); $stmt->execute( [ $_GET['boat'], $_GET['berth'], $_GET['date'] ] ); $pdo->commit(); } catch(PDOException $e) { $pdo->rollBack(); throw $e; } exit(marina($pdo)); } elseif ($_GET['ajax'] == 'dispose') { if (!isset($_SESSION['isadmin'])) { exit(marina($pdo)); } $pdo->beginTransaction(); try { $stmt = $pdo->prepare("UPDATE boat_berth SET date_until = ? - INTERVAL 1 DAY WHERE boat_id = ? AND date_until IS NULL "); $stmt->execute( [ $_GET['date'], $_GET['boat'] ] ); $stmt = $pdo->prepare("UPDATE boat SET disposal_date = ? WHERE boat_id = ? "); $stmt->execute( [ $_GET['date'], $_GET['boat'] ] ); $pdo->commit(); } catch(PDOException $e) { $pdo->rollBack(); throw $e; } exit(marina($pdo)); } } //////////////////////////////////////////////////////////////////// /* Shape and size of the boat graphics / illustrations */ function boat($id, $size, $rotate, $x, $y) { switch ($size) { case 1: $width = 66; $height = 18; break; case 2: $width = 78; $height = 22; break; case 3: $width = 88; $height = 26; case 4: $width = 88; $height = 26; } /* The graphics / illustrations of the boats are in three parts. There are bow, midships and stern.<br> ellipse is the shape of the bow */ $cx = $width/2; $cy = $height/2; $svg = "<g transform='translate($x, $y)'> <g transform='rotate($rotate $cx $cy)'>\n"; $cx2 = $width/2; $rx2 = $cx2; $cy2 = $height/2; $ry2 = $cy2; $svg .= "<ellipse cx='$cx2' cy='$cy2' rx='$rx2' ry='$ry2' class='boat boat1' data-sel='0' data-size='$size' data-id='$id'/>\n"; $cx1 = $width/10; $rx1 = $cx1; $cy1 = $height/2; $ry1 = $cy1; $svg .= "<ellipse cx='$cx1' cy='$cy1' rx='$rx1' ry='$ry1'class='boat' />\n"; $rx3 = $cx1; $ry3 = 0; $rw3 = $cx2 - $cx1; $rh3 = $height; $svg .= "<rect x='$rx3' y='$ry3' width='$rw3' height='$rh3' class='boat' />\n"; $svg .= "</g> </g>\n"; return $svg; } function berth($bid, $no, $size, $rotate, $boat, $x, $y) { switch ($size) { case 1: $width = 26; break; case 2: $width = 30; break; case 3: case 4: $width = $rotate==180 ? 153 : 34; break; } $even = (intval(substr($no, -2)))%2; $offsets = [ 1 => [ 0 => [ 'x' => 6-$width, 'y' => 5], 1 => [ 'x' => 6-$width, 'y' => 28], ], 2 => [ 0 => [ 'x' => 6-$width, 'y' => -3], 1 => [ 'x' => 6-$width, 'y' => 32], ], 3 => [ 0 => [ 'x' => 6-$width, 'y' => -10], 1 => [ 'x' => 60, 'y' => 3], ], 4 => [ 0 => [ 'x' => 6-$width, 'y' => -10], 1 => [ 'x' => 60, 'y' => 3], ] ]; $height = 50; $ty = $height/2; $tx = $width/2 + 3; $ta = -90; $svg = "<g transform='translate($x, $y)'>\n"; if ($rotate == -90) { $svg .= "<path d='M 0 0 v $height h $width v -$height' fill='#000079' stroke='#C0C0C0' stroke-width='2' class='berth' data-bid='$bid' data-bno='$no' data-boat='$boat' data-size='$size' />\n"; } elseif ($rotate == 90) { $svg .= "<path d='M 0 $height v -$height h $width v $height' fill='#000080' stroke='#C0C0C0' stroke-width='2' class='berth' data-bid='$bid' data-bno='$no' data-boat='$boat' data-size='$size' />\n"; } else { $svg .= "<path d='M 0 20 v -20 h $width v 20' fill='#000080' stroke='#C0C0C0' stroke-width='2' class='berth' data-bid='$bid' data-bno='$no' data-boat='$boat' data-size='$size' />\n"; $ty = 18; $tx += 30; $ta = 0; } if ($boat) { $svg .= boat($boat, $size, $rotate, $offsets[$size][$even]['x'], $offsets[$size][$even]['y']); } $bclass = $boat ? 'bno1' : 'bno2'; $svg .= "<text x='$tx' y='$ty' text-anchor='middle' class='$bclass' transform='rotate( $ta $tx $ty)'>$no</text>\n"; $svg .= "</g>\n"; return $svg; } function marina($db) { /* Controling the piers and berths */ $piers = [ 'A' => ['x0' => 60, // Positioning sideways of pier A 'y0' => 100, // Positioning up/down of pier A 'w' => 988, // Length pier A 'h' => 16, // Width Pier A 'bw' => 26 // Berth width pier A ], 'B' => ['x0' => 198, // Positioning sideways of pier B 'y0' => 324, // Positioning up/down of pier B 'w' => 810, // Length pier B 'h' => 16, // Width Pier B 'bw' => 30 // Berth width pier B ], 'C' => ['x0' => 310, // Positioning sideways of pier C 'y0' => 596, // Positioning up/down of pier C 'w' => 612, // Length pier C 'h' => 16, // Width Pier C 'bw' => 34 // Berth width pier C ] ]; $svg = "<svg width='1140' height='840' viewBox='0 0 1140 840'> <defs> <radialGradient id='myGradient'> <stop offset='10%' stop-color='#000000' /> <stop offset='95%' stop-color='#808080' /> </radialGradient> <radialGradient id='myGrad2'> <stop offset='10%' stop-color='#A91723' /> <stop offset='95%' stop-color='#808080' /> </radialGradient> <style type='text/css'> .boat { fill: #FCF8E8; } .boat1 { cursor: pointer; } .pierno { font-size: 20pt; fill: #FFF; } .piernox { font-size: 12pt; fill: #FFF; } .qno { font-size: 20pt; fill: #CCC; } .bno1 { font-size: 10pt; fill: #444; } .bno2 { font-size: 10pt; fill: #FFF; } .title1 { font-size: 30pt; font-family: gabriola, cursive; font-style: italic; fill: #FFF; } .title2 { font-size: 20pt; font-family: gabriola, cursive; font-style: italic; fill: #FFF; } </style> </defs> "; $svg .= "<rect x='0' y='0' width='1140' height='800' fill='#000080' /> <rect id='waiting-area' x='0' y='700' width='1140' height='140' fill='#808080' /> <!--<text x='1130' y='690' fill='#808080' font-size='8pt' transform='rotate(-90 1130 690)'>&copy; 2021 Barry Andrew</text>--> <path d='M 0 700 h 1140' stroke='#006EFC'/> <text x='5' y='695' fill='#C0C0C0' font-size='20'>FÞrste 10 pÄ venteliste for bÄtplass.(+ er long-side-plasser pÄ brygge C)</text> <text x='1080' y='720' text-anchor='middle' fill='#000080' font-size='18'>Slette fra</text> <text x='1080' y='795' text-anchor='middle' fill='#000080' font-size='18'>venteliste</text> "; // Berths $res = $db->query("SELECT b.berth_id , b.pier , b.berth_no , b.size , bb.boat_id FROM berth b LEFT JOIN boat_berth bb ON b.berth_id = bb.berth_id AND CURDATE() BETWEEN bb.date_from AND COALESCE(bb.date_until, '9999-12-31') ORDER BY berth_no "); foreach ($res as $r) { $px = $piers[$r['pier']]['x0'] + $piers[$r['pier']]['w']; $bno = intval(substr($r['berth_no'], -2)); switch ($r['pier']) { case 'A': case 'B': $y = ($bno%2 == 0) ? $piers[$r['pier']]['y0'] - 50 : $piers[$r['pier']]['y0'] + 16; $x = $px - floor(($bno+1)/2) * $piers[$r['pier']]['bw']; $rotate = ($bno%2 == 0) ? -90 : 90; $svg .= berth($r['berth_id'], $r['berth_no'], $r['size'], $rotate, $r['boat_id'], $x, $y); break; case 'C': if ($bno%2 == 0) { $y = $piers[$r['pier']]['y0'] - 50; $x = $px - floor(($bno+1)/2) * $piers[$r['pier']]['bw']; $rotate = -90; } else { $y = $piers[$r['pier']]['y0'] + 16; $x = $px - floor(($bno+1)/2) * $piers[$r['pier']]['w']/4; $rotate = 180; } $svg .= berth($r['berth_id'], $r['berth_no'], $r['size'], $rotate, $r['boat_id'], $x, $y); break; } } // Jetties for ($j='A'; $j<='C'; $j++) { $x = $piers[$j]['x0']; $y = $piers[$j]['y0']; $h = $piers[$j]['h']; $w = $piers[$j]['w']; $tx = $piers[$j]['x0'] - 28; $ty = $piers[$j]['y0'] + 17; $svg .= "<rect x='$x' y='$y' width='$w' height='$h' fill='#C38E31' />\n"; /* Pier color */ $svg .= "<text x='$tx' y='$ty' fill='#FFF' class='pierno'>$j</text>\n"; } /* Positioning and appearance of the molo */ $ty += 28; $svg .= "<text x='$tx' y='$ty' fill='#FFF' class='piernox'>+</text>\n"; $svg .= "<path d='M 1116 0 h 16 v 200 l -130 412 h -16 l 130 -412 z' fill='#ACACAC' />" ; foreach ($piers as $p) { $svg .= gangplank($p['x0'] + $p['w'] - 6, $p['y0'] + 1, 75); } // Unberthed boats $res = $db->query("SELECT b.boat_id , b.size FROM boat b JOIN boat_berth bb ON b.boat_id = bb.boat_id AND bb.berth_id IS NULL AND CURDATE() BETWEEN bb.date_from AND COALESCE(bb.date_until, '9999-12-31') ORDER BY b.size, bb.date_from "); $tx = 4; $ty = 725; $by = 705; $waiting = []; foreach ($res as $r) { $waiting[$r['size']][] = $r['boat_id']; } foreach ($waiting as $sz => $q) { switch ($sz) { case 1: $p = 'A'; break; case 2: $p = 'B'; break; case 3: $p = 'C'; break; case 4: $p = '+'; break; } $svg .= "<text x='$tx' y='$ty' fill='#FFF' class='qno'>$p</text>\n"; $k = count($q); $xtra = $k > 10 ? $k - 10 : ''; $q = array_slice($q, 0, 10); $bx = 30; foreach ($q as $id) { $svg .= boat($id, $sz, 180, $bx, $by); $bx += 92; } $ky = $ty - 6; if ($xtra) $svg .= "<text x='$bx' y='$ky' fill='#FFF' fill='#FFF' font-size='20'>+$xtra</text>\n"; $ty += 32; $by += 32; } $svg .= "<circle id='vortex' cx='1080' cy='750' r='25' fill='url(\"#myGradient\")' />"; $svg .= '</svg>' ; return $svg; } function gangplank($x, $y, $len) { $svg = "<rect x='$x' y='$y' width='$len' height='12' fill='#E0E0E0' stroke='#666' />\n"; for ($i=5; $i<$len; $i+=5) { $ix = $x + $i; $svg .= "<path d='M $ix $y v 12' fill='none' stroke='#666' />\n"; } return $svg; } ?> <!DOCTYPE html> <html lang='no'> <head> <title>Brandbu SmÄbÄtForening - BÄtplasser</title> <meta http-equiv='Content-Type' content='text/html; charset=utf-8'> <link rel='stylesheet' href='https://www.w3schools.com/w3css/4/w3.css'> <link rel='stylesheet' href='https://use.fontawesome.com/releases/v5.15.1/css/all.css'> <link href='css/footer_marina.css' rel='stylesheet' type="text/css"> <script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js'></script> <script type='text/javascript'> $().ready(function() { $("#nav-marina").addClass("w3-bottombar") init() $("#info_btn").click( function() { $("#infopanel").toggle() }) }) function init() { $('.boat1').click(function() { var boat = $(this).data('id') $('.boat').css('fill', '#FCF8E8') $('.boat').attr('data-sel', 0) $(this).attr('data-sel', 1) $(this).parent().children().css('fill', '#FF0000') $.get( '', {'ajax':'getberth', 'boat':boat}, function(resp) { $('#query-results').html(resp) $('#query-results').show() location.href = '#query-results' }, 'TEXT' ) }) $('.berth').click( function() { var boat = $(".boat1[data-sel='1']") if (!boat) { return } else { var boatsize = $(boat).data('size') var berthsize = $(this).data('size') if (berthsize != boatsize) { return } if ($(this).data('boat')) return; var boatid = $(boat).data('id') var berthid = $(this).data('bid') var date = $('#reberth_date').val() $.get( '', {'ajax':'reberth', 'boat':boatid, 'berth':berthid, 'date':date}, function(resp) { $('.boat').attr('data-sel', 0) $('#marina').html(resp) init() }, 'TEXT' ) } }) $("#vortex").click( function() { var boat = $(".boat1[data-sel='1']") if (!boat) { return } var boatid = $(boat).data('id') var date = $('#reberth_date').val() $.get( '', {'ajax':'dispose', 'boat':boatid, 'date':date}, function(resp) { $('.boat').attr('data-sel', 0) $('#marina').html(resp) init() }, 'TEXT' ) }) } function hideHelp() { $("#infopanel").toggle() } function hideInfo() { $('#query-results').hide() $('.boat').css('fill', '#FCF8E8') $('.boat').data('sel', 0) } </script> <style type='text/css'> label { background-color: #607d8b; color: white; border: 1px solid white; display: inline-block; padding: 4px; width: 130px; margin-right: 10px; } #query-results { display: none; } #vortex:hover { cursor: pointer; fill: url('#myGrad2'); } #info_btn { cursor: pointer; } #infopanel { display: none; } .berth:hover { fill: #2e90ff; cursor: pointer; } body { background-color: #000080; } </style> </head> <body> <?php include $ROOT.'header.php' ?> <div id="infopanel" class="w3-card-4 w3-container w3-sand"> <div class="w3-panel w3-brown w3-center w3-padding w3-large"> Informasjon <span class="w3-right w3-margin-right" onclick="hideHelp();"><i class='fas fa-times'></i></span> </div> <p>Denne siden gir en oversikt over marinaen, bÄtene og bÄtplassene i BSF marina. I tillegg vil du finne noe informasjon om RÞykenvik og Randsfjorden her.</p> <ul> <li>Klikk pÄ en bÄt (baug-omrÄdet) for Ä se informasjonen om den bÄten/eieren i et informasjonspanel Þverst pÄ siden.</li> <li>NÄr en bÄt er valgt, kan du flytte den til en annen bÄtplass av samme stÞrrelse ved Ä klikke pÄ en tom kÞye.</li> <li>Du kan ogsÄ slette bÄten ved Ä klikke pÄ "slette fra venteliste"-knappen nederst til hÞyre.</li> <li>Disse bevegelsene brukes fra i dag. Hvis du vil at de skal brukes pÄ en annen dato, kan du angi Þnsket dato i bÄtens informasjonspanel</li> <li>De fÞrste 10 bÄtene (i datorekkefÞlge) for hver brygge som venter pÄ at en bryggeplass skal bli tilgjengelig, vises i "venteomrÄdet" nederst. Igjen, disse kan velges og tildeles en tilgjengelig bÄtplass.</li> </ul> </div> <div class='w3-container'> <div id='query-results' class='w3-card-4 w3-margin w3-padding w3-light-gray'> <!-- click response --> </div> <div id='marina' class='w3-container w3-padding w3-center' style='overflow:auto;'> <?=marina($pdo)?> </div> </div> <?php include $ROOT.'footer_marina.php'; ?> </body> </html>
  13. As explained, this is a script that barand has put together for me. I've probably messed it up properly, he's done a good job of getting me started again, but I have a long way to go. So if I understand you two right. NO LINESPACE BETWEEN <? PHP and?> Will that say not abow the block or below the block to? I know I can take shortcuts that are stupid to make it easier to read the code, both along the way and afterwards. So what I spend an enormous amount of time on now is correcting all the mistakes I have "made". So I have to go through and make sure that everything that is between opening and frying PHP is without double line breaks / white space .. When you say this about the differences between the different IDEs that exist in the market. Do you mean that they treat the code differently or do you mean that they show the code in different colors? It's because I take shortcuts to make the code more readable to myself I break up the blocks. I am fully aware of that, but in eagerness and able to do more and in combination with the fact that I am tired, unconcentrated and just want to do a little more all the time, I do a lot of stupid things. And sometimes I can make so many changes that in the end I do not remember what I have done. I remember that I was very structured in the way I worked before, but everything is forgotten, unfortunately. Do you mean that you do not need to close <?php I never think I've tried before. I will remeber that 🙂 I will post the complete the full script from the marina.php file. That file is loooong. I will post it below of this post. After i have done that i have to go to bed. Its 11:00 in the morning here in norway now, so its on time to get some sleep. I haven't slept for 33-34 hours.
  14. Why do i get a; Syntax error unexpected '?' on the line below? $loggedin = $_SESSION['member_id'] ?? 0;
  15. No, it did not help to delete the <? Php and?> That were too many and I also made sure not to have any white space between <? Php .... and ....?> I also made sure not to have white space before them in the margin.
  16. O oh... Is that the reason. Got to try it. Give me 3 min. Yes, it has bean a realy long dau- 12:50 in the night here now 😼 Thanks for your suggestion.
  17. I thought you understood it was a session_start error when i say so. Here is a print screen of what the error is in letters. heres a screen dump: (before you ask. I have tried "require_once". It doesent help.)
  18. Please help me out here? I have had this error for weeks now, but i cant find the reason. And noe i even dont know where to look. I am totaly f***** The error is about "session_start" "<? php error_reporting (E_ALL); ini_set ('display_errors', '1'); ?> " Can the above error checker show errors even a site is opening normal? When I open a page with session_start, an error occurs, but when I open the same page without this, the page opens without problems and appears and appears completely without error. Ie. that all pages that contain session_start then the error will appear, as long as I have activated error check. Have for a long time suspected that this error is related to log in. So I tried to run error check directly from the log in page. I did not get any errors there, but I can not log in. On the log in page there is no session_start, but there is a "$ loggedin = $ _SESSION ['member_id'] ?? 0;" that is, this is a variable for session start. Or a global variable. So the error may be in db_inc.php as well, but I can not find the error. I do not understand what I am overlooking. I have tried as best I can to familiarize myself with the script. It's not set up by me. That's what barand has done, so before anyone asks why I can not ask barand. Then I say as it is. I do not understand that either, he has probably told me something, but ..... Easiest is to say: So, dont even ask. I hope anyway to get help to solve this problem. Can the "specified" error check indicate an error outside it is there? Or, it is there, but not where it is supposed to be. # counselless Below is some of the scripting from the files. Name of files included. **AJAX script in the.php is deleted because there is no relations in that of mater**. --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- db_inc.php <?php define("HOST",'****'); // Default database host. define("USERNAME",'****'); // Deafault database username . define("PASSWORD",'****'); // Default database password. define("DATABASE", '****'); // Default database name. function pdoConnect($dbname=DATABASE) { $db = new PDO("mysql:host=".HOST.";dbname=$dbname;charset=utf8",USERNAME,PASSWORD); $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $db->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC); $db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false); return $db; } ?> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- header.php <?php //error_reporting(E_ALL); //ini_set('display_errors', '1'); ?> <?php $disabl1 = isset($_SESSION['member_id']) ? '' : 'w3-disabled'; $disabl2 = isset($_SESSION['member_id']) && isset($_SESSION['isadmin']) ? '' : 'w3-disabled'; $log_btn = isset($_SESSION['member_id']) ? 'Logg ut' : 'Logg inn'; ?> <?php session_start(); $ROOT = str_replace('\\', '/', $_SERVER['DOCUMENT_ROOT']) . '/'; $HOST = 'http://' . $_SERVER['HTTP_HOST'] . '/'; include $ROOT.'db_inc.php'; $pdo = pdoConnect(); $loggedin = $_SESSION['member_id'] ?? 0; unset( $_SESSION['member_id'], $_SESSION['isadmin']); if ($loggedin) { header("Location: {$HOST}marina.php"); exit; } $msg = ''; if ($_SERVER['REQUEST_METHOD']=='POST') { $res = $pdo->prepare("SELECT password , member_id , admin FROM member WHERE email = ? "); $res->execute([ $_POST['email'] ]); $row = $res->fetch(); if ($row && password_verify($_POST['password'], $row['password'])) { $_SESSION['member_id'] = $row['member_id']; if ($row['admin'] == 1) { $_SESSION['isadmin'] = 1; } header("Location: {$HOST}members.php"); exit; } else $msg = "<div class='w3-panel w3-red w3-padding'><p>Error: Kunne ikke logge inn!</p></div>"; } ?> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- marina.php <?php session_start(); $ROOT = str_replace('\\', '/', $_SERVER['DOCUMENT_ROOT']) . '/'; $HOST = 'http://' . $_SERVER['HTTP_HOST'] . '/'; include $ROOT.'db_inc.php'; $pdo = pdoConnect(); const PAGETITLE = 'BĂ„tplasskart og Venteliste'; const HELPBUTTON = "<span id='info_btn' class='w3-badge w3-small w3-white w3-border w3-border-white w3-right' title='Hjelp'>?</span>"; ////////////////////////////////////////////////////////////////////////// **AJAX script is deleted because there is no relations in that of mater** --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- login.php <?php error_reporting(E_ALL); ini_set('display_errors', '1'); ?> <?php session_start(); $ROOT = str_replace('\\', '/', $_SERVER['DOCUMENT_ROOT']) . '/'; $HOST = 'http://' . $_SERVER['HTTP_HOST'] . '/'; include $ROOT.'db_inc.php'; $pdo = pdoConnect(); $loggedin = $_SESSION['member_id'] ?? 0; unset( $_SESSION['member_id'], $_SESSION['isadmin']); if ($loggedin) { header("Location: {$HOST}index.php"); exit; } $msg = ''; if ($_SERVER['REQUEST_METHOD']=='POST') { $res = $pdo->prepare("SELECT password , member_id , admin FROM member WHERE email = ? "); $res->execute([ $_POST['email'] ]); $row = $res->fetch(); if ($row && password_verify($_POST['password'], $row['password'])) { $_SESSION['member_id'] = $row['member_id']; if ($row['admin'] == 1) { $_SESSION['isadmin'] = 1; } header("Location: {$HOST}index.php"); exit; } else $msg = "<div class='w3-panel w3-red w3-padding'><p>Ugyldig innlogging</p></div>"; } ?> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- front.php <div class='w3-content w3-card-4 w3-margin-top w3-padding w3-light-gray'> <div class="w3-content"> <div class='w3-panel w3-blue-gray w3-center'> <h3>Infrormasjon og Nyheter i Brandbu SmĂ„bĂ„tforening, RĂžykenvik og pĂ„ Randsfjorden.</h3> </div> <div class='w3-container'> <h4>Registrere som medlem, legge inn bĂ„t og fĂ„ tildelt bĂ„tplass.</h4> <p>Det er gjort sĂ„ pier A, B eller C velges automatisk som visninglg av kun de ledige plasser pĂ„ registreringsidens nedtrekksmeny for pier-valg/for hvilke pier man tildeles. Scriptet skiller mellom oddetall og partall pĂ„ alle pierene inkl. B brygge/pier. Alt skjer automatisk selv om det er bĂ„de 3 og 3,5 meters plasser der. Dette skjer ut i fra hvilke bredde pĂ„ bĂ„ten som legges inn i registreringskjemaet. Det skal ikke gĂ„ ann Ă„ fĂ„ stĂžrre plass enn hva systemet er satt til Ă„ beregne som tilpasset for hver brygge/plass. <p> <h4>Log In</h4> <p>Jeg har generert e-postadresser for alle testmedlemmene. Alle e-poster har utforming "[email protected]". Ved en tilfeldighet har alle medlemmer valgt samme passord ("passord"). Scott Chegg er for tiden utnevnt til administrator, sĂ„ for eksempel <ul> <li>Logg inn som Admin</p> <pre> E-mail : [email protected] Passord: password </pre> </li> <li>Logg inn som normalt medlem</p> <pre> E-mail : [email protected] Passord: password </pre> </li> </ul> <p> Gjestetilgang gis for Ăžyeblikket menyalternativene "BĂ„tplass" og "Innmelding" (og "Logg inn", selvfĂžlgelig) </p> <p> Bare administratorer har menyfunksjonen "Faktura" tilgjengelig. </p> <h4> Marina.php </h4> <p> &bull; Gjestene &ndash; kan se kartet og klikke pĂ„ bĂ„ter, men medlemsdata er skjult for dem. De kan ikke flytte bĂ„ter. <br> &bull; Medlemmer &ndash; kan klikke bĂ„ter og se medlemsdata. De kan heller ikke flytte bĂ„ter. <br> &bull; Administratorer &ndash; kan klikke bĂ„ter, se medlemsdata og flytte bĂ„ter. </p> <p> Lagt til brygge C + for bĂ„ter med bjelke over 3,8 meter. Disse bĂ„tene har nĂ„ sin egen venteliste. </p> <p> Alle ventelister utvidet til Ă„ vise de 10 fĂžrste bĂ„tene i hver liste. </p> <h4> Members.php </h4> <p> Medlemmenes medlemsnummer vises pĂ„ listen. </p> <p> Medlemmer kan redigere sine egne personlige data. De kan ogsĂ„ legge til detaljer om den nye bĂ„ten sin (om nĂždvendig). <ul> <li> Hvis den nye bĂ„ten har samme stĂžrrelse som den gamle bĂ„ten, blir bĂ„tplassen beholdt </li> <li> Hvis den nye bĂ„ten er mindre enn den gamle bĂ„ten, blir bĂ„tplassen beholdt til slutten av medlemsĂ„ret og deretter plassert pĂ„ ventelisten for en mindre bĂ„tplass </li> <li> Hvis den nye bĂ„ten er stĂžrre enn den gamle bĂ„ten, plasseres den nye bĂ„ten i venteliste for bredere bĂ„tplass. </li> <li> Den gamle bĂ„ten fjernes i alle tilfeller. </li> </ul> <p> Administratorer kan redigere alle medlemmers personlige data og angi / deaktivere medlemmers administratorstatus. Administratorer kan ogsĂ„ fjerne medlemmer (i sĂ„ fall blir bĂ„ten deres ogsĂ„ fjernet) </p> <h4> Register.php </h4> <p> Et for Ăžyeblikket tilgjengelig medlemsnummer vises pĂ„ skjemaet. Ved registrering tildeles medlemmet dette medlemsnummeret </p> <h4> Fakturaer </h4> <p> Disse viser nĂ„ medlemmets navn og medlemsnummer </p> </div> </div> </div> </div> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- index.php <?php session_start(); $ROOT = str_replace('\\', '/', $_SERVER['DOCUMENT_ROOT']) . '/'; $HOST = 'http://' . $_SERVER['HTTP_HOST'] . '/'; const PAGETITLE = "Velkommen"; include $ROOT.'header.php'; include $ROOT.'front.php'; //For you only. Remove when not required include $ROOT.'footer.php'; ?>
  19. I got this "<class="w3-bar-item w3-button">" The buttons and the bar got the color #008833 (green), the hover color is standard light grey, but I want it to hoover in my specified color (#008833) and hold on to this colorff6633 (orange) when its clicked/chosen and hold on to that color (#ff6633) when it is on that site/page. I tried to find the solution for this in the index of w3 schools index over w3.css, but i couldn't find it, dosent it exist or? (correct me if i am wrong?)
  20. barand, thanks 🙂 (vomit, that was a good one đŸ€ŁđŸ˜œ)
  21. Yes, that's exactly what I was talking about. You probably threw out some "words" I left out and say. I'm too careful to say too much here yet because I'm fresh in here and do not know where the line is laid. Besides, I have been away from the "subject" for too long to be able to engage in longer discussions about what is good or bad. It's too much new and too much to get acquainted with right away in addition to the fact that I struggle to remember what I could from before. It is 11 years ago and more than that since I was involved in development. I dont know if you guys understand what i mean sometimes, but some times i realy struggle. And that's why i am so happy to find this site with so many good programmers and developers that is not afraid telling a Norwegian man (who feels so stupid) soon 50 years old how to do it even though he some times ask to much. Thank you 🙂
  22. Maybe it's because w3-css is new to me, but the fact is that i know css wer y well from before. I am not in to css3 or w3 css, that i look at as a kind of containers with a lot of ready to use css scripts/syntax. I am the old school that like to have control over what i am doing and what is happening because of what i have done. I feel like i am loosing that control with w3-css. Because every thing is pre-made, but i have seen it like this is something i have to learn. So thats why i am strugling with this. At least, they could have left a little from the basic of CSS when making this (horse shit). I call it like that because i am loosing the control i am used to have before when i was working with this. But i still got it in me. I have some external .css files. Or... there is a advantage with w3-css. Since we got so many platforms to relate to as developers, it is probably an advantage that we are spared a lot of extra work to have our sites to fit all over. We didn't need to do that before. But beyond that .... I wish you a good night requinix. I am tired and have to go to bed soon. It has bean a looooong day.
  23. A wery good night to upload files to the server.
  24. OK 🙂 I know that one, but i thought i could set a BG color on a W3-css bar with a hex valuea with w3-black. I will remeber that. Thanks 🙂 Isn't it posible to set a w3-#000000 at all?
  25. How do I set the color value with hex in w3-css? I tried w3-#009000, but it didnt work. I also tried w3-#009000; but that didn't work either.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.