예제 #1
0
 protected function execute($arguments = array(), $options = array())
 {
     // initialize the database connection
     $databaseManager = new sfDatabaseManager($this->configuration);
     $connection = $databaseManager->getDatabase($options['connection'] ? $options['connection'] : null)->getConnection();
     $names = array('Martin', 'Pedro', 'Lucas', 'Agustin', 'Cristian', 'Matias', 'Tomas', 'Cludio', 'Nancy', 'Emilia', 'Alejandra', 'Barbara', 'Luciana', 'Lucia', 'Belen', 'Natalia', 'Adriana', 'Patricio', 'Diego', 'Gonzalo', 'Juan', 'Pablo');
     $last_names = array('Ramirez', 'Rodriguez', 'Cordoba', 'Brown', 'Osorio', 'Diaz', 'Ayesa', 'Ramirez', 'Perez', 'Ripoll', 'Bottini', 'Ponce', 'Casella', 'Martinez', 'Erviti', 'Rodgriguez', 'Gonzalez', 'Fernandez', 'Benitez');
     $this->createContextInstance('backend');
     for ($i = 1; $i <= 100; $i++) {
         $person = new Person();
         $person->setLastname($last_names[rand(0, 18)]);
         $person->setFirstName($names[rand(0, 21)]);
         $person->setIdentificationType(1);
         $person->setIdentificationNumber($i);
         $person->setSex(rand(1, 2));
         $person->setBirthDate('2000-06-30');
         $student = new Student();
         $student->setGlobalFileNumber($i);
         $student->setPerson($person);
         $person->save();
         $student->save();
         $this->logSection("Person created", $person->__toString());
     }
     // add your code here
 }
예제 #2
0
 public function testSettersAndGetters()
 {
     $max = new Person('Max', 'Mustermann', Person::GENDER_MALE);
     $max->setFirstName('Maxi');
     $this->assertEquals('Maxi', $max->getFirstName());
     $max->setLastName('Mustermännchen');
     $this->assertEquals('Mustermännchen', $max->getLastName());
     $max->setGender(Person::GENDER_FEMALE);
     $this->assertEquals(Person::GENDER_FEMALE, $max->getGender());
 }
예제 #3
0
 function Main()
 {
     switch ($this->formArray["formAction"]) {
         case "edit":
             $ImprovementsBuildingsDetails = new SoapObject(NCCBIZ . "ImprovementsBuildingsDetails.php", "urn:Object");
             if (!($xmlStr = $ImprovementsBuildingsDetails->getImprovementsBuildings($this->formArray["propertyID"]))) {
                 echo "xml failed";
             } else {
                 //echo $xmlStr;
                 if (!($domDoc = domxml_open_mem($xmlStr))) {
                     $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock");
                     $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc");
                 } else {
                     $improvementsBuildings = new ImprovementsBuildings();
                     $improvementsBuildings->parseDomDocument($domDoc);
                     foreach ($improvementsBuildings as $key => $value) {
                         switch ($key) {
                             case "propertyAdministrator":
                                 if (is_a($value, Person)) {
                                     list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value->getBirthday());
                                     $this->formArray["personID"] = $value->getPersonID();
                                     $this->formArray["lastName"] = $value->getLastName();
                                     $this->formArray["firstName"] = $value->getFirstName();
                                     $this->formArray["middleName"] = $value->getMiddleName();
                                     $this->formArray["gender"] = $value->getGender();
                                     $this->formArray["birth_year"] = removePreZero($dateArr["year"]);
                                     $this->formArray["birth_month"] = removePreZero($dateArr["month"]);
                                     $this->formArray["birth_day"] = removePreZero($dateArr["day"]);
                                     $this->formArray["maritalStatus"] = $value->getMaritalStatus();
                                     $this->formArray["tin"] = $value->getTin();
                                     if (is_array($value->addressArray)) {
                                         $this->formArray["addressID"] = $value->addressArray[0]->getAddressID();
                                         $this->formArray["number"] = $value->addressArray[0]->getNumber();
                                         $this->formArray["street"] = $value->addressArray[0]->getStreet();
                                         $this->formArray["barangay"] = $value->addressArray[0]->getBarangay();
                                         $this->formArray["district"] = $value->addressArray[0]->getDistrict();
                                         $this->formArray["municipalityCity"] = $value->addressArray[0]->getMunicipalityCity();
                                         $this->formArray["province"] = $value->addressArray[0]->getProvince();
                                     }
                                     $this->formArray["telephone"] = $value->getTelephone();
                                     $this->formArray["mobileNumber"] = $value->getMobileNumber();
                                     $this->formArray["email"] = $value->getEmail();
                                 } else {
                                     $this->formArray[$key] = "";
                                 }
                                 break;
                             case "appraisedByDate":
                                 if (true) {
                                     list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value);
                                     $this->formArray["as_year"] = removePreZero($dateArr["year"]);
                                     $this->formArray["as_month"] = removePreZero($dateArr["month"]);
                                     $this->formArray["as_day"] = removePreZero($dateArr["day"]);
                                 } else {
                                     $this->formArray[$key] = "";
                                 }
                                 break;
                             case "recommendingApprovalDate":
                                 if (true) {
                                     list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value);
                                     $this->formArray["re_year"] = removePreZero($dateArr["year"]);
                                     $this->formArray["re_month"] = removePreZero($dateArr["month"]);
                                     $this->formArray["re_day"] = removePreZero($dateArr["day"]);
                                 } else {
                                     $this->formArray[$key] = "";
                                 }
                                 break;
                             case "approvedByDate":
                                 if (true) {
                                     list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value);
                                     $this->formArray["av_year"] = removePreZero($dateArr["year"]);
                                     $this->formArray["av_month"] = removePreZero($dateArr["month"]);
                                     $this->formArray["av_day"] = removePreZero($dateArr["day"]);
                                 } else {
                                     $this->formArray[$key] = "";
                                 }
                                 break;
                             case "dateConstructed":
                                 if (true) {
                                     list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value);
                                     $this->formArray["dc_year"] = removePreZero($dateArr["year"]);
                                     $this->formArray["dc_month"] = removePreZero($dateArr["month"]);
                                     $this->formArray["dc_day"] = removePreZero($dateArr["day"]);
                                 } else {
                                     $this->formArray[$key] = "";
                                 }
                                 break;
                             case "dateOccupied":
                                 if (true) {
                                     list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value);
                                     $this->formArray["do_year"] = removePreZero($dateArr["year"]);
                                     $this->formArray["do_month"] = removePreZero($dateArr["month"]);
                                     $this->formArray["do_day"] = removePreZero($dateArr["day"]);
                                 } else {
                                     $this->formArray[$key] = "";
                                 }
                                 break;
                             case "dateCompleted":
                                 if (true) {
                                     list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value);
                                     $this->formArray["dm_year"] = removePreZero($dateArr["year"]);
                                     $this->formArray["dm_month"] = removePreZero($dateArr["month"]);
                                     $this->formArray["dm_day"] = removePreZero($dateArr["day"]);
                                 } else {
                                     $this->formArray[$key] = "";
                                 }
                                 break;
                             default:
                                 $this->formArray[$key] = $value;
                         }
                     }
                 }
             }
             break;
         case "save":
             if ($this->formArray["verifiedByID"] != "" && $this->formArray["verifiedByID"] != "xx" && $this->formArray["propertyID"] != "") {
                 $this->saveVerified($this->formArray["afsID"], $this->formArray["verifiedByID"], $this->formArray["propertyID"]);
             }
             $ImprovementsBuildingsEncode = new SoapObject(NCCBIZ . "ImprovementsBuildingsEncode.php", "urn:Object");
             if ($this->formArray["propertyID"] != "") {
                 $ImprovementsBuildingsDetails = new SoapObject(NCCBIZ . "ImprovementsBuildingsDetails.php", "urn:Object");
                 if (!($xmlStr = $ImprovementsBuildingsDetails->getImprovementsBuildings($this->formArray["propertyID"]))) {
                     $this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
                     $this->tpl->set_var("TableBlock", "record not found");
                 } else {
                     if (!($domDoc = domxml_open_mem($xmlStr))) {
                         $this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
                         $this->tpl->set_var("TableBlock", "error xmlDoc");
                     } else {
                         $address = new Address();
                         $address->setAddressID($this->formArray["addressID"]);
                         $address->setNumber($this->formArray["number"]);
                         $address->setStreet($this->formArray["street"]);
                         $address->setBarangay($this->formArray["barangay"]);
                         $address->setDistrict($this->formArray["district"]);
                         $address->setMunicipalityCity($this->formArray["municipalityCity"]);
                         $address->setProvince($this->formArray["province"]);
                         $address->setDomDocument();
                         $propertyAdministrator = new Person();
                         $propertyAdministrator->setPersonID($this->formArray["personID"]);
                         $propertyAdministrator->setLastName($this->formArray["lastName"]);
                         $propertyAdministrator->setFirstName($this->formArray["firstName"]);
                         $propertyAdministrator->setMiddleName($this->formArray["middleName"]);
                         //$propertyAdministrator->setGender($this->formArray["gender"]);
                         //$propertyAdministrator->setBirthday($this->birthdate);
                         //$propertyAdministrator->setMaritalStatus($this->formArray["maritalStatus"]);
                         //$propertyAdministrator->setTin($this->formArray["tin"]);
                         $propertyAdministrator->setAddressArray($address);
                         $propertyAdministrator->setTelephone($this->formArray["telephone"]);
                         //$propertyAdministrator->setMobileNumber($this->formArray["mobileNumber"]);
                         $propertyAdministrator->setEmail($this->formArray["email"]);
                         $propertyAdministrator->setDomDocument();
                         $improvementsBuildings = new ImprovementsBuildings();
                         $improvementsBuildings->parseDomDocument($domDoc);
                         $improvementsBuildings->setPropertyID($this->formArray["propertyID"]);
                         $improvementsBuildings->setAfsID($this->formArray["afsID"]);
                         $improvementsBuildings->setArpNumber($this->formArray["arpNumber"]);
                         $improvementsBuildings->setPropertyIndexNumber($this->formArray["propertyIndexNumber"]);
                         $improvementsBuildings->setPropertyAdministrator($propertyAdministrator);
                         $improvementsBuildings->setVerifiedBy($this->formArray["verifiedByID"]);
                         $improvementsBuildings->setPlottingsBy($this->formArray["plottingsByID"]);
                         $improvementsBuildings->setNotedBy($this->formArray["notedByID"]);
                         $improvementsBuildings->setMarketValue($this->formArray["marketValue"]);
                         $improvementsBuildings->setKind($this->formArray["kind"]);
                         $improvementsBuildings->setActualUse($this->formArray["actualUse"]);
                         $improvementsBuildings->setAdjustedMarketValue($this->formArray["adjustedMarketValue"]);
                         $improvementsBuildings->setAssessmentLevel($this->formArray["assessmentLevel"]);
                         $improvementsBuildings->setAssessedValue($this->formArray["assessedValue"]);
                         $improvementsBuildings->setPreviousOwner($this->formArray["previousOwner"]);
                         $improvementsBuildings->setPreviousAssessedValue($this->formArray["previousAssessedValue"]);
                         $improvementsBuildings->setTaxability($this->formArray["taxability"]);
                         $improvementsBuildings->setEffectivity($this->formArray["effectivity"]);
                         $improvementsBuildings->setAppraisedBy($this->formArray["appraisedByID"]);
                         $improvementsBuildings->setAppraisedByDate($this->formArray["appraisedByDate"]);
                         $improvementsBuildings->setRecommendingApproval($this->formArray["recommendingApprovalID"]);
                         $improvementsBuildings->setRecommendingApprovalDate($this->formArray["recommendingApprovalDate"]);
                         $improvementsBuildings->setApprovedBy($this->formArray["approvedByID"]);
                         $improvementsBuildings->setApprovedByDate($this->formArray["approvedByDate"]);
                         $improvementsBuildings->setMemoranda($this->formArray["memoranda"]);
                         $improvementsBuildings->setPostingDate($this->formArray["postingDate"]);
                         $improvementsBuildings->setLandPin($this->formArray["landPin"]);
                         $improvementsBuildings->setFoundation($this->formArray["foundation"]);
                         $improvementsBuildings->setColumnsBldg($this->formArray["columnsBldg"]);
                         $improvementsBuildings->setBeams($this->formArray["beams"]);
                         $improvementsBuildings->setTrussFraming($this->formArray["trussFraming"]);
                         $improvementsBuildings->setRoof($this->formArray["roof"]);
                         $improvementsBuildings->setExteriorWalls($this->formArray["exteriorWalls"]);
                         $improvementsBuildings->setFlooring($this->formArray["flooring"]);
                         $improvementsBuildings->setDoors($this->formArray["doors"]);
                         $improvementsBuildings->setCeiling($this->formArray["ceiling"]);
                         $improvementsBuildings->setStructuralTypes($this->formArray["structuralTypes"]);
                         $improvementsBuildings->setBuildingClassification($this->formArray["buildingClassification"]);
                         $improvementsBuildings->setBuildingPermit($this->formArray["buildingPermit"]);
                         $improvementsBuildings->setBuildingAge($this->formArray["buildingAge"]);
                         $improvementsBuildings->setCctNumber($this->formArray["cctNumber"]);
                         $improvementsBuildings->setNumberOfStoreys($this->formArray["numberOfStoreys"]);
                         $improvementsBuildings->setWindows($this->formArray["windows"]);
                         $improvementsBuildings->setStairs($this->formArray["stairs"]);
                         $improvementsBuildings->setPartition($this->formArray["partition"]);
                         $improvementsBuildings->setWallFinish($this->formArray["wallFinish"]);
                         $improvementsBuildings->setElectrical($this->formArray["electrical"]);
                         $improvementsBuildings->setToiletAndBath($this->formArray["toiletAndBath"]);
                         $improvementsBuildings->setPlumbingSewer($this->formArray["plumbingSewer"]);
                         $improvementsBuildings->setFixtures($this->formArray["fixtures"]);
                         $improvementsBuildings->setDateConstructed($this->formArray["dateConstructed"]);
                         $improvementsBuildings->setDateOccupied($this->formArray["dateOccupied"]);
                         $improvementsBuildings->setDateCompleted($this->formArray["dateCompleted"]);
                         $improvementsBuildings->setAreaOfGroundFloor($this->formArray["areaOfGroundFloor"]);
                         $improvementsBuildings->setTotalBuildingArea($this->formArray["totalBuildingArea"]);
                         $improvementsBuildings->setUnitValue($this->formArray["unitValue"]);
                         $improvementsBuildings->setBuildingCoreAndAdditionalItems($this->formArray["buildingCoreAndAdditionalItems"]);
                         $improvementsBuildings->setAddItems($this->formArray["addItems"]);
                         $improvementsBuildings->setDepreciationRate($this->formArray["depreciationRate"]);
                         $improvementsBuildings->setAccumulatedDepreciation($this->formArray["accumulatedDepreciation"]);
                         $improvementsBuildings->setDepreciatedMarketValue($this->formArray["depreciatedMarketValue"]);
                         $improvementsBuildings->setCreatedBy($this->userID);
                         $improvementsBuildings->setModifiedBy($this->userID);
                         $improvementsBuildings->setDomDocument();
                         $doc = $improvementsBuildings->getDomDocument();
                         $xmlStr = $doc->dump_mem(true);
                         //echo $xmlStr;
                         $ret = $ImprovementsBuildingsEncode->updateImprovementsBuildings($xmlStr);
                         if (!($ret = $ImprovementsBuildingsEncode->updateImprovementsBuildings($xmlStr))) {
                             exit("error update" . $ret);
                         }
                     }
                 }
             } else {
                 $address = new Address();
                 //$address->setAddressID($this->formArray["addressID"]);
                 $address->setNumber($this->formArray["number"]);
                 $address->setStreet($this->formArray["street"]);
                 $address->setBarangay($this->formArray["barangay"]);
                 $address->setDistrict($this->formArray["district"]);
                 $address->setMunicipalityCity($this->formArray["municipalityCity"]);
                 $address->setProvince($this->formArray["province"]);
                 $address->setDomDocument();
                 $propertyAdministrator = new Person();
                 //$propertyAdministrator->setPersonID($this->formArray["personID"]);
                 $propertyAdministrator->setLastName($this->formArray["lastName"]);
                 $propertyAdministrator->setFirstName($this->formArray["firstName"]);
                 $propertyAdministrator->setMiddleName($this->formArray["middleName"]);
                 //$propertyAdministrator->setGender($this->formArray["gender"]);
                 //$propertyAdministrator->setBirthday($this->birthdate);
                 //$propertyAdministrator->setMaritalStatus($this->formArray["maritalStatus"]);
                 //$propertyAdministrator->setTin($this->formArray["tin"]);
                 $propertyAdministrator->setAddressArray($address);
                 $propertyAdministrator->setTelephone($this->formArray["telephone"]);
                 //$propertyAdministrator->setMobileNumber($this->formArray["mobileNumber"]);
                 $propertyAdministrator->setEmail($this->formArray["email"]);
                 $propertyAdministrator->setDomDocument();
                 $improvementsBuildings = new ImprovementsBuildings();
                 $improvementsBuildings->parseDomDocument($domDoc);
                 //$improvementsBuildings->setPropertyID($this->formArray["propertyID"]);
                 $improvementsBuildings->setAfsID($this->formArray["afsID"]);
                 $improvementsBuildings->setArpNumber($this->formArray["arpNumber"]);
                 $improvementsBuildings->setPropertyIndexNumber($this->formArray["propertyIndexNumber"]);
                 $improvementsBuildings->setPropertyAdministrator($propertyAdministrator);
                 $improvementsBuildings->setVerifiedBy($this->formArray["verifiedByID"]);
                 $improvementsBuildings->setPlottingsBy($this->formArray["plottingsByID"]);
                 $improvementsBuildings->setNotedBy($this->formArray["notedByID"]);
                 $improvementsBuildings->setMarketValue($this->formArray["marketValue"]);
                 $improvementsBuildings->setKind($this->formArray["kind"]);
                 $improvementsBuildings->setActualUse($this->formArray["actualUse"]);
                 $improvementsBuildings->setAdjustedMarketValue($this->formArray["adjustedMarketValue"]);
                 $improvementsBuildings->setAssessmentLevel($this->formArray["assessmentLevel"]);
                 $improvementsBuildings->setAssessedValue($this->formArray["assessedValue"]);
                 $improvementsBuildings->setPreviousOwner($this->formArray["previousOwner"]);
                 $improvementsBuildings->setPreviousAssessedValue($this->formArray["previousAssessedValue"]);
                 $improvementsBuildings->setTaxability($this->formArray["taxability"]);
                 $improvementsBuildings->setEffectivity($this->formArray["effectivity"]);
                 $improvementsBuildings->setAppraisedBy($this->formArray["appraisedByID"]);
                 $improvementsBuildings->setAppraisedByDate($this->formArray["appraisedByDate"]);
                 $improvementsBuildings->setRecommendingApproval($this->formArray["recommendingApprovalID"]);
                 $improvementsBuildings->setRecommendingApprovalDate($this->formArray["recommendingApprovalDate"]);
                 $improvementsBuildings->setApprovedBy($this->formArray["approvedByID"]);
                 $improvementsBuildings->setApprovedByDate($this->formArray["approvedByDate"]);
                 $improvementsBuildings->setMemoranda($this->formArray["memoranda"]);
                 $improvementsBuildings->setPostingDate($this->formArray["postingDate"]);
                 $improvementsBuildings->setLandPin($this->formArray["landPin"]);
                 $improvementsBuildings->setFoundation($this->formArray["foundation"]);
                 $improvementsBuildings->setColumnsBldg($this->formArray["columnsBldg"]);
                 $improvementsBuildings->setBeams($this->formArray["beams"]);
                 $improvementsBuildings->setTrussFraming($this->formArray["trussFraming"]);
                 $improvementsBuildings->setRoof($this->formArray["roof"]);
                 $improvementsBuildings->setExteriorWalls($this->formArray["exteriorWalls"]);
                 $improvementsBuildings->setFlooring($this->formArray["flooring"]);
                 $improvementsBuildings->setDoors($this->formArray["doors"]);
                 $improvementsBuildings->setCeiling($this->formArray["ceiling"]);
                 $improvementsBuildings->setStructuralTypes($this->formArray["structuralTypes"]);
                 $improvementsBuildings->setBuildingClassification($this->formArray["buildingClassification"]);
                 $improvementsBuildings->setBuildingPermit($this->formArray["buildingPermit"]);
                 $improvementsBuildings->setBuildingAge($this->formArray["buildingAge"]);
                 $improvementsBuildings->setCctNumber($this->formArray["cctNumber"]);
                 $improvementsBuildings->setNumberOfStoreys($this->formArray["numberOfStoreys"]);
                 $improvementsBuildings->setWindows($this->formArray["windows"]);
                 $improvementsBuildings->setStairs($this->formArray["stairs"]);
                 $improvementsBuildings->setPartition($this->formArray["partition"]);
                 $improvementsBuildings->setWallFinish($this->formArray["wallFinish"]);
                 $improvementsBuildings->setElectrical($this->formArray["electrical"]);
                 $improvementsBuildings->setToiletAndBath($this->formArray["toiletAndBath"]);
                 $improvementsBuildings->setPlumbingSewer($this->formArray["plumbingSewer"]);
                 $improvementsBuildings->setFixtures($this->formArray["fixtures"]);
                 $improvementsBuildings->setDateConstructed($this->formArray["dateConstructed"]);
                 $improvementsBuildings->setDateOccupied($this->formArray["dateOccupied"]);
                 $improvementsBuildings->setDateCompleted($this->formArray["dateCompleted"]);
                 $improvementsBuildings->setAreaOfGroundFloor($this->formArray["areaOfGroundFloor"]);
                 $improvementsBuildings->setTotalBuildingArea($this->formArray["totalBuildingArea"]);
                 $improvementsBuildings->setUnitValue($this->formArray["unitValue"]);
                 $improvementsBuildings->setBuildingCoreAndAdditionalItems($this->formArray["buildingCoreAndAdditionalItems"]);
                 $improvementsBuildings->setAddItems($this->formArray["addItems"]);
                 $improvementsBuildings->setDepreciationRate($this->formArray["depreciationRate"]);
                 $improvementsBuildings->setAccumulatedDepreciation($this->formArray["accumulatedDepreciation"]);
                 $improvementsBuildings->setDepreciatedMarketValue($this->formArray["depreciatedMarketValue"]);
                 $improvementsBuildings->setCreatedBy($this->userID);
                 $improvementsBuildings->setModifiedBy($this->userID);
                 $improvementsBuildings->setDomDocument();
                 $doc = $improvementsBuildings->getDomDocument();
                 $xmlStr = $doc->dump_mem(true);
                 //echo $xmlStr;
                 $xmlStr = $doc->dump_mem(true);
                 if (!($ret = $ImprovementsBuildingsEncode->saveImprovementsBuildings($xmlStr))) {
                     echo "ret=" . $ret;
                 }
             }
             $this->formArray["propertyID"] = $ret;
             header("location: ImprovementsBuildingsClose.php" . $this->sess->url("") . $this->sess->add_query(array("afsID" => $this->formArray["afsID"])));
             exit;
             break;
         case "cancel":
             header("location: ImprovementsBuildingsList.php");
             exit;
             break;
         default:
             if (!($firstPropertyID = $this->getFirstPropertyID())) {
                 $this->tpl->set_block("rptsTemplate", "odID", "odIDBlock");
                 $this->tpl->set_var("odIDBlock", "");
                 $this->tpl->set_block("rptsTemplate", "ACK", "ACKBlock");
                 $this->tpl->set_var("ACKBlock", "");
             } else {
                 $ImprovementsBuildingsDetails = new SoapObject(NCCBIZ . "ImprovementsBuildingsDetails.php", "urn:Object");
                 if (!($xmlStr = $ImprovementsBuildingsDetails->getImprovementsBuildings($firstPropertyID))) {
                     echo "xml failed";
                 } else {
                     //echo $xmlStr;
                     if (!($domDoc = domxml_open_mem($xmlStr))) {
                         $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock");
                         $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc");
                     } else {
                         $improvementsBuildings = new ImprovementsBuildings();
                         $improvementsBuildings->parseDomDocument($domDoc);
                         foreach ($improvementsBuildings as $key => $value) {
                             switch ($key) {
                                 case "propertyID":
                                     $this->formArray["propertyID"] = "";
                                     break;
                                 case "propertyAdministrator":
                                     if (is_a($value, Person)) {
                                         list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value->getBirthday());
                                         $this->formArray["personID"] = $value->getPersonID();
                                         $this->formArray["lastName"] = $value->getLastName();
                                         $this->formArray["firstName"] = $value->getFirstName();
                                         $this->formArray["middleName"] = $value->getMiddleName();
                                         $this->formArray["gender"] = $value->getGender();
                                         $this->formArray["birth_year"] = removePreZero($dateArr["year"]);
                                         $this->formArray["birth_month"] = removePreZero($dateArr["month"]);
                                         $this->formArray["birth_day"] = removePreZero($dateArr["day"]);
                                         $this->formArray["maritalStatus"] = $value->getMaritalStatus();
                                         $this->formArray["tin"] = $value->getTin();
                                         $this->formArray["addressID"] = $value->addressArray[0]->getAddressID();
                                         $this->formArray["number"] = $value->addressArray[0]->getNumber();
                                         $this->formArray["street"] = $value->addressArray[0]->getStreet();
                                         $this->formArray["barangay"] = $value->addressArray[0]->getBarangay();
                                         $this->formArray["district"] = $value->addressArray[0]->getDistrict();
                                         $this->formArray["municipalityCity"] = $value->addressArray[0]->getMunicipalityCity();
                                         $this->formArray["province"] = $value->addressArray[0]->getProvince();
                                         $this->formArray["telephone"] = $value->getTelephone();
                                         $this->formArray["mobileNumber"] = $value->getMobileNumber();
                                         $this->formArray["email"] = $value->getEmail();
                                     } else {
                                         $this->formArray[$key] = "";
                                     }
                                     break;
                                 case "appraisedByDate":
                                     if (true) {
                                         list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value);
                                         $this->formArray["as_year"] = removePreZero($dateArr["year"]);
                                         $this->formArray["as_month"] = removePreZero($dateArr["month"]);
                                         $this->formArray["as_day"] = removePreZero($dateArr["day"]);
                                     } else {
                                         $this->formArray[$key] = "";
                                     }
                                     break;
                                 case "recommendingApprovalDate":
                                     if (true) {
                                         list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value);
                                         $this->formArray["re_year"] = removePreZero($dateArr["year"]);
                                         $this->formArray["re_month"] = removePreZero($dateArr["month"]);
                                         $this->formArray["re_day"] = removePreZero($dateArr["day"]);
                                     } else {
                                         $this->formArray[$key] = "";
                                     }
                                     break;
                                 case "approvedByDate":
                                     if (true) {
                                         list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value);
                                         $this->formArray["av_year"] = removePreZero($dateArr["year"]);
                                         $this->formArray["av_month"] = removePreZero($dateArr["month"]);
                                         $this->formArray["av_day"] = removePreZero($dateArr["day"]);
                                     } else {
                                         $this->formArray[$key] = "";
                                     }
                                     break;
                                 case "dateConstructed":
                                     if (true) {
                                         list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value);
                                         $this->formArray["dc_year"] = removePreZero($dateArr["year"]);
                                         $this->formArray["dc_month"] = removePreZero($dateArr["month"]);
                                         $this->formArray["dc_day"] = removePreZero($dateArr["day"]);
                                     } else {
                                         $this->formArray[$key] = "";
                                     }
                                     break;
                                 case "dateOccupied":
                                     if (true) {
                                         list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value);
                                         $this->formArray["do_year"] = removePreZero($dateArr["year"]);
                                         $this->formArray["do_month"] = removePreZero($dateArr["month"]);
                                         $this->formArray["do_day"] = removePreZero($dateArr["day"]);
                                     } else {
                                         $this->formArray[$key] = "";
                                     }
                                     break;
                                 case "dateCompleted":
                                     if (true) {
                                         list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value);
                                         $this->formArray["dm_year"] = removePreZero($dateArr["year"]);
                                         $this->formArray["dm_month"] = removePreZero($dateArr["month"]);
                                         $this->formArray["dm_day"] = removePreZero($dateArr["day"]);
                                     } else {
                                         $this->formArray[$key] = "";
                                     }
                                     break;
                                 case "arpNumber":
                                 case "propertyIndexNumber":
                                 case "propertyAdministrator":
                                 case "personID":
                                 case "lastName":
                                 case "firstName":
                                 case "middleName":
                                 case "gender":
                                 case "birth_month":
                                 case "birth_day":
                                 case "birth_year":
                                 case "maritalStatus":
                                 case "tin":
                                 case "addressID":
                                 case "number":
                                 case "street":
                                 case "barangay":
                                 case "district":
                                 case "municipalityCity":
                                 case "province":
                                 case "telephone":
                                 case "mobileNumber":
                                 case "email":
                                 case "verifiedByID":
                                 case "verifiedBy":
                                 case "verifiedByName":
                                 case "plottingsByID":
                                 case "plottingsBy":
                                 case "plottingsByName":
                                 case "notedByID":
                                 case "notedBy":
                                 case "notedByName":
                                 case "marketValue":
                                 case "kind":
                                 case "actualUse":
                                 case "adjustedMarketValue":
                                 case "assessmentLevel":
                                 case "assessedValue":
                                 case "previousOwner":
                                 case "previousAssessedValue":
                                 case "taxability":
                                 case "effectivity":
                                 case "appraisedByID":
                                 case "appraisedBy":
                                 case "appraisedByName":
                                 case "appraisedByDate":
                                 case "recommendingApprovalID":
                                 case "recommendingApproval":
                                 case "recommendingApprovalName":
                                 case "recommendingApprovalDate":
                                 case "approvedByID":
                                 case "approvedBy":
                                 case "approvedByName":
                                 case "approvedByDate":
                                 case "memoranda":
                                 case "postingDate":
                                 case "landPin":
                                 case "foundation":
                                 case "columnsBldg":
                                 case "beams":
                                 case "trussFraming":
                                 case "roof":
                                 case "exteriorWalls":
                                 case "flooring":
                                 case "doors":
                                 case "ceiling":
                                 case "structuralTypes":
                                 case "buildingClassification":
                                 case "buildingPermit":
                                 case "buildingAge":
                                 case "cctNumber":
                                 case "numberOfStoreys":
                                 case "windows":
                                 case "stairs":
                                 case "partition":
                                 case "wallFinish":
                                 case "electrical":
                                 case "toiletAndBath":
                                 case "plumbingSewer":
                                 case "fixtures":
                                 case "dateConstructed":
                                 case "dateOccupied":
                                 case "dateCompleted":
                                 case "areaOfGroundFloor":
                                 case "totalBuildingArea":
                                 case "unitValue":
                                 case "buildingCoreAndAdditionalItems":
                                 case "addItems":
                                 case "depreciationRate":
                                 case "accumulatedDepreciation":
                                 case "depreciatedMarketValue":
                                 case "as_month":
                                 case "as_day":
                                 case "as_year":
                                 case "re_month":
                                 case "re_day":
                                 case "re_year":
                                 case "av_month":
                                 case "av_day":
                                 case "av_year":
                                 case "dc_month":
                                 case "dc_day":
                                 case "dc_year":
                                 case "do_month":
                                 case "do_day":
                                 case "do_year":
                                 case "dm_month":
                                 case "dm_day":
                                 case "dm_year":
                                     $this->formArray[$key] = $value;
                                     break;
                             }
                         }
                     }
                 }
             }
     }
     $this->setForm();
     $this->tpl->set_var("Session", $this->sess->url("") . $this->sess->add_query(array("odID" => $this->formArray["odID"], "ownerID" => $this->formArray["ownerID"])));
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $this->tpl->p("templatePage");
 }
예제 #4
0
 if ($action == "Submit Edits") {
     $firstname = $_REQUEST["firstname"];
     $lastname = $_REQUEST["lastname"];
     $email = $_REQUEST["email"];
     $title = array_key_exists("title", $_REQUEST) ? $_REQUEST["title"] : "";
     $institution = array_key_exists("institution", $_REQUEST) ? $_REQUEST["institution"] : "";
     $city = array_key_exists("city", $_REQUEST) ? $_REQUEST["city"] : "";
     $state = array_key_exists("state", $_REQUEST) ? $_REQUEST["state"] : "";
     $zip = array_key_exists("zip", $_REQUEST) ? $_REQUEST["zip"] : "";
     $country = array_key_exists("country", $_REQUEST) ? $_REQUEST["country"] : "";
     $url = array_key_exists("url", $_REQUEST) ? $_REQUEST["url"] : "";
     $biography = array_key_exists("biography", $_REQUEST) ? $_REQUEST["biography"] : "";
     $isPublic = array_key_exists("ispublic", $_REQUEST) ? $_REQUEST["ispublic"] : "";
     $newPerson = new Person();
     $newPerson->setUid($userId);
     $newPerson->setFirstName($firstname);
     $newPerson->setLastName($lastname);
     $newPerson->setTitle($title);
     $newPerson->setInstitution($institution);
     $newPerson->setCity($city);
     $newPerson->setState($state);
     $newPerson->setZip($zip);
     $newPerson->setCountry($country);
     $newPerson->setEmail($email);
     $newPerson->setUrl($url);
     $newPerson->setBiography($biography);
     $newPerson->setIsPublic($isPublic);
     if (!$pHandler->updateProfile($newPerson)) {
         $statusStr = "Profile update failed!";
     }
     $person = $pHandler->getPerson();
예제 #5
0
<?php

require_once 'autoload.php';
$person = new Person();
$person->setFirstName('Peter');
$person->setSurName('Pan');
echo $person->getInfo();
$person2 = new Person();
$person2->setFirstName('Capitan');
$person2->setSurName('Hook');
echo $person2->getInfo();
$vehicle = new Vehicle();
$vehicle->setDescription('Very nice vehicle');
echo $vehicle->getDescription() . PHP_EOL;
예제 #6
0
 function Main()
 {
     switch ($this->formArray["formAction"]) {
         case "edit":
             $PersonDetails = new SoapObject(NCCBIZ . "PersonDetails.php", "urn:Object");
             if (!($xmlStr = $PersonDetails->getPersonDetails($this->formArray["personID"]))) {
                 $this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
                 $this->tpl->set_var("TableBlock", "record not found");
             } else {
                 if (!($domDoc = domxml_open_mem($xmlStr))) {
                     $this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
                     $this->tpl->set_var("TableBlock", "error xmlDoc");
                 } else {
                     $person = new Person();
                     $person->parseDomDocument($domDoc);
                     list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $person->getBirthday());
                     $this->formArray["personID"] = $person->getPersonID();
                     $this->formArray["lastName"] = $person->getLastName();
                     $this->formArray["firstName"] = $person->getFirstName();
                     $this->formArray["middleName"] = $person->getMiddleName();
                     $this->formArray["gender"] = $person->getGender();
                     $this->formArray["birth_year"] = removePreZero($dateArr["year"]);
                     $this->formArray["birth_month"] = removePreZero($dateArr["month"]);
                     $this->formArray["birth_day"] = removePreZero($dateArr["day"]);
                     $this->formArray["maritalStatus"] = $person->getMaritalStatus();
                     $this->formArray["tin"] = $person->getTin();
                     $address = $person->addressArray[0];
                     if (is_a($address, Address)) {
                         $this->formArray["addressID"] = $address->getAddressID();
                         $this->formArray["number"] = $address->getNumber();
                         $this->formArray["street"] = $address->getStreet();
                         $this->formArray["barangay"] = $address->getBarangay();
                         $this->formArray["district"] = $address->getDistrict();
                         $this->formArray["municipalityCity"] = $address->getMunicipalitycity();
                         $this->formArray["province"] = $address->getProvince();
                     }
                     $this->formArray["telephone"] = $person->getTelephone();
                     $this->formArray["mobileNumber"] = $person->getMobileNumber();
                     $this->formArray["email"] = $person->getEmail();
                 }
             }
             break;
         case "save":
             $PersonEncode = new SoapObject(NCCBIZ . "PersonEncode.php", "urn:Object");
             if ($this->formArray["personID"] != "") {
                 $PersonDetails = new SoapObject(NCCBIZ . "PersonDetails.php", "urn:Object");
                 if (!($xmlStr = $PersonDetails->getPersonDetails($this->formArray["personID"]))) {
                     $this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
                     $this->tpl->set_var("TableBlock", "record not found");
                 } else {
                     if (!($domDoc = domxml_open_mem($xmlStr))) {
                         $this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
                         $this->tpl->set_var("TableBlock", "error xmlDoc");
                     } else {
                         $person = new Person();
                         $person->parseDomDocument($domDoc);
                         $address = $person->addressArray[0];
                         if (is_a($address, Address)) {
                             $address->setAddressID($this->formArray["addressID"]);
                             $address->setNumber($this->formArray["number"]);
                             $address->setStreet($this->formArray["street"]);
                             $address->setBarangay($this->formArray["barangay"]);
                             $address->setDistrict($this->formArray["district"]);
                             $address->setMunicipalityCity($this->formArray["municipalityCity"]);
                             $address->setProvince($this->formArray["province"]);
                             $address->setDomDocument();
                         }
                         $person->setPersonID($this->formArray["personID"]);
                         $person->setLastName($this->formArray["lastName"]);
                         $person->setFirstName($this->formArray["firstName"]);
                         $person->setMiddleName($this->formArray["middleName"]);
                         $person->setGender($this->formArray["gender"]);
                         $person->setBirthday($this->birthdate);
                         $person->setMaritalStatus($this->formArray["maritalStatus"]);
                         $person->setTin($this->formArray["tin"]);
                         $person->setAddressArray($address);
                         $person->setTelephone($this->formArray["telephone"]);
                         $person->setMobileNumber($this->formArray["mobileNumber"]);
                         $person->setEmail($this->formArray["email"]);
                         $person->setDomDocument();
                         $doc = $person->getDomDocument();
                         $xmlStr = $doc->dump_mem(true);
                         if (!($ret = $PersonEncode->updatePerson($xmlStr))) {
                             exit("error update");
                         }
                     }
                 }
             } else {
                 $address = new Address();
                 $address->setNumber($this->formArray["number"]);
                 $address->setStreet($this->formArray["street"]);
                 $address->setBarangay($this->formArray["barangay"]);
                 $address->setDistrict($this->formArray["district"]);
                 $address->setMunicipalityCity($this->formArray["municipalityCity"]);
                 $address->setProvince($this->formArray["province"]);
                 $address->setDomDocument();
                 $person = new Person();
                 $person->setPersonID($this->formArray["personID"]);
                 $person->setLastName($this->formArray["lastName"]);
                 $person->setFirstName($this->formArray["firstName"]);
                 $person->setMiddleName($this->formArray["middleName"]);
                 $person->setGender($this->formArray["gender"]);
                 $person->setBirthday($this->birthdate);
                 $person->setMaritalStatus($this->formArray["maritalStatus"]);
                 $person->setTin($this->formArray["tin"]);
                 $person->setAddressArray($address);
                 $person->setTelephone($this->formArray["telephone"]);
                 $person->setMobileNumber($this->formArray["mobileNumber"]);
                 $person->setEmail($this->formArray["email"]);
                 $person->setDomDocument();
                 $doc = $person->getDomDocument();
                 $xmlStr = $doc->dump_mem(true);
                 //echo $this->formArray["ownerID"].$xmlStr;
                 if (!($ret = $PersonEncode->savePerson($xmlStr, $this->formArray["ownerID"]))) {
                     exit("error save");
                 }
             }
             $this->formArray["personID"] = $ret;
             header("location: ChangeOfOwnershipPropertyInfoClose.php" . $this->sess->url("") . $this->sess->add_query(array("odID" => $this->formArray["odID"], "personID" => $ret, "formAction" => "view")));
             exit;
             break;
         case "cancel":
             header("location: PersonList.php");
             exit;
             break;
         default:
             if ($this->formArray["locID"]) {
                 $ODDetails = new SoapObject(NCCBIZ . "ODDetails.php", "urn:Object");
                 if (!($xmlStr = $ODDetails->getLocation($this->formArray["locID"]))) {
                     exit("xml failed");
                 } else {
                     if (!($domDoc = domxml_open_mem($xmlStr))) {
                     } else {
                         $loc = new LocationAddress();
                         $loc->parseDomDocument($domDoc);
                         foreach ($loc as $key => $value) {
                             $this->formArray[$key] = $value;
                         }
                     }
                 }
             }
             $this->tpl->set_block("rptsTemplate", "personID", "personIDBlock");
             $this->tpl->set_var("personIDBlock", "");
             $this->tpl->set_block("rptsTemplate", "ACK", "ACKBlock");
             $this->tpl->set_var("ACKBlock", "");
     }
     $this->setForm();
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $this->tpl->p("templatePage");
 }
예제 #7
0
파일: UserEncode.php 프로젝트: armic/erpts
 function Main()
 {
     switch ($this->formArray["formAction"]) {
         case "edit":
             $UserDetails = new SoapObject(NCCBIZ . "UserDetails.php", "urn:Object");
             if (!($xmlStr = $UserDetails->getUserDetails($this->formArray["userID"]))) {
                 $this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
                 $this->tpl->set_var("TableBlock", "User record not found");
             } else {
                 if (!($domDoc = domxml_open_mem($xmlStr))) {
                     $this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
                     $this->tpl->set_var("TableBlock", "error xmlDoc");
                 } else {
                     $user = new User();
                     $user->parseDomDocument($domDoc);
                     $this->formArray["userID"] = $user->getUserID();
                     $this->formArray["userType"] = $user->getUserType();
                     $this->formArray["username"] = $user->getUsername();
                     $this->formArray["password"] = $user->getPassword();
                     $this->formArray["personID"] = $user->getPersonID();
                     $this->formArray["status"] = $user->getStatus();
                 }
             }
             $PersonDetails = new SoapObject(NCCBIZ . "PersonDetails.php", "urn:Object");
             if (!($xmlStr = $PersonDetails->getPersonDetails($this->formArray["personID"]))) {
                 $this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
                 $this->tpl->set_var("TableBlock", "Person record not found");
             } else {
                 if (!($domDoc = domxml_open_mem($xmlStr))) {
                     $this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
                     $this->tpl->set_var("TableBlock", "error xmlDoc");
                 } else {
                     $person = new Person();
                     $person->parseDomDocument($domDoc);
                     list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $person->getBirthday());
                     $this->formArray["personID"] = $person->getPersonID();
                     $this->formArray["lastName"] = $person->getLastName();
                     $this->formArray["firstName"] = $person->getFirstName();
                     $this->formArray["middleName"] = $person->getMiddleName();
                     $this->formArray["gender"] = $person->getGender();
                     $this->formArray["birth_year"] = removePreZero($dateArr["year"]);
                     $this->formArray["birth_month"] = removePreZero($dateArr["month"]);
                     $this->formArray["birth_day"] = removePreZero($dateArr["day"]);
                     $this->formArray["maritalStatus"] = $person->getMaritalStatus();
                     $this->formArray["tin"] = $person->getTin();
                     $address = $person->addressArray[0];
                     if (is_a($address, Address)) {
                         $this->formArray["addressID"] = $address->getAddressID();
                         $this->formArray["number"] = $address->getNumber();
                         $this->formArray["street"] = $address->getStreet();
                         $this->formArray["barangay"] = $address->getBarangay();
                         $this->formArray["district"] = $address->getDistrict();
                         $this->formArray["municipalityCity"] = $address->getMunicipalitycity();
                         $this->formArray["province"] = $address->getProvince();
                     }
                     $this->formArray["telephone"] = $person->getTelephone();
                     $this->formArray["mobileNumber"] = $person->getMobileNumber();
                     $this->formArray["email"] = $person->getEmail();
                 }
             }
             $this->tpl->set_block("rptsTemplate", "NewUserPassword", "NewUserPasswordBlock");
             $this->tpl->set_var("NewUserPasswordBlock", "");
             $this->tpl->set_block("rptsTemplate", "OldUserPassword", "OldUserPasswordBlock");
             $this->tpl->set_var("oldNewUserRowspan", 5);
             //$this->tpl->set_var("oldNewUserRowspan", 3);
             $this->tpl->parse("OldUserPasswordBlock", "OldUserPassword", true);
             break;
         case "save":
             /*
             			    if($this->isOldPasswordCorrect()==false){
             			        $this->message = "Error. Cannot Save. Old password incorrect to create new password.";
             		    	    $this->tpl->set_var("message", $this->message);	
             		    	    $this->tpl->parse("MessageBlock", "Message", true);
             		    	    
                                 $this->tpl->set_block("rptsTemplate", "NewUserPassword", "NewUserPasswordBlock");
                                 $this->tpl->set_var("NewUserPasswordBlock", "");
             
                                 $this->tpl->set_block("rptsTemplate", "OldUserPassword", "OldUserPasswordBlock");
                                 $this->tpl->set_var("oldNewUserRowspan", 3);
                                 $this->tpl->parse("OldUserPasswordBlock", "OldUserPassword", true);		    	
             		    	    break;
             			    }
             */
             if ($this->formArray["newPassword"] != "" && $this->formArray["newPassword"] != "null") {
                 $this->formArray["password"] = md5($this->formArray["newPassword"]);
             }
             if ($this->usernameAlreadyExists() == true) {
                 $this->message = "Error. Cannot Save. Username already exists.";
                 $this->tpl->set_var("message", $this->message);
                 $this->tpl->parse("MessageBlock", "Message", true);
                 $this->tpl->set_block("rptsTemplate", "NewUserPassword", "NewUserPasswordBlock");
                 $this->tpl->set_block("rptsTemplate", "OldUserPassword", "OldUserPasswordBlock");
                 if ($this->formArray["personID"] != "") {
                     $this->tpl->set_var("NewUserPasswordBlock", "");
                     $this->tpl->set_var("oldNewUserRowspan", 3);
                     $this->tpl->parse("OldUserPasswordBlock", "OldUserPassword", true);
                 } else {
                     $this->tpl->set_var("oldNewUserRowspan", 2);
                     $this->tpl->parse("NewUserPasswordBlock", "NewUserPassword", true);
                     $this->tpl->set_var("OldUserPasswordBlock", "");
                 }
                 break;
             }
             $PersonEncode = new SoapObject(NCCBIZ . "PersonEncode.php", "urn:Object");
             if ($this->formArray["personID"] != "") {
                 $PersonDetails = new SoapObject(NCCBIZ . "PersonDetails.php", "urn:Object");
                 if (!($xmlStr = $PersonDetails->getPersonDetails($this->formArray["personID"]))) {
                     $this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
                     $this->tpl->set_var("TableBlock", "Person record not found");
                 } else {
                     if (!($domDoc = domxml_open_mem($xmlStr))) {
                         $this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
                         $this->tpl->set_var("TableBlock", "error xmlDoc");
                     } else {
                         $person = new Person();
                         $person->parseDomDocument($domDoc);
                         $address = $person->addressArray[0];
                         if (is_a($address, Address)) {
                             $address->setAddressID($this->formArray["addressID"]);
                             $address->setNumber($this->formArray["number"]);
                             $address->setStreet($this->formArray["street"]);
                             $address->setBarangay($this->formArray["barangay"]);
                             $address->setDistrict($this->formArray["district"]);
                             $address->setMunicipalityCity($this->formArray["municipalityCity"]);
                             $address->setProvince($this->formArray["province"]);
                             $address->setDomDocument();
                         }
                         $person->setPersonID($this->formArray["personID"]);
                         $person->setPersonType("adminUser");
                         $person->setLastName($this->formArray["lastName"]);
                         $person->setFirstName($this->formArray["firstName"]);
                         $person->setMiddleName($this->formArray["middleName"]);
                         $person->setGender($this->formArray["gender"]);
                         $person->setBirthday($this->birthdate);
                         $person->setMaritalStatus($this->formArray["maritalStatus"]);
                         $person->setTin($this->formArray["tin"]);
                         $person->setAddressArray($address);
                         $person->setTelephone($this->formArray["telephone"]);
                         $person->setMobileNumber($this->formArray["mobileNumber"]);
                         $person->setEmail($this->formArray["email"]);
                         $person->setDomDocument();
                         $doc = $person->getDomDocument();
                         //echo $doc->html_dump_mem();
                         $xmlStr = $doc->dump_mem(true);
                         if (!($ret = $PersonEncode->updatePerson($xmlStr))) {
                             exit("error update");
                         }
                     }
                 }
             } else {
                 $address = new Address();
                 $address->setNumber($this->formArray["number"]);
                 $address->setStreet($this->formArray["street"]);
                 $address->setBarangay($this->formArray["barangay"]);
                 $address->setDistrict($this->formArray["district"]);
                 $address->setMunicipalityCity($this->formArray["municipalityCity"]);
                 $address->setProvince($this->formArray["province"]);
                 $address->setDomDocument();
                 $person = new Person();
                 $person->setPersonID($this->formArray["personID"]);
                 $person->setPersonType("adminUser");
                 $person->setLastName($this->formArray["lastName"]);
                 $person->setFirstName($this->formArray["firstName"]);
                 $person->setMiddleName($this->formArray["middleName"]);
                 $person->setGender($this->formArray["gender"]);
                 $person->setBirthday($this->birthdate);
                 $person->setMaritalStatus($this->formArray["maritalStatus"]);
                 $person->setTin($this->formArray["tin"]);
                 $person->setAddressArray($address);
                 $person->setTelephone($this->formArray["telephone"]);
                 $person->setMobileNumber($this->formArray["mobileNumber"]);
                 $person->setEmail($this->formArray["email"]);
                 $person->setDomDocument();
                 $doc = $person->getDomDocument();
                 $xmlStr = $doc->dump_mem(true);
                 //echo $this->formArray["ownerID"].$xmlStr;
                 if (!($ret = $PersonEncode->savePerson($xmlStr, $this->formArray["ownerID"]))) {
                     exit("error save");
                 }
             }
             $this->formArray["personID"] = $ret;
             $UserEncode = new SoapObject(NCCBIZ . "UserEncode.php", "urn:Object");
             if ($this->formArray["userID"] != "") {
                 $UserDetails = new SoapObject(NCCBIZ . "UserDetails.php", "urn:Object");
                 if (!($xmlStr = $UserDetails->getUserDetails($this->formArray["userID"]))) {
                     exit("User record not found");
                 } else {
                     if (!($domDoc = domxml_open_mem($xmlStr))) {
                         $this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
                         $this->tpl->set_var("TableBlock", "error xmlDoc");
                     } else {
                         $user = new User();
                         $user->parseDomDocument($domDoc);
                         $user->setUserID($this->formArray["userID"]);
                         $user->setUserType($this->formArray["userType"]);
                         $user->setUsername($this->formArray["username"]);
                         $user->setPassword($this->formArray["password"]);
                         $user->setPersonID($this->formArray["personID"]);
                         $user->setStatus($this->formArray["status"]);
                         $user->setDomDocument();
                         $doc = $user->getDomDocument();
                         $xmlStr = $doc->dump_mem(true);
                         if (!($ret = $UserEncode->updateUser($xmlStr))) {
                             exit("error update");
                         }
                     }
                 }
             } else {
                 $user = new User();
                 //$user->setUserID($this->formArray["userID"]);
                 $user->setUserType($this->formArray["userType"]);
                 $user->setUsername($this->formArray["username"]);
                 $user->setPassword(md5($this->formArray["password"]));
                 $user->setPersonID($this->formArray["personID"]);
                 $user->setStatus($this->formArray["status"]);
                 $user->setDomDocument();
                 $doc = $user->getDomDocument();
                 $xmlStr = $doc->dump_mem(true);
                 if (!($ret = $UserEncode->saveUser($xmlStr))) {
                     exit("error save");
                 }
             }
             header("location: UserClose.php" . $this->sess->url(""));
             exit;
             break;
         case "cancel":
             header("location: UserClose.php" . $this->sess->url(""));
             exit;
             break;
         default:
             $this->tpl->set_block("rptsTemplate", "UserID", "UserIDBlock");
             $this->tpl->set_var("UserIDBlock", "");
             $this->tpl->set_block("rptsTemplate", "ACK", "ACKBlock");
             $this->tpl->set_var("ACKBlock", "");
             $this->tpl->set_block("rptsTemplate", "NewUserPassword", "NewUserPasswordBlock");
             $this->tpl->set_var("oldNewUserRowspan", 2);
             $this->tpl->parse("NewUserPasswordBlock", "NewUserPassword", true);
             $this->tpl->set_block("rptsTemplate", "OldUserPassword", "OldUserPasswordBlock");
             $this->tpl->set_var("OldUserPasswordBlock", "");
     }
     $this->setForm();
     if ($this->message == "") {
         $this->tpl->set_var("MessageBlock", "");
     }
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $this->tpl->p("templatePage");
 }
예제 #8
0
function setName(Person $person, $name)
{
    $person->setFirstName($name);
}
예제 #9
0
 function Main()
 {
     switch ($this->formArray["formAction"]) {
         case "edit":
             $PlantsTreesDetails = new SoapObject(NCCBIZ . "PlantsTreesDetails.php", "urn:Object");
             if (!($xmlStr = $PlantsTreesDetails->getPlantsTrees($this->formArray["propertyID"]))) {
                 echo "xml failed";
             } else {
                 //echo $xmlStr;
                 if (!($domDoc = domxml_open_mem($xmlStr))) {
                     $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock");
                     $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc");
                 } else {
                     $plantsTrees = new PlantsTrees();
                     $plantsTrees->parseDomDocument($domDoc);
                     foreach ($plantsTrees as $key => $value) {
                         switch ($key) {
                             case "propertyAdministrator":
                                 if (is_a($value, Person)) {
                                     list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value->getBirthday());
                                     $this->formArray["personID"] = $value->getPersonID();
                                     $this->formArray["lastName"] = $value->getLastName();
                                     $this->formArray["firstName"] = $value->getFirstName();
                                     $this->formArray["middleName"] = $value->getMiddleName();
                                     $this->formArray["gender"] = $value->getGender();
                                     $this->formArray["birth_year"] = removePreZero($dateArr["year"]);
                                     $this->formArray["birth_month"] = removePreZero($dateArr["month"]);
                                     $this->formArray["birth_day"] = removePreZero($dateArr["day"]);
                                     $this->formArray["maritalStatus"] = $value->getMaritalStatus();
                                     $this->formArray["tin"] = $value->getTin();
                                     $this->formArray["addressID"] = $value->addressArray[0]->getAddressID();
                                     $this->formArray["number"] = $value->addressArray[0]->getNumber();
                                     $this->formArray["street"] = $value->addressArray[0]->getStreet();
                                     $this->formArray["barangay"] = $value->addressArray[0]->getBarangay();
                                     $this->formArray["district"] = $value->addressArray[0]->getDistrict();
                                     $this->formArray["municipalityCity"] = $value->addressArray[0]->getMunicipalityCity();
                                     $this->formArray["province"] = $value->addressArray[0]->getProvince();
                                     $this->formArray["telephone"] = $value->getTelephone();
                                     $this->formArray["mobileNumber"] = $value->getMobileNumber();
                                     $this->formArray["email"] = $value->getEmail();
                                 } else {
                                     $this->formArray[$key] = "";
                                 }
                                 break;
                             case "appraisedByDate":
                                 if (true) {
                                     list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value);
                                     $this->formArray["as_year"] = removePreZero($dateArr["year"]);
                                     $this->formArray["as_month"] = removePreZero($dateArr["month"]);
                                     $this->formArray["as_day"] = removePreZero($dateArr["day"]);
                                 } else {
                                     $this->formArray[$key] = "";
                                 }
                                 break;
                             case "recommendingApprovalDate":
                                 if (true) {
                                     list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value);
                                     $this->formArray["re_year"] = removePreZero($dateArr["year"]);
                                     $this->formArray["re_month"] = removePreZero($dateArr["month"]);
                                     $this->formArray["re_day"] = removePreZero($dateArr["day"]);
                                 } else {
                                     $this->formArray[$key] = "";
                                 }
                             case "approvedByDate":
                                 if (true) {
                                     list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value);
                                     $this->formArray["av_year"] = removePreZero($dateArr["year"]);
                                     $this->formArray["av_month"] = removePreZero($dateArr["month"]);
                                     $this->formArray["av_day"] = removePreZero($dateArr["day"]);
                                 } else {
                                     $this->formArray[$key] = "";
                                 }
                                 break;
                             case "dateAcquired":
                                 if (true) {
                                     list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value);
                                     $this->formArray["da_year"] = removePreZero($dateArr["year"]);
                                     $this->formArray["da_month"] = removePreZero($dateArr["month"]);
                                     $this->formArray["da_day"] = removePreZero($dateArr["day"]);
                                 } else {
                                     $this->formArray[$key] = "";
                                 }
                                 break;
                             case "dateOfInstallation":
                                 if (true) {
                                     list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value);
                                     $this->formArray["di_year"] = removePreZero($dateArr["year"]);
                                     $this->formArray["di_month"] = removePreZero($dateArr["month"]);
                                     $this->formArray["di_day"] = removePreZero($dateArr["day"]);
                                 } else {
                                     $this->formArray[$key] = "";
                                 }
                                 break;
                             case "dateOfOperation":
                                 if (true) {
                                     list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value);
                                     $this->formArray["do_year"] = removePreZero($dateArr["year"]);
                                     $this->formArray["do_month"] = removePreZero($dateArr["month"]);
                                     $this->formArray["do_day"] = removePreZero($dateArr["day"]);
                                 } else {
                                     $this->formArray[$key] = "";
                                 }
                                 break;
                             default:
                                 $this->formArray[$key] = $value;
                         }
                     }
                 }
             }
             break;
         case "save":
             if ($this->formArray["verifiedByID"] != "" && $this->formArray["verifiedByID"] != "xx" && $this->formArray["propertyID"] != "") {
                 $this->saveVerified($this->formArray["afsID"], $this->formArray["verifiedByID"], $this->formArray["propertyID"]);
             }
             $PlantsTreesEncode = new SoapObject(NCCBIZ . "PlantsTreesEncode.php", "urn:Object");
             if ($this->formArray["propertyID"] != "") {
                 $PlantsTreesDetails = new SoapObject(NCCBIZ . "PlantsTreesDetails.php", "urn:Object");
                 if (!($xmlStr = $PlantsTreesDetails->getPlantsTrees($this->formArray["propertyID"]))) {
                     $this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
                     $this->tpl->set_var("TableBlock", "record not found");
                 } else {
                     if (!($domDoc = domxml_open_mem($xmlStr))) {
                         $this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
                         $this->tpl->set_var("TableBlock", "error xmlDoc");
                     } else {
                         $address = new Address();
                         $address->setAddressID($this->formArray["addressID"]);
                         $address->setNumber($this->formArray["number"]);
                         $address->setStreet($this->formArray["street"]);
                         $address->setBarangay($this->formArray["barangay"]);
                         $address->setDistrict($this->formArray["district"]);
                         $address->setMunicipalityCity($this->formArray["municipalityCity"]);
                         $address->setProvince($this->formArray["province"]);
                         $address->setDomDocument();
                         $propertyAdministrator = new Person();
                         $propertyAdministrator->setPersonID($this->formArray["personID"]);
                         $propertyAdministrator->setLastName($this->formArray["lastName"]);
                         $propertyAdministrator->setFirstName($this->formArray["firstName"]);
                         $propertyAdministrator->setMiddleName($this->formArray["middleName"]);
                         //$propertyAdministrator->setGender($this->formArray["gender"]);
                         //$propertyAdministrator->setBirthday($this->birthdate);
                         //$propertyAdministrator->setMaritalStatus($this->formArray["maritalStatus"]);
                         //$propertyAdministrator->setTin($this->formArray["tin"]);
                         $propertyAdministrator->setAddressArray($address);
                         $propertyAdministrator->setTelephone($this->formArray["telephone"]);
                         //$propertyAdministrator->setMobileNumber($this->formArray["mobileNumber"]);
                         $propertyAdministrator->setEmail($this->formArray["email"]);
                         $propertyAdministrator->setDomDocument();
                         $plantsTrees = new PlantsTrees();
                         $plantsTrees->parseDomDocument($domDoc);
                         $plantsTrees->setPropertyID($this->formArray["propertyID"]);
                         $plantsTrees->setAfsID($this->formArray["afsID"]);
                         $plantsTrees->setArpNumber($this->formArray["arpNumber"]);
                         $plantsTrees->setPropertyIndexNumber($this->formArray["propertyIndexNumber"]);
                         $plantsTrees->setPropertyAdministrator($propertyAdministrator);
                         $plantsTrees->setVerifiedBy($this->formArray["verifiedByID"]);
                         $plantsTrees->setPlottingsBy($this->formArray["plottingsByID"]);
                         $plantsTrees->setNotedBy($this->formArray["notedByID"]);
                         $plantsTrees->setMarketValue($this->formArray["marketValue"]);
                         $plantsTrees->setKind($this->formArray["kind"]);
                         $plantsTrees->setActualUse($this->formArray["actualUse"]);
                         $plantsTrees->setAdjustedMarketValue($this->formArray["adjustedMarketValue"]);
                         $plantsTrees->setAssessmentLevel($this->formArray["assessmentLevel"]);
                         $plantsTrees->setAssessedValue($this->formArray["assessedValue"]);
                         $plantsTrees->setPreviousOwner($this->formArray["previousOwner"]);
                         $plantsTrees->setPreviousAssessedValue($this->formArray["previousAssessedValue"]);
                         $plantsTrees->setTaxability($this->formArray["taxability"]);
                         $plantsTrees->setEffectivity($this->formArray["effectivity"]);
                         $plantsTrees->setAppraisedBy($this->formArray["appraisedByID"]);
                         $plantsTrees->setAppraisedByDate($this->formArray["appraisedByDate"]);
                         $plantsTrees->setRecommendingApproval($this->formArray["recommendingApprovalID"]);
                         $plantsTrees->setRecommendingApprovalDate($this->formArray["recommendingApprovalDate"]);
                         $plantsTrees->setApprovedBy($this->formArray["approvedByID"]);
                         $plantsTrees->setApprovedByDate($this->formArray["approvedByDate"]);
                         $plantsTrees->setMemoranda($this->formArray["memoranda"]);
                         $plantsTrees->setPostingDate($this->formArray["postingDate"]);
                         $plantsTrees->setLandPin($this->formArray["landPin"]);
                         $plantsTrees->setSurveyNumber($this->formArray["surveyNumber"]);
                         $plantsTrees->setProductClass($this->formArray["productClass"]);
                         $plantsTrees->setAreaPlanted($this->formArray["areaPlanted"]);
                         $plantsTrees->setTotalNumber($this->formArray["totalNumber"]);
                         $plantsTrees->setNonFruitBearing($this->formArray["nonFruitBearing"]);
                         $plantsTrees->setFruitBearing($this->formArray["fruitBearing"]);
                         $plantsTrees->setAge($this->formArray["age"]);
                         $plantsTrees->setUnitPrice($this->formArray["unitPrice"]);
                         $plantsTrees->setAdjustmentFactor($this->formArray["adjustmentFactor"]);
                         $plantsTrees->setPercentAdjustment($this->formArray["percentAdjustment"]);
                         $plantsTrees->setValueAdjustment($this->formArray["valueAdjustment"]);
                         $plantsTrees->setCreatedBy($this->userID);
                         $plantsTrees->setModifiedBy($this->userID);
                         $plantsTrees->setDomDocument();
                         $doc = $plantsTrees->getDomDocument();
                         $xmlStr = $doc->dump_mem(true);
                         //echo $xmlStr;
                         if (!($ret = $PlantsTreesEncode->updatePlantsTrees($xmlStr))) {
                             exit("error update");
                         }
                     }
                 }
             } else {
                 $address = new Address();
                 //$address->setAddressID($this->formArray["addressID"]);
                 $address->setNumber($this->formArray["number"]);
                 $address->setStreet($this->formArray["street"]);
                 $address->setBarangay($this->formArray["barangay"]);
                 $address->setDistrict($this->formArray["district"]);
                 $address->setMunicipalityCity($this->formArray["municipalityCity"]);
                 $address->setProvince($this->formArray["province"]);
                 $address->setDomDocument();
                 $propertyAdministrator = new Person();
                 //$propertyAdministrator->setPersonID($this->formArray["personID"]);
                 $propertyAdministrator->setLastName($this->formArray["lastName"]);
                 $propertyAdministrator->setFirstName($this->formArray["firstName"]);
                 $propertyAdministrator->setMiddleName($this->formArray["middleName"]);
                 //$propertyAdministrator->setGender($this->formArray["gender"]);
                 //$propertyAdministrator->setBirthday($this->birthdate);
                 //$propertyAdministrator->setMaritalStatus($this->formArray["maritalStatus"]);
                 //$propertyAdministrator->setTin($this->formArray["tin"]);
                 $propertyAdministrator->setAddressArray($address);
                 $propertyAdministrator->setTelephone($this->formArray["telephone"]);
                 //$propertyAdministrator->setMobileNumber($this->formArray["mobileNumber"]);
                 $propertyAdministrator->setEmail($this->formArray["email"]);
                 $propertyAdministrator->setDomDocument();
                 $plantsTrees = new PlantsTrees();
                 $plantsTrees->parseDomDocument($domDoc);
                 //$plantsTrees->setPropertyID($this->formArray["propertyID"]);
                 $plantsTrees->setAfsID($this->formArray["afsID"]);
                 $plantsTrees->setArpNumber($this->formArray["arpNumber"]);
                 $plantsTrees->setPropertyIndexNumber($this->formArray["propertyIndexNumber"]);
                 $plantsTrees->setPropertyAdministrator($propertyAdministrator);
                 $plantsTrees->setVerifiedBy($this->formArray["verifiedByID"]);
                 $plantsTrees->setPlottingsBy($this->formArray["plottingsByID"]);
                 $plantsTrees->setNotedBy($this->formArray["notedByID"]);
                 $plantsTrees->setMarketValue($this->formArray["marketValue"]);
                 $plantsTrees->setKind($this->formArray["kind"]);
                 $plantsTrees->setActualUse($this->formArray["actualUse"]);
                 $plantsTrees->setAdjustedMarketValue($this->formArray["adjustedMarketValue"]);
                 $plantsTrees->setAssessmentLevel($this->formArray["assessmentLevel"]);
                 $plantsTrees->setAssessedValue($this->formArray["assessedValue"]);
                 $plantsTrees->setPreviousOwner($this->formArray["previousOwner"]);
                 $plantsTrees->setPreviousAssessedValue($this->formArray["previousAssessedValue"]);
                 $plantsTrees->setTaxability($this->formArray["taxability"]);
                 $plantsTrees->setEffectivity($this->formArray["effectivity"]);
                 $plantsTrees->setAppraisedBy($this->formArray["appraisedByID"]);
                 $plantsTrees->setAppraisedByDate($this->formArray["appraisedByDate"]);
                 $plantsTrees->setRecommendingApproval($this->formArray["recommendingApprovalID"]);
                 $plantsTrees->setRecommendingApprovalDate($this->formArray["recommendingApprovalDate"]);
                 $plantsTrees->setApprovedBy($this->formArray["approvedByID"]);
                 $plantsTrees->setApprovedByDate($this->formArray["approvedByDate"]);
                 $plantsTrees->setMemoranda($this->formArray["memoranda"]);
                 $plantsTrees->setPostingDate($this->formArray["postingDate"]);
                 $plantsTrees->setLandPin($this->formArray["landPin"]);
                 $plantsTrees->setSurveyNumber($this->formArray["surveyNumber"]);
                 $plantsTrees->setProductClass($this->formArray["productClass"]);
                 $plantsTrees->setAreaPlanted($this->formArray["areaPlanted"]);
                 $plantsTrees->setTotalNumber($this->formArray["totalNumber"]);
                 $plantsTrees->setNonFruitBearing($this->formArray["nonFruitBearing"]);
                 $plantsTrees->setFruitBearing($this->formArray["fruitBearing"]);
                 $plantsTrees->setAge($this->formArray["age"]);
                 $plantsTrees->setUnitPrice($this->formArray["unitPrice"]);
                 $plantsTrees->setAdjustmentFactor($this->formArray["adjustmentFactor"]);
                 $plantsTrees->setPercentAdjustment($this->formArray["percentAdjustment"]);
                 $plantsTrees->setValueAdjustment($this->formArray["valueAdjustment"]);
                 $plantsTrees->setCreatedBy($this->userID);
                 $plantsTrees->setModifiedBy($this->userID);
                 $plantsTrees->setDomDocument();
                 $doc = $plantsTrees->getDomDocument();
                 $xmlStr = $doc->dump_mem(true);
                 //exit($xmlStr);
                 if (!($ret = $PlantsTreesEncode->savePlantsTrees($xmlStr))) {
                     echo "ret=" . $ret;
                 }
             }
             $this->formArray["propertyID"] = $ret;
             header("location: PlantsTreesClose.php" . $this->sess->url("") . $this->sess->add_query(array("afsID" => $this->formArray["afsID"])));
             exit;
             break;
         case "cancel":
             header("location: PlantsTreesList.php");
             exit;
             break;
         default:
             if (!($firstPropertyID = $this->getFirstPropertyID())) {
                 $this->tpl->set_block("rptsTemplate", "odID", "odIDBlock");
                 $this->tpl->set_var("odIDBlock", "");
                 $this->tpl->set_block("rptsTemplate", "ACK", "ACKBlock");
                 $this->tpl->set_var("ACKBlock", "");
             } else {
                 $PlantsTreesDetails = new SoapObject(NCCBIZ . "PlantsTreesDetails.php", "urn:Object");
                 if (!($xmlStr = $PlantsTreesDetails->getPlantsTrees($firstPropertyID))) {
                     echo "xml failed";
                 } else {
                     //echo $xmlStr;
                     if (!($domDoc = domxml_open_mem($xmlStr))) {
                         $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock");
                         $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc");
                     } else {
                         $plantsTrees = new PlantsTrees();
                         $plantsTrees->parseDomDocument($domDoc);
                         foreach ($plantsTrees as $key => $value) {
                             switch ($key) {
                                 case "propertyID":
                                     $this->formArray["propertyID"] = "";
                                     break;
                                 case "propertyAdministrator":
                                     if (is_a($value, Person)) {
                                         list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value->getBirthday());
                                         $this->formArray["personID"] = $value->getPersonID();
                                         $this->formArray["lastName"] = $value->getLastName();
                                         $this->formArray["firstName"] = $value->getFirstName();
                                         $this->formArray["middleName"] = $value->getMiddleName();
                                         $this->formArray["gender"] = $value->getGender();
                                         $this->formArray["birth_year"] = removePreZero($dateArr["year"]);
                                         $this->formArray["birth_month"] = removePreZero($dateArr["month"]);
                                         $this->formArray["birth_day"] = removePreZero($dateArr["day"]);
                                         $this->formArray["maritalStatus"] = $value->getMaritalStatus();
                                         $this->formArray["tin"] = $value->getTin();
                                         $this->formArray["addressID"] = $value->addressArray[0]->getAddressID();
                                         $this->formArray["number"] = $value->addressArray[0]->getNumber();
                                         $this->formArray["street"] = $value->addressArray[0]->getStreet();
                                         $this->formArray["barangay"] = $value->addressArray[0]->getBarangay();
                                         $this->formArray["district"] = $value->addressArray[0]->getDistrict();
                                         $this->formArray["municipalityCity"] = $value->addressArray[0]->getMunicipalityCity();
                                         $this->formArray["province"] = $value->addressArray[0]->getProvince();
                                         $this->formArray["telephone"] = $value->getTelephone();
                                         $this->formArray["mobileNumber"] = $value->getMobileNumber();
                                         $this->formArray["email"] = $value->getEmail();
                                     } else {
                                         $this->formArray[$key] = "";
                                     }
                                     break;
                                 case "appraisedByDate":
                                     if (true) {
                                         list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value);
                                         $this->formArray["as_year"] = removePreZero($dateArr["year"]);
                                         $this->formArray["as_month"] = removePreZero($dateArr["month"]);
                                         $this->formArray["as_day"] = removePreZero($dateArr["day"]);
                                     } else {
                                         $this->formArray[$key] = "";
                                     }
                                     break;
                                 case "recommendingApprovalDate":
                                     if (true) {
                                         list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value);
                                         $this->formArray["re_year"] = removePreZero($dateArr["year"]);
                                         $this->formArray["re_month"] = removePreZero($dateArr["month"]);
                                         $this->formArray["re_day"] = removePreZero($dateArr["day"]);
                                     } else {
                                         $this->formArray[$key] = "";
                                     }
                                 case "approvedByDate":
                                     if (true) {
                                         list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value);
                                         $this->formArray["av_year"] = removePreZero($dateArr["year"]);
                                         $this->formArray["av_month"] = removePreZero($dateArr["month"]);
                                         $this->formArray["av_day"] = removePreZero($dateArr["day"]);
                                     } else {
                                         $this->formArray[$key] = "";
                                     }
                                     break;
                                 case "dateAcquired":
                                     if (true) {
                                         list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value);
                                         $this->formArray["da_year"] = removePreZero($dateArr["year"]);
                                         $this->formArray["da_month"] = removePreZero($dateArr["month"]);
                                         $this->formArray["da_day"] = removePreZero($dateArr["day"]);
                                     } else {
                                         $this->formArray[$key] = "";
                                     }
                                     break;
                                 case "dateOfInstallation":
                                     if (true) {
                                         list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value);
                                         $this->formArray["di_year"] = removePreZero($dateArr["year"]);
                                         $this->formArray["di_month"] = removePreZero($dateArr["month"]);
                                         $this->formArray["di_day"] = removePreZero($dateArr["day"]);
                                     } else {
                                         $this->formArray[$key] = "";
                                     }
                                     break;
                                 case "dateOfOperation":
                                     if (true) {
                                         list($dateArr["year"], $dateArr["month"], $dateArr["day"]) = explode("-", $value);
                                         $this->formArray["do_year"] = removePreZero($dateArr["year"]);
                                         $this->formArray["do_month"] = removePreZero($dateArr["month"]);
                                         $this->formArray["do_day"] = removePreZero($dateArr["day"]);
                                     } else {
                                         $this->formArray[$key] = "";
                                     }
                                     break;
                                 case "arpNumber":
                                 case "propertyIndexNumber":
                                 case "verifiedByID":
                                 case "verifiedBy":
                                 case "verifiedByName":
                                 case "plottingsByID":
                                 case "plottingsBy":
                                 case "plottingsByName":
                                 case "notedByID":
                                 case "notedBy":
                                 case "notedByName":
                                 case "marketValue":
                                 case "kind":
                                 case "actualUse":
                                 case "adjustedMarketValue":
                                 case "assessmentLevel":
                                 case "assessedValue":
                                 case "previousOwner":
                                 case "previousAssessedValue":
                                 case "taxability":
                                 case "effectivity":
                                 case "appraisedByID":
                                 case "appraisedBy":
                                 case "appraisedByName":
                                 case "appraisedByDate":
                                 case "recommendingApprovalID":
                                 case "recommendingApproval":
                                 case "recommendingApprovalName":
                                 case "recommendingApprovalDate":
                                 case "approvedByID":
                                 case "approvedBy":
                                 case "approvedByName":
                                 case "approvedByDate":
                                 case "memoranda":
                                 case "postingDate":
                                 case "landPin":
                                 case "surveyNumber":
                                 case "productClass":
                                 case "areaPlanted":
                                 case "totalNumber":
                                 case "nonFruitBearing":
                                 case "fruitBearing":
                                 case "age":
                                 case "unitPrice":
                                 case "adjustmentFactor":
                                 case "percentAdjustment":
                                 case "valueAdjustment":
                                 case "as_month":
                                 case "as_day":
                                 case "as_year":
                                 case "re_month":
                                 case "re_day":
                                 case "re_year":
                                 case "av_month":
                                 case "av_day":
                                 case "av_year":
                                     $this->formArray[$key] = $value;
                                     break;
                             }
                         }
                     }
                 }
             }
     }
     $this->setForm();
     $this->tpl->set_var("Session", $this->sess->url("") . $this->sess->add_query(array("odID" => $this->formArray["odID"], "ownerID" => $this->formArray["ownerID"])));
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $this->tpl->p("templatePage");
 }
예제 #10
0
     //$p = implode(",", array_slice(explode(",", $p), 0, 2));
     //echo $p."\n";
     $parser = new HumanNameParser_Parser($p);
     $searchURL = "/peoplefinderWS/peoplefinderws.asmx/PeopleFinderXml?firstName=" . urlencode($parser->getFirst()) . "&lastname=" . urlencode($parser->getLast()) . "&department=&phoneno=&email=";
     $peopleInfoXML = file_get_contents($baseURL . $searchURL, false, $context) or die("The mospace server might failed\n");
     //echo $baseURL.$searchURL;
     $peopleInfoXMLObject = simplexml_load_string($peopleInfoXML, null, LIBXML_NOCDATA);
     if ($peopleInfoXMLObject['found'] == 0 || $peopleInfoXMLObject['found'] >= 49) {
         continue;
     }
     //echo "<pre>";
     ///print_r($peopleInfoXMLObject->Person);
     //echo "</pre>";
     $personObject = new Person();
     $personObject->setLastName($parser->getLast());
     $personObject->setFirstName($parser->getFirst());
     //For test purpose only
     //echo $personObject->getLastName().", ".$personObject->getFirstName().";   ";
     $personObject->setDepartment($peopleInfoXMLObject->Person->Department);
     $personObject->setTitle($peopleInfoXMLObject->Person->Title);
     //$personObject->setImageURL("http://freelanceme.net/Images/default%20profile%20picture.png");
     if ($peopleInfoXMLObject->Person->Phone != null) {
         $personObject->setPhone($peopleInfoXMLObject->Person->Phone);
     }
     $personObject->setEmail($peopleInfoXMLObject->Person->{'E-mail'});
     $personObject->insertToDatabase();
 }
 echo "\n";
 //For testing purpose only
 //if($i++ > 10){
 //break;
예제 #11
0
 /**
  * missionRequests save all data into corresponding tables
  * CODE:mission_request_create
  */
 public function executeSave(sfWebRequest $request)
 {
     # security
     if (!$this->getUser()->hasCredential(array('Administrator', 'Staff', 'Coordinator'), false)) {
         $this->getUser()->setFlash("warning", 'You don\'t have permission to access this url ' . $request->getReferer());
         $this->redirect('dashboard/index');
     }
     $miss_req_session = $this->getUser()->getAttribute('miss_req');
     if (!$miss_req_session) {
         return $this->forward('passenger', 'step3');
     }
     //set Requester Person
     $req_person = new Person();
     $req_person->setFirstName($miss_req_session->getReqFirstname());
     $req_person->setLastName($miss_req_session->getReqLastname());
     $req_person->setAddress1($miss_req_session->getReqAddress1());
     $req_person->setAddress2($miss_req_session->getReqAddress2());
     $req_person->setCity($miss_req_session->getReqCity());
     $req_person->setCounty($miss_req_session->getReqCounty());
     $req_person->setState($miss_req_session->getReqState());
     $req_person->setCountry($miss_req_session->getReqCountry());
     $req_person->setZipcode($miss_req_session->getReqZipcode());
     $req_person->setEmail($miss_req_session->getReqEmail());
     $req_person->setSecondaryEmail($miss_req_session->getReqSecondaryEmail());
     $req_person->setPagerEmail($miss_req_session->getReqPagerEmail());
     $req_person->setDayPhone($miss_req_session->getReqDayPhone());
     $req_person->setDayComment($miss_req_session->getReqDayComment());
     $req_person->setEveningPhone($miss_req_session->getReqEvePhone());
     $req_person->setEveningComment($miss_req_session->getReqEveComment());
     $req_person->setMobilePhone($miss_req_session->getReqMobilePhone());
     $req_person->setMobileComment($miss_req_session->getReqMobileComment());
     $req_person->setPagerPhone($miss_req_session->getReqPagerPhone());
     $req_person->setPagerComment($miss_req_session->getReqPagerComment());
     $req_person->setOtherPhone($miss_req_session->getReqOtherPhone());
     $req_person->setOtherComment($miss_req_session->getReqOtherComment());
     $req_person->save();
     //end of Requester Person
     // set Requester Agency
     $agency = AgencyPeer::getByNamePhone(trim($miss_req_session->getAgencyName()));
     if ($agency) {
         # nothing
     } else {
         $agency = new Agency();
         $agency->setName(trim($miss_req_session->getAgencyName()));
         $agency->save();
     }
     //set Requester
     $requester = new Requester();
     $requester->setPersonId($req_person->getId());
     $requester->setAgencyId($agency->getId());
     //$requester->setDischarge($miss_req_session->getReqDischarge());
     $requester->save();
     if (isset($miss_req_session->passenger_id)) {
         $passenger = PassengerPeer::retrieveByPK($miss_req_session->passenger_id);
         if (!$passenger instanceof Passenger) {
             $passenger = new Passenger();
         }
     } else {
         $passenger = new Passenger();
     }
     if ($passenger->isNew()) {
         $person = new Person();
     } else {
         $person = $passenger->getPerson();
     }
     //set Person to Passenger
     $person->setTitle($miss_req_session->getPassTitle());
     $person->setFirstName($miss_req_session->getPassFirstName());
     $person->setLastName($miss_req_session->getPassLastName());
     $person->setGender($miss_req_session->getPassGender());
     $person->setAddress1($miss_req_session->getPassAddress1());
     $person->setAddress2($miss_req_session->getPassAddress2());
     $person->setCity($miss_req_session->getPassCity());
     $person->setState($miss_req_session->getPassState());
     $person->setZipcode($miss_req_session->getPassZipcode());
     $person->setCountry($miss_req_session->getPassCountry());
     $person->setEmail($miss_req_session->getPassEmail());
     $person->setDayPhone($miss_req_session->getPassDayPhone());
     $person->setDayComment($miss_req_session->getPassDayComment());
     $person->setEveningPhone($miss_req_session->getPassEvePhone());
     $person->setEveningComment($miss_req_session->getPassEveComment());
     $person->setMobilePhone($miss_req_session->getPassMobilePhone());
     $person->setMobileComment($miss_req_session->getPassMobileComment());
     $person->setPagerPhone($miss_req_session->getPassPagerPhone());
     $person->setPagerComment($miss_req_session->getPassPagerComment());
     $person->setOtherPhone($miss_req_session->getPassOtherPhone());
     $person->setOtherComment($miss_req_session->getPassOtherComment());
     $person->save();
     //set Passenger
     $passenger->setPersonId($person->getId());
     $passenger->setPassengerTypeId($miss_req_session->getPassType());
     $passenger->setDateOfBirth($miss_req_session->getPassDateOfBirth());
     $passenger->setIllness($miss_req_session->getIllness());
     $passenger->setFinancial($miss_req_session->getFinancial());
     $passenger->setPublicConsiderations($miss_req_session->getPassPublicCons());
     $passenger->setPrivateConsiderations($miss_req_session->getPassPrivateCons());
     $passenger->setReleasingPhysician($miss_req_session->getReleasingPhysician());
     $passenger->setReleasingPhone($miss_req_session->getReleasePhone());
     $passenger->setReleasingFax1($miss_req_session->getReleaseFax());
     $passenger->setReleasingFax1Comment($miss_req_session->getReleaseFaxComment());
     $passenger->setLodgingName($miss_req_session->getLodgingName());
     $passenger->setLodgingPhone($miss_req_session->getLodgingPhone());
     $passenger->setLodgingPhoneComment($miss_req_session->getLodgingPhoneComment());
     $passenger->setFacilityName($miss_req_session->getFacilityName());
     $passenger->setFacilityPhone($miss_req_session->getFacilityPhone());
     $passenger->setFacilityPhoneComment($miss_req_session->getFacilityPhoneComment());
     $passenger->setReleasingEmail($miss_req_session->getReleaseEmail());
     $passenger->setTreatingPhysician($miss_req_session->getTreatingPhysician());
     $passenger->setTreatingPhone($miss_req_session->getTreatingPhone());
     $passenger->setTreatingFax1($miss_req_session->getTreatingFax());
     $passenger->setTreatingFax1Comment($miss_req_session->getTreatingFaxComment());
     $passenger->setTreatingEmail($miss_req_session->getTreatingEmail());
     $passenger->setLanguageSpoken($miss_req_session->getPassLanguage());
     $passenger->setBestContactMethod($miss_req_session->getBestContact());
     $passenger->setEmergencyContactName($miss_req_session->getEmergencyName());
     $passenger->setEmergencyContactPrimaryPhone($miss_req_session->getEmergencyPhone1());
     $passenger->setEmergencyContactPrimaryComment($miss_req_session->getEmergencyPhone1Comment());
     $passenger->setEmergencyContactSecondaryPhone($miss_req_session->getEmergencyPhone2());
     $passenger->setEmergencyContactSecondaryComment($miss_req_session->getEmergencyPhone2Comment());
     $passenger->setNeedMedicalRelease($miss_req_session->getPassMedical());
     $passenger->save();
     //set Companions
     if ($passenger && $miss_req_session->getCom1Name()) {
         $person = new Person();
         $names[] = split(" ", $miss_req_session->getCom1Name());
         //echo var_dump($names); die();
         $person->setFirstName($names[0][0]);
         $person->setLastName($names[0][1]);
         $person->setDayPhone($miss_req_session->getCom1Phone());
         $person->setDayComment($miss_req_session->getCom1Comment());
         $person->save();
         $companion = new Companion();
         $companion->setPassengerId($passenger->getId());
         $companion->setName($miss_req_session->getCom1Name());
         $companion->setRelationship($miss_req_session->getCom1Relationship());
         $companion->setDateOfBirth($miss_req_session->getCom1DateOfBirth());
         $companion->setWeight($miss_req_session->getCom1Weigth());
         $companion->setCompanionPhone($miss_req_session->getCom1Phone());
         $companion->setCompanionPhoneComment($miss_req_session->getCom1Comment());
         $companion->setPersonId($person->getId());
         $companion->save();
     }
     if ($passenger && $miss_req_session->getCom2Name()) {
         $person = new Person();
         $names[] = split(" ", $miss_req_session->getCom2Name());
         //echo var_dump($names); die();
         $person->setFirstName($names[0][0]);
         $person->setLastName($names[0][1]);
         $person->setDayPhone($miss_req_session->getCom2Phone());
         $person->setDayComment($miss_req_session->getCom2Comment());
         $person->save();
         $companion = new Companion();
         $companion->setPassengerId($passenger->getId());
         $companion->setName($miss_req_session->getCom2Name());
         $companion->setRelationship($miss_req_session->getCom2Relationship());
         $companion->setDateOfBirth($miss_req_session->getCom2DateOfBirth());
         $companion->setWeight($miss_req_session->getCom2Weigth());
         $companion->setCompanionPhone($miss_req_session->getCom2Phone());
         $companion->setCompanionPhoneComment($miss_req_session->getCom2Comment());
         $companion->setPersonId($person->getId());
         $companion->save();
     }
     if ($passenger && $miss_req_session->getCom3Name()) {
         $person = new Person();
         $names[] = split(" ", $miss_req_session->getCom3Name());
         //echo var_dump($names); die();
         $person->setFirstName($names[0][0]);
         $person->setLastName($names[0][1]);
         $person->setDayPhone($miss_req_session->getCom3Phone());
         $person->setDayComment($miss_req_session->getCom3Comment());
         $person->save();
         $companion = new Companion();
         $companion->setPassengerId($passenger->getId());
         $companion->setName($miss_req_session->getCom3Name());
         $companion->setRelationship($miss_req_session->getCom3Relationship());
         $companion->setDateOfBirth($miss_req_session->getCom3DateOfBirth());
         $companion->setWeight($miss_req_session->getCom3Weigth());
         $companion->setCompanionPhone($miss_req_session->getCom3Phone());
         $companion->setCompanionPhoneComment($miss_req_session->getCom3Comment());
         $companion->setPersonId($person->getId());
         $companion->save();
     }
     if ($passenger && $miss_req_session->getCom4Name()) {
         $person = new Person();
         $names[] = split(" ", $miss_req_session->getCom4Name());
         //echo var_dump($names); die();
         $person->setFirstName($names[0][0]);
         $person->setLastName($names[0][1]);
         $person->setDayPhone($miss_req_session->getCom4Phone());
         $person->setDayComment($miss_req_session->getCom4Comment());
         $person->save();
         $companion = new Companion();
         $companion->setPassengerId($passenger->getId());
         $companion->setName($miss_req_session->getCom4Name());
         $companion->setRelationship($miss_req_session->getCom4Relationship());
         $companion->setDateOfBirth($miss_req_session->getCom4DateOfBirth());
         $companion->setWeight($miss_req_session->getCom4Weigth());
         $companion->setCompanionPhone($miss_req_session->getCom4Phone());
         $companion->setCompanionPhoneComment($miss_req_session->getCom4Comment());
         $companion->setPersonId($person->getId());
         $companion->save();
     }
     if ($passenger && $miss_req_session->getCom5Name()) {
         $person = new Person();
         $names[] = split(" ", $miss_req_session->getCom5Name());
         //echo var_dump($names); die();
         $person->setFirstName($names[0][0]);
         $person->setLastName($names[0][1]);
         $person->setDayPhone($miss_req_session->getCom5Phone());
         $person->setDayComment($miss_req_session->getCom5Comment());
         $person->save();
         $companion = new Companion();
         $companion->setPassengerId($passenger->getId());
         $companion->setName($miss_req_session->getCom5Name());
         $companion->setRelationship($miss_req_session->getCom5Relationship());
         $companion->setDateOfBirth($miss_req_session->getCom5DateOfBirth());
         $companion->setWeight($miss_req_session->getCom5Weigth());
         $companion->setCompanionPhone($miss_req_session->getCom5Phone());
         $companion->setCompanionPhoneComment($miss_req_session->getCom5Comment());
         $companion->setPersonId($person->getId());
         $companion->save();
     }
     //set Itinerary
     $itinerary = ItineraryPeer::getByMissReqId($miss_req_session->getId());
     if (!$itinerary) {
         $new_itinerary = new Itinerary();
         $new_itinerary->setDateRequested(date('m/d/Y'));
         $new_itinerary->setMissionRequestId($miss_req_session->getId());
         $new_itinerary->setMissionTypeId($miss_req_session->getMissionRequestTypeId());
         $new_itinerary->setApointTime($miss_req_session->getApptDate());
         $new_itinerary->setPassengerId($passenger->getId());
         $new_itinerary->setRequesterId($requester->getId());
         $new_itinerary->setFacility($miss_req_session->getFacilityName());
         $new_itinerary->setLodging($miss_req_session->getLodgingName());
         $new_itinerary->setOrginCity($miss_req_session->getOrginCity());
         $new_itinerary->setOrginState($miss_req_session->getOrginState());
         $new_itinerary->setDestCity($miss_req_session->getDestCity());
         $new_itinerary->setDestState($miss_req_session->getDestState());
         $new_itinerary->setWaiverNeed(0);
         $new_itinerary->setNeedMedicalRelease($miss_req_session->getPassMedical());
         $new_itinerary->setComment($miss_req_session->getComment());
         $new_itinerary->setAgencyId($agency->getId());
         $new_itinerary->save();
     }
     //set default Mission to Mission table
     //get Passenger
     //$passenger = PassengerPeer::getByPersonId($person->getId());
     $misson = new Mission();
     $misson->setRequestId($miss_req_session->getId());
     $misson->setItineraryId($new_itinerary->getId());
     $misson->setMissionTypeId($miss_req_session->getMissionRequestTypeId());
     $misson->setDateRequested($miss_req_session->getRequesterDate());
     if ($passenger) {
         $misson->setPassengerId($passenger->getId());
     }
     if ($requester) {
         $misson->setRequesterId($requester->getId());
     }
     if ($agency) {
         $misson->setAgencyId($agency->getId());
     }
     // Farazi Mission 1 externa ID
     $c = new Criteria();
     $c->add(MissionPeer::EXTERNAL_ID, NULL, Criteria::ISNOTNULL);
     $c->addDescendingOrderByColumn(MissionPeer::ID);
     $external_mission = MissionPeer::doSelectOne($c);
     $external_id = $external_mission->getExternalId();
     $currentExternalId = $external_id + 1;
     $misson->setExternalId($currentExternalId);
     $misson->setApptDate($miss_req_session->getApptDate());
     $misson->setFlightTime($miss_req_session->getFlightTime());
     $misson->setMissionDate($miss_req_session->getMissionDate());
     $misson->setMissionCount(1);
     $misson->save();
     $missLeg = new MissionLeg();
     $missLeg->setMissionId($misson->getId());
     $missLeg->setLegNumber(1);
     if ($miss_req_session->getOrginState() && $miss_req_session->getOrginZipcode()) {
         //echo $miss_req_session->getOrginState().'-'.$miss_req_session->getOrginZipcode();die();
         $fromairport = AirportPeer::getAirportByStateAndZipcode($miss_req_session->getOrginState(), $miss_req_session->getOrginZipcode());
         if ($fromairport) {
             $missLeg->setFromAirportId($fromairport->getId());
         }
     }
     if ($miss_req_session->getDestState() && $miss_req_session->getDestZipcode()) {
         //echo $miss_req_session->getDestState().'--'.$miss_req_session->getDestZipcode();die();
         $toairport = AirportPeer::getAirportByStateAndZipcode($miss_req_session->getDestState(), $miss_req_session->getDestZipcode());
         if ($toairport) {
             $missLeg->setToAirportId($toairport->getId());
         }
     }
     //echo "oder";die();
     $missLeg->setPassOnBoard(0);
     $missLeg->setWebCoordinated(0);
     $missLeg->setTransportation('air_mission');
     $missLeg->save();
     //end set Mission
     $this->getUser()->setFlash('success', 'New mission has successfully created!');
     $miss_req_session->setProcessedDate(time());
     $miss_req_session->save();
     $this->getUser()->setAttribute('miss_req', null);
     //$this->redirect('miss_req');
     //$this->getUser()->setFlash('success',$success);
     //$request->getParameter('back')
     $this->redirect('/itinerary/detail/' . $new_itinerary->getId());
 }
예제 #12
0
<?php

require_once 'autoload.php';
$person = new Person();
$person->setFirstName('Peter');
$person->setLastName('Pan');
echo $person->getInfo(), PHP_EOL;
$person2 = new Person();
$person2->setFirstName('Captain');
$person2->setLastName('Hook');
echo $person2->getInfo(), PHP_EOL;
$vehicle = new Vehicle();
$vehicle->setDescription('Very nice vehicle');
echo $vehicle->getDescription(), PHP_EOL;
$car = $vehicle;
$car->setDescription('Very nice car');
$o1 = new stdClass();
// {}| new Object()
$o2 = new stdClass();
// {}| new Object()
var_dump($vehicle->getDescription(), $car === $vehicle, $o1 === $o2);
예제 #13
0
    protected $firstName;
    protected $lastName;
    public function __construct($firstName, $lastName)
    {
        $this->setFirstName($firstName);
        $this->setLastName($lastName);
    }
    protected function setFirstName($firstName)
    {
        $this->firstName = trim($firstName);
    }
    protected function setLastName($lastName)
    {
        $this->lastName = trim($lastName);
    }
    protected function getFirstName($firstName)
    {
        return $this->firstName;
    }
    protected function getLastName($lastName)
    {
        return $this->lastName;
    }
    public function fullName()
    {
        return $this->getFirstName . " " . $this->getLastName;
    }
}
$person = new Person('John', 'Doe');
echo $person->setFirstName('Jane');
예제 #14
0
파일: testparse.php 프로젝트: armic/erpts
$address->setDistrict("xOrtigas Center");
$address->setMunicipalityCity("xPasig City");
$address->setProvince("xMetro Manila");
$address->setDomDocument();
$address1 = new Address();
//$address->setAddressID(124);
$address1->setNumber("unit 2415 Megaplaza Building");
$address1->setStreet("ADB Avenue corner Garnett Street");
$address1->setBarangay("Barangay San Antonio");
$address1->setDistrict("Ortigas Center");
$address1->setMunicipalityCity("Pasig City");
$address1->setProvince("Metro Manila");
$address1->setDomDocument();
$person = new Person();
//$person->setPersonID(126);
$person->setFirstName("Nelson Juan");
$person->setMiddleName("Miranda");
$person->setLastName(date("H:i:s"));
$person->setGender("male");
$person->setBirthday("1977/07/09");
$person->setMaritalStatus("single");
$person->setTin("1234567890");
$person->setTelephone("026584746");
$person->setMobileNumber("09175302791");
$person->setEmail("*****@*****.**");
$person->setAddressArray($address);
$person->setAddressArray($address1);
$person->setDomDocument();
$domDoc = $person->getDomDocument();
$xmlStr = $domDoc->dump_mem(true);
$obj = new PersonEncode();
예제 #15
0
 public function executeAjaxCreate(sfWebRequest $request)
 {
     if (!$this->getUser()->hasCredential(array('Administrator', 'Staff', 'Coordinator'), false)) {
         $this->getUser()->setFlash("warning", 'You don\'t have permission to access this url ' . $request->getReferer());
         $this->redirect('dashboard/index');
     }
     $this->form = new CompanionForm();
     $this->form->bind($request->getParameter($this->form->getName()));
     if ($this->form->isValid()) {
         //----------------------------------------------
         $person = new Person();
         $names[] = split(" ", $this->form->getValue('name'));
         //echo var_dump($names); die();
         $person->setFirstName($names[0][0]);
         $person->setLastName($names[0][1]);
         $person->setDayPhone($this->form->getValue('companion_phone'));
         $person->setDayComment($this->form->getValue('companion_phone_comment'));
         $person->save();
         $comp = $this->form->getObject();
         $comp->setPassengerId($this->form->getValue('passenger_id'));
         $comp->setName($this->form->getValue('name'));
         $comp->setRelationship($this->form->getValue('relationship'));
         $comp->setDateOfBirth($this->form->getValue('date_of_birth'));
         $comp->setWeight($this->form->getValue('weight'));
         $comp->setCompanionPhone($this->form->getValue('companion_phone'));
         $comp->setCompanionPhoneComment($this->form->getValue('companion_phone_comment'));
         $comp->setPersonId($person->getId());
         $comp->save();
         //----------------------------------------------
         //$companion = $this->form->save();
         $id = $comp->getId();
         $name = addslashes($comp->getName());
         $rel = addslashes($comp->getRelationship());
         return $this->renderText("<script type=\"text/javascript\">appendCompanion({$id},'{$name}','{$rel}')</script>");
     } else {
         $this->setTemplate('ajaxNew');
         $this->el_id = $request->getParameter('el_id');
     }
 }
예제 #16
0
 public function testSetAndGetFirstName()
 {
     $this->person->setFirstName('Benjamin');
     $this->assertEquals('Benjamin', $this->person->getFirstName());
 }
예제 #17
0
 public function executeStepSave(sfWebRequest $request)
 {
     $passenger_session_step5 = $this->getUser()->getAttribute('passangers_step5');
     if (!$passenger_session_step5) {
         return $this->forward('passanger', 'step5_4');
     }
     //save Person data
     $person = new Person();
     $person->setTitle($passenger_session_step5['title']);
     $person->setFirstName($passenger_session_step5['firstname']);
     $person->setLastName($passenger_session_step5['lastname']);
     $person->setAddress1($passenger_session_step5['address1']);
     $person->setAddress2($passenger_session_step5['address2']);
     $person->setCity($passenger_session_step5['city']);
     $person->setCounty($passenger_session_step5['county']);
     $person->setState($passenger_session_step5['state']);
     $person->setCountry($passenger_session_step5['country']);
     $person->setZipcode($passenger_session_step5['zipcode']);
     $person->setDayPhone($passenger_session_step5['day_phone']);
     $person->setDayComment($passenger_session_step5['day_comment']);
     $person->setEveningPhone($passenger_session_step5['eve_phone']);
     $person->setEveningComment($passenger_session_step5['eve_comment']);
     $person->setMobilePhone($passenger_session_step5['mobile_phone']);
     $person->setMobileComment($passenger_session_step5['mobile_comment']);
     $person->setPagerPhone($passenger_session_step5['pager_phone']);
     $person->setPagerComment($passenger_session_step5['pager_comment']);
     $person->setOtherPhone($passenger_session_step5['other_comment']);
     $person->setOtherComment($passenger_session_step5['other_comment']);
     $person->setFaxPhone1($passenger_session_step5['fax_phone1']);
     $person->setFaxComment1($passenger_session_step5['fax_comment1']);
     $person->setAutoFax($passenger_session_step5['auto_fax']);
     $person->setFaxPhone2($passenger_session_step5['fax_phone2']);
     $person->setFaxComment2($passenger_session_step5['fax_comment2']);
     $person->setEmail($passenger_session_step5['email']);
     $person->setEmailTextOnly($passenger_session_step5['textonly']);
     $person->setEmailBlocked($passenger_session_step5['emailblocked']);
     $person->setComment($passenger_session_step5['comment']);
     $person->setBlockMailings($passenger_session_step5['blockmailings']);
     $person->setNewsletter($passenger_session_step5['newsletter']);
     $person->setGender($passenger_session_step5['gender']);
     $person->setDeceased($passenger_session_step5['deceased']);
     $person->setDeceasedComment($passenger_session_step5['deceased_comment']);
     $person->setSecondaryEmail($passenger_session_step5['secemail']);
     $person->setDeceasedDate($passenger_session_step5['deceased_date']);
     $person->setMiddleName($passenger_session_step5['middlename']);
     $person->setSuffix($passenger_session_step5['suffix']);
     $person->setNickname($passenger_session_step5['nickname']);
     $person->setVeteran($passenger_session_step5['military']);
     $person->save();
     //save Passenger data
     $passenger = new Passenger();
     $passenger->setPersonId($person->getId());
     if ($passenger_session_step5['passenger_type_id'] == 0) {
         $passenger->setPassengerTypeId(null);
     } else {
         $passenger->setPassengerTypeId($passenger_session_step5['passenger_type_id']);
     }
     $passenger->setParent($passenger_session_step5['parent']);
     $passenger->setDateOfBirth($passenger_session_step5['date_of_birth']);
     $passenger->setWeight($passenger_session_step5['weight']);
     $passenger->setIllness($passenger_session_step5['illness']);
     $passenger->setPassengerIllnessCategoryId($passenger_session_step5['passenger_illness_category_id']);
     $passenger->setLanguageSpoken($passenger_session_step5['language_spoken']);
     $passenger->setBestContactMethod($passenger_session_step5['best_contact_method']);
     $passenger->setFinancial($passenger_session_step5['facility_name']);
     $passenger->setPublicConsiderations($passenger_session_step5['public_considerations']);
     $passenger->setPrivateConsiderations($passenger_session_step5['private_considerations']);
     $passenger->setGroundTransportationComment($passenger_session_step5['ground_transportation_comment']);
     $passenger->setTravelHistoryNotes($passenger_session_step5['travel_history_notes']);
     $passenger->setReleasingPhysician($passenger_session_step5['releasing_physician']);
     $passenger->setReleasingPhone($passenger_session_step5['releasing_phone']);
     $passenger->setReleasingFax1($passenger_session_step5['releasing_fax1']);
     $passenger->setReleasingFax1Comment($passenger_session_step5['releasing_fax1_comment']);
     $passenger->setReleasingEmail($passenger_session_step5['releasing_email']);
     $passenger->setNeedMedicalRelease($passenger_session_step5['need_medical_release']);
     $passenger->setMedicalReleaseRequested($passenger_session_step5['medical_release_requested']);
     $passenger->setMedicalReleaseReceived($passenger_session_step5['medical_release_received']);
     $passenger->setTreatingPhysician($passenger_session_step5['treating_physician']);
     $passenger->setTreatingPhone($passenger_session_step5['treating_phone']);
     $passenger->setTreatingFax1($passenger_session_step5['treating_fax1']);
     $passenger->setTreatingFax1Comment($passenger_session_step5['treating_fax1_comment']);
     $passenger->setTreatingEmail($passenger_session_step5['treating_email']);
     $passenger->setLanguageSpoken($passenger_session_step5['language_spoken']);
     $passenger->setLodgingPhone($passenger_session_step5['lodging_phone']);
     $passenger->setLodgingPhoneComment($passenger_session_step5['lodging_phone_comment']);
     $passenger->setFacilityName($passenger_session_step5['facility_name']);
     $passenger->setFacilityPhone($passenger_session_step5['facility_phone']);
     $passenger->setFacilityPhoneComment($passenger_session_step5['facility_phone_comment']);
     $passenger->setEmergencyContactName($passenger_session_step5['emergency_contact_name']);
     $passenger->setEmergencyContactPrimaryPhone($passenger_session_step5['emergency_contact_primary_phone']);
     $passenger->setEmergencyContactPrimaryComment($passenger_session_step5['emergency_contact_primary_comment']);
     $passenger->setEmergencyContactSecondaryPhone($passenger_session_step5['emergency_contact_secondary_phone']);
     $passenger->setEmergencyContactSecondaryComment($passenger_session_step5['emergency_contact_secondary_comment']);
     $passenger->save();
     $key = $passenger_session_step5['key'];
     $this->getUser()->setFlash('success', 'Passenger information has been successfully created!');
     $this->redirect('@passenger');
     //removing used session like passenger data
     unset($passenger_session_step5p[$key]);
     $this->getUser()->setAttribute('passanger_step5', $passenger_session_step5);
 }
예제 #18
0
파일: AFSEncode.php 프로젝트: armic/erpts
 function Main()
 {
     switch ($this->formArray["formAction"]) {
         case "edit":
             $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object");
             if (!($xmlStr = $AFSDetails->getAFS($this->formArray["afsID"]))) {
                 echo "xml failed";
             } else {
                 if (!($domDoc = domxml_open_mem($xmlStr))) {
                     $this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock");
                     $this->tpl->set_var("OwnerListTableBlock", "error xmlDoc");
                 } else {
                     $afs = new AFS();
                     $afs->parseDomAFS($domDoc);
                     foreach ($afs as $key => $value) {
                         $this->formArray[$key] = $value;
                     }
                     //print_r($afs);
                     //exit();
                     $administrator = $afs->getAdministratorArray();
                     foreach ($administrator as $key => $value) {
                         $this->formArray["lastName"] = $value->getLastName();
                         $this->formArray["firstName"] = $value->getFirstName();
                         $this->formArray["middleName"] = $value->getMiddleName();
                         $this->formArray["number"] = $value->getNumber();
                         $this->formArray["street"] = $value->getStreet();
                         $this->formArray["barangay"] = $value->getBarangay();
                         $this->formArray["district"] = $value->getDistrict();
                         $this->formArray["municipalityCity"] = $value->getMunicipalityCity();
                         $this->formArray["province"] = $value->getProvince();
                         $this->formArray["telephone"] = $value->getTelephone();
                     }
                 }
             }
             break;
         case "save":
             $AFSEncode = new SoapObject(NCCBIZ . "AFSEncode.php", "urn:Object");
             if ($this->formArray["afsID"] != "") {
                 $afs = new AFS();
                 $afs->selectAFS($this->formArray["afsID"]);
                 $afs->setOdID($this->formArray["odID"]);
                 $afs->setPropertyIndexNumber($this->formArray["propertyIndexNumber"]);
                 $afs->setCertificateOfTitleNumber($this->formArray["certificateOfTitleNumber"]);
                 $afs->setCadastralLotNumber($this->formArray["cadastralLotNumber"]);
                 $afs->setNorth($this->formArray["north"]);
                 $afs->setSouth($this->formArray["south"]);
                 $afs->setEast($this->formArray["east"]);
                 $afs->setWest($this->formArray["west"]);
                 $afs->setCreatedBy($this->userID);
                 $afs->setModifiedBy($this->userID);
                 $person = new Person();
                 $person->setPersonID($afs->getAdministrator());
                 $person->setLastName($this->formArray["lastName"]);
                 $person->setFirstName($this->formArray["firstName"]);
                 $person->setMiddleName($this->formArray["middleName"]);
                 $person->setNumber($this->formArray["number"]);
                 $person->setStreet($this->formArray["street"]);
                 $person->setBarangay($this->formArray["barangay"]);
                 $person->setDistrict($this->formArray["district"]);
                 $person->setMunicipalityCity($this->formArray["municipalityCity"]);
                 $person->setProvince($this->formArray["province"]);
                 $person->setTelephone($this->formArray["telephone"]);
                 $person->setDom();
                 $afs->setAdministratorArray($person);
                 $afs->setDomAFS();
                 $doc = $afs->getDomAFS();
                 $xmlStr = $doc->dump_mem();
                 if (!($ret = $AFSEncode->updateAFS($xmlStr))) {
                     echo "error update";
                 }
                 header("location: AFSClose.php" . $this->sess->url("") . $this->sess->add_query(array("odID" => $ret)));
                 exit;
             } else {
                 $afs = new AFS();
                 $afs->setOdID($this->formArray["odID"]);
                 $afs->setPropertyIndexNumber($this->formArray["propertyIndexNumber"]);
                 $afs->setCertificateOfTitleNumber($this->formArray["certificateOfTitleNumber"]);
                 $afs->setCadastralLotNumber($this->formArray["cadastralLotNumber"]);
                 $afs->setNorth($this->formArray["north"]);
                 $afs->setSouth($this->formArray["south"]);
                 $afs->setEast($this->formArray["east"]);
                 $afs->setWest($this->formArray["west"]);
                 $afs->setCreatedBy($this->userID);
                 $afs->setModifiedBy($this->userID);
                 $adminAddress = new Address();
                 $adminAddress->setNumber($this->formArray["number"]);
                 $adminAddress->setStreet($this->formArray["street"]);
                 $adminAddress->setBarangay($this->formArray["barangay"]);
                 $adminAddress->setDistrict($this->formArray["district"]);
                 $adminAddress->setMunicipalityCity($this->formArray["municipalityCity"]);
                 $adminAddress->setProvince($this->formArray["province"]);
                 $adminAddress->setDomDocument();
                 $person = new Person();
                 $person->setLastName($this->formArray["lastName"]);
                 $person->setFirstName($this->formArray["firstName"]);
                 $person->setMiddleName($this->formArray["middleName"]);
                 $person->setTelephone($this->formArray["telephone"]);
                 $person->setDomDocument();
                 $afs->setAdministratorArray($person);
                 $afs->setDomDocument();
                 $doc = $afs->getDomDocument();
                 $xmlStr = $doc->dump_mem(true);
                 if (!($ret = $AFSEncode->saveAFS($xmlStr))) {
                     echo "ret=" . $ret;
                 }
                 $this->formArray["afsID"] = $ret;
                 header("location: AFSClose.php" . $this->sess->url("") . $this->sess->add_query(array("afsID" => $ret)));
                 exit;
             }
             break;
         case "cancel":
             header("location: AFSList.php");
             exit;
             break;
         default:
             $this->tpl->set_block("rptsTemplate", "odID", "odIDBlock");
             $this->tpl->set_var("odIDBlock", "");
             $this->tpl->set_block("rptsTemplate", "ACK", "ACKBlock");
             $this->tpl->set_var("ACKBlock", "");
     }
     $this->setForm();
     $this->tpl->set_var("Session", $this->sess->url("") . $this->sess->add_query(array("odID" => $this->formArray["odID"], "ownerID" => $this->formArray["ownerID"])));
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $this->tpl->p("templatePage");
 }
예제 #19
0
 public function register($postArr)
 {
     $status = false;
     $firstName = $postArr['firstname'];
     $lastName = $postArr['lastname'];
     if ($postArr['institution'] && !trim(strpos($postArr['institution'], ' ')) && preg_match('/[a-z]+[A-Z]+[a-z]+[A-Z]+/', $postArr['institution'])) {
         if ($postArr['title'] && !trim(strpos($postArr['title'], ' ')) && preg_match('/[a-z]+[A-Z]+[a-z]+[A-Z]+/', $postArr['title'])) {
             return false;
         }
     }
     $person = new Person();
     $person->setPassword($postArr['pwd']);
     $person->setUserName($this->userName);
     $person->setFirstName($firstName);
     $person->setLastName($lastName);
     $person->setTitle($postArr['title']);
     $person->setInstitution($postArr['institution']);
     $person->setCity($postArr['city']);
     $person->setState($postArr['state']);
     $person->setZip($postArr['zip']);
     $person->setCountry($postArr['country']);
     $person->setEmail($postArr['emailaddr']);
     $person->setUrl($postArr['url']);
     $person->setBiography($postArr['biography']);
     $person->setIsPublic(isset($postArr['ispublic']) ? 1 : 0);
     //Add to users table
     $fields = 'INSERT INTO users (';
     $values = 'VALUES (';
     $fields .= 'firstname ';
     $values .= '"' . $this->cleanInStr($person->getFirstName()) . '"';
     $fields .= ', lastname';
     $values .= ', "' . $this->cleanInStr($person->getLastName()) . '"';
     if ($person->getTitle()) {
         $fields .= ', title';
         $values .= ', "' . $this->cleanInStr($person->getTitle()) . '"';
     }
     if ($person->getInstitution()) {
         $fields .= ', institution';
         $values .= ', "' . $this->cleanInStr($person->getInstitution()) . '"';
     }
     if ($person->getDepartment()) {
         $fields .= ', department';
         $values .= ', "' . $this->cleanInStr($person->getDepartment()) . '"';
     }
     if ($person->getAddress()) {
         $fields .= ', address';
         $values .= ', "' . $this->cleanInStr($person->getAddress()) . '"';
     }
     if ($person->getCity()) {
         $fields .= ', city';
         $values .= ', "' . $this->cleanInStr($person->getCity()) . '"';
     }
     $fields .= ', state';
     $values .= ', "' . $this->cleanInStr($person->getState()) . '"';
     $fields .= ', country';
     $values .= ', "' . $this->cleanInStr($person->getCountry()) . '"';
     if ($person->getZip()) {
         $fields .= ', zip';
         $values .= ', "' . $this->cleanInStr($person->getZip()) . '"';
     }
     if ($person->getPhone()) {
         $fields .= ', phone';
         $values .= ', "' . $this->cleanInStr($person->getPhone()) . '"';
     }
     if ($person->getEmail()) {
         $fields .= ', email';
         $values .= ', "' . $this->cleanInStr($person->getEmail()) . '"';
     }
     if ($person->getUrl()) {
         $fields .= ', url';
         $values .= ', "' . $person->getUrl() . '"';
     }
     if ($person->getBiography()) {
         $fields .= ', biography';
         $values .= ', "' . $this->cleanInStr($person->getBiography()) . '"';
     }
     if ($person->getIsPublic()) {
         $fields .= ', ispublic';
         $values .= ', ' . $person->getIsPublic();
     }
     $sql = $fields . ') ' . $values . ')';
     //echo "SQL: ".$sql;
     $editCon = $this->getConnection('write');
     if ($editCon->query($sql)) {
         $person->setUid($editCon->insert_id);
         $this->uid = $person->getUid();
         //Add userlogin
         $sql = 'INSERT INTO userlogin (uid, username, password) ' . 'VALUES (' . $person->getUid() . ', "' . $this->cleanInStr($person->getUserName()) . '", PASSWORD("' . $this->cleanInStr($person->getPassword()) . '"))';
         if ($editCon->query($sql)) {
             $status = true;
             //authenicate
             $this->userName = $person->getUserName();
             $this->displayName = $person->getFirstName();
             $this->reset();
             $this->setCookies();
         } else {
             $this->errorStr = 'FAILED: Unable to create user.<div style="margin-left:55px;">Please contact system administrator for assistance.</div>';
         }
     }
     $editCon->close();
     return $status;
 }
예제 #20
0
 public function executeUpdateAjaxCompanion(sfWebRequest $request)
 {
     #security
     if (!$this->getUser()->hasCredential(array('Administrator', 'Staff', 'Coordinator'), false)) {
         $this->getUser()->setFlash("warning", 'You don\'t have permission to access this url ' . $request->getReferer());
         $this->redirect('dashboard/index');
     }
     # id parameter is companion id which then edits
     if ($request->hasParameter('id')) {
         $cmp = CompanionPeer::retrieveByPK($request->getParameter('id'));
         $this->forward404Unless($cmp);
     } else {
         #new companion adding to existing passenger
         $cmpnnPid = $request->getParameter('campnn[passenger_id]');
         $cmp = new Companion();
         if (isset($cmpnnPid)) {
             $cmp->setPassengerId($cmpnnPid);
         } else {
             $cmp->setPassengerId($request->getParameter('passenger_id'));
         }
     }
     $this->itId = $request->getParameter('itId');
     #referer
     if ($request->hasParameter('referer')) {
         $this->referer = $request->getParameter('referer');
     } else {
         $this->referer = $request->getReferer() ? $request->getReferer() : $this->generateUrl('companion', array(), true);
     }
     $form = new CompanionForm($cmp);
     if ($request->getParameter('back')) {
         $this->back = $request->getParameter('back');
     }
     # validate and save
     if ($request->isMethod('post')) {
         $form->bind($request->getParameter($form->getName()));
         if ($form->isValid()) {
             $is_new = $form->isNew();
             if ($is_new) {
                 $person = new Person();
                 $names = explode(" ", $form->getValue('name'));
                 $person->setFirstName($names[0]);
                 if (isset($names[1])) {
                     $person->setLastName($names[1]);
                 } else {
                     $person->setLastName(NULL);
                 }
                 $person->setDayPhone($form->getValue('companion_phone'));
                 $person->setDayComment($form->getValue('companion_phone_comment'));
                 $person->save();
                 $comp = $form->getObject();
                 $comp->setName($form->getValue('name'));
                 $comp->setRelationship($form->getValue('relationship'));
                 $comp->setDateOfBirth($form->getValue('date_of_birth'));
                 $comp->setWeight($form->getValue('weight'));
                 $comp->setCompanionPhone($form->getValue('companion_phone'));
                 $comp->setCompanionPhoneComment($form->getValue('companion_phone_comment'));
                 $comp->setPersonId($person->getId());
                 $comp->save();
             } else {
                 $form->save();
             }
             $this->getUser()->setFlash('success', 'Companion has successfully ' . ($is_new ? 'created' : 'saved') . '!');
             $this->companion_saved = $form->getValue('name');
             $this->companion_id = $comp->getId();
             $this->relationship = $form->getValue('relationship');
         }
     }
     $passenger = $cmp->getPassenger();
     $this->forward404Unless($passenger);
     $this->passenger = $passenger;
     $this->form_a = $form;
     $this->cmp = $cmp;
 }