本文整理汇总了PHP中cobalt_load_class函数的典型用法代码示例。如果您正苦于以下问题:PHP cobalt_load_class函数的具体用法?PHP cobalt_load_class怎么用?PHP cobalt_load_class使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cobalt_load_class函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display_citizen_name
function display_citizen_name($citizen_id)
{
$dbh_citizen = cobalt_load_class('citizen');
$dbh_citizen->set_fields('first_name,middle_name,last_name');
$dbh_citizen->set_where("citizen_id='{$citizen_id}'");
$dbh_citizen->exec_fetch('single');
// debug($dbh_citizen->dump);
$citizen_name = '';
if (empty($dbh_citizen->dump)) {
//skip
} else {
$first_name = $dbh_citizen->dump['first_name'];
$middle_name = $dbh_citizen->dump['middle_name'];
$last_name = $dbh_citizen->dump['last_name'];
$citizen_name = $first_name . ' ' . $middle_name . ' ' . $last_name . ' ';
}
return $citizen_name;
}
示例2: init_cobalt
<?php
//******************************************************************
//This file was generated by Cobalt, a rapid application development
//framework developed by JV Roig (jvroig@jvroig.com).
//
//Cobalt on the web: http://cobalt.jvroig.com
//******************************************************************
require 'path.php';
init_cobalt('View questionnaire');
require 'reporter_class.php';
$reporter = cobalt_load_class('questionnaire_rpt');
require 'components/reporter_result_query_constructor.php';
require 'components/reporter_result_body.php';
示例3: init_cobalt
<?php
//****************************************************************************************
//Generated by Cobalt, a rapid application development framework. http://cobalt.jvroig.com
//Cobalt developed by JV Roig (jvroig@jvroig.com)
//****************************************************************************************
require 'path.php';
init_cobalt('View zone');
require 'reporter_class.php';
$reporter = cobalt_load_class('zone_rpt');
//$reporter->print_settings(); //You can uncomment this line to get the PHP code for the settings arrays. You can
//use one or more of the arrays to customize the report output or deal with special cases
//(adding special aliases, overriding labels for tables with similar field names, etc)
require 'components/reporter_interface_proc.php';
require 'components/reporter_interface_head.php';
for ($i = 0; $i < $num_fields; ++$i) {
init_var($text_field[$i]);
require 'components/reporter_interface_body.php';
}
require 'components/reporter_interface_foot.php';
示例4: init_cobalt
<?php
//****************************************************************************************
//Generated by Cobalt, a rapid application development framework. http://cobalt.jvroig.com
//Cobalt developed by JV Roig (jvroig@jvroig.com)
//****************************************************************************************
require 'path.php';
init_cobalt('View employee');
require_once 'thirdparty/tcpdf/tcpdf.php';
require_once 'reporter_class.php';
$reporter = cobalt_load_class('employee_rpt');
$sess_var = $reporter->session_array_name;
$title = $reporter->report_title;
require_once 'components/reporter_result_pdf.php';
// close and output PDF document
$pdf_filename = $_SESSION['user'] . '_' . $sess_var . '_' . date('Y-m-d_h-ia') . '.pdf';
$pdf->Output($pdf_filename, 'I');
示例5: sanitize
function sanitize(&$param)
{
$lst_error = '';
require_once 'validation_class.php';
require_once 'char_set_class.php';
$validator = new validation();
//Check if some required fields are left blank.
foreach ($this->fields as $field_name => $field_details) {
$label = $field_details['label'];
$required = $field_details['required'];
if ($required) {
init_var($param[$field_name]);
$lst_error .= $validator->check_if_null($label, $param[$field_name]);
}
}
foreach ($param as $unclean => $unclean_value) {
if (isset($this->fields[$unclean])) {
$length = $this->fields[$unclean]['length'];
$data_type = $this->fields[$unclean]['data_type'];
$attribute = $this->fields[$unclean]['attribute'];
$control_type = $this->fields[$unclean]['control_type'];
$label = $this->fields[$unclean]['label'];
$char_set_method = $this->fields[$unclean]['char_set_method'];
$char_set_allow_space = $this->fields[$unclean]['char_set_allow_space'];
$extra_chars_allowed = $this->fields[$unclean]['extra_chars_allowed'];
$trim = $this->fields[$unclean]['trim'];
$valid_set = $this->fields[$unclean]['valid_set'];
//Apply trimming if specified.
//Triming should be applied to $unclean_value for purposes of further filtering/checking,
//and then also applied to $param[$unclean] so as to actually affect the POST variable.
if (strtolower($trim) == 'trim') {
$unclean_value = trim($unclean_value);
$param[$unclean] = trim($unclean_value);
} elseif (strtolower($trim) == 'ltrim') {
$unclean_value = ltrim($unclean_value);
$param[$unclean] = ltrim($unclean_value);
} elseif (strtolower($trim) == 'rtrim') {
$unclean_value = rtrim($unclean_value);
$param[$unclean] = rtrim($unclean_value);
}
//Check length
if ($length > 0) {
if (strlen($unclean_value) > $length) {
$lst_error .= "The field '{$label}' can only accept {$length} characters.<br>";
}
}
$validator = new validation();
//If there is a set of valid inputs, check if 'unclean' conforms to it.
if (count($valid_set) > 1) {
if ($unclean_value == '') {
//No need to check because no value was submitted.
} else {
$validator->check_data_set($unclean_value, $valid_set, TRUE);
if ($validator->validity == FALSE) {
$lst_error .= $validator->error_message . $label . '<br>';
}
}
} else {
//If a char set method is given, check 'unclean' for invalid characters
if ($char_set_method != '') {
$cg = new char_set();
$cg->allow_space = $char_set_allow_space;
$cg->{$char_set_method}($extra_chars_allowed);
$allowed = $cg->allowed_chars;
$validator->field_name = $label;
$validator->validate_data($unclean_value, $data_type, $allowed);
if ($validator->validity == FALSE) {
$cntInvalidChars = count($validator->invalid_chars);
if ($cntInvalidChars == 1) {
$lst_error .= "Invalid character found in '{$label}': " . cobalt_htmlentities($validator->invalid_chars[0]) . '<br>';
} elseif ($cntInvalidChars > 1) {
$lst_error .= "Invalid characters found in '{$label}': ";
for ($a = 0; $a < $cntInvalidChars; ++$a) {
$lst_error .= cobalt_htmlentities($validator->invalid_chars[$a]) . ' ';
}
$lst_error .= '<br>';
}
}
}
}
}
}
//determine if multifield data needs to be sanitized
foreach ($this->relations as $rel_info) {
if ($rel_info['type'] == '1-M') {
$subclass = cobalt_load_class($rel_info['table']);
$lst_error .= $subclass->sanitize_mf($param)->lst_error;
}
}
$this->lst_error = $lst_error;
return $this;
}
示例6: init_cobalt
<?php
//******************************************************************
//This file was generated by Cobalt, a rapid application development
//framework developed by JV Roig (jvroig@jvroig.com).
//
//Cobalt on the web: http://cobalt.jvroig.com
//******************************************************************
require 'path.php';
init_cobalt('View user role');
require 'thirdparty/tcpdf/tcpdf.php';
require 'reporter_class.php';
$reporter = cobalt_load_class('user_role_rpt');
$sess_var = $reporter->session_array_name;
$title = $reporter->report_title;
require 'components/reporter_result_pdf.php';
// close and output PDF document
$pdf_filename = $_SESSION['user'] . '_' . $sess_var . '_' . date('Y-m-d_h-ia') . '.pdf';
$pdf->Output($pdf_filename, 'I');
示例7: init_cobalt
<?php
//****************************************************************************************
//Generated by Cobalt, a rapid application development framework. http://cobalt.jvroig.com
//Cobalt developed by JV Roig (jvroig@jvroig.com)
//****************************************************************************************
require 'path.php';
init_cobalt('View notification');
require 'reporter_class.php';
$reporter = cobalt_load_class('notification_rpt');
require 'components/reporter_result_query_constructor.php';
require 'components/reporter_result_body.php';
示例8: init_cobalt
<?php
//******************************************************************
//This file was generated by Cobalt, a rapid application development
//framework developed by JV Roig (jvroig@jvroig.com).
//
//Cobalt on the web: http://cobalt.jvroig.com
//******************************************************************
require 'path.php';
init_cobalt('View cobalt sst');
require 'reporter_class.php';
$reporter = cobalt_load_class('cobalt_sst_rpt');
//$reporter->print_settings(); //You can uncomment this line to get the PHP code for the settings arrays. You can
//use one or more of the arrays to customize the report output or deal with special cases
//(adding special aliases, overriding labels for tables with similar field names, etc)
require 'components/reporter_interface_proc.php';
require 'components/reporter_interface_head.php';
for ($i = 0; $i < $num_fields; ++$i) {
init_var($text_field[$i]);
require 'components/reporter_interface_body.php';
}
require 'components/reporter_interface_foot.php';
示例9: init_cobalt
<?php
//******************************************************************
//This file was generated by Cobalt, a rapid application development
//framework developed by JV Roig (jvroig@jvroig.com).
//
//Cobalt on the web: http://cobalt.jvroig.com
//******************************************************************
require 'path.php';
init_cobalt('View resume hdr');
require_once 'thirdparty/tcpdf/tcpdf.php';
require_once 'reporter_class.php';
$reporter = cobalt_load_class('resume_hdr_rpt');
$sess_var = $reporter->session_array_name;
$title = $reporter->report_title;
require_once 'components/reporter_result_pdf.php';
// close and output PDF document
$pdf_filename = $_SESSION['user'] . '_' . $sess_var . '_' . date('Y-m-d_h-ia') . '.pdf';
$pdf->Output($pdf_filename, 'I');
示例10: get_report_fields
function get_report_fields()
{
//Check if there are valid relationships
$ENABLE_ALIAS = FALSE;
foreach ($this->relations as $relation_data) {
if ($relation_data['type'] == '1-1') {
$ENABLE_ALIAS = TRUE;
$alias_index = 0;
}
}
foreach ($this->fields as $dd_field_name => $dd_field_data) {
if ($dd_field_data['rpt_in_report'] == TRUE && $dd_field_data['attribute'] != 'foreign key' && $dd_field_data['attribute'] != 'primary&foreign key') {
$label = $dd_field_data['label'];
$this->arr_rpt_fields[] = $label;
$this->arr_rpt_column_alignments[$label] = $dd_field_data['rpt_column_alignment'];
$this->arr_rpt_column_formats[$label] = $dd_field_data['rpt_column_format'];
$this->arr_rpt_show_sum[$label] = $dd_field_data['rpt_show_sum'];
if ($ENABLE_ALIAS) {
$this->arr_rpt_fields_sql[$label] = 'a.' . $dd_field_name;
} else {
$this->arr_rpt_fields_sql[$label] = $dd_field_name;
}
}
if ($dd_field_data['attribute'] == 'foreign key' || $dd_field_data['attribute'] == 'primary&foreign key') {
foreach ($this->relations as $relation_data) {
if ($relation_data['type'] == '1-1') {
if ($relation_data['link_child'] == $dd_field_name) {
$obj_related_table = cobalt_load_class($relation_data['table']);
$arr_related_fields = $obj_related_table->fields;
$alias = $this->arr_alias[$alias_index];
++$alias_index;
foreach ($arr_related_fields as $rel_field_name => $rel_field_data) {
//We check if it is not a foreign key because we only want to include directly related tables.
if ($rel_field_data['rpt_in_report'] == TRUE && $rel_field_data['attribute'] != 'foreign key') {
$label = '[' . ucwords(str_replace('_', ' ', $relation_data['table'])) . '] ' . $rel_field_data['label'];
$this->arr_rpt_fields[] = $label;
$this->arr_rpt_column_alignments[$label] = $rel_field_data['rpt_column_alignment'];
$this->arr_rpt_column_formats[$label] = $rel_field_data['rpt_column_format'];
$this->arr_rpt_show_sum[$label] = $rel_field_data['rpt_show_sum'];
if ($ENABLE_ALIAS) {
$this->arr_rpt_fields_sql[$label] = $alias . '.' . $rel_field_name;
} else {
$this->arr_rpt_fields_sql[$label] = $rel_field_name;
}
}
}
}
}
}
}
}
return $this;
}
示例11: cobalt_load_class
$html->draw_field('mother_contact_number');
echo '</td>';
echo "<td>Mother's Occupation :</td>";
echo '<td>';
$html->draw_field('mother_occupation');
echo '</td>';
echo '</tr>';
echo '</table>';
echo '</div>';
//end tag of tabs-7 id
//tab8
echo '<div id="tabs-8">';
echo '<table>';
echo '<tr>';
echo '<td>';
$obj_validate = cobalt_load_class('validate_html');
$obj_validate->fields['status']['control_type'] = 'hidden';
$obj_validate->draw_controls_mf();
echo '</td>';
echo '</tr>';
echo '<table>';
echo '<tr>';
echo '<td>Are you a Citizen of the barangay?</td>';
echo '<td>';
$html->draw_field('is_citizen');
echo '</td>';
echo '</tr>';
echo '</table>';
echo '</table>';
echo '</div>';
//end tag of tabs-8 id