示例#1
0
function jBeginEntry($entriid, $messageResult = "", $action = "", $method = "POST")
{
    global $gcms_entri_list;
    global $extra_style_entri;
    $extra = str_replace("xxxx", $daftarid, $extra_style_entri);
    gcms_add_to_head($extra);
    $preventConflic = '<script type="text/javascript" src="./extensions/erp/js/jquery.js"></script>' . "\n" . '<script type="text/javascript" src="./extensions/erp/js/jquery.form.js"></script>' . "\n" . '<script type="text/javascript" src="./extensions/erp/js/jquery.validate.js"></script>' . "\n" . '<script type="text/javascript" src="./extensions/erp/js/ui.datepicker.js"></script>' . "\n" . '<script type="text/javascript">' . "\n" . '   var $j = jQuery.noConflict();' . "\n" . '</script>' . "\n";
    gcms_add_to_head($preventConflic);
    if (!is_array($gcms_entri_list)) {
        $gcms_entri_list[0] = $entriid;
    } else {
        array_push($gcms_entri_list, $entriid);
    }
    if (!$action) {
        $action = "request.php";
    }
    /* pas onload di-resize dulu biar pas */
    gcms_add_on_load($entriid . "_resize_entri()");
    echo '<script type="text/javascript"> ' . "\n" . 'var ' . $entriid . '_daftars = new Array(); ' . "\n" . 'var ' . $entriid . '_pattern = new Array(); ' . "\n" . 'function ' . $entriid . '_resize_entri() { ' . "\n" . '  var cnt = document.getElementById("content"); ' . "\n" . '  var tbl = document.getElementById("tbl_' . $entriid . '"); ' . "\n" . '  tbl.style.height = cnt.offsetHeight; ' . "\n" . '} ' . "\n" . 'setInterval("' . $entriid . '_check_size()", 500); ' . "\n" . 'var ' . $entriid . '_oldw = 0; ' . "\n" . 'var ' . $entriid . '_oldh = 0; ' . "\n" . 'function ' . $entriid . '_check_size() { ' . "\n" . '  var form = document.getElementById("' . $entriid . '"); ' . "\n" . '  if ((' . $entriid . '_oldw != form.offsetWidth) || (' . $entriid . '_oldh != form.offsetHeight)) { ' . "\n" . '    ' . $entriid . '_resize_entri(); ' . "\n" . '    ' . $entriid . '_oldw = form.offsetWidth; ' . "\n" . '    ' . $entriid . '_oldh = form.offsetHeight; ' . "\n" . '  } ' . "\n" . '} ' . "\n" . 'function setIdNavigation(p,n){' . "\n" . '	document.getElementById("prev_id").value=p;' . "\n" . '	document.getElementById("next_id").value=n;' . "\n" . '}' . "\n" . 'function setJSONPattern(arr){' . "\n" . '	' . $entriid . '_pattern=arr;' . "\n" . '}' . "\n" . '</script> ' . "\n";
    if (count($_REQUEST['id']) > 1) {
        $status_edit = $_REQUEST['id'][0] ? '1' : '0';
    } else {
        $status_edit = $_REQUEST['id'] ? '1' : '0';
    }
    echo '<form id="' . $entriid . '" action="' . $action . '" method="' . $method . '"> ' . "\n" . '<input type="hidden" name="page" value="' . $_REQUEST['page'] . '"> ' . "\n" . '<input type="hidden" name="mode" value="asyc"> ' . "\n" . '<input type="hidden" name="action" value="' . $_REQUEST['action'] . '"> ' . "\n" . '<input type="hidden" name="sender" value="' . $entriid . '"> ' . "\n" . '<input type="hidden" name="status_edit" id="status_edit" value="' . $status_edit . '"> ' . "\n" . '<input type="hidden" name="idmasters" id="idmasters" value="' . $_REQUEST['id'] . '"> ' . "\n" . '<input type="hidden" id="navrec" name="navrec"><input type="hidden" id="prev_id" name="prev_id"><input type="hidden" id="next_id" name="next_id">' . "\n" . '<table id="tbl_' . $entriid . '" style="width: 100%;"><tr height="100%"><td valign="top">' . "\n" . ($messageResult ? '<div id="' . $messageResult . '"></div>' . "\n" : '') . '<div id="div' . $entriid . '" class="entri" style="height: 100%;"> ' . "\n";
}
示例#2
0
function init_update_title($procname, $get_title_func)
{
    echo '<script type="text/javascript"> ' . "\n";
    if ($get_title_func) {
        gcms_add_on_load($procname . ";");
        echo 'function ' . $procname . ' { ' . "\n" . '  document.title = ' . $get_title_func . '; ' . "\n" . '  document.getElementById("form_header").innerHTML = document.title; ' . "\n" . '} ' . "\n";
    }
    echo '</script> ' . "\n";
}
示例#3
0
function begin_entri($entriid, $action = "", $method = "POST")
{
    global $gcms_entri_list;
    if (!is_array($gcms_entri_list)) {
        $gcms_entri_list[0] = $entriid;
    } else {
        array_push($gcms_entri_list, $entriid);
    }
    if (!$action) {
        $action = $_SERVER['PHP_SELF'];
    }
    /* pas onload di-resize dulu biar pas */
    gcms_add_on_load($entriid . "_resize_entri();");
    echo '<script type="text/javascript"> ' . "\n" . 'var ' . $entriid . '_daftars = new Array(); ' . "\n" . 'function ' . $entriid . '_resize_entri() { ' . "\n" . '  var cnt = document.getElementById("content"); ' . "\n" . '  var tbl = document.getElementById("tbl_' . $entriid . '"); ' . "\n" . '  tbl.style.height = cnt.offsetHeight; ' . "\n" . '} ' . "\n" . 'setInterval("' . $entriid . '_check_size()", 500); ' . "\n" . 'var ' . $entriid . '_oldw = 0; ' . "\n" . 'var ' . $entriid . '_oldh = 0; ' . "\n" . 'function ' . $entriid . '_check_size() { ' . "\n" . '  var form = document.getElementById("' . $entriid . '"); ' . "\n" . '  if ((' . $entriid . '_oldw != form.offsetWidth) || (' . $entriid . '_oldh != form.offsetHeight)) { ' . "\n" . '    ' . $entriid . '_resize_entri(); ' . "\n" . '    ' . $entriid . '_oldw = form.offsetWidth; ' . "\n" . '    ' . $entriid . '_oldh = form.offsetHeight; ' . "\n" . '  } ' . "\n" . '} ' . "\n" . '</script> ' . "\n";
    echo '<form id="' . $entriid . '" action="' . $action . '" method="' . $method . '"> ' . "\n" . '<input type="hidden" name="page" value="' . $_REQUEST['page'] . '"> ' . "\n" . '<input type="hidden" name="action" value="' . $_REQUEST['action'] . '"> ' . "\n" . '<input type="hidden" name="sender" value="' . $entriid . '"> ' . "\n" . '<input id="daftars_' . $entriid . '" type="hidden" name="daftars" value=""> ' . "\n" . '<input id="save_' . $entriid . '" type="hidden" name="save" value=""> ' . "\n" . '<table id="tbl_' . $entriid . '" style="width: 100%;"><tr><td valign="top">' . "\n" . '<div id="div' . $entriid . '" class="entri" style="height: 100%;"> ' . "\n";
}