public function save() { $religionId = $this->getValue('religionId'); if (!empty($religionId)) { $religion = $this->getReligionService()->getReligionById($religionId); } else { $religion = new Religion(); } $religion->setCode($this->getValue('code')); $religion->setName($this->getValue('name')); $religion->save(); }
public static function getReligions() { $dados = Database::ReadAll("religion", "*"); if (!$dados) { return ''; } foreach ($dados as $dado) { $religion = new Religion(); $religion->setId($dado['ID_RELIGION']); $religion->setName($dado['NAME_RELIGION']); $religions[] = $religion; } return $religions; }
echo $form->dropDownList($model, 'student_transaction_nationality_id', Nationality::items(), array('empty' => 'Select Nationality')); ?> <span class="status"> </span> <?php echo $form->error($model, 'student_transaction_nationality_id'); ?> </div> </div> <div class="row"> <div class="row-left"> <?php echo $form->labelEx($model, 'student_transaction_religion_id'); ?> <?php echo $form->dropDownList($model, 'student_transaction_religion_id', Religion::items(), array('empty' => 'Select Religion')); ?> <span class="status"> </span> <?php echo $form->error($model, 'student_transaction_religion_id'); ?> </div> <div class="row-right"> <?php echo $form->labelEx($model, 'student_transaction_quota_id'); ?> <?php echo $form->dropDownList($model, 'student_transaction_quota_id', Quota::items(), array('empty' => 'Select Quota')); ?> <span class="status"> </span> <?php
<?php include "system.php"; include_once '../simantz/class/Religion.inc.php'; $o = new Religion(); $s = new XoopsSecurity(); $action = $_REQUEST['action']; $isadmin = $xoopsUser->isAdmin(); $uid = $xoopsUser->getVar('uid'); switch ($action) { case "search": //return xml table to grid $wherestring = " WHERE religion_id>0"; $o->showReligion($wherestring); exit; //after return xml shall not run more code. break; case "lookup": //return xml table to grid include_once "../simantz/class/EBAGetHandler.php"; $defaultorganization_id = $_SESSION['defaultorganization_id']; $lookupdelay = 1000; $pagesize =& $_GET["pagesize"]; $ordinalStart =& $_GET["startrecordindex"]; $sortcolumn =& $_GET["sortcolumn"]; $sortdirection =& $_GET["sortdirection"]; $getHandler = new EBAGetHandler(); $getHandler->ProcessRecords(); $wherestring = " WHERE religion_id>0"; $o->showLookupReligion($wherestring); exit;
<?php $EmployeeInfo = EmployeeInfo::model()->findByPk($employee_transaction[0]->employee_transaction_employee_id); if ($employee_transaction[0]->employee_transaction_category_id != null) { $Category = Category::model()->findByPk($employee_transaction[0]->employee_transaction_category_id); } else { $Category = new Category(); } if ($employee_transaction[0]->employee_transaction_religion_id != null) { $Religion = Religion::model()->findByPk($employee_transaction[0]->employee_transaction_religion_id); } else { $Religion = new Religion(); } $Shift = Shift::model()->findByPk($employee_transaction[0]->employee_transaction_shift_id); $EmployeeDesignation = EmployeeDesignation::model()->findByPk($employee_transaction[0]->employee_transaction_designation_id); if ($employee_transaction[0]->employee_transaction_nationality_id != null) { $Nationality = Nationality::model()->findByPk($employee_transaction[0]->employee_transaction_nationality_id); } else { $Nationality = new Nationality(); } $Department = Department::model()->findByPk($employee_transaction[0]->employee_transaction_department_id); if ($employee_transaction[0]->employee_transaction_languages_known_id != null) { $LanguagesKnown = LanguagesKnown::model()->findByPk($employee_transaction[0]->employee_transaction_languages_known_id); } $Organization = Organization::model()->findByPk($employee_transaction[0]->employee_transaction_organization_id); if ($employee_transaction[0]->employee_transaction_emp_address_id != null) { $EmployeeAddress = EmployeeAddress::model()->findByPk($employee_transaction[0]->employee_transaction_emp_address_id); } else { $EmployeeAddress = new EmployeeAddress(); } ?>
public static function getPersons() { $dados = Database::ReadAll("person", "*"); if (!$dados) { return ''; } foreach ($dados as $dado) { $person = new Person(); $person->setId($dado['ID_PERSON']); $person->setName($dado['NAME_PERSON']); $person->setEmail($dado['EMAIL']); $person->setAge($dado['AGE']); $person->setSex($dado['SEX']); $person->setPhone($dado['PHONE']); $person->setOperator($dado['OPERATOR']); $person->setMaritalStatus($dado['MARITAL_STATUS']); $person->setChildren($dado['CHILDREN']); $religion = Religion::getReligion("WHERE id_religion = " . $dado['ID_RELIGION']); $person->setReligion($religion); $address = Address::getAddress("AND id_address = " . $dado['ID_ADDRESS']); $person->setAddress($address); $login = Login::getLogin($dado['ID_PERSON']); $person->setLogin($login); $persons[] = $person; } return $persons; }
public static function getResident($where) { $dado = Database::ReadOne("resident r, person p", "r.*, p.*", "WHERE p.id_person = r.id_person {$where}"); if (!$dado) { return ''; } $resident = new Resident(); $resident->setId($dado['ID_PERSON']); $resident->setName($dado['NAME_PERSON']); $resident->setEmail($dado['EMAIL']); $resident->setAge($dado['AGE']); $resident->setSex($dado['SEX']); $resident->setPhone($dado['PHONE']); $resident->setOperator($dado['OPERATOR']); $resident->setMaritalStatus($dado['MARITAL_STATUS']); $resident->setChildren($dado['CHILDREN']); $resident->setDateInsert($dado['INSERT_DATE']); $resident->setNumberResident($dado['NUMBER_RESIDENT_HOUSE']); $resident->setHouseFather($dado['HOUSEFATHER']); $resident->setCognateAdventista($dado['COGNATE_ADVENTISTA']); $religion = Religion::getReligion("WHERE id_religion = " . $dado['ID_RELIGION']); $resident->setReligion($religion); $address = Address::getAddress("AND id_address = " . $dado['ID_ADDRESS']); $resident->setAddress($address); $research = Research::getResearch('WHERE id_resident = ' . $dado['ID_PERSON']); $resident->setResearch($research); return $resident; }
?> <?php echo $form->dropDownList($model, 'student_transaction_nationality_id', Nationality::items(), array('empty' => '-----------Select---------', 'tabindex' => 17)); ?> <span class="status"> </span> <?php echo $form->error($model, 'student_transaction_nationality_id'); ?> </div> <div class="row-right"> <?php echo $form->labelEx($model, 'student_transaction_religion_id'); ?> <?php echo $form->dropDownList($model, 'student_transaction_religion_id', Religion::items(), array('empty' => '-----------Select---------', 'tabindex' => 18)); ?> <span class="status"> </span> <?php echo $form->error($model, 'student_transaction_religion_id'); ?> </div>--> </div> <div class="row"> <div class="row-left"> <?php echo $form->labelEx($model, 'student_transaction_quota_id'); ?> <?php
public function getUserReligion($userId) { $Object = new Religion(); $result = $Object->getUserReligion($userId); return $result; }
<div class = "row_all_a"> <div class="row_t_v"> <?php echo '<lable><b>Religion :</b></lable>'; ?> <div class="rowm"> <?php //echo ($model->student_transaction_religion_id != null ? $model->Rel_Religion->religion_name : 'NA'); ?> <?php $religionid = StudentTransaction::model()->findByPk($model->student_archive_stud_tran_id)->student_transaction_religion_id; ?> <?php echo Religion::model()->findByPk($religionid)->religion_name; ?> </div> </div> <div class="row_t_v"> <?php echo '<lable><b>Branch :</b></lable>'; ?> <div class="rowm"> <?php //echo $model->Rel_Branch->branch_name .'<br>'; ?> <?php $branchid = StudentTransaction::model()->findByPk($model->student_archive_stud_tran_id)->student_transaction_branch_id;
$Category = Category::model()->findByPk($student_transaction[0]->student_transaction_category_id); } else { $Category = new Category(); } if ($student_transaction[0]->student_transaction_category_id != null) { $Nationality = Nationality::model()->findByPk($student_transaction[0]->student_transaction_nationality_id); } else { $Nationality = new Nationality(); } if ($student_transaction[0]->student_transaction_quota_id != null) { $Quota = Quota::model()->findByPk($student_transaction[0]->student_transaction_quota_id); } else { $Quota = new Quota(); } if ($student_transaction[0]->student_transaction_religion_id != null) { $Religion = Religion::model()->findByPk($student_transaction[0]->student_transaction_religion_id); } else { $Religion = new Religion(); } $Branch = Branch::model()->findByPk($student_transaction[0]->student_transaction_branch_id); $Shift = Shift::model()->findByPk($student_transaction[0]->student_transaction_shift_id); $Division = Division::model()->findByPk($student_transaction[0]->student_transaction_division_id); $Batch = Batch::model()->findByPk($student_transaction[0]->student_transaction_batch_id); $Organization = Organization::model()->findByPk($student_transaction[0]->student_transaction_organization_id); if ($student_transaction[0]->student_transaction_languages_known_id != null) { $LanguagesKnown = LanguagesKnown::model()->findByPk($student_transaction[0]->student_transaction_languages_known_id); } else { $LanguagesKnown = new $LanguagesKnown(); } if ($student_transaction[0]->student_transaction_languages_known_id != null) { $StudentAddress = StudentAddress::model()->findByPk($student_transaction[0]->student_transaction_student_address_id);
private static function loadItems() { self::$_items = array(); $models = self::model()->findAll(); foreach ($models as $model) { self::$_items[$model->religion_id] = $model->religion_name; } }
public static function getLeaders() { $dados = Database::ReadAll("calebe c, person p", "c.*, p.*", "WHERE p.id_person = c.id_person AND c.leader = 2"); if (!$dados) { return ''; } foreach ($dados as $dado) { $calebe = new Calebe(); $calebe->setId($dado['ID_PERSON']); $calebe->setName($dado['NAME_PERSON']); $calebe->setEmail($dado['EMAIL']); $calebe->setAge($dado['AGE']); $calebe->setSex($dado['SEX']); $calebe->setPhone($dado['PHONE']); $calebe->setOperator($dado['OPERATOR']); $calebe->setMaritalStatus($dado['MARITAL_STATUS']); $calebe->setChildren($dado['CHILDREN']); $calebe->setBaptism($dado['BAPTISM']); $calebe->setLeader($dado['LEADER']); $calebe->setTimeStudy($dado['TIME_STUDY']); $calebe->setStatus($dado['STATUS']); $calebe->setDateInsert($dado['INSERT_DATE']); $religion = Religion::getReligion("WHERE id_religion = " . $dado['ID_RELIGION']); $calebe->setReligion($religion); $address = Address::getAddress("AND id_address = " . $dado['ID_ADDRESS']); $calebe->setAddress($address); $login = Login::getLogin($dado['ID_PERSON']); $calebe->setLogin($login); $calebes[] = $calebe; } return $calebes; }
</td> <td> <div class="row"> <?php echo $form->labelEx($model, 'religionid'); ?> <?php echo $form->hiddenField($model, 'religionid'); ?> <input type="text" name="religion_name" id="religion_name" style="width:75%" readonly value="<?php echo Religion::model()->findByPk($model->religionid) !== null ? Religion::model()->findByPk($model->religionid)->religionname : ''; ?> "> <?php $this->beginWidget('zii.widgets.jui.CJuiDialog', array('id' => 'religion_dialog', 'options' => array('title' => Yii::t('app', 'Religion'), 'width' => 'auto', 'autoOpen' => false, 'modal' => true))); $religion = new Religion('searchwstatus'); $religion->unsetAttributes(); // clear any default values if (isset($_GET['Religion'])) { $religion->attributes = $_GET['Religion']; } $this->widget('zii.widgets.grid.CGridView', array('id' => 'religion-grid', 'dataProvider' => $religion->Searchwstatus(), 'filter' => $religion, 'template' => '{summary}{pager}<br>{items}{pager}{summary}', 'columns' => array(array('header' => '', 'type' => 'raw', 'value' => 'CHtml::Button("V", array("name" => "send_religion", "id" => "send_religion", "onClick" => "$(\\"#religion_dialog\\").dialog(\\"close\\"); $(\\"#religion_name\\").val(\\"$data->religionname\\"); $(\\"#Employee_religionid\\").val(\\"$data->religionid\\");"))'), array('name' => 'religionid', 'visible' => false, 'value' => '$data->religionid', 'htmlOptions' => array('width' => '1%')), 'religionname'))); $this->endWidget('zii.widgets.jui.CJuiDialog'); echo CHtml::Button('...', array('onclick' => '$("#religion_dialog").dialog("open"); return false;')); ?> <?php echo $form->error($model, 'religionid'); ?>
public function saveReligion() { $this->log->showLog(2, "Access saveReligion()"); // die; global $xoopsDB, $saveHandler, $createdby, $timestamp, $defaultorganization_id; $tablename = "sim_religion"; $pkey = "religion_id"; $keyword = "Religion"; $controlfieldname = "religion_name"; $insertCount = $saveHandler->ReturnInsertCount(); $this->log->showLog(3, "Start Insert({$insertCount} records)"); if ($insertCount > 0) { $arrfield = array($controlfieldname, "religion_description", "isactive", "defaultlevel", "created", "createdby", "updated", "updatedby", "organization_id"); $arrfieldtype = array('%s', '%s', '%d', '%d', '%s', '%d', '%s', '%d', '%d'); // Yes there are INSERTs to perform... for ($currentRecord = 0; $currentRecord < $insertCount; $currentRecord++) { $arrvalue = array($saveHandler->ReturnInsertField($currentRecord, $controlfieldname), $saveHandler->ReturnInsertField($currentRecord, "religion_description"), $saveHandler->ReturnInsertField($currentRecord, "isactive"), $saveHandler->ReturnInsertField($currentRecord, "defaultlevel"), $timestamp, $createdby, $timestamp, $createdby, $defaultorganization_id); $controlvalue = $saveHandler->ReturnInsertField($currentRecord, $controlfieldname); $this->InsertRecord($tablename, $arrfield, $arrvalue, $arrfieldtype, $controlvalue, $pkey); // Now we execute this query } } $updateCount = $saveHandler->ReturnUpdateCount(); $this->log->showLog(3, "Start update({$updateCount} records)"); if ($updateCount > 0) { $arrfield = array($controlfieldname, "religion_description", "isactive", "defaultlevel", "updated", "updatedby", "isdeleted"); $arrfieldtype = array('%s', '%s', '%d', '%d', '%s', '%d', '%d'); // Yes there are UPDATEs to perform... for ($currentRecord = 0; $currentRecord < $updateCount; $currentRecord++) { $arrvalue = array($saveHandler->ReturnUpdateField($currentRecord, $controlfieldname), $saveHandler->ReturnUpdateField($currentRecord, "religion_description"), $saveHandler->ReturnUpdateField($currentRecord, "isactive"), $saveHandler->ReturnUpdateField($currentRecord, "defaultlevel"), $timestamp, $createdby, $saveHandler->ReturnUpdateField($currentRecord, "isdeleted")); $controlvalue = $saveHandler->ReturnUpdateField($currentRecord, $controlfieldname); $this->UpdateRecord($tablename, $pkey, $saveHandler->ReturnUpdateField($currentRecord), $arrfield, $arrvalue, $arrfieldtype, $controlvalue); } } $ispurge = 0; $deleteCount = $saveHandler->ReturnDeleteCount(); $this->log->showLog(3, "Start delete/purge({$deleteCount} records)"); $classname = "class/{$keyword}.inc.php"; include $classname; $this->log->showLog(3, "Include {$classname} successfully"); $o = new Religion(); $this->log->showLog(3, "Inilialize Religion()"); if ($deleteCount > 0) { for ($currentRecord = 0; $currentRecord < $deleteCount; $currentRecord++) { $record_id = $saveHandler->ReturnDeleteField($currentRecord); $o->fetchReligion($record_id); $controlvalue = $o->religion_name; $isdeleted = $o->isdeleted; if ($o->allowDelete($record_id)) { $this->DeleteRecord($tablename, $pkey, $record_id, $controlvalue, $isdeleted); } else { $this->failfeedback .= "Cannot delete {$keyword}: {$o->religion_name} <br/>"; } } } //$this->failfeedback.="asdasdpasd<br/>\n"; //$this->failfeedback.="123 3443<br/>\n"; //$this->failfeedback.="234 45656523 234<br/>\n"; if ($this->failfeedback != "") { $this->failfeedback .= "Warning!<br/>\n" . $this->failfeedback; } $saveHandler->setErrorMessage($this->failfeedback); $saveHandler->CompleteSave(); }
/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. * @param integer the ID of the model to be loaded */ public function loadModel($id) { $model = Religion::model()->findByPk((int) $id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
<div class="form-group"> <label for="pass1" class="control-label col-lg-4">Filhos</label> <div class="col-lg-1" > <input type="number" id="CHILDREN" name="CHILDREN" min="0" max="10" value="0" class="form-control" /> </div> </div> <div class="form-group"> <label for="religion" class="control-label col-lg-4">Religião</label> <div class="col-lg-5"> <select name="ID_RELIGION" id="ID_RELIGION" class="form-control" required> <?php if (Religion::getReligions()) { $rel = Religion::getReligions(); echo '<option value="' . $rel[0]->getId() . '" selected>' . $rel[0]->getName() . '</option>'; } ?> </select> </div> </div> <div class="form-group"> <div class="col-md-offset-8"> <button type="submit" class="btn btn-primary">Continue</button> </div> </div> </form> </div> <!-- FIM PRIMEIRO PASSO - DADOS PESSOAIS -->
<?php include_once '../class/Functions.php'; include_once '../class/Mission.php'; include_once '../class/Resident.php'; $acao = $_POST['acao']; switch ($acao) { case 'religion': $cod = filter_input(INPUT_POST, 'cod', FILTER_SANITIZE_NUMBER_INT); $rel = Religion::getReligion("WHERE id_religion = {$cod}"); ?> <p><label>Nome</label>: <?php echo $rel->getName(); ?> </p> <?php break; case 'admin': $cod = filter_input(INPUT_POST, 'cod', FILTER_SANITIZE_NUMBER_INT); $cal = false; if (!Database::ReadOne('calebe', '*', 'WHERE id_person =' . $cod)) { $per = Person::getPerson('WHERE id_person = ' . $cod); } else { $per = Calebe::getCalebe('AND p.id_person = ' . $cod); $cal = true; } ?> <p><label>No sistema desde</label>: <?php echo $per->getDateInsert(); ?> </p>
?> /> Não </label> </div> </div> </div> <div class="form-group"> <label for="religion" class="control-label col-lg-4">Religião</label> <div class="col-lg-5"> <select name="ID_RELIGION" id="ID_RELIGION_C" class="form-control" required> <option value="">Selecione a Religião</option> <?php if (Religion::getReligions()) { foreach (Religion::getReligions() as $rel) { if ($rel->getId() == $cal->getReligion()->getId()) { echo '<option value="' . $rel->getId() . '" selected>' . $rel->getName() . '</option>'; } else { echo '<option value="' . $rel->getId() . '">' . $rel->getName() . '</option>'; } } } ?> </select> </div> </div> <div class="form-group lider" <?php if ($cal->getReligion()->getId() != 1 || $cal->getBaptism() != 1) { echo 'style="display: none;"';
private function getReligion() { $Object = new Religion(); $result = $Object->getUserReligion($this->userId); if ($result[0]['Status'] == "ok") { $this->religion = $result[1]['ReligionId']; $this->sect = $result[1]['SectId']; $this->religionSectId = $result[1]['religionsectId']; return true; } return false; }