Пример #1
0
    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>
//        </li>";
$line = $permission->showGMenu($parentwindows_id, 0, $userid, $module_id);
//$line;
//var_dump($permission->window_dialog);
echo $line;
//$menulist .= "        <li>
//        <a href='report.php' class='parent'><span>Reports</span></a>
//        </li></ul></div></div>";
//$menulist = str_replace(array("\r\n", "\n", "\r"), "", $menulist);
Пример #2
0
\t\t<A href='index.php'>Back To This Module Administration Menu</A><br>
\t\teverything in this organization is purge!
EOF;
        $log->showLog(3, "\n\t\t{$sql1}<br>\n\t\t{$sql2}<br>\n\t\t{$sql3}<br>\n\t\t{$sql4}<br>\n\t\t{$sql5}<br>\n\t\t{$sql6}<br>\n\t\t{$sql7}<br>\n\t\t{$sql8}<br>\n\t\t{$sql9}<br>\n\t\t{$sql10}<br>\n\t\t{$sql11}<br>\n\t\t{$sql12}<br>\n\t\t{$sql13}<br>\n\t\t{$sql14}<br>\n\t\t{$sql15}<br>\n\t\t{$sql16}<br>\n\t\t{$sql17}<br>\n\t\t{$sql18}<br>\n\t\t{$sql19}<br>\n\t\t{$sql20}<br>\n\t\t{$sql21}<br>\n\t\t{$sql22}<br>\n\t\t");
    } else {
        echo <<<EOF
\t\t<A href='index.php'>Back To This Module Administration Menu</A><br>
\t\tNo organization is selected, click <a href="resetaccounts.php">[here]</a> to go back previous page.
EOF;
    }
} else {
    include_once "../class/SelectCtrl.inc.php";
    include_once "../class/Log.inc.php";
    $log = new Log();
    $ctrl = new SelectCtrl();
    $orgctrl = $ctrl->selectionOrg(0, 0, 'Y', '');
    echo <<<EOF
\t<A href='index.php'>Back To This Module Administration Menu</A><br>
Confirm to reset accounts in this organization? Please backup your data before proceed further.<br>

<FORM action="resetaccounts.php" method="POST" onsubmit="return confirm('Confirm to clear data?')">
Organization: {$orgctrl}<br>

  <INPUT type="submit" name="submit" value="Reset Account">
</FORM>

EOF;
}
xoops_cp_footer();
?>
Пример #3
0
        $acc->fetchAccounts($_REQUEST["accounts_id"]);
        if ($acc->account_type == 4) {
            echo 1;
        } else {
            echo 0;
        }
        die;
        break;
    default:
        //and (account_type=4 or account_type=7)
        include "menu.php";
        $xoTheme->addScript($url . '/modules/simantz/include/validatetext.js');
        $xoTheme->addScript('browse.php?Frameworks/jquery/jquery.js');
        $o->showJavascript();
        $token = $s->createToken($tokenlife, "CREATE_ACG");
        $o->orgctrl = $ctrl->selectionOrg($o->createdby, $defaultorganization_id, 'N', "", 'Y');
        //$o->accounclassctrl=$ctrl->getAccClass(0,'N');
        //	$o->accountsfromctrl=$ctrl->getSelectAccounts(0,'Y',"onchange='reloadAccountFrom(this.value)'","accountsfrom_id","");
        $o->accountsfromctrl = $simbizctrl->getSelectAccounts(0, 'Y', "onchange='reloadAccountFrom(this.value)'", "accountsfrom_id", "");
        //$o->accountstoctrl=$ctrl->getSelectAccounts(0,'Y',"onchange='reloadAccountTo(this.value)'","accountsto_id","");
        $o->currencyctrl = $ctrl->getSelectCurrency($defaultcurrency_id, 'N', "currency_id", "", "onchange='refreshCurrency(this.value)'");
        //	$o->bpartnerctrl=$ctrl->getSelectBPartner(0,'Y',"style='display:none' onchange='changePaidFrom(this.selectedIndex)'");
        //echo "<input name='bpartner_id' value='0' type='hidden'>";
        $o->preparedby = $xoopsUser->getVar("name");
        $o->getInputForm("new", 0, $token);
        //$o->showPaymentVoucherTable("WHERE f.paymentvoucher_id>0 and f.organization_id=$defaultorganization_id","ORDER BY f.paymentvoucher_no limit 0,30");
        $o->showPaymentVoucherTable("WHERE f.paymentvoucher_id>0 and f.organization_id={$defaultorganization_id} and f.iscomplete=0", "ORDER BY f.paymentvoucher_no");
        break;
}
echo "</td>";
require XOOPS_ROOT_PATH . '/footer.php';
Пример #4
0
$o->showcalendar1 = $dp->show("datefrom");
$o->showcalendar2 = $dp->show("dateto");
$o->organization_id = $_POST['organization_id'];
$o->table_name = $_POST['table_name'];
$o->uid = $_POST['uid'];
$o->datefrom = $_POST['datefrom'];
$o->dateto = $_POST['dateto'];
$o->activitytype = $_POST['activitytype'];
if ($o->organization_id == "") {
    $o->organization_id = $defaultorganization_id;
}
if ($uid == "") {
    $uid = 0;
}
$userid = $xoopsUser->getVar('uid');
$o->orgctrl = $ctrl->selectionOrg($userid, $o->organization_id);
$o->userctrl = $permission->selectAvailableSysUser($o->uid, 'Y');
$o->windowsctrl = $ctrl->getSelectWindows($o->table_name, "Y");
switch ($action) {
    //When user submit new organization
    case "create":
        // if the token is exist and not yet expired
        $log->showLog(4, "Accessing create record event, with activitysummary name={$o->activitysummary_name}");
        if ($s->check(false, $token, "CREATE_STD")) {
            if ($o->insertActivitysummary()) {
                $latest_id = $o->getLatestActivitysummaryID();
                redirect_header("activitysummary.php?action=edit&activitysummary_id={$latest_id}", $pausetime, "Your data is saved, the new id={$latest_id}");
            } else {
                echo "Can't create activitysummary!";
            }
        } else {
Пример #5
0
//	include_once '../system/class/Log.php';
//	include_once '../themes/default/style.css';
include_once "../simantz/class/datepicker/class.datepicker.php";
$url = XOOPS_URL . "/modules/simantz";
$module_id = $xoopsModule->getVar('mid');
$tableprefix = XOOPS_DB_PREFIX . "_";
$userid = $xoopsUser->getVar('uid');
$user = $xoopsUser->getVar('uname');
$log = new Log();
$o = new Permission($xoopsDB, $tableprefix, $log, $module_id);
$menulist = $o->generateMenu($userid, $module_id);
$menulist = str_replace(array("\r\n", "\n", "\r"), "", $menulist);
include_once '../simantz/class/SelectCtrl.inc.php';
$ctrl = new SelectCtrl();
$orgwhereaccess = $permission->orgWhereStr($userid);
$orgctrl = $ctrl->selectionOrg($userid, $defaultorganization_id, $showNull = 'N');
$curr_date = getDateSession($curr_date);
$sql = "SELECT employee_name FROM sim_simedu_employee WHERE uid={$userid}";
$query = $xoopsDB->query($sql);
if ($row = $xoopsDB->fetchArray($query)) {
    $user = $row['employee_name'];
}
echo "\n\t<div id='pagetitle'>Dear {$user}, you are now in the {$menuname}</div><br>";
echo <<<EOF
<script src="../simantz/include/sframe.js" type="text/javascript"></script>

<link rel="stylesheet" href="../simantz/include/stylemenu.css" type="text/css" />
<script type="text/javascript" src="../../modules/system/class/gui/oxygen/js/menu.js"></script>


<script type='text/javascript'>
Пример #6
0
     if ($o->iscomplete == 1) {
         $latest_id = $o->getLatestBatchID();
         $o->batch_id = $latest_id;
         $trans->removeUnusedLine($o->batch_id);
         $trans->compileSummary($o->batch_id);
         $trans->insertTransactionSummary($o->batch_id, $defaultorganization_id, $o->iscomplete);
     }
     if ($chkAddNew == 'on') {
         redirect_header("batch.php", $pausetime, "Your data is saved, creating new record");
     } else {
         redirect_header("batch.php?action=edit&batch_id={$latest_id}", $pausetime, "Your data is saved, the new id={$latest_id}");
     }
 } else {
     echo "<b style='color:red'>Record cannot save, please reverified data you insert into this record.</b>";
     $token = $s->createToken($tokenlife, "CREATE_ACG");
     $o->orgctrl = $ctrl->selectionOrg($o->createdby, $o->organization_id, 'N', "", 'Y');
     $o->periodctrl = $simbizctrl->getSelectPeriod($o->period_id, 'N');
     echo "<table><tr><td>";
     $o->getInputForm("new", -1, $token);
     echo "</td><td>";
     $o->showBatchTable("WHERE batch_id>0 and organization_id={$defaultorganization_id} and iscomplete=0", "ORDER BY batchno");
     echo "</td></tr></table>";
 }
 /*}else{	// if the token is not valid or the token is expired, it back to previous form with previous inputed data
 			echo "<b style='color:red'>Record cannot save due to token expired. Please resave this record</b>";
 		$token=$s->createToken($tokenlife,"CREATE_ACG");
 		$o->orgctrl=$ctrl->selectionOrg($o->createdby,$o->organization_id,'N',"",'Y');
 		$o->periodctrl=$ctrl->getSelectPeriod($o->period_id,'N');
 		echo "<table><tr>";
 		echo "<td>";
 		$o->getInputForm("new",-1,$token);
Пример #7
0
//include_once 'class/SelectCtrl.php';
//include_once "../../class/datepicker/class.datepicker.php";
include_once '../simantz/class/fpdf/fpdf.php';
include_once "../simantz/class/datepicker/class.datepicker.php";
$dp = new datepicker("{$url}");
$dp->dateFormat = 'Y-m-d';
$datefrom = getMonth(date("Ymd", time()), 0);
$dateto = getMonth(date("Ymd", time()), 1);
$showDateFrom = $dp->show('datefrom');
$showDateTo = $dp->show('dateto');
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
$log = new Log();
$s = new XoopsSecurity();
$ctrl = new SelectCtrl();
$uid = $xoopsUser->getVar('uid');
$orgctrl = $ctrl->selectionOrg($uid, $defaultorganization_id, 'N', "", 'N');
echo <<<EOF
<script type='text/javascript'>

function autofocus(){
changereport();
}
function changereport(){
//alert(value);
value=document.frmtrialbalancereport.reporttype.value;

\tswitch(value){

\t\tcase "s":
\t\t\tdocument.frmtrialbalancereport.action='viewtrialbalancesummary.php';
\t\tbreak;
Пример #8
0
    public function viewsubtable()
    {
        global $havewriteperm, $defcurrencycode, $userid, $sbfe;
        include_once "../simantz/class/SelectCtrl.inc.php";
        include_once "../simbiz/class/SimbizSelectCtrl.inc.php";
        $ctrl = new SelectCtrl();
        $bpctrl = new SimbizSelectCtrl();
        $form = "";
        $i = 0;
        //second table
        $sql = "SELECT il.*,o.organization_code\n                FROM sim_bpartner_quotationline il\n                LEFT JOIN sim_simbiz_accounts a ON a.accounts_id=il.accounts_id\n                left join sim_organization o on o.organization_id=il.branch_id\n                 WHERE il.quotation_id={$this->quotation_id} order by il.seqno ASC";
        $this->log->showLog(4, "getsubtalbe :" . $sql . "<br>");
        $query = $this->xoopsDB->query($sql);
        $form .= <<<EOF



<div align="center">


<table id="quotationline" class="" style="width:100%">

   <tr class="searchformheader" >
     <td colspan="8">
       <table><tr><td>
              <div style="float:left;cursor:pointer"><a onclick="addLine()">[Add Line]</a></div>
              <div style="float:center">Item(s)</div>
       </td></tr></table>
     </td>
   </tr>

   <tr class="searchformheader" >
          <td style="width:30px;vertical-align:top;">Seq</td>
          <td style="width:250px">Subject</td>
          <td style="width:50px">Unit Price</td>
          <td style="width:50px">Qty</td>
          <td style="width:70px">UOM</td>
          <td style="width:50px">Amount</td>
    </tr>

EOF;
        $g = 0;
        $totalgeneralamt = 0;
        global $sbfe;
        while ($row = $this->xoopsDB->fetchArray($query)) {
            if ($rowtype == "odd") {
                $rowtype = "even";
            } else {
                $rowtype = "odd";
            }
            $subject = htmlspecialchars($row['subject']);
            $description = htmlspecialchars($row['description']);
            if ($description == '') {
                $hidedesc = " style='display:none;width:350px' ";
            } else {
                $hidedesc = " style='width:350px' ";
            }
            $amt = $row['amt'];
            $localamt = $row['localamt'];
            $totalgeneralamt += $amt;
            $quotationline_id = $row['quotationline_id'];
            $accounts_id = $row['accounts_id'];
            $terms_id = $row['terms_id'];
            $terms_name = $row['terms_name'];
            $quotation_amt = $row['quotation_amt'];
            $unitprice = $row['unitprice'];
            $qty = $row['qty'];
            $uom = $row['uom'];
            $gstamt = $row['gstamt'];
            // $tax_name = $row['tax_name'];
            $organization_code = $row['organization_code'];
            $granttotalamt = $row['granttotalamt'];
            $localgranttotalamt = $row['localgranttotalamt'];
            $localamt = $row['localamt'];
            $accounts_name = $row['accountcode_full'] . " - " . $row['accounts_name'];
            //            $tax = $row['total_tax'] * 0.01;
            //name="lineaccount_id[$i]" id="account_id_$i"
            //<select name="lineaccount_id[$i]" id="account_id_$i" onfocus=getList(this.id,this.value) style='width:300px'>$acclist</select><img onclick='clearlist()' src='../simantz/images/reload.gif' title='reload'/>
            //			$acclist=$bpctrl->getSimpleSelectAccounts($accounts_id,'Y',"and accounts_id=$accounts_id");
            $orgctrl = $ctrl->selectionOrg($userid, $row['branch_id'], 'N');
            $seqno = $row['seqno'];
            $description = str_replace("\n", "<br/>", $description);
            $description = str_replace("  ", " &nbsp;", $description);
            $form .= <<<EOF
         <tr class="{$rowtype}" id='trline_{$i}'>
            <td class="{$rowtype}" style='vertical-align:top;'>{$seqno}</td>
            <td style="text-align:left;vertical-align:top;">
             {$subject}<br/>
            {$description}
            </td>

            <td style='text-align:right;vertical-align:top;'>{$unitprice}</td>
            <td style='text-align:right;vertical-align:top;'>{$qty}</td>
            <td style='text-align:center;vertical-align:top;'>{$uom}</td>
\t\t\t<td  style='vertical-align:top;text-align:right;'>
\t\t\t\t\t\t{$amt}
\t\t\t\t</td>

         </tr>

EOF;
            $i++;
            $g++;
        }
        $totalgeneralamt = number_format($totalgeneralamt, "2", ".", "");
        $form .= <<<EOF
<tfooter>
         <tr class="foot" id="trlinetotal">
\t\t\t<td ></td>
         
            <td >
                                 <input type="hidden" value="{$i}" name="totalline" id="totalline">
            </td>
            <td   colspan='3' style="width:60px;text-align:right">Sub Total {$this->currency_code}:</td>
            <td  style="width:60px;text-align:right" >{$this->subtotal}</td>
         </tr>
        
</tfooter>
                \t
\t\t\t\t         

EOF;
        $form .= <<<EOF
 </table>
</div>
EOF;
        return $form;
    }