PHP - Creating And Displaying School Timetable
Hello,
I want to create and display school time table like
timetable.jpg 45.66KB
2 downloads
I have created my database like this
CREATE TABLE IF NOT EXISTS `time_table` ( `id` int(10) NOT NULL AUTO_INCREMENT, `class` varchar(20) NOT NULL, `section` varchar(10) NOT NULL, `subject` varchar(20) NOT NULL, `teacher` varchar(30) NOT NULL, `monday` varchar(10) NOT NULL, `tuesday` varchar(10) NOT NULL, `wednsday` varchar(10) NOT NULL, `thursday` varchar(10) NOT NULL, `friday` varchar(10) NOT NULL, `saturday` varchar(10) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;Columns' Monday', 'Tuesday' will store starting hour of a period But i don't know how to display it as above format. I even do not know whether i am using proper format of table. Somebody please suggest me how can i create this time table Similar TutorialsThis topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=346425.0 I'm new here so I say hallo to everyone I have to implement bus time table in this way: Every bus drives every second day from the day chosen. Let's say: If xx bus goes every second day from 23rd February to 30th June to Spain (23rd, 25th, 27th...), How can I check if let's say on 14th May there is bus to Spain? I started with odd and even numbers: if it starts from the even day than there is array of months with number of days, but what if Feb has 29days (every 4th year) instead of 28... I'm totally confused here. In database I have rows: start date, end date and bus name. Is there any other way of implementing this? This topic has been moved to Other Libraries and Frameworks. http://www.phpfreaks.com/forums/index.php?topic=306490.0 My school is running PHP 4.3.2 on its network, and I'm running PHP 5.3.1 on my localhost machine using Xampp/Apache. My login system works perfectly at school, however $_SESSION["LoggedIn"] does not register, recognise nor acknowledge on my home system. It's not the script itself as I've copied the files across, so in theory it should work exactly the same? I've compared phpinfo()'s and within the session category all values are the same. The database/MySQL works fine on both networks so it's not a problem to do with this. Any ideas? Thanks. Hello house, I am new to coding, I have a project about generating school terminal results and using pin to check results in codeigniter framework. Any help will be appreciated. Thanks
Hello, I'm a cs student (2nd year) this year has been a disaster for us the students(studying over zoom and shit), I have a tiny tiny project that a have to finish in the next 24 hours, we made a small sample website using html and js, and now we need to switch it to php language and make the site responsive and later on add SQL. I would very much appreciate if someone can help me for couple of minutes over zoom and help me complete it. All I have left is echo the products from an array with a loop and make a php table that will put my items to my cart. It's my first time here..hope there is some good people here Edited July 21, 2020 by requinixadded thread title Hi guys and girls im a new guy on this forums and im here to beg for a favor, for my school assignment i have to make a simple php script and i have no idea how to do that so, here i am what i need is basically a video store rental application that store staff would use. Nothing fancy just that it works. We also got sakila-db to work with and use witch is 30% of my problem if a got to make my own db i would not be quite as confused right now. Can any1 help me because im starting to panic. i apologize if i posted in the wrong place. im including small dijagram of how this thing is supposed to look any help would be appreciated. [attachment deleted by admin] err, dunno if i managed to put it in the right thread but if i didn't, please tell me. thank you.
getting back on topic, my father asked me to create a website for a school. i know how to make a website but the problem is, how do i start? should i ask about their objectives or something? color of the webpage etc? in short, i don't know the practicalities and processes used in making a website for a certain client. you could say this would be my first time in doing this (kind of like an on-the-job training) so...any ideas? i would very much appreciate any help given.
Hello everyone, I found a tutorial on creating a pdf with php and I just tried to create a basic pdf to see if it worked and modify it from there. Here is the link to the tutorial: http://www.astahost.com/info/tfclt-create-pdf-php-create-fly-pdf-web-server.html Well, after uploading the following php file to the server and testing it, I got this error: Fatal error: Call to undefined function pdf_new() in /home/caresa6/public_html/BubblyBounce.com/admin/pdftest.php on line 2 Here's the code that produced the error: Code: [Select] <?php $mypdf = PDF_new(); PDF_open_file($mypdf, ""); PDF_begin_page($mypdf, 595, 842); $myfont = PDF_findfont($mypdf, "Times-Roman", "host", 0); PDF_setfont($mypdf, $myfont, 10); PDF_show_xy($mypdf, "Sample PDF, constructed by PHP in real-time.", 50, 750); PDF_show_xy($mypdf, "Made with the PDF libraries for PHP.", 50, 730); PDF_end_page($mypdf); PDF_close($mypdf); $mybuf = PDF_get_buffer($mypdf); $mylen = strlen($mybuf); header("Content-type: application/pdf"); header("Content-Length: $mylen"); header("Content-Disposition: inline; filename=gen01.pdf"); print $mybuf; PDF_delete($mypdf); ?> Can anyone help me figure out what to do from here? I have some PHP knowledge, but I'm treading in uncharted waters with this, so I am totally lost. Thanks in advance. Hello all I have a requirement to create images mostly made up of rectangles circles and squares etc I have discovered imageline but is there anything a bit more exspansive? hi i am not sure if i should be posting this problem hear.. so please direct me to the right place if i am. I am trying to create a application form, for people wanting to apply for a apartment. I managed to connect to the database set up table, even make the actual form. Know that everything is done i wanted to make it a little more interactive. I want the form to automatically show the price per month and the size of the apartment if the applicant choses apartment 1 on the form, or if he chooses apartment 2. a managed to tweak around with a filtering system by jquery but i am lost and tired, i wanted to know if there was something simple out there that could help me. Thank you so much for the help. Hello, On my website I wish to have a simple graphic and allow users to write their own text onto the graphic then they can save out the graphic. I'm new to PHP so I'm not that good at it. I've done some research and I think I need to use the GD library. Is this correct? What would be the easiest way to do what I want? Thanks I would to create my own php class for my website but i dunno the fundamentals of PHP CLASSES. Can anyone teach me how to create and use php class. best if you go into deeper explanations. My main subject is to create a social net site Hello! First I would like to say welcome to the forums! I hope one day I'll be able to give back!! Anyway, I seem to not know how to do this. I'm creating a website for my guild, and I'm very very rusty with PHP (learned it a year or two back than lost it). Anyway, I made the script to display the calendar portion of it (followed a tutorial), but I can't seem to import the feature to display events in the same cell as the date that its on. Sorry my coding is a little sloppy but I'm hoping you guys can help xD I left off with thinking that maybe i could use an array to do the job but I honestly have no clue how to go about this... Code: [Select] <?php function calendar(){ include('connect.php'); $month = date("n"); $year = date("Y"); $query = "SELECT * FROM calendar WHERE (month='$month' AND year='$year')"; $result = mysql_query($query); $num = mysql_num_rows($result); $firstDay1 = mktime(0,1,0,$month,1,$year); $firstDay = mktime(0,1,0,$month,1,$year); $daysInMonth = date("t",$firstDay); $firstDay = date("w",$firstDay); $day1 = array(); $message = array(); $message1 = ''; $dayNumber = 1; $i = 0; while ($i < $num) { $day1[$i] = mysql_result($result,$i,"day"); $message[$i] = mysql_result($result,$i,"message"); $i++; } echo "<table width='280' border='1'>\n"; echo "<tr>\n"; echo "<td align='center'>" . date("F Y") . "</td>\n"; echo "</tr>\n"; echo "<tr>\n"; echo "<td>\n"; echo "<table width='490' border='0' cellspacing='2' cellpadding='2'>\n"; echo "<tr align='center'>\n"; echo "<td width='70'>Sun</td>\n"; echo "<td width='70'>Mon</td>\n"; echo "<td width='70'>Tue</td>\n"; echo "<td width='70'>Wed</td>\n"; echo "<td width='70'>Thu</td>\n"; echo "<td width='70'>Fri</td>\n"; echo "<td width='70'>Sat</td>\n"; echo "</tr>\n"; # Calculate number of rows $totalCells = $firstDay + $daysInMonth; if($totalCells < 36){ $rowNumber = 5; } else { $rowNumber = 6; } # Create Rows for($currentRow=1; $currentRow <= $rowNumber; $currentRow++){ if($currentRow == 1){ # Create First Row echo "<tr align='center'>\n"; for($currentCell = 0; $currentCell<7; $currentCell++){ if($currentCell == $firstDay){ # First Day of the Month if($day1 == $dayNumber){ $message1 = $message; } else { $message1 = ""; } echo "<td width='70' height='50'>" . $dayNumber . "<br />$message1</td>\n"; $dayNumber++; } else { if($dayNumber > 1){ # First Day Passed so output Date if($day1 == $dayNumber){ $message1 = $message; } else { //$message1 = ""; } echo "<td width='70' height='50'>" . $dayNumber . "<br />$message1</td>\n"; $dayNumber++; } else { # First Day Not Reached so display blank cell echo "<td width='70' height='50'> </td>\n"; } } } echo "</tr>\n"; } else { # Create Remaining Rows echo "<tr align='center'>\n"; for($currentCell = 0; $currentCell < 7; $currentCell++){ if($dayNumber > $daysInMonth){ # Days in month exceeded so display blank cell echo "<td width='70' height='50'> </td>\n"; } else { if($day1 == $dayNumber){ $message1 = $message; } else { $message1 = ""; } echo "<td width='70' height='50'>" . $dayNumber . "<br />$message1</td>\n"; $dayNumber++; } } echo "</tr>\n"; } } echo "</table>\n"; echo "</td>\n"; echo "</tr>\n"; echo "</table>\n"; } calendar(); ?> Thank you guys so much!!! It will mean alot to me and my guild xD!! **EDIT** Forgot to add, Database looks like this id day month year message Thanks again! I have set up a database using myPHPadmin, I have created the following code: Code: [Select] <?php session_start(); $username = $_POST['username']; $password = $_POST['password']; if ($username&&$password) { $connect = mysql_connect("127.0.0.1","root","password") or die("Couldnt connect to database"); mysql_select_db("login") or die ("Couldnt find database"); $query = mysql_query("SELECT * FROM users WHERE username ='$username'"); $numrows = mysql_num_rows ($query); if($rumrows != 0) { while ($row = mysql_fetch_assoc($query)) { $dbusername = $row['username']; $dbpassword = $row['password']; } if ($username==$dbusername&&$password==$dbpassword) { echo "Login successful. <a href='members.php'> Click here to enter memebers area </a>"; $_SESSION['username']=$dbusername; } else echo "Incorrect password"; } else die ("Username does not exist"); } else die ("Please enter a username and password"); ?> Even though the database is set up when i try and enter the username for the log in page and password, it says the username does not exist? I dont understand why when it is in the database? Please help! MOD EDIT: [code] . . . [/code] BBCode tags added. hi i open this post so i dont open 5 new ones ok i have a task to do an event calendar now i found some tutorial for creating simple calendar BUT all of them are on english what i need is change it to croatian - that means i have custom names for days, custom names for months, and what i also need is put sunday where it belongs... at the end because we are calculating week starts by monday... so any tips? if you know some tutorial that works for these spec things i googled it but i only found like 2 calendars that actualy works other have some bugs in scripts and wont do thing or just write me tips and ill try to create it I am trying to create a madlibs game .. I have a txt file with paragraphs in it .. Some of the sentences have the following tags in it <#noun>, or <#verb>, etc ... I need to parse the file in php and display the content in between the tags to the user. The user can fill the the words in text box, and the story will be displayed with the new words instead of the tags. I am new to php. Any help greatly appreciated. Thanks in Advance, Vladimir i need to create a to do list with php. but i dont want to use database .is there anything else i can use instead of using a database? i need to delete ,add functions .how may i do this? basicly it will have process.php,index.php and delete.php it may need more pages though. im a beginner so , code shouldnt be complicated and should be with explanation please . thanks. I want to create a REST API for my website. What I want to do is to display advertisements from my database on websites that I sell to clients. Their website will call my database for advertisements to display on their websites. Also, I am performing a site validity check where the client's site would send the site URL, site name, and site token to my database for validation. If it returns false then the site will not display as it will be invalid according to my database. I've been Googling this topic all day, but cannot seem to get my head around it. I want to set an API key on my website so that not just anybody can be querying my database. For the advertisement query, no parameters need to be sent from the client websites to my database. Can anyone offer some advice on how to do this? |