本文整理汇总了PHP中DataForm::process方法的典型用法代码示例。如果您正苦于以下问题:PHP DataForm::process方法的具体用法?PHP DataForm::process怎么用?PHP DataForm::process使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataForm
的用法示例。
在下文中一共展示了DataForm::process方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process
function process()
{
//$this->_details_fields();
$result = parent::process();
switch ($this->_action) {
case "update":
if ($this->on_error()) {
$this->_status = "modify";
$this->_process_uri = $this->rapyd->uri->uri_string();
$this->_details_fields();
$this->_sniff_fields();
$this->_build_buttons();
$this->_rel_script();
$this->build_form();
}
if ($this->on_success()) {
$this->_postprocess_uri .= "/" . $this->rapyd->uri->build_clause("show" . $this->pk_to_URI($this->_dataobject->pk));
if ($this->back_save) {
header("Refresh:0;url=" . $this->back_url);
} else {
redirect("/" . $this->_postprocess_uri, 'refresh');
}
}
break;
case "insert":
if ($this->on_error()) {
$this->_status = "create";
$this->_process_uri = $this->rapyd->uri->uri_string();
$this->_details_fields();
$this->_sniff_fields();
$this->_build_buttons();
$this->_rel_script();
$this->build_form();
}
if ($this->on_success()) {
$this->_postprocess_uri .= $this->pk_to_URI($this->_dataobject->pk);
if ($this->back_save) {
header("Refresh:0;url=" . $this->back_url);
} else {
redirect($this->_postprocess_uri, 'refresh');
}
}
break;
case "delete":
if ($this->on_error()) {
$this->_build_buttons();
if (empty($this->_dataobject->error_message_ar['pre_del'])) {
$this->build_message_form(RAPYD_MSG_0206);
} else {
$this->build_message_form($this->_dataobject->error_message_ar['pre_del']);
}
}
if ($this->on_success()) {
$this->_build_buttons();
if ($this->back_delete) {
header("Refresh:0;url=" . $this->back_url);
} else {
$this->build_message_form(RAPYD_MSG_0202);
}
}
break;
}
switch ($this->_status) {
case "show":
case "modify":
case "create":
//$this->_details_fields();
$this->_build_buttons();
$this->_rel_script();
$this->build_form();
break;
case "delete":
//$this->_details_fields();
$this->_build_buttons();
$this->build_message_form(RAPYD_MSG_0209);
break;
case "unknow_record":
//$this->_details_fields();
$this->_build_buttons();
$this->build_message_form(RAPYD_MSG_0208);
break;
}
}
示例2: process
function process($miview = 'dataform')
{
$result = parent::process();
switch ($this->_action) {
case 'search':
// prepare the WHERE clause
foreach ($this->_fields as $fieldname => $field) {
if ($field->value != '') {
if (strpos($field->name, '_copy') > 0) {
$name = substr($field->db_name, 0, strpos($field->db_name, '_copy'));
} else {
$name = $field->db_name;
}
$field->_getValue();
$field->_getNewValue();
$value = $field->newValue;
switch ($field->clause) {
case 'like':
//$this->db->like($name, $value,$field->like_side);
$comodin = $this->ci->datasis->traevalor('COMODIN');
if (!empty($comodin)) {
$v = str_replace($comodin, '%', $value);
} else {
$v = $value;
}
if ($field->like_side == 'before') {
$v = $this->db->escape('%' . $v);
} elseif ($field->like_side == 'after') {
$v = $this->db->escape($v . '%');
} else {
$v = $this->db->escape('%' . $v . '%');
}
$strlike = "{$name} LIKE {$v}";
$this->db->where($strlike);
break;
case 'orlike':
$this->db->orlike($name, $value);
break;
case 'where':
/*if(is_numeric($value)){
$value =1*$value;
$bool =FALSE;
}else{
$bool=TRUE;
}*/
$this->db->where($name . ' ' . $field->operator, $value);
break;
case 'orwhere':
/*if(is_numeric($value)){
$value =1*$value;
$bool =FALSE;
}else{
$bool=TRUE;
}*/
$this->db->orwhere($name . ' ' . $field->operator, $value);
break;
//..
}
}
}
$this->_build_buttons();
$this->build_form($miview);
break;
case 'reset':
//pulire sessioni
$this->_build_buttons();
$this->build_form($miview);
break;
default:
$this->_build_buttons();
$this->build_form($miview);
break;
}
}
示例3: process
function process()
{
$result = parent::process();
switch ($this->_action) {
case "update":
if ($this->on_error()) {
$this->_status = 'modify';
$this->_process_uri = $this->rapyd->uri->uri_string();
$this->_sniff_fields();
$this->_build_buttons();
$this->build_form();
}
if ($this->on_success()) {
$this->_postprocess_uri .= '/' . $this->rapyd->uri->build_clause('show' . $this->pk_to_URI($this->_dataobject->pk));
if ($this->on_save_redirect) {
if ($this->back_save) {
header("Refresh:0;url=" . $this->back_url);
} else {
redirect('/' . $this->_postprocess_uri, 'refresh');
}
}
}
break;
case "insert":
if ($this->on_error()) {
$this->_status = 'create';
$this->_process_uri = $this->rapyd->uri->uri_string();
$this->_sniff_fields();
$this->_build_buttons();
$this->build_form();
}
if ($this->on_success()) {
$this->_postprocess_uri .= $this->pk_to_URI($this->_dataobject->pk);
if ($this->on_save_redirect) {
if ($this->back_save) {
header("Refresh:0;url=" . $this->back_url);
} else {
redirect($this->_postprocess_uri, 'refresh');
}
}
}
break;
case 'delete':
if ($this->on_error()) {
$this->_build_buttons();
if (empty($this->_dataobject->error_message_ar['pre_del'])) {
$this->build_message_form(RAPYD_MSG_0206);
} else {
$this->build_message_form($this->_dataobject->error_message_ar['pre_del']);
}
}
if ($this->on_success()) {
$this->_build_buttons();
if ($this->back_delete) {
header("Refresh:0;url=" . $this->back_url);
} else {
$this->build_message_form(RAPYD_MSG_0202);
}
}
break;
}
switch ($this->_status) {
case 'show':
case 'modify':
case 'create':
$this->_build_buttons();
$this->build_form();
break;
case 'delete':
$this->_build_buttons();
$this->build_message_form(RAPYD_MSG_0209);
break;
case 'unknow_record':
$this->_build_buttons();
$this->build_message_form(RAPYD_MSG_0208);
break;
}
}
示例4: process
function process()
{
$result = parent::process();
switch ($this->_action) {
case "search":
// prepare the WHERE clause
foreach ($this->_fields as $fieldname => $field) {
if ($field->value != "") {
if (strpos($field->name, "_copy") > 0) {
$name = substr($field->db_name, 0, strpos($field->db_name, "_copy"));
} else {
$name = $field->db_name;
}
$field->_getValue();
$field->_getNewValue();
$value = $field->newValue;
switch ($field->clause) {
case "like":
$this->db->like($name, $value, $field->like_side);
break;
case "orlike":
$this->db->orlike($name, $value);
break;
case "where":
$this->db->where($name . " " . $field->operator, $value);
break;
case "orwhere":
$this->db->orwhere($name . " " . $field->operator, $value);
break;
//..
}
}
}
$this->_build_buttons();
$this->build_form();
break;
case "reset":
//pulire sessioni
$this->_build_buttons();
$this->build_form();
break;
default:
$this->_build_buttons();
$this->build_form();
break;
}
}