Exemplo n.º 1
0
/**
 * @param Symfony\Component\Translation\Translator $translator
 * @return null|string
 */
function drawRequirements($translator)
{
    $requirements = getRequirements();
    $html = null;
    $html .= '<tr>
                <td>
                    ' . $translator->trans('Required') . '
                </td>
                <td>
                </td>
              </tr>';
    foreach ($requirements['required'] as $extension => $req) {
        $checkExtension = check_extension($extension, $translator->trans('Yes'), $translator->trans('No'));
        $html .= '<tr>
                    <td>
                        <a href="' . $req['url'] . '">' . $extension . '</a>
                    </td>
                    <td>
                        ' . $checkExtension . '
                    </td>
                  </tr>';
    }
    $html .= '<tr>
                <td>
                    ' . $translator->trans('Optional') . '
                </td>
                <td>
                </td>
              </tr>';
    foreach ($requirements['optional'] as $extension => $req) {
        $checkExtension = check_extension($extension, $translator->trans('Yes'), $translator->trans('No'));
        $html .= '<tr>
                    <td>
                        <a href="' . $req['url'] . '">' . $extension . '</a>
                    </td>
                    <td>
                        ' . $checkExtension . '
                    </td>
                  </tr>';
    }
    return $html;
}
function getProjectDataForCharts($project_id, $con)
{
    $mega = array("weekly_report" => getWeeklyReports($project_id, $con, "*", "`project_id`", " = " . $project_id), "project" => getProjects($project_id, $con, "*", "project_id", " = " . $project_id), "participation" => getParticipation($project_id, $con, "*", "project_id", " = " . $project_id), "individual" => getIndividual($project_id, $con, "*", "project_id", " = " . $project_id), "requirement" => getRequirements($project_id, $con, "*", "project_id", " = " . $project_id), "weekly_requirement" => getWeeklyRequirements($project_id, $con, "*", "project_id", " = " . $project_id));
    echo json_encode($mega);
}
Exemplo n.º 3
0
define('INSTALL', 'install');
// 安装成功
define('INSTALLED', 'installed');
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : CHECK;
if (is_file("install.lock") && $action != UPGRADED && $action != INSTALLED) {
    header("location: ../index.php");
}
$lang = getPreferredLanguage();
$viewDir = dirname(__FILE__) . '/views/' . $lang . '/';
if (!is_dir($viewDir)) {
    $viewDir = dirname(__FILE__) . '/views/zh_cn/';
}
switch ($action) {
    case CHECK:
        $viewFile = $viewDir . 'check.php';
        $requirements = getRequirements();
        $dirRights = getDirRights($paths);
        renderFile($viewFile, array('requirements' => $requirements, 'dirRights' => $dirRights, 'checkResult' => getCheckResult($requirements, $dirRights)));
        break;
    case BACKUP:
        $viewFile = $viewDir . 'upgrade.php';
        list($dbhost, $dbname, $port, $dbuser, $dbpwd, $dbprefix) = getDBConfig(CONFIG_FILE);
        list($result, $info, $target, $con) = getDBCon($dbhost, $port, $dbuser, $dbpwd);
        $version = getDBVersion($con, $dbname, $dbprefix);
        if ($_CFG['version'] == $_CFG['versionMap'][$version]) {
            @mysql_close($con);
            header('Location: index.php?action=upgraded');
        }
        if (isset($_GET['download'])) {
            if (!$result) {
                $dumpSql = backupDB($con, $dbname, $dbprefix);
Exemplo n.º 4
0
     getEmployeeStatus($db);
 } else {
     if (isset($_GET['ename']) && !empty($_GET['ename'])) {
         getEId($db);
     } else {
         if (isset($_GET['commentSubmit']) && !empty($_GET['commentSubmit'])) {
             insertComment($db);
         } else {
             if (isset($_GET['getform']) && !empty($_GET['getform'])) {
                 getForm($db);
             } else {
                 if (isset($_GET['editform']) && !empty($_GET['editform'])) {
                     editForm($db);
                 } else {
                     if (isset($_GET['eid']) && !empty($_GET['eid'])) {
                         getRequirements($db);
                     } else {
                         if (isset($_GET['deleteform']) && !empty($_GET['deleteform'])) {
                             deleteForm($db);
                         } else {
                             if (isset($_GET['deletefield']) && !empty($_GET['deletefield'])) {
                                 deleteField($db);
                             } else {
                                 if (isset($_GET['empid']) && !empty($_GET['empid'])) {
                                     pullVals($db);
                                 } else {
                                     if (isset($_POST['addField']) && !empty($_POST['addField'])) {
                                         updateForm($db);
                                     } else {
                                         if (isset($_POST['input']) && !empty($_POST['input'])) {
                                             editEmployee($db);