示例#1
0
    /**
     * Display input form, type can be 'new', or 'edit', if new all field will be set
     * empty or 0. Or else all field data will pull from database.
     *
     * @param string type 
     * @param int overtime_id
     * @return 
     * @access public
     */
    public function getInputForm($type, $overtime_id, $token)
    {
        $mandatorysign = "<b style='color:red'>*</b>";
        $header = "";
        // parameter to display form header
        $action = "";
        $savectrl = "";
        $searchctrl = "";
        $deletectrl = "";
        $itemselect = "";
        $previewctrl = "";
        $orgctrl = "";
        $this->created = 0;
        if ($type == "new") {
            $header = "New";
            $action = "create";
            if ($overtime_id == 0) {
                $this->otapproval_name = "";
                $this->isactive = "";
                $this->defaultlevel = 10;
                $otapprovalchecked = "CHECKED";
                //$this->overtime_no = getNewCode($this->xoopsDB,"overtime_no",$this->tableovertime,"");
                $this->overtime_date = getDateSession();
                $this->payment_type = "C";
                $this->iscomplete = 0;
            }
            $savectrl = "<input astyle='height: 40px;' name='btnSave' value='Save' type='submit'>";
            $checked = "CHECKED";
            $deletectrl = "";
            $addnewctrl = "";
            $selectStock = "";
            $selectClass = "";
            $selectCharge = "";
        } else {
            $action = "update";
            $savectrl = "<input name='overtime_id' value='{$this->overtime_id}' type='hidden'>" . "<input astyle='height: 40px;' name='btnSave' value='Save' type='submit'>";
            if ($this->isAdmin) {
                $recordctrl = "<form target='_blank' action='recordinfo.php' method='POST'>" . "<input name='tablename' value='{$this->tableovertime}' type='hidden'>" . "<input name='id' value='{$this->overtime_id}' type='hidden'>" . "<input name='idname' value='overtime_id' type='hidden'>" . "<input name='title' value='Otapproval' type='hidden'>" . "<input name='btnView' value='View Record Info' type='submit'>" . "</form>";
            }
            //force isactive checkbox been checked if the value in db is 'Y'
            if ($this->isactive == 1) {
                $checked = "CHECKED";
            } else {
                $checked = "";
            }
            $header = "Edit";
            if ($this->allowDelete($this->overtime_id)) {
                $deletectrl = "<FORM action='otapproval.php' method='POST' onSubmit='return confirm(" . '"confirm to remove this otapproval?"' . ")'><input type='submit' value='Delete' name='btnDelete'>" . "<input type='hidden' value='{$this->overtime_id}' name='overtime_id'>" . "<input type='hidden' value='delete' name='action'><input name='token' value='{$token}' type='hidden'></form>";
            } else {
                $deletectrl = "";
            }
            $addnewctrl = "<Form action='otapproval.php' method='POST'><input name='btnNew' value='New' type='submit'></form>";
            $previewctrl = "<FORM target='_blank' action='viewovertime.php' method='POST' aonSubmit='return confirm(" . '"confirm to remove this overtime?"' . ")'><input type='submit' value='Preview' name='btnPreview'>" . "<input type='hidden' value='{$this->overtime_id}' name='overtime_id'>" . "<input type='hidden' value='delete' name='action'><input name='token' value='{$token}' type='hidden'></form>";
        }
        $searchctrl = "<Form action='otapproval.php' method='POST'>\r\n                            <input name='btnSearch' value='Search' type='submit'>\r\n                            <input name='action' value='search' type='hidden'>\r\n                            </form>";
        $selectCash = "";
        $selectCheque = "";
        if ($this->payment_type == "Q") {
            $selectCheque = "SELECTED";
        } else {
            $selectCash = "SELECTED";
        }
        if ($this->payment_type == "C") {
            $stylecno = "style='display:none'";
        } else {
            $stylecno = "";
        }
        $this->stylecomplete = "style='display:none'";
        $this->styleenable = "style='display:none'";
        $this->stylesave = "style='display:none'";
        $this->styleverify = "style='display:none'";
        $this->stylepublish = "style='display:none'";
        if ($type == "edit") {
            if ($this->iscomplete == 0) {
                $this->stylecomplete = "";
                $this->stylesave = "";
                $formsubmit = "onsubmit='return validateOtapproval()'";
            } else {
                $this->styleenable = "";
                $formsubmit = "onsubmit='return false'";
            }
            if ($this->issubmit == 1) {
                $publishbtn = "Re-Activate (Employee)";
                $this->styleverify = "";
                $this->stylesave = "style='display:none'";
                $this->stylepublish = "";
                $formsubmit = "onsubmit='return false'";
            } else {
                $publishbtn = "Submit Form";
                $this->stylepublish = "";
            }
            if ($this->isverify == 1) {
                $this->stylecomplete = "";
                $this->stylepublish = "style='display:none'";
                $this->styleverify = "";
                $verifybtn = "Re-Activate (HOD)";
            } else {
                $this->stylecomplete = "style='display:none'";
                $verifybtn = "Verify";
            }
            if ($this->iscomplete == 1) {
                $this->stylecomplete = "style='display:none'";
                $this->styleverify = "style='display:none'";
            }
        } else {
            $this->stylesave = "";
            $formsubmit = "onsubmit='return validateOtapproval()'";
        }
        // setting for verified_by
        $login_user = $this->getEmployeeId($this->updatedby);
        if ($login_user != $this->verified_by) {
            $this->styleverify = "style='display:none'";
        }
        //end
        echo <<<EOF


<table style="width:140px;">
<tbody>
<td>{$addnewctrl}</td>
<td>{$searchctrl}</td>
<td><form {$formsubmit} method="post"
 action="otapproval.php" name="frmOtapproval"  enctype="multipart/form-data"><input name="reset" value="Reset" type="reset"></td></tbody></table>

<input type="hidden" name="deletesubline_id" value="0">
<input type="hidden" name="deletenoteline_idss" value="0">
<input type="hidden" name="iscomplete" value="{$this->iscomplete}">
<input type="hidden" name="fldnamebtn" value="">
<input type="hidden" name="fldnamebtn_id" value="0">
<input type="hidden" name="batch_id" value="{$this->batch_id}">

  <table style="text-align: left; width: 100%;" border="0" cellpadding="0" cellspacing="1">
    <tbody>
        <tr>
        <th colspan="4" rowspan="1">{$header}</th>
        </tr>
        <tr>
        <td class="head">Organization {$mandatorysign}</td>
        <td class="even">{$this->orgctrl}</td>
        <td class="head">Date {$mandatorysign}</td>
        <td class="even">
        <input name='overtime_date' id='overtime_date' value="{$this->overtime_date}" maxlength='10' size='10'>
        <input name='btnDate' value="Date" type="button" onclick="{$this->overtimedatectrl}"> <font color=red>YYYY-MM-DD (Ex: 2009-01-30)</font>
        </td>

        </tr>

        <tr>
        <td class="head">Period</td>
        <td class="even">{$this->periodctrl}</td>
        <td class="head">Doc No</td>
        <td class="even">{$this->overtime_no}</td>
        </tr>

        <tr>
        <td class="head">Employee</td>
        <td class="even" colspan="3">{$this->employeectrl}</td>
        </tr>

        <tr style="display:none">
        <td class="head">Payment Method</td>
        <td class="even">
        <select name="payment_type" onchange="changeMethod(this.value)">
        <option value="C" {$selectCash}>Cash</option>
        <option value="Q" {$selectCheque}>Cheque</option>
        </select>
        </td>
        <td class="head">Cheque No</td>
        <td class="even"><input {$stylecno} maxlength="10" size="10" name="overtime_chequeno" value="{$this->overtime_chequeno}"></td>
        </tr>

        <tr style="display:none">

        <td class="head">To Account</td>
        <td class="even" colspan="3">{$this->toaccountsctrl}</td>
        </tr>

        <tr>
        <td class="head">Description</td>
        <td class="even" colspan='3'><textarea name="description" cols="40" rows="3">{$this->description}</textarea></td>
        </tr>

        <tr>
        <td class="head">Verify By</td>
        <td class="even" colspan='3'>{$this->verifyctrl}</td>
        </tr>
    </tbody>
  </table>
EOF;
        if ($type != "new") {
            $this->getAlertTable($this->employee_id);
            $this->getSubTable($this->overtime_id);
        } else {
        }
        echo <<<EOF

<br>
<table astyle="width:150px;"><tbody><td width=1 {$this->stylesave}>{$savectrl}
\t<input name="action" value="{$action}" type="hidden">
\t<input name="token" value="{$token}" type="hidden"></td>
\t</form>
    <td width=1 nowrap>

    <input type="button" value="{$publishbtn}" onclick="overtimeUpdate('issubmit',{$this->issubmit})" {$this->stylepublish}>
    <input type="button" value="{$verifybtn}" onclick="overtimeUpdate('isverify',{$this->isverify})" {$this->styleverify}>
    <input type="button" value="Complete" onclick="overtimeComplete()" {$this->stylecomplete} {$this->styledisplayadmin}>
    <input type="button" value="Re-Enable" onclick="overtimeEnable()" {$this->styleenable} {$this->styledisplayadmin}>
    </td>
    <td >{$previewctrl}</td>
    <td align="right" {$this->stylesave}>{$deletectrl}</td>
    </tbody></table>
  <br>

{$recordctrl}

EOF;
    }
示例#2
0
    if (strpos($browser, $ab) > 0) {
        $deniedaccess = false;
        break;
    } else {
        continue;
    }
}
if ($deniedaccess != "" && $i > 0) {
    //if user define will enforce checking
    redirect_header("{$url}", 300, "<b style='color:red'>Your browser {$browser} is not supported, please click <a href='{$supportbrowserurl}' target='_blank'>here</a> to get supported browser.</b>");
}
//if there is no module id submit from another include use simantz module as menu
if ($parentwindows_id == "") {
    $parentwindows_id = 0;
}
$curr_date = getDateSession($curr_date);
//echo $curr_date=$defaultDateSession;
$currenturl = curPageURL();
$action = $_REQUEST['action'];
if (strpos($currenturl, "?") > 0) {
    $newurl = "'{$currenturl}&switchorg=Y&defaultorganization_id='+this.value+'&action={$action}'";
} else {
    $newurl = "'{$currenturl}?action={$action}&switchorg=Y&defaultorganization_id='+this.value";
}
$orgctrl = $ctrl->selectionOrg($userid, $defaultorganization_id, 'N', "location.href={$newurl}");
//echo <<< EOF
//<a href="http://apycom.com/" style='display:none'>Apycom jQuery Menus</a>
//EOF;
//$menulist = "<div id='navbarCP' style='height:30px'><div id='menu'><ul class='menu' id='menu'>
//        <li>
//        <a href='index.php' class='parent'><span>Home</span></a>
<?php

include "system.php";
$action = $_GET['action'];
if (!isset($action) || $action == 'create') {
    include "../simantz/class/pchart/pChart/pData.class";
    include "../simantz/class/pchart/pChart/pChart.class";
    //$oriyear= date("Y",time());
    //$orimonth=date("m",time());
    //$oriyear=2008;
    //$orimonth=8;
    $orimonth = right(left(getDateSession(), 7), 2);
    $oriyear = left(getDateSession(), 4);
    $p = array();
    $arrtotalamt = array();
    //$period1=$period->getPeriodID($year,$month);
    for ($i = 5; $i >= 0; $i--) {
        $year = $oriyear;
        $month = $orimonth - $i;
        if ($month <= 0) {
            $month = $month + 12;
            $year = $year - 1;
        }
        if (strlen($month) == 1) {
            $month = "0" . $month;
        }
        //$period1=$period->getPeriodID($year,$month);
        $curperiodname = $year . '-' . $month;
        array_push($p, $year . '-' . $month);
        $sql = "SELECT '{$curperiodname}',coalesce(sum(localamt),0) as totalamt\n                FROM sim_bpartner_quotation q\n                where q.iscomplete=1 and  left(CAST( q.document_date AS CHAR),7)='{$curperiodname}'\n                group by left(CAST( q.document_date AS CHAR),7)";
        $query = $xoopsDB->query($sql);
示例#4
0
    /**
     * Display input form, type can be 'new', or 'edit', if new all field will be set
     * empty or 0. Or else all field data will pull from database.
     *
     * @param string type
     * @param int paymentvoucher_id
     * @return
     * @access public
     */
    public function getInputForm($type, $paymentvoucher_id, $token)
    {
        global $prefix_pv;
        $mandatorysign = "<b style='color:red'>*</b>";
        $header = "";
        // parameter to display form header
        $action = "";
        $savectrl = "";
        $deletectrl = "";
        $itemselect = "";
        $originalamtctrl = "";
        $orgctrl = "";
        $this->created = 0;
        if ($type == "new") {
            $header = "New PaymentVoucher";
            $action = "create";
            if ($paymentvoucher_id == 0) {
                $this->paidto = "";
                $this->iscomplete = "";
                $this->exchangerate = 1;
                $this->amt = 0;
                $this->displaychequenostyle = "style='display:none'";
                //$this->paymentvoucher_date=date('Y-m-d',time());
                $this->paymentvoucher_date = getDateSession();
                $this->paymentvoucher_type = "B";
                $this->batch_id = 0;
                $this->paymentvoucher_no = getNewCode($this->xoopsDB, "paymentvoucher_no", $this->tablepaymentvoucher, " and paymentvoucher_type = '{$this->paymentvoucher_type}' ");
                $this->originalamt = 0;
                $this->iscomplete = 0;
                $this->paymentvoucher_prefix = $prefix_pv;
            }
            $savectrl = "<input style='height: 40px;' name='btnSave' value='Save' type='button'  onclick='iscomplete.value=0;saveRecord();'>";
            $completectrl = "";
            $checked = "CHECKED";
            $deletectrl = "";
            $addnewctrl = "";
            $selectStock = "";
            $selectClass = "";
            $selectCharge = "";
            $closectrl = "";
            $originalamtctrl = "<input name='originalamt' type='hidden' value='0'>";
        } else {
            $action = "update";
            if ($this->isAdmin) {
                $recordctrl = "<form target='_blank' action='recordinfo.php' method='POST'>" . "<input name='tablename' value='{$this->tablepaymentvoucher}' type='hidden'>" . "<input name='id' value='{$this->paymentvoucher_id}' type='hidden'>" . "<input name='idname' value='paymentvoucher_id' type='hidden'>" . "<input name='title' value='Financial Year' type='hidden'>" . "<input name='btnView' value='View Record Info' type='submit'>" . "</form>";
            }
            $previewctrl = "<form target='_blank' action='viewpaymentvoucher.php' method='GET'>" . "<input name='paymentvoucher_id' value='{$this->paymentvoucher_id}' type='hidden'>" . "<input name='btnPreview' value='Print Preview' type='submit'>" . "</form>";
            $header = "Edit PaymentVoucher";
            if ($this->iscomplete == 0) {
                $deletectrl = "<FORM action='paymentvoucher.php' method='POST' onSubmit='return confirm(" . '"confirm to remove this paymentvoucher?"' . ")'><input type='submit' value='Delete' name='btnDelete'>" . "<input type='hidden' value='{$this->paymentvoucher_id}' name='paymentvoucher_id'>" . "<input type='hidden' value='delete' name='action'><input name='token' value='{$token}' type='hidden'></form>";
                $savectrl = "<input name='paymentvoucher_id' value='{$this->paymentvoucher_id}' type='hidden'>" . "<input style='height: 40px;' name='btnSave' value='Save' type='button' onclick='iscomplete.value=0;saveRecord();'>";
                $completectrl = "<input style='height: 40px;' name='btnComplete' value='Complete' type='button' onclick='iscomplete.value=1;saveRecord();'>";
            } else {
                $deletectrl = "";
                $savectrl = "";
                $completectrl = "";
                if ($this->isAdmin) {
                    $activatectrl = "<FORM action='paymentvoucher.php' method='POST' onSubmit='return confirm(" . '"confirm to reactivate this paymentvoucher?"' . ")'><input type='submit' value='Reactivate' name='btnActivate'>" . "<input type='hidden' value='{$this->paymentvoucher_id}' name='paymentvoucher_id'>" . "<input type='hidden' value='reactivate' name='action'><input name='token' value='{$token}' type='hidden'></form>";
                }
            }
            $navigationctrl = $this->navigationRecord($this->paymentvoucher_id, $this->paymentvoucher_date, $this->paymentvoucher_no);
            if ($this->batch_id > 0) {
                $viewbatch = "<a href='batch.php?batch_id={$this->batch_id}&action=edit'>View Journal</a>";
            } else {
                $viewbatch = "";
            }
        }
        $selectedCash = "";
        $selectedbank = "";
        if ($this->paymentvoucher_type == "B") {
            $selectedBank = "SELECTED";
        } else {
            $selectedCash = "SELECTED";
        }
        /*if($this->bpartner_id == 0)
        $bpartner_fld = "<input type='hidden' name='bpartner_id' value='0'>";
        */
        echo <<<EOF
<A href='paymentvoucher.php'>[Add New]</A>&nbsp;<A href='paymentvoucher.php?action=showSearchForm'>[Search]</A>
<form onsubmit="return validatePaymentVoucher()" method="post"
 action="paymentvoucher.php" name="frmPaymentVoucher">
<table style="width:140px;"><tbody><td><input name="reset" value="Reset" type="reset"></td></tbody></table>
<div id="bpartnerID">{$bpartner_fld}</div>
  <table style="text-align: left; width: 100%;" border="1" cellpadding="0" cellspacing="1">

{$originalamtctrl}
    <tbody>
      <tr>
        <th colspan="4" rowspan="1">{$header}</th>
      </tr>
<tr>
        <td class="head">Organization {$mandatorysign}</td>
        <td class="even" acolspan='3'>{$this->orgctrl} {$viewbatch} </td>
\t<td class="head">PaymentVoucher No {$mandatorysign}</td>
        <td class="even" >
<input name="paymentvoucher_prefix" value="{$this->paymentvoucher_prefix}" size='3' maxlength='10'>
<input name="paymentvoucher_no" value="{$this->paymentvoucher_no}" size='10' maxlength='10'>
\t\t\t<input name="iscomplete" value="{$this->iscomplete}" type='hidden'></td>

      </tr>
      <tr>
   \t<td class="head">PaymentVoucher Type</td>
        <td class="even" >
\t\t<select name="paymentvoucher_type" onchange="getTypeNo(this.value)">
\t\t<option value="B" {$selectedBank}>Bank</option>
\t\t<option value="C" {$selectedCash}>Cash</option>
\t\t</select>
\t\t</td>
        <td class="head">Date {$mandatorysign}</td>
        <td class="even" ><input name='paymentvoucher_date' value="{$this->paymentvoucher_date}" id='paymentvoucher_date'  size='10' maxlength='10'>
\t\t\t\t<input name='btnDate' type='button' value='Date' onclick="{$this->showCalendar}"></td>

      </tr>
      <tr>
    
        <td class="head">Paid To {$mandatorysign}</td>
        <td class="even" colspan="3"><input name='paidto' value="{$this->paidto}" id='paidto'></td>
      </tr>
      <tr>
        <td class="head">Currency {$mandatorysign}</td>
        <td class="even"><select name='currency_id' id='currency_id'>{$this->currencyctrl}</select></td>
        <td class="head">Exchange Rate {$mandatorysign}</td>
        <td class="even"><input name='exchangerate' value="{$this->exchangerate}" onchange='amt.value=parseFloat(this.value*originalamt.value).toFixed(2)' size="10">
\tLocal Amount :
\t<input name='amt' value="{$this->amt}" readonly='readonly'></td>
      </tr>

      <tr>
   <td class="head">From Accounts</td>
        <td class="even">{$this->accountsfromctrl} <input id='chequeno' value="{$this->chequeno}" name='chequeno' {$this->displaychequenostyle}>
\t\t</td>
        <td class="head">Prepared By</td>
        <td class="even"><input name='preparedby' value="{$this->preparedby}">
\t<input name='batch_id' value="{$this->batch_id}" type='hidden'></td>
      </tr>

    <tr>
        <td class="head">Add Line</td>
\t<td class="even" colspan="3">
\t\t<SELECT name='addpaymentvoucherlineqty' >
\t\t\t<OPTION value='0'>0 Line</OPTION>
\t\t\t<OPTION value='1'>1 Line</OPTION>
\t\t\t<OPTION value='2'>2 Line</OPTION>
\t\t\t<OPTION value='3'>3 Line</OPTION>
\t\t\t<OPTION value='5'>5 Line</OPTION>
\t\t\t<OPTION value='10'>10 Line</OPTION>
\t\t\t<OPTION value='15'>15 Line</OPTION>
\t\t</SELECT>
\t</td>
      </tr>
\t{$this->paymentvoucherlinectrl}

      <tr>
        <td class="head">Description</td>
        <td class="even" colspan='3'><textarea cols='70' name='description' >{$this->description}</textarea></td>
      </tr>
  <tr>
        <td class="head">Add New Record</td>
        <td class="even" colspan='3'><input type='checkbox' name='chkAddNew'> Add new record immediately after save or complete.</td>
      </tr>
\t     <!-- <tr>
        <td class="head">Amount {$mandatorysign} </td>
        <td class="even" colspan="3">
\t<input name='originalamta' value="{$this->originalamta}" onchange='amt.value=parseFloat(exchangerate.value*this.value).toFixed(2)' >
\t</td>
      </tr>-->
    </tbody>
  </table>
<table style="width:150px;"><tbody><td>{$savectrl} </td><td>{$completectrl}</td>
\t<input name="action" value="{$action}" type="hidden">
\t<input name="token" value="{$token}" type="hidden"></td></tbody>
\t</table></form>
\t<table style="width:150px;">
\t<td>{$deletectrl} {$activatectrl}</td><td>{$recordctrl}</td><td>{$previewctrl}</td></table>
  <br>
{$navigationctrl}


EOF;
    }
示例#5
0
    /**
     * Display input form, type can be 'new', or 'edit', if new all field will be set
     * empty or 0. Or else all field data will pull from database.
     *
     * @param string type 
     * @param int studentpayment_id
     * @return 
     * @access public
     */
    public function getInputForm($type, $studentpayment_id, $token)
    {
        $mandatorysign = "<b style='color:red'>*</b>";
        $header = "";
        // parameter to display form header
        $action = "";
        $savectrl = "";
        $searchctrl = "";
        $deletectrl = "";
        $itemselect = "";
        $previewctrl = "";
        $orgctrl = "";
        $this->created = 0;
        if ($type == "new") {
            $header = "New";
            $action = "create";
            if ($studentpayment_id == 0) {
                $this->studentpayment_name = "";
                $this->isactive = "";
                $this->defaultlevel = 10;
                $studentpaymentchecked = "CHECKED";
                $this->studentpayment_no = getNewCode($this->xoopsDB, "studentpayment_no", $this->tablestudentpayment, "");
                $this->studentpayment_date = getDateSession();
                $this->studentpayment_type = "C";
                $this->iscomplete = 0;
            }
            $savectrl = "<input astyle='height: 40px;' name='btnSave' value='Save' type='submit'>";
            $checked = "CHECKED";
            $deletectrl = "";
            $addnewctrl = "";
            $selectStock = "";
            $selectClass = "";
            $selectCharge = "";
        } else {
            $action = "update";
            $savectrl = "<input name='studentpayment_id' value='{$this->studentpayment_id}' type='hidden'>" . "<input astyle='height: 40px;' name='btnSave' value='Save' type='submit'>";
            if ($this->isAdmin) {
                $recordctrl = "<form target='_blank' action='recordinfo.php' method='POST'>" . "<input name='tablename' value='{$this->tablestudentpayment}' type='hidden'>" . "<input name='id' value='{$this->studentpayment_id}' type='hidden'>" . "<input name='idname' value='studentpayment_id' type='hidden'>" . "<input name='title' value='Studentpayment' type='hidden'>" . "<input name='btnView' value='View Record Info' type='submit'>" . "</form>";
            }
            //force isactive checkbox been checked if the value in db is 'Y'
            if ($this->isactive == 1) {
                $checked = "CHECKED";
            } else {
                $checked = "";
            }
            $header = "Edit";
            if ($this->allowDelete($this->studentpayment_id)) {
                $deletectrl = "<FORM action='studentpayment.php' method='POST' onSubmit='return confirm(" . '"confirm to remove this studentpayment?"' . ")'><input type='submit' value='Delete' name='btnDelete'>" . "<input type='hidden' value='{$this->studentpayment_id}' name='studentpayment_id'>" . "<input type='hidden' value='delete' name='action'><input name='token' value='{$token}' type='hidden'></form>";
            } else {
                $deletectrl = "";
            }
            $addnewctrl = "<Form action='studentpayment.php' method='POST'><input name='btnNew' value='New' type='submit'></form>";
            $previewctrl = "<FORM target='_blank' action='viewstudentpayment.php' method='POST' aonSubmit='return confirm(" . '"confirm to remove this studentpayment?"' . ")'><input type='submit' value='Preview' name='btnPreview'>" . "<input type='hidden' value='{$this->studentpayment_id}' name='studentpayment_id'>" . "<input type='hidden' value='delete' name='action'><input name='token' value='{$token}' type='hidden'></form>";
        }
        $searchctrl = "<Form action='studentpayment.php' method='POST'>\r\n                            <input name='btnSearch' value='Search' type='submit'>\r\n                            <input name='action' value='search' type='hidden'>\r\n                            </form>";
        $selectInvoice = "";
        $selectOthers = "";
        $styleInvoice = "";
        $styleOthers = "";
        if ($this->studentpayment_category == "O") {
            $selectOthers = "SELECTED";
            if ($type != "new") {
                $styleInvoice = "style='display:none'";
            }
        } else {
            $selectInvoice = "SELECTED";
            if ($type != "new") {
                $styleOthers = "style='display:none'";
            }
        }
        $selectCash = "";
        $selectCheque = "";
        if ($this->studentpayment_type == "Q") {
            $selectCheque = "SELECTED";
        } else {
            $selectCash = "SELECTED";
        }
        if ($this->studentpayment_type == "C") {
            $stylecno = "style='display:none'";
        } else {
            $stylecno = "";
        }
        $this->stylecomplete = "style='display:none'";
        $this->styleenable = "style='display:none'";
        $this->stylesave = "style='display:none'";
        $submitform = "onsubmit='return validateStudentpayment()'";
        if ($type == "edit") {
            if ($this->iscomplete == 0) {
                $this->stylecomplete = "";
                $this->stylesave = "";
            } else {
                $this->styleenable = "";
                $submitform = "onsubmit='return false'";
            }
        } else {
            $this->stylesave = "";
        }
        echo <<<EOF


<table style="width:140px;">
<tbody>
<td>{$addnewctrl}</td>
<td>{$searchctrl}</td>
<td><form {$submitform} method="post"
 action="studentpayment.php" name="frmStudentpayment"  enctype="multipart/form-data"><input name="reset" value="Reset" type="reset"></td></tbody></table>

<input type="hidden" name="deletesubline_id" value="0">
<input type="hidden" name="deletenoteline_idss" value="0">
<input type="hidden" name="iscomplete" value="{$this->iscomplete}">
<input type="hidden" name="batch_id" value="{$this->batch_id}">

  <table style="text-align: left; width: 100%;" border="0" cellpadding="0" cellspacing="1">
    <tbody>
        <tr>
        <th colspan="4" rowspan="1">{$header}</th>
        </tr>
        <tr>
        <td class="head">Organization {$mandatorysign}</td>
        <td class="even">{$this->orgctrl}</td>
        <td class="head">Date {$mandatorysign}</td>
        <td class="even">
        <input name='studentpayment_date' id='studentpayment_date' value="{$this->studentpayment_date}" maxlength='10' size='10'>
        <input name='btnDate' value="Date" type="button" onclick="{$this->invoicedatectrl}"> <font color=red>YYYY-MM-DD (Ex: 2009-01-30)</font>
        </td>

        </tr>

        <tr style="display:none">
        <td class="head" style="display:none">Studentpayment Code {$mandatorysign}</td>
        <td class="even" style="display:none"></td>
        <td class="head">Studentpayment Name {$mandatorysign}</td>
        <td class="even" ><input maxlength="100" size="50" name="studentpayment_name" value="{$this->studentpayment_name}"></td>
        </tr>

        <tr>
        <td class="head">Payment Type</td>
        <td class="even" colspan="3">
        <select name="studentpayment_category">
        <option value="I" {$selectInvoice} {$styleInvoice}>By Invoice</option>
        <option value="O" {$selectOthers} {$styleOthers}>Others</option>
        </select>
        </td>
        </tr>

        <tr>
        <td class="head">Student</td>
        <td class="even">{$this->studentctrl}</td>
        <td class="head">Payment No</td>
        <td class="even"><input maxlength="30" size="15" name="studentpayment_no" value="{$this->studentpayment_no}"></td>
        </tr>

        <tr>
        <td class="head">Payment Method</td>
        <td class="even">
        <select name="studentpayment_type" onchange="changeMethod(this.value)">
        <option value="C" {$selectCash}>Cash</option>
        <option value="Q" {$selectCheque}>Cheque</option>
        </select>
        </td>
        <td class="head">Cheque No</td>
        <td class="even"><input {$stylecno} maxlength="10" size="10" name="studentpayment_chequeno" value="{$this->studentpayment_chequeno}"></td>
        </tr>

        <tr>
        <td class="head" style="display:none">From Account</td>
        <td class="even" style="display:none">{$this->fromaccountsctrl}</td>
        <td class="head">To Account</td>
        <td class="even" colspan="3">{$this->toaccountsctrl}</td>
        </tr>

        <tr>
        <td class="head">Description</td>
        <td class="even" colspan='3'><textarea name="description" cols="40" rows="3">{$this->description}</textarea></td>
        </tr>
 
    </tbody>
  </table>
EOF;
        if ($type != "new") {
            $this->getAlertTable($this->student_id);
            $this->getSubTable($this->studentpayment_id);
        } else {
        }
        echo <<<EOF

<br>
<table astyle="width:150px;"><tbody><td width=1 {$this->stylesave}>{$savectrl}
\t<input name="action" value="{$action}" type="hidden">
\t<input name="token" value="{$token}" type="hidden"></td>
\t</form>
    <td width=1>
    <input type="button" value="Complete" onclick="paymentComplete()" {$this->stylecomplete}>
    <input type="button" value="Re-Enable" onclick="paymentEnable()" {$this->styleenable}>
    </td>
    <td >{$previewctrl}</td>
    <td align="right" {$this->stylesave}>{$deletectrl}</td>
    </tbody></table>
  <br>

{$recordctrl}

EOF;
    }
    /**
     * Display input form, type can be 'new', or 'edit', if new all field will be set
     * empty or 0. Or else all field data will pull from database.
     *
     * @param string type 
     * @param int debitcreditnote_id 
     * @return 
     * @access public
     */
    public function getInputForm($type, $debitcreditnote_id, $token)
    {
        $mandatorysign = "<b style='color:red'>*</b>";
        $header = "";
        // parameter to display form header
        $action = "";
        $savectrl = "";
        $deletectrl = "";
        $itemselect = "";
        $orgctrl = "";
        $this->created = 0;
        if ($type == "new") {
            $header = "New Debit/Credit Note";
            $action = "create";
            if ($debitcreditnote_id == 0 || $debitcreditnote_id == "") {
                //$this->document_no = getNewCode($this->xoopsDB,"debitcreditnote_no",$this->tabledebitcreditnote);
                //$this->document_date=date('Y-m-d',time());
                $this->document_date = getDateSession();
                $this->documenttype = "0";
                $this->bpartner_id = 0;
                $this->amt = 0;
                $this->batch_id = 0;
                $this->originalamt = 0;
                //$this->debitcreditnote_prefix=0;
            }
            $savectrl = "<input style='height: 40px;' name='btnSave' value='Save' type='button' onclick='iscomplete.value=0;saveRecord()'>";
            $checked = "CHECKED";
            $deletectrl = "";
            $addnewctrl = "";
            $selectStock = "";
            $selectClass = "";
            $selectCharge = "";
            $statustext = 'This purchase invoice not yet exist in database. You will lose this record if you not save it.';
        } else {
            $action = "update";
            $printctrl = "<form target='_blank' name='frmPrintInvoice' method='POST' action='viewdebitcreditnote.php'>\n\t\t\t<INPUT TYPE='hidden' value='{$this->debitcreditnote_id}'\n\t\t\t\tname='debitcreditnote_id'>\n\t\t\t<INPUT TYPE='submit' value='Preview'\n\t\t\t\tname='btnPreview'></form>";
            if ($this->iscomplete == 0) {
                $savectrl = "<input name='debitcreditnote_id' value='{$this->debitcreditnote_id}' type='hidden'>" . "<input style='height: 40px;' name='btnSave' value='Save' type='button' onclick='iscomplete.value=0;saveRecord();'>";
                $completectrl = " <input style='height: 40px;' name='btnComplete' value='Complete' type='button'\n\t\t\t\tonclick='iscomplete.value=1;saveRecord();'>";
                $activatectrl = '';
                $deletectrl = "<FORM action='debitcreditnote.php' method='POST' onSubmit='return confirm(" . '"confirm to remove this debitcreditnote?"' . ")'><input type='submit' value='Delete' name='btnDelete'>" . "<input type='hidden' value='{$this->debitcreditnote_id}' name='debitcreditnote_id'>" . "<input type='hidden' value='delete' name='action'><input name='token' value='{$token}' type='hidden'></form>";
                $statustext = 'This purchase invoice under draft mode, you need to complete it in order to effect accounts.';
            } else {
                $savectrl = "";
                $completectrl = "";
                $activatectrl = "<form method='POST' name='frmActivateDebitCreditNote' \n\t\t\tonsubmit='return confirm(\"Reactivate this debitcreditnote record?\");'>\n\t\t\t<input type='hidden' name='action' value='reactive'>\n\t\t\t<input type='hidden' name='debitcreditnote_id' value='{$this->debitcreditnote_id}'>\n\t\t\t<input type='submit' name='btnReactive' value='Reactive'>\n\t\t\t</form>";
                $deletectrl = "";
                $statustext = 'This purchase invoice is completed and it effect to accounts. You cannot change this purchase invoice before reactivate it.';
            }
            if ($this->isAdmin) {
                $recordctrl = "<form target='_blank' action='recordinfo.php' method='POST'>" . "<input name='tablename' value='{$tabledebitcreditnote}' type='hidden'>" . "<input name='id' value='{$this->debitcreditnote_id}' type='hidden'>" . "<input name='idname' value='debitcreditnote_id' type='hidden'>" . "<input name='title' value='DebitCreditNote' type='hidden'>" . "<input name='btnRecord' value='View Record Info' type='submit'>" . "</form>";
            }
            $header = "Edit Debit/Credit Note";
            //if($this->allowDelete($this->debitcreditnote_id))
            //else
            //$deletectrl="";
            $addnewctrl = "<Form action='debitcreditnote.php' method='POST'><input name='btnNew' value='New' type='submit'></form>";
            if ($this->batch_id > 0) {
                $viewbatch = "<a href='batch.php?batch_id={$this->batch_id}&action=edit'>View Journal</a>";
            } else {
                $viewbatch = "";
            }
        }
        if ($this->documenttype == 1) {
            $selectnulldoctype = "";
            $selectdebitdoctype = "selected='selected'";
            $selectcreditdoctype = "";
        } elseif ($this->documenttype == 2) {
            $selectnulldoctype = "";
            $selectdebitdoctype = "";
            $selectcreditdoctype = "selected='selected'";
        } else {
            $selectnulldoctype = "selected='selected'";
            $selectdebitdoctype = "";
            $selectcreditdoctype = "";
        }
        global $defcurrencycode;
        echo <<<EOF
<a href='debitcreditnote.php'>[Add New]</a>&nbsp;<a href='debitcreditnote.php?action=showSearchForm'>[Search]</a>
<table style="width:140px;"><tbody><td nowrap><form onsubmit="return validateDebitCreditNote()" method="post"
 action="debitcreditnote.php" name="frmDebitCreditNote">
<input name="reset" value="Reset" type="reset">
</td></tbody></table>

  <table style="text-align: left; width: 100%;" border="1" cellpadding="0" cellspacing="1">
    <tbody>
      <tr>
        <th colspan="4" rowspan="1">{$header}</th>
      </tr>
      <tr>
        <td class="head">Organization {$mandatorysign} </td>
        <td class="even" >{$this->orgctrl} {$viewbatch}<input type='hidden' value='{$this->iscomplete}' name='iscomplete'>
\t\t\t\t\t<input type='hidden' value="{$this->batch_id}" name='batch_id'></td>
        <td class="head">Document Type</td>
        <td class="even" ><SELECT name='documenttype' onchange="reloadDocumentNo({$this->debitcreditnote_id},this.value)">
\t\t\t\t<option {$selectnulldoctype} value="0">Null</option>
\t\t\t\t<option {$selectdebitdoctype} value="1">Debit Note</option>
\t\t\t\t<option {$selectcreditdoctype} value="2">Credit Note</option>
\t\t\t</SELECT></td>

      </tr>

      <tr>
\t<td class="head">Date {$mandatorysign}</td>
\t<td class="even" ><input maxlength="10" size="10" id='document_date' 
\t\t\tname='document_date' value="{$this->document_date}">
\t\t\t<input type='button' name='btndocument_date' onclick="{$this->showcalendar}" value='Date'></td>
\t<td class="head">Document No {$mandatorysign}</td>
\t<td class="even" >
        <input maxlength="10" size="3" name="debitcreditnote_prefix" value="{$this->debitcreditnote_prefix}">
\t<input maxlength="20" size="15" name="document_no" value="{$this->document_no}">
</td>
      </tr>
      <tr>
\t<td class="head">Business Partner Account</td>
\t<td class="even" >{$this->bpartneraccountsctrl}</td>
\t<td class="head">Business Partner {$mandatorysign}</td>
        <td class="even" ><select name="bpartner_id" id="bpartner_id" onchange='changeBPartner(this.value)'>{$this->bpartnerctrl}</select></td>
\t<!--<td class="head">Effected Account</td>
\t<td class="even" >{$this->accountsctrla}</td>-->
      </tr>
    <tr>
\t
\t<td class="head">Reference No</td>
\t<td class="even" colspan="3"><input maxlength="30" size="20" name='ref_no' value="{$this->ref_no}"></td>

\t</td>
      </tr>
  <tr>
\t<td class="head">Currency {$mandatorysign}</td>
        <td class="even" ><select name="currency_id" id="currency_id">{$this->currencyctrl}</select> <input type='button' name='btnRecalculate' onclick='calculatesummary()' value='Recalculate Total'>
\t<td class="head">Exchange Rate</td>
\t<td class="even" ><input maxlength="30" size="20" name='exchangerate' value="{$this->exchangerate}">
\t\tLocal Amount: {$defcurrencycode}<input maxlength="30" size="20" name='amt' value="{$this->amt}" readonly='readonly'></td>

\t</td>
      </tr>
    <tr>
        <td class="head">Add Line</td>
\t<td class="even" colspan="3">
\t\t<SELECT name='adddebitcreditnotelineqty' >
\t\t\t<OPTION value='0'>0 Line</OPTION>
\t\t\t<OPTION value='1'>1 Line</OPTION>
\t\t\t<OPTION value='2'>2 Line</OPTION>
\t\t\t<OPTION value='3'>3 Line</OPTION>
\t\t\t<OPTION value='5'>5 Line</OPTION>
\t\t\t<OPTION value='10'>10 Line</OPTION>
\t\t\t<OPTION value='15'>15 Line</OPTION>
\t\t</SELECT>
\t</td>
      </tr>
\t{$this->debitcreditnotelinectrl}
      <tr>
        <td class="head">Description</td>
\t<td class="even" colspan="3"><textarea name='description' cols='80'>{$this->description}</textarea>
\t</td>
      </tr>

      <tr>
        <td class="head">Add After Save</td>
\t<td class="even" colspan="3"><input type='checkbox' name='chkAddNew'>Add new record immediately after save or complete.
\t</td>
      </tr>
 \t
    </tbody>
  </table><input type='hidden' id='itemqty' name='itemqty' value="{$this->itemqty}">
<table style="width:150px;"><tbody><td>{$savectrl}</td><td> {$completectrl}
\t<input name="action" value="{$action}" type="hidden">
\t<input name="token" value="{$token}" type="hidden"></td>
\t</form><td>{$deletectrl}</td><td>{$activatectrl}</td><td>{$printctrl}</td></tbody></table>
  <br>

{$recordctrl}

EOF;
    }
示例#7
0
    /**
     * Display input form, type can be 'new', or 'edit', if new all field will be set
     * empty or 0. Or else all field data will pull from database.
     *
     * @param string type 
     * @param int overtime_id
     * @return 
     * @access public
     */
    public function getInputForm($type, $overtime_id, $token)
    {
        $mandatorysign = "<b style='color:red'>*</b>";
        $header = "";
        // parameter to display form header
        $action = "";
        $savectrl = "";
        $searchctrl = "";
        $deletectrl = "";
        $itemselect = "";
        $previewctrl = "";
        $orgctrl = "";
        $this->created = 0;
        if ($type == "new") {
            $header = "New";
            $action = "create";
            if ($overtime_id == 0) {
                $this->overtime_name = "";
                $this->isactive = "";
                $this->defaultlevel = 10;
                $overtimechecked = "CHECKED";
                $this->overtime_no = getNewCode($this->xoopsDB, "overtime_no", $this->tableovertime, "");
                $this->overtimeline_date = getDateSession();
            }
            $savectrl = "<input astyle='height: 40px;' name='btnSave' value='Save' type='submit'>";
            $checked = "CHECKED";
            $deletectrl = "";
            $addnewctrl = "";
            $selectStock = "";
            $selectClass = "";
            $selectCharge = "";
        } else {
            $action = "update";
            $savectrl = "<input name='overtimeline_id' value='{$this->overtimeline_id}' type='hidden'>" . "<input astyle='height: 40px;' name='btnSave' value='Save' type='submit'>";
            if ($this->isAdmin) {
                $recordctrl = "<form target='_blank' action='recordinfo.php' method='POST'>" . "<input name='tablename' value='{$this->tableovertimeline}' type='hidden'>" . "<input name='id' value='{$this->overtimeline_id}' type='hidden'>" . "<input name='idname' value='overtimeline_id' type='hidden'>" . "<input name='title' value='Overtime' type='hidden'>" . "<input name='btnView' value='View Record Info' type='submit'>" . "</form>";
            }
            //force isactive checkbox been checked if the value in db is 'Y'
            if ($this->isactive == 1) {
                $checked = "CHECKED";
            } else {
                $checked = "";
            }
            $header = "Edit";
            if ($this->allowDelete($this->overtime_id)) {
                $deletectrl = "<FORM action='overtime.php' method='POST' onSubmit='return confirm(" . '"confirm to remove this overtime?"' . ")'><input type='submit' value='Delete' name='btnDelete'>" . "<input type='hidden' value='{$this->overtimeline_id}' name='overtimeline_id'>" . "<input type='hidden' value='delete' name='action'><input name='token' value='{$token}' type='hidden'></form>";
            } else {
                $deletectrl = "";
            }
            $addnewctrl = "<Form action='overtime.php' method='POST'><input name='btnNew' value='New' type='submit'></form>";
            $previewctrl = "<FORM target='_blank' action='../system/class/XMLParameter.php' method='POST' aonSubmit='return confirm(" . '"confirm to remove this overtime?"' . ")'><input type='submit' value='Preview' name='btnPreview'>" . "<input type='hidden' value='{$this->overtime_id}' name='fld_value'>" . "<input type='hidden' value='overtime_id' name='fld_name'>" . "<input type='hidden' value='delete' name='action'><input name='token' value='{$token}' type='hidden'></form>";
        }
        $searchctrl = "<Form action='overtime.php' method='POST'>\r\n                            <input name='btnSearch' value='Search' type='submit'>\r\n                            <input name='action' value='search' type='hidden'>\r\n                            </form>";
        $stylesave = "";
        if ($this->overtime_id > 0) {
            $stylesave = "style='display:none'";
        }
        $styletimehours = "";
        if ($this->overtimeline_type == "T") {
            $styletimehours = "style='display:none'";
        }
        echo <<<EOF


<table style="width:140px;">
<tbody>
<td>{$addnewctrl}</td>
<td>{$searchctrl}</td>
<td><form onsubmit="return validateOvertime()" method="post"
 action="overtime.php" name="frmOvertime"  enctype="multipart/form-data"><input name="reset" value="Reset" type="reset"></td></tbody></table>


  <table style="text-align: left; width: 100%;" border="0" cellpadding="0" cellspacing="1">
    <tbody>
        <tr>
        <th colspan="4" rowspan="1">{$header}</th>
        </tr>

        <tr>
        <td class="head">Employee</td>
        <td class="even" colspan="3">{$this->employeectrl}</td>
        </tr>

        <tr>
        <td class="head">Date</td>
        <td class="even">
        <input name='overtimeline_date' id='overtimeline_date' value="{$this->overtimeline_date}" maxlength='10' size='10'>
        <input name='btnDate' value="Date" type="button" onclick="{$this->overtimedatectrl}"> <font color=red>YYYY-MM-DD (Ex: 2009-01-30)</font>
        </td>
        <td class="head">Type</td>
        <td class="even">
        <select name="overtimeline_type" onchange="viewHours(this.value)">
        <option value="H" {$selectTypeH}>By Hours</option>
        <option value="T" {$selectTypeT}>By Trip</option>
        </select>
        </td>
        </tr>


        <tr id="idTimeHours" {$styletimehours}>
        <td class="head">Time In</td>
        <td class="even"><input maxlength="4" size="4" name="overtimeline_starttime" value="{$this->overtimeline_starttime}"> (HHMM) 24 Hours Format</td>
        <td class="head">Time Out</td>
        <td class="even"><input maxlength="4" size="4" name="overtimeline_endtime" value="{$this->overtimeline_endtime}"> (HHMM) 24 Hours Format</td>
        </tr>


        <tr>
        <td class="head">Total Hours/Trip</td>
        <td class="even"><input maxlength="10" size="4" name="overtimeline_totalhour" value="{$this->overtimeline_totalhour}"></td>
        <td class="head">Description</td>
        <td class="even"><textarea name="line_desc" cols="40" rows="4">{$this->line_desc}</textarea></td>
        </tr>
 
    </tbody>
  </table>
EOF;
        echo <<<EOF

<br>
<table astyle="width:150px;"><tbody><td width=1 {$stylesave}>{$savectrl}
\t<input name="action" value="{$action}" type="hidden">
\t<input name="token" value="{$token}" type="hidden"></td>
\t</form>
    <td align="right" {$stylesave}>{$deletectrl}</td>
    </tbody></table>
  <br>

{$recordctrl}

EOF;
    }
    /**
     * Display input form, type can be 'new', or 'edit', if new all field will be set
     * empty or 0. Or else all field data will pull from database.
     *
     * @param string type 
     * @param int bankreconcilation_id 
     * @return 
     * @access public
     */
    public function getInputForm($type, $bankreconcilation_id, $token)
    {
        $mandatorysign = "<b style='color:red'>*</b>";
        global $defcurrencycode;
        $header = "";
        // parameter to display form header
        $action = "";
        $savectrl = "";
        $deletectrl = "";
        $itemselect = "";
        $reusectrl = "";
        $styledate = "";
        $stylecalendar = "";
        $styleclosing = "";
        $orgctrl = "";
        //$this->created=0;
        $addnewctrl = "<a href='bankreconcilation.php'>[ Add New ]</a><a href='bankreconcilation.php?action=showsearchform'>[ Search ]</a>";
        if ($type == "new") {
            $header = "New Bank Reconcilation";
            $action = "create";
            $this->iscomplete = 0;
            if ($bankreconcilation_id == 0) {
                $this->bankreconcilationno = getNewCode($this->xoopsDB, "bankreconcilationno", $this->tablebankreconcilation);
                $this->statementbalance = "0.00";
                //$this->bankreconcilationdate= date("Y-m-d", time()) ;
                $this->bankreconcilationdate = getDateSession();
            }
            //$savectrl="";
            //$savectrl="<input style='height: 40px;' name='btnSave' value='Save' type='button' onclick='validateBankReconcilationSave();'>";
            $savectrl = "<input name='bankreconcilation_id' value='{$this->bankreconcilation_id}' type='hidden'>\r\n\t\t\t <input style='height: 40px;' name='btnSave' value='Save' type='submit' onclick='iscomplete.value=0;'>";
            $completectrl = "<input style='height: 40px;display:none' name='btncomplete' value='Complete' type='submit' \t\r\n\t\t\t\tonclick='iscomplete.value=1;'>";
            $checked = "";
            $deletectrl = "";
            $selectStock = "";
            $selectClass = "";
            $selectCharge = "";
            $transactionctrl = "";
            /*			$defaultcurrencysetting="<tr><td class='head'>Currency</td>
            				<td class='even' >$this->currencyctrl Organization Currency: $defcurrencycode</TD>
            				<td class='head'>Conversion Rate</td>
            				<td class='even'><input value='$this->conversionrate' name='conversionrate'></td>
            			</tr>";*/
        } else {
            $selectadd0line = "SELECTED='SELECTED'";
            $selectadd1line = "";
            //$styledate="readonly";
            //$stylecalendar="style='display:none'";
            //	$defaultcurrencysetting="";
            $action = "update";
            if ($this->iscomplete == 0) {
                $savectrl = "<input name='bankreconcilation_id' value='{$this->bankreconcilation_id}' type='hidden'>\r\n\t\t\t <input style='height: 40px;' name='btnSave' value='Save' type='submit' onclick='iscomplete.value=0;'>";
                $stylecomplete = "display:none";
                if ($this->differenceamt == 0) {
                    $stylecomplete = "";
                }
                $completectrl = "<input style='height: 40px;{$stylecomplete}' name='btncomplete' value='Complete' type='submit' onclick='iscomplete.value=1;'>";
                $readonlyctrl = "";
            } else {
                $readonlyctrl = "readonly='readonly'";
                $savectrl = " <input name='btncomplete' type='hidden'>";
            }
            $defaultsetting = "";
            if ($this->isAdmin) {
                $recordctrl = "<form target='_blank' action='recordinfo.php' method='POST'>" . "<input name='tablename' value='{$tablebankreconcilation}' type='hidden'>" . "<input name='id' value='{$this->bankreconcilation_id}' type='hidden'>" . "<input name='idname' value='bankreconcilation_id' type='hidden'>" . "<input name='title' value='BankReconcilation' type='hidden'>" . "<input name='btnRecord' value='View Record Info' type='submit'>" . "</form>";
            }
            //force reuse checkbox been checked if the value in db is 'Y'
            if ($this->reuse == 1) {
                $checked = "CHECKED";
            } else {
                $checked = "";
            }
            if ($this->iscomplete == 0) {
                $docstatus = "Draft";
            } else {
                $docstatus = "Completed";
            }
            $header = "Edit Bank Reconcilation";
            if ($this->allowDelete($this->bankreconcilation_id) && $this->iscomplete == 0) {
                $deletectrl = "<FORM action='bankreconcilation.php' method='POST' onSubmit='return confirm(" . '"confirm to remove this bankreconcilation?"' . ")'><input type='submit' value='Delete' name='btnDelete' style='height: 40px;'>" . "<input type='hidden' value='{$this->bankreconcilation_id}' name='bankreconcilation_id'>" . "<input type='hidden' value='delete' name='action'><input name='token' value='{$token}' type='hidden'></form>";
            } else {
                $deletectrl = "";
            }
            if ($this->iscomplete == 1) {
                $reactivatectrl = "<FORM action='bankreconcilation.php' method='POST' onSubmit='return confirm(" . '"confirm to re-activate this bankreconcilation?"' . ")'><input style='height: 40px;' type='submit' value='Activate' name='btnActivate'>" . "<input type='hidden' value='{$this->bankreconcilation_id}' name='bankreconcilation_id'>" . "<input type='hidden' value='reactivate' name='action'>\r\n\t\t<input name='token' value='{$token}' type='hidden'>\r\n\t\t</form>";
            } elseif ($this->iscomplete == -1) {
                $reactivatectrl = "<b style='color: red'>Reversed By {$this->fromsys}</b>";
            }
            $printctrl = "<Form method='GET' target='_blank' action='viewbankreconcilationreport.php'>\r\n\t\t\t\t<input name='submit' value='Print Preview' type='submit'>\r\n\t\t\t\t<input name='bankreconcilation_id' value='{$this->bankreconcilation_id}' type='hidden'></Form>";
        }
        if ($this->reconcilamt == "") {
            $this->reconcilamt = 0;
        }
        if ($this->unreconcilamt == "") {
            $this->unreconcilamt = 0;
        }
        echo <<<EOF
{$addnewctrl}

<form onsubmit="return validateBankReconcilation()" method="post"
 action="bankreconcilation.php" name="frmBankReconcilation">
<table style="width:140px;"><tbody><td><input name="reset" value="Reset" type="reset"></td></tbody></table>

  <table style="text-align: left; width: 100%;" border="1" cellpadding="0" cellspacing="1">
    <tbody>
      <tr>
        <th colspan="4" rowspan="1">{$header}</th>
      </tr>
      <tr>
        <td class="head">Organization {$mandatorysign}</td>
        <td class="even" >{$this->orgctrl}</td>
\t<td class="head">Bank Accounts</td>
\t<td class="even" >{$this->accountsctrl}<input name='account_balance' value="{$this->account_balance}" readonly='readonly'></td>

  
      </tr>
      <tr>
        <td class="head">New Statement Balance</td>
        <td class="even" ><input name='statementbalance' value="{$this->statementbalance}" size='15'style='text-align:right' onchange='calculateBalance()'>
\t\t</TD>

\t<td class="head">Last Statement Balance</td>
\t<td class="even" ><input name='laststatementbalance' value="{$this->laststatementbalance}" readonly="readonly"  size='15'style='text-align:right'></td>

      </tr>

  
   <tr>
 \t   \t<td class="head">Bank Reconcilation No {$mandatorysign}</td>
        <td class="even" ><input name='bankreconcilationno' value={$this->bankreconcilationno} {$readonlyctrl}> </td>

\t<td class="head">Difference Amount</td>
\t<td class="even" ><input name='differenceamt' value="{$this->differenceamt}" readonly="readonly" size='15' {$readonlyctrl} 
\t\tstyle='text-align:right'> \t
\t\t\t<input type='hidden' name='iscomplete' value="{$this->iscomplete}">
\t\t\t<input type='hidden' name='reconcilamt' value="{$this->reconcilamt}">
\t\t\t<input type='hidden' name='unreconcilamt' value="{$this->unreconcilamt}"></td>
      </tr>

   <tr>
 \t<td class="head">Bank Statement Date</td>
\t<td class="even" >
\t<input id='bankreconcilationdate' name='bankreconcilationdate' value="{$this->bankreconcilationdate}" size="8">
\t<input type='button' onclick="{$this->showcalendar}" value='Date' {$stylecalendar} {$readonlyctrl}>
\t<br>Period&nbsp;{$this->periodctrl}
\t</td>

\t<td class="head">Last Statement Date</td>
\t<td class="even" ><input name='laststatementdate' id='laststatementdate' value="{$this->laststatementdate}"  readonly="readonly"></td>
      </tr>
\t\t<td class="head">Transaction</td><td  class="even" colspan='3'><div id='childtable'>{$this->transctrl}</div></td>
    </tbody>
  </table>
<table style="width:150px;"><tbody><tr><td {$styleclosing}>{$savectrl} 
\t<input name="action" value="{$action}" type="hidden">
\t<input name="token" value="{$token}" type="hidden"></td><td>{$completectrl}</td>
\t</form><td {$styledelete}>{$deletectrl}</td><td {$styleclosing}>{$reactivatectrl}</td><td>{$printctrl}</td></tr></tbody></table>
  <br>

{$recordctrl}

EOF;
    }
示例#9
0
    public function getInputForm($type, $batch_id, $token)
    {
        $mandatorysign = "<b style='color:red'>*</b>";
        global $defcurrencycode;
        $header = "";
        // parameter to display form header
        $action = "";
        $savectrl = "";
        $deletectrl = "";
        $itemselect = "";
        $reusectrl = "";
        $styledate = "";
        $stylecalendar = "";
        $styleclosing = "";
        $orgctrl = "";
        //$this->created=0;
        $nextid = 0;
        $previousid = 0;
        $addnewctrl = "<a href='batch.php'>[ Add New ]</a><a href='batch.php?action=showsearchform'>[ Search ]</a>";
        if ($type == "new") {
            $header = "New Batch";
            $action = "create";
            if ($batch_id == 0) {
                $this->batch_name = "";
                $this->reuse = "";
                $this->period_id = 0;
                //$this->batchno=0;
                $this->batchno = getNewCode($this->xoopsDB, "batchno", $this->tablebatch);
                $this->totaldebit = "0.00";
                $this->totalcredit = "0.00";
                //$this->batchdate= date("Y-m-d", time()) ;
                $this->batchdate = getDateSession();
            }
            //$savectrl="";
            //$savectrl="<input style='height: 40px;' name='btnSave' value='Save' type='button' onclick='validateBatchSave();'>";
            /*
            		$savectrl="<input name='batch_id' value='$this->batch_id' type='hidden'>
            			 <input style='height: 40px;' name='btnSave' value='Save' type='button' onclick='iscomplete.value=0;validatePeriodDate();'>
            			 <input style='height: 40px;display:none' name='btncomplete' value='Complete' type='button' onclick='iscomplete.value=1;validatePeriodDate();'>";
            */
            $savectrl = "<input name='batch_id' value='{$this->batch_id}' type='hidden'>\r\n\t\t\t <input style='height: 40px;' name='btnSave' value='Save' type='button' onclick='iscomplete.value=0;saveBatch();'>";
            $completectrl = " <input style='height: 40px;display:none' name='btncomplete' value='Complete' type='button' onclick='iscomplete.value=1;saveBatch();'>";
            $checked = "";
            $deletectrl = "";
            $selectStock = "";
            $selectClass = "";
            $selectCharge = "";
            $defaultsetting = "\r\n\t\t\t\t<table border='1' >\r\n\t\t\t\t<tr>\r\n\t\t\t\t<td class='head' rowspan='3' style='display:none'>Transaction</td>\r\n\t\t\t\t<th>Accounts</th><th>Cheque.No</th><th>Debit</th><th>Credit</th><th>Doc.No</th><th>Add Line</th><tr>\r\n\t\t\t\t<td class='head' rowspan='2' style='display:none'>Transaction</td>\r\n\t\t\t\t<td nowrap width='1' class='odd'>\r\n\t\t\t\t<table>\r\n\t\t\t\t<tr>\r\n\t\t\t\t<td>{$this->defaultaccountsctrl}</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr>\r\n\t\t\t\t<td><div id='ctrlBP' width='1' style='display:none;float: left'>\r\n\t\t\t\t\t<input type='hidden' value='0' name='defaultbpartner_id'></div></td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr>\r\n\t\t\t\t<td><input  size='17' name='linedescdef' id='linedescdef'  aonKeyDown='return changearrayfieldEnter(event,\"linedescdef\",{$nextid},{$previousid},\"linedescdef\",this)'></td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t</table>\r\n\t\t\t\t\r\n\t\t    \t\t\r\n\t\t\t\t</td>\r\n\t\t\t\t<td nowrap width='1' class='odd'>\r\n\t\t\t\t<input name='defaultchequeno' id='defaultchequeno' size='10' maxlength='10'\r\n\t\t\t\t\t style='display:none' onfocus='this.select()' \r\n\t\t\t\taonKeyDown='return changearrayfieldEnter(event,\"defaultchequeno\",{$nextid},{$previousid},\"defaultchequeno\",this)'>\r\n\t\t\t\t</td>\r\n\t\t\t\t<td nowrap width='1' class='odd'>\r\n\t\t\t\t<input name='defaultdebit' onchange='checkFldDefault(this.name)' value='0.00' size='10' maxlength='10'\r\n\t\t\t\t\tonfocus='this.select()' id='defaultdebit'  aonKeyDown='return changearrayfieldEnter(event,\"defaultdebit\",{$nextid},{$previousid},\"defaultdebit\",this)'> \r\n\t\t\t\t</td><td nowrap width='1' class='odd'>\r\n\t\t\t\t<input name='defaultcredit' onchange='checkFldDefault(this.name)' value='0.00' size='10' maxlength='10'\r\n\t\t\t\t\tonfocus='this.select()' id='defaultcredit' aonKeyDown='return changearrayfieldEnter(event,\"defaultcredit\",{$nextid},{$previousid},\"defaultcredit\",this)'>\r\n\t\t\t\t</td><td nowrap width='1' class='odd'>\r\n\t\t\t\t<input name='defaultdocno1' id='defaultdocno1' size='10' maxlength='10' onfocus='this.select()' aonKeyDown='return changearrayfieldEnter(event,\"defaultdocno1\",{$nextid},{$previousid},\"defaultdocno1\",this)'>\r\n\t\t\t\t</td>\r\n\t\t\t\t<td nowrap awidth='1' class='odd'>\r\n\t\t\t\t<SELECT name='defaultline'  onchange='showRef(this.value)'  id='defaultline' aonKeyDown='return changearrayfieldEnter(event,\"defaultline\",{$nextid},{$previousid},\"defaultline\",this)'>\r\n\t\t\t\t\t<option value='0' selected='SELECTED'></option>\r\n\t\t\t\t\t<option value='1' > 1 </option>\r\n\t\t\t\t\t<option value='2' > 2 </option>\r\n\t\t\t\t\t<option value='3' > 3 </option>\r\n\t\t\t\t\t<option value='4' > 4 </option>\r\n\t\t\t\t\t<option value='6' > 6 </option>\r\n\t\t\t\t</SELECT></td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr id='refID'>\r\n\t\t\t\t<td class='head' style='display:none' class='even'>Reference Account</td>\r\n\t\t\t\t<td nowrap width='1' class='even'>\r\n\t\t\t\t<table>\r\n\t\t\t\t<tr>\r\n\t\t\t\t<td>&nbsp;&nbsp;&nbsp;&nbsp;{$this->defaultaccountsctrlref}</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr>\r\n\t\t\t\t<td><div id='ctrlBPRef' width='1' style='display:none;float: left'>\r\n\t\t\t\t\t\t<input type='hidden' value='0' name='defaultbpartnerref_id'>\r\n\t\t\t\t\t</div></td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr>\r\n\t\t\t\t<td>&nbsp;&nbsp;&nbsp;&nbsp;<input size='17' name='linedescref' id='linedescref' aonKeyDown='return changearrayfieldEnter(event,\"linedescref\",{$nextid},{$previousid},\"linedescref\",this)'></td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t</table>\r\n\t\t\t\t\t\r\n\t\t\t\t</td>\r\n\t\t\t\t<td nowrap width='1' class='even'>&nbsp;&nbsp;&nbsp;&nbsp;\r\n\t\t\t\t\t<input name='refchequeno' id='refchequeno' size='10' maxlength='10'\r\n\t\t\t\t\t\t style='display:none' onfocus='this.select()'  aonKeyDown='return changearrayfieldEnter(event,\"refchequeno\",{$nextid},{$previousid},\"refchequeno\",this)'>\r\n\t\t\t\t</td>\r\n\t\t\t\t<td nowrap class='even'> &nbsp;&nbsp;&nbsp;&nbsp;\r\n\t\t\t\t\t<input name='refamtvaluedebit' size='10' maxlength='10' value='0.00' onchange='checkRefValue(this.name);'\r\n\t\t\t\t\tonfocus='this.select()'  id='refamtvaluedebit' aonKeyDown='return changearrayfieldEnter(event,\"refamtvaluedebit\",{$nextid},{$previousid},\"refamtvaluedebit\",this)'>\r\n\t\t\t\t</td>\r\n\r\n\t\t\t\t<td nowrap width='1' class='even'>&nbsp;&nbsp;&nbsp;&nbsp;\r\n\t\t\t\t\t<input name='refamtvaluecredit' size='10' maxlength='10' value='0.00' onchange='checkRefValue(this.name);'\r\n\t\t\t\t\tonfocus='this.select()'  id='refamtvaluecredit' aonKeyDown='return changearrayfieldEnter(event,\"refamtvaluecredit\",{$nextid},{$previousid},\"refamtvaluedebit\",this)'>\r\n\t\t\t\t</td>\r\n\t\t\t\t<td nowrap width='1' class='even'>&nbsp;&nbsp;&nbsp;&nbsp;\r\n\t\t\t\t\t<input name='refdocno1' id='refdocno1' size='10' maxlength='10' onfocus='this.select()'  aonKeyDown='return changearrayfieldEnter(event,\"refdocno1\",{$nextid},{$previousid},\"refdocno1\",this)'>\r\n\t\t\t\t</td>\r\n\t\t\t\t<td nowrap awidth='1' class='even'>\r\n\t\t\t\t</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t</table>\r\n\t\t\t\t";
            $transactionctrl = "<tr><td class='head'>Transaction</td>\t<td colspan='3'>{$defaultsetting}</td></tr>";
            $selectadd1line = "SELECTED='SELECTED'";
            $selectadd0line = "";
            /*			$defaultcurrencysetting="<tr><td class='head'>Currency</td>
            				<td class='even' >$this->currencyctrl Organization Currency: $defcurrencycode</TD>
            				<td class='head'>Conversion Rate</td>
            				<td class='even'><input value='$this->conversionrate' name='conversionrate'></td>
            			</tr>";*/
        } else {
            $selectadd0line = "SELECTED='SELECTED'";
            $selectadd1line = "";
            //$styledate="readonly";
            //$stylecalendar="style='display:none'";
            //	$defaultcurrencysetting="";
            $action = "update";
            //check whether this batch is system controlled batch
            if ($this->isreadonly == 0) {
                if ($this->iscomplete == 0) {
                    $savectrl = "<input name='batch_id' value='{$this->batch_id}' type='hidden'>\r\n\t\t\t <input style='height: 40px;' name='btnSave' value='Save' type='button' onclick='iscomplete.value=0;validateBatchSave2();'>";
                    $completectrl = "<input style='height: 40px;' name='btncomplete' value='Complete' type='button' onclick='iscomplete.value=1;validateBatchSave2();'>";
                    $readonlyctrl = "";
                } else {
                    $readonlyctrl = "readonly='readonly'";
                    $savectrl = " <input name='btncomplete' type='hidden'>";
                }
            } else {
                $readonlyctrl = "readonly='readonly'";
                $statusmsg = "<b style='color:red'>System controlled record, you have readonly permission.</b>";
            }
            //end else from check isreadonly field
            $defaultsetting = "";
            if ($this->isAdmin) {
                $recordctrl = "<form target='_blank' action='../simantz/recordinfo.php' method='POST'>" . "<input name='tablename' value='{$this->tablebatch}' type='hidden'>" . "<input name='id' value='{$this->batch_id}' type='hidden'>" . "<input name='idname' value='batch_id' type='hidden'>" . "<input name='title' value='Batch' type='hidden'>" . "<input name='btnRecord' value='View Record Info' type='submit'>" . "</form>";
            }
            //force reuse checkbox been checked if the value in db is 'Y'
            if ($this->reuse == 1) {
                $checked = "CHECKED";
            } else {
                $checked = "";
            }
            if ($this->iscomplete == 0) {
                $docstatus = "Draft";
            } else {
                $docstatus = "Completed";
            }
            $header = "Edit Batch";
            if ($this->allowDelete($this->batch_id) && $this->isreadonly == 0) {
                $deletectrl = "<FORM action='batch.php' method='POST' onSubmit='return confirm(" . '"confirm to remove this batch?"' . ")'><input type='submit' value='Delete' name='btnDelete' style='height: 40px;'>" . "<input type='hidden' value='{$this->batch_id}' name='batch_id'>" . "<input type='hidden' value='delete' name='action'><input name='token' value='{$token}' type='hidden'></form>";
            } else {
                $deletectrl = "";
            }
            if ($this->iscomplete == 1 && $this->isreadonly == 0) {
                $reactivatectrl = "<FORM action='batch.php' method='POST' onSubmit='return confirm(" . '"confirm to re-activate this batch?"' . ")'><input style='height: 40px;' type='submit' value='Activate' name='btnActivate'>" . "<input type='hidden' value='{$this->batch_id}' name='batch_id'>" . "<input type='hidden' value='reactivate' name='action'>\r\n\t\t<input name='token' value='{$token}' type='hidden'>\r\n\t\t</form>";
            } elseif ($this->iscomplete == -1) {
                $reactivatectrl = "<b style='color: red'>Reversed By {$this->fromsys}</b>";
            }
            $transactionctrl = "<tr><td class='head'>Transaction</td><td class='even' colspan='3'>{$this->transactiontable}</td></tr>";
            if ($this->reuse == 1) {
                $reusectrl = "<FORM action='batch.php' method='POST' onSubmit='return confirm(" . '"confirm to re-use this batch?"' . ")'><input style='height: 40px;' type='submit' value='Re-Use' name='btnReuse'>" . "<input type='hidden' value='{$this->batch_id}' name='batch_id'>" . "<input type='hidden' value='reuseid' name='action'>\r\n\t\t<input name='token' value='{$token}' type='hidden'>\r\n\t\t</form>";
            }
            if ($this->checkClosing() == 1 || $this->iscomplete == 1) {
                $styledelete = "style='display:none'";
            }
        }
        echo <<<EOF
{$addnewctrl}

<form onsubmit="return validateBatch()" method="post"
 action="batch.php" name="frmBatch">
<table style="width:140px;"><tbody><td><input name="reset" value="Reset" type="reset"></td></tbody></table>

  <table style="text-align: left; width: 100%;" border="1" cellpadding="0" cellspacing="1">
    <tbody>
      <tr>
        <th colspan="4" rowspan="1">{$header}</th>
      </tr>
      <tr>
        <td class="head">Organization {$mandatorysign}</td>
        <td class="even" >{$this->orgctrl} </td>
   \t<td class="head">Batch No {$mandatorysign}</td>
        <td class="even" ><input name='batchno' value={$this->batchno} {$readonlyctrl} 
\t\t\taonKeyDown="return changearrayfieldEnter(event,this.id,{$nextid},{$previousid},this.id,this)"></td>
      </tr>
      <tr>
\t<td class="head">Date</td>
\t<td class="even" >
\t\t<input id='batchdate' name='batchdate' value="{$this->batchdate}" {$styledate} {$readonlyctrl}  aonKeyDown="return changearrayfieldEnter(event,'batchdate',{$nextid},{$previousid},'batchdate',this)">
\t\t<input type='button' onclick="{$this->showcalendar}" value='Date' {$stylecalendar} {$readonlyctrl}>
\t\t<input type='hidden' id='period_id' name='period_id' value="{$this->period_id}">
\t</td>
        <td class="head">Batch Name {$mandatorysign}</td>
        <td class="even" ><input maxlength="40" size="30" name="batch_name" value="{$this->batch_name}" {$readonlyctrl}  aonKeyDown="return changearrayfieldEnter(event,'batch_name',{$nextid},{$previousid},'batch_name',this)"  id="batch_name">
\t\t&nbsp;Re-Use <input type="checkbox" {$checked} name="reuse" {$readonlyctrl}  aonKeyDown="return changearrayfieldEnter(event,'reuse',{$nextid},{$previousid},'reuse',this)"  id="reuse"></td>
      </tr>

  
   <tr>
        <td class="head">Total Debit </td>
        <td class="even" ><input name='totaldebit' value="{$this->totaldebit}" readonly="readonly" size='12' {$readonlyctrl} 
\t\tstyle='text-align:right'  aonKeyDown="return changearrayfieldEnter(event,this.id,{$nextid},{$previousid},this.id,this)" ></TD>
\t<td class="head">Total Credit</td>
\t<td class="even" ><input name='totalcredit' value="{$this->totalcredit}" readonly="readonly" size='12' {$readonlyctrl} 
\t\tstyle='text-align:right' aonKeyDown="return changearrayfieldEnter(event,this.id,{$nextid},{$previousid},this.id,this)" > \t
\t\t\t<input type='hidden' name='iscomplete' value='0'></td>
      </tr>
      <tr>
        <td class="head">Description</td>
        <td class="even" colspan='3'><input maxlength="100" size="90" name="description" value="{$this->description}" {$readonlyctrl}
\t\taonKeyDown="return changearrayfieldEnter(event,this.id,{$nextid},{$previousid},this.id,this)" ></td>
      </tr>

\t
   
{$transactionctrl}
 \t<tr>
        <td class="head">Add New Record</td>
        <td class="even" colspan='3'><input type='checkbox' name='chkAddNew' 
\t\taonKeyDown="return changearrayfieldEnter(event,this.id,{$nextid},{$previousid},this.id,this);"> 
\t\t\tAdd new record immediately after save or complete.<br/>{$statusmsg}</td>
      \t</tr>
    </tbody>
  </table>
<table style="width:150px;"><tbody><tr><td {$styleclosing}>{$savectrl}  
\t<input name="action" value="{$action}" type="hidden">
\t<input name="token" value="{$token}" type="hidden"></td><td>{$completectrl}</td>
\t</form><td {$styledelete}>{$deletectrl}</td><td {$styleclosing}>{$reactivatectrl}</td><td>{$reusectrl}</td></tr></tbody></table>
  <br>

{$recordctrl}
<div id='iddivstatus'>Please wait for download your record completely.</div>
EOF;
    }
示例#10
0
    /**
     * Display input form, type can be 'new', or 'edit', if new all field will be set
     * empty or 0. Or else all field data will pull from database.
     *
     * @param string type
     * @param int studentchase_id
     * @return
     * @access public
     */
    public function getInputForm($type, $studentchase_id, $token)
    {
        $mandatorysign = "<b style='color:red'>*</b>";
        $previewbtn = '';
        $header = "";
        // parameter to display form header
        $action = "";
        $savectrl = "";
        $deletectrl = "";
        $itemselect = "";
        $orgctrl = "";
        $this->created = 0;
        if ($type == "new") {
            $header = "New History";
            $action = "create";
            if ($studentchase_id == 0) {
                $this->studentchase_date = getDateSession();
                $this->isactive = "";
                $this->defaultlevel = 10;
                $this->studentchase_id = getNewCode($this->xoopsDB, "studentchase_id", $this->tablestudentchase, "");
            }
            $savectrl = "<input astyle='height: 40px;' name='submit' value='Save' type='submit'>";
            $checked = "CHECKED";
            $deletectrl = "";
            $addnewctrl = "";
            $selectStock = "";
            $selectClass = "";
            $selectCharge = "";
        } else {
            $action = "update";
            $savectrl = "<input name='studentchase_id' value='{$this->studentchase_id}' type='hidden'>" . "<input astyle='height: 40px;' name='submit' value='Save' type='submit'>";
            if ($this->isAdmin) {
                $recordctrl = "<form target='_blank' action='recordinfo.php' method='POST'>" . "<input name='tablename' value='{$this->tablestudentchase}' type='hidden'>" . "<input name='id' value='{$this->studentchase_id}' type='hidden'>" . "<input name='idname' value='studentchase_id' type='hidden'>" . "<input name='title' value='Student Reminder' type='hidden'>" . "<input name='submit' value='View Record Info' type='submit'>" . "</form>";
            }
            //force isactive checkbox been checked if the value in db is 'Y'
            if ($this->isactive == 1) {
                $checked = "CHECKED";
            } else {
                $checked = "";
            }
            $header = "Edit History";
            if ($this->allowDelete($this->studentchase_id)) {
                $deletectrl = "<FORM action='studentchase.php' method='POST' onSubmit='return confirm(" . '"confirm to remove this student reminder?"' . ")'><input type='submit' value='Delete' name='submit'>" . "<input type='hidden' value='{$this->studentchase_id}' name='studentchase_id'>" . "<input type='hidden' value='delete' name='action'><input name='token' value='{$token}' type='hidden'></form>";
            } else {
                $deletectrl = "";
            }
            $addnewctrl = "<Form action='studentchase.php' method='POST'><input name='submit' value='New' type='submit'></form>";
            $previewbtn = '<a href="student_reminder.php?reminder_id=' . $this->studentchase_id . '" target="blank"><input type="hidden" value="Preview Letter" name="preButton"></a>';
        }
        echo <<<EOF


<table style="width:140px;"><tbody><td>{$addnewctrl}</td><td><form onsubmit="return validateStudentchase()" method="post"
 action="studentchase.php" name="frmStudentchase"><input name="reset" value="Reset" type="reset"></td>
<td><a href="studentchase.php?action=search"><input type="button" value="Search History" name="searchbutton"></a></td></tbody></table>

  <table style="text-align: left; width: 100%;" border="0" cellpadding="0" cellspacing="1">
    <tbody>
      <tr>
        <th colspan="4" rowspan="1">{$header}</th>
      </tr>
      <tr>
        <td class="head">Organization {$mandatorysign}</td>
        <td class="even" colspan="3">{$this->orgctrl}&nbsp;Active <input type="checkbox" {$checked} name="isactive"></td>
\t\t\t<td class="head" style="display:none">Default Level {$mandatorysign}</td>
\t        <td class="even"  style="display:none"><input maxlength="3" size="3" name='defaultlevel' value='{$this->defaultlevel}'>

      </tr>
      <tr>
\t<td class="head">Student </td>
        <td class="even" >{$this->studentctrl}</td>
        <td class="head">Semester</td>
        <td class="even">{$this->semesterctrl}</td>
      </tr>
      <tr>
        <td class="head">Date</td>
        <td class="even" colspan="3"><input name='studentchase_date' id='studentchase_date' value="{$this->studentchase_date}" maxlength='10' size='10'>
    <input name='btnDate' value="Date" type="button" onclick="{$this->reminderdatectrl}"> <font color=red>YYYY-MM-DD (Ex: 2009-12-30)</font></td>
      </tr>
      <tr>
        <td class="head">Remarks</td>
        <td class="even"  colspan="3"><textarea name="remarks" cols="40" rows="4">{$this->remarks}</textarea></td>
        
      </tr>

    </tbody>
  </table>
<table style="width:150px;"><tbody><td>{$savectrl}
\t<input name="action" value="{$action}" type="hidden">
\t<input name="token" value="{$token}" type="hidden">
        </td>
\t</form>
        
        <td>{$deletectrl}</td><td>{$previewbtn}</td></tbody></table>

  <br>

{$recordctrl}

EOF;
    }
    /**
     * Display input form, type can be 'new', or 'edit', if new all field will be set
     * empty or 0. Or else all field data will pull from database.
     *
     * @param string type 
     * @param int paymentvoucher_id 
     * @return 
     * @access public
     */
    public function getInputForm($type, $paymentvoucher_id, $token)
    {
        $mandatorysign = "<b style='color:red'>*</b>";
        $header = "";
        // parameter to display form header
        $action = "";
        $savectrl = "";
        $deletectrl = "";
        $itemselect = "";
        $orgctrl = "";
        $this->created = 0;
        if ($type == "new") {
            $header = "New Payment Voucher";
            $action = "create";
            if ($paymentvoucher_id == 0) {
                $this->paidto = "";
                $this->iscomplete = "";
                $this->exchangerate = 1;
                $this->amt = 0;
                $this->displaychequenostyle = "style='display:none'";
                $this->originalamt = 0;
                $this->iscomplete = 0;
                $this->paymentvoucher_no = getNewCode($this->xoopsDB, "paymentvoucher_no", $this->tablepaymentvoucher);
                //$this->paymentvoucher_date=date('Y-m-d',time());
                $this->paymentvoucher_date = getDateSession();
                $this->batch_id = 0;
            }
            $savectrl = "<input style='height: 40px;' name='submit' value='Save' type='submit'  onclick='iscomplete.value=0'>";
            $completectrl = "<input style='height: 40px;' name='submit' value='Complete' type='submit' onclick='iscomplete.value=1'>";
            $checked = "CHECKED";
            $deletectrl = "";
            $addnewctrl = "";
            $selectStock = "";
            $selectClass = "";
            $selectCharge = "";
            $closectrl = "";
        } else {
            $action = "update";
            if ($this->isAdmin) {
                $recordctrl = "<form target='_blank' action='recordinfo.php' method='POST'>" . "<input name='tablename' value='{$this->tablepaymentvoucher}' type='hidden'>" . "<input name='id' value='{$this->paymentvoucher_id}' type='hidden'>" . "<input name='idname' value='paymentvoucher_id' type='hidden'>" . "<input name='title' value='Financial Year' type='hidden'>" . "<input name='submit' value='View Record Info' type='submit'>" . "</form>";
            }
            $previewctrl = "<form target='_blank' action='viewpaymentvoucher.php' method='POST'>" . "<input name='paymentvoucher_id' value='{$this->paymentvoucher_id}' type='hidden'>" . "<input name='submit' value='Print Preview' type='submit'>" . "</form>";
            $princhequectrl = "<form target='_blank' action='viewprintcheque.php' method='POST' name='frmPrintCheque'>" . "<input name='paymentvoucher_id' value='{$this->paymentvoucher_id}' type='hidden'>" . "<input name='submit' value='Print Cheque' type='submit' id='btnPrintCheque' {$this->displaychequenostyle}>" . "</form>";
            $header = "Edit Payment Voucher";
            if ($this->iscomplete == 0) {
                $deletectrl = "<FORM action='paymentvoucher.php' method='POST' onSubmit='return confirm(" . '"confirm to remove this paymentvoucher?"' . ")'><input type='submit' value='Delete' name='submit'>" . "<input type='hidden' value='{$this->paymentvoucher_id}' name='paymentvoucher_id'>" . "<input type='hidden' value='delete' name='action'><input name='token' value='{$token}' type='hidden'></form>";
                $savectrl = "<input name='paymentvoucher_id' value='{$this->paymentvoucher_id}' type='hidden'>" . "<input style='height: 40px;' name='submit' value='Save' type='submit' onclick='iscomplete.value=0'>";
                $completectrl = "<input style='height: 40px;' name='submit' value='Complete' type='submit' onclick='iscomplete.value=1'>";
            } else {
                $deletectrl = "";
                $savectrl = "";
                $completectrl = "";
                if ($this->isAdmin) {
                    $activatectrl = "<FORM action='paymentvoucher.php' method='POST' onSubmit='return confirm(" . '"confirm to reactivate this paymentvoucher?"' . ")'><input type='submit' value='Reactivate' name='submit'>" . "<input type='hidden' value='{$this->paymentvoucher_id}' name='paymentvoucher_id'>" . "<input type='hidden' value='reactivate' name='action'><input name='token' value='{$token}' type='hidden'></form>";
                }
            }
            if ($this->batch_id > 0) {
                $viewbatch = "<a href='batch.php?batch_id={$this->batch_id}&action=edit'>View Journal</a>";
            } else {
                $viewbatch = "";
            }
        }
        if ($this->bpartner_id == 0) {
            $bpartner_fld = "<input type='hidden' name='bpartner_id' value='0'>";
        }
        echo <<<EOF
<A href='paymentvoucher.php'>[Add New]</A>&nbsp;<A href='paymentvoucher.php?action=showSearchForm'>[Search]</A>

<form onsubmit="return validatePaymentVoucher()" method="post" action="paymentvoucher.php" name="frmPaymentVoucher">
<table style="width:140px;"><tbody><td><input name="reset" value="Reset" type="reset"></td></tbody></table>
<div id="bpartnerID">{$bpartner_fld}</div>

  <table style="text-align: left; width: 100%;" border="1" cellpadding="0" cellspacing="1">
    <tbody>
      <tr>
        <th colspan="4" rowspan="1">{$header}</th>
      </tr>
      <tr>
        <td class="head">Organization {$mandatorysign}</td>
        <td class="even" colspan='3'>{$this->orgctrl} {$viewbatch}</td>
\t</tr><tr>
   \t<td class="head">Date </td>
        <td class="even" ><input name="paymentvoucher_date" value="{$this->paymentvoucher_date}" id='paymentvoucher_date' size='10' maxlength='10'>
\t\t<input name="btnDate" value="Date" id='btnDate'  onclick="{$this->showCalendar}" type='button'></td>

   \t<td class="head">Payment Voucher No </td>
        <td class="even" ><input name="paymentvoucher_no" value="{$this->paymentvoucher_no}">
\t\t<input name="iscomplete" value="{$this->iscomplete}" type='hidden'></td>
      </tr>
      <tr>
     
        <td class="head">To Accounts</td>
        <td class="even">{$this->accountstoctrl} <div id='divbpartner'> {$this->bpartnerctrl}</div> 
\t\t\t<input name='bpartner_id_bc' id='bpartner_id_bc' type='hidden' value="{$this->bpartner_id_bc}"></td>
        <td class="head">Paid To</td>
        <td class="even"><input name='paidto' value="{$this->paidto}"></td>
      </tr>
      <tr>
        <td class="head">Currency</td>
        <td class="even">{$this->currencyctrl}</td>
        <td class="head">Exchange Rate</td>
        <td class="even"><input name='exchangerate' value="{$this->exchangerate}" onchange='amt.value=parseFloat(this.value*originalamt.value).toFixed(2)'></td>
      </tr>
      <tr>
        <td class="head">Amount</td>
        <td class="even"><input name='originalamt' value="{$this->originalamt}" onchange='amt.value=parseFloat(exchangerate.value*this.value).toFixed(2)'></td>
        <td class="head">Coverted Amount</td>
        <td class="even"><input name='amt' value="{$this->amt}" readonly='readonly'></td>
      </tr>

      <tr>
   <td class="head">From Accounts</td>
        <td class="even">{$this->accountsfromctrl} <input value="{$this->chequeno}" name='chequeno' {$this->displaychequenostyle}>
\t\t</td>
        <td class="head">Received By</td>
        <td class="even"><input name='receivedby' value="{$this->receivedby}">
\t<input name='batch_id' value="{$this->batch_id}" type='hidden'></td>
      </tr>
      <tr>
        <td class="head">Description</td>
        <td class="even" colspan='3'><textarea cols='70' name='description' >{$this->description}</textarea></td>
      </tr>
 <tr>
        <td class="head">Add New Record</td>
        <td class="even" colspan='3'><input type='checkbox' name='chkAddNew'> Add new record immediately after save or complete.</td>
      </tr>
    </tbody>
  </table>
<table style="width:150px;"><tbody><td>{$savectrl} </td><td>{$completectrl}</td>
\t<input name="action" value="{$action}" type="hidden">
\t<input name="token" value="{$token}" type="hidden"></td>
\t</tbody>
\t<table></form>

\t<table style="width:150px;">
\t<td>{$deletectrl} {$activatectrl}</td><td>{$recordctrl}</td><td>{$previewctrl}</td><td>{$princhequectrl}</td></table>
  <br>



EOF;
    }
示例#12
0
    /**
     * Display input form, type can be 'new', or 'edit', if new all field will be set
     * empty or 0. Or else all field data will pull from database.
     *
     * @param string type 
     * @param int studentinvoice_id
     * @return 
     * @access public
     */
    public function getInputForm($type, $studentinvoice_id, $token)
    {
        global $isreadonlywindows;
        $mandatorysign = "<b style='color:red'>*</b>";
        $header = "";
        // parameter to display form header
        $action = "";
        $savectrl = "";
        $searchctrl = "";
        $deletectrl = "";
        $itemselect = "";
        $previewctrl = "";
        $orgctrl = "";
        $this->created = 0;
        if ($type == "new") {
            $header = "New";
            $action = "create";
            if ($studentinvoice_id == 0) {
                $this->studentcharges_name = "";
                $this->isactive = "";
                $this->defaultlevel = 10;
                $studentchargeschecked = "CHECKED";
                $this->studentinvoice_no = getNewCode($this->xoopsDB, "studentinvoice_no", $this->tablestudentinvoice, "");
                $this->studentcharges_date = getDateSession();
                $this->studentinvoice_lineamt = 0;
            }
            $savectrl = "<input astyle='height: 40px;' name='btnSave' value='Save' type='submit'>";
            $checked = "CHECKED";
            $deletectrl = "";
            $addnewctrl = "";
            $selectStock = "";
            $selectClass = "";
            $selectCharge = "";
        } else {
            $action = "update";
            $savectrl = "<input name='studentinvoiceline_id' value='{$this->studentinvoiceline_id}' type='hidden'>" . "<input astyle='height: 40px;' name='btnSave' value='Save' type='submit'>";
            if ($this->isAdmin) {
                $recordctrl = "<form target='_blank' action='recordinfo.php' method='POST'>" . "<input name='tablename' value='{$this->tablestudentinvoice}' type='hidden'>" . "<input name='id' value='{$this->studentinvoice_id}' type='hidden'>" . "<input name='idname' value='studentinvoice_id' type='hidden'>" . "<input name='title' value='Studentcharges' type='hidden'>" . "<input name='btnView' value='View Record Info' type='submit'>" . "</form>";
            }
            //force isactive checkbox been checked if the value in db is 'Y'
            if ($this->isactive == 1) {
                $checked = "CHECKED";
            } else {
                $checked = "";
            }
            $header = "Edit";
            if ($this->allowDelete($this->studentinvoice_id)) {
                $deletectrl = "<FORM action='studentcharges.php' method='POST' onSubmit='return confirm(" . '"confirm to remove this studentcharges?"' . ")'><input type='submit' value='Delete' name='btnDelete'>" . "<input type='hidden' value='{$this->studentinvoiceline_id}' name='studentinvoiceline_id'>" . "<input type='hidden' value='delete' name='action'><input name='token' value='{$token}' type='hidden'></form>";
            } else {
                $deletectrl = "";
            }
            $addnewctrl = "<Form action='studentcharges.php' method='POST'><input name='btnNew' value='New' type='submit'></form>";
            $previewctrl = "<FORM target='_blank' action='viewstudentcharges.php' method='POST' aonSubmit='return confirm(" . '"confirm to remove this studentcharges?"' . ")'><input type='submit' value='Preview' name='btnPreview'>" . "<input type='hidden' value='{$this->studentinvoice_id}' name='studentinvoice_id'>" . "<input type='hidden' value='delete' name='action'><input name='token' value='{$token}' type='hidden'></form>";
        }
        $searchctrl = "<Form action='studentcharges.php' method='POST'>\r\n                            <input name='btnSearch' value='Search' type='submit'>\r\n                            <input name='action' value='search' type='hidden'>\r\n                            </form>";
        $stylesave = "";
        if ($this->studentinvoice_id > 0) {
            $stylesave = "style='display:none'";
        }
        $actionform = 'action="studentcharges.php"';
        $this->styleviewwindows = "";
        if ($isreadonlywindows == 1) {
            $addnewctrl = "";
            $deletectrl = "";
            $savectrl = "";
            $actionform = 'onsubmit="return false"';
            $this->styleviewwindows = "style='display:none'";
        }
        echo <<<EOF


<table style="width:140px;">
<tbody>
<td>{$addnewctrl}</td>
<td>{$searchctrl}</td>
<td><form onsubmit="return validateStudentcharges()" method="post"
 action="studentcharges.php" name="frmStudentcharges"  enctype="multipart/form-data"><input name="reset" value="Reset" type="reset"></td></tbody></table>


  <table style="text-align: left; width: 100%;" border="0" cellpadding="0" cellspacing="1">
    <tbody>
        <tr>
        <th colspan="4" rowspan="1">{$header}</th>
        </tr>

        <tr>
        <td class="head">Student</td>
        <td class="even" colspan="3">{$this->studentctrl}</td>
        </tr>

        <tr>
        <td class="head">Item</td>
        <td class="even">
        <input maxlength="100" size="30" name="studentinvoice_item" value="{$this->studentinvoice_item}">
        <a title="Add By Product" style="cursor:pointer" onclick="viewProduct()"> >> </a><br>
        <div id="idProductCtrl" style="display:none">{$this->productctrl}</div>
        </td>
        <td class="head">Amount (RM)</td>
        <td class="even"><input maxlength="11" size="11" name="studentinvoice_lineamt" value="{$this->studentinvoice_lineamt}"></td>
        </tr>

        <tr>
        <td class="head">Description</td>
        <td class="even" colspan='3'><textarea name="line_desc" cols="40" rows="4">{$this->line_desc}</textarea></td>
        </tr>
 
    </tbody>
  </table>
EOF;
        echo <<<EOF

<br>
<table astyle="width:150px;"><tbody><td width=1 {$stylesave}>{$savectrl}
\t<input name="action" value="{$action}" type="hidden">
\t<input name="token" value="{$token}" type="hidden"></td>
\t</form>
    <td align="right" {$stylesave}>{$deletectrl}</td>
    </tbody></table>
  <br>

{$recordctrl}

EOF;
    }