-
Notifications
You must be signed in to change notification settings - Fork 1
/
add.php
681 lines (577 loc) · 16.6 KB
/
add.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
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Recipe Hunt</title>
<link rel="icon" href="logo.png">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="addStyle.css">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="keywords" content="footer, address, phone, icons" />
<link rel="stylesheet" href="css/demo.css">
<link href='https://fonts.googleapis.com/css?family=Dancing Script ' rel="stylesheet">
<link href='https://fonts.googleapis.com/css?family=Bellefair ' rel="stylesheet">
<link href='https://fonts.googleapis.com/css?family=Fresca ' rel="stylesheet">
<link href='https://fonts.googleapis.com/css?family=Salsa ' rel="stylesheet">
<link href='https://fonts.googleapis.com/css?family=Acme ' rel="stylesheet">
<link href='https://fonts.googleapis.com/css?family=Kite One ' rel="stylesheet">
<link rel="stylesheet" href="css/footer-distributed-with-address-and-phones.css">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css">
<link href="http://fonts.googleapis.com/css?family=Cookie" rel="stylesheet" type="text/css">
<style>
input[type="submit"]{
font-size:"10%";
background-color: #fff;
color: #000;
border-radius: 5px;
padding:5px 15px;
}
.borderless td, .borderless th {
border: none;
}
.bgimg{
}
.bgimg img{ position: absolute;
left: 0;
top: 0;
width: 100%;
height:30%;
z-index: 1;
opacity: .2;
}
.footer-distributed{
background-color: #292c2f;
box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.12);
box-sizing: border-box;
width: 100%;
text-align: left;
font: bold 16px sans-serif;
padding: 35px 30px;
margin-top: 10px;
}
.footer-distributed .footer-left,
.footer-distributed .footer-center,
.footer-distributed .footer-right{
display: inline-block;
vertical-align: top;
}
/* Footer left */
.footer-distributed .footer-left{
width: 30%;
}
/* The company logo */
.footer-distributed h3{
color: #ffffff;
font: normal 36px 'Cookie', cursive;
margin: 0;
}
.footer-distributed h3 span{
color: #5383d3;
}
/* Footer links */
.footer-distributed .footer-links{
color: #ffffff;
margin: 20px 0 12px;
padding: 0;
}
.footer-distributed .footer-links a{
display:inline-block;
line-height: 1.8;
text-decoration: none;
color: inherit;
}
.footer-distributed .footer-company-name{
color: #8f9296;
font-size: 14px;
font-weight: normal;
margin: 0;
}
/* Footer Center */
.footer-distributed .footer-center{
width: 35%;
}
.footer-distributed .footer-center i{
background-color: #33383b;
color: #ffffff;
font-size: 25px;
width: 38px;
height: 38px;
border-radius: 50%;
text-align: center;
line-height: 42px;
margin: 10px 15px;
vertical-align: middle;
}
.footer-distributed .footer-center i.fa-envelope{
font-size: 17px;
line-height: 38px;
}
.footer-distributed .footer-center p{
display: inline-block;
color: #ffffff;
vertical-align: middle;
margin:0;
}
.footer-distributed .footer-center p span{
display:block;
font-weight: normal;
font-size:20px;
line-height:2;
}
.footer-distributed .footer-center p a{
color: #5383d3;
text-decoration: none;;
}
/* Footer Right */
.footer-distributed .footer-right{
width: 20%;
}
.footer-distributed .footer-company-about{
line-height: 20px;
color: #92999f;
font-size: 25px;
font-weight: normal;
margin: 0;
}
.footer-distributed .footer-company-about span{
display: block;
color: #000000;
font-size: 20px;
font-weight: bold;
margin-bottom: 20px;
}
.footer-distributed .footer-icons{
margin-top: 35px;
}
.footer-distributed .footer-icons a{
display: inline-block;
width: 35px;
height: 35px;
cursor: pointer;
background-color: #33383b;
border-radius: 2px;
font-size: 20px;
color: #ffffff;
text-align: center;
line-height: 35px;
margin-right: 3px;
margin-bottom: 5px;
}
/* If you don't want the footer to be responsive, remove these media queries */
@media (max-width: 880px) {
.footer-distributed{
font: bold 14px sans-serif;
}
.footer-distributed .footer-left,
.footer-distributed .footer-center,
.footer-distributed .footer-right{
display: block;
width: 100%;
margin-bottom: 10px;
text-align: center;
}
.footer-distributed .footer-center i{
margin-left: 0;
}
}
.footer-distributed {
background-color: lightgray;
box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.12);
box-sizing: border-box;
width: 100%;
text-align: left;
font: bold 16px sans-serif;
padding: 35px 30px;
margin-top: 10px;
}
.footer-distributed .footer-links {
color: black;
margin: 20px 0 12px;
padding: 0;
position: relative;
left: -101px;
top: -114px;
font-size: 25px;
font-family: Dancing Script;
}
.i1
{
background-color: #33383b;
color: #ffffff;
font-size: 25px;
width: 38px;
height: 38px;
border-radius: 50%;
text-align: center;
line-height: 42px;
margin: 10px 15px;
vertical-align: middle;
}
.add
{
font-family: kite one;
font-size: 35px;
position: relative;
top: -39px;
left: 64px;
font-size: large;
}
.l1
{
position: relative;
top: -43px;
left: 169px;
/* color: blue; */
}
a:-webkit-any-link {
color: -webkit-link;
cursor: auto;
}
.e1
{
position: relative;
top: -59px;
}
.dn
{
position: relative;
top: -100px;
left: 62px;
font-size: 21px;
}
.p1
{
color: black;
font-family: Kite One;
position: relative;
top: 10px;
}
.r1
{
position: relative;
top: 1px;
}
.footer-distributed {
background-color: lightgray;
box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.12);
box-sizing: border-box;
width: 100%;
text-align: left;
font: bold 16px sans-serif;
padding: 35px 30px;
margin-top: 10px;
height: 333px;
}
.f1
{
font-family:Acme;
font-size:19px;
}
.navbar-brand {
float: left;
height: 50px;
padding: 15px 15px;
font-size: 20px;
line-height: 20px;
}
.f2
{
font-size:20px;
}
</style>
</head>
<body>
<center><img src="logo.png" ></center>
<nav class="navbar navbar-inverse bg-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand t1"><span class="f2"> Recipe Hunt</span></a>
</div>
<ul class="nav navbar-nav">
<li class="f1"><a href="index.php"><span class="glyphicon glyphicon-home"></span> Home</a></li>
<li class="f1"><a href='recipe.php' >Show all recipes</a></li>
</ul>
<ul class="nav navbar-nav ">
<li class="active f1"><a href='add.php' >Add New Recipe</a></li>
<li class="f1"><a href="feedback.php">Feedback</a></li>
<li class="f1"><a href="recent.php">Recently Added</a></li>
<li class="f1"><a href="restaurant.php">Restaurants</a></li>
</ul>
</nav>
<div class="bgimg">
<img src="http://healthyeatingforfamilies.com/wp-content/uploads/2014/09/15-healthy-ingredeints-iStock_000008217571Small.jpg">
<br><br><br>
</div>
<?php
include('conn.php');
if(isset($_REQUEST['add'])){
?>
<style>
.appBanner{visibility:hidden;}
</style> <form action="" method="POST">
<table cellpadding="30px" cellspacing="30px" width="90%" align=left class="table borderless">
<caption><h2 style="color:blue;font-size:60px;font-family:Bellefair;" align="center">Add your ingredient</h2><p align="center" style="font-family:fresca;">Fill the form below to add the ingredient if you don't find it here</p><br></caption>
<tr><td align="right" style="vertical-align:top;font-family:Salsa;">Ingredient Name</td><td><textarea name="ingi" cols="100" rows="1" required style="color:black;"></textarea></td>
<tr><td colspan="2" align="center" style="vertical-align:top;font-family:Salsa;">Once you are done with filling the ingredient click here <input type="submit" name="done" value="DONE" class="btn btn-success"></td></tr>
</form>
</table>
<?php
}
?>
<?php
include('conn.php');
if(isset($_REQUEST['source'])){
?>
<style>
.appBanner{visibility:hidden;}
</style> <form action="" method="POST">
<table cellpadding="30px" cellspacing="30px" width="90%" align=left class="table borderless">
<caption><h2 style="color:blue;font-size:60px;" align="center">Add your source</h2><p align="center">Fill the form below to add the source if you don't find it on the site</p><br></caption>
<tr><td align="right" style="vertical-align:top;">Source Name</td><td><textarea name="resti" cols="100" rows="1" required style="color:black;"></textarea></td>
<tr><td colspan="2" align="center" style="vertical-align:top;">Once you are done with filling the source name click here <input type="submit" name="resta" value="DONE" class="btn btn-default"></td></tr>
</form>
</table>
<?php
}
?>
<br>
<div class="appBanner">
<table cellpadding="30px" cellspacing="30px" width="90%" align=left class="table">
<caption><h2 style="color:blue;font-size:60px;font-family:Bellefair;" align="center">Add your own recipe</h2><p align="center" style="font-family:Fresca;">Fill the form below to add your own recipe if you don't find it here</p></caption>
<form action="" method="post" name="feedback" >
<tr>
<td align="right" style="vertical-align:top;font-family:Fresca;font-size:23px">Recipe Name</td>
<td style="color:black;"><textarea name="r_name" cols="100" rows="1" required></textarea></td>
</tr>
<tr>
<td align="right" style="vertical-align:top;font-family:Fresca;font-size:23px">Steps</td>
<td style="color:black;"><textarea rows="15" cols="100" name="STEPS" required></textarea></td>
</tr>
<tr>
<td colspan="2" align="center" style="font-family:Fresca;">Upload your image on internet and paste the url in the field below. To go to the link to upload and generate the url - <a href="https://ctrlq.org/images/" target="_blank" style="font-family:Salsa;"> Click here</a></td>
</tr>
<tr>
<td align="right" style="vertical-align:top;font-family:Fresca;">Image Link</td>
<td style="color:black;"><input type="url" name="image" cols="100" rows="1" required></td>
</tr>
<tr>
<td align="right" style="vertical-align:top;font-family:Fresca;"> Select Ingredients Required </td>
<td> <?php
include('conn.php');
$sql = "select * from ingredient";
$re = $conn->query($sql);
if($re){
?><table class="table" cellpadding="15px" cellpadding="15px" class="checking"><?php
while($fes=$re->fetch_object()){
?>
<tr>
<td style="color:green;font-family:Salsa;"><input type="checkbox" name="ch[]" value="<?php echo $fes->i_id;?> " >
<?php
echo $fes->i_name;
?></td>
<?php if($fes=$re->fetch_object()){?>
<td style="color:green;font-family:Salsa;"><input type="checkbox" name="ch[]" value="<?php echo $fes->i_id;?> ">
<?php
echo $fes->i_name;
}else{break;}?></td>
<?php if($fes=$re->fetch_object()){?>
<td style="color:green;font-family:Salsa;"><input type="checkbox" name="ch[]" value="<?php echo $fes->i_id;?> ">
<?php
echo $fes->i_name;
}
else{break;}}}?></td>
</tr>
<tr><td colspan="2" align="center" style="font-family:Fresca;">Dont find your ingredient above add here</td><td>
<input type="submit" name="add" value="Add Ingredient" class="btn btn-primary"></td></tr>
</td></tr></table>
<tr><td align="right" style="vertical-align:top;font-family:Fresca;">Select the source</td><td>
<table class="table">
<tr><td align="left">
<select name="ab">
<?php
$sq="select * from restaurant";
$r=$conn->query($sq);
if($r){
while($t=$r->fetch_object()){
?>
<option value="<?php echo $t->res_id;?>"><?php echo $t->res_name;?></option>
<?php
}
}
?>
</select>
</td></tr>
<tr><td align="left" style="font-family:Fresca;">Dont find your source . Add here
<input type="submit" name="source" value="Add Source" class="btn btn-primary"></td></tr></table>
</td></tr>
<tr>
<td colspan="2" align="center" style="vertical-align:top;font-family:Fresca;">Once you are done with writing about your recipe click here
<input type="submit" name="submit" class="btn btn-success" value="Completed" id="one"></td>
</tr></table>
</form>
</div>
<footer class="footer-distributed">
<div class="footer-left">
<div class="row"><span class="hidden-xs">
<h3><span></span> <img src="logo.png" style="
width: 300px;
position: relative;
top: -45px;
"></span></h3>
</span>
</div>
</div>
<div class="footer-center">
<div>
<i class="fa fa-phone"></i>
<p><span class="p1">Adarsh Misra: 9537524200</span><br>
</div>
<div>
<i class="fa fa-phone"></i>
<p><span class="p1">Nishi Doshi: 9687781018</span><br>
</div>
<div>
<i class="fa fa-phone"></i>
<p><span class="p1">Rohan Dhanwani: 8460435249</span></br>
</div>
<div>
<i class="fa fa-phone"></i>
<p><span class="p1 r1">Roshani R: 7433053793</span></p>
</div>
</div>
<div class="footer-right">
<p class="footer-company-about">
<i class="fa fa-map-marker i1"></i>
<span class="add"><span class="t1">Dhirubhai Ambani</span><span class="t2">Institute of Information</span><span class="t3">and Communication</span><span class="t4">Technology,near Indroda</span><span>Circle,Gandhinagar,Gujarat</span></span>
<a href="https://www.google.co.in/maps/place/DA-IICT/@23.1885444,72.6268665,17z/data=!3m1!4b1!4m5!3m4!1s0x395c2a3ed70db7a9:0x5c6ef3f74fec0ece!8m2!3d23.1885395!4d72.6290552" target="_blank"><span class="l1" style="color: blue;">View Location</span></a>
<div>
<i class="fa fa-envelope i1 e1"></i>
<span class="dn">doshinishi1216@gmail.com</span>
</div>
</p>
</div>
</span>
</li></li></li></li>
</li></li>
</li></li>
<div><div><div>
</div>
</div>
</footer>
</body>
<?php
include('conn.php');
if(isset($_REQUEST['submit'])){
$hob = $_REQUEST['ch'];
if(sizeof($hob)==0){
}else{
?>
<script type="text/javascript">
alert("You have selected <?php echo sizeof($hob) ?> items");
</script>
<?php
include('conn.php');
$j="";
for($x=0 ; $x<sizeof($hob) ; $x++){
$w= "select * from ingredient where i_id=$hob[$x]";
$res = $conn->query($w);
if($res){
$fe = $res->fetch_object();
$j.=$fe->i_name;
}
if($x!=sizeof($hob)-1){
$j.=",";
}
}
$r_name=$_REQUEST['r_name'];
$STEPS=$_REQUEST['STEPS'];
$img = $_REQUEST['image'];
$ab=$_REQUEST['ab'];
$sq="insert into receipe(r_name,ing,STEPS,imagesrc,res_id) values ('$r_name','$j','$STEPS','$img','$ab')";
$re = $conn->query($sq);
if($re){
?>
<script type="text/javascript">
alert("inserted");
</script>
<?php
}else{
?>
<script type="text/javascript">
alert("not inserted");
</script>
<?php
}
include('conn.php');
$r = "select * from receipe where r_name='$r_name'";
$wel = $conn->query($r);
if($wel){
$fest = $wel->fetch_object();
$abc = $fest->r_id;
$tea=0;
for($x=0 ; $x<sizeof($hob) ; $x++){
$test = $hob[$x];
$pearl = "insert into connection (r_id,i_id) values ($abc,$test)";
$da = $conn->query($pearl);
if($da){
$tea=$tea+1;
}
}
if($tea==sizeof($hob)){
?>
<script type="text/javascript">
window.location="index.php";
</script>
<?php
}
}
}
}
?>
<?php
include('conn.php');
if(isset($_REQUEST['done'])){
$has=$_REQUEST['ingi'];
$sqli = "insert into ingredient(i_name) values ('$has')";
$req = $conn->query($sqli);
if($req){
?>
<script type="text/javascript">
alert("Added the ingredient");
window.location="add.php";
</script>
<?php
}else{
?>
<script type="text/javascript">
alert("Sorry there occured an error");
</script>
<?php
}
}
?>
<?php
include('conn.php');
if(isset($_REQUEST['resta'])){
$has=$_REQUEST['resti'];
$sqli = "insert into restaurant(res_name) values ('$has')";
$req = $conn->query($sqli);
if($req){
?>
<script type="text/javascript">
alert("Added the source");
window.location="add.php";
</script>
<?php
}else{
?>
<script type="text/javascript">
alert("Sorry there occured an error");
</script>
<?php
}
}
?>