Location: PHPKode > projects > NOLA > glpostupd.php
<? include('includes/main.php'); ?>
<script language="JavaScript">
     var calDateFormat='yyyy-MM-DD';
</script>
<script language="JavaScript" src="js/calendar.js"></script>
<?
     echo texttitle('GL Reverse Post');
     if ($unpost) {
          if ($begindate) {
               $query = "update gltransvoucher set status='0', postuserid=NULL, posteddate='0000-00-00 00:00:00', post2date='0000-00-00', lastchangedate=NOW(), lastchangeuserid=".sqlprep($userid)." where gltransvoucher.status='1' and gltransvoucher.cancel='0' and gltransvoucher.standardset='0' and substring(gltransvoucher.posteddate,1,10) = ".sqlprep($begindate);
          } else {
               $query = "update gltransvoucher set status='0', postuserid=NULL, posteddate='0000-00-00 00:00:00', post2date='0000-00-00', lastchangedate=NOW(), lastchangeuserid=".sqlprep($userid)." where gltransvoucher.status='1' and gltransvoucher.cancel='0' and gltransvoucher.standardset='0' and gltransvoucher.post2date=".sqlprep($postedyear."-".$postedmonth."-01");
          };
          if ($conn->Execute($query) === false) die(texterror('Unable to reverse vouchers.'));
          echo textsuccess($conn->Affected_Rows()." vouchers reversed OK.");
     } else {
          $postyear=createtime("Y");
          $postmonth=createtime("m");
          $bgdate=createtime("Y-m-d");
          if ($pdate) {
               echo texttitle('Reverse All Vouchers Posted on a Specific Date');
               echo '<form action="glpostupd.php" method="post" name="mainform"><input type="hidden" name="unpost" value="1"><table><tr><td>Date to Unpost:</td><td><input type="text" name="begindate" onchange="formatDate(this)" value="'.$bgdate.'" size="30"'.INC_TEXTBOX.'><a href="javascript:doNothing()" onclick="setDateField(document.mainform.begindate); top.newWin = window.open(\'calendar.html\',\'cal\',\'dependent=yes,width=210,height=230,screenX=200,screenY=300,titlebar=yes\')"><img src="images/calendar.gif" border="0" alt="Display Calendar"></a></td></tr>';
               echo '</table><input type="submit" value="Reverse Post"></form>  <a href="glpostupd.php">Switch to Reverse All Entries Posted TO a Specific Month</a>';
          } else {
               echo texttitle('Reverse All Vouchers Posted TO a Specific Month');
               echo '<form action="glpostupd.php" method="post" name="mainform"><input type="hidden" name="unpost" value="1"><table><tr><td>Year/Month to Unpost:</td><td><input type="text" name="postedyear" value="'.$postyear.'" size="14" maxlength="4"'.INC_TEXTBOX.'><input type="text" name="postedmonth" value="'.$postmonth.'" size="14" maxlength="4"'.INC_TEXTBOX.'></td></tr>';
               echo '</table><input type="submit" value="Reverse Post"></form> <a href="glpostupd.php?pdate=1">Switch to Reverse All Entries Posted ON a Specific Date</a>';
          };
     };
?>
<? include('includes/footer.php'); ?>
Return current item: NOLA