Commit ce5211e2 authored by May's avatar May

projcet

parent 60ea0c08
Pipeline #686 failed with stages
# HomeDog.php
Online Tours & Travels management system: This is an online project developed using PHP and MySQL. The purpose of this project is to provide the complete information about the vehicles available for a tour. There are 2 different types of users. First the customer visits the site and enters the place from where to where he wishes to travel. He also provides the date as when he would like to travel. Then he sends these details to the travel and tourism agency. The employee of travel and tourism agency receives the mail and check which vehicle is available for that day and reverts back to the customer along with the quotation. If the customer agrees for any one of the quotation, he can reply back along with agreed quotation.
Online Tours & Travels management system: This is an online project developed using PHP and MySQL.
The purpose of this project is to provide the complete information about the vehicles available for a tour.
There are 2 different types of users. First the customer visits the site and enters the place from where to where he wishes to travel.
He also provides the date as when he would like to travel.
Then he sends these details to the travel and tourism agency. The employee of travel and tourism agency receives the mail and check which vehicle is available for that day and reverts back to the customer along with the quotation.
If the customer agrees for any one of the quotation, he can reply back along with agreed quotation.
Objective Of the Project
Faster processing time and more accurate data for travel requests and reimbursements
Ability for travelers to track authorization and reimbursement request status through the system rather than via phone calls or campus mail
Major technological upgrades to the current travel system
Use of IU’s standardized, virtual J2EE environments
Many new features and enhancements
Software Requirements
WAMP Server
XAMPP Server
Installation/Configuration Steps
Download zip files and Unzip files.
Copy and Paste the unzip files inside “c:/wamp/www/” or “c:/xampp/htdocs/”.
Database Configuration:
Create a new database named “db name”.
Import database HomeDog.sql file through phpmyadmin dashboard
Run/Execute PHP Projects
Open Your Web Browser
Put/type inside the web browser : “localhost/project folder”
Admin Login
Open Your Web Browser
Put/type inside the web browser : “localhost/project folder/Admin”
Admin User : admin
Admin Password : admin
<?php
if(isset($_POST['breed'])) {
$breed = $_POST['breed'];
$age = $_POST['age'];
$habit = $_POST['habit'];
$breedpeople = $_POST['breedpeople'];
$general = $_POST['general'];
$care = $_POST['care'];
$should_know = $_POST['should_know'];
$picture = $_FILES['picture'];
$video = $_POST['video'];
$file_name = $_FILES['picture']['name'];
$file_size =$_FILES['picture']['size'];
$file_tmp =$_FILES['picture']['tmp_name'];
$file_type=$_FILES['picture']['type'];
$file_ext=strtolower(end(explode('.',$_FILES['picture']['name'])));
$path="images/".time().$file_name;
move_uploaded_file($file_tmp, $path);
include('includes/config.php');
$sql = "INSERT INTO `dogs` VALUES (default,'$path', '$breed', '$age','$video', '$habit', '$breedpeople', '$general', '$care', '$should_know')";
$result = mysqli_query($conn, $sql);
if(mysqli_affected_rows($conn)>=0){
header('Location:page5.php');
}else{
echo mysqli_error($conn);
}
mysqli_close($conn);
}
?>
<?php include('layouts/header.php'); ?>
<div class="container">
<div class="row">
<div class="offset-sm-3 col-sm-6">
<h1 class="text-center text-info my-2">เพิ่มข้อมูลสุนัข</h1>
<form action="createDog.php" method="post" enctype="multipart/form-data">
<div class="form-group row">
<label for="breed" class="col-sm-3 col-form-label">สายพันธุ์ :</label>
<div class="col-sm-9">
<input type="text" name="breed" class="form-control" id="breed" size="20" required>
</div>
</div>
<div class="form-group row">
<label for="age" class="col-sm-3 col-form-label">ช่วงอายุ :</label>
<div class="col-sm-9">
<input type="text" name="age" class="form-control" id="age" size="20" required>
</div>
</div>
<div class="form-group row">
<label for="habit" class="col-sm-3 col-form-label">ลักษณะนิสัย :</label>
<div class="col-sm-9">
<input type="text" name="habit" class="form-control" id="habit" size="20" required>
</div>
</div>
<div class="form-group">
<label for="breedpeople">สายพันธุ์ที่เหมาะสมกับผู้เลี้ยง :</label>
<textarea name="breedpeople" rows="8" class="form-control" cols="80" id="breedpeople" required></textarea>
</div>
<div class="form-group">
<label for="general">ลักษณะทั่วไป :</label>
<textarea name="general" rows="8" class="form-control" cols="80" id="general" required></textarea>
</div>
<div class="form-group">
<label for="care">การดูแลสุนัข :</label>
<textarea name="care" rows="8" class="form-control" cols="80" id="care" required></textarea>
</div>
<div class="form-group">
<label for="should_know">ข้อควรรู้ :</label>
<textarea name="should_know" rows="8" class="form-control" cols="80" id="should_know" required></textarea>
</div>
<div class="form-group row">
<label for="picture" class="col-sm-3 col-form-label">รูปภาพ :</label>
<div class="col-sm-9">
<div class="custom-file">
<input type="file" class="form-control" name="picture" id="picture" required>
</div>
</div>
</div>
<div class="form-group row">
<label for="video" class="col-sm-3 col-form-label">วิธีการเตรียมตัวก่อนเลี้ยงสุนัข :</label>
<div class="col-sm-9">
<input type="text" name="video" class="form-control" id="video" size="20" required>
</div>
</div>
<p class="text-center">
<button type="submit" class="btn btn-success">เพิ่มข้อมูล</button>
</p>
</form>
</div>
</div>
</div>
<?php include('layouts/footer.php'); ?>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<?php
$id = $_GET['id'];
if(isset($_POST['breed'])) {
$breed = $_POST['breed'];
$age = $_POST['age'];
$habit = $_POST['habit'];
$breedpeople = $_POST['breedpeople'];
$general = $_POST['general'];
$care = $_POST['care'];
$should_know = $_POST['should_know'];
$picture = $_FILES['picture'];
$video = $_POST['video'];
include('includes/config.php');
if($picture['name']){
$file_name = $_FILES['picture']['name'];
$file_size =$_FILES['picture']['size'];
$file_tmp =$_FILES['picture']['tmp_name'];
$file_type=$_FILES['picture']['type'];
$file_ext=strtolower(end(explode('.',$_FILES['picture']['name'])));
$path="images/".time().$file_name;
move_uploaded_file($file_tmp, $path);
$sql = "UPDATE `dogs` SET `picture`='$path', `breed`='$breed',`age`='$age',`video`='$video',`habit`='$habit',`breedpeople`='$breedpeople',`general`='$general',`care`='$care',`should know`='$should_know' WHERE id = '$id'";
}else{
$sql = "UPDATE `dogs` SET `breed`='$breed',`age`='$age',`video`='$video',`habit`='$habit',`breedpeople`='$breedpeople',`general`='$general',`care`='$care',`should know`='$should_know' WHERE id = '$id'";
}
$result = mysqli_query($conn, $sql);
if(mysqli_affected_rows($conn)>=0){
header('Location:page5.php');
}else{
echo mysqli_error($conn);
}
mysqli_close($conn);
}
?>
<?php
include('layouts/header.php');
include('includes/config.php');
$sql = "select * from dogs where id = $id";
$result = mysqli_query($conn, $sql);
if (mysqli_num_rows($result) > 0) {
while($row = mysqli_fetch_assoc($result)) {?>
<div class="container">
<div class="row">
<div class="offset-sm-3 col-sm-6">
<h1 class="text-center text-info my-2">เพิ่มข้อมูลน้องหมา</h1>
<form action="editDog.php?id=<?= $id ?>" method="post" enctype="multipart/form-data">
<div class="form-group row">
<label for="breed" class="col-sm-3 col-form-label">สายพันธุ์ :</label>
<div class="col-sm-9">
<input type="text" name="breed" class="form-control" value="<?= $row['breed'] ?>" id="breed" size="20" required>
</div>
</div>
<div class="form-group row">
<label for="age" class="col-sm-3 col-form-label">ช่วงอายุ :</label>
<div class="col-sm-9">
<input type="text" name="age" class="form-control" value="<?= $row['age'] ?>" id="age" size="20" required>
</div>
</div>
<div class="form-group row">
<label for="habit" class="col-sm-3 col-form-label">ลักษณะนิสัย :</label>
<div class="col-sm-9">
<input type="text" name="habit" class="form-control" id="habit" value="<?= $row['habit'] ?>" size="20" required>
</div>
</div>
<div class="form-group">
<label for="breedpeople">สายพันธุ์ที่เหมาะสมกับผู้เลี้ยง :</label>
<textarea name="breedpeople" rows="8" class="form-control" cols="80" id="breedpeople" required><?= $row['breedpeople'] ?></textarea>
</div>
<div class="form-group">
<label for="general">ลักษณะทั่วไป :</label>
<textarea name="general" rows="8" class="form-control" cols="80" id="general" required><?= $row['general'] ?></textarea>
</div>
<div class="form-group">
<label for="care">การดูแลสุนัข :</label>
<textarea name="care" rows="8" class="form-control" cols="80" id="care" required><?= $row['care'] ?></textarea>
</div>
<div class="form-group">
<label for="should_know">ข้อควรรู้ :</label>
<textarea name="should_know" rows="8" class="form-control" cols="80" id="should_know" required><?= $row['should know'] ?></textarea>
</div>
<div class="form-group row">
<label for="picture" class="col-sm-3 col-form-label">รูปภาพ :</label>
<div class="col-sm-9">
<div class="custom-file">
<input type="file" class="form-control" name="picture" id="picture">
</div>
</div>
</div>
<div class="form-group row">
<label for="video" class="col-sm-3 col-form-label">วิธีการเตรียมตัวก่อนเลี้ยงสุนัข :</label>
<div class="col-sm-9">
<input type="text" name="video" class="form-control" id="video" size="20" value="<?= $row['video'] ?>" required>
</div>
</div>
<p class="text-center">
<button type="submit" class="btn btn-success">เพิ่มข้อมูล</button>
</p>
</form>
</div>
</div>
</div>
<?php
}
}
mysqli_close($conn);
?>
<?php include('layouts/footer.php'); ?>
This diff is collapsed.
<?php
// DB credentials.
$servername = "localhost";
$username = "root";
$password = "pass@word2";
$dbname = "home_dog2";
// Create connection
$conn = mysqli_connect($servername, $username, $password);
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}else{
// echo "Connected succsssfully<br>";
}
mysqli_select_db($conn, $dbname);
mysqli_set_charset($conn, "utf8");
?>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment