-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
89 changed files
with
19,069 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
Program's_Contributed_By_Contributors/C++_Programs/addZeroToFirstIndex.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#include <iostream> | ||
#include <vector> | ||
using namespace std; | ||
|
||
void shift(vector<int>& array); | ||
|
||
int main() { | ||
vector<int> arr = {1,0,4,3}; | ||
shift(arr); | ||
for (int j = 0; j < arr.size(); j++) { | ||
cout << arr[j] << " "; | ||
} | ||
cout << endl; | ||
} | ||
void shift(vector<int>& array) { | ||
for (int i = array.size() - 2; i >= 1; i--) { | ||
array[i+1] = array[i]; | ||
} | ||
array[1] = 0; | ||
} |
19 changes: 19 additions & 0 deletions
19
Program's_Contributed_By_Contributors/Contact-Form/LICENSE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Copyright (c) 2017 Prasanth Janardanan | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is furnished | ||
to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
162 changes: 162 additions & 0 deletions
162
Program's_Contributed_By_Contributors/Contact-Form/form.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,162 @@ | ||
|
||
|
||
/*General */ | ||
html{ | ||
background:url('images/sun-2297961_1920.jpg') no-repeat; | ||
background-size: cover; | ||
height:100%; | ||
} | ||
body | ||
{ | ||
font-family: 'Montserrat', Arial, Helvetica, sans-serif; | ||
} | ||
|
||
#feedback-page{ | ||
text-align:center; | ||
} | ||
|
||
#form-main{ | ||
width:100%; | ||
float:left; | ||
padding-top:0px; | ||
} | ||
|
||
#form-div { | ||
background-color:rgba(72,72,72,0.4); | ||
padding-left:35px; | ||
padding-right:35px; | ||
padding-top:35px; | ||
padding-bottom:50px; | ||
width: 450px; | ||
float: left; | ||
left: 50%; | ||
position: absolute; | ||
margin-top:30px; | ||
margin-left: -260px; | ||
border-radius: 7px; | ||
|
||
} | ||
|
||
.montform .feedback-input { | ||
color:#3c3c3c; | ||
font-family: Helvetica, Arial, sans-serif; | ||
font-weight:500; | ||
font-size: 18px; | ||
border-radius: 0; | ||
line-height: 22px; | ||
background-color: #fbfbfb; | ||
padding: 13px 13px 13px 54px; | ||
margin-bottom: 10px; | ||
width:100%; | ||
box-sizing: border-box; | ||
border: 3px solid rgba(0,0,0,0); | ||
} | ||
/*Inputs styles*/ | ||
.montform .feedback-input:focus{ | ||
background: #fff; | ||
border: 3px solid #3498db; | ||
color: #3498db; | ||
outline: none; | ||
padding: 13px 13px 13px 54px; | ||
} | ||
|
||
|
||
/* Icons ---------------------------------- */ | ||
.montform #name{ | ||
background-image: url(https://cdnjs.cloudflare.com/ajax/libs/foundicons/3.0.0/svgs/fi-address-book.svg); | ||
background-size: 30px 30px; | ||
background-position: 11px 8px; | ||
background-repeat: no-repeat; | ||
} | ||
|
||
.montform #name:focus{ | ||
background-image: url(https://cdnjs.cloudflare.com/ajax/libs/foundicons/3.0.0/svgs/fi-address-book.svg); | ||
background-size: 30px 30px; | ||
background-position: 8px 5px; | ||
background-position: 11px 8px; | ||
background-repeat: no-repeat; | ||
} | ||
|
||
.montform #email{ | ||
background-image: url(https://cdnjs.cloudflare.com/ajax/libs/foundicons/3.0.0/svgs/fi-mail.svg); | ||
background-size: 30px 30px; | ||
background-position: 11px 8px; | ||
background-repeat: no-repeat; | ||
} | ||
|
||
.montform #email:focus{ | ||
background-image: url(https://cdnjs.cloudflare.com/ajax/libs/foundicons/3.0.0/svgs/fi-mail.svg); | ||
background-size: 30px 30px; | ||
background-position: 11px 8px; | ||
background-repeat: no-repeat; | ||
} | ||
|
||
.montform #comment{ | ||
background-image: url(https://cdnjs.cloudflare.com/ajax/libs/foundicons/3.0.0/svgs/fi-pencil.svg); | ||
background-size: 30px 30px; | ||
background-position: 11px 8px; | ||
background-repeat: no-repeat; | ||
} | ||
|
||
.montform textarea { | ||
width: 100%; | ||
height: 150px; | ||
line-height: 150%; | ||
resize:vertical; | ||
} | ||
|
||
.montform input:hover, .montform textarea:hover, | ||
.montform input:focus, .montform textarea:focus { | ||
background-color:#e6e6e6; | ||
} | ||
|
||
.button-blue{ | ||
font-family: 'Montserrat', Arial, Helvetica, sans-serif; | ||
float:left; | ||
width: 100%; | ||
border: #fbfbfb solid 4px; | ||
cursor:pointer; | ||
background-color: #3498db; | ||
color:white; | ||
font-size:24px; | ||
padding-top:22px; | ||
padding-bottom:22px; | ||
transition: all 0.3s; | ||
margin-top:-4px; | ||
font-weight:700; | ||
} | ||
|
||
.button-blue:hover{ | ||
background-color: rgba(0,0,0,0); | ||
color: #0493bd; | ||
} | ||
|
||
.montform .submit:hover { | ||
color: #3498db; | ||
} | ||
|
||
.ease { | ||
width: 0px; | ||
height: 74px; | ||
background-color: #fbfbfb; | ||
transition: .3s ease; | ||
} | ||
|
||
.submit:hover .ease{ | ||
width:100%; | ||
background-color:white; | ||
} | ||
|
||
/*Styles for small screens*/ | ||
|
||
@media only screen and (max-width: 580px) { | ||
#form-div{ | ||
left: 3%; | ||
margin-right: 3%; | ||
width: 88%; | ||
margin-left: 0; | ||
padding-left: 3%; | ||
padding-right: 3%; | ||
} | ||
} | ||
|
63 changes: 63 additions & 0 deletions
63
Program's_Contributed_By_Contributors/Contact-Form/form.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
|
||
$(function() | ||
{ | ||
function after_form_submitted(data) | ||
{ | ||
if(data.result == 'success') | ||
{ | ||
$('form#reused_form').hide(); | ||
$('#success_message').show(); | ||
$('#error_message').hide(); | ||
} | ||
else | ||
{ | ||
$('#error_message').append('<ul></ul>'); | ||
|
||
jQuery.each(data.errors,function(key,val) | ||
{ | ||
$('#error_message ul').append('<li>'+key+':'+val+'</li>'); | ||
}); | ||
$('#success_message').hide(); | ||
$('#error_message').show(); | ||
|
||
//reverse the response on the button | ||
$('button[type="button"]', $form).each(function() | ||
{ | ||
$btn = $(this); | ||
label = $btn.prop('orig_label'); | ||
if(label) | ||
{ | ||
$btn.prop('type','submit' ); | ||
$btn.text(label); | ||
$btn.prop('orig_label',''); | ||
} | ||
}); | ||
|
||
}//else | ||
} | ||
|
||
$('#reused_form').submit(function(e) | ||
{ | ||
e.preventDefault(); | ||
|
||
$form = $(this); | ||
//show some response on the button | ||
$('button[type="submit"]', $form).each(function() | ||
{ | ||
$btn = $(this); | ||
$btn.prop('type','button' ); | ||
$btn.prop('orig_label',$btn.text()); | ||
$btn.text('Sending ...'); | ||
}); | ||
|
||
|
||
$.ajax({ | ||
type: "POST", | ||
url: 'handler.php', | ||
data: $form.serialize(), | ||
success: after_form_submitted, | ||
dataType: 'json' | ||
}); | ||
|
||
}); | ||
}); |
43 changes: 43 additions & 0 deletions
43
Program's_Contributed_By_Contributors/Contact-Form/formpage.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<title>Contact Form HTML/CSS Template - reusable form</title> | ||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> | ||
<link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet"> | ||
<link rel="stylesheet" href="form.css" > | ||
<script src="form.js"></script> | ||
</head> | ||
<body > | ||
<div class="container"> | ||
<div id="form-main"> | ||
<div id="form-div"> | ||
<form class="montform" id="reused_form" > | ||
<p class="name"> | ||
<input name="name" type="text" class="feedback-input" required placeholder="Name" id="name" /> | ||
</p> | ||
<p class="email"> | ||
<input name="email" type="email" required class="feedback-input" id="email" placeholder="Email" /> | ||
</p> | ||
<p class="text"> | ||
<textarea name="message" class="feedback-input" id="comment" placeholder="Message"></textarea> | ||
</p> | ||
<div class="submit"> | ||
<button type="submit" class="button-blue">SUBMIT</button> | ||
<div class="ease"></div> | ||
</div> | ||
</form> | ||
<div id="error_message" style="width:100%; height:100%; display:none; "> | ||
<h4> | ||
Error | ||
</h4> | ||
Sorry there was an error sending your form. | ||
</div> | ||
<div id="success_message" style="width:100%; height:100%; display:none; "> <h2>Success! Your Message was Sent Successfully.</h2> </div> | ||
</div> | ||
</div> | ||
</div> | ||
</body> | ||
</html> |
26 changes: 26 additions & 0 deletions
26
Program's_Contributed_By_Contributors/Contact-Form/handler.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
ini_set('display_errors', 1); | ||
ini_set('display_startup_errors', 1); | ||
error_reporting(E_ALL); | ||
/* | ||
Tested working with PHP5.4 and above (including PHP 7 ) | ||
*/ | ||
require_once './vendor/autoload.php'; | ||
|
||
use FormGuide\Handlx\FormHandler; | ||
|
||
|
||
$pp = new FormHandler(); | ||
|
||
$validator = $pp->getValidator(); | ||
$validator->fields(['name','email'])->areRequired()->maxLength(50); | ||
$validator->field('email')->isEmail(); | ||
$validator->field('message')->maxLength(6000); | ||
|
||
|
||
|
||
|
||
$pp->sendEmailTo('someone@gmail.com'); // ← Your email here | ||
|
||
echo $pp->process($_POST); |
Binary file added
BIN
+548 KB
Program's_Contributed_By_Contributors/Contact-Form/images/sun-2297961_1920.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.