예제 #1
0
function create_ecp_PaymentMethod()
{
    $uniqueValue = get_unique_value();
    $merchantAccountId = 'account-' . $uniqueValue;
    $merchantPaymentMethodId = 'pm-' . $uniqueValue;
    $email = get_unique_value() . '@nomail.com';
    $successUrl = 'http://good.com/';
    //need a trailing slash
    $errorUrl = 'http://bad.com/';
    //need a trailing slash
    $name = 'John Vindicia';
    $addr1 = '303 Twin Dolphin Drive';
    $city = 'Redwood City';
    $district = 'CA';
    $postalCode = '94065';
    $country = 'US';
    $address = new Address();
    $address->setName($name);
    $address->setAddr1($addr1);
    $address->setCity($city);
    $address->setDistrict($district);
    $address->setPostalCode($postalCode);
    $address->setCountry($country);
    $paymentmethod = new PaymentMethod();
    $paymentmethod->setType('ECP');
    $paymentmethod->setAccountHolderName($name);
    $paymentmethod->setBillingAddress($address);
    $paymentmethod->setMerchantPaymentMethodId($merchantPaymentMethodId);
    $paymentmethod->setCurrency('USD');
    $ecp = new ECP();
    $ecp->setAccount('495958930');
    $ecp->setRoutingNumber('611111111');
    $ecp->setAllowedTransactionType('Inbound');
    $ecp->setAccountType('ConsumerChecking');
    $paymentmethod->setECP($ecp);
    $account = new Account();
    $account->setMerchantAccountId($merchantAccountId);
    $account->setEmailAddress($email);
    $account->setShippingAddress($address);
    $account->setEmailTypePreference('html');
    $account->setName($name);
    $account->setPaymentMethods(array($paymentmethod));
    return $account;
}
function create_paypal_PaymentMethod()
{
    $uniqueValue = get_unique_value();
    $merchantAccountId = 'account-' . $uniqueValue;
    $merchantPaymentMethodId = 'pm-' . $uniqueValue;
    $email = get_unique_value() . '@nomail.com';
    $successUrl = 'http://good.com/';
    //need a trailing slash
    $errorUrl = 'http://bad.com/';
    //need a trailing slash
    $name = 'John Vindicia';
    $addr1 = '303 Twin Dolphin Drive';
    $city = 'Redwood City';
    $district = 'CA';
    $postalCode = '94065';
    $country = 'US';
    $address = new Address();
    $address->setName($name);
    $address->setAddr1($addr1);
    $address->setCity($city);
    $address->setDistrict($district);
    $address->setPostalCode($postalCode);
    $address->setCountry($country);
    $paymentmethod = new PaymentMethod();
    $paymentmethod->setType('PayPal');
    $paymentmethod->setAccountHolderName($name);
    $paymentmethod->setBillingAddress($address);
    $paymentmethod->setMerchantPaymentMethodId($merchantPaymentMethodId);
    $paymentmethod->setCurrency('USD');
    $paypal = new PayPal();
    $paypal->setReturnUrl($successUrl);
    $paypal->setCancelUrl($errorUrl);
    $paymentmethod->setPaypal($paypal);
    $account = new Account();
    $account->setMerchantAccountId($merchantAccountId);
    $account->setEmailAddress($email);
    $account->setShippingAddress($address);
    $account->setEmailTypePreference('html');
    $account->setName($name);
    //$account->setPaymentMethods(array($paymentmethod));
    //return $account;
    return array('account' => $account, 'paymentmethod' => $paymentmethod);
}
예제 #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");
 }
require_once 'Vindicia/Soap/Vindicia.php';
require_once 'Vindicia/Soap/Const.php';
$parentID = $argv[1];
print "parent: {$parentID} \n";
$name = "Child One";
$addr1 = "19 Davis Dr";
$city = "Belmont";
$state = "CA";
$postalcode = "94002";
$country = "US";
$email = "childAccount" . rand(10000, 99999) . "@vindicia.com";
$address = new Address();
$address->setName($name);
$address->setAddr1($addr1);
$address->setCity($city);
$address->setDistrict($state);
$address->setPostalCode($postalcode);
$address->setCountry($country);
$accountID = "childAccount" . rand(1000, 9999) . "-" . rand(1000, 999999);
$child1 = new Account();
$child1->setMerchantAccountId($accountID);
$child1->setEmailAddress($email);
$child1->setShippingAddress($address);
$child1->setEmailTypePreference('html');
$child1->setWarnBeforeAutoBilling(false);
$child1->setName($name);
$parent = new Account();
$parent->setMerchantAccountId($parentID);
// use the force flag to remove these children from a previous parent
// and assign them to this new one
//$force=true;
예제 #5
0
 function Main()
 {
     switch ($this->formArray["formAction"]) {
         case "edit":
             $CompanyDetails = new SoapObject(NCCBIZ . "CompanyDetails.php", "urn:Object");
             if (!($xmlStr = $CompanyDetails->getCompanyDetails($this->formArray["companyID"]))) {
                 $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 {
                     $company = new Company();
                     $company->parseDomDocument($domDoc);
                     $this->formArray["companyID"] = $company->getCompanyID();
                     $this->formArray["companyName"] = $company->getCompanyName();
                     $this->formArray["tin"] = $company->getTin();
                     $this->formArray["telephone"] = $company->getTelephone();
                     $this->formArray["fax"] = $company->getFax();
                     $address = $company->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["email"] = $company->getEmail();
                     $this->formArray["website"] = $company->getWebsite();
                 }
             }
             break;
         case "save":
             $CompanyEncode = new SoapObject(NCCBIZ . "CompanyEncode.php", "urn:Object");
             if ($this->formArray["companyID"] != "") {
                 $CompanyDetails = new SoapObject(NCCBIZ . "CompanyDetails.php", "urn:Object");
                 if (!($xmlStr = $CompanyDetails->getCompanyDetails($this->formArray["companyID"]))) {
                     $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 {
                         $company = new Company();
                         $company->parseDomDocument($domDoc);
                         $address = $company->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();
                         }
                         //$company->selectRecord($this->formArray["companyID"]);
                         $company->setCompanyID($this->formArray["companyID"]);
                         $company->setCompanyName($this->formArray["companyName"]);
                         $company->setTin($this->formArray["tin"]);
                         $company->setTelephone($this->formArray["telephone"]);
                         $company->setFax($this->formArray["fax"]);
                         $company->setAddressArray($address);
                         $company->setEmail($this->formArray["email"]);
                         $company->setWebsite($this->formArray["website"]);
                         $company->setDomDocument();
                         $doc = $company->getDomDocument();
                         $xmlStr = $doc->dump_mem(true);
                         if (!($ret = $CompanyEncode->updateCompany($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();
                 $company = new Company();
                 $company->setCompanyID($this->formArray["companyID"]);
                 $company->setCompanyName($this->formArray["companyName"]);
                 $company->setTelephone($this->formArray["telephone"]);
                 $company->setFax($this->formArray["fax"]);
                 $company->setTin($this->formArray["tin"]);
                 $company->setAddressArray($address);
                 $company->setEmail($this->formArray["email"]);
                 $company->setWebsite($this->formArray["website"]);
                 $company->setDomDocument();
                 $doc = $company->getDomDocument();
                 $xmlStr = $doc->dump_mem(true);
                 if (!($ret = $CompanyEncode->saveCompany($xmlStr, $this->formArray["ownerID"]))) {
                     exit("error save");
                 }
             }
             $this->formArray["companyID"] = $ret;
             //echo $ret;
             //}
             header("location: CompanyClose.php?parentURL=" . urlencode($this->formArray["parentURL"]));
             exit;
             //*/
             //else echo "tumpak!";
             break;
         case "cancel":
             header("location: CompanyList.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", "companyID", "companyIDBlock");
             $this->tpl->set_var("companyIDBlock", "");
             $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");
 }
예제 #6
0
파일: PlaceTest.php 프로젝트: EHER/chegamos
 public function testPopulate()
 {
     $subCategory = new Subcategory();
     $subCategory->setId(1234);
     $subCategory->setName("Self Service");
     $category = new Category();
     $category->setId(12);
     $category->setName("Restaurantes");
     $category->setSubCategory($subCategory);
     $city = new City();
     $city->setCountry("Brasil");
     $city->setState("SP");
     $city->setName("São Paulo");
     $address = new Address();
     $address->setCity($city);
     $address->setComplement("1 Andar");
     $address->setDistrict("Vila Olímpia");
     $address->setNumber("129");
     $address->setStreet("Rua Funchal");
     $address->setZipcode("04551-069");
     $gasStation = new GasStation(array('price_gas' => 1, 23, 'price_vodka' => 23, 45));
     $placeInfo = new PlaceInfo();
     $placeInfo->setGasStation($gasStation);
     $data = new \stdClass();
     $data->id = 123;
     $data->name = "Chegamos!";
     $data->average_rating = 4;
     $data->review_count = 3;
     $data->category = $category;
     $data->subcategory = $subCategory;
     $data->address = $address;
     $data->point->lat = "-23.529366";
     $data->point->lng = "-47.467117";
     $data->main_url = "http://chegamos.com/";
     $data->other_url = "http://chegamos.com.br/";
     $data->icon_url = "http://chegamos.com/img/icon.png";
     $data->description = "Description";
     $data->created = "01/12/2010 16:19";
     $data->phone = "11 2222-3333";
     $data->extended = $placeInfo;
     $data->num_visitors = 1024;
     $data->num_photos = 5;
     $this->object->populate($data);
     $this->assertEquals(123, $this->object->getId());
     $this->assertEquals("Chegamos!", $this->object->getName());
     $this->assertEquals(4, $this->object->getAverageRating());
     $this->assertEquals("Bom", $this->object->getAverageRatingString());
     $this->assertEquals(3, $this->object->getReviewCount());
     $this->assertEquals("app\\models\\Category", \get_class((object) $this->object->getCategory()));
     $this->assertEquals("Restaurantes - Self Service", (string) $this->object->getCategory());
     $this->assertEquals("app\\models\\Address", \get_class((object) $this->object->getAddress()));
     $this->assertEquals("Rua Funchal, 129 - Vila Olímpia<br/>São Paulo - SP", (string) $this->object->getAddress());
     $this->assertEquals("-23.529366,-47.467117", (string) $this->object->getPoint());
     $this->assertEquals("http://chegamos.com/", $this->object->getMainUrl());
     $this->assertEquals("http://chegamos.com.br/", $this->object->getOtherUrl());
     $this->assertEquals("http://chegamos.com/img/icon.png", $this->object->getIconUrl());
     $this->assertEquals("Description", $this->object->getDescription());
     $this->assertEquals("01/12/2010 16:19", $this->object->getCreated());
     $this->assertEquals("11 2222-3333", $this->object->getPhone());
     $this->assertEquals("app\\models\\PlaceInfo", \get_class((object) $this->object->getPlaceInfo()));
     $this->assertEquals(1024, $this->object->getNumVisitors());
     $this->assertEquals(5, $this->object->getNumPhotos());
 }
예제 #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
파일: testparse.php 프로젝트: armic/erpts
//*
$address = new Address();
//$address->setAddressID(124);
$address->setNumber("xunit 2415 Megaplaza Building");
$address->setStreet("xADB Avenue corner Garnett Street");
$address->setBarangay("xBarangay San Antonio");
$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("*****@*****.**");
예제 #9
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");
 }
 /**
  * Sets the shipping address for this payment request
  * @param String $postalCode
  * @param String $street
  * @param String $number
  * @param String $complement
  * @param String $district
  * @param String $city
  * @param String $state
  * @param String $country
  */
 public function setShippingAddress($postalCode = null, $street = null, $number = null, $complement = null, $district = null, $city = null, $state = null, $country = null)
 {
     $param = $postalCode;
     if ($this->shipping == null) {
         $this->shipping = new Shipping();
     }
     if (is_array($param)) {
         $this->shipping->setAddress(new Address($param));
     } elseif ($param instanceof Address) {
         $this->shipping->setAddress($param);
     } else {
         $address = new Address();
         $address->setPostalCode($postalCode);
         $address->setStreet($street);
         $address->setNumber($number);
         $address->setComplement($complement);
         $address->setDistrict($district);
         $address->setCity($city);
         $address->setState($state);
         $address->setCountry($country);
         $this->shipping->setAddress($address);
     }
 }
예제 #11
0
 public static function getAddresses($where = null)
 {
     $dados = Database::ReadAll("address a, city c, state s", "a.*, c.*, s.*", "WHERE a.id_city = c.id_city AND s.id_state = c.id_state " . $where);
     if (!$dados) {
         return '';
     }
     foreach ($dados as $dado) {
         $address = new Address();
         $address->setId($dado['ID_ADDRESS']);
         $address->setStreet($dado['NAME_ADDRESS']);
         $address->setNumber($dado['NUMBER']);
         $address->setComplement($dado['COMPLEMENT']);
         $address->setDistrict($dado['DISTRICT']);
         $address->setLatitude($dados['LATITUDE']);
         $address->setLongitude($dados['LONGITUDE']);
         $address->setCity($dado['NAME_CITY']);
         $address->setState($dado['INITIALS']);
         $address->setPs($dado['PS']);
         $addresses[] = $address;
     }
     return $addresses;
 }
 public static function readTransaction($str_xml)
 {
     // Parser
     $parser = new xmlParser($str_xml);
     // <transaction>
     $data = $parser->getResult('transaction');
     $transaction = new Transaction();
     // <transaction> <lastEventDate>
     if (isset($data["lastEventDate"])) {
         $transaction->setLastEventDate($data["lastEventDate"]);
     }
     // <transaction> <date>
     if (isset($data["date"])) {
         $transaction->setDate($data["date"]);
     }
     // <transaction> <code>
     if (isset($data["code"])) {
         $transaction->setCode($data["code"]);
     }
     // <transaction> <reference>
     if (isset($data["reference"])) {
         $transaction->setReference($data["reference"]);
     }
     // <transaction> <type>
     if (isset($data["type"])) {
         $transaction->setType(new TransactionType($data["type"]));
     }
     // <transaction> <status>
     if (isset($data["status"])) {
         $transaction->setStatus(new TransactionStatus($data["status"]));
     }
     if (isset($data["paymentMethod"]) && is_array($data["paymentMethod"])) {
         // <transaction> <paymentMethod>
         $paymentMethod = new PaymentMethod();
         // <transaction> <paymentMethod> <type>
         if (isset($data["paymentMethod"]['type'])) {
             $paymentMethod->setType(new PaymentMethodType($data["paymentMethod"]['type']));
         }
         // <transaction> <paymentMethod> <code>
         if (isset($data["paymentMethod"]['code'])) {
             $paymentMethod->setCode(new PaymentMethodCode($data["paymentMethod"]['code']));
         }
         $transaction->setPaymentMethod($paymentMethod);
     }
     // <transaction> <grossAmount>
     if (isset($data["grossAmount"])) {
         $transaction->setGrossAmount($data["grossAmount"]);
     }
     // <transaction> <discountAmount>
     if (isset($data["discountAmount"])) {
         $transaction->setDiscountAmount($data["discountAmount"]);
     }
     // <transaction> <feeAmount>
     if (isset($data["feeAmount"])) {
         $transaction->setFeeAmount($data["feeAmount"]);
     }
     // <transaction> <netAmount>
     if (isset($data["netAmount"])) {
         $transaction->setNetAmount($data["netAmount"]);
     }
     // <transaction> <extraAmount>
     if (isset($data["extraAmount"])) {
         $transaction->setExtraAmount($data["extraAmount"]);
     }
     // <transaction> <installmentCount>
     if (isset($data["installmentCount"])) {
         $transaction->setInstallmentCount($data["installmentCount"]);
     }
     if (isset($data["items"]['item']) && is_array($data["items"]['item'])) {
         $items = array();
         $i = 0;
         if (isset($data["items"]['item'][0])) {
             foreach ($data["items"]['item'] as $key => $value) {
                 $item = self::parseTransactionItem($value);
                 $items[$i] = $item;
                 $i++;
             }
         } else {
             $items[0] = self::parseTransactionItem($data["items"]['item']);
         }
         // <transaction> <items>
         $transaction->setItems($items);
     }
     if (isset($data["sender"])) {
         // <transaction> <sender>
         $sender = new Sender();
         // <transaction> <sender> <name>
         if (isset($data["sender"]["name"])) {
             $sender->setName($data["sender"]["name"]);
         }
         // <transaction> <sender> <email>
         if (isset($data["sender"]["email"])) {
             $sender->setEmail($data["sender"]["email"]);
         }
         if (isset($data["sender"]["phone"])) {
             // <transaction> <sender> <phone>
             $phone = new Phone();
             // <transaction> <sender> <phone> <areaCode>
             if (isset($data["sender"]["phone"]["areaCode"])) {
                 $phone->setAreaCode($data["sender"]["phone"]["areaCode"]);
             }
             // <transaction> <sender> <phone> <number>
             if (isset($data["sender"]["phone"]["number"])) {
                 $phone->setNumber($data["sender"]["phone"]["number"]);
             }
             $sender->setPhone($phone);
         }
         $transaction->setSender($sender);
     }
     if (isset($data["shipping"]) && is_array($data["shipping"])) {
         // <transaction> <shipping>
         $shipping = new Shipping();
         // <transaction> <shipping> <type>
         if (isset($data["shipping"]["type"])) {
             $shipping->setType(new ShippingType($data["shipping"]["type"]));
         }
         // <transaction> <shipping> <cost>
         if (isset($data["shipping"]["cost"])) {
             $shipping->setCost($data["shipping"]["cost"]);
         }
         if (isset($data["shipping"]["address"]) && is_array($data["shipping"]["address"])) {
             // <transaction> <shipping> <address>
             $address = new Address();
             // <transaction> <shipping> <address> <street>
             if (isset($data["shipping"]["address"]["street"])) {
                 $address->setStreet($data["shipping"]["address"]["street"]);
             }
             // <transaction> <shipping> <address> <number>
             if (isset($data["shipping"]["address"]["number"])) {
                 $address->setNumber($data["shipping"]["address"]["number"]);
             }
             // <transaction> <shipping> <address> <complement>
             if (isset($data["shipping"]["address"]["complement"])) {
                 $address->setComplement($data["shipping"]["address"]["complement"]);
             }
             // <transaction> <shipping> <address> <city>
             if (isset($data["shipping"]["address"]["city"])) {
                 $address->setCity($data["shipping"]["address"]["city"]);
             }
             // <transaction> <shipping> <address> <state>
             if (isset($data["shipping"]["address"]["state"])) {
                 $address->setState($data["shipping"]["address"]["state"]);
             }
             // <transaction> <shipping> <address> <district>
             if (isset($data["shipping"]["address"]["district"])) {
                 $address->setDistrict($data["shipping"]["address"]["district"]);
             }
             // <transaction> <shipping> <address> <postalCode>
             if (isset($data["shipping"]["address"]["postalCode"])) {
                 $address->setPostalCode($data["shipping"]["address"]["postalCode"]);
             }
             // <transaction> <shipping> <address> <country>
             if (isset($data["shipping"]["address"]["country"])) {
                 $address->setCountry($data["shipping"]["address"]["country"]);
             }
             $shipping->setAddress($address);
         }
         // <transaction> <shipping>
         $transaction->setShipping($shipping);
     }
     return $transaction;
 }
예제 #13
0
 function main()
 {
     switch ($this->formArray["formAction"]) {
         case "clear":
             $this->tpl->set_var("myAssessorId", "");
             $this->tpl->set_var("myPersonId", "");
             $this->tpl->set_var("myLastName", "");
             $this->tpl->set_var("myFirstName", "");
             $this->tpl->set_var("myMiddleName", "");
             $this->tpl->set_var("myPosition", "");
             $this->tpl->set_var("myGender", "");
             $this->tpl->set_var("myBirthday", "");
             $this->tpl->set_var("myMaritalStatus", "");
             $this->tpl->set_var("myTin", "");
             $this->tpl->set_var("myAddressID", "");
             $this->tpl->set_var("myNumber", "");
             $this->tpl->set_var("myStreet", "");
             $this->tpl->set_var("myBarangay", "");
             $this->tpl->set_var("myDistrict", "");
             $this->tpl->set_var("myMunicipalityCity", "");
             $this->tpl->set_var("myProvince", "");
             $this->tpl->set_var("myTelephone", "");
             $this->tpl->set_var("myMobileNumber", "");
             $this->tpl->set_var("myEmail", "");
             $this->tpl->set_var("myPosition", "");
             $this->tpl->set_block("testAssessorTemplate", "myXMLentries");
             $this->tpl->set_var("myXMLentries", "");
             $this->tpl->set_var("myXML", "");
             break;
         case "submit":
             $this->assessorDude->setAssessorID($this->formArray["myAssessorId"]);
             $this->assessorDude->setPersonID($this->formArray["myPersonId"]);
             $this->assessorDude->setLastName($this->formArray["myLastName"]);
             $this->assessorDude->setFirstName($this->formArray["myFirstName"]);
             $this->assessorDude->setMiddleName($this->formArray["myMiddleName"]);
             $this->assessorDude->setPosition($this->formArray["myPosition"]);
             $this->assessorDude->setGender($this->formArray["myGender"]);
             $this->assessorDude->setBirthday($this->formArray["myBirthday"]);
             $this->assessorDude->setMaritalStatus($this->formArray["myMaritalStatus"]);
             $this->assessorDude->setTin($this->formArray["myTin"]);
             $myAddress = new Address();
             $myAddress->setAddressID($this->formArray["myAddressID"]);
             $myAddress->setNumber($this->formArray["myNumber"]);
             $myAddress->setStreet($this->formArray["myStreet"]);
             $myAddress->setBarangay($this->formArray["myBarangay"]);
             $myAddress->setDistrict($this->formArray["myDistrict"]);
             $myAddress->setMunicipalityCity($this->formArray["myMunicipalityCity"]);
             $myAddress->setProvince($this->formArray["myProvince"]);
             $this->assessorDude->setTelephone($this->formArray["myTelephone"]);
             $this->assessorDude->setMobileNumber($this->formArray["myMobileNumber"]);
             $this->assessorDude->setEmail($this->formArray["myEmail"]);
             $this->assessorDude->setPosition($this->formArray["myPosition"]);
             $myAddress->setDomDocument();
             $this->assessorDude->setAddressArray($myAddress);
             $this->assessorDude->setDomDocument();
             $domObj = $this->assessorDude->getDomDocument();
             $assessorDudeInfo = $this->parseMyDom($domObj);
             $this->tpl->set_var("myAssessorId", $this->formArray["myAssessorId"]);
             $this->tpl->set_var("myPersonId", $this->formArray["myPersonId"]);
             $this->tpl->set_var("myLastName", $this->formArray["myLastName"]);
             $this->tpl->set_var("myFirstName", $this->formArray["myFirstName"]);
             $this->tpl->set_var("myMiddleName", $this->formArray["myMiddleName"]);
             $this->tpl->set_var("myPosition", $this->formArray["myPosition"]);
             $this->tpl->set_var("myGender", $this->formArray["myGender"]);
             $this->tpl->set_var("myBirthday", $this->formArray["myBirthday"]);
             $this->tpl->set_var("myMaritalStatus", $this->formArray["myMaritalStatus"]);
             $this->tpl->set_var("myTin", $this->formArray["myTin"]);
             $this->tpl->set_var("myAddressID", $this->formArray["myAddressID"]);
             $this->tpl->set_var("myNumber", $this->formArray["myNumber"]);
             $this->tpl->set_var("myStreet", $this->formArray["myStreet"]);
             $this->tpl->set_var("myBarangay", $this->formArray["myBarangay"]);
             $this->tpl->set_var("myDistrict", $this->formArray["myDistrict"]);
             $this->tpl->set_var("myMunicipalityCity", $this->formArray["myMunicipalityCity"]);
             $this->tpl->set_var("myProvince", $this->formArray["myProvince"]);
             $this->tpl->set_var("myTelephone", $this->formArray["myTelephone"]);
             $this->tpl->set_var("myMobileNumber", $this->formArray["myMobileNumber"]);
             $this->tpl->set_var("myEmail", $this->formArray["myEmail"]);
             $this->tpl->set_var("myPosition", $this->formArray["myPosition"]);
             $this->tpl->set_block("testAssessorTemplate", "myXMLentries");
             $this->tpl->set_var("myParsedXML", "" . $assessorDudeInfo . "" . $myAddressString . "");
             $this->tpl->set_var("myXML", htmlentities($domObj->dump_mem(true)));
             break;
         default:
             $this->tpl->set_var("myAssessorId", "fill in the blank");
             $this->tpl->set_var("myPersonId", "fill in the blank");
             $this->tpl->set_var("myLastName", "fill in the blank");
             $this->tpl->set_var("myFirstName", "fill in the blank");
             $this->tpl->set_var("myMiddleName", "fill in the blank");
             $this->tpl->set_var("myPosition", "fill in the blank");
             $this->tpl->set_var("myGender", "fill in the blank");
             $this->tpl->set_var("myBirthday", "fill in the blank");
             $this->tpl->set_var("myMaritalStatus", "fill in the blank");
             $this->tpl->set_var("myTin", "fill in the blank");
             $this->tpl->set_var("myAddressID", "fill in the blank");
             $this->tpl->set_var("myNumber", "fill in the blank");
             $this->tpl->set_var("myStreet", "fill in the blank");
             $this->tpl->set_var("myBarangay", "fill in the blank");
             $this->tpl->set_var("myDistrict", "fill in the blank");
             $this->tpl->set_var("myMunicipalityCity", "fill in the blank");
             $this->tpl->set_var("myProvince", "fill in the blank");
             $this->tpl->set_var("myTelephone", "fill in the blank");
             $this->tpl->set_var("myMobileNumber", "fill in the blank");
             $this->tpl->set_var("myEmail", "fill in the blank");
             $this->tpl->set_var("myPosition", "fill in the blank");
             $this->tpl->set_block("testAssessorTemplate", "myXMLentries");
             $this->tpl->set_var("myXMLentries", "");
             $this->tpl->set_var("myXML", "");
     }
     $this->tpl->parse("PrinttestAssessorTemplate", "testAssessorTemplate");
     $this->tpl->finish("PrinttestAssessorTemplate");
     $this->tpl->p("PrinttestAssessorTemplate");
 }
예제 #14
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");
 }
예제 #15
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");
 }
function CreateAccount($merchantAccountId, $email)
{
    $account = new Account();
    $account->setName('Migrated Customer');
    $account->setMerchantAccountId($merchantAccountId);
    // Be conscious that using real email addresses in ProdTest depending on configuration will
    // have live emails triggered and sent on billing events for the Account.
    // It is recommended that when testing in ProdTest be certain to mask real email addresses.
    $account->setEmailAddress($email);
    $account->setEmailTypePreference('html');
    $account->setWarnBeforeAutoBilling(true);
    $anyOtherHelpfulDataForCSRsWhenLookingUpAccount = new NameValuePair();
    $anyOtherHelpfulDataForCSRsWhenLookingUpAccount->setName('HelpfulData');
    $anyOtherHelpfulDataForCSRsWhenLookingUpAccount->setValue('BestCustomerEver');
    $account->setNameValues(array($anyOtherHelpfulDataForCSRsWhenLookingUpAccount));
    $address = new Address();
    $address->setAddr1('303 Twin Dolphin Drive');
    $address->setAddr2('Suite 200');
    $address->setCity('Redwood City');
    $address->setDistrict('CA');
    $address->setPostalCode('94065');
    $address->setCountry('US');
    $address->setPhone('123-456-7890');
    $srd = '';
    $account->setShippingAddress($address);
    $response = $account->update($srd);
    // Log soap id for each API call.
    //    $log->addDebug('Method = Account.update' . PHP_EOL);
    //    $log->addDebug('Soap Id = ' . $response['data']->return->soapId . PHP_EOL);
    //    $log->addDebug('Return Code = ' . $response['returnCode'] . PHP_EOL);
    //    $log->addDebug('Return String = ' . $response['returnString'] . PHP_EOL);
    if ($response['returnCode'] == 200) {
        print "Call succeeded" . PHP_EOL;
    } else {
        print "Call failed" . PHP_EOL;
        print_r($response);
    }
}
$txItem1->setName('Premium Pay-per-view movie (English)');
$txItem1->setPrice(5.99);
$txItem1->setQuantity(1);
$txItem1->setTaxClassification('DM030000');
$txItem1->setCampaignCode('PPV2015US');
$txItem2 = new TransactionItem();
$txItem2->setSku('smAccess2015');
$txItem2->setName('Social Media Chat Access');
$txItem2->setPrice(2.0);
$txItem2->setQuantity(1);
$txItem2->setTaxClassification('D0000000');
$tx->setTransactionItems(array($txItem1, $txItem2));
$addr = new Address();
$addr->setAddr1('809 Cuesta Dr');
$addr->setCity('Mountain View');
$addr->setDistrict('CA');
$addr->setPostalCode('94040');
$addr->setCountry('US');
$tx->setShippingAddress($addr);
// for tax calculation purposes
$response = $tx->auth(100, false, null, true);
// dry run
if ($response['returnCode'] == 200) {
    print "Successfully dry ran transaction. Call SOAP ID" . $response['data']->return->soapId . "\n";
    // Present order summary to the customer
    $retTx = $response['data']->transaction;
    $orderTotal = $retTx->getAmount();
    $orderCurrency = $retTx->getCurrency();
    // iterate over line items to get discounts and taxes
    $retTxItems = $retTx->getTransactionItems();
    foreach ($retTxItems as $retTxItem) {