Exemplo n.º 1
0
 function getParish()
 {
     if (!isset($this->religious_administration)) {
         $this->religious_administration = new stdClass();
     }
     $parish = new Parish();
     $parish->getByChurchId($this->id);
     $this->religious_administration->parish = $parish;
 }
Exemplo n.º 2
0
 public function getFormFields()
 {
     $fields = parent::getFormFields();
     /*
             'Status' => "Enum('own, rent, loan')",
             'Amount' => 'Int',
             'HoldsRationCard' => 'Boolean',
             'CardType' => 'VarChar(4)',
             'Type' => "Enum('hut,ollapera,sheet,oddapera,concrete,2level,multilevel,flat')",
             'BuildYear' => 'Int'
     */
     $statusArray = singleton('House')->dbObject('Status')->enumValues();
     $statusField = DropdownField::create('Status', 'Own House/Renting/On Loan', $statusArray);
     $statusField->setEmptyString('All');
     $fields->push($statusField);
     //$fields->push(CheckboxField::create('HoldsRationCard', 'Yes'));
     $options = array('1' => 'Yes', '0' => 'No', '' => 'All');
     $holdsRationCardField = new OptionsetField("HoldsRationCard", 'Holds RationCard', $options, null);
     $fields->push($holdsRationCardField);
     $cardTypes = Config::inst()->get('House', 'CardType');
     $cardTypeField = DropdownField::create('CardType', 'Ration Card Type', $cardTypes);
     $cardTypeField->setEmptyString('select any');
     $fields->push($cardTypeField);
     $typeArray = singleton('House')->dbObject('Type')->enumValues();
     $typeField = DropdownField::create('Type', 'House Type', $typeArray);
     $typeField->setEmptyString('select any');
     $fields->push($typeField);
     $parishes = Parish::get()->map('ID', 'NameWithLocation')->toArray();
     $parishField = DropdownField::create('ParishID', 'Parish')->setSource($parishes);
     $parishField->setEmptyString('All Parish');
     $parishField->setValue(parent::getDefaultParishID());
     $fields->push($parishField);
     return $fields;
 }
 public function getFormFields()
 {
     $fields = parent::getFormFields();
     $typeArray = singleton('Agriculture')->dbObject('Type')->enumValues();
     $typeField = DropdownField::create('Type', 'Type', $typeArray);
     $typeField->setEmptyString('select any');
     $fields->push($typeField);
     $parishes = Parish::get()->map('ID', 'NameWithLocation')->toArray();
     $parishField = DropdownField::create('ParishID', 'Parish')->setSource($parishes);
     $parishField->setEmptyString('All Parish');
     $parishField->setValue(parent::getDefaultParishID());
     $fields->push($parishField);
     return $fields;
 }
 public function getFormFields()
 {
     $fields = parent::getFormFields();
     $options = array('1' => 'Yes', '0' => 'No', '' => 'All');
     $statusField = new OptionsetField("Status", 'Shifted from Urban/Rural area', $options, 1);
     $fields->push($statusField);
     //$fields->push(CheckboxField::create('Status', 'Yes'));
     $parishes = Parish::get()->map('ID', 'NameWithLocation')->toArray();
     $parishField = DropdownField::create('ParishID', 'Parish')->setSource($parishes);
     $parishField->setEmptyString('All Parish');
     $parishField->setValue(parent::getDefaultParishID());
     $fields->push($parishField);
     return $fields;
 }
Exemplo n.º 5
0
 public function getFormFields()
 {
     $fields = parent::getFormFields();
     //$fields->push(TextField::create('Pincode', 'Pincode'));
     $fields->push(TextField::create('BlockNo', 'Block No'));
     $fields->push(TextField::create('UnitNo', 'Unit No'));
     //$fields->push(CheckboxField::create('IsPanchayat', 'Is Panchayat'));
     //$fields->push(CheckboxField::create('IsMunicipality', 'Is Municipality'));
     //$fields->push(CheckboxField::create('IsCorporation', 'Is Corporation'));
     $parishes = Parish::get()->map('ID', 'NameWithLocation')->toArray();
     $parishField = DropdownField::create('ParishID', 'Parish')->setSource($parishes);
     $parishField->setEmptyString('All Parish');
     $parishField->setValue(parent::getDefaultParishID());
     $fields->push($parishField);
     return $fields;
 }
Exemplo n.º 6
0
 public function search()
 {
     $term = Convert::raw2sql($this->request->getVar('term'));
     $data = Parish::get()->filter(array('Title:PartialMatch' => $term));
     //$f1 = new JSONDataFormatter();
     //return $f1->convertDataObjectSet($data,array('ID','Title'));
     if ($data) {
         $return_arr = array();
         foreach ($data as $p) {
             $array['id'] = $p->ID;
             $array['title'] = ucwords(strtolower($p->Title));
             $array['location'] = $p->Location;
             array_push($return_arr, $array);
         }
         return json_encode($return_arr);
     }
 }
Exemplo n.º 7
0
 public function getFormFields()
 {
     $fields = parent::getFormFields();
     //$fields->push(CheckboxField::create('HoldsLand', 'Yes'));
     $options = array('1' => 'Yes', '0' => 'No', '' => 'All');
     $holdsLandField = new OptionsetField("HoldsLand", 'Holds Land', $options, null);
     $fields->push($holdsLandField);
     $landArray = singleton('Land')->dbObject('Area')->enumValues();
     $landField = DropdownField::create('Area', 'Area', $landArray);
     $landField->setEmptyString('select any');
     $fields->push($landField);
     $parishes = Parish::get()->map('ID', 'NameWithLocation')->toArray();
     $parishField = DropdownField::create('ParishID', 'Parish')->setSource($parishes);
     $parishField->setEmptyString('All Parish');
     $parishField->setValue(parent::getDefaultParishID());
     $fields->push($parishField);
     return $fields;
 }
Exemplo n.º 8
0
 public function Header()
 {
     $parish = Parish::get();
     $logo_src = $parish->logo_src;
     if (!isset($logo_src)) {
         $logo_src = "logo-new.gif";
     }
     $logo_src = dirname(__FILE__) . "/../../images/{$logo_src}";
     $this->Image($logo_src, 0.6, 0.1, '', 1.95, 'GIF', '', 'T', false, 300, '', false, false, 0, false, false, false);
     #		$this->SetFont('helvetica','B',20);
     #		$this->Cell(0,1,$parish->name,0,false,'C');
     $this->SetTextColorArray(array(50, 50, 50));
     $this->SetFont("times", "B", 18);
     $topX = $this->GetX() + 1.0;
     $this->SetXY($topX, 0.25);
     $this->Cell(0, 0, $parish->name . ", " . $parish->city, 0, 1, 'L');
     $this->SetFont("courier", "B", 11);
     $this->SetTextColorArray(array(60, 80, 170));
     $this->SetX($topX);
     $web = $parish->website;
     $phone = $parish->phone;
     if (isset($web) and !empty($web)) {
         $txt = $web;
         if (isset($phone) and !empty($phone)) {
             $txt .= " | {$phone}";
         }
     } else {
         $txt = "Phone: {$phone}";
     }
     $this->Cell(0, 0, $txt, 0, 1, 'L');
     $this->SetTextColorArray(array(20, 20, 20));
     $this->SetFont("times", "R", 11);
     $this->SetX($topX);
     $this->Cell(0, 0, $parish->address . ', ' . $parish->city . ' - ' . $parish->pin, 0, 1, 'L');
     $currY = $this->GetY() + 0.2;
     $this->Line(1, $currY, $this->getPageWidth() - 1, $currY);
 }
Exemplo n.º 9
0
echo $form->textField($model, 'name', array('size' => 60, 'maxlength' => 75));
?>
		<?php 
echo $form->hiddenField($model, 'member_id');
?>
		<?php 
echo $form->error($model, 'name');
?>
	</div>

	<div class="row">
		<?php 
echo $form->labelEx($model, 'church');
?>
		<?php 
echo $form->textField($model, 'church', array('size' => 50, 'maxlength' => 50, 'value' => Parish::get()->name));
?>
		<?php 
echo $form->error($model, 'church');
?>
	</div>

	<div class="row">
	<span class="leftHalf">
		<?php 
echo $form->labelEx($model, 'confirmation_dt');
?>
		<?php 
$this->widget('zii.widgets.jui.CJuiDatePicker', array('model' => $model, 'attribute' => "confirmation_dt", 'options' => array('dateFormat' => Yii::app()->params['dateFmtDP'], 'yearRange' => '1900:c+10', 'changeYear' => true), 'htmlOptions' => array('size' => '10', 'maxlength' => '10')));
?>
		<?php 
Exemplo n.º 10
0
?>
/css/form.css" />

	<title><?php 
echo CHtml::encode($this->pageTitle);
?>
</title>
</head>

<body>

<div class="container" id="page">

	<div id="header">
		<div id="logo"><?php 
$parish = Parish::get();
if (isset($parish) and isset($parish->logo_src)) {
    echo CHtml::link(CHtml::image(Yii::app()->request->baseUrl . $parish->logo_src, CHtml::encode(Yii::app()->name), array('width' => $parish->logo_width, 'height' => $parish->logo_height)), Yii::app()->request->baseUrl . '/');
} else {
    echo CHtml::link(CHtml::image(Yii::app()->request->baseUrl . '/images/logo-new.gif', CHtml::encode(Yii::app()->name), array('width' => 200, 'height' => 100)), Yii::app()->request->baseUrl . '/');
}
?>
</div>
		<?php 
if (!Yii::app()->user->isGuest) {
    ?>
		<div id="search">
			<?php 
    $form = $this->beginWidget('CActiveForm', array('id' => 'search_form', 'action' => Yii::app()->createUrl('/parish/search'), 'method' => 'GET'));
    echo CHtml::textField('key', '', array('id' => 'search_key'));
    echo CHtml::imageButton(Yii::app()->request->baseUrl . '/images/search.png');
Exemplo n.º 11
0
 public function actionConfig()
 {
     $a = Yii::app();
     list($cont, $action) = explode('/', $a->urlManager->parseUrl($a->request));
     if ('site' == $cont) {
         throw new CHttpException(403, 'Forbidden: You are not authorized to access this page.');
     }
     $path = preg_replace('/controllers/', 'config/params.php', dirname(__FILE__));
     Yii::trace("SC.actionConfig called with path {$path}", 'application.controllers.SiteController');
     $model = Parish::model()->findByPk(1);
     if (!isset($model)) {
         $model = new Parish();
     }
     $installed = Yii::app()->params['installed'];
     if (!$installed and !is_writable($path)) {
         Yii::app()->user->setFlash("error", "WARNING: the file {$path} needs to be writable before submitting this form." . "Please change the permissions of the file or, if it does not exist, of the parent config directory");
     } elseif (isset($_POST['Parish'])) {
         $model->attributes = $_POST['Parish'];
         Yii::trace("model attributes: " . var_export($model->attributes, true), 'application.controllers.SiteController');
         try {
             if (isset($_FILES['Parish'])) {
                 $files = $_FILES['Parish'];
                 $filename = $files['name']['logo'];
                 Yii::trace("IC.actionConfig called with logo {$filename}", 'application.controllers.InstallController');
                 if (isset($filename) and !empty($filename)) {
                     $tmp_path = $files['tmp_name']['logo'];
                     Yii::trace("IC.actionConfig logo temp path {$tmp_path}", 'application.controllers.InstallController');
                     if (isset($tmp_path) and !empty($tmp_path)) {
                         $dir = "images/";
                         $fname = preg_replace('/\\.[a-z]+$/i', '', $filename);
                         preg_match('/(\\.[a-z]+)$/i', $filename, $matches);
                         $fext = $matches[0];
                         if (file_exists($dir . $filename)) {
                             $fname .= "_01";
                             while (file_exists($dir . $fname . $fext)) {
                                 ++$fname;
                             }
                         }
                         $dest = $dir . $fname . $fext;
                         $parishLogo = array();
                         $parishLogo['logo_src'] = "/{$dest}";
                         list($width, $height) = getimagesize($tmp_path);
                         Yii::trace("IC.actionConfig logo dimensions {$width} x {$height}", 'application.controllers.InstallController');
                         $parishLogo['logo_width'] = $width;
                         $parishLogo['logo_height'] = $height;
                         if (is_writable($dir)) {
                             move_uploaded_file($tmp_path, $dest);
                             $model->attributes = $parishLogo;
                         } else {
                             $path = preg_replace('?protected/controllers?', $dest, dirname(__FILE__));
                             throw new Exception("Path {$path} not writable. Please ensure write permissions");
                         }
                     } else {
                         $errors = array(1 => "Size exceeds max_upload", 2 => "FORM_SIZE", 3 => "No tmp dir", 4 => "can't write", 5 => "error extension", 6 => "error partial");
                         throw new Exception($errors[$files['error']['logo']]);
                     }
                 }
             }
             if (!$installed) {
                 $params = array('installed' => true);
                 $fh = fopen($path, "r");
                 $header = "";
                 for ($i = 0; $i < 21; ++$i) {
                     if (($line = fgets($fh)) !== false) {
                         $header .= $line;
                     } else {
                         break;
                     }
                 }
                 fclose($fh);
                 $conf = $header . "return " . var_export($params, true) . ";\n";
                 file_put_contents($path, $conf);
             }
             if (!$model->save(false)) {
                 $errs = $model->errors;
                 throw new Exception("Unable to save parish data: " . $errs[0]);
             }
         } catch (Exception $e) {
             Yii::app()->user->setFlash('error', $e->getMessage());
         }
         if ("admin" != $cont) {
             $this->render("/{$cont}/success");
             return;
         } else {
             Yii::app()->user->setFlash('msg', 'Parish data saved successfully');
         }
     }
     $this->render("/{$cont}/config", array('model' => $model));
 }
Exemplo n.º 12
0
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# Alive Parish Software is distributed in the hope that it will
# be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
/* @var $this BannsRecordsController */
/* @var $model BannsRecord */
/* @var $form CActiveForm */
$this->widget('application.extensions.fancybox.EFancyBox', array('target' => 'a[rel=gallery]', 'config' => array()));
Yii::app()->clientScript->registerScript('findMatches', "\nfunction set_find(crit) {\n\t\$('#findMatchForm').submit(function() {\n\t\t\$.get('" . Yii::app()->createAbsoluteUrl('/person/findMatch') . "', {\n\t\t\t'sex': crit['sex'],\n\t\t\t'key': \$('#key').val()\n\t\t}, function(data) {\n\t\t\t\$('#fancybox-content').html(data);\n\t\t\tset_find(crit);\n\t\t\tset_sort(crit);\n\t\t\tset_select(crit);\n\t\t\tset_pager(crit);\n\t\t} );\n\t\treturn false;\n\t} );\n\t\$('#key').focus();\n}\nfunction set_sort(crit) {\n\t\$('a.sort-link').click(function() {\n\t\t\$.get(\$(this).attr('href'), function(data) {\n\t\t\t\$('#fancybox-content').html(data);\n\t\t\tset_find(crit);\n\t\t\tset_sort(crit);\n\t\t\tset_select(crit);\n\t\t\tset_pager(crit);\n\t\t} );\n\t\treturn false;\n\t} );\n}\nfunction set_select(crit) {\n\t\$('#submitMatch').click(function() {\n\t\t\$.fancybox.close();\n\t\t\$.post('" . Yii::app()->createAbsoluteUrl('/person/findMatch') . "', {\n\t\t\t'person': \$('input:checked').val()\n\t\t}, crit['callback'], 'json' );\n\t} );\n}\nfunction set_pager(crit) {\n\t\$('div.pager li a').click(function() {\n\t\t\$.get(\$(this).attr('href'), function(data) {\n\t\t\t\$('#fancybox-content').html(data);\n\t\t\tset_find(crit);\n\t\t\tset_sort(crit);\n\t\t\tset_select(crit);\n\t\t\tset_pager(crit);\n\t\t} );\n\t\treturn false;\n\t} );\n}\nvar groom = new Object;\ngroom['id'] = 'groom';\ngroom['sex'] = 'male';\ngroom['callback'] = function(p) {\n\t\$('#BannsRecord_groom_name').val(p.name).attr('readonly', true);\n\t\$('#BannsRecord_groom_parent').val(p.parents_name).attr('readonly', true);\n\t\$('#BannsRecord_groom_parish').attr('name', 'groom_parish_pub');\n\t\$('#BannsRecord_groom_parish').val('" . Parish::get()->name . "');\n\t\$('#BannsRecord_groom_parish').attr('readonly', true);\n\t\$('#BannsRecord_groom_parish_hid').val(p.id);\n\t\$('#BannsRecord_groom_parish_hid').attr('name', 'BannsRecord[groom_parish]');\n};\n\$('#groom_search').fancybox( {\n\t'onComplete': function() {\n\t\tset_find(groom);\n\t\tset_sort(groom);\n\t\tset_select(groom);\n\t\tset_pager(groom);\n\t}\n} );\n\$('#groom_clear').click(function() {\n\t\$('#BannsRecord_groom_parish').attr('name', 'BannsRecord[groom_parish]');\n\t\$('#BannsRecord_groom_parish').val('');\n\t\$('#BannsRecord_groom_parish').attr('readonly', false);\n\t\$('#BannsRecord_groom_parish_hid').val('');\n\t\$('#BannsRecord_groom_parish_hid').attr('name', 'groom_parish_hid');\n\t\$('#BannsRecord_groom_name').val('').attr('readonly', false);\n\t\$('#BannsRecord_groom_parent').val('').attr('readonly', false);\n\treturn false;\n} );\n\nvar bride = new Object;\nbride['id'] = 'bride';\nbride['sex'] = 'female';\nbride['callback'] = function(p) {\n\t\$('#BannsRecord_bride_name').val(p.name).attr('readonly', true);\n\t\$('#BannsRecord_bride_parent').val(p.parents_name).attr('readonly', true);\n\t\$('#BannsRecord_bride_parish').attr('name', 'bride_parish_pub');\n\t\$('#BannsRecord_bride_parish').val('" . Parish::get()->name . "');\n\t\$('#BannsRecord_bride_parish').attr('readonly', true);\n\t\$('#BannsRecord_bride_parish_hid').val(p.id);\n\t\$('#BannsRecord_bride_parish_hid').attr('name', 'BannsRecord[bride_parish]');\n};\n\$('#bride_search').fancybox( {\n\t'onComplete': function() {\n\t\tset_find(bride);\n\t\tset_sort(bride);\n\t\tset_select(bride);\n\t\tset_pager(bride);\n\t}\n} );\n\$('#bride_clear').click(function() {\n\t\$('#BannsRecord_bride_parish').attr('name', 'BannsRecord[bride_parish]');\n\t\$('#BannsRecord_bride_parish').val('');\n\t\$('#BannsRecord_bride_parish').attr('readonly', false);\n\t\$('#BannsRecord_bride_parish_hid').val('');\n\t\$('#BannsRecord_bride_parish_hid').attr('name', 'bride_parish_hid');\n\t\$('#BannsRecord_bride_name').val('').attr('readonly', false);\n\t\$('#BannsRecord_bride_parent').val('').attr('readonly', false);\n\treturn false;\n} );\n\n");
$baseScriptUrl = Yii::app()->getAssetManager()->publish(Yii::getPathOfAlias('zii.widgets.assets'));
Yii::app()->clientScript->registerCssFile($baseScriptUrl . '/gridview/styles.css');
$pagerScriptUrl = Yii::app()->getAssetManager()->publish(Yii::getPathOfAlias('system.web.widgets.pagers'));
Yii::app()->clientScript->registerCssFile($pagerScriptUrl . '/pager.css');
?>

<div class="form">

<?php 
$form = $this->beginWidget('CActiveForm', array('id' => 'banns-record-form', 'enableAjaxValidation' => false));
?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php 
 public function actionMassAmt()
 {
     if (isset($_POST['MassBooking'])) {
         $mass_dt = $_POST['MassBooking']['mass_dt'];
         $mass_type = $this->isSpecialMass(new DateTime(date('Y-m-d', CDateTimeParser::parse($mass_dt, Yii::app()->locale->getDateFormat('short')))));
         $parish = Parish::get();
         $cmt = "";
         if ($mass_type) {
             $amt = $parish->mass_book_sun;
             $cmt = "({$mass_type})";
         } else {
             $amt = $parish->mass_book_basic;
         }
         echo "Amount will be: &#8377; {$amt} {$cmt}<input name='amount' type='hidden' value='{$amt}'>";
     }
 }
Exemplo n.º 14
0
 public function MyParishes($limit = 10)
 {
     $list = Parish::get()->limit($limit);
     return $list;
 }
Exemplo n.º 15
0
        $pdf->Cell(2, 0, "", 0, 0);
    }
    $pdf->Cell((1.6 * strlen($value) + strlen($text)) * 0.22, 0.8, $text . strtoupper($value), 0, 1, 'L');
    draw_line($pdf, (strlen($text) + $col) * 0.2, (strlen($text) + strlen($value) * 1.6 + $col) * 0.2);
    ++$line;
    $col = 0;
}
$pdf->Cell(0, 4, "", 0, 1);
$pdf->SetFont("times", "R", 14);
$pdf->Cell(0, 0, "Date: " . $model->res_dt . "              ", 0, 1, 'R');
$pdf->Cell(2, 0, '', 0, 0);
$pdf->Cell(0, 0, "Dear Rev. Father,", 0, 1, 'L');
$pdf->Cell(0, 1, '', 0, 1);
$pdf->SetFont("times", "R", 14);
$pdf->Cell(2, 0, '', 0, 0);
$pdf->Cell(0, 0, "    Greetings from " . Parish::get()->name . '. Received your', 0, 1, 'L');
$pdf->Cell(2, 0, '', 0, 0);
$pdf->Cell(0, 1, "letter with regard to the proposal of marriage between", 0, 1, 'L');
$pdf->Cell(0, 0.5, '', 0, 1);
$banns = $model->banns;
show_field($pdf, $banns->groom_name, 'Mr. ');
show_field_ln($pdf, '', ', ');
show_field_ln($pdf, $banns->groom_parent, 'S/o.  ');
$gp = ctype_digit($banns->groom_parish) ? 'our' : 'your';
show_field_ln($pdf, null, "of {$gp} parish and");
/*	$pdf->Cell(2,0,"",0,0);
	$pdf->Cell(0,0.8,get_parish($banns->groom_parish). ' Parish and ',0,1,'L');
*/
show_field_ln($pdf, '', '');
show_field($pdf, $banns->bride_name, 'Ms.  ');
show_field_ln($pdf, '', ', ');
Exemplo n.º 16
0
    $parms['readonly'] = true;
}
echo $form->textField($model, 'groom_parent', $parms);
?>
		<?php 
echo $form->error($model, 'groom_parent');
?>
	</div>

	<div class="row">
		<?php 
echo $form->labelEx($model, 'bride_parish');
?>
		<?php 
if ('groom' != $local) {
    echo CHtml::textField('bride_parish_pub', Parish::get()->name, array('readonly' => true));
    echo $form->hiddenField($model, 'bride_parish', array('value' => $bride->id));
} else {
    echo $form->textField($model, 'bride_parish', array('size' => 50, 'maxlength' => 50));
}
?>
		<?php 
echo $form->error($model, 'bride_parish');
?>
	</div>

	<div class="row">
		<?php 
echo $form->labelEx($model, 'bride_name');
?>
		<?php 
Exemplo n.º 17
0
 public static function get_name()
 {
     $parish = Parish::get();
     if (isset($parish)) {
         return $parish->name;
     } else {
         return Yii::app()->name;
     }
 }
Exemplo n.º 18
0
	<li>A software that can make your parish administration very effective.</li>
	<li>Developed with latest technology and cutting edge features.</li>
	<li>User friendly operations and functionality.</li>
  </ul>
Registered User?
<?php 
    echo CHtml::link('Login', array('/site/login'));
    ?>

</div>
<?php 
} else {
    ?>

<h1>Welcome to <i><?php 
    echo CHtml::encode(Parish::get_name());
    ?>
</i></h1>

<?php 
    $iconMenu = Yii::app()->params['iconMenu'];
    foreach ($iconMenu as $icon) {
        if (isset($icon['role'])) {
            $role = $icon['role'];
            if (preg_match('/^!/', $role)) {
                $role = preg_replace('/^!/', '', $role);
                if (Yii::app()->user->checkAccess($role)) {
                    continue;
                }
            } elseif (!Yii::app()->user->checkAccess($role)) {
                continue;
Exemplo n.º 19
0
 public function getCMSFields()
 {
     $fields = parent::getCMSFields();
     if ($this->ID) {
         Session::set("FamilyID", $this->ID);
     }
     $nameField = TextField::create('Name', 'Family Name');
     $fields->replaceField('Name', $nameField);
     $houseNoField = TextField::create('HouseNo', 'House No (govt)');
     $fields->replaceField('HouseNo', $houseNoField);
     $parishes = Parish::get()->map('ID', 'NameWithLocation')->toArray();
     $parishField = DropdownField::create('ParishID', 'Parish')->setSource($parishes);
     $parishField->setEmptyString('select...');
     $fields->replaceField('ParishID', $parishField);
     //remove FamilyMembers tab
     $fields->removeByName('FamilyMembers');
     $memberGridFieldConfig = GridFieldConfig_RecordEditor::create();
     $familyMemberList = FamilyMember::get()->filter(array('FamilyID' => $this->ID))->sort('ID ASC');
     $familyMemberGridField = new GridField('Members', 'Family members', $familyMemberList, $memberGridFieldConfig);
     $fields->addFieldsToTab('Root.Members', array($familyMemberGridField));
     //house gridfield
     $houseGridFeildConfig = GridFieldConfig_RecordEditor::create();
     $houseList = House::get()->filter(array('FamilyID' => $this->ID))->sort('ID ASC');
     // remove add button if record already exists
     if ($houseList->count()) {
         $houseGridFeildConfig->removeComponentsByType('GridFieldAddNewButton');
     }
     $houseGridField = new GridField('House', 'House', $houseList, $houseGridFeildConfig);
     $fields->addFieldsToTab('Root.Housing', array($houseGridField));
     //land gridfield
     $landGridFeildConfig = GridFieldConfig_RecordEditor::create();
     $landList = Land::get()->filter(array('FamilyID' => $this->ID))->sort('ID ASC');
     // remove add button if record already exists
     if ($landList->count()) {
         $landGridFeildConfig->removeComponentsByType('GridFieldAddNewButton');
     }
     $landGridField = new GridField('Land', 'Land', $landList, $landGridFeildConfig);
     $fields->addFieldsToTab('Root.Housing', array($landGridField));
     //ShiftedFrom gridfield
     $shiftedFromGridFeildConfig = GridFieldConfig_RecordEditor::create();
     $shiftedFromList = ShiftedFrom::get()->filter(array('FamilyID' => $this->ID))->sort('ID ASC');
     // remove add button if record already exists
     if ($shiftedFromList->count()) {
         $shiftedFromGridFeildConfig->removeComponentsByType('GridFieldAddNewButton');
     }
     $shiftedFromGridField = new GridField('Shifted', 'Shifted', $shiftedFromList, $shiftedFromGridFeildConfig);
     $fields->addFieldsToTab('Root.Housing', array($shiftedFromGridField));
     //Agriculture gridfield
     $agricultureGridFeildConfig = GridFieldConfig_RecordEditor::create();
     $agricultureList = Agriculture::get()->filter(array('FamilyID' => $this->ID))->sort('ID ASC');
     // remove add button if record already exists
     if ($agricultureList->count()) {
         $agricultureGridFeildConfig->removeComponentsByType('GridFieldAddNewButton');
     }
     $agricultureGridField = new GridField('Agriculture', 'Agriculture', $agricultureList, $agricultureGridFeildConfig);
     $fields->addFieldsToTab('Root.Occupation', array($agricultureGridField));
     //Business gridfield
     $businessGridFeildConfig = GridFieldConfig_RecordEditor::create();
     $businessList = Business::get()->filter(array('FamilyID' => $this->ID))->sort('ID ASC');
     // remove add button if record already exists
     if ($businessList->count()) {
         $businessGridFeildConfig->removeComponentsByType('GridFieldAddNewButton');
     }
     $businessGridField = new GridField('Business', 'Business', $businessList, $businessGridFeildConfig);
     $fields->addFieldsToTab('Root.Occupation', array($businessGridField));
     //MonthlyIncome gridfield
     $monthlyIncomeGridFeildConfig = GridFieldConfig_RecordEditor::create();
     $monthlyIncomeList = MonthlyIncome::get()->filter(array('FamilyID' => $this->ID))->sort('ID ASC');
     // remove add button if record already exists
     if ($monthlyIncomeList->count()) {
         $monthlyIncomeGridFeildConfig->removeComponentsByType('GridFieldAddNewButton');
     }
     $monthlyIncomeGridField = new GridField('MonthlyIncome', 'MonthlyIncome', $monthlyIncomeList, $monthlyIncomeGridFeildConfig);
     $fields->addFieldsToTab('Root.Monthly', array($monthlyIncomeGridField));
     //MonthlyExpense gridfield
     $monthlyExpenseGridFeildConfig = GridFieldConfig_RecordEditor::create();
     $monthlyExpenseList = MonthlyExpense::get()->filter(array('FamilyID' => $this->ID))->sort('ID ASC');
     // remove add button if record already exists
     if ($monthlyExpenseList->count()) {
         $monthlyExpenseGridFeildConfig->removeComponentsByType('GridFieldAddNewButton');
     }
     $monthlyExpenseGridField = new GridField('MonthlyExpense', 'MonthlyExpense', $monthlyExpenseList, $monthlyExpenseGridFeildConfig);
     $fields->addFieldsToTab('Root.Monthly', array($monthlyExpenseGridField));
     //Vehicle gridfield
     $vehicleGridFeildConfig = GridFieldConfig_RecordEditor::create();
     $vehicleList = Vehicle::get()->filter(array('FamilyID' => $this->ID))->sort('ID ASC');
     // remove add button if record already exists
     if ($vehicleList->count()) {
         $vehicleGridFeildConfig->removeComponentsByType('GridFieldAddNewButton');
     }
     $vehicleGridField = new GridField('Vehicle', 'Vehicle', $vehicleList, $vehicleGridFeildConfig);
     $fields->addFieldsToTab('Root.OtherDetails', array($vehicleGridField));
     //Appliance gridfield
     $applianceGridFeildConfig = GridFieldConfig_RecordEditor::create();
     $applianceList = Appliance::get()->filter(array('FamilyID' => $this->ID))->sort('ID ASC');
     // remove add button if record already exists
     if ($applianceList->count()) {
         $applianceGridFeildConfig->removeComponentsByType('GridFieldAddNewButton');
     }
     $applianceGridField = new GridField('Appliance', 'Appliance', $applianceList, $applianceGridFeildConfig);
     $fields->addFieldsToTab('Root.OtherDetails', array($applianceGridField));
     //OtherFacility gridfield
     $otherFacilityGridFeildConfig = GridFieldConfig_RecordEditor::create();
     $otherFacilityList = OtherFacility::get()->filter(array('FamilyID' => $this->ID))->sort('ID ASC');
     // remove add button if record already exists
     if ($otherFacilityList->count()) {
         $otherFacilityGridFeildConfig->removeComponentsByType('GridFieldAddNewButton');
     }
     $otherFacilityGridField = new GridField('OtherFacility', 'Other Facility', $otherFacilityList, $otherFacilityGridFeildConfig);
     $fields->addFieldsToTab('Root.OtherDetails', array($otherFacilityGridField));
     //Media gridfield
     $mediaGridFieldConfig = GridFieldConfig_RecordEditor::create();
     $mediaList = Media::get()->filter(array('FamilyID' => $this->ID))->sort('ID ASC');
     // remove add button if record already exists
     if ($mediaList->count()) {
         $mediaGridFieldConfig->removeComponentsByType('GridFieldAddNewButton');
     }
     $mediaGridField = new GridField('Media', 'Media', $mediaList, $mediaGridFieldConfig);
     $fields->addFieldsToTab('Root.OtherDetails', array($mediaGridField));
     //CatholicMagazine gridfield
     $catholicMagazineGridFieldConfig = GridFieldConfig_RecordEditor::create();
     $catholicMagazineList = CatholicMagazine::get()->filter(array('FamilyID' => $this->ID))->sort('ID ASC');
     // remove add button if record already exists
     if ($catholicMagazineList->count()) {
         $catholicMagazineGridFieldConfig->removeComponentsByType('GridFieldAddNewButton');
     }
     $catholicMagazineGridField = new GridField('CatholicMagazine', 'Catholic Magazine', $catholicMagazineList, $catholicMagazineGridFieldConfig);
     $fields->addFieldsToTab('Root.OtherDetails', array($catholicMagazineGridField));
     //Loan gridfield
     $loanGridFieldConfig = GridFieldConfig_RecordEditor::create();
     $loanList = Loan::get()->filter(array('FamilyID' => $this->ID))->sort('ID ASC');
     // remove add button if record already exists
     if ($loanList->count()) {
         $loanGridFieldConfig->removeComponentsByType('GridFieldAddNewButton');
     }
     $loanGridField = new GridField('Loan', 'Loan', $loanList, $loanGridFieldConfig);
     $fields->addFieldsToTab('Root.Financial', array($loanGridField));
     //Saving gridfield
     $savingGridFieldConfig = GridFieldConfig_RecordEditor::create();
     $savingList = Saving::get()->filter(array('FamilyID' => $this->ID))->sort('ID ASC');
     // remove add button if record already exists
     if ($savingList->count()) {
         $savingGridFieldConfig->removeComponentsByType('GridFieldAddNewButton');
     }
     $savingGridField = new GridField('Saving', 'Saving', $savingList, $savingGridFieldConfig);
     $fields->addFieldsToTab('Root.Financial', array($savingGridField));
     //Talent gridfield
     $talentGridFieldConfig = GridFieldConfig_RecordEditor::create();
     $talentList = Talent::get()->filter(array('FamilyID' => $this->ID))->sort('ID ASC');
     // remove add button if record already exists
     if ($talentList->count()) {
         $talentGridFieldConfig->removeComponentsByType('GridFieldAddNewButton');
     }
     $talentGridField = new GridField('Talent', 'Talent', $talentList, $talentGridFieldConfig);
     $fields->addFieldsToTab('Root.Members', array($talentGridField));
     //Contact gridfield
     $contactGridFieldConfig = GridFieldConfig_RecordEditor::create();
     $contactList = Contact::get()->filter(array('FamilyID' => $this->ID))->sort('ID ASC');
     // remove add button if record already exists
     if ($contactList->count()) {
         $contactGridFieldConfig->removeComponentsByType('GridFieldAddNewButton');
     }
     $contactGridField = new GridField('Contact', 'Contact', $contactList, $contactGridFieldConfig);
     $fields->addFieldsToTab('Root.Contact', array($contactGridField));
     return $fields;
 }
Exemplo n.º 20
0
$pdf = Yii::createComponent('application.extensions.tcpdf.ETcPdf', 'P', 'cm', 'A4', true, 'UTF-8');
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor("Terence Monteiro");
$pdf->SetTitle("Mass Booking");
$pdf->SetSubject("Mass Booking");
$pdf->SetKeywords("PDF");
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
#$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->SetFont("times", "R", 16);
$pdf->Cell(0, 0.1, "", 0, 1);
$pdf->Cell(0, 0, strtoupper(Parish::get()->name), 0, 0, 'C');
$pdf->SetFont("courier", "R", 10);
$pAddr = explode("\n", Parish::get()->address);
array_push($pAddr, implode(' - ', array(Parish::get()->city, Parish::get()->pin)));
if (count($pAddr) == 2) {
    array_push($pAddr, '');
}
foreach ($pAddr as $addr) {
    $pdf->Cell(0, 0, $addr, 0, 1, 'R');
}
$pdf->SetFont("courier", "R", 11);
$pdf->Cell(0, 0, "Mass Booking Receipt", 0, 1, 'C');
$trans = $model->trans;
$pdf->Cell(0, 1, '', 0, 1, 'L');
$pdf->Cell(1, 0, '', 0, 0, 'L');
$pdf->SetFont("courier", "R", 10);
$pdf->Cell(0, 0, 'Receipt No.: ' . $model->id, 0, 0, 'L');
$pdf->SetFont("courier", "R", 9.5);
$pdf->Cell(0, 0, $trans->created, 0, 1, 'R');
Exemplo n.º 21
0
 public static function get_parish($parish)
 {
     if (ctype_digit($parish)) {
         return Parish::get()->name;
     } else {
         return $parish;
     }
 }
Exemplo n.º 22
0
#
# Alive Parish Software is distributed in the hope that it will
# be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
/* @var $this SubscriptionController */
/* @var $model Subscription */
$this->breadcrumbs = array('Subscriptions' => array('index'), $model->id);
if (!isset($family)) {
    $family = $model->family;
}
$this->menu = array(array('label' => 'List Subscription', 'url' => array('index', 'fid' => $family->id)), array('label' => 'Create Subscription', 'url' => array('create', 'fid' => $family->id)), array('label' => 'Update Subscription', 'url' => array('update', 'id' => $model->id, 'fid' => $family->id)), array('label' => 'Delete Subscription', 'url' => '#', 'linkOptions' => array('submit' => array('delete', 'id' => $model->id, 'fid' => $family->id), 'confirm' => 'Are you sure you want to delete this item?')), array('label' => 'Manage Subscription', 'url' => array('admin')));
?>

<h1>View Subscription #<?php 
echo $model->id;
?>
</h1>

<?php 
$NF = Yii::app()->numberFormatter;
$cur = Parish::get()->currency;
$this->widget('zii.widgets.CDetailView', array('data' => $model, 'attributes' => array('id', array('label' => 'Family&nbsp;(Head&nbsp;name,&nbsp;id)', 'name' => 'family_id', 'value' => $model->family->head_name . " #" . $model->family->id), array('label' => 'From&nbsp;month', 'name' => 'start_year', 'value' => date_format(new DateTime(implode("-", array($model->start_year, $model->start_month, 1))), "M, Y")), array('label' => 'Till&nbsp;month', 'name' => 'end_year', 'value' => date_format(new DateTime(implode("-", array($model->end_year, $model->end_month, 1))), "M, Y")), array('label' => 'Monthly Amt', 'value' => $NF->formatCurrency($model->amount, $cur)), array('label' => 'Total Amount', 'value' => $NF->formatCurrency($model->trans->amount, $cur)), 'paid_by')));
?>

<?php 
echo CHtml::link('Download Receipt', array('viewRect', 'id' => $model->id), array('target' => '_blank'));
Exemplo n.º 23
0
$pdf->Cell(10, $ht, '', 'BR', 1, 'L');
function show_data($pdf, $label, $value = '', $uc = true)
{
    $pdf->Cell(1, 0);
    $pdf->Cell(7, $pdf->ht, $label, 'BLR', 0, 'L');
    if ($uc) {
        $value = strtoupper($value);
    }
    $pdf->Cell(10, $pdf->ht, $value, 'RB', 1, 'L');
}
show_data($pdf, 'Established Year', Parish::get()->est_year);
show_data($pdf, 'Name of the Parish Priest', $pp->fullname);
show_data($pdf, 'No. of Catholics', $members);
show_data($pdf, 'No. of Families', $families);
show_data($pdf, 'Telephone No.', Parish::get()->phone);
show_data($pdf, 'Mobile No.', $pp->mobile);
show_data($pdf, 'Email ID', $pp->email, false);
show_data($pdf, 'Fax No.');
show_data($pdf, 'Web Site:', Parish::get()->website, false);
foreach ($apps as $app) {
    show_data($pdf, 'Name of the Assistant Parish Priest', $app->fullname);
    show_data($pdf, 'Mobile No.', $app->mobile);
    show_data($pdf, 'Email', $app->email, false);
}
$pdf->SetFont("times", "B", 12);
$y = 27;
$pdf->Text(2, $y, 'Date:');
$pdf->Text(10, $y, 'Seal');
$pdf->Text(15, $y, 'Signature & Name');
$pdf->Output("parish-profile-{$year}.pdf", "I");
Yii::app()->end();