本文整理汇总了PHP中Person::get_last_name方法的典型用法代码示例。如果您正苦于以下问题:PHP Person::get_last_name方法的具体用法?PHP Person::get_last_name怎么用?PHP Person::get_last_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Person
的用法示例。
在下文中一共展示了Person::get_last_name方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testConstructor
function testConstructor()
{
$test_person = new Person("John", "Smith", "10-12-87", "Male", "555 Main Street", "Flushing", "NY", "11111", "20724415902", "2072654046", "john.smith@stjohns.edu", "volunteer", " ", "Schedule", "I like helping out", "55555", "03-14-14", "email");
echo "Testing first name" . '</br>';
if ($test_person->get_first_name() == "John") {
echo 'First name test succeeded </br>';
} else {
echo 'First name test failed </br>';
}
if ($test_person->get_last_name() == "Smith") {
echo 'last name test succeeded </br>';
} else {
echo 'last name test failed </br>';
}
if ($test_person->get_gender() == "Male") {
echo 'gender test succeeded </br>';
} else {
echo 'gender test failed </br>';
}
if ($test_person->get_address() == "555 Main Street") {
echo 'address test succeeded </br>';
} else {
echo 'address test failed </br>';
}
if ($test_person->get_city() == "Flushing") {
echo 'city test succeeded </br>';
} else {
echo 'city test failed </br>';
}
if ($test_person->get_state() == "NY") {
echo 'state test succeeded </br>';
} else {
echo 'state test failed </br>';
}
if ($test_person->get_zip() == "11111") {
echo 'zip test succeeded </br>';
} else {
echo 'zip test failed </br>';
}
if ($test_person->get_county() == "Queens") {
echo 'county test succeeded </br>';
} else {
echo 'county test failed </br>';
}
if ($test_person->get_phone1() == "20724415902") {
echo 'phone1 test succeeded </br>';
} else {
echo 'phone1 test failed </br>';
}
if ($test_person->get_phone2() == "2072654046") {
echo 'phone2 test succeeded </br>';
} else {
echo 'phone2 test failed </br>';
}
}
示例2: testPersonModule
function testPersonModule()
{
$myPerson = new Person("Taylor", "Talmage", "928 SU", "Brunswick", "ME", 04011, 2074415902, 2072654046, "ttalmage@bowdoin.edu", "volunteer", "soupkitchen", "C", "active", "Mon:1,Tue:3,Wed:1", "09-19-13,09-16-13", "02-19-89", "03-14-08", "this is a note", "Taylor2074415902");
//first assertion - check that a getter is working from the superconstructor's initialized data
$this->assertTrue($myPerson->get_first_name() == "Taylor");
$this->assertTrue($myPerson->get_type() == "volunteer");
$this->assertTrue($myPerson->get_status() == "active");
$this->assertEqual($myPerson->get_availability(), array("Mon:1", "Tue:3", "Wed:1"));
$this->assertTrue($myPerson->get_last_name() !== "notMyLastName");
echo "testPerson complete";
}
示例3: testPersonModule
function testPersonModule()
{
$myPerson = new Person("Susan", "L", "portland", "928 SU", "Portland", "ME", 04011, 2074415902, "home", 2072654046, "cell", "susanl@aol.com", "volunteer", "", "", "active", "USM", "student", 3, "semester", "I like helping out", "cooking", "", "Mon:9-12:portland,Sun:evening:portland", "", "", "89-02-19", "08-03-14", "internet", "this is a note", "");
//first assertion - check that a getter is working from the superconstructor's initialized data
$this->assertTrue($myPerson->get_first_name() == "Susan");
$this->assertTrue($myPerson->get_type() == array("volunteer"));
$this->assertTrue($myPerson->get_status() == "active");
$this->assertTrue($myPerson->get_city() == "Portland");
$this->assertTrue($myPerson->get_phone1() == 2074415902);
$this->assertTrue($myPerson->get_employer() == "USM");
$this->assertEqual($myPerson->get_availability(), array("Mon:9-12:portland", "Sun:evening:portland"));
$this->assertTrue($myPerson->get_last_name() !== "notMyLastName");
$this->assertTrue($myPerson->get_phone1type() !== "work");
$this->assertTrue($myPerson->get_howdidyouhear() == "internet");
$this->assertTrue($myPerson->get_birthday() == "89-02-19");
echo "testPerson complete";
}
示例4: testPersonModule
function testPersonModule()
{
$this->assertEqual(true, true);
$this->assertTrue(true);
$this->assertFalse(false);
//fake person to test
$test_person = new Person("Smith", "John", "123 College Street", "Brunswick", "ME", "04011", "(207)555-1234", "", "email@bowdoin.edu", "guest", "", "Jane Smith", "98-01-01", "parent", "");
//testing getter functions
$this->assertTrue($test_person->get_first_name() == "John");
$this->assertTrue($test_person->get_last_name() == "Smith");
$this->assertTrue($test_person->get_address() == "123 College Street");
$this->assertTrue($test_person->get_city() == "Brunswick");
$this->assertTrue($test_person->get_state() == "ME");
$this->assertTrue($test_person->get_zip() == "04011");
$this->assertTrue($test_person->get_phone1() == "(207)555-1234");
$this->assertTrue($test_person->get_phone2() == "");
$this->assertTrue($test_person->get_email() == "email@bowdoin.edu");
$this->assertTrue($test_person->get_patient_name() == "Jane Smith");
$this->assertTrue($test_person->get_patient_birthdate() == "98-01-01");
$this->assertTrue($test_person->get_patient_relation() == "parent");
//tests the 'check_type' function
$this->assertTrue($test_person->check_type("guest"));
//checks that the checkin dates array returns false correctly
$this->assertFalse(in_array("11-02-01", $test_person->get_prior_bookings()));
//adds a checkin date and checks that it was added to the array
$test_person->add_prior_booking("10-05-01John2075551234");
$this->assertTrue(in_array("10-05-01John2075551234", $test_person->get_prior_bookings()));
//tests adding and checking type
$this->assertFalse($test_person->check_type("social worker"));
$test_person->add_type("social worker");
$this->assertTrue($test_person->check_type("social worker"));
//checks the manager notes getter and setter
$this->assertFalse($test_person->get_mgr_notes(), "note");
$test_person->set_mgr_notes("here is a note");
$this->assertEqual($test_person->get_mgr_notes(), "here is a note");
echo "testPerson complete";
}
示例5: removeContactGroup
function removeContactGroup($group)
{
//global the variables
global $contactForm;
//if the user confirms the delete then delete the id
if (isset($_POST['deleteYes'])) {
//if the id is valid delete
if (is_numeric($_GET['contactID']) && is_numeric($_GET['contactTypeID'])) {
$contact = new Person($_GET['contactID']);
$contactType = new PersonType($_GET['contactTypeID']);
if ($group->remove_contact($_GET['contactID'], $_GET['contactTypeID'])) {
$status = "success";
$_SESSION['action'] = "Removed from " . $contactType->get_name() . ": " . $contact->get_first_name() . " " . $contact->get_last_name();
echo "<meta http-equiv=\"REFRESH\" content=\"0;url=" . $_SERVER['PHP_SELF'] . "?action=showGroup&groupID=" . $_GET['groupID'] . "&delete={$status}\">";
} else {
$link = $_SERVER['PHP_SELF'] . "?action=showGroup&groupID=" . $_GET['groupID'];
$contactForm->error("Warning: Failed to remove customer. Reason: " . $group->get_error(), $link);
}
}
} else {
if (isset($_POST['deleteNo'])) {
echo "<meta http-equiv=\"REFRESH\" content=\"0;url=" . $_SERVER['PHP_SELF'] . "?action=showGroup&groupID=" . $_GET['groupID'] . "\">";
} else {
$contactForm->prompt("Are you sure you want to delete?");
}
}
}
示例6: Person
$json .= '{ "id" : "' . $c->get_id() . '",
"photo" : "' . $c->get_photo() . '",
"firstname" : "' . $c->get_first_name() . '",
"lastname" : "' . $c->get_last_name() . '",
"dateofbirth" : "' . $c->get_date_of_birth() . '",
"skills" : "' . $c->get_skills() . '",
"status" : "' . $c->get_status() . '",';
$id = $c->get_tutor();
$tutor = new Person($id);
$json .= '
"tutor" : {
"id" : "' . $tutor->get_id() . '",
"role" : "' . $tutor->get_role() . '",
"photo" : "' . $tutor->get_photo() . '",
"firstname" : "' . $tutor->get_first_name() . '",
"lastname" : "' . $tutor->get_last_name() . '",
"date_of_birth" : "' . $tutor->get_date_of_birth() . '",
"email" : "' . $tutor->get_email() . '",
"phone" : "' . $tutor->get_phone() . '",
"address" : "' . $tutor->get_address() . '"
},';
$id_transporter = $c->get_transporter();
$transporter = new Transporter($id_transporter);
$json .= '
"transporter" : {
"id" : "' . $transporter->get_id() . '",
"photo" : "' . $transporter->get_photo() . '",
"firstname" : "' . $transporter->get_first_name() . '",
"lastname" : "' . $transporter->get_last_name() . '",
"email" : "' . $transporter->get_email() . '",
示例7: getallheaders
require_once 'classes/transporter.php';
require_once 'classes/person.php';
//get headers
$headers = getallheaders();
//validate parameter and headers
if (isset($_GET['id']) & isset($headers['email']) & isset($headers['token'])) {
//validate
if ($headers['token'] == generate_token($headers['email'])) {
try {
$t = new Person($_GET['id']);
$json = '{ "status" : 0, "tutors" : [';
//read makes
$json .= '{ "id" : "' . $t->get_id() . '",
"photo" : "' . $t->get_photo() . '",
"firstname" : "' . $t->get_first_name() . '",
"lastname" : "' . $t->get_last_name() . '",
"dateofbirth" : "' . $t->get_date_of_birth() . '",
"email" : "' . $t->get_email() . '",
"phone" : "' . $t->get_phone() . '",
"address" : "' . $t->get_address() . '",
"childs" : [';
$childs = $t->get_childs();
$second = true;
foreach ($childs as $c) {
if ($second) {
$second = false;
} else {
$json .= ',';
}
$json .= '{ "id" : "' . $c->get_id() . '",
"photo" : "' . $c->get_photo() . '",
示例8: testConstructor
function testConstructor()
{
$test_person = new Person("John", "Smith", "10-12-87", "Male", "555 Main Street", "Flushing", "NY", "11111", "20724415902", "2072654046", "john.smith@stjohns.edu", "volunteer", " ", "Schedule", "I like helping out", "55555", "03-14-14", "email");
echo "Testing first name" . '</br>';
if ($test_person->get_first_name() == "John") {
echo 'First name test succeeded </br>';
} else {
echo 'First name test failed </br>';
}
if ($test_person->get_last_name() == "Smith") {
echo 'last name test succeeded </br>';
} else {
echo 'last name test failed </br>';
}
if ($test_person->get_gender() == "Male") {
echo 'gender test succeeded </br>';
} else {
echo 'gender test failed </br>';
}
if ($test_person->get_address() == "555 Main Street") {
echo 'address test succeeded </br>';
} else {
echo 'address test failed </br>';
}
if ($test_person->get_city() == "Flushing") {
echo 'city test succeeded </br>';
} else {
echo 'city test failed </br>';
}
if ($test_person->get_state() == "NY") {
echo 'state test succeeded </br>';
} else {
echo 'state test failed </br>';
}
if ($test_person->get_zip() == "11111") {
echo 'zip test succeeded </br>';
} else {
echo 'zip test failed </br>';
}
if ($test_person->get_phone1() == "20724415902") {
echo 'phone1 test succeeded </br>';
} else {
echo 'phone1 test failed </br>';
}
if ($test_person->get_phone2() == "2072654046") {
echo 'phone2 test succeeded </br>';
} else {
echo 'phone2 test failed </br>';
}
if ($test_person->get_email() == "john.smith@stjohns.edu") {
echo 'email test succeeded </br>';
} else {
echo 'email test failed </br>';
}
if ($test_person->get_type() == "volunteer") {
echo 'type test succeedeed </br>';
} else {
echo 'type test failed </br>';
}
if ($test_person->get_schedule() == "Schedule") {
echo 'schedule test succeeded </br>';
} else {
echo 'schedule test failed </br>';
}
error_log($test_person->get_schedule());
if ($test_person->get_notes() == "I like helping out") {
echo 'notes test succeeded </br>';
} else {
echo 'notes test failed </br>';
}
if ($test_person->get_password() == "55555") {
echo 'password test succeeded </br>';
} else {
echo 'password test failed </br>';
}
if ($test_person->get_availabiltiy() == "03-14-14") {
echo 'availability test succeeded </br>';
} else {
echo ' availability test failed </br>';
}
if ($test_person->get_id() == "John20724415902") {
echo 'id test succeeded </br>';
} else {
echo ' id test failed </br>';
}
if ($test_person->get_contact_preference() == "email") {
echo 'contact preference test succeeded </br>';
} else {
echo ' contact preference test failed </br>';
}
}