Exemplo n.º 1
0
     break;
 case 'approveallchecked':
     $idlist = COM_applyFilter($_REQUEST['allids']);
     $postedemp = COM_applyFilter($_REQUEST['emp'], true);
     if ($idlist == '') {
         $error = 'You have not chosen any items...';
         $output = '';
     } else {
         $ts = new nexTime();
         $arr = explode(",", $idlist);
         $retval = true;
         $thisval = '';
         foreach ($arr as $id) {
             $thisval = COM_applyFilter($_REQUEST['approve' . $id]);
             //using this ID, we need to determine the date range it fits in...
             $dtarray = $ts->generateSundayToSundayRange($ts->getDateStampFromID($id));
             if ($thisval != '') {
                 $emp = $ts->getUIDFromID($id);
                 $ret = $ts->approveRange($emp, $dtarray[0], $dtarray[1]);
                 $retval = $retval & $ret;
             }
             $thisval = '';
         }
         if ($retval) {
             $error = 'Successfully approved all of the items you chose...';
             $output = '';
             $ret = $ts->generateApprovalTimesheetRows($_USER['uid'], $postedemp);
             $output = $ret[1];
         } else {
             $error = 'Error! Database Error thrown.';
             $output = '';