Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Appointmentmgt #64

Open
wants to merge 2 commits into
base: version2.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion Project1/models/Appointments.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,23 @@ let Appointment = new Schema({

name : {
type : String,
required: true

},
email:{
type:String,
required: true

},
phone:{
type:String,
required: true

},

petName:{
type:String,
required: true

},

Expand All @@ -35,13 +39,19 @@ let Appointment = new Schema({
},
Reason:{
type:String,
required: true


},
note:{
type:String,

}
},

reggdate: {
type: Date,
default: Date.now,
},
},

{
Expand Down
30 changes: 30 additions & 0 deletions Project1/models/Schedule.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

const mongoose = require('mongoose');
const Schema = mongoose.Schema;

let schedule = new Schema({


name: {
type: String,
required: true
},


lname: {
type: String,
required: true
},

date: {
type: Date,
default: Date.now
}
},
{
collection: 'schedule'
}

);

module.exports = mongoose.model ('schedule', schedule)
8 changes: 6 additions & 2 deletions Project1/myapp/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ import PrescriptionListPreview from './components/PrescriptionListPrintPreview'
import ShelterListPrintPreview from './components/ShelterListPrintPreview'
import SupplierListPrintPreview from './components/SupplierListPrintPreview';
import UserListPrintPreview from './components/UserListPrintPreview';
import DoctorsList from './components/DoctorsList';
import ScheduleList from './components/ScheduleList'

class App extends Component {


Expand Down Expand Up @@ -80,9 +83,10 @@ class App extends Component {
<Route path = "/store" element={<StoreCard/>}/>
<Route path = "/medicalrecords" element={<MedicalRecordsList/>}/>
<Route path = "/employees" element={<EmployeeList/>}/>

<Route path = "/appointment" element={<AppointmentList/>}/>
<Route path = "/CusAppointment" element={<CusAppointment/>}/>
<Route path = "/ScheduleList" element={<DoctorsList/>}/>


<Route path = "/animals" element={<AnimalList/>}/>
Expand All @@ -97,7 +101,7 @@ class App extends Component {
<Route path = "/shelterListPrintPreview" element={<ShelterListPrintPreview/>}/>
<Route path = "/supplierListPrintPreview" element={<SupplierListPrintPreview/>}/>
<Route path = "/userListPrintPreview" element={<UserListPrintPreview/>}/>

<Route path = "/schedule" element={<ScheduleList/>}/>



Expand Down
40 changes: 23 additions & 17 deletions Project1/myapp/src/components/AppointmentList.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import Form from "react-bootstrap/Form";
import Modal from "react-bootstrap/Modal";
import { withRouter } from "./withRouter";



import "../components/CSS/listmain.css";


Expand Down Expand Up @@ -127,7 +129,7 @@ function ApplicationList(props) {
>
<Form.Label>Email Address</Form.Label>
<Form.Control
type="text"
type="email"
name="email"
value={data.email}
placeholder="Enter Email"
Expand All @@ -138,8 +140,9 @@ function ApplicationList(props) {
<Form.Group className="mb-3" controlId="exampleForm.ControlInput1">
<Form.Label> Phone number:</Form.Label>
<Form.Control
type="text"
type="tel"
name="phone"
country={'sri lanka'}
value={data.phone}
placeholder="Mobile Number"
onChange={handleChange}
Expand Down Expand Up @@ -209,7 +212,7 @@ function ApplicationList(props) {
</Modal.Footer>
</Modal>

<h1 align="center">Application List</h1>
<h1 align="center">Appointment List</h1>
<h4 className="text-right">
<b>Total: {count}</b>
</h4>
Expand All @@ -232,11 +235,25 @@ function ApplicationList(props) {
</tr>
<tr>
<td>
<Link to="/appointments" className="nav-link">
<Link to="/appointment" className="nav-link">
<p>View Appointments</p>
</Link>
</td>
</tr>
<tr>
<td>
<Link to ="/ScheduleList" className="nav-link">
<p>Create Schedule</p>
</Link>
</td>
</tr>
<tr>
<td>
<Link to ="/schedule" className="nav-link">
<p>View Schedules</p>
</Link>
</td>
</tr>
</table>
</div>

Expand All @@ -249,27 +266,16 @@ function ApplicationList(props) {
<td>
<b>Name</b>
</td>
<td>
<b>Email</b>
</td>
<td>
<b>Phone</b>
</td>
<td>
<b>Pet Name</b>
</td>
<td>
<b>Species</b>
</td>
<td>
<b>Breed</b>
</td>
<td>
<b>Reason</b>
</td>
<td>
<b>Note</b>
<b>Date & Time</b>
</td>

</tr>
<tbody>{tabRow()}</tbody>
</table>
Expand Down
20 changes: 9 additions & 11 deletions Project1/myapp/src/components/AppointmentTableRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const AppointmentTableRow = (props) => {
Breed:props.obj.Breed,
Reason:props.obj.Reason,
note:props.obj.note,
date:props.obj.reggdate,
});

const [show, setShow] = useState(false);
Expand Down Expand Up @@ -71,7 +72,7 @@ const AppointmentTableRow = (props) => {
</Modal.Title>
</Modal.Header>
<Modal.Body>
<h4>Centered Modal</h4>

<Form>
<Form.Group className="mb-3" controlId="exampleForm.ControlInput1">
<Form.Label> Full Name:</Form.Label>
Expand Down Expand Up @@ -113,7 +114,7 @@ const AppointmentTableRow = (props) => {
<Form.Label> Pet's Name:</Form.Label>
<Form.Control
type="text"
name="petname"
name="petName"
value={updated.petName}
placeholder="Pet's Name"
onChange={handleChange}
Expand All @@ -124,9 +125,9 @@ const AppointmentTableRow = (props) => {
<Form.Label> Species:</Form.Label>
<Form.Control
type="text"
name="species"
name="Species"
value={updated.Species}
placeholder="Cat"
placeholder="Species Ex:-Cat"
onChange={handleChange}
autoFocus
/>
Expand All @@ -135,7 +136,7 @@ const AppointmentTableRow = (props) => {
<Form.Label> Breed:</Form.Label>
<Form.Control
type="text"
name="breed"
name="Breed"
value={updated.Breed}
placeholder="Breed"
onChange={handleChange}
Expand All @@ -146,7 +147,7 @@ const AppointmentTableRow = (props) => {
<Form.Label> Reasons:</Form.Label>
<Form.Control
type="text"
name="reason"
name="Reason"
value={updated.Reason}
placeholder="Reason(s) to make appointment"
onChange={handleChange}
Expand Down Expand Up @@ -180,13 +181,10 @@ const AppointmentTableRow = (props) => {
{" "}
</td>
<td>{appointmentState.name}</td>
<td>{appointmentState.email}</td>
<td>{appointmentState.phone}</td>
<td>{appointmentState.petName}</td>
<td>{appointmentState.Species}</td>
<td>{appointmentState.Breed}</td>
<td>{appointmentState.Reason}</td>
<td>{appointmentState.note}</td>
<td>{appointmentState.date}</td>

<td>
<button
type="submit"
Expand Down
4 changes: 2 additions & 2 deletions Project1/myapp/src/components/CusAppointment.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ function CusAppointment(props) {
>
<Form.Label>Email Address</Form.Label>
<Form.Control
type="text"
type="email"
name="email"
value={data.email}
placeholder="Enter Email"
Expand Down Expand Up @@ -208,7 +208,7 @@ function CusAppointment(props) {
}

<Link onClick={handleShow} className="nav-link">
<p>Make an Appointment</p>
<button style={{marginTop:"40px",marginLeft:"450px",paddingLeft:"30px",paddingRight:"30px",paddingTop:"20px",paddingBottom:"20px",backgroundColor:"rgb(193, 71, 91)",borderRadius:"10px"}}>Make an Appointment</button>
</Link>
</div>
);
Expand Down
Loading