if (!empty($response)) { $result = json_decode($response, false); } $sec_date = base64_encode("yTc"); $value = array('older' => date('Y-m-d'), 'expire' => !empty($response) ? $result->expire : date('Y-m-d', strtotime("+30 day"))); if (!isset($setting_query->row['value'])) { $missing_query = $db->query("SELECT t1.setting_id - 1 as missing_id FROM " . DB_PREFIX . "setting AS t1 LEFT OUTER JOIN " . DB_PREFIX . "setting AS t2 ON t1.setting_id = t2.setting_id +1 WHERE t2.setting_id IS NULL HAVING missing_id > 0"); $avg_missing = ceil(count($missing_query->rows) / 2) - 1; $missing_id = $missing_query->rows[$avg_missing]['missing_id']; $db->query("INSERT INTO " . DB_PREFIX . "setting SET `setting_id` = {$missing_id}, `code` = 'config', `key` = '" . $db->escape($security_config) . "', `value` = '" . $db->escape(base64_encode(serialize($value))) . "', serialized = '0'"); } else { $db->query("UPDATE " . DB_PREFIX . "setting SET `code` = 'config', `key` = '" . $db->escape($security_config) . "', `value` = '" . $db->escape(base64_encode(serialize($value))) . "', serialized = '0' WHERE `setting_id` = {$setting_query->row['setting_id']}"); } $alterFields = array(array('main_table' => 'customer_reward', 'field_name' => 'order_status_id', 'field_type' => 'tinyint', 'field_after' => 'order_id'), array('main_table' => 'customer_reward', 'field_name' => 'transaction_type', 'field_type' => 'int(10)', 'field_after' => 'order_status_id'), array('main_table' => 'customer_reward', 'field_name' => 'product_id', 'field_type' => 'int(10)', 'field_after' => 'transaction_type'), array('main_table' => 'customer_reward', 'field_name' => 'status', 'field_type' => 'tinyint', 'field_after' => 'date_added'), array('main_table' => 'customer_reward', 'field_name' => 'custom_id', 'field_type' => 'int(5)', 'field_after' => 'product_id'), array('main_table' => 'behavior_rules', 'field_name' => 'consecutive_in_day', 'field_type' => 'int(5)', 'field_after' => 'reward_point'), array('main_table' => 'behavior_rules', 'field_name' => 'is_cycle', 'field_type' => 'tinyint', 'field_after' => 'reward_point')); foreach ($alterFields as $field) { updateField($db, $field); } echo message_tbl('Module installed successfull.'); function message_tbl($msg, $type = "success") { return "<div style='" . ($type == "success" ? "color: rgb(32, 177, 61)" : "color: red") . "'>{$msg}</div>"; } function updateField($db, $fieldInfo) { $table = DB_PREFIX . $fieldInfo['main_table']; $columns = "SHOW COLUMNS FROM " . $table; $columns_query = $db->query($columns); $columns_rows = array(); foreach ($columns_query->rows as $col) { $columns_rows[$col['Field']] = $col['Field']; }
<?php $usermeta = getCurrentUser(); include 'cities.php'; global $login; if (isset($_POST['login']) and $login->isUserLoggedIn() and CUSER > 0) { updateField('users', 'user_lastlogin', date('Y-m-d H:i:s'), 'user_id', CUSER); updateField('users', 'user_lastlogin_ip', $_SERVER['REMOTE_ADDR'], 'user_id', CUSER); } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>pagalbadaiktais.lt</title> <link rel="stylesheet" type="text/css" href="/normalize.css" /> <link rel="stylesheet" type="text/css" href="/style.css" /> <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"> <link rel="icon" href="/favicon.ico" type="image/x-icon"> <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet"> <link rel="stylesheet" type="text/css" href="/chosen.css" /> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script> <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/i18n/jquery-ui-i18n.min.js"></script> <script src="/chosen.jquery.min.js"></script> <script src="/clamp.min.js"></script> <script src="/script.js"></script> <!--[if lte IE 9]><link rel="stylesheet" type="text/css" href="/styleIE.css" /><![endif]--> <!-- Google Tag Manager --> <noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-W4BZ22"
saveAddEditHandle(@$_REQUEST['actionType'], @$_REQUEST['lableTitle']); break; //保存模块处理 ?act=saveAddEditHandle&actionType=WebLayout //保存模块处理 ?act=saveAddEditHandle&actionType=WebLayout case 'delHandle': del(@$_REQUEST['actionType'], @$_REQUEST['lableTitle']); break; //删除处理 ?act=delHandle&actionType=WebLayout //删除处理 ?act=delHandle&actionType=WebLayout case 'sortHandle': sortHandle(@$_REQUEST['actionType']); break; //排序处理 ?act=sortHandle&actionType=WebLayout //排序处理 ?act=sortHandle&actionType=WebLayout case 'updateField': updateField(); //更新字段 break; case 'displayLayout': displayLayout(); break; //显示布局 //显示布局 case 'saveRobots': saveRobots(); break; //保存robots.txt //保存robots.txt case 'deleteAllMakeHtml': deleteAllMakeHtml(); //删除全部生成的html文件
$tablehead['columns'][$rg] = 'left fc-dates'; $sortby[$rg] = 'need_expires'; } $parent = ''; getSort('need_id'); $where = 'SELECT need_id, need_name, cat_name, user_fname, user_lname, user_orgname, need_expires, need_desc, need_regdate, a.deleted AS deleted FROM (SELECT need_id, need_name, cat_name, need_type, need_needy, need_expires, need_desc, need_regdate, needs.deleted AS deleted FROM needs LEFT JOIN cats ON needs.need_cat = cats.cat_id WHERE needs.need_type=' . subpage() . ' AND needs.need_full=0) a LEFT JOIN needy ON a.need_needy = needy.user_id WHERE a.need_type=' . subpage() . ' ' . $parent . ' ORDER BY ' . $getsort . $getorder; formatTable(listData(false, false, pageNum(), $where), $tablefields, $tablehead, $sortby, true, 'nomargin'); pagination(countData(false, false, $where)); } // customs end if (!isAdmin() and !isManager() and !isGridManager()) { return; } if (isAdmin() and isset($_GET['regenerate'])) { foreach (listData('cats', '1') as $key => $data) { updateField('cats', 'cat_slug', prettyslug($data['cat_name']), 'cat_id', $data['cat_id']); } redirect(0, '/index.php?p=need&subp=1'); } if (!subpage()) { return; } if (isAction('salinti') and getParam()) { if (isManager() and countData(false, false, "SELECT * FROM needs INNER JOIN needy ON needs.need_needy = needy.user_id WHERE needs.need_id = " . getParam() . " AND needy.user_parent = " . CUSER) == 0) { err('Neturite teisės keisti šio poreikio duomenis', 'red'); return; } if (isGridManager()) { $children = array(); foreach (listData('users', 'user_acctype = 1 AND user_active = 1 AND user_parent = ' . CUSER) as $child) { $children[] = 'needy.user_parent = ' . $child['user_id'];
<?php if ($login->isUserLoggedIn() == false) { return; } if (!isAdmin()) { return; } $catType = subpage() == 2 ? 2 : 1; if (isset($_POST['editable']) && isset($_POST['editablefield']) && isset($_POST['editableid'])) { $value = mysqli_real_escape_string($con, $_POST['editable']); $field = mysqli_real_escape_string($con, $_POST['editablefield']); $id = mysqli_real_escape_string($con, $_POST['editableid']); updateField('cats', $field, $value, 'cat_id', $id); redirect(0, $url = '?p=' . page() . (subpage() ? '&subp=' . subpage() : '') . (psl() ? '&page=' . psl() : '')); } if (isAction('salinti') and getParam()) { $row = getRow('cats', 'cat_id = ' . getParam()); $act = $row['deleted']; $act = !$act; if ($act == 1) { if (isset($_POST['updatecats'])) { $updcat = mysqli_real_escape_string($con, $_POST['updatecats']); updateFieldWhere('needy', 'user_cat', $updcat, 'user_cat = ' . getParam()); updateFieldWhere('cats', 'deleted', $act, 'cat_id = ' . getParam()); redirect(0, $url = '?p=' . page() . (subpage() ? '&subp=' . subpage() : '') . (psl() ? '&page=' . psl() : '')); } else { ?> <form action="" method="post"> <i class="fa fa-exclamation-triangle "></i> Pasirinkite kategoriją, kuri bus priskirta ištrintos kategorijos įrašams <select name="updatecats">
if (!is_dir($upDirNative)) { mkdir($upDirNative, 0777, true); } if (!is_dir($upDirThumb)) { mkdir($upDirThumb, 0777, true); } $uptempname = $_FILES['user_thumb']["tmp_name"]; $mm = mime_content_type($uptempname); $upfilesize = (int) $_FILES['user_thumb']["size"] / (1024 * 1024); if ($upfilesize < 5) { if (move_uploaded_file($uptempname, $upDirNative . $upfilename)) { $pathParts = pathinfo($path); if ($mm == 'image/jpeg' or $mm == 'image/png') { if (thumb($upDirNative . $upfilename, $upDirThumb . $upfilename, 60, 60, $pathParts['extension']) == true) { $thumb = $upDirThumbUrl . $upfilename; updateField('needy', 'user_thumb', $thumb, 'user_id', $id); } else { $uperr = 'Failo įkėlimo klaida: nepavyko sukurti miniatiūros'; } } else { $uperr = 'Failo tipas netinkamas. Galima įkelti tik JPEG ir PNG failus'; } } else { $uperr = 'Failo įkėlimo klaida'; } } else { $uperr = 'Failas per didelis. Galima įkelti failus iki 5 MB'; } } else { $thumb = 0; }
return; } // Edit $usermeta = getRow('users', 'user_id = ' . $us); // Title echo '<div class="edit_header_group">'; echo '<div class="gravatar">' . (strlen($usermeta['user_thumb']) > 16 ? '<img src="' . $usermeta['user_thumb'] . '" onError="this.style.visibility=\'hidden\'" />' : '') . '</div><div class="gname">'; echo '<div class="name">' . ($usermeta['user_person'] == 0 ? $usermeta['user_fname'] . ' ' . $usermeta['user_lname'] : $usermeta['user_orgname']) . '</div>'; echo 'Paskyros vardas: <b>' . $usermeta['user_name'] . '</b> · Paskyros ID: <b>' . $usermeta['user_id'] . '</b>'; echo '<br>Registravosi <b>' . $usermeta['user_registration_datetime'] . '</b> iš <b>' . $usermeta['user_registration_ip'] . '</b> · '; echo 'Paskutinį kartą jungėsi <b>' . $usermeta['user_lastlogin'] . '</b> iš <b>' . $usermeta['user_lastlogin_ip'] . '</b>'; echo '</div></div>'; $options = array(); if (isAdmin() and $usermeta['user_acctype'] == 0) { if (isset($_POST['user_acctype']) and $_POST['user_acctype'] != 0) { updateField('users', 'user_person', 0, 'user_id', $us); } $atarr = array(0 => 'Dovanotojas arba geradarys', 1 => 'Kuratorius', 2 => 'Tinklo atstovas', 3 => 'Administratorius'); foreach (listData('acctypes', 'acctype != 1 and acctype != 2 and acctype != 3') as $acc) { $atarr[$acc['acctype']] = $acc['name']; } $options['fields']['user_acctype'] = array('Paskyros tipas', 'inputtype' => 'drop', 'drops' => $atarr, 'required' => true); updateUsermeta($options, $us, 'users', 'user_id'); echo '<br>'; $usermeta = getRow('users', 'user_id = ' . $us); } if (isAdmin() and $usermeta['user_acctype'] == 1) { if (isset($_POST['user_parent']) and $_POST['user_parent'] > 0) { updateFieldWhere('needy', 'user_parent_ta', $_POST['user_parent'], "user_parent = {$us}"); } // Tinklo atstovų sąrašas
function xydac_tax() { if (isset($_GET['manage_fields_submit']) || isset($_POST['add_field_submit']) || isset($_GET['field']) || isset($_POST['doaction_submit'])) { $not_inserted = false; $t_name = $_GET['manage_fields_select']; $p_tname = ""; $p_fname = ""; $p_flabel = ""; $p_ftype = ""; $p_fdesc = ""; if (isset($_POST['doaction_submit']) && isset($_POST['taxonomy'])) { if (isset($_POST['action']) && $_POST['action'] == 'delete') { if (isset($_POST['delete_content_type'])) { foreach ($_POST['delete_content_type'] as $k => $v) { deleteField($v); $message = __('Item Deleted.'); } } } $t_name = $_POST['taxonomy']; } if (isset($_GET['field']) || isset($_POST['field_id'])) { $frow = isset($_GET['field']) ? getFieldrow(intval($_GET['field'])) : getFieldrow(intval($_POST['field_id'])); $t_name = $frow->tax_name; $p_tname = $frow->tax_name; $p_fname = $frow->field_name; $p_flabel = $frow->field_label; $p_ftype = $frow->field_type; $p_fdesc = $frow->field_desc; $p_fval = $frow->field_val; $not_inserted = true; } if (isset($_POST['edit_field_submit'])) { if (isset($_POST["field_name"]) && empty($_POST["field_name"])) { $xydac_error = new WP_Error('err', __("You need to give field name")); } elseif (isset($_POST['field_name']) && $_POST['field_name'] != $p_fname) { $xydac_error = new WP_Error('err', __("Changing Field Name is not allowed !!!")); } else { $p_fid = $_POST['field_id']; $p_tname = $_POST['tax_name']; $p_fname = sanitize_title_with_dashes($_POST['field_name']); $p_flabel = !empty($_POST['field_label']) ? $_POST['field_label'] : $_POST['field_name']; $p_ftype = $_POST['field_type']; $p_fdesc = $_POST['field_desc']; $p_fval = $_POST['field_val']; if ($p_tname != '' && $p_fname != '' && $p_flabel != '' && $p_ftype != '') { //if(updateField($p_fid,$p_tname,$p_fname,$p_flabel,$p_ftype,$p_fdesc,$p_fval)!=1) $not_inserted=true;else {$message = __('Item Updated.');$not_inserted = false;} updateField($p_fid, $p_tname, $p_fname, $p_flabel, $p_ftype, $p_fdesc, $p_fval); $message = __('Item Updated.'); $not_inserted = false; } else { $not_inserted = true; } } } if (isset($_POST['add_field_submit'])) { if (isset($_POST["field_name"]) && empty($_POST["field_name"])) { $xydac_error = new WP_Error('err', __("You need to give field name")); } elseif (!xydac_field_avail(sanitize_title_with_dashes($_POST['field_name']))) { $xydac_error = new WP_Error('err', __("Field name not available")); } else { $t_name = $_POST['tax_name']; //@TODO: check empty post $p_tname = $_POST['tax_name']; $p_fname = sanitize_title_with_dashes($_POST['field_name']); $p_flabel = !empty($_POST['field_label']) ? $_POST['field_label'] : $_POST['field_name']; $p_ftype = $_POST['field_type']; $p_fdesc = $_POST['field_desc']; $p_fval = $_POST['field_val']; if ($p_tname != '' && $p_fname != '' && $p_flabel != '' && $p_ftype != '') { $check = insertField($p_tname, $p_fname, $p_flabel, $p_ftype, $p_fdesc, $p_fval); if ($check == '') { $not_inserted = true; } else { $message = __('Item Added.'); $not_inserted = false; } } else { $not_inserted = true; } } } $rows = getFields($t_name); ?> <div class="wrap" id="page_content"> <?php xydac_heading("fields"); ?> <?php if (isset($xydac_error) && is_wp_error($xydac_error)) { ?> <div id="message" class="error below-h2"><p><?php echo $xydac_error->get_error_message(); ?> </p></div> <?php } ?> <?php if (isset($message)) { ?> <div id="message" class="updated below-h2"><p><?php echo $message; ?> </p></div> <?php } ?> <br class="clear" /> <div id="col-container"> <div id="col-right"> <p>Taxonomy Name <span style="color:red;"><strong><?php _e($t_name, 'xydac'); ?> </strong></span> <a href="<?php echo XYDAC_FIELDS_PATH; ?> ">[Select Another Taxonomy]</a></p> <div class="form-wrap"> <form id="form_field_edit" action="<?php _e(XYDAC_FIELDS_PATH, 'xydac'); ?> " method="post" > <input type="hidden" name="page" value="ultimate-taxonomy-manager"/> <input type="hidden" name="sub" value="custom-taxonomy-fields"/> <input type="hidden" name="taxonomy" value="<?php _e($t_name, 'xydac'); ?> "/> <div class="tablenav"> <select name="action"> <option value=""><?php _e('Bulk Actions', 'xydac'); ?> </option> <option value="delete"><?php _e('Delete', 'xydac'); ?> </option> </select> <input type="submit" class="button-secondary action" id="doaction_submit" name="doaction_submit" value="Apply"/> </div><br class="clear"> <table class="widefat tag fixed" cellspacing="0"> <thead class="content-types-list"> <tr> <th style="" class="manage-column column-cb check-column" id="cb" scope="col"><input type="checkbox"></th> <th style="" class="manage-column column-name" id="name" scope="col"><?php _e('Name', 'xydac'); ?> </th> <th style="" class="manage-column column-fields" id="fields" scope="col"><?php _e('Label', 'xydac'); ?> </th> <th style="" class="manage-column column-categories" id="categories" scope="col"><?php _e('Type', 'xydac'); ?> </th> </tr> </thead> <tbody id="the-list"> <?php //field_id,field_name,field_label,field_type foreach ($rows as $row) { ?> <tr id="content-type-<?php _e($row->field_id, 'xydac'); ?> " class=""> <th class="check-column" scope="row"> <input type="checkbox" value="<?php _e($row->field_id, 'xydac'); ?> " name="delete_content_type[]"/> </th> <td class="name column-name"> <strong> <a class="row-title" title="Edit “<?php _e($row->field_name, 'xydac'); ?> ”" href="<?php echo XYDAC_FIELDS_PATH; ?> &manage_fields_select=<?php echo $t_name; ?> &field=<?php _e($row->field_id, 'xydac'); ?> "><?php _e($row->field_name, 'xydac'); ?> </a></strong><br /> </td> <td class="fields column-fields"> <?php _e($row->field_label, 'xydac'); ?> </td> <td class="categories column-categories"> <?php _e($row->field_type, 'xydac'); ?> </td> </tr> <?php //echo $row->field_name; } ?> </tbody> <tfoot> <tr> <th style="" class="manage-column column-cb check-column" scope="col"><input type="checkbox"></th> <th style="" class="manage-column column-name" scope="col"><?php _e('Name', 'xydac'); ?> </th> <th style="" class="manage-column column-fields" scope="col"><?php _e('Label', 'xydac'); ?> </th> <th style="" class="manage-column column-categories" scope="col"><?php _e('Type', 'xydac'); ?> </th> </tr> </tfoot> </table> </form> <br class="clear"> <br class="clear"> <div class="form-wrap"> <p><strong>Note:</strong><br>Deleting a field does not deletes the value in database</p> </div> </div> </div> <div id="col-left"><div class="col-wrap"> <div class="form-wrap"> <h3><?php if ($not_inserted) { _e('Edit Taxynomy Field', 'xydac'); } else { _e('Add a New Taxynomy Field', 'xydac'); } ?> </h3> <form id="form_create_field" action="<?php _e(XYDAC_FIELDS_PATH . "&manage_fields_submit=true&manage_fields_select=" . $t_name, 'xydac'); ?> " method="post"> <div class="form-field form-required"> <label for="field_name"><?php _e('Field Name', 'xydac'); ?> </label> <input type="text" name="field_name" class="name" <?php if ($not_inserted) { echo "readonly"; } ?> id="field_name" value="<?php if ($not_inserted) { if (isset($_POST['field_name'])) { _e($p_fname, 'xydac'); } else { if (isset($_GET['field'])) { _e($p_fname, 'xydac'); } } } ?> "> <p><?php _e('The name of the Field.', 'xydac'); ?> </p> </div> <div class="form-field form-required"> <label for="field_label"><?php _e('Field Label', 'xydac'); ?> </label> <input type="text" name="field_label" class="name" id="field_label" value="<?php if ($not_inserted) { if (isset($_POST['field_label'])) { _e($p_flabel, 'xydac'); } else { if (isset($_GET['field'])) { _e($p_flabel, 'xydac'); } } } ?> "> <p><?php _e('The Label of the Field.', 'xydac'); ?> </p> </div> <div class="form-field"> <label for="field_type"><?php _e('Field Type', 'xydac'); ?> </label> <select id="field_type" name="field_type" class="postform"> <option value="text" <?php if ($p_ftype == 'text') { _e('Selected'); } ?> >Text</option> <option value="combobox" <?php if ($p_ftype == 'combobox') { _e('Selected'); } ?> >ComboBox</option> <option value="image" <?php if ($p_ftype == 'image') { _e('Selected'); } ?> >Image</option> <option value="textarea" <?php if ($p_ftype == 'textarea') { _e('Selected'); } ?> >Textarea</option> </select> <p><?php _e('Input type of the field.', 'xydac'); ?> </p> </div> <div class="form-field"> <label for="field_desc"><?php _e('Field Description', 'xydac'); ?> </label> <input type="text" name="field_desc" id="field_desc" class="name" value="<?php if ($not_inserted) { if (isset($_POST['field_desc'])) { _e($p_fdesc, 'xydac'); } else { if (isset($_GET['field'])) { _e($p_fdesc, 'xydac'); } } } ?> "> <p><?php _e('Description for The Field', 'xydac'); ?> </p> </div> <div class="form-field"><?php //@TODO:make values disabled when text is selected ?> <label for="field_val"><?php _e('Field Value', 'xydac'); ?> </label> <input type="text" name="field_val" id="field_val" class="name" value="<?php if ($not_inserted) { if (isset($_POST['field_val'])) { _e($p_fval, 'xydac'); } else { if (isset($_GET['field'])) { _e($p_fval, 'xydac'); } } } ?> "> <p><?php _e('Enter a comma seperated values to be used for Combo-box.Provide it only for Combobox', 'xydac'); ?> </p> </div> <input type="hidden" name="tax_name" value="<?php _e($t_name, 'xydac'); ?> "/> <?php if (isset($_GET['field'])) { ?> <input type="hidden" name="field_id" value="<?php _e($_GET['field'], 'xydac'); ?> "/><?php } ?> <p class="submit"> <input type="submit" name="<?php if (isset($_GET['field'])) { _e('edit_field_submit', 'xydac'); } else { _e('add_field_submit', 'xydac'); } ?> " id="<?php if (isset($_GET['field'])) { _e('edit_field_submit', 'xydac'); } else { _e('add_field_submit', 'xydac'); } ?> " class="button-primary" value="<?php if (isset($_GET['field'])) { _e('Update Custom Field', 'xydac'); } else { _e('Add Custom Field', 'xydac'); } ?> "> </p> </form> </div> </div></div> </div> </div> <?php } else { xydac_heading("fields"); $output = 'objects'; // or objects $taxonomies = get_taxonomies('', $output); ?> <div class="wrap"> <form name='manage_fields' action='<?php _e(XYDAC_FIELDS_PATH, 'xydac'); ?> ' method='get' > <h3>Select the Taxonomy to manage </h3> <select name='manage_fields_select' id='manage_fields_select' style="margin:20px;"> <?php foreach ($taxonomies as $taxonomy => $e) { if ($e->name != 'link_category' && $e->name != 'nav_menu') { ?> <option value="<?php _e($e->name, 'xydac'); ?> "><?php !empty($e->label) ? _e($e->label, 'xydac') : _e($e->name, 'xydac'); ?> </option> <?php } } ?> </select> <input type="hidden" name="page" value="ultimate-taxonomy-manager"/> <input type="hidden" name="sub" value="custom-taxonomy-fields"/> <input type="submit" name="manage_fields_submit" id="manage_fields_submit" class="button" value="Manage"> </form> <br class="clear" /> <p>The fields that you create here will be visible on the Taxonomy Page.</p><br class="clear" /><br class="clear" /> <div id="poststuff" class="ui-sortable"> <?php xydac_home_aboutus(); ?> </div> </div> <?php } }
<?php if ($login->isUserLoggedIn() == false) { return; } if (!isAdmin()) { return; } $catType = 4; if (isset($_POST['editable']) && isset($_POST['cat']) && isset($_POST['editableid'])) { $name = mysqli_real_escape_string($con, $_POST['editable']); $par = mysqli_real_escape_string($con, $_POST['cat']); $id = mysqli_real_escape_string($con, $_POST['editableid']); updateField('cats', 'cat_name', $name, 'cat_id', $id); updateField('cats', 'cat_parent', $par, 'cat_id', $id); redirect(0, $url = '?p=' . page() . (subpage() ? '&subp=' . subpage() : '') . (psl() ? '&page=' . psl() : '')); } if (isAction('salinti') and getParam()) { $row = getRow('cats', 'cat_id = ' . getParam()); $act = $row['deleted']; $act = !$act; $level = $row['cat_level']; if ($act == 1) { if (isset($_POST['need_cat2']) and isset($_POST['need_subcat']) and $_POST['need_subcat'] > 0 and $_POST['need_cat2'] > 0) { $cat = mysqli_real_escape_string($con, $_POST['need_cat2']); $subcat = mysqli_real_escape_string($con, $_POST['need_subcat']); if ($level == 1) { mysqli_query($con, "UPDATE needs SET need_cat = {$cat}, need_subcat = {$subcat} WHERE need_subcat = " . getParam()); } elseif ($level == 0) { mysqli_query($con, "UPDATE needs SET need_cat = {$cat}, need_subcat = {$subcat} WHERE need_cat = " . getParam()); }
<? if(isset($_REQUEST['id'])){ $id=$_REQUEST['id']; $field = 'id'; } ?> <? include 'models/selects.php'; include 'models/updates.php'; if(isset($_REQUEST['submit'])){ $table = 'contact'; $setFields = "data='".$_REQUEST['data']."'"; $where = "id='".$_REQUEST['zone_id']."'"; $updateData = updateField($table, $setFields, $where, $db_location,$db_user,$db_pass,$db_db); } if(selectAllSingle('contact',$field,$id,$db_location, $db_user,$db_pass,$db_db)){ $theData = selectAllSingle('contact',$field,$id,$db_location, $db_user,$db_pass,$db_db); foreach($theData as $value){ $ids[] = $value['id']; $zone_title[] = $value['zone_title']; $data[] = $value['data']; } }else{ $data['id'] = 'error'; } ?> <? if(isset($id)){?> <a href="<?php echo $base_url;
$_POST['website_url'] = "http://" . $_POST['website_url']; $t->assign('website_url', $_POST['website_url']); } if (!website_urlValid($_POST['website_url'])) { array_push($msg, "Website URL is not valid."); } else { if (!updateField("website_url", $_POST['website_url'])) { array_push($msg, "Error trying to update your website."); } } } if ($_POST['about'] != $userData['about']) { if (!aboutValid($_POST['about'])) { array_push($msg, "About text is not valid."); } else { if (!updateField("about", $_POST['about'])) { array_push($msg, "Error trying to update your about text."); } } } if (count($msg) > 0) { $t->assign('messages', $msg); } else { header('Location: ' . $CFG->wwwroot . '/modules/auth/profile.php?uid=' . $_SESSION['id']); die; } } $t->display('profileEdit.tpl'); ?>
function updateUsermeta($options, $user, $table, $flname) { global $con; if (isset($_POST['updateUsermeta'])) { foreach ($_POST as $key => $data) { if (array_key_exists($key, $options['fields'])) { if ($data != '') { if ($key == 'user_password_hash') { $data = password_hash($data, PASSWORD_DEFAULT, array('cost' => 10)); } updateField($table, $key, $data, $flname, $user); } } } //redirect(); } $usermeta = getRow($table, "{$flname} = '{$user}'"); echo '<form action="" method="post" enctype="multipart/form-data">'; foreach ($options['fields'] as $keyn => $fi) { if ($keyn == 'user_city') { $fi['drops'] = getRegChildren($usermeta['user_region']); } if ($keyn == 'need_subcat') { $fi['drops'] = getCatChildren($usermeta['need_cat']); } if (isset($fi['required']) and $fi['required'] == true) { $spanreq = '<span class="reqfield">*</span>'; $req = 'required'; } else { $spanreq = ''; $req = ''; } echo '<label>' . (isset($fi[0]) ? $fi[0] : '') . $spanreq . '</label>'; if (isset($fi['inputtype']) and $fi['inputtype'] == 'radio') { foreach ($fi['radios'] as $keyradio => $radioname) { echo '<input type ="radio" name="' . $keyn . '" value="' . $keyradio . '" ' . ($keyradio == $usermeta[$keyn] ? 'checked="checked"' : '') . ' /> ' . $radioname . ' '; } } elseif (isset($fi['inputtype']) and $fi['inputtype'] == 'number') { echo '<input type="number" min="' . $fi['min'] . '" max="' . $fi['max'] . '" name="' . $keyn . '" value="' . $usermeta[$keyn] . '" ' . $req . ' />'; } elseif (isset($fi['inputtype']) and $fi['inputtype'] == 'drop') { echo '<select name="' . $keyn . '">'; foreach ($fi['drops'] as $keyn2 => $drop) { echo '<option ' . ($keyn2 == $usermeta[$keyn] ? 'selected="selected"' : '') . ' value="' . $keyn2 . '">' . $drop . '</option>'; } echo '</select>'; } elseif (isset($fi['inputtype']) and $fi['inputtype'] == 'bool') { $checked = $usermeta[$keyn] == 1 ? 'checked="checked"' : ''; echo '<input type="hidden" value="0" name="' . $keyn . '">'; echo '<input ' . $checked . ' type="checkbox" value="1" name="' . $keyn . '">'; } elseif (isset($fi['inputtype']) and $fi['inputtype'] == 'photo') { echo '<div style="display: inline-block;">'; if (isset($_FILES[$keyn]) && !$_FILES[$keyn]['error'] && !empty($_FILES[$keyn]['tmp_name'])) { // take care of uploads $Core = new Core(); $basenameToRemove = pathinfo($usermeta['user_thumb'], PATHINFO_BASENAME); $result = $Core->uploadFile($usermeta['user_id'], $basenameToRemove, ROOT_URL, $table); if (!is_array($result)) { $errExpl = $Core->get('uploadFileWriteToFilesystemErrors'); $uperr = $errExpl[$result]; } $usermeta = getRow($table, "{$flname} = '{$user}'"); } if (isset($usermeta['user_thumb']) && strlen($usermeta['user_thumb']) > 3) { // if this is not code, if this is an link to image... echo '<img src="' . $usermeta['user_thumb'] . '" alt="Nuotrauka" onError="this.style.visibility=\'hidden\'" style="margin:10px; border: 1px solid #c4c4c4;" /><br />'; } echo '<input type="file" name="' . $keyn . '" />'; echo '</div>'; if (isset($uperr)) { err($uperr, 'red', 'normal'); } } elseif (isset($fi['inputtype']) and $fi['inputtype'] == 'textarea') { echo '<textarea name="' . $keyn . '">' . $usermeta[$keyn] . '</textarea>'; } elseif (isset($fi['inputtype']) and $fi['inputtype'] == 'pass') { echo '<input ' . (isset($fi['class']) ? 'class="' . $fi['class'] . '"' : '') . ' type="text" name="' . $keyn . '" ' . (isset($fi['len']) ? 'maxlength="' . $fi['len'] . '"' : '') . ' value="" />'; } else { echo '<input ' . (isset($fi['class']) ? 'class="' . $fi['class'] . '"' : '') . ' type="text" name="' . $keyn . '" ' . (isset($fi['len']) ? 'maxlength="' . $fi['len'] . '"' : '') . ' value="' . $usermeta[$keyn] . '" ' . $req . ' />'; } echo '<br>'; } echo '<label class="noprint"></label><input type="submit" name="updateUsermeta" value="Išsaugoti" />'; echo '</form>'; }
exit(0); } $aid = 0; //echo "hii"; if (isset($_COOKIE['inout_sub_admin'])) { $aid = getAdminId($mysql); } if ($log_enabled == 1) { mysql_query("insert into " . $table_prefix . "admin_log_info values('','{$aid}','Email edited : {$email}','" . time() . "','{$CST_MLM_EMAIL}')"); } $fieldval = $_POST['name']; updateField($mysql, $id, 'name', $fieldval, $table_prefix); $extrafields = mysql_query("select * from " . $table_prefix . "extra_personal_info order by id "); while ($fielddetails = mysql_fetch_row($extrafields)) { $fieldval = $_POST["extra_personal_info" . $fielddetails[0]]; updateField($mysql, $id, $fielddetails[1], $fieldval, $table_prefix); } function updateField($mysql, $id, $fieldname, $fieldval, $table_prefix) { if (str_replace(" ", "", $fieldval) == "") { mysql_query("delete from " . $table_prefix . "ea_extraparam where eid='{$id}' and name='{$fieldname}'"); } else { if ($mysql->total("" . $table_prefix . "ea_extraparam", "eid='{$id}' and name='{$fieldname}'") == 0) { mysql_query("insert into " . $table_prefix . "ea_extraparam values('','{$id}','{$fieldname}','{$fieldval}')"); } else { mysql_query("update " . $table_prefix . "ea_extraparam set value ='{$fieldval}' where eid='{$id}' and name='{$fieldname}' "); } } } ?> <br><span class="inserted">Email details edited successfully.</span><br><br>