Esempio n. 1
0
echo $lang['common_customers'];
?>
</h1>

<?php 
$customerInst = new customer();
#######################################################################
## perform action
$status = 1;
if (tool::securePost('action') == "save" && tool::securePost('id')) {
    # fill customer with submitted data
    $customerInst->id = tool::securePost('id');
    $customerInst->fill(tool::securePostAll());
    $status = $customerInst->update();
} elseif (tool::securePost('action') == "save") {
    $customerInst->fill(tool::securePostAll());
    $status = $customerInst->insert();
}
if (tool::securePost('action') == "delete") {
    $customerInst->id = tool::securePost('id');
    $customerInst->delete();
}
if (tool::securePost('action') == "edit") {
    $status = 0;
    $customerInst->activate(tool::securePost('id'));
}
#######################################################################
## make edit / new form
if (!$status) {
    echo "<h2>" . $lang['common_editRecord'] . " (<a href=\"" . $toolInst->encodeUrl("index.php?content=" . $content) . "\">" . $lang['common_newRecord'] . "</a>)</h2>\n";
} else {
Esempio n. 2
0
    $jobInst->start = $toolInst->timestampToSec(tool::securePost('startyear'), tool::securePost('startmonth'), tool::securePost('startday'), tool::securePost('starthour'), tool::securePost('startmin'));
    $jobInst->stop = $toolInst->timestampToSec(tool::securePost('stopyear'), tool::securePost('stopmonth'), tool::securePost('stopday'), tool::securePost('stophour'), tool::securePost('stopmin'));
    $saveflags = 0;
    // handle job flags
    if (tool::securePost('privatejob') == "1") {
        $saveflags += JOB_FLAG_PRIVATE;
    }
    $jobInst->flags = $saveflags;
    $jobInst->stop();
    if (tool::securePost('taskdone') == "1") {
        $taskInst->stop();
        $taskInst->update();
    }
} elseif (tool::securePost('action') == "save") {
    // start job
    $jobInst->fill(tool::securePostAll());
    $jobInst->taskId = $taskInst->id;
    $jobInst->start = $toolInst->timestampToSec(tool::securePost('startyear'), tool::securePost('startmonth'), tool::securePost('startday'), tool::securePost('starthour'), tool::securePost('startmin'));
    $saveflags = 0;
    // handle job flags
    if (tool::securePost('privatejob') == "1") {
        $saveflags += JOB_FLAG_PRIVATE;
    }
    $jobInst->flags = $saveflags;
    $jobId = $jobInst->start();
    $jobInst->activate($jobId);
} elseif (tool::securePost('action') == "deleteattach") {
    $attachment = new attachment(tool::securePost('id'));
    $attachment->delete();
    // we need to reload the task to clear the attachment member in this object
    $taskInst->activate($taskInst->id);
Esempio n. 3
0
?>
</h1>

<?php 
$projectInst = new project();
if (!$loginInst->isCustomer()) {
    #######################################################################
    ## perform action
    $status = 1;
    if (tool::securePost('action') == "save" && tool::securePost('id')) {
        # fill project with submitted data
        $projectInst->id = tool::securePost('id');
        $projectInst->fill(tool::securePostAll());
        $status = $projectInst->update();
    } elseif (tool::securePost('action') == "save") {
        $projectInst->fill(tool::securePostAll());
        $status = $projectInst->insert();
    }
    if (tool::securePost('action') == "delete") {
        $projectInst->id = tool::securePost('id');
        $projectInst->delete();
    }
    if (tool::securePost('action') == "edit") {
        $status = 0;
        $projectInst->activate(tool::securePost('id'));
    }
    #######################################################################
    ## make edit / new form
    if (!$status) {
        echo "<h2>" . $lang['common_editRecord'] . " (<a href=\"" . $toolInst->encodeUrl("index.php?content=" . $content) . "\">" . $lang['common_newRecord'] . "</a>)</h2>\n";
    } else {
Esempio n. 4
0
        $recordType = "new";
    } else {
        $recordType = "edit";
    }
}
if ($action == "new") {
    $requestInst->fill(tool::securePostAll());
    if ($requestInst->insert()) {
        $requestInst->clear();
    }
}
if ($action == "search") {
    if (tool::securePost('lastrecordtype')) {
        $recordType = tool::securePost('lastrecordtype');
    }
    $requestInst->fill(tool::securePostAll());
}
if ($action == "delete") {
    $requestInst->id = tool::securePost('id');
    $requestInst->delete();
    $requestInst->clear();
}
if ($action == "edit") {
    $recordType = "edit";
    $requestInst->activate(tool::securePost('id'));
}
#######################################################################
## make edit / new form
?>

<form method="post" name="form1" enctype="multipart/form-data">
Esempio n. 5
0
<?php 
$userInst = new user();
#######################################################################
## perform action
$status = 1;
if (tool::securePost('action') && tool::securePost('action') == "save" && tool::securePost('id') && tool::securePost('id') != "") {
    # fill user with submitted data
    $userInst->id = tool::securePost('id');
    $userInst->fill(tool::securePostAll());
    if (!DEMO_MODE) {
        $status = $userInst->update();
    } else {
        $toolInst->errorStatus("not allowed in this demo. Sorry ;)");
    }
} elseif (tool::securePost('action') && tool::securePost('action') == "save") {
    $userInst->fill(tool::securePostAll());
    $status = $userInst->insert();
}
if (tool::securePost('action') && tool::securePost('action') == "delete" && tool::securePost('id') && tool::securePost('id') != "") {
    $userInst->id = tool::securePost('id');
    if (!DEMO_MODE) {
        $userInst->delete();
    } else {
        $toolInst->errorStatus("not allowed in this demo. Sorry ;)");
    }
}
if (tool::securePost('action') && tool::securePost('action') == "edit" && tool::securePost('id') && tool::securePost('id') != "") {
    $status = 0;
    $userInst->activate(tool::securePost('id'));
}
#######################################################################
Esempio n. 6
0
if ($action == "search") {
    if (tool::securePost('lastrecordtype')) {
        $recordType = tool::securePost('lastrecordtype');
    }
    $taskInst->fill(tool::securePostAll());
    $taskInst->id = tool::securePost('id');
}
if ($action == "delete") {
    $taskInst->id = tool::securePost('id');
    $taskInst->delete();
}
if ($action == "edit") {
    $recordType = "edit";
    $taskInst->activate(tool::securePost('id'));
}
$taskInst->fillFilter(tool::securePostAll());
#######################################################################
## make edit / new form
?>

<form method="post" name="form1" enctype="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE" value="<?php 
echo $config['attach_maxfilesize'];
?>
">
<input type="hidden" name="id" value="<?php 
echo $taskInst->id;
?>
">
<input type="hidden" name="action" value="">
<input type="hidden" name="order" value="<?php 
Esempio n. 7
0
    }
}
if (tool::securePost('action') == "update") {
    $recordType = "edit";
    $accessInst->fill(tool::securePostAll());
    if (!DEMO_MODE) {
        if ($accessInst->update()) {
            $accessInst->clear();
            $recordType = "new";
        }
    } else {
        $toolInst->errorStatus("not allowed in this demo. Sorry ;)");
    }
}
if (tool::securePost('action') == "new") {
    $accessInst->fill(tool::securePostAll());
    if ($accessInst->insert()) {
        $accessInst->clear();
        $recordType = "new";
    } else {
        $recordType = "edit";
    }
}
if (tool::securePost('action') == "delete") {
    $accessInst->id = tool::securePost('id');
    if (!DEMO_MODE) {
        $accessInst->delete();
    } else {
        $toolInst->errorStatus("not allowed in this demo. Sorry ;)");
    }
}