Ejemplo n.º 1
0
 public function standings(Request $request)
 {
     $year = $request->input('year');
     $player = $request->input('player');
     if ($year) {
         return redirect('teams/standings/' . $year);
     } elseif ($player) {
         return redirect('players/list/' . $player);
     } else {
         flashMessage("Error.", "alert-danger");
         return back();
     }
 }
Ejemplo n.º 2
0
	public function setPanelSettings()
	{
		$discountRules = getCustomerQuote()->getAppliedDiscountRules();
		foreach($discountRules as $discountRule) {
			if(!empty($discountRule['banners'])) {
				foreach($discountRule['banners'] as $banner) {
					flashMessage(getLang('DiscountCongratulations').' '.$banner, MSG_INFO);
				}
			}
		}

		$messages = getFlashMessageBoxes();
		if(!$messages) {
			$this->DontDisplay = true;
			return;
		}

		$GLOBALS['CartStatusMessage'] = $messages;
	}
Ejemplo n.º 3
0
	private function EditUserStep2()
	{
		// Get the information from the form and add it to the database
		$userId = $_POST['userId'];
		$arrData = array();
		$arrPerms = array();
		$err = "";
		$arrUserData = array();

		$this->_GetUserData($userId, $arrUserData);

		// Does this user have permission to edit this user?
		if($GLOBALS['ISC_CLASS_ADMIN_AUTH']->GetVendorId() && $arrUserData['uservendorid'] != $GLOBALS['ISC_CLASS_ADMIN_AUTH']->GetVendorId()) {
			FlashMessage(GetLang('Unauthorized'), MSG_ERROR, 'index.php?ToDo=viewUsers');
		}

		$this->_GetUserData(0, $arrData);
		if($arrUserData['pk_userid'] == 1 || $arrUserData['username'] == "admin") {
			$arrData['username'] = "******";
		}

		$arrPerms = $this->_GetPermissionData(0);

		// Commit the values to the database
		if($this->_CommitUser($userId, $arrData, $arrPerms, $err)) {
			// Log this action
			if(!isset($arrData['username'])) {
				$arrData['username'] = '******';
			}

			$GLOBALS['ISC_CLASS_LOG']->LogAdminAction($userId, $arrData['username']);

			if($GLOBALS['ISC_CLASS_ADMIN_AUTH']->HasPermission(AUTH_Manage_Users)) {
				$this->ManageUsers(GetLang('UserUpdatedSuccessfully'), MSG_SUCCESS);
			} else {
				$GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('UserUpdatedSuccessfully'), MSG_SUCCESS);
			}
		}
		else {
			if($GLOBALS['ISC_CLASS_ADMIN_AUTH']->HasPermission(AUTH_Manage_Users)) {
				flashMessage(sprintf(GetLang('ErrUserNotUpdated'), $err), MSG_ERROR, 'index.php?ToDo=editUser&userId='.$userId);
			} else {
				$GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(sprintf(GetLang('ErrUserNotUpdated'), $err), MSG_ERROR);
			}
		}
	}
Ejemplo n.º 4
0
	/**
	 * Handle the ability to copy a tax rate.
	 */
	public function copyTaxRateAction()
	{
		if(empty($_POST['id'])) {
			flashMessage(getLang('InvalidTaxZone'), MSG_ERROR,
				'index.php?ToDo=viewTaxSettings'
			);
		}

		$taxRate = $this->getTaxRateById($_POST['id'], true);
		if(empty($taxRate)) {
			flashMessage(getLang('InvalidTaxRate'), MSG_ERROR,
				'index.php?ToDo=viewTaxSettings'
			);
		}

		// Update the name
		$newName = getLang('TaxRateCopyName', array(
			'name' => $taxRate['name']
		));

		// Save the tax rate with a new ID
		$taxRateId = $this->copyTaxRate($taxRate['id'], $newName);
		if(!$taxRateId) {
			flashMessage(getLang('ProblemSavingTaxRate'), MSG_ERROR);
			$this->handleToDo('editTaxRate');
			return;
		}

		// Log this action
		$this->log->logAdminAction($taxRateId, $taxRate['name'], $newName);

		flashMessage(getLang('TaxRateCopied'), MSG_SUCCESS,
			'index.php?ToDo=editTaxRate&id='.$taxRateId
		);
	}
Ejemplo n.º 5
0
 public function toggleNotificacion($id)
 {
     $notificacion = Notificacion::find($id);
     if ($notificacion->user_id != Auth::user()->id) {
         Response::make('No Permitido', 403);
     }
     $notificacion->leido = $notificacion->leido == 0 ? 1 : 0;
     $notificacion->save();
     if (Request::ajax()) {
         return Response::json($notificacion, 200);
     } else {
         flashMessage('Listo');
         return Redirect::back();
     }
 }
Ejemplo n.º 6
0
        echo $chemistErr;
        echo $msg2;
        ?>
                                </div>

                                <div class="form-group">
                                    <input type="number" class="form-control" name="strips" placeholder=" Strips Sold At Above Chemist" required="">
                                    <?php 
        echo $stripsErr;
        echo $msg2;
        ?>
                                </div>
                                <div class="form-group">
                                    <?php 
        if (!empty($exit)) {
            flashMessage('Already Submitted For The Day ', 'error');
            ?>
        <?php 
        } else {
            ?>
                                        <div class="form-group">
                                            <input type="submit" class="btn btn-primary "  name="save" value="Submit" placeholder="No of Rx">
                                        </div>

                                        <?php 
        }
        ?>
                                </div>
                            </div>
                        </form>
Ejemplo n.º 7
0
function flashError($message)
{
    return flashMessage($message, FLASH_ERROR);
}
Ejemplo n.º 8
0
	public function LoadChooseTemplateTab()
	{
		$installedTemplates = $this->getInstalledTemplates();
		$downloadableTemplates = $this->getDownloadableTemplates();
		if($downloadableTemplates === false) {
			flashMessage(getLang('UnableRetrieveDownloadableTemplates'), MSG_ERROR);
		}

		$templateList = $installedTemplates;
		if(is_array($downloadableTemplates)) {
			$templateList = array_merge($templateList, $downloadableTemplates);
		}
		uasort($templateList, array($this, 'sortTemplateCallback'));

		$GLOBALS['TemplateListMap'] = '';
		foreach($templateList as $template) {
			if(GetConfig('template') == $template['template'] && strtolower($template['templateColor']) == GetConfig('SiteColor')) {
				$GLOBALS['CurrentTemplateImage'] = $template['preview'];
			}

			if($template['installed']) {
				$GLOBALS['TemplateInstalledClass'] = '';
			}
			else {
				$GLOBALS['TemplateInstalledClass'] = 'Installable';
			}

			if(GetConfig('template') == $template['template'] && strtolower($template['templateColor']) == GetConfig('SiteColor')) {
				$GLOBALS['CurrentTemplateClass'] = 'TemplateBoxOn';
			}
			else {
				$GLOBALS['CurrentTemplateClass'] = '';
			}

			if($_SERVER['HTTPS'] == 'on') {
				$template['preview'] = str_replace('http://', 'https://', $template['preview']);
				$template['previewFull'] = str_replace('http://', 'https://', $template['previewFull']);
			}

			$GLOBALS['TemplateId'] = $template['template'];
			$GLOBALS['TemplateName'] = $template['templateName'];
			$GLOBALS['TemplateColor'] = $template['templateColor'];
			$GLOBALS['TemplatePreviewThumb'] = $template['preview'];
			$GLOBALS['TemplatePreviewFull'] = $template['previewFull'];

			$GLOBALS['TemplateListMap'] .= $this->template->render('layout.choosetemplate.row.tpl');
		}
	}
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $gallery = Gallery::findOrFail($id);
     $name = $gallery->name;
     $gallery->delete();
     flashMessage("'{$name}' has been deleted.", "alert-success");
     return redirect('galleries');
 }
Ejemplo n.º 10
0
		/**
		*	Send the email to confirm the change
		*/
		private function SendPasswordEmail()
		{
			/*
				Include the email API class
			*/

			if (isset($_POST['email'])) {
				$email = $_POST['email'];

				// Does an account with the email address exist?
				if ($this->AccountWithEmailAlreadyExists($email)) {
					// Is the current password right?
					$query = sprintf("select customerid, customertoken from [|PREFIX|]customers where custconemail='%s'", $GLOBALS['ISC_CLASS_DB']->Quote($email));
					$result = $GLOBALS['ISC_CLASS_DB']->Query($query);

					if ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {

						// The account exists, let's create a new temporary token to be used to verify the email that will be sent
						$customer_id = $row['customerid'];
						$storeRandom = md5(uniqid(mt_rand(), true) . $_SERVER['HTTP_USER_AGENT'] . $_SERVER['REMOTE_ADDR'] . $_SERVER['REQUEST_TIME']);
						$linkRandom = $this->generateCustomerHash($storeRandom, $customer_id);
						$UpdatedCustomer = array(
							"customerpasswordresettoken" => $storeRandom,
							"customerpasswordresetemail" => $email,
						);

						if ($GLOBALS['ISC_CLASS_DB']->UpdateQuery("customers", $UpdatedCustomer, "customerid='".$GLOBALS['ISC_CLASS_DB']->Quote($customer_id)."'")) {
							// Send the email
							$data = sprintf("c=%d&t=%s", $customer_id, $linkRandom);
							$link = sprintf("%s/login.php?action=change_password&%s", $GLOBALS['ShopPath'], $data);
							$store_name = GetConfig('StoreName');
							$email_message = sprintf(GetLang('ForgotPassEmailMessage'), $store_name, $link, $link);

							// Create a new email API object to send the email
							require_once(ISC_BASE_PATH . "/lib/email.php");
							$obj_email = GetEmailClass();
							$obj_email->Set('CharSet', GetConfig('CharacterSet'));
							$obj_email->From(GetConfig('OrderEmail'), $store_name);
							$obj_email->Set("Subject", sprintf(GetLang('ForgotPassEmailSubject'), $store_name));
							$obj_email->AddBody("html", $email_message);
							$obj_email->AddRecipient($email, "", "h");
							$email_result = $obj_email->Send();

							// If the email was sent ok, show a confirmation message
							if ($email_result['success']) {
								flashMessage(getLang('ForgotPassEmailSent'), MSG_SUCCESS, 'login.php#login');
							}
							else {
								// Email error
								$this->ResetPassword("internal_error");
							}
						}
						else {
							// Database error
							$this->ResetPassword("internal_error");
						}
					}
					else {
						// Bad password
						$this->ResetPassword("bad_password");
					}
				}
				else {
					// No account with that email address
					$this->ResetPassword("bad_email");
				}
			}
			else {
				$this->ResetPassword();
			}
		}
Ejemplo n.º 11
0
$public->getCategory();
$categories = $public->dataCategory();
$posts = $public->getPost();
?>

	<div class="header-wrapper">
			<div class="header-container">
				<h3>Home</h3>
			</div>
		</div>

	<div class="row">
		<div class="large-12 columns">
		<?php 
if (Session::exists('index')) {
    flashMessage(Session::flash('index'));
}
?>
		<div class="row">
			<div class="large-2 columns">
				<?php 
include 'includes/Menu/categorySidebar.php';
?>
			</div>
			<div class="row">
				<div class="large-8 columns">
			<?php 
if (!Input::exists('get')) {
    echo '<h3>Articles</h3><hr>';
    $posts = $public->getPost();
    if (empty($posts)) {
Ejemplo n.º 12
0
include 'includes/header.php';
$admin = $user->admin();
$users = $admin->allUsers();
?>

	<div class="header-wrapper">
		<div class="header-container">
			<h3>Admin Panel</h3>
		</div>
	</div>

	<div class="row">
		<div class="large-12 columns">
			<?php 
if (Session::exists('admin')) {
    flashMessage(Session::flash('admin'));
}
?>
			<div class="row">
				<div class="large-12 columns">
					<table class="hover" style="width: 100%;">
					  <thead>
					    <tr>
					      <th>Username</th>
					      <th>Email</th>
					      <th>Full Name</th>
					      <th>Location</th>
					      <th>Date Joined</th>
					      <th>Account Status</th>
					      <th></th>
					    </tr>
Ejemplo n.º 13
0
 public function editarResidencia()
 {
     $residencias = Residencias::lists('nombre', 'id');
     if (Input::has('nombre')) {
         $rules = array('nombre' => 'required|min:4|max:50', 'cant_personas' => 'required|numeric|min:0', 'persona_id_propietario' => 'required|numeric|exists:personas,id');
         $validation = Validator::make(Input::except('_token'), $rules);
         if ($validation->fails()) {
             return Redirect::to('perfil')->withResidencias($residencias)->withErrors($validation);
         } else {
             Residencias::find(Auth::user()->residencia_id)->Update(Input::except('_token'));
             flashMessage("Residencia Actualizada Correctamente");
             return Redirect::to("ver-residencia");
         }
     }
 }
Ejemplo n.º 14
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $photo = Photo::findOrFail($id);
     $id = $photo->id;
     $photo->delete();
     flashMessage("Photo with ID {$id} has been deleted.", "alert-success");
     return redirect('photos/list');
 }
Ejemplo n.º 15
0
	private function AddReorderItems()
	{
		$this->ValidateReorder();
		if (isset($_REQUEST['reorderitem'])) {
			$OrdProdIds = implode(',', array_keys($_REQUEST['reorderitem']));
			$QueryWhere = "op.orderprodid IN (".$GLOBALS['ISC_CLASS_DB']->Quote($OrdProdIds).")";
		} else if (isset($_REQUEST['orderid'])) {
			$QueryWhere = "op.orderorderid = ".(int)$_REQUEST['orderid'];
		}

		$orderItems = array();

		// Grab any configurable fields
		$configurableFields = array();
		$query = "
			SELECT ocf.*, op.orderprodid
			FROM [|PREFIX|]order_configurable_fields ocf
			JOIN [|PREFIX|]order_products op ON (op.orderprodid = ocf.ordprodid)
		";
		$result = $GLOBALS['ISC_CLASS_DB']->query($query);
		while($field = $GLOBALS['ISC_CLASS_DB']->fetch($result)) {
			if(!isset($configurableFields['ordprodid'])) {
				$configurableFields[$field['orderprodid']] = array();
			}

			$configurableFields[$field['orderprodid']][] = $field;
		}

		$query = "
			SELECT *
			FROM [|PREFIX|]order_products op
			WHERE ".$QueryWhere;
		$result = $GLOBALS['ISC_CLASS_DB']->query($query);
		while($row = $GLOBALS['ISC_CLASS_DB']->fetch($result)) {
			try {
				$quote = getCustomerQuote();
				$item = new ISC_QUOTE_ITEM;
				$item
					->setQuote($quote)
					->setProductId($row['ordprodid'])
					->setQuantity($row['ordprodqty'])
					->setVariation($row['ordprodvariationid'])
				;
				if($row['ordprodeventdate']) {
					$item
						->setEventDate($row['ordprodeventdate'])
						->setEventName($row['ordprodeventname']);
				}

				if($row['ordprodwrapid']) {
					$wrappingOptions = array(
						'all' => $row['ordprodwrapid']
					);
					$wrappingMessage = array(
						'all' => $row['ordprodwrapmessage']
					);
					$item->applyGiftWrapping('same', $wrappingOptions, $wrappingMessage);
				}

				$configuredFields = array();
				if(!empty($configurableFields[$row['orderprodid']])) {
					$configuration = $configurableFields[$row['orderprodid']];
					foreach($configuration as $field) {
						if($field['fieldtype'] == 'file') {
							$filePath = ISC_BASE_PATH.'/'.getConfig('ImageDirectory').'/configured_products/'.$field['filename'];
							$fileTmpPath = ISC_BASE_PATH.'/'.GetConfig('ImageDirectory').'/configured_products_tmp/'.$field['filename'];

							// Copy the field to the temp directory
							if(!@copy($filePath, $fileTmpPath)) {
								flashMessage(getLang('ConfigurableFileCantBeMoved'), MSG_ERROR, 'cart.php');
							}

							// Add it to the configuration
							$configuredFields[$field['fieldid']] = array(
								'name' => $field['originalfilename'],
								'type' => $field['filetype'],
								'size' => filesize($filePath),
								'existingPath' => $fileTmpPath,
							);
						}
						else {
							$configuredFields[$field['fieldid']] = $field['textcontents'];
						}
					}

					$item->applyConfiguration($configuredFields);
				}

				$quote->addItem($item);
			}
			catch(ISC_QUOTE_EXCEPTION $e) {
				flashMessage($e->getMessage(), MSG_ERROR);
				$hasErrors = true;
			}
		}

		redirect('cart.php');
	}
Ejemplo n.º 16
0
                    $errors[] = 'Your username or password is incorrect';
                }
            } catch (Exception $e) {
                die($e->getMessage());
            }
        }
    }
}
include 'includes/header.php';
?>

	<div class="row">
		<div class="large-12 columns">
			<?php 
if (Session::exists('login')) {
    flashMessage(Session::flash('login'));
}
if (Session::exists('alert')) {
    flashAlert(Session::flash('alert'));
}
?>
		</div>
	</div>

	<div class="register-card">
		<h3>Log In</h3>
		<div class="row">
			<div class="large-12 columns">
				<form action="" method="POST">
					<label for="username"><h5>Username <span class="required">*</span></h5>
				    	<input type="text" id="username" name="username">
Ejemplo n.º 17
0
		/**
		 * Reassigns products and deletes selected categories.
		 *
		 * @return void
		 **/
		public function reassigncategory()
		{
			// Sanitise input.
			$newCat = (int) $_POST['parentCat'];
			$categories = array();
			foreach ($_POST['categories'] as $c) {
				$categories[(int) $c] = '';
			}

			$res = true;
			$reassign = false;
			if ($_POST['reassign'] == 'true') {
				$reassign = true;
			}

			if ($reassign) {
				// Reassign exclusive products to new category.
				foreach ($_POST['products'] as $p) {
					$values = array(
						'productid' => (int) $p,
						'categoryid' => $newCat,
					);
					$res = $this->db->insertQuery("categoryassociations", $values);
					if ($res == false) {
						break;
					}
				}
			}

			if ($res) {
				// Delete selected categories.
				$res = $this->deleteCategory($categories, false);
			}

			if ($res) {
				if ($reassign) {
					flashMessage(getLang('ReassignSuccessFlashMsg'), MSG_SUCCESS);
				} else {
					flashMessage(getLang('CatDeletedSuccessfully'), MSG_SUCCESS);
				}
			} else {
				flashMessage(getLang('ReassignErrorFlashMsg'), MSG_ERROR);
			}
		}
Ejemplo n.º 18
0
<?php

require_once "./includes/initialize.php";
session_start();
$tf_id = $_SESSION['taskforce'];
$doctor = tf_doc::list_doctor($tf_id);
if (isset($_GET['delete_doc'])) {
    $field_array = array('doc_id' => $_GET['delete_doc']);
    //    $field_array = array('id' => $id);
    $del_doc = new tf_doc();
    $del_doc->delete($field_array, 'tf_doc');
    flashMessage(' Deleted Successfully.', 'Success');
}
require_once './header.php';
if (isset($_SESSION['message'])) {
    echo $_SESSION['message'];
    unset($_SESSION['message']);
}
?>

<style>
    .bgc-fff {
        background-color: #9DC7E0!important;
    }
    .box-shad {
        -webkit-box-shadow: 1px 1px 0 rgba(0,0,0,.2);
        box-shadow: 1px 1px 0 rgba(0,0,0,.2);
    }
    .brdr {
        border: 1px solid #ededed;
    }
Ejemplo n.º 19
0
$user = new User();
require_once 'core/checkLogin.php';
include 'includes/header.php';
$blogger = $user->blogger();
$posts = $blogger->getPost();
?>
		<div class="header-wrapper">
			<div class="header-container">
				<h3>Dashboard</h3>
			</div>
		</div>
		<div class="row">
			<div class="large-12 columns">
				<?php 
if (Session::exists('home')) {
    flashMessage(Session::flash('home'));
}
?>
				<div class="row">
					<div class="large-2 columns">
					<?php 
include 'includes/Menu/sidebar.php';
?>
					</div>
					<div class="large-10 columns">
					<?php 
if (empty($posts)) {
    echo '<h5>You currently don\'t have any post!</h5>';
} else {
    foreach ($posts as $post) {
        ?>
Ejemplo n.º 20
0
	private function restoreGiftCertificate()
	{
		$id = !empty($_REQUEST['id']) ? $_REQUEST['id'] : null;
		$editGiftCertificateUrl = 'index.php?ToDo=viewTemplates&forceTab=7';

		if(!$theme = ISC_GIFTCERTIFICATE_THEME::findById($id)) {
			$message = getLang('GiftCertificateRestoreErrorInvalid');
			flashMessage($message, MSG_ERROR, $editGiftCertificateUrl);
			return;
		}

		// Replacements for the success and fail messages
		$replacements = array('name' => $theme->name);

		if($theme->restoreFromMaster()) {
			$message = getLang('GiftCertificateRestored', $replacements);
			flashMessage($message, MSG_SUCCESS, $editGiftCertificateUrl);

			return;
		}

		$message = getLang('GiftCertificateRestoreError', $replacements);
		flashMessage($message, MSG_ERROR, $editGiftCertificateUrl);
	}
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $submission = Submission::findOrFail($id);
     $id = $submission->submission_id;
     $submission->delete();
     flashMessage("Submission with ID {$id} has been deleted.", "alert-success");
     return redirect('submissions');
 }
Ejemplo n.º 22
0
		/**
		* Set Express Checkout step in Paypal Express checkout
		* it sends cart details to paypal and redirect customer to paypal login page.
		*
		*/
		private function SetExpressCheckout()
		{

			$currency = GetCurrencyCodeByID(GetConfig('DefaultCurrencyID'));

			$merchant = $this->GetMerchantSettings();

			$quote = getCustomerQuote();
			$amount = $quote->getGrandTotal();

			$shippingDetails = array();
			//if user click the paypal button on order confirmation page
			if(isset($_COOKIE['SHOP_ORDER_TOKEN'])) {
				$userAction = '&useraction=commit';
				$orders = $this->GetOrders();
				reset($orders);
				$order = current($orders);
				$orderId = '#'.implode(', #', array_keys($orders));

				if($order['ordisdigital']) {
					$shippingDetails = array (
						'NOSHIPPING' => 1,
					);
				} else {
					$shippingAddress = $this->getShippingAddress();
					$shippingDetails = array (
						'NAME' => $shippingAddress['first_name']." ".$shippingAddress['last_name'],
						'SHIPTOSTREET' => $shippingAddress['address_1'],
						'SHIPTOSTREET2' => $shippingAddress['address_2'],
						'SHIPTOCITY' => $shippingAddress['city'],
						'SHIPTOZIP' => $shippingAddress['zip'],
						'SHIPTOCOUNTRY' => $shippingAddress['country_iso2'],
						'PHONENUM' => $shippingAddress['phone'],
					);

					if($shippingAddress['state_id'] != 0 && GetStateISO2ById($shippingAddress['state_id'])) {
						$shippingDetails['SHIPTOSTATE'] = GetStateISO2ById($shippingAddress['state_id']);
					}
					else {
						$shippingAddress['SHIPTOSTATE'] = isc_html_escape($shippingAddress['state']);
					}
				}

				//don't display shipping address in PayPal
				$addressOverride = 1;
			} else {
				$userAction = '&useraction=continue';
				//display shipping address in PayPal
				$addressOverride = 0;
			}

			if($merchant['testmode'] == 'YES') {
				$transactionURL = $this->_testTransactionURL;
				$transactionURI = $this->_testTransactionURI;
				$PaypalExpressCheckoutURL = 'https://www.sandbox.paypal.com/webscr&cmd=_express-checkout&token=';
			}
			else {
				$transactionURL = $this->_liveTransactionURL;
				$transactionURI = $this->_liveTransactionURI;
				$PaypalExpressCheckoutURL = 'https://www.paypal.com/webscr&cmd=_express-checkout&token=';
			}

			$pp_array = array(
				'METHOD'		=> 'SetExpressCheckout',
				'USER'			=> $merchant['username'],
				'PWD'			=> $merchant['password'],
				'SIGNATURE'		=> $merchant['signature'],
				'VERSION'		=> '53.0',
				'PAYMENTACTION'		=> $merchant['transactionType'],

				'AMT'			=> number_format($amount,2,'.',''),
				'CURRENCYCODE'		=> $currency,
				'PAYMENTACTION'		=> $merchant['transactionType'],

				'RETURNURL'		=> $GLOBALS['ShopPath']."/checkout.php?action=set_external_checkout&provider=paypalexpress",
				'CANCELURL'		=> $GLOBALS['ShopPath']."/cart.php",
				'ADDRESSOVERRIDE'	=> $addressOverride,
				'NOTIFYURL'		=> $GLOBALS['ShopPath'].'/checkout.php?action=gateway_ping&provider='.$this->GetId(),
				'L_NAME0'		=> getLang('YourOrderFromX', array('storeName' => getConfig('StoreName'))),
				'L_AMT0'		=> number_format($amount,2,'.',''),
				'L_QTY0'		=> 1,
			);

			//if shipping details are known here, which happens when user chose paypay express checkout at normal  order confirmation page
			if(!empty($shippingDetails)) {
				$pp_array = array_merge($pp_array, $shippingDetails);
			}
			$paypal_query = '';
			foreach ($pp_array as $key => $value) {
				$paypal_query .= $key.'='.urlencode($value).'&';
			}
			$paypal_query = rtrim($paypal_query, '&');

			$result = $this->_ConnectToProvider($transactionURL, $transactionURI, $paypal_query);
			$nvpArray = $this->_DecodePaypalResult($result);

			//if data is sent to paypal successfully, a token for this transaction will return from paypal
			if(strtolower($nvpArray['ACK']) == 'success') {
				// Redirect to paypal.com here
				$token = $nvpArray["TOKEN"];
				$PayPalURL = $PaypalExpressCheckoutURL.$token.$userAction;
				header("Location: ".$PayPalURL);
			} else {
				$GLOBALS['ISC_CLASS_LOG']->LogSystemError(array('payment',  $this->GetName()), GetLang('ErrorConnectingToPaypal'), $nvpArray['L_ERRORCODE0']." ".$nvpArray['L_LONGMESSAGE0']);
				flashMessage(getLang('ErrorConnectingToPaypal'), MSG_ERROR, 'cart.php');
			}
		}
Ejemplo n.º 23
0
        $pobErr = 'required';
    } elseif (empty($_POST['strips'])) {
        $stripsErr = 'required';
    } elseif (empty($_POST['chemist'])) {
        $chemistErr = 'required';
    } else {
        if (!is_numeric($_POST['pob'])) {
            $msg = '<span class="error"> Data entered was not numeric</span>';
        } else {
            if (!is_numeric($_POST['strips'])) {
                $msg2 = '<span class="error"> Data entered was not numeric</span>';
            } else {
                $field_array = array('pob' => $_POST['pob'], 'strips' => $_POST['strips'], 'chemist' => $_POST['chemist'], 'bdm_id' => $tf_id, 'type' => 'tf', 'created_at' => date('Y:m:d '));
                $rx = new pob();
                $rx->create($field_array);
                flashMessage('Added Successfully', 'success');
            }
        }
    }
}
?>
<a href="dashboard.php" class="btn btn" >Back</a>
<?php 
require_once 'header.php';
if (isset($_SESSION['message'])) {
    echo $_SESSION['message'];
    unset($_SESSION['message']);
}
?>

Ejemplo n.º 24
0
include 'includes/header.php';
$blogger = $user->blogger();
$page = isset($_GET['page']) && !empty(Input::get('page')) ? (int) Input::get('page') : 1;
?>

	<div class="header-wrapper">
			<div class="header-container">
				<h3>Category</h3>
			</div>
		</div>

	<div class="row">
		<div class="large-12 columns">
			<?php 
if (Session::exists('category')) {
    flashMessage(Session::flash('category'));
}
?>
			<div class="row">
				<div class="large-2 columns">
				<?php 
include 'includes/Menu/sidebar.php';
?>
				</div>
				<div class="large-10 columns">
				<?php 
if (!isset($_GET['id'])) {
    $categories = $blogger->getCategory(null, $page);
    $total = $blogger->count('categories');
    $pages = ceil($total / 6);
    if (isset($_GET['page']) && Input::get('page') > $pages) {
Ejemplo n.º 25
0
        redirect_to("bmdashboard.php");
    } elseif ($found_sm) {
        $_SESSION['smsWayID'] = $found_sm->smsWayID;
        $_SESSION['smname'] = $found_sm->SM_Name;
        $_SESSION['smzone'] = $found_sm->Zone;
        $_SESSION['smemp'] = $found_sm->SM_Emp_Id;
        redirect_to("SMDashboard.php");
    } elseif ($found_tm) {
        $_SESSION['smsWayID'] = $found_tm->smsWayID;
        $_SESSION['tmname'] = $found_tm->TM_Name;
        $_SESSION['tmzone'] = $found_tm->Zone;
        $_SESSION['tmemp'] = $found_tm->TM_Emp_Id;
        redirect_to("TMDashboard.php");
    } else {
        $message = "Incorrect Username/Password.";
        flashMessage($message, 'error');
    }
}
if (isset($_SESSION['message'])) {
    echo $_SESSION['message'];
    unset($_SESSION['message']);
}
?>

<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">
        <meta name="description" content="">
        <meta name="author" content="">
Ejemplo n.º 26
0
	private function DoPurchaseGiftCertificate()
	{
		$errors = array();
		// Begin validation!
		if(GetConfig('GiftCertificateCustomAmounts') == 1) {

			// Is there a minimum and maximum limit?
			$minAmount = ConvertPriceToCurrency(GetConfig('GiftCertificateMinimum'));
			$maxAmount = ConvertPriceToCurrency(GetConfig('GiftCertificateMaximum'));

			if(!GetConfig('GiftCertificateCustomAmounts')) {
				$errors[] = GetLang('SelectValidGiftCertificateAmount');
			}
			else if(!isset($_POST['certificate_amount']) || !is_numeric($_POST['certificate_amount'])) {
				$errors[] = GetLang('EnterValidGiftCertificateAmount');
			}
			else if(($minAmount > 0 && $_POST['certificate_amount'] < $minAmount) || ($maxAmount > 0 && $_POST['certificate_amount'] > $maxAmount)) {
				$errors[] = GetLang('EnterGiftCertificateValueBetween');
			}
			else {
				$amount = ConvertPriceToDefaultCurrency($_POST['certificate_amount']);
			}
		}
		// Selected a gift certificate amount from the list
		else {
			if(!in_array($_POST['selected_amount'], GetConfig('GiftCertificateAmounts'))) {
				$errors[] = GetLang('SelectValidGiftCertificateAmount');
			}
			else {
				$amount = $_POST['selected_amount'];
			}
		}

		// Did they not enter who they wanted the certificate to be sent to?
		if(!isset($_POST['to_name']) || trim($_POST['to_name']) == "") {
			$errors[] = Getlang('EnterValidCertificateToName');
		}

		if(!isset($_POST['to_email']) || !is_email_address($_POST['to_email'])) {
			$errors[] = GetLang('EnterValidCertificateToEmail');
		}

		// Missing from details?
		if(!isset($_POST['from_name']) ||trim($_POST['from_name']) == "") {
			$errors[] = GetLang('EnterValidCertificateFromName');
		}

		if(!isset($_POST['from_email']) || !is_email_address($_POST['from_email'])) {
			$errors[] = GetLang('EnterValidCertificateFromEmail');
		}

		$message = '';
		if(isset($_POST['message']) && isc_strlen($_POST['message']) > 200) {
			$errors[] = GetLang('GiftCertificateMessageTooLong');
		}
		else if(isset($_POST['message'])) {
			$message = $_POST['message'];
		}

		// Did they select a valid theme?
		$enabledThemes = explode(",", GetConfig('GiftCertificateThemes'));

		// Only one theme enabled, automagically select it
		if(count($enabledThemes) == 1) {
			$_POST['certificate_theme'] = $enabledThemes[0];
		}
		else if(empty($enabledThemes)) {
			$_POST['certificate_theme'] = 'General';
		}
		else if(!isset($_POST['certificate_theme']) || !in_array($_POST['certificate_theme'], $enabledThemes)) {
			$errors[] = GetLang('SelectValidGiftCertificateTheme');
		}

		// Now the validation is all done, were there any errors? If yes, throw back to the purchase page
		if(!empty($errors)) {
			$this->PurchaseGiftCertificate($errors);
		}

		// Else, add the gift certificate to the cart
		else {
			$newCertificate = array(
				"amount" => $amount,
				"to_name" => $_POST['to_name'],
				"to_email" => $_POST['to_email'],
				"from_name" => $_POST['from_name'],
				"from_email" => $_POST['from_email'],
				"message" => $_POST['message'],
				"theme" => $_POST['certificate_theme']
			);

			if(isset($_POST['cartitemid']) && $_POST['cartitemid'] >= 0) {
				$this->UpdateGiftCertificateInCart($_POST['cartitemid'], $newCertificate);
				$message =  getLang('GiftCertificateUpdated');
			}
			else {
				$this->AddGiftCertificateToCart($newCertificate);
				$message = getLang('GiftCertificateAddedToCart');
			}

			flashMessage($message, MSG_SUCCESS, 'cart.php');
		}
	}
Ejemplo n.º 27
0
		private function SetExpressCheckout()
		{
			$currency = GetCurrencyCodeByID(GetConfig('DefaultCurrencyID'));

			$merchant = $this->GetMerchantSettings();

			$quote = getCustomerQuote();
			$amount = $quote->getGrandTotal();

			if($merchant['testmode'] == 'YES') {
				$transactionURL = $this->_testTransactionURL;
				$transactionURI = $this->_testTransactionURI;
				$PaypalURL = 'https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=';
			}
			else {
				$transactionURL = $this->_liveTransactionURL;
				$transactionURI = $this->_liveTransactionURI;
				$PaypalURL = 'https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=';
			}

			$pp_array = array(
								'ACTION'			=> 'S',
								'TRXTYPE'			=> $merchant['transactionType'],
								'AMT'				=> number_format($amount,2,'.',''),
								'CANCELURL'			=> $GLOBALS['ShopPath']."/cart.php",
								'PARTNER'			=> $merchant['partnerid'],

								'TENDER'			=> 'P',
								'USER'				=> $merchant['userid'],
								'PWD'				=> $merchant['password'],
								'VENDOR'			=> $merchant['vendorid'],
								'CURRENCY'			=> $currency,
								'REQCONFIRMSHIPPING'=> 1,
								'NOSHIPPING'		=> 0,
								'RETURNURL'			=> $GLOBALS['ShopPath']."/checkout.php?action=set_external_checkout&provider=paypalpaymentsprouk",
								'NOTIFYURL'			=> $GLOBALS['ShopPath'].'/checkout.php?action=gateway_ping&provider='.$this->GetId(),
							);

			$paypal_query = '';
			foreach ($pp_array as $key => $value) {
				$paypal_query .= $key.'['.strlen($value).']='.$value. '&';
			}
			$paypal_query = rtrim($paypal_query, '&');

			$result = $this->_ConnectToProvider($transactionURL, $transactionURI, $paypal_query, uniqid(rand()));
			$nvpArray = $this->_DecodePaypalResult($result);


			if($nvpArray['RESULT'] == 0) {
				// Redirect to paypal.com here
				$token = $nvpArray["TOKEN"];
				$PaypalURL = $PaypalURL.$token;
				header("Location: ".$PaypalURL);
			} else {
				//Redirecting to APIError.php to display errors.
				flashMessage(getLang('ErrorConnectingToPaypal'), MSG_ERROR, 'cart.php');

				$GLOBALS['ISC_CLASS_LOG']->LogSystemError(array('payment',  $this->GetName()), GetLang('ErrorConnectingToPaypal'), $nvpArray['RESULT']." ".$nvpArray['RESPMSG']);

				$location = $GLOBALS['ShopPath']."/cart.php";
				header("Location: $location");
			}
		}
Ejemplo n.º 28
0
        }
    }
}
?>

	<div class="header-wrapper">
			<div class="header-container">
				<h3>Article</h3>
			</div>
		</div>
	
	<div class="row">
		<div class="large-12 columns">
			<?php 
if (Session::exists('post')) {
    flashMessage(Session::flash('post'));
}
?>
			<div class="row">
				<div class="large-2 columns">
				<?php 
include 'includes/Menu/sidebar.php';
?>
				</div>
				<div class="row">
					<div class="large-9 columns">
						<div class="row">
							<div class="large-12 columns">
								<h3><?php 
echo display($post->title);
?>
Ejemplo n.º 29
0
                                    <div class="col-md-6">
                                        <input type="text" class="form-control" value="<?php 
echo set_value("name");
?>
" name="name" placeholder="Enter Company Name">
                                        <?php 
echo myform_error('name');
?>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-md-3 control-label">Logo</label>
                                    <div class="col-md-6">
                                        <input type="file" name="image" >
                                        <?php 
echo flashMessage(true, true);
?>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-md-3 control-label">About Company</label>
                                    <div class="col-md-9">
                                        <textarea class="ckeditor form-control" name="about_company" 
                                                 data-error-container="#editor2_error"></textarea>
                                    </div>
                                </div>
                                  
                            </div>
                            <div class="form-actions">
                                <div class="row">
                                    <div class="col-md-offset-3 col-md-9">
Ejemplo n.º 30
0
		/**
		* Set Express Checkout step in Paypal Express checkout
		* it sends cart details to paypal and redirect customer to paypal login page.
		*
		*/
		private function SetExpressCheckout()
		{
			$currency = GetCurrencyCodeByID(GetConfig('DefaultCurrencyID'));

			$merchant = $this->GetMerchantSettings();

			$quote = getCustomerQuote();
			$amount = $quote->getGrandTotal();

			if($merchant['testmode'] == 'YES') {
				$transactionURL = $this->_testTransactionURL;
				$transactionURI = $this->_testTransactionURI;
				$PaypalExpressCheckoutURL = 'https://www.sandbox.paypal.com/webscr&cmd=_express-checkout&token=';
			}
			else {
				$transactionURL = $this->_liveTransactionURL;
				$transactionURI = $this->_liveTransactionURI;
				$PaypalExpressCheckoutURL = 'https://www.paypal.com/webscr&cmd=_express-checkout&token=';
			}

			$pp_array = array(
				'METHOD'	=> 'SetExpressCheckout',
				'USER'		=> $merchant['username'],
				'PWD'		=> $merchant['password'],
				'SIGNATURE'	=> $merchant['signature'],
				'VERSION'	=> '53.0',
				'PAYMENTACTION'	=> $merchant['transactionType'],
				'AMT'		=> number_format($amount,2,'.',''),
				'CURRENCYCODE'	=> $currency,
				'PAYMENTACTION'	=> $merchant['transactionType'],
				'RETURNURL'	=> $GLOBALS['ShopPath']."/checkout.php?action=set_external_checkout&provider=paypalpaymentsprous",
				'CANCELURL'	=> $GLOBALS['ShopPath']."/cart.php",
				'NOSHIPPING'	=> 0,
				'NOTIFYURL'	=> $GLOBALS['ShopPath'].'/checkout.php?action=gateway_ping&provider='.$this->GetId(),
			);
			$paypal_query = http_build_query($pp_array);


			$result = $this->_ConnectToProvider($transactionURL, $transactionURI, $paypal_query);
			$nvpArray = $this->_DecodePaypalResult($result);
			//if data is sent to paypal successfully, a token for this transaction will return from paypal
			if(strtolower($nvpArray['ACK']) == 'success') {
				// Redirect to paypal.com here
				$token = $nvpArray["TOKEN"];
				$PayPalURL = $PaypalExpressCheckoutURL.$token;
				header("Location: ".$PayPalURL);
			} else {
				//Redirecting to APIError.php to display errors.
				$GLOBALS['ISC_CLASS_LOG']->LogSystemError(array('payment',  $this->GetName()), GetLang('ErrorConnectingToPaypal'), $nvpArray['L_ERRORCODE0']." ".$nvpArray['L_LONGMESSAGE0']);
				flashMessage(getLang('ErrorConnectingToPaypal'), MSG_ERROR, 'cart.php');
			}
		}