<?php
  /**
   * Controller
   *
   * @package Digital Downloads Pro
   * @author wojoscripts.com
   * @copyright 2010
   * @version $Id: controller.php, v2.00 2011-07-10 10:12:05 gewa Exp $
   */
  define("_VALID_PHP", true);
  require_once("../init.php");

  if (!$user->logged_in)
      redirect_to("../index.php");
?>
<?php
  /* Proccess User */
  if (isset($_POST['processUser']))
      : if (intval($_POST['processUser']) == 0 || empty($_POST['processUser']))
      : redirect_to("../profile.php");
  endif;
  $user->updateProfile();
  endif;
?>
<?php
  /* Proccess Gateway */
  if (isset($_POST['loadgateway'])): 
      $gate_id = intval($_POST['loadgateway']);
       $row = $core->getRowById("gateways", $gate_id, false, false);
	   
      $form_url = BASEPATH . "gateways/" . $row['dir'] . "/form.tpl.php";
      (file_exists($form_url)) ? include($form_url) : $core->msgError('<span>!خـطا</span>. روش پرداخـت انتخابـی شمـا معتبـر نمی باشـد، لطفـا دوبـاره سعی نمائیـد');
  endif;
?>