Doctype HTML Heading Title Title Heading Body h2 h2 P P Img A A
Doctype HTML Heading Title Title Heading Body h2 h2 P P Img A A
• URLs (Uniform Resource Locators), Hypertext Markup Language (HTML), and Hypertext
Transfer Protocol (HTTP), Cascading Style Sheets(CSS)
• Tag Pairs: Opening tag (<tag>) and a closing tag (</tag>), anything b/w called content.
• Attributes: Tags can have attributes like "src" for images
• Few tags only have start, Anything within the start/end tag is called content
HTML5 Document
Attributes=2
<!DOCTYPE html>
<html>
<heading>
<title>
Html Structure
</title>
</heading>
<body>
<table border="solid">
<tr>
<th>Header 1</th>
<th>Header 2</th>
</tr>
<tr>
<td>Data 1</td>
<td>Data 2</td>
</tr>
</table>
<li>First item</li>
<ol>
<li>First item</li>
<li>Second item</li>
<li>Third item</li>
</ol>
Ordered and Unordered List
<ul>
<li>Red</li>
<li>Green</li>
<li>Blue</li>
</ul>
action: Specifies the URL where the form data will be sent when the user submits the form.
method: Determines how the form data is sent to the server. Common methods are GET and POST.
Form fields: Various input elements like text fields, radio buttons, checkboxes, etc., go within the
form tag.
Name - ImranAli Registration - SP20-BCS-013 Web Theory – Assignment 01
color: blue alt="Girl with a jacket" Alt text will displd, when img not loads
<address>
Box 564, Disneyland, USA<br>
</address>
<code> Hellow World </code> Defines a piece of computer code
<mark>milk</mark> Highlite with yellow text
<progress id="file" value="32" max="100"> 32% </progress> Progress of task with loading icon
<p> <small>This is some smaller text.</small> </p> Defines a smaller text
<strong> IMP text, Bold
<br> Empty line
  Four spaces gap
<section>
<div class="myDiv"> div
<fieldset>
<legend>Personal Info:</legend>
</fieldset>
<li>First item</li> bullet
<ol> Ordered list. i.e 1,2,3
<li>First item</li>
</ol>
<ul> UnOrdered list. i.e bullets
<li>Red</li>
</ul>
<iframe src="https://www.w3schools.com" title="W3Schools Free Any website small frame
Online Web Tutorials">
</iframe>
<video width="320" height="240" controls> video
<source src="movie.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
<audio controls> audio
<source src="horse.mp3" type="audio/mpeg">
</audio>
<figure> Image with figure caption below
<img src="pic_trulli.jpg" alt="Trulli" style="width:100%">
<figcaption>Fig.1 - Trulli, Puglia, Italy</figcaption>
</figure>
<details>
<summary>Epcot Center</summary>
<p>click to open hidden text<p>
</details>
• Form Tags
Grouping Selector
color: #000000; color: #000000; <link rel="stylesheet" href="Stylesheet.css" media=" all" />
} } </head>
` Class Selector External CSS importing
Descendent Selector, Child Selector,
Attribute Selector.
ID Selector
The ID selector in CSS is used to select and style a single unique element on a web page.
Flexbox Elements
align-content align-self
align-items order
Display flex-basis
flex-direction flex-grow
flex-flow flex-shrink
flex-wrap flex
justify-content
Bootstrap
<!-- Link to Bootstrap CSS via CDN -->
<!-- Optional: Link to Bootstrap JavaScript and jQuery via CDN -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
Color Classes
# is value of pixel
console.log(sum); // Output: 15
, let: var limited to the block of code where thy are defined.
Control Flow and Conditionals
} else {
Loops and Iteration
console.log("Good evening!");
for (let i = 0; i < 5; i++) {
} else{
console.log(`Iteration ${i}`);
console.log("Good evening!");
}
}
Functions Objects
function greet(name) { let person = {
return `Hello, ${name}!`; firstName: "Alice",
} lastName: "Johnson",
console.log(greet("Bob")); age: 30,
greet: function() {
colors.push("yellow"); };
console.log(colors); console.log(person.greet());
Laravel
For unexpected errors
php artisan optimize
cd c:\xampp\htdocs
Create Project
Open Project
cd c:\xampp\htdocs\webProject
Migrate
Run server
• Creating model
• Creating Controller
Migration
$table->id();
$table->string('regNo',7);
$table->integer('engineCapacity');
$table->double('costPerHour',10);
$table->unsignedBigInteger('company_id');
$table->foreign('company_id')->references('id')->on('companies')-
>onDelete('cascade'); //cascade delete all records
//Creating
public function create() {
return view ("vehicle/create");
}
public function store(Request $request) {
$Vehicle = new vehicle; // Must import the Model file: use
App\Models\guest;
$Vehicle->id = $request->get('id');
$Vehicle->save();
return redirect('vehicle/create')->with('status', 'id'.$Vehicle->id.'
added Successfully!');
}
//read
public function read() {
$vehicles = vehicle::all();
return view('vehicle/read')->with(['vehicles' => $vehicles]);
}
//update
public function update(Request $request, $id) {
$vehicle = vehicle::find($id);
$vehicle->id = $request->get('id');
$vehicle->save();
• Web.PHP
//create
Route::get('vehicle/create', [vehicleController::class,'create'])-
>name('vehicle.create');
Route::get('vehicle/store', [vehicleController::class,'store'])-
>name('vehicle.store');
//delete
Route::get('vehicle/delete/{id}', [vehicleController::class,'delete'])-
>name('vehicle.delete');
//edit
Route::get('vehicle/edit/{id}', [vehicleController::class,'edit'])-
>name('vehicle.edit');
//update
Route::post('vehicle/update/{id}', [vehicleController::class,'update'])-
>name('vehicle.update');
Create:
Read
Vehicle Model
Company model
File Upload
$fileName = time().'.'.$request->file->extension();
//$request->file->move(public_path('uploads'), $fileName);
$request->file->storeAs('uploads', $fileName);
//....................................................
$fileWriter = new filing;
$fileWriter->fileName = $fileName;
// $fileWriter->filePath = Storage::putFilesAs($fileName);
// $fileWriter->filePath = 'C:\xampp\htdocs\SP20-BCS-
013\storage\app\uploads\\'; or
$fileWriter->filePath = storage_path('app\uploads\\'.$fileName);
//C:\xampp\htdocs\SP20-BCS-013\storage\app\uploads
$fileWriter->save();
//....................................................
// return "File has been Uploaded Successfully!";
return back()->with('message_sent', 'File has been Uploaded
Successfully!')->with('file', $fileName);
}