Skip to content

Instantly share code, notes, and snippets.

View gs-ysingh's full-sized avatar

Yogesh Singh gs-ysingh

View GitHub Profile
module.exports = function (info) {
//private variable
var values = {};
for(var prop in info) {
if(values[prop] !== 'undefined') {
values[prop] = info[prop];
}
}
//return public function
return {
<?php
require_once('class.phpmailer.php');
$errors = array(); // array to hold validation errors
$data = array(); // array to pass back data
// validate the variables ======================================================
if (empty($_POST['name']))
$errors['name'] = 'Name is required.';
// define angular module/app
var formApp = angular.module('formApp', []);
// create angular controller and pass in $scope and $http
function formController($scope, $http) {
// create a blank object to hold our form information
// $scope will allow this to pass between controller and view
$scope.formData = {};
<script src = "scripts/form.js"></script>
<div class="container" ng-app="formApp" ng-controller="formController">
<div class="col-md-6 col-md-offset-3">
<!-- PAGE TITLE -->
<div class="page-header">
<h1><span class="glyphicon glyphicon-tower" style="font-size:20px"></span><span style="font-size:20px; margin-left:10px;">Send a direct e-mail to us</span></h1>
</div>
<!-- SHOW ERROR/SUCCESS MESSAGES -->
<div id="messages" class="well" ng-show="message"></div>
<!-- FORM -->