예제 #1
0
     $error = 'Successfully saved your timesheet... ';
     if ($forWhichUID == 0 || $forWhichUID == $_USER['uid']) {
         $output = generateTimesheet();
     } else {
         $output = generateTimesheet($forWhichUID, false, true, $forWhichUID);
     }
     break;
 case 'savetimesheet':
     $maxRowNumber = COM_applyFilter($_POST['max_row_number'], true);
     $approvalUID = COM_applyFilter($_POST['approved_by'], true);
     $forWhichUID = COM_applyFilter($_POST['emp'], true);
     $ts = new nexTime();
     for ($cntr = 0; $cntr < $maxRowNumber; $cntr++) {
         $ts->setDataFromPOST($cntr);
         if ($forWhichUID == 0) {
             $ret = $ts->commitData($approvalUID, $_USER['uid']);
         } else {
             $ret = $ts->commitData($approvalUID, $forWhichUID);
         }
     }
     if ($ret) {
         $error = 'Successfully saved your timesheet... ';
         if ($forWhichUID == 0 || $forWhichUID == $_USER['uid']) {
             $output = generateTimesheet();
         } else {
             $output = generateTimesheet($forWhichUID, false, true, $forWhichUID);
         }
     } else {
         $error = 'There is an error in your timesheet - ensure all numeric fields are filled with numeric data!...';
         $output = '';
     }
예제 #2
0
                break;
        }
        $list = str_replace("&", "&amp;", $list);
        echo $list;
        echo "<listname>" . htmlentities($title) . "</listname>";
        echo "</data>";
        break;
    case 'save':
        $ts = new nexTime();
        header("Cache-Control: no-store, no-cache, must-revalidate");
        header("content-type: application/xml");
        echo "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n";
        $uid = nxtime_testuser($username, $password);
        if ($uid > 0) {
            $ds = $_POST['datestamp0'];
            $testdate = strftime($ds . " 00:00:00", time());
            $testintdate = strtotime($testdate);
            $_POST['datestamp0'] = $testintdate;
            $_USER['uid'] = $uid;
            $ts->setDataFromPOST(0);
            $ret = $ts->commitData(0, $uid);
            if ($ret) {
                echo "<data>\n<error>0</error>\n</data>";
            } else {
                echo "<data>\n<error>1</error>\n</data>";
            }
        } else {
            echo "<data>\n<error>1</error>\n</data>";
        }
        break;
}