/
testimonies.php
98 lines (86 loc) · 2.96 KB
/
testimonies.php
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
<?php
include('conn.php');
$sqi=mysql_query("select * from testimony where visibility=1 order by testimony_id desc");
$name=$_POST['name'];
$phone=$_POST['phone'];
$mail=$_POST['mail'];
$testy=$_POST['testy'];
if(isset($_POST['sub'])){
$sql=mysql_query("insert into testimony (name, phone, mail,message,visibility) VALUES ('$name','$phone' ,'$mail','$testy',1)");
if($sql){$suc=true;}
if(!isset($sql)){$fail=true;}
}
?>
<!DOCTYPE html>
<!--[if IE 7 ]><html class="ie ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]-->
<!--[if IE 9 ]><html class="ie ie9" lang="en"> <![endif]-->
<html lang="en">
<!--<![endif]-->
<head>
<!-- Basic Page Needs -->
<meta charset="utf-8">
<title>AOI - Testimonies</title>
</head>
<body>
<!--[if !IE]><!--><script>if(/*@cc_on!@*/false){document.documentElement.className+=' ie10';}</script><!--<![endif]--> <!-- Border radius fixed IE10-->
<!-- HEADER -->
<?php include('header.php'); ?>
<!-- -->
<!-- NAV -->
<?php include('nav.php'); ?>
<!-- -->
<div class="container">
<!-- =========================Start Col right section ============================= -->
<h2> Testimonies</h2>
<section class="col-md-8 col-sm-8">
<div class="col-right">
<ul>
<?php $num=0; while($roh=mysql_fetch_array($sqi)){ $num++; $nid=$roh['news_id'];
?>
<div> <h4> <?php echo $roh['name']; ?></h4>
<p><i>"<?php echo $roh['message'];?> "</i><hr></p>
</div>
<?php } ?>
</ul>
<br>
<br>
<br><br>
<?php if(isset($suc)){echo "<div class='suc'>$name your Testimony was submitted succesfully,<br> thanks for giving your testimony JAZAKUM LAHU KHAIRAN! </div>";}
if(isset($fail)){echo "<div class='fail'>An error ocured</div>";} ?>
<form name="form1" method="post" action="" <?php if(isset($suc)){echo "hidden=''";} ?>
<h4>Submit your testimony </h4>
<div class="row">
<div class="col-md-6">
<label>Name </label>
<input type="text" class="form-control" name="name">
</div>
</div>
<div class="row">
<div class="col-md-6">
<label>Email<small>(Optinal)</small></label>
<input type="email" class="form-control" name="mail">
</div>
</div>
<div class="row">
<div class="col-md-6">
<label>Phone <small>(Optional)</small></label>
<input type="text" class="form-control" name="phone">
</div>
</div>
<div class="row">
<div class="col-md-12">
<label>Testimony </label>
<textarea rows="5" class="form-control" name="testy"></textarea>
</div>
</div>
<input type="submit" id="submit-visit" value="Submit testimony" class=" button_medium" name="sub">
</form>
</div><!-- end col right-->
</section>
</div><!-- end row-->
</div><!-- end container-->
<!-- HEADER -->
<?php include('footer.php'); ?>
</body>
</html>