示例#1
0
  public function executeShownot(sfWebRequest $request)
  {
	$user = new AdUser();
	if($user->isAllowed($_POST['token'], $_POST['user_id'])){
		$this->ad_notification = Doctrine_Core::getTable('AdNotification')->find(array($request->getParameter('notification_id')));
		$this->userId= $request->getParameter('user_id');
		$this->forward404Unless($this->ad_notification);
		$log = new AdLog();
		$log->setAction('De gebruiker heeft zijn notifications gecontroleerd.');
		$log->setAdUserId($_POST['user_id']);
		$log->setDate(date('y-m-d H:m:s'));
		$log->save();
	}else{
		$this->redirect('users/error?message=Not logged in!&title=Error&type=error');
	}	
  }
示例#2
0
  public function executeIndex(sfWebRequest $request)
  {
		$user = new AdUser();
		if($user->isAllowed($_POST['token'], $_POST['user_id'])){
			$this->med_ki_vals = Doctrine_Core::getTable('medKiVal')
			  ->createQuery('a')
			  ->execute();
			$log = new AdLog();
			$log->setAction('De ki waarden zijn opgevraagd.');
			$log->setAdUserId($_POST['user_id']);
			$log->setDate(date('y-m-d H:m:s'));
			$log->save();
		}else{
			$this->redirect('users/error?message=Not logged in!&title=Error&type=error');
		}
  }
示例#3
0
  public function executeShow(sfWebRequest $request)
  {
	$user = new AdUser();
	if($user->isAllowed($_POST['token'], $_POST['user_id'])){
		$this->id = $request->getParameter('med_chem_bonding_id');
		$this->med_form_bondings = Doctrine_Query::create()->from('medFormBonding mfb')->where('mfb.med_chem_bonding_id = ?',$request->getParameter('med_chem_bonding_id'))->orderBy('med_ki_val_id')->execute();
		$this->forward404Unless($this->med_form_bondings);
		$log = new AdLog();
		$med_chem_bonding = Doctrine_Core::getTable('medChemBonding')->find(array($request->getParameter('med_chem_bonding_id')));
		$log->setAction('De gebruiker heeft info over een receptor opgevraagd: ' . $med_chem_bonding->getName());
		$log->setAdUserId($_POST['user_id']);
		$log->setDate(date('y-m-d H:m:s'));
		$log->save();
	}else{
		$this->redirect('users/error?message=Not logged in!&title=Error&type=error');
	}
  }
示例#4
0
  public function executeCreate(sfWebRequest $request)
  {
	$user = new AdUser();
	if($user->isAllowed($_POST['token'], $_POST['user_id'])){
		$adNonPsychoPat = new AdNonPsychoPat();
		$adNonPsychoPat->setPatientId($_POST['patientId']);
		$adNonPsychoPat->setNonPsychoId($_POST['nonPsychoId']);
		$adNonPsychoPat->setStartDate($_POST['startDate']);
		$adNonPsychoPat->save();  
	/*    $this->forward404Unless($request->isMethod(sfRequest::POST));
		$this->form = new adNonPsychoPatForm();
		$this->processForm($request, $this->form);
		$this->setTemplate('new');*/
		$this->ad_patient = Doctrine_Core::getTable('adPatient')->find(array($_POST['patientId']));
		$log = new AdLog();
		$log->setAction('Er is een nieuwe non-psycho toegevoegd aan de patient: ' . $this->ad_patient->getFname() . $this->ad_patient->getLname());
		$log->setAdUserId($_POST['user_id']);
		$log->setDate(date('y-m-d H:m:s'));
		$log->save();
	}else{
		$this->redirect('users/error?message=Not logged in!&title=Error&type=error');
	}
  }
示例#5
0
  public function executeCreate(sfWebRequest $request)
  {
	$user = new AdUser();
	if($user->isAllowed($_POST['token'], $_POST['user_id'])){
	  if(isset($_POST['fName'])){
		  $med_type = new MedType();
		  $med_type->setMedSubtype1Id($_POST['med_subtype1']);
		  $med_type->setMedSubtype2Id($_POST['med_subtype2']);
		  $med_type->save();

		  $med_base_id = new MedBaseId();
		  $med_base_id->setMainclass($_POST['mainclass']);
		  $med_base_id->setGenName($_POST['gen_name']);
		  $med_base_id->setSpeciality($_POST['speciality']);
		  $med_base_id->setMedTypeId($med_type->getMedTypeId());
		  $med_base_id->save();

		  $med_form = new MedForm();
		  $med_form->setMedBaseId($med_base_id->getMedBaseId());
		  $med_form->setMedMagisterFormId($_POST['med_magister_form']);
		  $med_form->setDose($_POST['dose']);
		  $med_form->setBioavailability($_POST['bioavailability']);
		  $med_form->setProteineBinding($_POST['proteine_binding']);
		  $med_form->setTMaxH($_POST['t_max_h']);
		  $med_form->setHlf($_POST['hlf']);
		  $med_form->setDdd($_POST['ddd']);
		  $med_form->save();
		  $i = 0;
		  foreach($_POST['chem_bonding_id'] as $chemBonding){
			  $med_form_bonding = new medFormBonding();
			  $med_form_bonding->setMedFormBondingId($med_form->getMedFormId());
			  $med_form_bonding->setMedChemBondingId($_POST['chem_bonding_id'][$i]);
			  $med_form_bonding->setMedKiValId($_POST['med_ki_val_id'][$i]);
			  $i++;
		  }

		  $med_bnf_medicine=new MedBnfMedicine();
		  $med_bnf_percentage = Doctrine_Query::create()->from('med_bnf_percentage mbp')->where('mbp.percentage = ?',$_POST['bnf_percentage'])->execute();
		  $med_bnf_medicine->setBnfPercentageId($med_bnf_percentage[0]->getBnfPercentageId());
		  $med_bnf_medicine->setValue($_POST['bnf_value']);
		  $med_bnf_medicine->setMedFormId($med_form->getMedFormId());
		  $med_bnf_medicine->save();

		  $int_metabolism = new IntMetabolism();
		  $int_metabolism->setEnzymGroupId($_POST['enzym_name']);
		  $int_metabolism->setMedFormId($med_form->getMedFormId());
		  $int_metabolism->save();
		  
		  $log = new AdLog();
		  $log->setAction('Een nieuw medicijn is toegevoegd: ' . $med_base_id->getSpeciality());
		  $log->setAdUserId($_POST['user_id']);
		  $log->setDate(date('y-m-d H:m:s'));
		  $log->save();
	  }
	}else{
		$this->redirect('users/error?message=Not logged in!&title=Error&type=error');
	}
/*    $this->forward404Unless($request->isMethod(sfRequest::POST));

    $this->form = new medFormForm();

    $this->processForm($request, $this->form);

    $this->setTemplate('new');*/
  }
示例#6
0
  public function executeCreate(sfWebRequest $request)
  {
	$user = new AdUser();
	if($user->isAllowed($_POST['token'], $_POST['user_id'])){
      if(isset($_POST['fName'])){
        $patient = new AdPatient();
        $patient->setFname($_POST['fName']);
        $patient->setLname($_POST['lName']);
        $patient->setBdate($_POST['bDate']);
        $patient->setSex($_POST['sex']);
        $patient->setPatientSince(date('y-m-d H:m:s'));
        $patient->save();
		$log = new AdLog();
		$log->setAction('Een nieuwe patient is toegevoegd: ' . $patient->getFname . ' ' . $patient->getLname);
		$log->setAdUserId($_POST['user_id']);
		$log->setDate(date('y-m-d H:m:s'));
		$log->save();
        $this->redirect('show_patient',array('patient_id'=>$patient->getPatientId()));
      }else{
         $this->forward404('er is een fout gebeurd bij het invullen van de gegevens');
      }
	}else{
		$this->redirect('users/error?message=Not logged in!&title=Error&type=error');
	}
#    $this->forward404Unless($request->isMethod(sfRequest::POST));
#    $this->form = new adPatientForm();
#    $this->processForm($request, $this->form);
#    $this->setTemplate('new');
  }
示例#7
0
  public function executeDelete(sfWebRequest $request)
  {
//    $request->checkCSRFProtection();
	$user = new AdUser();
	if($user->isAllowed($_POST['token'], $_POST['user_id'])){
    $this->forward404Unless($ad_user = Doctrine_Core::getTable('adUser')->find(array($request->getParameter('user_id'))), sprintf('Object ad_user does not exist (%s).', $request->getParameter('user_id')));
                $log = new AdLog();
		$log->setAction('De gebruiker heeft een andere gebruiker verwijderd: ' . $ad_user->getFname() . $ad_user->getLname());
		$log->setAdUserId($_POST['user_id']);
		$log->setDate(date('y-m-d H:m:s'));
		$log->save();
        
        	$ad_user->delete();
                $this->redirect('users/index');
	}else{
		$this->redirect('users/error?message=Not logged in!&title=Error&type=error');
	}
  }
示例#8
0
    public function executeFirstLogin(sfWebRequest $request)
      {
		$user = new AdUser();
		if($user->isAllowed($_POST['token'], $_POST['user_id'])){
			$uName= $_POST['uName'];// $request->getParameter('uName');
			$old = $_POST['old']; //$request->getParameter('old');
			$new= $_POST['new']; //$request->getParameter('new');
			$unlock = $_POST['unlock']; // $request->getParameter('unlock');
			$user = new AdUser();
			$this->firstLogin = $user->firstLogin($uName,$old,$new,$unlock);
			$log = new AdLog();
			$log->setAction('De gebruiker heeft zich geregistreerd.');
			$log->setAdUserId($_POST['user_id']);
			$log->setDate(date('y-m-d H:m:s'));
			$log->save();
		}else{
			$this->redirect('users/error?message=Not logged in!&title=Error&type=error');
		}
      }