/** * This is construct base of the class. * * A public constructor; initializes the variable $instanceDataBase. * */ public function __construct($instanceDataBase) { parent::__construct($instanceDataBase); AssignPersonContact::setDataOperationBusiness($instanceDataBase); AssignPersonContact::getBusiness(); AssignPersonContact::getDescriptionBusiness(); }
<?php $action = 'LIST'; if (isset($_POST['ACTION'])) { $action = $_POST['ACTION']; } else { if (isset($_GET['ACTION'])) { $action = $_GET['ACTION']; } } $person = new Person($registry[$nameDataBase]); $contact = new Contact($registry[$nameDataBase]); $assContact = new AssignPersonContact($registry[$nameDataBase]); $assDoc = new AssignPersonIdentifyDoc($registry[$nameDataBase]); $assProf = new AssignPersonProfession($registry[$nameDataBase]); $direction = new Direction($registry[$nameDataBase]); $assDir = new AssignPersonDirection($registry[$nameDataBase]); $bill = new BillingData($registry[$nameDataBase]); switch ($action) { case 'INSERT': $transaction = new Transaction($registry[$nameDataBase]); Person::setDataOperationBusiness($registry[$nameDataBase]); $idTransaction = $transaction->insertTransaction(array(Person::$business, Person::$insert, Person::$descriptionBusiness)); //name,last_name,maternal_name,married_name,fk_id_gender,birthday,birth_city,country_birth,locality_birth,foto,ext_file_foto $ext_file_foto = null; $foto = null; if (is_uploaded_file($_FILES['EXT_FILE_PHOTO']['tmp_name'])) { $nombreDirectorio = "upload/person_img/"; $idUnico = time(); $nombreFichero = $idUnico . "_" . $_FILES['EXT_FILE_PHOTO']['name']; //movemos el archivo a la ruta especifica
$title_1 = $property["pages"]["security/person"]["NEW_TITLE"]; switch ($action) { case 'EDIT': $title_1 = $property["pages"]["security/person"]["EDIT_TITLE"]; break; case 'PREVIEW': $title_1 = $property["pages"]["security/person"]["PREVIEW_TITLE"]; break; default: break; } if ($action == 'PREVIEW' || $action == 'EDIT') { $person = new Person($registry[$nameDataBase]); $list = $person->getListPerson($_GET['PK_ID_PERSON']); $data = $list[0]; $cont = new AssignPersonContact($registry[$nameDataBase]); $contacts = $cont->getListAssingPersonContact($data['pk_id_person']); $assProf = new AssignPersonProfession($registry[$nameDataBase]); $profs = $assProf->getListAssingPersonProfession($data['pk_id_person']); $assDir = new AssignPersonDirection($registry[$nameDataBase]); $dirs = $assDir->getListAssingPersonDirection($data['pk_id_person']); $assDoc = new AssignPersonIdentifyDoc($registry[$nameDataBase]); $docs = $assDoc->getListAssingPersonIdentifyDoc($data['pk_id_person']); $bill = new BillingData($registry[$nameDataBase]); $billData = $bill->getListBillingData($data['pk_id_person']); //print_r($billData); if ($action == 'PREVIEW') { $preview_flag = 1; } } ?>