function draw(&$form) { parent::draw($form); reset($this->options); if ($this->updatable) { $myText = new CHAW_text($this->title . $this->labelseparator); $myText->set_br(0); } else { while ($tok = each($this->options)) { //$mySelect->add_option($tok[1][1], $tok[1][0], $selected); if ($tok[1][0] == $this->value) { $value = $tok[1][1]; } } $myText = new CHAW_text($this->title . $this->labelseparator . ' ' . $value); } $form->add_text($myText); if ($this->updatable) { $mySelect = new CHAW_select($this->key); while ($tok = each($this->options)) { $selected = $tok[1][0] == $this->value ? HAW_SELECTED : HAW_NOTSELECTED; $mySelect->add_option($tok[1][1], $tok[1][0], $selected); } $form->add_select($mySelect); $text = new CHAW_text(''); $form->add_text($text); } }
function draw(&$form) { parent::draw($form); if (!$this->_checkboxes_loaded) { $this->_checkboxes(false); } if ($this->form->noproc) { $this->_checkboxes(true); } $text = new CHAW_text($this->title . $this->labelseparator); $text->set_br(1); if (!empty($this->title)) { $form->add_text($text); } $count = 0; foreach ($this->checklist_checkboxes as $index => $checkbox) { if ($this->updatable) { $count++; if ($count % $this->cols != 0) { $checkbox->set_br(0); } $form->add_input($checkbox); } else { if ($checkbox->value > 0) { $myText = new CHAW_text($checkbox->label . $this->labelseparator . ' ' . $checkbox->value); $form->add_text($myText); } } } }
function draw(&$form) { parent::draw($form); $text = new CHAW_text($this->title . $this->labelseparator); $text->set_br(0); if (!empty($this->title)) { $form->add_text($text); } $mySelect = new CHAW_select($this->key); global $_CAMILA; $_CAMILA['db']->SetFetchMode(ADODB_FETCH_ASSOC); $result = $_CAMILA['db']->Execute($this->query); if ($result === false) { camila_error_page(camila_get_translation('camila.sqlerror') . ' ' . $_CAMILA['db']->ErrorMsg()); } $val = ''; while (!$result->EOF) { if ($result->fields[$this->lbkey] == $this->value) { $mySelect->add_option($result->fields[$this->lbvalue], $result->fields[$this->lbkey], HAW_SELECTED); $val = $result->fields[$this->lbvalue]; } else { $mySelect->add_option($result->fields[$this->lbvalue], $result->fields[$this->lbkey]); } $result->MoveNext(); } if ($this->updatable) { $form->add_select($mySelect); $text = new CHAW_text(''); $form->add_text($text); } else { $text = new CHAW_text($val); $form->add_text($text); } }
function draw(&$form) { parent::draw($form); if (!$this->_checkboxes_loaded) { $this->_checkboxes(false); } if ($this->form->noproc) { $this->_checkboxes(true); } $text = new CHAW_text($this->title . $this->labelseparator); $text->set_br(1); if (!empty($this->title)) { $form->add_text($text); } $select_all = new CHAW_js('<div class="camilacheckall" id="camilacheckall"><a id="CheckAll_' . $this->key . '" href="">' . camila_get_translation('camila.form.checkall') . '</a> ' . camila_get_translation('camila.form.checkallseparator') . ' <a id="UncheckAll_' . $this->key . '" href="">' . camila_get_translation('camila.form.uncheckall') . '</a></div>'); $form->add_userdefined($select_all); $count = 0; foreach ($this->checklist_checkboxes as $index => $checkbox) { $checkbox->cols = $this->cols; if ($this->updatable) { $count++; if ($count % $this->cols != 0) { $checkbox->set_br(0); } $form->add_checkbox($checkbox); } else { if ($checkbox->is_checked()) { $myText = new CHAW_text($checkbox->label); $form->add_text($myText); } } } }
function draw(&$form) { parent::draw($form); $text = new CHAW_text($this->title . $this->labelseparator); $text->set_br(0); if (!empty($this->title)) { $form->add_text($text); } $mySelect = $this->_get_select(); if ($this->updatable) { $form->add_select($mySelect); $text = new CHAW_text(''); $form->add_text($text); } else { $text = new CHAW_text($val); $form->add_text($text); } }
function draw(&$form) { parent::draw($form); $text = new CHAW_text($this->title . $this->labelseparator); $text->set_br(1); if (!empty($this->title)) { $form->add_text($text); } $select_all = new CHAW_js('<div class="camilacheckall" id="camilacheckall"><a id="CheckAll_' . $this->key . '" href="">' . camila_get_translation('camila.form.checkall') . '</a> ' . camila_get_translation('camila.form.checkallseparator') . ' <a id="UncheckAll_' . $this->key . '" href="">' . camila_get_translation('camila.form.uncheckall') . '</a></div>'); $form->add_userdefined($select_all); global $_CAMILA; $_CAMILA['db']->SetFetchMode(ADODB_FETCH_ASSOC); $result = $_CAMILA['db']->Execute($this->query); if ($result === false) { camila_error_page(camila_get_translation('camila.sqlerror') . ' ' . $_CAMILA['db']->ErrorMsg()); } $count = 0; // while (!$result->EOF) { for ($i = 0; $i < count($this->values); $i++) { // $myHidden = new CHAW_hidden($this->key . '_labels_'.$count, $result->fields[$this->label_field]); // $form->add_input($myHidden); if ($this->values[$i] == '') { $myImage = new CHAW_image(CAMILA_IMG_DIR . 'wbmp/nocheck.wbmp', CAMILA_IMG_DIR . 'png/nocheck.png', '-'); $myImage->set_br(0); $form->add_image($myImage); $text = new CHAW_text($this->labels[$i]); $form->add_text($text); } else { if (in_array($this->values[$i], $this->value)) { $myCheckbox = new CHAW_checkbox($this->key . '_' . $i, $this->values[$i], $this->labels[$i], HAW_SELECTED); } else { $myCheckbox = new CHAW_checkbox($this->key . '_' . $i, $this->values[$i], $this->labels[$i]); } $form->add_checkbox($myCheckbox); $this->checked++; } $count++; // $result->MoveNext(); } // $myHidden = new CHAW_hidden($this->key . '_count', $count); // $form->add_input($myHidden); }
function draw(&$form) { parent::draw($form); $text = new CHAW_text($this->title . $this->labelseparator); $text->set_br(1); if (!empty($this->title)) { $form->add_text($text); } if (count($this->labels) > 1) { $select_all = new CHAW_js('<div class="camilacheckall" id="camilacheckall"><a id="CheckAll_' . $this->key . '" href="">' . camila_get_translation('camila.form.checkall') . '</a> ' . camila_get_translation('camila.form.checkallseparator') . ' <a id="UncheckAll_' . $this->key . '" href="">' . camila_get_translation('camila.form.uncheckall') . '</a></div>'); $form->add_userdefined($select_all); } global $_CAMILA; $count = 0; foreach ($this->values as $key => $value) { $myHidden = new CHAW_hidden($this->key . '_labels_' . $count, $this->labels[$count]); $form->add_input($myHidden); if ($this->values[$count] == '') { $myImage = new CHAW_image(CAMILA_IMG_DIR . 'wbmp/nocheck.wbmp', CAMILA_IMG_DIR . 'png/nocheck.png', '-'); $myImage->set_br(0); $form->add_image($myImage); $text = new CHAW_text($this->labels[$count]); $form->add_text($text); } else { if (in_array($fields[$count], $this->value)) { $myCheckbox = new CHAW_checkbox($this->key . '_' . $count, $this->values[$count], $this->labels[$count], HAW_SELECTED); } else { $myCheckbox = new CHAW_checkbox($this->key . '_' . $count, $this->values[$count], $this->labels[$count]); } if (($count + 1) % $this->cols != 0 && count($this->labels) > 1) { $myCheckbox->set_br(0); } $form->add_checkbox($myCheckbox); $this->checked++; } $count++; } // $myHidden = new CHAW_hidden($this->key . '_count', $count); // $form->add_input($myHidden); }
Camila PHP Framework 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 Camila PHP Framework; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ require_once CAMILA_DIR . 'datagrid/form.class.php'; require_once CAMILA_DIR . 'datagrid/elements/form/hidden.php'; require_once CAMILA_DIR . 'datagrid/elements/form/filebox.php'; require_once CAMILA_DIR . 'datagrid/elements/form/textbox.php'; require_once CAMILA_DIR . 'datagrid/elements/form/template_file_listbox.php'; require_once CAMILA_DIR . 'datagrid/elements/form/checklist.php'; require_once CAMILA_DIR . 'datagrid/elements/form/text_separator.php'; $export_deck_title = new CHAW_text(camila_get_translation('camila.export.options'), $_CAMILA['page_title_attributes']); $export_deck_title->set_br(2); $export_deck_title->set_color($_CAMILA['page_title_color'], $_CAMILA['page_title_boxcolor']); $_CAMILA['page']->add_text($export_deck_title); $form = new phpform('camila'); $form->submitbutton = camila_get_translation('camila.export.xml2pdf'); $form->drawrules = false; $form->preservecontext = true; global $_CAMILA; $pos = strrpos($_CAMILA['page_url'], '?'); if ($pos !== false) { new form_hidden($form, substr($_CAMILA['page_url'], $pos + 1)); } new form_template_file_listbox($form, 'xml2pdf', camila_get_translation('camila.export.template'), CAMILA_TMPL_DIR . '/' . $_CAMILA['lang'], false, $_CAMILA['adm_usergroup'], '', true); new form_text_separator(&$form, camila_get_translation('camila.export.options')); $nodata = 'n';
function _editcolumns() { global $_CAMILA; $form = new CHAW_form($_SERVER['PHP_SELF']); foreach ($_REQUEST as $key => $value) { if (!is_array($value)) { $myInput = new CHAW_hidden($key, $value); if ($key == 'camila_editcols' || substr($key, 0, 1) == 'f' && $value == 'y') { $export_format = $key; } else { $form->add_input($myInput); } } else { foreach ($value as $k => $v) { $myInput = new CHAW_hidden($key . '[' . $k . ']', $v); $form->add_input($myInput); } } } $select_all = new CHAW_js('<div class="camilacheckall" id="camilacheckall"><a id="CheckAll_' . $this->key . '" href="">' . camila_get_translation('camila.form.checkall') . '</a> ' . camila_get_translation('camila.form.checkallseparator') . ' <a id="UncheckAll_' . $this->key . '" href="">' . camila_get_translation('camila.form.uncheckall') . '</a></div>'); $form->add_userdefined($select_all); $arr = unserialize($_COOKIE[$this->editcolumscookiename]); if ($_COOKIE[$this->editcolumscookiename] == '' || count($arr) > 0 && $arr[$b] == 'f' . $b) { $new_stmt .= $this->stmtfields[$a] . ','; $count++; } for ($a = 0; $a < $this->stmtnumoffields; $a++) { $b = $a + 1; if ($_COOKIE[$this->editcolumscookiename] == '') { if (isset($_REQUEST['f' . $b]) && $_REQUEST['f' . $b] == 'y' || in_array('f' . $b, $_REQUEST['camila_f']) || isset($_REQUEST['camila_f' . $b]) && $_REQUEST['camila_f' . $b] == 'y') { $myCheckbox = new CHAW_checkbox('camila_f' . '[' . $b . ']', 'f' . $b, $this->map($this->stmtfields[$a]), HAW_SELECTED); } else { $myCheckbox = new CHAW_checkbox('camila_f' . '[' . $b . ']', 'f' . $b, $this->map($this->stmtfields[$a])); } if ($b % 2 != 0) { $myCheckbox->set_br(0); } $myCheckbox->cols = 2; } else { $arr = unserialize($_COOKIE[$this->editcolumscookiename]); if ($arr[$b] == 'f' . $b) { $myCheckbox = new CHAW_checkbox('camila_f' . '[' . $b . ']', 'f' . $b, $this->map($this->stmtfields[$a]), HAW_SELECTED); } else { $myCheckbox = new CHAW_checkbox('camila_f' . '[' . $b . ']', 'f' . $b, $this->map($this->stmtfields[$a])); } if ($b % 2 != 0) { $myCheckbox->set_br(0); } $myCheckbox->cols = 2; } $form->add_checkbox($myCheckbox); } $myHidden = new CHAW_hidden('count', $count); $form->add_hidden($myHidden); $text = new CHAW_text(''); $text->set_br(2); $form->add_text($text); $theSubmission = new CHAW_submit('Ok', 'camila_save'); $form->add_submit($theSubmission); $_CAMILA['page']->add_form($form); }
function print_title() { global $_CAMILA; $text = new CHAW_text($this->title . ': ', HAW_TEXTFORMAT_BOLD); $text->set_br(0); if ($this->value != '') { $_CAMILA['page']->add_text($text); } }
function draw(&$form) { parent::draw($form); global $_CAMILA; $this->tDate = ''; $this->tFormat = ''; $fmt = ''; $fmt2 = ''; $f = array(); $m = camila_get_translation('camila.dateformat.monthpos'); $d = camila_get_translation('camila.dateformat.daypos'); $y = camila_get_translation('camila.dateformat.yearpos'); $f[$m] = 'm'; $f[$d] = 'd'; $f[$y] = 'Y'; ksort($f); reset($f); $count = 0; while (list($k, $v) = each($f)) { $fmt .= $v; $fmt2 .= '%' . $v; $this->tFormat .= camila_get_translation('camila.dateformat.placeholder.' . $v); if ($count < 2) { $fmt .= camila_get_translation('camila.dateformat.separator'); $fmt2 .= camila_get_translation('camila.dateformat.separator'); $this->tFormat .= camila_get_translation('camila.date.separator'); } $count++; } if ($this->value != '') { $this->tDate = $_CAMILA['db']->UserTimeStamp($this->value, $fmt); $this->value_hour = $_CAMILA['db']->UserTimeStamp($this->value, 'H'); $this->value_minute = $_CAMILA['db']->UserTimeStamp($this->value, 'i'); } if ($this->updatable && !isset($_REQUEST['camila_inline_field'])) { $myInput = new CHAW_input($this->key, $this->tDate, $this->title . ' - Data (' . $this->tFormat . ')' . $this->labelseparator); if ($this->maxlength > 0) { $myInput->set_maxlength($this->maxlength); } if ($this->size > 0) { $myInput->set_size($this->size); } $myInput->set_br(1); $form->add_input($myInput); $code = '<link rel="stylesheet" type="text/css" media="all" href="' . CAMILA_LIB_DIR . 'jscalendar/' . $this->calendar_theme_file . '" />'; $code .= '<script src=\'' . CAMILA_LIB_DIR . 'jscalendar/calendar.js\' type=\'text/javascript\'></script>'; $code .= '<script src=\'' . CAMILA_LIB_DIR . 'jscalendar/' . $this->calendar_lang_file . '\' type=\'text/javascript\'></script>'; $code .= '<script src=\'' . CAMILA_LIB_DIR . 'jscalendar/' . $this->calendar_setup_file . '\' type=\'text/javascript\'></script>'; $_CAMILA['page']->camila_add_js($code, 'jscalendar'); $code = '<script type=\'text/javascript\'>xParent(\'' . $this->key . '\',true).removeChild(xNextSib(\'' . $this->key . '\',\'br\'))</script>'; $js = new CHAW_js($code); $form->add_userdefined($js); $popup = new CHAW_js("<a href=\"#\" id=\"f-calendar-trigger-" . $this->key . "\"><img src=\"" . CAMILA_LIB_DIR . "jscalendar/img.gif\" alt=\"\" align=\"middle\" border=\"0\"></a><script type=\"text/javascript\">Calendar.setup({\"ifFormat\":\"" . $fmt2 . "\",\"daFormat\":\"" . $fmt2 . "\",\"firstDay\":1,\"showsTime\":false,\"showOthers\":false,\"timeFormat\":12,\"inputField\":\"" . $this->key . "\",\"button\":\"f-calendar-trigger-" . $this->key . "\"});</script>"); $form->add_userdefined($popup); $myText = new CHAW_text(' Ora' . $this->labelseparator); $myText->set_br(0); $form->add_text($myText); $tok = strtok('00,01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,19,20,21,22,23', ','); while ($tok) { $pos = strpos($tok, ';'); if ($pos === false) { $this->hour_options[] = array($tok, $tok); } else { $this->hour_options[] = array(substr($tok, 0, $pos), substr($tok, $pos + 1)); } $tok = strtok(','); } $mySelect = new CHAW_select($this->key . '_hour'); while ($tok = each($this->hour_options)) { $selected = $tok[1][0] == $this->value_hour ? HAW_SELECTED : HAW_NOTSELECTED; $mySelect->add_option($tok[1][1], $tok[1][0], $selected); } $form->add_select($mySelect); $text = new CHAW_text(':'); $text->set_br(0); $form->add_text($text); $this->minute_options = array(); for ($i = 0; $i < 60; $i += 60 / $this->hslots) { $this->minute_options[] = array(str_pad($i, 2, '0', STR_PAD_LEFT), str_pad($i, 2, '0', STR_PAD_LEFT)); } $mySelect = new CHAW_select($this->key . '_minute'); while ($tok = each($this->minute_options)) { $selected = $tok[1][0] == $this->value_minute ? HAW_SELECTED : HAW_NOTSELECTED; $mySelect->add_option($tok[1][1], $tok[1][0], $selected); } $form->add_select($mySelect); $text = new CHAW_text(''); $form->add_text($text); } elseif (isset($_REQUEST['camila_inline_field'])) { $fVal = $this->tDate . ' ' . $this->value_hour . camila_get_translation('camila.time.separator') . $this->value_minute . camila_get_translation('camila.time.separator') . '00'; $mySelect = new CHAW_select($this->key); if ($this->value == '-' || $this->value == '') { $mySelect->add_option('-', '-', HAW_SELECTED); } else { $mySelect->add_option($fVal, $fVal, HAW_SELECTED); $mySelect->add_option('-', '-', HAW_NOTSELECTED); } $now = $_CAMILA['db']->UserTimeStamp(date('Y-m-d H:i:s'), $fmt) . ' ' . date('H') . camila_get_translation('camila.time.separator') . date('i') . camila_get_translation('camila.time.separator') . '00'; $fVal = $this->tDate . ' ' . $this->value_hour . camila_get_translation('camila.time.separator') . $this->value_minute . camila_get_translation('camila.time.separator') . '00'; if ($fVal == $now) { $mySelect->add_option($now, $now, HAW_SELECTED); } else { $mySelect->add_option($now, $now, HAW_NOTSELECTED); } $form->add_select($mySelect); } else { if ($this->value_hour != '00' || $this->value_minute != '00') { $myText = new CHAW_text($this->title . $this->labelseparator . ' ' . $this->tDate . ' - Ore ' . $this->value_hour . camila_get_translation('camila.time.separator') . $this->value_minute); } else { $myText = new CHAW_text($this->title . $this->labelseparator . ' ' . $this->tDate); } $form->add_text($myText); } }
function camila_information_text($msg) { global $_CAMILA; $text = new CHAW_text($msg, HAW_TEXTFORMAT_BOLD); $text->set_br(2); $text->set_color('red'); $_CAMILA['page']->add_text($text); }
function draw_footer() { if (!$this->drawnavigationbox) { return; } global $_CAMILA; if ($this->rows > 0 && !$_CAMILA['page']->camila_exporting()) { if ($this->page > 2) { $myLink = new CHAW_link(camila_get_translation('camila.report.navbox.first'), basename($_SERVER['PHP_SELF']) . $this->urlappend . '&f0=' . $_REQUEST['f0'] . '&camila_pagnum=1'); $myLink->set_br(0); $_CAMILA['page']->add_link($myLink); $text = new CHAW_text(' | '); $text->set_br(0); $_CAMILA['page']->add_text($text); } if ($this->page > 1) { $myLink = new CHAW_link(camila_get_translation('camila.report.navbox.prev'), basename($_SERVER['PHP_SELF']) . $this->urlappend . '&f0=' . $_REQUEST['f0'] . '&camila_pagnum=' . ($this->page - 1)); $myLink->set_br(0); $_CAMILA['page']->add_link($myLink); } $text = new CHAW_text(' ' . camila_get_translation('camila.report.navbox.page') . ' ' . $this->page . '/' . ceil($this->totalrows / $this->rows) . ' '); $text->set_br(0); $_CAMILA['page']->add_text($text); if ($this->page < ceil($this->totalrows / $this->rows)) { $myLink = new CHAW_link(camila_get_translation('camila.report.navbox.next'), basename($_SERVER['PHP_SELF']) . $this->urlappend . '&f0=' . $_REQUEST['f0'] . '&camila_pagnum=' . ($this->page + 1)); $myLink->set_br(0); $_CAMILA['page']->add_link($myLink); } if ($this->page < ceil($this->totalrows / $this->rows) - 1) { $text = new CHAW_text(' | '); $text->set_br(0); $_CAMILA['page']->add_text($text); $myLink = new CHAW_link(camila_get_translation('camila.report.navbox.last'), basename($_SERVER['PHP_SELF']) . $this->urlappend . '&f0=' . $_REQUEST['f0'] . '&camila_pagnum=' . ceil($this->totalrows / $this->rows)); $myLink->set_br(0); $_CAMILA['page']->add_link($myLink); } $text = new CHAW_text(' | '); $text->set_br(0); $_CAMILA['page']->add_text($text); $myLink = new CHAW_link(camila_get_translation('camila.report.navbox.allpages') . ' (' . $this->totalfiles . ' ' . camila_get_translation('camila.report.navbox.files') . ' ' . $this->_convertfilesize($this->totalfilesize) . ' ' . camila_get_translation('camila.report.navbox.occupied') . ')', basename($_SERVER['PHP_SELF']) . $this->urlappend . '&f0=' . $_REQUEST['f0'] . '&camila_pagnum=-1'); $myLink->set_br(0); if ($this->page > 0) { $_CAMILA['page']->add_link($myLink); } } if (!$_CAMILA['page']->camila_exporting()) { if (isset($this->additional_links)) { foreach ($this->additional_links as $key => $value) { $text = new CHAW_text(' | '); $text->set_br(0); $_CAMILA['page']->add_text($text); $link = new CHAW_link($key, $value); $link->set_br(0); $_CAMILA['page']->add_link($link); } } $text = new CHAW_text(''); $_CAMILA['page']->add_text($text); } }
function draw(&$form) { parent::draw($form); global $_CAMILA; if (is_array($this->form->fields[$this->field . '_camilauploaded']->value)) { $text = new CHAW_text(camila_get_translation('camila.fm.filealreadyuploaded')); $text->set_br(1); $form->add_text($text); } foreach ($this->form->fields[$this->field . '_camilauploaded']->value as $key => $value) { if ($this->extfsenabled) { $text = new CHAW_text(substr($value, 0, -CAMILA_FM_PREFIX)); } else { $text = new CHAW_text($value); } //$text = new CHAW_text(fm_name($value, $this->usergroup)); $text->set_br(1); $form->add_text($text); } $text = new CHAW_text(''); $text->set_br(1); $form->add_text($text); $myFile = new CHAW_file($this->key . '[]', $this->title . $this->labelseparator, $this->size, $this->maxsize); $myFile->set_br(1); //$mySelect = fm_select_group_dir($this->key.'_camiladir[]', $this->usergroup); for ($i = 0; $i < 1; $i++) { $form->add_userdefined($myFile); // $text = new CHAW_text(camila_get_translation('camila.fm.intofolder') . ': '); // $text->set_br(0); // if ($this->selectuploadfolder) { // $form->add_text($text); //$form->add_select($mySelect); // $text = new CHAW_text(''); // $text->set_br(0); $form->add_text($text); // } } $text = new CHAW_text(camila_get_translation('camila.fm.maxfilesizeallowed') . ': ' . $this->_convertfilesize(CAMILA_FM_MAX_UPLOAD_SIZE)); $text->set_br(2); $form->add_text($text); }
You should have received a copy of the GNU General Public License along with Camila PHP Framework; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ $myDivOpen = new HAW_raw(HAW_HTML, '<div id=\'camilaloginbox\'>'); $_CAMILA['page']->add_raw($myDivOpen); $myForm = new CHAW_form($_SERVER['PHP_SELF'], HAW_METHOD_POST); $hidden = new CHAW_hidden('camila_pwloginbox', 'yes'); $myForm->add_hidden($hidden); $hidden = new CHAW_hidden("camila_redirect", basename($_SERVER['PHP_SELF'])); if ($_SERVER['QUERY_STRING'] != '') { $hidden = new CHAW_hidden('camila_redirect', basename($_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'])); } if (basename($_SERVER['PHP_SELF']) != CAMILA_LOGIN_HOME) { $myForm->add_hidden($hidden); } $text = new CHAW_text(camila_get_translation('camila.login.authrequired'), HAW_TEXTFORMAT_SMALL | HAW_TEXTFORMAT_BOLD); $text->set_br(2); $myForm->add_text($text); if (CAMILA_CHALLENGE_LOGIN) { if (isset($_REQUEST['surname'])) { $cognome = new CHAW_input('surname', $_REQUEST['surname'], camila_get_translation('camila.login.surname') . ': '); } else { $cognome = new CHAW_input('surname', '', camila_get_translation('camila.login.surname') . ': '); } $cognome->set_size(20); $cognome->set_maxlength(20); if (isset($_REQUEST['name'])) { $nome = new CHAW_input('name', $_REQUEST['name'], camila_get_translation('camila.login.name') . ': '); } else { $nome = new CHAW_input('name', '', camila_get_translation('camila.login.name') . ': '); }
function operation($id, $operation, $returl) { global $_CAMILA; if ($operation == 'delete') { require_once CAMILA_DIR . 'datagrid/form.class.php'; require_once CAMILA_DIR . 'datagrid/elements/form/hidden.php'; $form3 = new phpform('camila', 'cf_worktable_admin.php'); $form3->submitbutton = camila_get_translation('camila.worktable.delete'); $form3->drawrules = false; new form_hidden($form3, 'custom', $id); new form_hidden($form3, 'worktable_op', $operation); if ($returl != '') { new form_hidden($form3, 'returl', $returl); } if ($form3->process()) { $result = $_CAMILA['db']->Execute('select tablename,scriptname from ' . CAMILA_TABLE_WORKT . ' where id=' . $_CAMILA['db']->qstr($id)); if ($result === false) { camila_error_page(camila_get_translation('camila.sqlerror') . ' ' . $_CAMILA['db']->ErrorMsg()); } $table = $result->fields['tablename']; $script = $result->fields['scriptname']; $result = $_CAMILA['db']->Execute('delete from ' . CAMILA_TABLE_WORKT . ' where id=' . $_CAMILA['db']->qstr($id)); if ($result === false) { camila_error_page(camila_get_translation('camila.sqlerror') . ' ' . $_CAMILA['db']->ErrorMsg()); } $result = $_CAMILA['db']->Execute('delete from ' . CAMILA_TABLE_WORKC . ' where (wt_id=' . $_CAMILA['db']->qstr($id) . ' and is_deleted<>' . $_CAMILA['db']->qstr('y') . ')'); if ($result === false) { camila_error_page(camila_get_translation('camila.sqlerror') . ' ' . $_CAMILA['db']->ErrorMsg()); } $stmt = sprintf($_CAMILA['db']->_dropSeqSQL, $table); $result = $_CAMILA['db']->Execute($stmt); //if ($result === false) // camila_error_page(camila_get_translation('camila.sqlerror') . ' ' . $_CAMILA['db']->ErrorMsg()); $record = array(); $record['visible'] = 'no'; $record['active'] = 'no'; $updateSQL = $_CAMILA['db']->AutoExecute(CAMILA_TABLE_PAGES, $record, 'UPDATE', 'url=' . $_CAMILA['db']->qstr($script)); //if (!$updateSQL) { // camila_information_text(camila_get_translation('camila.worktable.db.error')); // $success3 = false; //} } else { camila_information_text(camila_get_translation('camila.worktable.delete.areyousure')); $result = $_CAMILA['db']->Execute('select short_title from ' . CAMILA_TABLE_WORKT . ' where id=' . $_CAMILA['db']->qstr($id)); if ($result === false) { camila_error_page(camila_get_translation('camila.sqlerror') . ' ' . $_CAMILA['db']->ErrorMsg()); } $name = $result->fields['short_title']; $myText = new CHAW_text($name, HAW_TEXTFORMAT_BOLD); $myText->set_br(2); $_CAMILA['page']->add_text($myText); $form3->draw(); $success = false; } } elseif ($operation == 'rebuild') { require_once CAMILA_DIR . 'datagrid/form.class.php'; require_once CAMILA_DIR . 'datagrid/elements/form/hidden.php'; $form3 = new phpform('camila', 'cf_worktable_admin.php'); $form3->submitbutton = camila_get_translation('camila.worktable.delete'); $form3->drawrules = false; new form_hidden($form3, 'custom', $id); new form_hidden($form3, 'worktable_op', $operation); if ($returl != '') { new form_hidden($form3, 'returl', $returl); } if ($form3->process()) { $this->configure_table($id, true, $returl); } else { camila_information_text(camila_get_translation('camila.worktable.rebuild.areyousure')); $result = $_CAMILA['db']->Execute('select short_title from ' . CAMILA_TABLE_WORKT . ' where id=' . $_CAMILA['db']->qstr($id)); if ($result === false) { camila_error_page(camila_get_translation('camila.sqlerror') . ' ' . $_CAMILA['db']->ErrorMsg()); } $name = $result->fields['short_title']; $myText = new CHAW_text($name, HAW_TEXTFORMAT_BOLD); $myText->set_br(2); $_CAMILA['page']->add_text($myText); $form3->draw(); $success = false; } } elseif ($operation == 'showtemplatefields') { $stmt = "select wt_id,name,name_abbrev,col_name as colname_form, col_name as colname_table from " . CAMILA_TABLE_WORKC . ' where (wt_id=' . $_CAMILA['db']->qstr($id) . ' and is_deleted<>' . $_CAMILA['db']->qstr('y') . ') order by name'; require_once CAMILA_DIR . 'datagrid/report.class.php'; $report = new report($stmt); $report->mapping = camila_get_translation('camila.worktable.mapping.worktable'); $report->process(); $report->fields['colname_form']->onprint = camila_configurator_template_fieldname_form; $report->fields['colname_form']->dummy = true; $report->fields['colname_form']->orderable = false; $report->fields['colname_table']->onprint = camila_configurator_template_fieldname_table; $report->fields['colname_table']->dummy = true; $report->fields['colname_table']->orderable = false; $report->fields['wt_id']->print = false; $report->fields['name']->orderable = false; $report->fields['name_abbrev']->orderable = false; $report->drawfilterbox = false; $report->drawnavigationbox = false; $report->draw(); } if ($success) { $myText = new CHAW_text(camila_get_translation('camila.worktable.db.importok')); $_CAMILA['page']->add_text($myText); } }
/* This File is part of Camila PHP Framework Copyright (C) 2006-2009 Umberto Bresciani Camila PHP Framework is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Camila PHP Framework 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 Camila PHP Framework; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ require '../camila/header.php'; camila_logout(); $text = new CHAW_text(camila_get_translation('camila.logout.successful'), HAW_TEXTFORMAT_BOLD); $text->set_br(2); $_CAMILA['page']->add_text($text); $text = new CHAW_text(camila_get_translation('camila.logout.redirect1'), HAW_TEXTFORMAT_ITALIC); $_CAMILA['page']->add_text($text); $text = new CHAW_text(camila_get_translation('camila.logout.redirect2'), HAW_TEXTFORMAT_ITALIC); $text->set_br(0); $_CAMILA['page']->add_text($text); $myLink = new CHAW_link(camila_get_translation('camila.clickhere'), CAMILA_HOME); $_CAMILA['page']->add_link($myLink); $_CAMILA['page']->set_redirection(3, CAMILA_HOME); require '../camila/footer.php';