本文整理汇总了PHP中Student::setEmail方法的典型用法代码示例。如果您正苦于以下问题:PHP Student::setEmail方法的具体用法?PHP Student::setEmail怎么用?PHP Student::setEmail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Student
的用法示例。
在下文中一共展示了Student::setEmail方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: executeNew
public function executeNew(sfWebRequest $request)
{
$programSectionId = $request->getParameter('sectionId');
$this->sectionDetail = Doctrine_Core::getTable('ProgramSection')->findOneById($programSectionId);
$this->forward404Unless($this->sectionDetail);
## New Form
$this->studentForm = new FrontendStudentForm();
if ($request->isMethod('POST')) {
$this->studentForm->bind($request->getParameter('studentform'));
if ($this->studentForm->isValid()) {
$formData = $this->studentForm->getValues();
$student = new Student();
$name = $formData['name'];
$fathersName = $formData['fathers_name'];
$grandfathersName = $formData['grandfathers_name'];
$motherName = $formData['mother_name'];
$dateOfBirth = $formData['date_of_birth'];
$sex = $formData['sex'];
$nationality = $formData['nationality'];
$birthLocation = $formData['birth_location'];
$residenceCity = $formData['residence_city'];
$residenceWoreda = $formData['residence_woreda'];
$residenceKebele = $formData['residence_kebele'];
$residenceHourseNumber = $formData['residence_house_number'];
$ethnicity = $formData['ethnicity'];
$telephone = $formData['telephone'];
$email = $formData['email'];
$student->setName($name);
$student->setFathersName($fathersName);
$student->setGrandfathersName($grandfathersName);
$student->setMotherName($motherName);
$student->setDateOfBirth($dateOfBirth);
$student->setSex($sex);
$student->setAdmissionYear(date('Y'));
$student->setNationality($nationality);
$student->setBirthLocation($birthLocation);
$student->setResidenceCity($residenceCity);
$student->setResidenceWoreda($residenceWoreda);
$student->setResidenceKebele($residenceKebele);
$student->setResidenceHouseNumber($residenceHourseNumber);
$student->setEthinicity($ethnicity);
$student->setTelephone($telephone);
$student->setEmail($email);
$student->save();
$enrollment = new EnrollmentInfo();
$enrollment->makeEnrollment(null, null, null, null, $programSectionId, sfConfig::get('app_transfer_enrollment'), $student->getId());
$auditlog = new AuditLog();
$auditlog->addNewLogInfo($this->getUser()->getAttribute('userId'), 'Performed Enrollment of Transfered Student');
$this->getUser()->setFlash('notice', 'Transfer Enrollment Was Successful ');
$this->redirect('transfer/sectiondetail/?id=' . $programSectionId);
} else {
$this->getUser()->setFlash('error', 'Error with Transfer Enrollment Form');
}
}
}
示例2: validate
protected function validate()
{
$required = array("teacher_id" => "Teacher Id", "admission_date" => "Admission Date", "name" => "Name", "subject_id" => "Subject", "date_of_birth" => "Date of Birth", "gender" => "Gender", "mobile" => "Mobile");
global $user;
if ($user->checkAdmin() == true) {
if (isset($_POST)) {
foreach ($required as $key => $value) {
if (!isset($_POST[$key]) || $_POST[$key] == '' || $_POST[$key] == 'select') {
echo $value . ' is Required<br/>';
return;
}
}
if (!is_numeric($_POST['mobile'])) {
echo "Mobile number must be Numeric";
} else {
if (isset($_POST['permanent_pincode']) && $_POST['permanent_pincode'] != '' && !is_numeric($_POST['permanent_pincode']) || isset($_POST['correspondence_pincode']) && $_POST['correspondence_pincode'] != '' && !is_numeric($_POST['correspondence_pincode'])) {
echo "Pincode must be Numeric";
} else {
echo 'Saving...';
global $objPDO;
require_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/student_class.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/cloud/model/student_profile_class.php';
$teacher = new Student($objPDO);
$teacherProfile = new Teacher($objPDO);
$temp_pass = substr(md5(microtime()), 5, 10);
$pass = md5($temp_pass);
$teacher_id = $_POST['teacher_id'];
if ($_POST['blood_group'] == 'select') {
unset($_POST['blood_group']);
}
$acct_type = 'teacher';
$teacher->setacctType($acct_type);
$teacher->loadByRoll($teacher_id);
$teacher->setRollNo($teacher_id);
$teacher->setPhone($_POST['phone']);
$teacher->setName($_POST['name']);
$teacher->setEmail($_POST['email']);
if ($teacher->getPassword() == '' || $teacher->getPassword() == NULL) {
$teacher->setPassword($pass);
}
$teacher->save();
$id = $teacher->getID();
$teacherProfile->setByArray($_POST);
$teacherProfile->setTempPass($temp_pass);
$teacherProfile->setUserId($id);
$teacherProfile->save();
echo '<meta http-equiv="Refresh" content="0;url=http://localhost/cloud/teacher/confirm/' . $teacherProfile->getUserId() . '"/>';
}
}
}
} else {
header('Location:http://localhost/cloud');
}
}
示例3: City
<?php
require_once '../Hypersistence/Hypersistence.php';
Hypersistence::registerAutoloader();
require_once './Person.php';
require_once './Book.php';
require_once './Student.php';
require_once './Course.php';
require_once './City.php';
//SAVE
$c = new City();
$c->setName('San Francisco');
$c->save();
$s = new Student();
$s->setCity($c);
$s->setEmail('test@hypersistence.com');
$s->setName('Mateus Fornari');
$s->setNumber('123456');
var_dump($s->save());
$course = new Course();
$course->setDescription('PHP Programming');
$course->save();
$s->addCourses($course);
$p = new Person();
$p->setCity($c);
$p->setEmail('other@hypersistence.com');
$p->setName('Other Person');
$p->save();
$b = new Book();
$b->setAuthor($p);
$b->setTitle('PHP Book');
示例4: array
<?php
require_once 'student_class.php';
require_once 'pdofactory_class.php';
$strDSN = 'mysql:dbname=cloud;host=localhost';
$objPDO = PDOfactory::GetPDO($strDSN, "root", "", array());
$objPDO->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$objUser = new Student($objPDO);
$objUser->setRollNo("admin");
$objUser->setName("admin");
$objUser->setEmail("srini2351994@yahoo.com");
$objUser->setPassword("827ccb0eea8a706c4c34a16891f84e7b");
$objUser->setPhone("2346");
$objUser->setacctType("admin");
$objUser->save();
echo $objUser->getName();
echo $objUser->getEmail();
echo $objUser->getPassword();
echo $objUser->getPhone();
//$objUser->markForDeletion();