public static function addInternship() { $input = Input::all(); $post = Employers::addInternship($input); if ($post) { return Redirect::to('/employers')->withErrors(array("msg" => "new Internship Post added successfully!")); } else { return Redirect::to('/employers')->withErrors(array("msg" => "we are sorry. Internship Post not added successfully!")); } }
namespace Ventus\CareerFairs; //============================================================================================ // Session, configuration file, localization constructor //============================================================================================ require '../includes/php/bootstrap.php'; $SESSION = new \Zend_Session_Namespace('internal', true); if (!isset($SESSION->lang)) { $SESSION->lang = DEFAULT_LANGUAGE; } $l10n->setLanguage($SESSION->lang); //============================================================================================ // Model //============================================================================================ $model = new Events($dbo); $employerModel = new Employers($dbo); $serviceModel = new Services($dbo); //============================================================================================ // Load the page requested by the user //============================================================================================ if (!isset($_GET['page'])) { $render = true; $thisPage = 'events'; // Get fiscal year for the dropdown menu $fiscalYears = \Ventus\Utilities\Functions::calcFiscalYearDate(date("Y-m-d"), 5); // Fetch events depend on what user has chosen from the fiscal dropdown menu $fiscal = $_GET['fiscal']; $event = array(); if ($fiscal === null || $fiscal === 'current-fiscal-year') { $fiscalDates = \Ventus\Utilities\Functions::calcFiscalYearDate(); $events = $model->getFiscalYearEvent($fiscalDates[0]['start_date']->format(DATETIME_MYSQL), $fiscalDates[0]['end_date']->format(DATETIME_MYSQL));
/** * Calculates invoice numbers * @param array $row The invoice * @return array */ public function calculateInvoice(array $row) { $model = new Events($this->db); $employerModel = new Employers($this->db); $totalBeforeTax = 0; // Get event price and add it to the total $totalBeforeTax += $row['event_price']; // Get employer info $employer = $employerModel->getAllEmployer($row['employer_id']); $employer = $employer[0]; // Get Services for this employer in this event, multiply the service price by the quantity and add it to the total $services = $model->getEventEmployerServices($row['employer_id'], $row['event_id']); if ($services != null) { foreach ($services as $s) { $totalBeforeTax += $s['price'] * $s['quantity']; } } $requestedINV['total_before_tax'] = $totalBeforeTax; $totalAfterTax = $totalBeforeTax; // default values of taxes are 0 $requestedINV['hst'] = $requestedINV['gst'] = $requestedINV['pst'] = 0; // check cases where tax is not exempt and add to total after tax accordingly if ($employer['hst_exempt'] === 0) { if ($employer['pst_exempt'] === 1) { $totalAfterTax = $totalBeforeTax * 1.05; $requestedINV['hst'] = $requestedINV['gst'] = $totalBeforeTax * 0.05; } else { $totalAfterTax = $totalBeforeTax * 1.13; $requestedINV['hst'] = $totalBeforeTax * 0.13; $requestedINV['gst'] = $totalBeforeTax * 0.05; $requestedINV['pst'] = $totalBeforeTax * 0.08; } } $requestedINV['total_after_tax'] = $totalAfterTax; return $requestedINV; }
@extends('layouts.main') @section('title') Employers : @parent @stop <link href='http://fonts.googleapis.com/css?family=Quicksand:300,400' rel='stylesheet' type='text/css'> <link href='http://fonts.googleapis.com/css?family=Lato:400,300' rel='stylesheet' type='text/css'> <link href="http://netdna.bootstrapcdn.com/font-awesome/3.1.1/css/font-awesome.css" rel="stylesheet"> <link rel="stylesheet" type="text/css" href="../css/timeline.css"> @section('header') <?php $details = Employers::getEmployersDetails(Session::get('eid')); ?> @parent | <?php echo $details['name']; ?> | <a href="/employers/logout">logout</a> @stop @section('sidebar') @stop @section('content') <div class="center"> <br> <a href="employers/internships"><button>add new internship</button></a> </div> <?php if ($errors->any()) { ?> <div class="center"> <?php echo implode('', $errors->all('<span style="color:red">:message</span>'));
namespace Ventus\CareerFairs; //============================================================================================ // Session, configuration file, localization constructor //============================================================================================ require '../includes/php/bootstrap.php'; $SESSION = new \Zend_Session_Namespace('internal', true); if (!isset($SESSION->lang)) { $SESSION->lang = DEFAULT_LANGUAGE; } $l10n->setLanguage($SESSION->lang); //============================================================================================ // Model //============================================================================================ $model = new Employers($dbo); //============================================================================================ // Load the page requested by the user //============================================================================================ if (!isset($_GET['page'])) { $render = true; $thisPage = 'employers'; $employers = $model->getAllEmployer(); $l10n->addResource(__DIR__ . '/l10n/employers.json'); $l10n->localizeArray($employers, 'org_name'); $l10n->localizeArray($employers, 'dep_name'); $l10n->localizeArray($employers, 'website'); $viewFile = 'views/employers.php'; } elseif ($_GET['page'] === "check-unique-employer") { $englishMap['org_name_en'] = $_POST['org_name_en']; $englishMap['dep_name_en'] = $_POST['dep_name_en'];
//============================================================================================ // Session, configuration file, localization constructor //============================================================================================ require '../includes/php/bootstrap.php'; $SESSION = new \Zend_Session_Namespace('internal', true); if (!isset($SESSION->lang)) { $SESSION->lang = DEFAULT_LANGUAGE; } \Locale::setDefault($SESSION->lang); $l10n->setLanguage($SESSION->lang); //============================================================================================ // Model //============================================================================================ $model = new Invoices($dbo); $employerModel = new Employers($dbo); $eventModel = new Events($dbo); //============================================================================================ // Load the page requested by the user //============================================================================================ if (!isset($_GET['page'])) { $render = true; // Get fiscal year for the dropdown menu $fiscalYears = \Ventus\Utilities\Functions::calcFiscalYearDate(date("Y-m-d"), 5); // Fetch events depend on what user has chosen from the fiscal dropdown menu $fiscal = $_GET['fiscal']; $invoices = array(); if ($fiscal === null || $fiscal === 'current-fiscal-year') { $fiscalDates = \Ventus\Utilities\Functions::calcFiscalYearDate(); $invoices = $model->getInvoice(null, $fiscalDates[0]['start_date']->format(DATETIME_MYSQL), $fiscalDates[0]['end_date']->format(DATETIME_MYSQL)); } elseif ($fiscal === 'no-fiscal-year-filter') {