public function delete() { $id = I('id'); $where = array('id' => $id, 'uid' => $this->user['id']); $account = M('Account')->where($where)->find(); if ($account) { $res = M('Account')->delete($id); if ($res) { show_tip('success', '/?tab=finance', '删除成功'); } } }
echo lang('php_gd_pic', $cmsinfos['gdpic']); ?> </li> <li><?php echo lang('php_max_upload', $cmsinfos['max_upload']); ?> </li> <li><?php echo lang('db_use_size', $cmsinfos['dbsize']); ?> </li> <li><?php echo lang('attach_size', $cmsinfos['attachsize']); ?> </li> <li><?php echo lang('php_mail_mode', $cmsinfos['sys_mail']); ?> </li> </ul> <div class="blank3"></div> </div> </div> <div class="blank18"></div> <div class="nav2 borderall"> <?php echo show_tip('08cms_group'); ?> </div> <br><br> <div class="footer"><hr size="0" noshade color="#86B9D6" width="100%">
document.getElementById('opt_continue').disabled = true; } table_name = encodeURIComponent(table_name); table_name = table_name.replace('adv', '%61dv'); var url = 'repair_db.php?lang=<?php echo LANGUAGE_ID; ?> &<?php echo bitrix_sessid_get(); ?> &table_name='+table_name; CHttpRequest.Send(url); } } </script> <?php } else { ?> <p><?php echo GetMessage("RDB_TIP_1"); ?> </p> <?php CAdminMessage::ShowMessage(array("MESSAGE" => GetMessage("RDB_TIP_2"), "TYPE" => "ERROR", "HTML" => true, "DETAILS" => GetMessage("RDB_TIP_3"))); show_tip(); } } else { CAdminMessage::ShowMessage(array("MESSAGE" => GetMessage("RDB_DATABASE_ERROR"), "TYPE" => "ERROR")); } require_once dirname(__FILE__) . "/../include/epilog_admin.php"; }
function get_table_data_list($rows, $thisPage, $items_per_page = '') { # 0.0.4 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # # show the list of table data contents # global $isFilteredData, $filters, $_TBL_DEFS, $_T_TBL_DEFS, $_FLD_DEFS, $_T_FLD_DEFS, $_FIELDS, $_T_FIELDS, $_RESERVED_FIELDS; if ($items_per_page == '') { $items_per_page = ITEMS_PER_PAGE; } # 0.0.4 $_ALLOWED_TYPES = explode('|', MED_FLD_TYPES); //var_dump($_ALLOWED_TYPES);echo '<hr>'; //var_dump($_FIELDS); $t = 0; if (is_array($rows)) { $t = count($rows); } $html = ''; $paginate = prep_prev_next($_SESSION[EDIT_TABLE_NAME . '_paginate']['thispage'], $_SESSION[EDIT_TABLE_NAME . '_paginate']['tot_pages'], '/?page=table_editor_adm&table=' . EDIT_TABLE_NAME, '', $items_per_page); # # create the table header # $html .= '<table align="center" cellspacing="' . TBL_LIST_CELLSPACING . '" cellpadding="0" width="90%">' . '<tr>' . '<th></th>'; for ($i = 0; $i < $_T_FIELDS; $i++) { //var_dump($_FIELDS[$i]);echo '<hr>'; $clean_type = get_field_type_clean($_FIELDS[$i]['Type']); //echo $clean_type.'<br>'; $is_numeric = is_field_numeric($clean_type); # 0.0.4 //echo $_FIELDS[$i]['Type'].'»'.$is_numeric.'<br>'; if ($_FIELDS[$i]['Comment'] != '*PRIVATE' && !in_array($_FIELDS[$i]['Field'], $_RESERVED_FIELDS) && in_array($clean_type, $_ALLOWED_TYPES)) { if ($_FIELDS[$i]['Comment'] != '') { $header = $_FIELDS[$i]['Comment']; } else { $header = $_FIELDS[$i]['Field']; } $align = 'left'; # 0.0.4 if ($is_numeric == true) { $align = 'right'; } # 0.0.4 # # 0.0.5: BEG #------------- $iii = 0; while ($iii < $_T_TBL_DEFS) { if ($_FIELDS[$i]['Field'] == $_TBL_DEFS[$iii]['referenceField']) { $align = 'left'; } $iii++; } #------------- # 0.0.5: END # //$html .= '<th>'.$header.'</th>'; # 0.0.4 $html .= '<th align="' . $align . '">' . $header . '</th>'; # 0.0.4 } } $html .= '</tr>'; //$html .= '<tr><td colspan="99">' // .$paginate // .'</td></tr>' //; # # fills it with the table data # if ($t == 0) { $html .= '' . '<tr>' . '<td colspan="99">' . 'No records on file' . '</td>' . '</tr>'; } else { $e = 1; # alternate rows background for readbility for ($i = 0; $i < $t; $i++) { //if(($e%2)>0) { $high='#eee'; } else { $high='#fff'; } if ($e % 2 > 0) { $high = TBL_LIST_TR_HIGHLIGHT_ON; } else { $high = TBL_LIST_TR_HIGHLIGHT_OFF; } $e++; $inp = array(); $out = array(); $inp[] = '[[EDIT_TABLE_NAME]]'; $out[] = EDIT_TABLE_NAME; # # 0.0.4: BEG #------------- if (strpos(EDIT_TABLE_RRN_FIELD, '|', 0) === false) { $inp[] = '[[RRN]]'; $out[] = $rows[$i]['r_' . EDIT_TABLE_RRN_FIELD]; } else { $keys = explode('|', EDIT_TABLE_RRN_FIELD); $values = ''; foreach ($keys as $key) { $values .= $rows[$i]['r_' . $key] . '|'; } $values = substr($values, 0, -1); $inp[] = '[[RRN]]'; $out[] = $values; } #------------- # 0.0.4: END # //echo 'EDIT_TABLE_RRN_FIELD['.EDIT_TABLE_RRN_FIELD.']<br>'; //var_dump($rows[$i]);echo '<hr>'; $html .= '' . '<tr style="' . $high . '" valign="top">' . str_replace($inp, $out, TABLE_ADM_ROWS_BUTTONS); for ($ii = 0; $ii < $_T_FIELDS; $ii++) { # fields # $field = 'r_' . $_FIELDS[$ii]['Field']; $iii = 0; $isREFERENCED = false; //$_TBL_DEFS, $_T_TBL_DEFS while ($iii < $_T_TBL_DEFS && $isREFERENCED == false) { if ($_FIELDS[$ii]['Field'] == $_TBL_DEFS[$iii]['referenceField']) { $isREFERENCED = true; $description = get_referenced_data($rows[$i][$field], $_TBL_DEFS[$iii]['referencedTable'], $_TBL_DEFS[$iii]['referencedID'], $_TBL_DEFS[$iii]['referencedDesc']); } $iii++; } if ($isREFERENCED == true) { $html .= '' . '<td valign="top" style="' . TBL_LIST_TD_STYLE . '">' . stripslashes($description) . '</td>'; $align = 'left'; # 0.0.5 } else { $clean_type = get_field_type_clean($_FIELDS[$ii]['Type']); $is_numeric = is_field_numeric($clean_type); # 0.0.4 if ($_FIELDS[$ii]['Comment'] != '*PRIVATE' && !in_array($_FIELDS[$ii]['Field'], $_RESERVED_FIELDS) && in_array($clean_type, $_ALLOWED_TYPES)) { $data = $rows[$i][$field]; //echo $_FIELDS[$ii]['Type'].'<br>'; if ($_FIELDS[$ii]['Type'] == 'date') { $data = format_date($data); } elseif ($_FIELDS[$ii]['Type'] == 'datetime' || $_FIELDS[$ii]['Type'] == 'timestamp') { $data = format_datetime($data); } else { if (strlen($data) > TBL_LIST_MAX_LENGTH) { $data = substr($data, 0, TBL_LIST_MAX_LENGTH) . ' [...]' . show_tip($data); } } $align = 'left'; # 0.0.4 if ($is_numeric == true) { $align = 'right'; } # 0.0.4 $html .= '' . '<td align="' . $align . '" valign="top" style="' . TBL_LIST_TD_STYLE . '">' . stripslashes($data) . '</td>'; } } } $html .= '</tr>'; } } if (strlen($paginate) == 0) { $html .= '<tr><td colspan="99">' . '<code>' . __('*END OF DATA*', MED_LOCALE) . '</code>' . '</td></tr>'; } else { $html .= '<tr><td colspan="99">' . $paginate . '</td></tr>'; } $html .= '</table>'; //$html .= prep_prev_next($_SESSION[EDIT_TABLE_NAME.'_paginate']['thispage'], // $_SESSION[EDIT_TABLE_NAME.'_paginate']['tot_pages'], // '/?page=table_editor_adm&table='.EDIT_TABLE_NAME // ); return $html; }