-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontact.cshtml
More file actions
141 lines (130 loc) · 7.31 KB
/
Copy pathcontact.cshtml
File metadata and controls
141 lines (130 loc) · 7.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
@{
Layout = "~/_SiteLayout.cshtml";
Page.Title = "Contact Page";
Validation.RequireField("Name", "Name is required.");
Validation.RequireField("Email", "Email is required.");
Validation.RequireField("Subject", "Subject is required.");
Validation.RequireField("Message", "Message is required.");
var db = Database.Open("SkillShareConnectionString");
var showMessage = false; // Flag to control displaying the success message
if (IsPost && Validation.IsValid())
{
var naam = Request["Name"];
var emails = Request["Email"];
var subjects = Request["Subject"];
var messages = Request["Message"];
// Insert new record into the database
var insertCommand = "INSERT INTO Contactform(Name, Email, Subject, Message) VALUES (@0, @1, @2, @3)";
db.Execute(insertCommand, naam, emails, subjects, messages);
showMessage = true; // Set flag to true after successful form submission
}
}
<body>
@if (showMessage)
{
<div class="alert alert-success mt-3" role="alert">
Your form was submitted successfully.
</div>
}
@Html.ValidationSummary();
<!-- Header Start -->
<div class="container-fluid bg-primary py-5 mb-5 page-header">
<div class="container py-5">
<div class="row justify-content-center">
<div class="col-lg-10 text-center">
<h1 class="display-3 text-white animated slideInDown">Contact</h1>
<nav aria-label="breadcrumb">
<ol class="breadcrumb justify-content-center">
<li class="breadcrumb-item"><a class="text-white" href="#">Home</a></li>
<li class="breadcrumb-item"><a class="text-white" href="#">Pages</a></li>
<li class="breadcrumb-item text-white active" aria-current="page">Contact</li>
</ol>
</nav>
</div>
</div>
</div>
</div>
<!-- Header End -->
<!-- Contact Start -->
<div class="container-xxl py-5">
<div class="container">
<div class="text-center wow fadeInUp" data-wow-delay="0.1s">
<h6 class="section-title bg-white text-center text-primary px-3">Contact Us</h6>
<h1 class="mb-5">Contact For Any Query</h1>
<p>If you have any queries related to our courses, feel free to reach out to us. Our staff will reply to you within the next 24 hours.</p>
</div>
<div class="row g-4">
<div class="col-lg-4 col-md-6 wow fadeInUp" data-wow-delay="0.1s">
<h5>Get In Touch</h5>
<div class="d-flex align-items-center mb-3">
<div class="d-flex align-items-center justify-content-center flex-shrink-0 bg-primary" style="width: 50px; height: 50px;">
<i class="fa fa-map-marker-alt text-white"></i>
</div>
<div class="ms-3">
<h5 class="text-primary">Office</h5>
<p class="mb-0">FAST NUCES Lahore, 852-B Milaad St, Block B Faisal Town, Lahore, Punjab 54770, Pakistan</p>
</div>
</div>
<div class="d-flex align-items-center mb-3">
<div class="d-flex align-items-center justify-content-center flex-shrink-0 bg-primary" style="width: 50px; height: 50px;">
<i class="fa fa-phone-alt text-white"></i>
</div>
<div class="ms-3">
<h5 class="text-primary">Mobile</h5>
<p class="mb-0">031300000851</p>
</div>
</div>
<div class="d-flex align-items-center">
<div class="d-flex align-items-center justify-content-center flex-shrink-0 bg-primary" style="width: 50px; height: 50px;">
<i class="fa fa-envelope-open text-white"></i>
</div>
<div class="ms-3">
<h5 class="text-primary">Email</h5>
<p class="mb-0">l22111@lhr.nu.edu.pk</p>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6 wow fadeInUp" data-wow-delay="0.3s">
<iframe class="position-relative rounded w-100 h-100"
src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3402.551346665567!2d74.30043381081806!3d31.481525748953402!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x391903f08ebc7e8b%3A0x47e934f4cd34790!2sFAST%20NUCES%20Lahore!5e0!3m2!1sen!2s!4v1710860442089!5m2!1sen!2s" width="600" height="450" style="border:0;" allowfullscreen="" loading="lazy" referrerpolicy="no-referrer-when-downgrade"
frameborder="0" style="min-height: 300px; border:0;" allowfullscreen="" aria-hidden="false"
tabindex="0"></iframe>
</div>
<div class="col-lg-4 col-md-12 wow fadeInUp" data-wow-delay="0.5s">
<form method="post">
<div class="row g-3">
<div class="col-md-6">
<div class="form-floating">
<input type="text" class="form-control" id="name" name="Name" placeholder="Your Name">
<label for="name">Your Name</label>
</div>
</div>
<div class="col-md-6">
<div class="form-floating">
<input type="email" class="form-control" id="email" name="Email" placeholder="Your Email">
<label for="email">Your Email</label>
</div>
</div>
<div class="col-12">
<div class="form-floating">
<input type="text" class="form-control" id="subject" name="Subject" placeholder="Subject">
<label for="subject">Subject</label>
</div>
</div>
<div class="col-12">
<div class="form-floating">
<textarea class="form-control" placeholder="Leave a message here" id="message" name="Message" style="height: 150px"></textarea>
<label for="message">Message</label>
</div>
</div>
<div class="col-12">
<button class="btn btn-primary w-100 py-3" type="submit">Send Message</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<!-- Contact End -->
</body>