$script->shutdown( 0, 'No tasks available.' );
}

$replies = $cli->askQuestionMultipleChoices( 'Choose tasks to perform', $taskList, 'validateReplyMultiple', true );
if ( empty( $replies ) )
{
    $script->shutdown( 0, 'No tasks selected' );
}

foreach ( $replies as $key )
{
    $task = $applications[$tasksIdsToApplicationsIds[$key]];
    switch ( $task['task'] )
    {
        case TASK_UPDATE:
            updateApplication( $task['object'], $task['internal_name'] );
            break;
        case TASK_CREATE:
            createApplication( $clusterIdentifier, $task['identifier'], $task['internal_name'], $country, $language );
            break;
        case TASK_CREATE_HOMEPAGE:
            createHomepage( $country, $clusterIdentifier, $language );
            break;
        case TASK_CREATE_PAGES_FOLDER:
            createPagesFolder( $country, $clusterIdentifier, $language );
            break;
        case TASK_CREATE_MERCK_MANUAL_SHOWCASE:
            createApplication( $clusterIdentifier, $task['identifier'], $task['internal_name'], $country, $language );
            break;
        default:
            $script->shutdown( 1, "Unknown task {$task['task']}" );
    $appName = isset($_POST['appName']) ? $_POST['appName'] : '';
    $FullForm = isset($_POST['FullForm']) ? $_POST['FullForm'] : '';
    $desc = isset($_POST['desc']) ? $_POST['desc'] : '';
    //echo $appName .$FullForm .$desc .$_FILES["file"]["name"];
    //echo $appName ."<br/>" . trim($appName);
    if (trim($appName) == "" || trim($FullForm) == "" || trim($desc) == "") {
        $alert_msg = "Input Incorrect!!!";
    } else {
        createNewApplication($appName, $FullForm, $desc, $fileName);
        $error_occured = false;
        $alert_msg = "Information added successfully";
    }
}
if ($actionType == "appUpdate") {
    $appId = isset($_POST["id"]) ? $_POST["id"] : '';
    updateApplication($appId, $fileName);
    $error_occured = false;
    $alert_msg = "Image added successfully";
}
if ($actionType == "intfAddDiagram") {
    $keywordIdUpdate = isset($_POST["id"]) ? $_POST["id"] : '';
    updateKeywordForDiagram($keywordIdUpdate, $fileName);
    $error_occured = false;
    $alert_msg = "Image added successfully";
}
if ($actionType == "intf") {
    $InterfaceName = isset($_POST['InterfaceName']) ? $_POST['InterfaceName'] : '';
    $Type = isset($_POST['Type']) ? $_POST['Type'] : '';
    $InterfaceDesc = isset($_POST['InterfaceDesc']) ? $_POST['InterfaceDesc'] : '';
    $SelectAppNames = isset($_POST["SelectAppNames"]) ? $_POST["SelectAppNames"] : '';
    //echo $SelectAppNames;