Example #1
0
}
######################################################################################################
#####		view project file
if ($viewprojectfile) {
    $sql = "SELECT email_name as ename, budgetfile, phaseno, budgetstart, \n            budgetend, actualstart, actualend, date \n        FROM timesheet.projbudgetfile \n        WHERE budgetfileid='{$budgetfileid}' and projcode_id='{$projcode_id}';";
    $result = mysql_query($sql);
    include "err_msg.inc";
    list($ename, $budgetfile, $phaseno, $budgetstart, $budgetend, $actualstart, $actualend, $date) = mysql_fetch_array($result);
    echo "<hr><h2>Budget File for Project <font color=#0000ff>" . $brcode[$projcode_id] . "</font> (Phase {$phaseno}).</h2>";
    echo "<h3>This budget file was provided by <font color=#ff0000>{$ename}</font> on {$date}.</h3>";
    echo "<table>";
    echo "<tr><th>&nbsp;</th><th>Budget</th><th>Actual</th></tr>";
    echo "<tr><th align=left>Start Date</th><td>{$budgetstart}</td><td>{$actualstart}</td></tr>";
    echo "<tr><th align=left>End Date</th><td>{$budgetend}</td><td>{$actualend}</td></tr>";
    echo "</table>";
    displaybudgetdata($budgetfile, $ref);
}
if ($modifybudgetdataentry) {
    echo "<hr>";
    $dstr = date("Y-m-d");
    if ($actualstart == $actualend) {
        $sql = "UPDATE timesheet.projbudgetfile \n        SET projcode_id='{$projectid}', phaseno='{$phaseno}'  \n        WHERE budgetfileid='{$budgetfileid}'";
    } else {
        $sql = "UPDATE timesheet.projbudgetfile \n        SET projcode_id='{$projectid}', phaseno='{$phaseno}', actualstart='{$actualstart}', actualend='{$actualend}'  \n        WHERE budgetfileid='{$budgetfileid}'";
    }
    #echo "$sql<br>";
    $result = mysql_query($sql);
    include "err_msg.inc";
    echo "<h2>Project Budget Data Modification Completed.</h2>";
}
######################################################################################################
        $date = date("Y-m-d");
        if ($actualstart == $date) {
            $actualstart = $budgetstart;
        }
        if ($actualend == $date) {
            $actualend = $budgetend;
        }
        $sql = "INSERT INTO timesheet.projbudgetfile \n        \tSET budgetfileid='null', email_name='{$email_name}', \n            projcode_id='{$projectid}', phaseno='{$phaseno}', budgetfile='{$filedata}', \n            neworold='y', date='{$date}', \n            budgetstart='{$budgetstart}', budgetend='{$budgetend}', \n            actualstart='{$actualstart}', actualend='{$actualend}',\n            dateinrow='{$daterow}';";
        $result = mysql_query($sql);
        include "err_msg.inc";
        $autoid = mysql_insert_id();
        //echo $autoid."<br>";
        echo "<h2>Contents in your project budget file are as follows.</font></h2>";
        $userstr = "?" . base64_encode($userinfo . "&deleteprojectfile=y&projcode_id={$projectid}&autoid={$autoid}");
        $ref = "<h3><a href=\"{$PHP_SELF}{$userstr}\">Delete This Budget File.</a></h3>";
        displaybudgetdata($filedata, $ref);
        echo "<h3><br><font color=#0000ff>Budget file for  project <font color=#ff0000>" . $brcode[$projectid] . "</font> have been successfully entered into DB.</font></h3><br>";
        /*
        		echo "<b><br><br>\"$filename_name\" has been uploaded, and ".
            	" is available for <a href=\"/$copyfileto$filename_name\" target=\"_blank\">view</a>.";
        		echo "<br>File absolute path on $SERVER_NAME is $fldcopy$filename_name.</b>";
        		//*/
    }
}
if ($cancel) {
    echo "<h3><br><br>You can upload file later.</h3>";
    exit;
}
######################################################################################################
#####		List previous project data
#####	for project leader