Exemplo n.º 1
0
function updateIcon()
{
    $request = Slim::getInstance()->request();
    $body = $request->getBody();
    $body = json_decode($body);
    unset($body->created_date);
    if (!empty($body->image)) {
        file_put_contents('./icon_images/' . $body->image->filename, base64_decode($body->image->base64));
        $body->image = $body->image->filename;
    } else {
        unset($body->image);
    }
    $id = $body->id;
    unset($body->image_url);
    if (isset($body->imagee)) {
        unset($body->imagee);
    }
    if (isset($body->id)) {
        unset($body->id);
    }
    $allinfo['save_data'] = $body;
    $coupon_details = edit(json_encode($allinfo), 'icon', $id);
    if (!empty($coupon_details)) {
        $result = '{"type":"success","message":"Changed Succesfully"}';
    } else {
        $result = '{"type":"error","message":"Not Changed"}';
    }
    echo $result;
}
Exemplo n.º 2
0
function write(&$frm)
{
    if ($frm->validate("write")) {
        return edit($frm);
    }
    $cols = grp(m("value", $_POST["print_dialog"]));
    $qry = new dbUpdate("settings", "cubit", $cols, "constant='PRINT_DIALOG'");
    $qry->run(DB_UPDATE);
    $OUT = "\n\t<h3>Printing Options</h3>\n\tSuccessfully saved printing options.";
    return $OUT;
}
function write(&$frm)
{
    if ($frm->validate("write")) {
        return edit($frm);
    }
    $cols = grp(m("value", $_POST["vat_setting"]));
    $qry = new dbUpdate("settings", "cubit", $cols, "constant='PURCH_DEFAULT_VAT_SETTING'");
    $qry->run(DB_UPDATE);
    $OUT = "\n\t<h3>Purchase VAT Setting</h3>\n\tSuccessfully saved setting.";
    return $OUT;
}
function updateSiteSettings()
{
    $request = Slim::getInstance()->request();
    $body = $request->getBody();
    $user = json_decode($body);
    $user->id = 1;
    unset($user->id);
    $allinfo['save_data'] = $user;
    $result = edit(json_encode($allinfo), 'site_settings', 1);
    $result = '{"type":"success","message":"Updated Succesfully"}';
    echo $result;
}
function write($frm)
{
    /* @var $frm cForm */
    if ($frm->validate("confirm")) {
        return edit($frm);
    }
    /* point of sale message at the bottom of the slip */
    $cols = grp(m("value", $_POST["posmsg"]));
    $upd = new dbUpdate("settings", "cubit", $cols, "constant='POSMSG'");
    $upd->run(DB_UPDATE);
    $OUT = "\n\t<h3>Point of Sale Settings</h3>\n\t\n\tSuccessfully updated.<br />";
    return $OUT;
}
Exemplo n.º 6
0
/**
 * Author : Jan Germann
 * Datum : 26.04.2010
 * Modul : files
 * Beschreibung : Dateiendaten Editieren
 *				  in 3 Schritten: Datei auswählen, Dateidaten anzeigen und ändern
 *				  und am ende die Dateidaten Updaten
*/
function edit()
{
    global $msg, $log, $mysql;
    if (!isset($_POST['id'])) {
        //Prüfen ob Dateien zum Editieren in der Datenbank vorhanden sind
        if (1 > mysql_result(mysql_query("SELECT count(*) FROM " . _PREFIX_ . "files"), 0)) {
            $msg->error("Es gibt noch keine Dateien die editiert werden können.");
            return;
        }
        //Selectfeld mit Dateien vorbereiten
        $q = mysql_query("SELECT * FROM " . _PREFIX_ . "files ORDER BY name");
        while ($r = mysql_fetch_object($q)) {
            $data .= "<option value=" . $r->id . ">" . $r->name . "</option>";
        }
        // Template ausfüllen -->
        $tpl = dirname(__FILE__) . "/template/form.edit.choose.tpl";
        $tpl = file_get_contents($tpl);
        return str_replace("%files%", $data, $tpl);
        // <-- Template ausfüllen
    } elseif (isset($_POST['id']) && !isset($_POST['name'])) {
        $q = mysql_query("SELECT * FROM " . _PREFIX_ . "files WHERE id='" . intval($_POST['id']) . "'");
        $o = mysql_fetch_object($q);
        // Template ausfüllen -->
        $tpl = dirname(__FILE__) . "/template/form.edit.tpl";
        if (is_file($tpl)) {
            $template = file_get_contents($tpl);
        }
        $template = str_replace(array("%id%", "%name%", "%description%", "%file%"), array($o->id, $o->name, $o->description, $o->file), $template);
        // <-- Template ausfüllen
        return $template;
    } elseif (isset($_POST['id']) && isset($_POST['name'])) {
        if (empty($_POST['name'])) {
            $msg->error("Sie haben keinen Namen angegeben.");
            unset($_POST['name']);
            return edit();
        }
        //Wenn kein Fehler beim Dateiupload bekannt ist soll die Datei ersetzt werden.
        if (!$_FILES['file']['error']) {
            update_file($_POST['id'], $_FILES['file']);
        }
        $name = mysql_real_escape_string($_POST['name']);
        $description = mysql_real_escape_string($_POST['description']);
        $id = intval($_POST['id']);
        $mysql->query("UPDATE " . _PREFIX_ . "files\r\n\t\t\t\t\t   SET name = '" . $name . "',\r\n\t\t\t\t\t\t   description = '" . $description . "'\r\n\t\t\t\t\t   WHERE id = '" . $id . "'\r\n\t\t\t\t\t   LIMIT 1");
        $msg->success("Datei editiert.");
        $log->add("Dateiupdate", "<id>" . $id . "</id><name>" . $name . "</name><description>" . $description . "</description>");
    }
}
function updateCoupon($id)
{
    $request = Slim::getInstance()->request();
    $body = $request->getBody();
    $coupon = json_decode($body);
    if (isset($coupon->id)) {
        unset($coupon->id);
    }
    $allinfo['save_data'] = $coupon;
    $coupon_details = edit(json_encode($allinfo), 'coupons', $id);
    if (!empty($coupon_details)) {
        $result = '{"type":"success","message":"Changed Succesfully"}';
    } else {
        $result = '{"type":"error","message":"Not Changed"}';
    }
    echo $result;
}
Exemplo n.º 8
0
function jump($action)
{
    switch ($action) {
        case 'add':
            add();
            break;
        case 'edit_del':
            if (array_key_exists('edit', $_REQUEST)) {
                edit();
            } elseif (array_key_exists('delete', $_REQUEST)) {
                delete_confirm();
            } else {
                error('invalid edit_del');
            }
            break;
        case 'update':
            if (array_key_exists('cancel', $_REQUEST)) {
                message('Edit canceled');
                main_page();
            } else {
                update();
            }
            break;
        case 'delete_do':
            if (array_key_exists('cancel', $_REQUEST)) {
                message('Delete canceled');
                main_page();
            } else {
                delete_do();
            }
            break;
        default:
            error_message('unhandled jump: ' . $action);
            main_page();
    }
    // fall-through
    message('jump > fall-through (%s)', $action);
    main_page();
}
function write($_POST)
{
    # get vars
    foreach ($_POST as $key => $value) {
        ${$key} = $value;
    }
    if (isset($back)) {
        return edit($div);
    }
    # validate input
    require_lib("validate");
    $v = new validate();
    $v->isOk($div, "num", 1, 50, "Invalid branch id.");
    $v->isOk($brancod, "string", 0, 50, "Invalid branch code.");
    $v->isOk($branname, "string", 1, 255, "Invalid branch name.");
    $v->isOk($brandet, "string", 0, 255, "Invalid details.");
    # Display errors, if any
    if ($v->isError()) {
        $confirm = "";
        $errors = $v->getErrors();
        foreach ($errors as $e) {
            $confirm .= "<li class=err>{$e['msg']}</li>";
        }
        $confirm .= "<p><input type=button onClick='JavaScript:history.back();' value='&laquo; Correct submission'>";
        return $confirm;
    }
    // Update branch
    db_connect();
    $sql = "UPDATE branches SET brancod = '{$brancod}', branname = '{$branname}', brandet = '{$brandet}' WHERE div = '{$div}'";
    $rslt = db_exec($sql) or errDie("Unable to update branch in Cubit.", SELF);
    $write = "\r\n\t<table border=0 cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "' width='50%'>\r\n\t<tr><th>Branch edited</th></tr>\r\n\t<tr class=datacell><td>Branch, {$branname} ({$brancod}) has been successfully edited.</td></tr>\r\n\t</table>\r\n\t<p>\r\n\t<table border=0 cellpadding='2' cellspacing='1'>\r\n\t<tr><th>Quick Links</th></tr>\r\n\t<tr class='bg-odd'><td><a href='admin-branview.php'>View Branches</a></td></tr>\r\n\t<tr class='bg-odd'><td><a href='main.php'>Main Menu</a></td></tr>\r\n\t</table>";
    return $write;
}
$gui->linked_tprojects = null;
$gui->cfield_types = $cfield_mgr->get_available_types();
$result_msg = null;
$do_control_combo_display = 1;
$cfieldCfg = cfieldCfgInit($cfield_mgr);
// Changed default values
$emptyCF = array('id' => $args->cfield_id, 'name' => '', 'label' => '', 'type' => 0, 'possible_values' => '', 'show_on_design' => 1, 'enable_on_design' => 1, 'show_on_execution' => 0, 'enable_on_execution' => 0, 'show_on_testplan_design' => 0, 'enable_on_testplan_design' => 0, 'node_type_id' => $cfieldCfg->allowed_nodes['testcase']);
$gui->cfield = $emptyCF;
switch ($args->do_action) {
    case 'create':
        $templateCfg->template = $templateCfg->default_template;
        $user_feedback = '';
        $operation_descr = '';
        break;
    case 'edit':
        $op = edit($args, $cfield_mgr);
        $gui->cfield = $op->cf;
        $gui->cfield_is_used = $op->cf_is_used;
        $gui->cfield_is_linked = $op->cf_is_linked;
        $gui->linked_tprojects = $op->linked_tprojects;
        $user_feedback = $op->user_feedback;
        $operation_descr = $op->operation_descr;
        break;
    case 'do_add':
    case 'do_add_and_assign':
        $op = doCreate($_REQUEST, $cfield_mgr, $args);
        $gui->cfield = $op->cf;
        $user_feedback = $op->user_feedback;
        $templateCfg->template = $op->template;
        $operation_descr = '';
        break;
#
#
#
#
#
#
#
#
#
#
# get settings
require "../settings.php";
require "../core-settings.php";
require "../libs/ext.lib.php";
if (isset($_GET['listid'])) {
    $OUTPUT = edit($_GET['listid']);
} else {
    $OUTPUT = "<li> - Invalid use of module.</li>";
}
# display output
require "../template.php";
function edit($listid)
{
    # validate input
    require_lib("validate");
    $v = new validate();
    $v->isOk($listid, "num", 1, 50, "Invalid Price List id.");
    # display errors, if any
    if ($v->isError()) {
        $confirm = "";
        $errors = $v->getErrors();
# decide what to do
if (isset($_POST["key"])) {
    switch ($_POST["key"]) {
        case "write":
            $OUTPUT = write($_POST);
            break;
        default:
            if (isset($_GET['fcid'])) {
                $OUTPUT = edit($_GET['fcid']);
            } else {
                $OUTPUT = "<li> - Invalid use of module";
            }
    }
} else {
    if (isset($_GET['fcid'])) {
        $OUTPUT = edit($_GET['fcid']);
    } else {
        $OUTPUT = "<li> - Invalid use of module";
    }
}
require "template.php";
##
# functions
##
# Enter settings
function edit($fcid)
{
    # validate input
    require_lib("validate");
    $v = new validate();
    $v->isOk($fcid, "num", 1, 20, "Invalid Currency.");
Exemplo n.º 13
0
function confirm($_POST)
{
    # Get vars
    global $_FILES, $DOCLIB_DOCTYPES;
    foreach ($_POST as $key => $value) {
        ${$key} = $value;
    }
    # Validate input
    require_lib("validate");
    $v = new validate();
    $v->isOk($docid, "string", 1, 20, "Invalid document number.");
    $v->isOk($typeid, "string", 1, 20, "Invalid type code.");
    if (isset($xin)) {
        $v->isOk($xin, "num", 1, 20, "Invalid {$DOCLIB_DOCTYPES[$typeid]} number.");
    }
    $v->isOk($docname, "string", 1, 255, "Invalid Document name.");
    $v->isOk($docref, "string", 0, 255, "Invalid Document reference.");
    $date = $day . "-" . $mon . "-" . $year;
    if (!checkdate($mon, $day, $year)) {
        $v->isOk($date, "num", 1, 1, "Invalid date.");
    }
    // $v->isOk ($docname, "string", 1, 255, "Invalid Document name.");
    $v->isOk($descrip, "string", 0, 255, "Invalid Document Description.");
    # Display errors, if any
    if ($v->isError()) {
        $confirm = "";
        $errors = $v->getErrors();
        foreach ($errors as $e) {
            $confirm .= "<li class=err>" . $e["msg"];
        }
        // $confirm .= "<p><input type=button onClick='JavaScript:history.back();' value='&laquo; Correct submission'>";
        return edit($_POST, $confirm);
    }
    if (!isset($xin)) {
        $typRs = get("yr2", "*", "doctypes", "typeid", $typeid);
        $typ = pg_fetch_array($typRs);
        $typename = "({$typ['typeref']}) {$typ['typename']}";
        $xinc = "";
    } else {
        $typename = $DOCLIB_DOCTYPES[$typeid];
        $xinc = xinc_gw($typeid, $xin);
    }
    $confirm = "<h3>Confirm Document</h3>\r\n\t<form action='" . SELF . "' method=post>\r\n\t<table cellpadding='" . TMPL_tblCellPadding . "' cellspacing='" . TMPL_tblCellSpacing . "'>\r\n\t<input type=hidden name=key value=write>\r\n\t<input type=hidden name=docid value='{$docid}'>\r\n\t<input type=hidden name=typeid value='{$typeid}'>\r\n\t<input type=hidden name=docname value='{$docname}'>\r\n\t<input type=hidden name=docref value='{$docref}'>\r\n\t<input type=hidden name=day value='{$day}'>\r\n\t<input type=hidden name=mon value='{$mon}'>\r\n\t<input type=hidden name=year value='{$year}'>\r\n\t<input type=hidden name=descrip value='{$descrip}'>\r\n\t<tr><th>Field</th><th>Value</th></tr>\r\n\t<tr class='even'><td>Type</td><td>{$typename}</td></tr>\r\n\t{$xinc}\r\n\t<tr class='odd'><td>Document Name</td><td>{$docname}</td></tr>\r\n\t<tr class='even'><td>Ref</td><td>{$docref}</td></tr>\r\n\t<tr class='odd'><td>Date</td><td align=center>{$date}</td></tr>\r\n\t<tr class='even'><td>Description</td><td>{$descrip}</td></tr>\r\n\t<tr><td><br></td></tr>\r\n\t<tr><td align=right></td><td valign=left><input type=submit value='Write &raquo;'></td></tr>\r\n\t</table></form>";
    return $confirm;
}
<?php

require_once '../init.php';
switch ($_POST['type']) {
    case 'add':
        if (add($_POST['contact_name'], $_POST['contact_lastname'], $_POST['companyname'], $_POST['first_adress'], $_POST['first_zipcode'], $_POST['first_city'], $_POST['first_housenumber'], $_POST['second_adress'], $_POST['second_zipcode'], $_POST['second_city'], $_POST['second_housenumber'], $_POST['initials'], $_POST['first_telephonenumber'], $_POST['second_telephonenumber'], $_POST['fax'], $_POST['email'], $db)) {
            header('location: ../../public/views/dashboard/dashboard.php');
        } else {
            echo "<script> history.go(-1); </script>";
        }
        break;
    case 'edit':
        if (edit($_POST['id'], $_POST['contact_name'], $_POST['contact_lastname'], $_POST['companyname'], $_POST['first_adress'], $_POST['first_zipcode'], $_POST['first_city'], $_POST['first_housenumber'], $_POST['second_adress'], $_POST['second_zipcode'], $_POST['second_city'], $_POST['second_housenumber'], $_POST['initials'], $_POST['first_telephonenumber'], $_POST['second_telephonenumber'], $_POST['fax'], $_POST['email'], $_POST['ledgeraccountnumber'], $_POST['taxcode'], $_POST['creditworthy'], $_POST['bkrcheck'], $_POST['open_project'], $db)) {
            header('location: ../../public/views/dashboard/dashboard.php');
        } else {
            echo "<script> history.go(-1); </script>";
        }
        break;
    case 'archive':
        $id = filter_var($_POST['id'], FILTER_SANITIZE_NUMBER_INT);
        if (archive($db, $_POST['id'])) {
            header('location: ../../public/views/dashboard/dashboard.php');
        } else {
            header('location: ../../public/views/dashboard/dashboard.php');
        }
        break;
    case 'dearchive':
        $id = filter_var($_POST['id'], FILTER_SANITIZE_NUMBER_INT);
        if (dearchive($db, $_POST['id'])) {
            header('location: ../../public/views/dashboard/dashboard.php');
        }
Exemplo n.º 15
0
Arquivo: nutzer.php Projeto: nubix/cms
/*
* Autor : Jan Germann
* Datum : 24.04.2010
* Modul : user
* Beschreibung : Die Nutzerverwaltung
*/
$_SESSION['content'] = '
	<div id=modulemenu><a href="' . $_SERVER['PHP_SELF'] . '?a=' . $_GET['a'] . '&exec=create">Erstellen</a>
	<a href="' . $_SERVER['PHP_SELF'] . '?a=' . $_GET['a'] . '&exec=edit">Editieren</a>
	<a href="' . $_SERVER['PHP_SELF'] . '?a=' . $_GET['a'] . '&exec=delete">Löschen</a></div>';
switch ($_GET['exec']) {
    case "create":
        $_SESSION['content'] .= insert();
        break;
    case "edit":
        $_SESSION['content'] .= edit();
        break;
    case "delete":
        $_SESSION['content'] .= delete();
        break;
}
function get_rightlevels($select = 0)
{
    $select = intval($select);
    $query = mysql_query("SELECT * FROM " . _PREFIX_ . "rightlevel ORDER BY id");
    while ($o = mysql_fetch_object($query)) {
        if ($o->id == $select) {
            $data .= '<option selected value=' . $o->id . '>' . $o->title . '</option>';
        } else {
            $data .= '<option value=' . $o->id . '>' . $o->title . '</option>';
        }
function updatePointMaster()
{
    $rarray = array();
    $request = Slim::getInstance()->request();
    $body = json_decode($request->getBody());
    $id = $body->id;
    unset($body->id);
    if (isset($body->merchant_name)) {
        unset($body->merchant_name);
    }
    $allinfo['save_data'] = $body;
    //$allinfo['save_data']['offer_to_date'] = $body->offer_to_date.' 23:59:59';
    $save = edit(json_encode($allinfo), 'point_master', $id);
    if (!empty($save)) {
        $rarray = array('type' => 'success', 'offers' => $save);
    } else {
        $rarray = array('type' => 'error', 'message' => 'Internal error please try again later.');
    }
    echo json_encode($rarray);
}
Exemplo n.º 17
0
$reloadType = 'none';
// domain 'none','reloadNavBar'
$tproject_mgr = new testproject($db);
$args = init_args($tproject_mgr, $_REQUEST, $session_tproject_id);
$gui = initializeGui($db, $args);
$of = web_editor('notes', $_SESSION['basehref'], $editorCfg);
$status_ok = 1;
switch ($args->doAction) {
    case 'create':
        $template = $templateCfg->default_template;
        $ui = create($args, $tproject_mgr);
        $gui->testprojects = $ui->testprojects;
        break;
    case 'edit':
        $template = $templateCfg->default_template;
        $ui = edit($args, $tproject_mgr);
        break;
    case 'doCreate':
        $op = doCreate($args, $tproject_mgr);
        $template = $op->status_ok ? null : $templateCfg->default_template;
        $ui = $op->ui;
        $status_ok = $op->status_ok;
        $user_feedback = $op->msg;
        $reloadType = $op->reloadType;
        break;
    case 'doUpdate':
        $op = doUpdate($args, $tproject_mgr, $session_tproject_id);
        $template = $op->status_ok ? null : $templateCfg->default_template;
        $ui = $op->ui;
        $status_ok = $op->status_ok;
        $user_feedback = $op->msg;
Exemplo n.º 18
0
// no direct access
defined('_VALID_MOS') or die('Restricted access');
require_once $mainframe->getPath('admin_html');
$cid = josGetArrayInts('cid');
switch ($task) {
    case 'cancel':
        cancel($option);
        break;
    case 'new':
        edit(0, $option);
        break;
    case 'edit':
        edit($id, $option);
        break;
    case 'editA':
        edit(intval($cid[0]), $option);
        break;
    case 'go2menu':
    case 'go2menuitem':
    case 'resethits':
    case 'menulink':
    case 'save':
    case 'apply':
        save($option, $task);
        break;
    case 'remove':
        trash($cid, $option);
        break;
    case 'publish':
        changeState($cid, 1, $option);
        break;
Exemplo n.º 19
0
checkRights($db, $_SESSION['currentUser'], $args);
$op = new stdClass();
$op->user_feedback = '';
$op->buttonCfg = new stdClass();
$op->buttonCfg->name = "";
$op->buttonCfg->value = "";
$gui = new stdClass();
$gui->tproject_id = $args->tproject_id;
$gui->tplan_id = $args->tplan_id;
$gui->main_descr = lang_get('title_build_2') . config_get('gui_title_separator_2') . lang_get('test_plan') . config_get('gui_title_separator_1') . $args->tplan_name;
$gui->cancelAction = "lib/plan/buildView.php?tproject_id={$gui->tproject_id}&tplan_id={$gui->tplan_id}";
$of = web_editor('notes', $_SESSION['basehref'], $editorCfg);
$of->Value = getItemTemplateContents('build_template', $of->InstanceName, $args->notes);
switch ($args->do_action) {
    case 'edit':
        $op = edit($args, $build_mgr, $date_format_cfg);
        $gui->closed_on_date = $args->closed_on_date;
        $of->Value = $op->notes;
        break;
    case 'create':
        $op = create($args);
        $gui->closed_on_date = $args->closed_on_date;
        break;
    case 'do_delete':
        $op = doDelete($args, $build_mgr);
        break;
    case 'do_update':
        $op = doUpdate($args, $build_mgr, $tplan_mgr, $date_format_cfg);
        $of->Value = $op->notes;
        $templateCfg->template = $op->template;
        break;
Exemplo n.º 20
0
    $do = trim(strtolower($_GET['do']));
    switch ($do) {
        case 'tplcover':
            $error = false;
            echo tplcover($pdo);
            break;
        case 'add':
            if (isset($_SESSION['login']) && $_SESSION['login'] && $_SESSION['permission'] == 'admin') {
                add($pdo);
            } else {
                $error = true;
            }
            break;
        case 'edit':
            if (isset($_SESSION['login']) && $_SESSION['login'] && $_SESSION['permission'] == 'admin') {
                edit($pdo);
            } else {
                $error = true;
            }
            break;
        case 'delete':
            if (isset($_SESSION['login']) && $_SESSION['login'] && $_SESSION['permission'] == 'admin') {
                delete($pdo);
            } else {
                $error = true;
            }
            break;
    }
} else {
    if (isset($_GET['link']) && intval($_GET['link'])) {
        echo view($pdo);
        case "confirm":
            $OUTPUT = confirm($_POST);
            break;
        case "write":
            $OUTPUT = write($_POST);
            break;
        default:
            if (isset($_GET['id'])) {
                $OUTPUT = edit($_GET['id']);
            } else {
                $OUTPUT = "<li> - Invalid use of module";
            }
    }
} else {
    if (isset($_GET['id'])) {
        $OUTPUT = edit($_GET['id']);
    } else {
        $OUTPUT = "<li> - Invalid use of module";
    }
}
# display output
require "template.php";
# Enter new paye bracket details
function edit($id)
{
    # validate input
    require_lib("validate");
    $v = new validate();
    $v->isOk($id, "num", 1, 50, "Invalid interest bracket id.");
    # display errors, if any
    if ($v->isError()) {
function updateCat($id)
{
    $request = Slim::getInstance()->request();
    $body = $request->getBody();
    $coupon = json_decode($body);
    if (isset($coupon->id)) {
        unset($coupon->id);
    }
    if (!empty($coupon->icon) && isset($coupon->icon->filename)) {
        $coupon->icon->filename = time() . $coupon->icon->filename;
        file_put_contents('category_icons/' . $coupon->icon->filename, base64_decode($coupon->icon->base64));
        $coupon->icon = $coupon->icon->filename;
    } else {
        unset($coupon->icon);
    }
    $allinfo['save_data'] = $coupon;
    $coupon_details = edit(json_encode($allinfo), 'category', $id);
    if (!empty($coupon_details)) {
        $result = '{"type":"success","message":"Changed Succesfully"}';
    } else {
        $result = '{"type":"error","message":"Not Changed"}';
    }
    echo $result;
}
Exemplo n.º 23
0
?>
</td>
</tr>
</table>
</td></tr></table>
<table width=95% border=0 cellspacing=1 cellpadding=1 bgcolor=#646c71 style=border-color: #000000;>
<tr><th class=t align=left><b>Shell</b></th></tr>
<tr><td class=contentb><center>
<form action method=POST>
<input type=hidden name="type" value=5>
<textarea cols=150 rows=20 name="value">
<?php 
echo htmlspecialchars(shell());
?>
</textarea><?php 
echo edit();
?>
</form>
<table border="0" width="100%">
<tr>
<td width="50%" align="center"><form action method=POST>
<b>Enter comand:</b>
<input type=hidden name="type" value=2>
<input type=text name="value" size=45><input type=submit value="Enter">
</form></td>
<td width="50%" align="center"><form action method=POST><b>PWD:</b> <input type=text name="value" size=51 value=<?php 
echo pwd();
?>
><input type=hidden name="type" value=3><input type=submit value="Enter">
</form></td>
</tr>
        case "confirm":
            $OUTPUT = confirm($_POST);
            break;
        case "write":
            $OUTPUT = write($_POST);
            break;
        default:
            if (isset($_GET['deptid'])) {
                $OUTPUT = edit($_GET['deptid']);
            } else {
                $OUTPUT = "<li> - Invalid use of module";
            }
    }
} else {
    if (isset($_GET['deptid'])) {
        $OUTPUT = edit($_GET['deptid']);
    } else {
        $OUTPUT = "<li> - Invalid use of module.</li>";
    }
}
# require template
require "template.php";
/*
 * Functions
 *
 */
// Prints a form to edit user with
function edit($deptid)
{
    # validate input
    require_lib("validate");
Exemplo n.º 25
0
     unzip($_REQUEST['dename'], $_REQUEST['ndir'], @$_REQUEST['del']);
     break;
 case "sqlb":
     sqlb();
     break;
 case "sqlbackup":
     sqlbackup($_POST['ip'], $_POST['sql'], $_POST['username'], $_POST['password']);
     break;
 case "ftpa":
     ftpa();
     break;
 case "ftpall":
     ftpall($_POST['ftpip'], $_POST['ftpuser'], $_POST['ftppass'], $_POST['goto'], $_POST['ftpfile'], $_POST['del']);
     break;
 case "edit":
     edit($_REQUEST['fename']);
     break;
 case "save":
     save($_REQUEST['ncontent'], $_REQUEST['fename'], $_REQUEST['encode']);
     break;
 case "cr":
     cr();
     break;
 case "create":
     create($_REQUEST['nfname'], $_REQUEST['isfolder'], $_REQUEST['ndir']);
     break;
 case "ren":
     ren($_REQUEST['file']);
     break;
 case "rename":
     renam($_REQUEST['rename'], $_REQUEST['nrename'], $folder);
Exemplo n.º 26
0
}
if (!isset($_GET['catview'])) {
    $catview = 0;
} else {
    $catview = $_GET['catview'];
}
if (!isset($_GET['copyevent'])) {
    $copyevent = 0;
} else {
    $copyevent = $_GET['copyevent'];
}
if ($op == "eventform") {
    eventform($add_day, $add_month, $add_year, $id);
} else {
    if ($op == "upeventform") {
        edit($id);
    }
}
// Set max length for text area
echo "<script language='javascript' type='text/javascript'>\n";
echo "<!--\n";
echo "function imposeMaxLength(Object, MaxLen)\n";
echo "{\n";
echo "  if (Object.value.length >= MaxLen) Object.value = Object.value.substring(0, MaxLen-1); \n";
echo "   return (Object.value.length <= MaxLen) ;\n";
echo "}\n";
echo "-->\n";
echo "</script>\n";
/*****************/
/* back function */
/*****************/
<?php

if (!isset($_GET['cmd'])) {
    $_GET['cmd'] = NULL;
}
switch ($_GET['cmd']) {
    default:
        comments();
        break;
    case 'delete':
        delete();
        break;
    case 'edit':
        edit();
        break;
}
function comments()
{
    global $domain, $db, $action;
    echo '<div class="heading">
		<h2>Manage Game Comments</h2>
	</div>
        <br clear="all">
	<table id="table">
		<thead>
			<tr>
				<th>ID</th>
				<th>Game ID</th>
				<th colspan="2">Comment</th>
			</tr>
		</thead>
Exemplo n.º 28
0
$dst = @$_GET['dst'];
$oldsrc = @$_GET['oldsrc'];
$olddst = @$_GET['olddst'];
if (!isset($opt) || !isset($src) || !isset($dst)) {
    echo "Argv error!\n";
    exit;
}
switch ($opt) {
    case 'add':
        add($src, $dst);
        break;
    case "del":
        del($src, $dst);
        break;
    case "edit":
        edit($src, $dst, $oldsrc, $olddst);
        break;
    default:
        echo "Opt error!\n";
        break;
}
function edit($src, $dst, $oldsrc, $olddst)
{
    $mysql = new MySQL();
    $mysql->opendb("dns_http_ref", "utf8");
    $sql = "select * from `http_ref` where `src`='{$oldsrc}' and `dst`='{$olddst}'";
    #echo $sql;
    $result = $mysql->query($sql);
    $num_rows = mysql_num_rows($result);
    if ($num_rows == NULL) {
        print_r(json_encode(result_init(1, '数据为空', '')));
Exemplo n.º 29
0
</form>
';
		html_footer();
	}
	break;
case 'edit':
	if (!empty($_POST['save'])) {
		$content = str_replace("\r\n", "\n", $_POST['content']);
		if (($f = @fopen($file, 'w')) && @fwrite($f, $content) !== false && @fclose($f)) {
			listing_page(notice('saved', $file));
		} else {
			listing_page(error('not_saved', $file));
		}
	} else {
		if (@is_readable($file) && @is_writable($file)) {
			edit($file);
		} else {
			listing_page(error('not_edited', $file));
		}
	}
	break;
case 'permission':
	if (!empty($_POST['set'])) {
		$mode = 0;
		if (!empty($_POST['ur'])) $mode |= 0400; if (!empty($_POST['uw'])) $mode |= 0200; if (!empty($_POST['ux'])) $mode |= 0100;
		if (!empty($_POST['gr'])) $mode |= 0040; if (!empty($_POST['gw'])) $mode |= 0020; if (!empty($_POST['gx'])) $mode |= 0010;
		if (!empty($_POST['or'])) $mode |= 0004; if (!empty($_POST['ow'])) $mode |= 0002; if (!empty($_POST['ox'])) $mode |= 0001;

		if (@chmod($file, $mode)) {
			listing_page(notice('permission_set', $file, decoct($mode)));
		} else {
Exemplo n.º 30
0
<?php

require_once '../init.php';
switch ($_POST['type']) {
    case 'add':
        if (add($_POST['id'], $_POST['date_of_invoice'], $_POST['end_invoice_date'], $_POST['invoicenumber'], $_POST['item1'], $_POST['item2'], $_POST['item3'], $_POST['item4'], $_POST['item5'], $_POST['item6'], $_POST['item7'], $_POST['item8'], $_POST['item9'], $_POST['item10'], $_POST['description1'], $_POST['description2'], $_POST['description3'], $_POST['description4'], $_POST['description5'], $_POST['description6'], $_POST['description7'], $_POST['description8'], $_POST['description9'], $_POST['description10'], $_POST['amount1'], $_POST['amount2'], $_POST['amount3'], $_POST['amount4'], $_POST['amount5'], $_POST['amount6'], $_POST['amount7'], $_POST['amount8'], $_POST['amount9'], $_POST['amount10'], $_POST['price1'], $_POST['price2'], $_POST['price3'], $_POST['price4'], $_POST['price5'], $_POST['price6'], $_POST['price7'], $_POST['price8'], $_POST['price9'], $_POST['price10'])) {
            header('location: ../../public/views/finance/invoiceinfo.php?id=' . $_POST['id'] . '&customerid=' . $_POST['customerid']);
        } else {
            echo "<script> history.go(-1); </script>";
        }
        break;
    case 'edit':
        if (edit($_POST['invoicenumber'], $_POST['date_of_invoice'], $_POST['end_invoice_date'], $_POST['paid'], $_POST['item1'], $_POST['item2'], $_POST['item3'], $_POST['item4'], $_POST['item5'], $_POST['item6'], $_POST['item7'], $_POST['item8'], $_POST['item9'], $_POST['item10'], $_POST['description1'], $_POST['description2'], $_POST['description3'], $_POST['description4'], $_POST['description5'], $_POST['description6'], $_POST['description7'], $_POST['description8'], $_POST['description9'], $_POST['description10'], $_POST['amount1'], $_POST['amount2'], $_POST['amount3'], $_POST['amount4'], $_POST['amount5'], $_POST['amount6'], $_POST['amount7'], $_POST['amount8'], $_POST['amount9'], $_POST['amount10'], $_POST['price1'], $_POST['price2'], $_POST['price3'], $_POST['price4'], $_POST['price5'], $_POST['price6'], $_POST['price7'], $_POST['price8'], $_POST['price9'], $_POST['price10'])) {
            header('location: ../../public/views/finance/invoiceinfo.php?id=' . $_POST['id'] . '&customerid=' . $_POST['customerid']);
        } else {
            echo "<script> history.go(-1); </script>";
        }
        break;
}
function edit($id, $date_of_invoice, $end_invoice_date, $paid, $item1, $item2, $item3, $item4, $item5, $item6, $item7, $item8, $item9, $item10, $description1, $description2, $description3, $description4, $description5, $description6, $description7, $description8, $description9, $description10, $amount1, $amount2, $amount3, $amount4, $amount5, $amount6, $amount7, $amount8, $amount9, $amount10, $price1, $price2, $price3, $price4, $price5, $price6, $price7, $price8, $price9, $price10)
{
    global $db;
    global $messageBag;
    if (empty($_POST['date_of_invoice']) || empty($_POST['end_invoice_date']) || !isset($_POST['paid'])) {
        $messageBag->add('w', 'Not all fields are filled in');
        return false;
    }
    if (!empty($item1)) {
        if (empty($description1) || empty($amount1) || empty($price1)) {
            $messageBag->add('w', 'Not all fields are filled in');
            return false;