<?php //header('Content-type:application/json; charset=utf-8'); include "programManager.php"; include "db_util.php"; include "DAO/AddressDAO.php"; include "DAO/StateDAO.php"; include "DTO/AddressDTO.php"; include "DTO/StateDTO.php"; include 'DTO/ResultDTO.php'; //include 'DTO/BaseDTO.php'; $data_back = json_decode(file_get_contents('php://input')); $address_id = $data_back->{"address_id"}; $progrManager = new programManager(); $progrManager->openConn(); $progrManager->updateAddr($address_id); $progrManager->closeConn(); //$con = db_connect(); //$result = getAddress($con, $address_id); //$json = json_encode($result); //echo $json; //db_close($con);
include "DTO/PersonDTO.php"; include "DAO/PersonDAO.php"; include "DTO/PhoneDTO.php"; include "DAO/PhoneDAO.php"; include "DAO/AddressDAO.php"; include "DTO/AddressDTO.php"; include "DAO/StateDAO.php"; include "DTO/StateDTO.php"; include 'DTO/ResultDTO.php'; $data_back = json_decode(file_get_contents('php://input')); $phone = $data_back->{"phoneDTO"}; $address = $data_back->{"addrDTO"}; $phone_number = $phone->{"phone_number"}; $phone_type_id = $phone->{"phone_type_id"}; $phone_id = $phone->{"phone_id"}; $phone_type = $phone->{"phone_type"}; $f_name = $data_back->{"f_name"}; $l_name = $data_back->{"l_name"}; $email_addr = $data_back->{"email_addr"}; $person_id = $data_back->{"person_id"}; $street1 = $address->{"street1"}; $street2 = $address->{"street2"}; $city = $address->{"city"}; $state_id = $address->{"state_id"}; $zip = $address->{"zip"}; $address_id = $address->{"address_id"}; $tempPhoneDTO = PhoneDAO::getPhoneDTO($phone_id, $person_id, $phone_type_id, $phone_number, $phone_type); $tempAddressDTO = AddressDAO::getAddressDTO($street1, $street2, $city, $state_id, $zip, $address_id, $person_id); $tempPersonDTO = PersonDAO::getPersonDTO($person_id, $l_name, $f_name, $email_addr, $tempPhoneDTO, $tempAddressDTO); $progrManager = new programManager(); $progrManager->updatePersonRecord($tempPersonDTO);
$l_name = $data_back->{"lname"}; $email_addr = $data_back->{"email"}; $street1 = $address->{"street1"}; $street2 = $address->{"street2"}; $city = $address->{"city"}; $state_id = $address->{"state_id"}; $zip = $address->{"zip"}; */ //$address_id = ""; //$person_id = ""; //$phone_id = ""; //$phone_type = ""; //$phoneDTO = PhoneDAO::getPhoneDTO($phone_id, $person_id, $phone_type_id, $phone_number, $phone_type); //$addressDTO = AddressDAO::getAddressDTO($street1, $street2, $city, $state_id, $zip, $address_id, $person_id); //$personDTO = PersonDAO::getPersonDTO($person_id, $l_name, $f_name, $email_addr, $phoneDTO, $addressDTO); $person_json = json_decode(file_get_contents('php://input')); $phone_json = $person_json->{"phone"}; $address_json = $person_json->{"address"}; $phoneDTO = PhoneDTO::hidrateSelf($phone_json); $addressDTO = AddressDTO::hidrateSelf($address_json); $personDTO = PersonDTO::hidrateSelf($person_json); if (!empty($phoneDTO)) { $personDTO->setPhoneDTO($phoneDTO); } if (!empty($addressDTO)) { $personDTO->setAddrDTO($addressDTO); } $progrManager = new programManager(); $return = $progrManager->createPerson($personDTO); $json = json_encode($return); echo $json;
<?php require_once "../programManager.php"; require_once "../db_util.php"; require_once "../DTO/PersonDTO.php"; require_once "../DAO/PersonDAO.php"; require_once "../DTO/PhoneDTO.php"; require_once "../DAO/PhoneDAO.php"; require_once "../DAO/AddressDAO.php"; require_once "../DTO/AddressDTO.php"; require_once "../DAO/StateDAO.php"; require_once "../DTO/StateDTO.php"; require_once '../DTO/ResultDTO.php'; require_once '../DTO/PersonsDTO.php'; // get data from the front end $data_back = json_decode(file_get_contents('php://input')); $person_id = $data_back->{"person_id"}; // pass data to program manager $progrManager = new programManager(); $personDTO = $progrManager->loadOnePerson($person_id); // encode data and pass back to front end $json = json_encode($personDTO); echo $json;
<?php require_once "../programManager.php"; require_once "../db_util.php"; require_once "../DTO/PersonDTO.php"; require_once "../DAO/PersonDAO.php"; require_once "../DTO/PhoneDTO.php"; require_once "../DAO/PhoneDAO.php"; require_once "../DAO/AddressDAO.php"; require_once "../DTO/AddressDTO.php"; require_once "../DAO/StateDAO.php"; require_once "../DTO/StateDTO.php"; require_once '../DTO/ResultDTO.php'; require_once '../DTO/PersonsDTO.php'; // get data from the front end $data_back = json_decode(file_get_contents('php://input')); $person_id = $data_back->{"person_id"}; // pass data to program manager $progrManager = new programManager(); $personsListDTO = $progrManager->loadPersonDetails($person_id); // encode data and pass back to front end $json = json_encode($personsListDTO); echo $json; ?>
<?php //header('Content-type:application/json; charset=utf-8'); include "programManager.php"; include "db_util.php"; include "DTO/PersonDTO.php"; include "DAO/PersonDAO.php"; include "DTO/PhoneDTO.php"; include "DAO/PhoneDAO.php"; include "DAO/AddressDAO.php"; include "DTO/AddressDTO.php"; include "DAO/StateDAO.php"; include "DTO/StateDTO.php"; include 'DTO/ResultDTO.php'; $person_id_list = $_GET['deleteId']; $person_id = explode(',', $person_id_list); $progrManager = new programManager(); $progrManager->deletePerson($person_id);
<?php include "programManager.php"; include "db_util.php"; include "DTO/PersonDTO.php"; include "DAO/PersonDAO.php"; include "DTO/PhoneDTO.php"; include "DAO/PhoneDAO.php"; include "DAO/AddressDAO.php"; include "DTO/AddressDTO.php"; include "DAO/StateDAO.php"; include "DTO/StateDTO.php"; include 'DTO/ResultDTO.php'; $progrManager = new programManager(); $progrManager->openConn(); $progrManager->getState(); $progrManager->closeConn();
<?php //header('Content-type:application/json; charset=utf-8'); include "programManager.php"; include "db_util.php"; include "DTO/AddressDTO.php"; include "DAO/AddressDAO.php"; include "DAO/StateDAO.php"; include "DTO/StateDTO.php"; include 'DTO/ResultDTO.php'; //include 'DTO/BaseDTO.php'; $data_back = json_decode(file_get_contents('php://input')); $street1 = $data_back->{"street1"}; $street2 = $data_back->{"street2"}; $city = $data_back->{"city"}; $state_id = $data_back->{"state"}; $zip = $data_back->{"zip"}; $address_id = " "; $tempAddressDTO = new AddressDTO($street1, $street2, $city, $state_id, $zip, $address_id); $progrManager = new programManager(); $progrManager->openConn(); $progrManager->createAddr($tempAddressDTO); $progrManager->closeConn();
<?php //header('Content-type:application/json; charset=utf-8'); include "programManager.php"; include "db_util.php"; include "DTO/PersonDTO.php"; include "DAO/PersonDAO.php"; include "DTO/PhoneDTO.php"; include "DAO/PhoneDAO.php"; include "DAO/AddressDAO.php"; include "DTO/AddressDTO.php"; include "DAO/StateDAO.php"; include "DTO/StateDTO.php"; include 'DTO/ResultDTO.php'; $data_back = json_decode(file_get_contents('php://input')); $person_id = $data_back->{"person_id"}; $progrManager = new programManager(); $progrManager->updatePerson($person_id);
<?php require_once "../programManager.php"; require_once "../db_util.php"; require_once "../DTO/PersonDTO.php"; require_once "../DAO/PersonDAO.php"; require_once "../DTO/PhoneDTO.php"; require_once "../DAO/PhoneDAO.php"; require_once "../DAO/AddressDAO.php"; require_once "../DTO/AddressDTO.php"; require_once "../DAO/StateDAO.php"; require_once "../DTO/StateDTO.php"; require_once '../DTO/ResultDTO.php'; require_once '../DTO/PersonsDTO.php'; // call program manager method $progrManager = new programManager(); $states = $progrManager->getStateList(); // encode data and pass back to front end $json = json_encode($states); echo $json;
<?php //header('Content-type: application/json'); include "programManager.php"; include "db_util.php"; include "DTO/PersonDTO.php"; include "DAO/PersonDAO.php"; include "DTO/PhoneDTO.php"; include "DAO/PhoneDAO.php"; include "DTO/AddressDTO.php"; include "DAO/AddressDAO.php"; include 'DTO/ResultDTO.php'; $progrManager = new programManager(); $personListDTO = $progrManager->readPerson(); $json = json_encode($personListDTO); echo $json;
<?php include "programManager.php"; include "db_util.php"; include "DTO/PersonDTO.php"; include "DAO/PersonDAO.php"; include "DTO/PhoneDTO.php"; include "DAO/PhoneDAO.php"; include 'DTO/ResultDTO.php'; $progrManager = new programManager(); $progrManager->openConn(); $progrManager->getPhoneTypes(); $progrManager->closeConn();
<?php //header('Content-type: application/json'); include "programManager.php"; include "db_util.php"; include "DAO/AddressDAO.php"; include "DAO/StateDAO.php"; include "DTO/AddressDTO.php"; include "DTO/StateDTO.php"; include 'DTO/ResultDTO.php'; //include 'DTO/BaseDTO.php'; $progrManager = new programManager(); $progrManager->openConn(); $progrManager->readAddr(); $progrManager->closeConn();
<?php require_once "../programManager.php"; require_once "../db_util.php"; require_once "../DTO/PersonDTO.php"; require_once "../DAO/PersonDAO.php"; require_once "../DTO/PhoneDTO.php"; require_once "../DAO/PhoneDAO.php"; require_once "../DAO/AddressDAO.php"; require_once "../DTO/AddressDTO.php"; require_once "../DAO/StateDAO.php"; require_once "../DTO/StateDTO.php"; require_once '../DTO/ResultDTO.php'; require_once '../DTO/PersonsDTO.php'; // call program manager method $progrManager = new programManager(); $personsListDTO = $progrManager->loadAllPersons(); // encode data and pass back to front end $json = json_encode($personsListDTO); echo $json;
<?php require_once "../programManager.php"; require_once "../db_util.php"; require_once "../DTO/PersonDTO.php"; require_once "../DAO/PersonDAO.php"; require_once "../DTO/PhoneDTO.php"; require_once "../DAO/PhoneDAO.php"; require_once "../DAO/AddressDAO.php"; require_once "../DTO/AddressDTO.php"; require_once "../DAO/StateDAO.php"; require_once "../DTO/StateDTO.php"; require_once '../DTO/ResultDTO.php'; require_once '../DTO/PersonsDTO.php'; // get data from the front end $person_id_list = $_GET['deleteId']; $person_id = explode(',', $person_id_list); // pass data to program manager $progrManager = new programManager(); $returnDTO = $progrManager->deletePerson($person_id); // encode data and pass back to front end $json = json_encode($returnDTO); echo $json;
<?php require_once "../programManager.php"; require_once "../db_util.php"; require_once "../DTO/PersonDTO.php"; require_once "../DAO/PersonDAO.php"; require_once "../DTO/PhoneDTO.php"; require_once "../DAO/PhoneDAO.php"; require_once "../DAO/AddressDAO.php"; require_once "../DTO/AddressDTO.php"; require_once "../DAO/StateDAO.php"; require_once "../DTO/StateDTO.php"; require_once '../DTO/ResultDTO.php'; require_once '../DTO/PersonsDTO.php'; // call program manager method $progrManager = new programManager(); $phoneTypeList = $progrManager->loadPhoneTypes(); // encode data and pass back to front end $json = json_encode($phoneTypeList); echo $json;
<?php //header('Content-type:application/json; charset=utf-8'); include "programManager.php"; include "db_util.php"; include "DAO/AddressDAO.php"; include "DAO/StateDAO.php"; include "DTO/AddressDTO.php"; include "DTO/StateDTO.php"; include 'DTO/ResultDTO.php'; //include 'DTO/BaseDTO.php'; $data_back = json_decode(file_get_contents('php://input')); $street1 = $data_back->{"street1"}; $street2 = $data_back->{"street2"}; $city = $data_back->{"city"}; $state_id = $data_back->{"state"}; $zip = $data_back->{"zip"}; $address_id = $data_back->{"address_id"}; $tempAddressDTO = new AddressDTO($street1, $street2, $city, $state_id, $zip, $address_id); $progrManager = new programManager(); $progrManager->openConn(); $progrManager->updateAddrRecord($tempAddressDTO); $progrManager->closeConn();
require_once "../db_util.php"; require_once "../DTO/PersonDTO.php"; require_once "../DAO/PersonDAO.php"; require_once "../DTO/PhoneDTO.php"; require_once "../DAO/PhoneDAO.php"; require_once "../DAO/AddressDAO.php"; require_once "../DTO/AddressDTO.php"; require_once "../DAO/StateDAO.php"; require_once "../DTO/StateDTO.php"; require_once '../DTO/ResultDTO.php'; require_once '../DTO/PersonsDTO.php'; // get data from the front end $person_json = json_decode(file_get_contents('php://input')); $phone_json = $person_json->{"phoneDTO"}; $address_json = $person_json->{"addrDTO"}; // create dtos $phoneDTO = PhoneDTO::hydrateSelf($phone_json); $addressDTO = AddressDTO::hydrateSelf($address_json); $personDTO = PersonDTO::hydrateSelf($person_json); if (!empty($phoneDTO)) { $personDTO->setPhoneDTO($phoneDTO); } if (!empty($addressDTO)) { $personDTO->setAddrDTO($addressDTO); } // pass data to program manager $progrManager = new programManager(); $returnDTO = $progrManager->updatePersonRecord($personDTO); // encode data and pass back to front end $json = json_encode($returnDTO); echo $json;