function aLinks_Extra($mode)
 {
     if ($mode != 'upd') {
         return array();
     }
     $app = trim($this->row['application']);
     // KFD 2/4/08, part of SVN system.  If this node has been set up
     //     as a server that pulls from SVN, we do not offer the build
     //     option on applications anymore, that is only for dev
     //     workstation and old-fashioned non-svn servers.
     $retval = array();
     if (OptionGet('DEV_STATION', 'Y') == 'Y' || $app == 'andro' || OptionGet('BUILD_ALL_APPS', 'N') == 'Y') {
         $retval[] = hLinkBuild($app, 'Build This Application');
         $retval[] = hLinkPopup('', 'View Most Recent Log', array("gp_page" => "a_builder_log", "gp_out" => "info", 'x2' => 1, 'txt_application' => $app));
     }
     // If no authoritative node is listed, we must be it, so list
     // an option.  Otherwise allow code control options.
     $lnk1 = "?gp_page=appversions_p&gp_app=" . trim($this->row['application']);
     $lnk2 = "?gp_page=a_scontrol&gp_skey=" . $this->row['skey'];
     //hprint_r($this->row);
     if (isset($this->row['node'])) {
         if (trim($this->row['node']) == 'LOCAL' || trim($this->row['node']) == '' || is_null($this->row['node'])) {
             $retval[] = hLink('', "Publish Current Code", $lnk1);
         } else {
             $retval[] = hLink('', "Source Code Functions", $lnk2);
         }
     }
     return $retval;
 }
Exemple #2
0
function tmpModuleLeft()
{
    // April 4, 2007, KFD.  Allow a breakout here
    if (function_exists('appModuleLeft')) {
        $continue = appModuleLeft();
        return $continue;
    }
    //echo "<br/>";
    if (!LoggedIn()) {
        return;
    }
    // Only display menu if
    if (OptionGet('MENULEFT', 'Y') == 'Y') {
        $module = SessionGet("AGMENU_MODULE");
        $AGMENU = SessionGet("AGMENU");
        $kount = 0;
        if (isset($AGMENU[$module])) {
            $desc = $AGMENU[$module]['description'];
            echo "<ul class=\"nav nav-list\">";
            echo "<li class=\"nav-header\">{$desc}</li>";
            foreach ($AGMENU[$module]['items'] as $key => $info) {
                $hExtra = ' tabindex="' . hpTabIndexNext(100) . '"';
                // We may make the first item the focused item if nothing else
                // has been picked yet.  This code runs when rendering is going on
                // and the class-specific biz code has all run already, so it will
                // not override any business-specific focus setting
                if (vgfGet('HTML_focus') == '') {
                    $hExtra .= ' ID="FIRSTSPLITMENU" NAME="FIRSTSPLITMENU" ';
                    vgfSet('HTML_focus', 'FIRSTSPLITMENU');
                }
                $kount++;
                $d = '?gp_page=' . $key;
                $h = hLink("mainlevel", $info['description'], $d, $hExtra);
                echo "\n<li>{$h}</li>";
                // Possibly two more links
                if (ArraySafe($info, 'linknew') == 'Y') {
                    $hx = ' tabindex="' . hpTabIndexNext(100) . '" style="margin-left:30px"';
                    $h = hLink("mainlevel", 'New', $d . '&gp_mode=ins', $hx);
                    echo "\n<li>{$h}</td></li>";
                }
                if (ArraySafe($info, 'linksearch') == 'Y') {
                    $hx = ' tabindex="' . hpTabIndexNext(100) . '" style="margin-left:30px"';
                    $h = hLink("mainlevel", 'Search', $d . '&gp_mode=search', $hx);
                    echo "\n<li>{$h}</li>";
                }
            }
            echo "</ul>";
        }
    }
    if (isset($continue)) {
        return $continue;
    }
    //while ($kount++ < 30) { echo "<br>"; }
}
Exemple #3
0
 function main()
 {
     if (gpExists('gp_xajax')) {
         $sq = "UPDATE variables\n                    SET variable_value = " . SQLFC(gp('varval')) . "\n                  WHERE variable = " . SQLFC(gp('variable'));
         SQL($sq);
     }
     if (gpExists('gp_cache')) {
         //unlink($GLOBALS['AG']['dirs']['dynamic'].'table_variables.php');
         OptionGet('X');
     }
     if (gpExists('gp_xajax')) {
         return;
     }
     parent::main();
 }
Exemple #4
0
/**
* @deprecated
*/
function ahColFromACol(&$acol)
{
    // Link to the subarray and assign any defaults
    $acol['html_element'] = 'input';
    $acol['html_right'] = '';
    $acol['html_inner'] = '';
    $acol['text-align'] = 'left';
    $acol['hparms'] = array('class' => 'x3' . $acol['mode'], 'type' => 'text', 'name' => '--NAME--', 'nameprefix' => '--NAME-PREFIX--', 'id' => '--ID--', 'tabindex' => '--TABINDEX--', 'tooltip' => ArraySafe($acol, 'tooltip', ''), 'value' => '--NAME----VALUE--', 'x_value_original' => $acol['mode'] == 'ins' ? '' : '--NAME----VALUE--', 'x_class_suffix' => '', 'x_error' => '0', 'x_class_base' => $acol['mode'], 'x_mode' => $acol['mode'], 'x_no_clear' => ArraySafe($acol, 'noclear', 'N'), 'x_ctl_prv' => ArraySafe($acol, 'ctl_prv', ''), 'x_ctl_nxt' => ArraySafe($acol, 'ctl_nxt', ''), 'x_value_focus' => '', 'x_type_id' => $acol['type_id']);
    if ($acol['type_id'] == 'date') {
        $acol['hparms']['data-date'] = '--NAME----VALUE--';
        $acol['hparms']['class'] = 'datepicker';
        $acol['hparms']['data-date-format'] = 'mm/dd/yyyy';
    }
    $TOOLTIPS = OptionGet('TOOLTIPS', 'N');
    switch ($TOOLTIPS) {
        case 'NONE':
            $acol['hparms']['title'] = '';
            $acol['hparms']['tooltip'] = '';
        case 'JQUERY_ALSO':
            $acol['hparms']['title'] = $acol['hparms']['tooltip'];
            break;
        case 'JQUERY_ONLY':
            $acol['hparms']['title'] = $acol['hparms']['tooltip'];
            unset($acol['hparms']['tooltip']);
    }
    // For read-onlies, add another class
    if (!$acol['writable']) {
        //$acol['hparms']['class']='x3ro';
        $acol['hparms']['readonly'] = 'readonly';
    }
    // A size correction
    $acol['size'] = min($acol['size'], 24);
    // KFD 10/22/07.  For PROMAT application originally
    if (ArraySafe($acol, 'pk_change') == 'Y') {
        $acol['html_right'] .= "&nbsp;&nbsp;" . "<a href=\"javascript:void(0)\"" . 'onclick="ob(\'--NAME--\').readOnly=false;ob(\'--NAME--\').focus()">' . 'change</a>';
    }
    // ------------------------------------
    // Big deal #1, decisions based on type
    // ------------------------------------
    switch ($acol['type_id']) {
        case 'date':
            //  We might put a date button off to the right,
            //  if it is writable
            /*
                  if($acol['writable']) {
                     $acol['html_right']
                        .="&nbsp;&nbsp;"
                        ."<img src='clib/dhtmlgoodies_calendar_images/calendar1.gif' value='Cal'
                           onclick=\"displayCalendar(ob('--NAME--'),'mm/dd/yyyy',this,true)\">";
                  }*/
            $acol['hparams']['data-date-format'] = 'yyyy-mm-dd';
            $acol['hparms']['size'] = $acol['size'];
            if (isset($acol['maxlength'])) {
                $acol['hparms']['maxlength'] = $acol['maxlength'];
            }
            break;
        case 'time':
            $acol['html_element'] = 'select';
            $hinner = '';
            $xmin = $acol['value_min'];
            $xmax = $acol['value_max'] ? $acol['value_max'] : 1425;
            for ($x = $xmin; $x <= $xmax; $x += 15) {
                $hinner .= "\n<option value=\"{$x}\">" . hTime($x) . "</option>";
            }
            if ($acol['mode'] == 'search') {
                $hinner = "\n<option value=\"\"></option>" . $hinner;
            }
            $acol['html_inner'] = $hinner;
            break;
        case 'cbool':
            // DO 3-7-2008  Added if statement so that when column level security is present
            //              changes to field can be "disabled"
            if (!$acol['writable']) {
                $acol['html_element'] = 'input';
            } else {
                $acol['html_element'] = 'select';
                $prefix = $acol['mode'] == 'search' ? '<option value=""></option>' : '';
                $acol['html_inner'] = $prefix . "\n<option --SELECTED-Y-- value='Y'>Y</option>" . "<option --SELECTED-N-- value='N'>N</option>";
            }
            break;
        case 'gender':
            // DO 3-7-2008  Added if statement so that when column level security is present
            //              changes to field can be "disabled"
            if (!$acol['writable']) {
                $acol['html_element'] = 'input';
            } else {
                $acol['html_element'] = 'select';
                $prefix = $acol['mode'] == 'search' ? '<option value=""></option>' : '';
                $acol['html_inner'] = $prefix . "\n<option value='M'>M</option>" . "<option value='F'>F</option>";
            }
            break;
        case 'text':
            $acol['html_element'] = 'textarea';
            $acol['hparms']['rows'] = $acol['uirows'] == 0 ? 4 : $acol['uirows'];
            $acol['hparms']['cols'] = $acol['uicols'] == 0 ? 40 : $acol['uicols'];
            $acol['html_inner'] = '--NAME----VALUE--';
            $acol['value'] = '';
            break;
        case 'numb':
        case 'int':
        case 'money':
            if ($acol['type_id'] != 'int') {
                $acol['hparms']['size'] = 12;
            } else {
                $acol['hparms']['size'] = $acol['size'];
            }
            $acol['text-align'] = 'right';
            break;
        case 'mime-h-f':
        case 'mime-h':
            // Do nothing, it all gets done later.
        // Do nothing, it all gets done later.
        default:
            $acol['hparms']['size'] = $acol['size'];
            if (isset($acol['maxlength'])) {
                $acol['hparms']['maxlength'] = $acol['maxlength'];
            }
    }
    // ------------------------------------
    // Big deal GLEPH, value_min & value_max
    // ------------------------------------
    if (a($acol, 'value_min', '') != '' && a($acol, 'value_max', '') != '') {
        if ($acol['type_id'] != 'time') {
            $acol['html_element'] = 'select';
            $acol['hparms']['size'] = 1;
            $hinner = '';
            $xmin = a($acol, 'value_min');
            $xmax = a($acol, 'value_max');
            // DJO 4-18-08 Add empty row during lookup mode
            if ($acol['mode'] == 'search') {
                $hinner .= "\n<option value=\"\"></option>";
            }
            for ($x = $xmin; $x <= $xmax; $x++) {
                $hinner .= "\n<option value=\"{$x}\">" . $x . "</option>";
            }
            $acol['html_inner'] = $hinner;
            $acol['hparms']['style'] = 'text-align:left';
        }
    }
    // ------------------------------------
    // Big deal B), foreign keys
    // ------------------------------------
    if ($acol['table_id_fko'] != '' && $acol['type_id'] != 'date') {
        // Says we want an info button next to it
        if ($acol['mode'] != 'search') {
            $acol['html_right'] .= "<span class=\"help-inline\"><a tabindex=999 href=\"javascript:Info2('" . $acol['table_id_fko'] . "'" . ",'--NAME--')\">Info</a></span>";
        }
        if ($acol['writable']) {
            // if numeric, set this back
            $acol['text-align'] = 'left';
            if ($acol['fkdisplay'] != 'dynamic') {
                // HTML SELECT Branch
                $acol['html_element'] = 'SELECT';
                $acol['html_inner'] = '--NAME----HINNER--';
                if (array_key_exists('size', $acol['hparms'])) {
                    unset($acol['hparms']['size']);
                }
                if (array_key_exists('maxlength', $acol['hparms'])) {
                    unset($acol['hparms']['maxlength']);
                }
                // KFD 10/8/07 compound foreign keys.  If its the first,
                // put in a snippet to pull the next
                $fkpks = explode(',', $acol['fk_pks']);
                if (count($fkpks) > 1) {
                    if (trim($acol['column_id']) == trim($fkpks[0])) {
                        $tfko = $acol['table_id_fko'];
                        $pk1 = $fkpks[0];
                        $pk2 = $fkpks[1];
                        $acol['snippets']['onblur'][] = "fetchSELECT('{$tfko}',this,'{$pk1}',this.value,'{$pk2}',obv('x2t_{$pk2}'))";
                    }
                }
            } else {
                // The core code just says do a dropdown
                $table_id_fko = $acol['table_id_fko'];
                $fkparms = 'gp_dropdown=' . $table_id_fko;
                if ($acol['writable']) {
                    //$col['input']='select';
                    if (vgfGet('adlversion', 2) == 1) {
                        $acol['snippets']['onkeyup'][] = "ajax_showOptions(this,'{$fkparms}',event)";
                    } else {
                        $acol['snippets']['onkeyup'][] = "androSelect_onKeyUp(this,'{$fkparms}',event)";
                        $acol['snippets']['onkeydown'][] = "androSelect_onKeyDown(event)";
                    }
                }
                $acol['hparms']['autocomplete'] = 'off';
            }
        }
    }
    // ------------------------------------
    // Big deal IV. change detection
    // ------------------------------------
    // Any item in update mode needs to get a snippet
    // KFD 8/8/07, JS_KEYSTROKE, see next section, all snippets
    //             for regular events are unconditional, the Js
    //             library routine decides what to do
    $acol['snippets']['onkeyup'][] = 'inputOnKeyUp(event,this)';
    // ------------------------------------
    // Big deal Epsilon, focus/unfocus
    // ------------------------------------
    // KFD 8/8/07, JS_KEYSTROKE.
    //             Call to javascript routines that will decide
    //             what to do, don't decide here
    $acol['snippets']['onfocus'][] = 'inputOnFocus(this)';
    $acol['snippets']['onblur'][] = 'inputOnBlur(this)';
    //if($acol['writable']) {
    //   $acol['snippets']['onfocus'][]='focusColor(this,true)';
    //   $acol['snippets']['onblur'][] ='focusColor(this,false)';
    //}
    // ------------------------------------
    // Big deal #6 execute lookup on ENTER
    // ------------------------------------
    if ($acol['mode'] == 'search') {
        $acol['snippets']['onkeypress'][] = "doButton(event,13,'but_lookup')";
    }
    // ------------------------------------
    // 2nd Big deal, execute FETCHes
    // ------------------------------------
    if (count(ArraySafe($acol, 'fetches', array())) > 0) {
        $fetches = $acol['fetches'];
        foreach ($fetches as $fetch) {
            $acol['snippets']['onchange'][] = "ajaxFetch(" . "'" . $fetch['table_id_par'] . "'" . ",'--NAME-PREFIX--'" . ",'" . $fetch['commapklist'] . "'" . ",'" . $fetch['commafklist'] . "'" . ",'" . $fetch['controls'] . "'" . ",'" . $fetch['columns'] . "'" . ",this)";
        }
    }
    // ------------------------------------
    // Does this field force recalc?
    // ------------------------------------
    if ($acol['calcs']) {
        // KFD 8/8/07 JS_KEYSTROKES, this will be done on server by
        //            calling back to the server when a value changes.
        //$acol['snippets']['onkeyup'][]="calcRow()";
        $acol['hparms']['autocomplete'] = 'off';
    }
    // ------------------------------------
    // Big deal OMEGA, rendering the element
    // ------------------------------------
    $hparms = '';
    foreach ($acol['hparms'] as $parm => $value) {
        $hparms .= $parm . '="' . (($acol['type_id'] == 'mime-h' || $acol['type_id'] == 'mime-h-f') && $parm == 'value' ? $value : hx($value)) . '"';
    }
    if ($acol['text-align'] == 'right') {
        $hparms .= ' style="text-align: right"';
    }
    $hcode = '';
    if (isset($acol['snippets'])) {
        foreach ($acol['snippets'] as $event => $list) {
            $hcode .= $event . '="' . implode(';', $list) . '"';
        }
    }
    // WE HAD A DISABLED HERE, BUT THEN IT WOULD NOT POST!
    $acol['html'] = "<" . $acol['html_element'] . ' ' . $hparms . ($acol['writable'] ? '' : ' READONLY ') . $hcode . '>' . $acol['html_inner'] . '</' . $acol['html_element'] . '>';
}
    function main()
    {
        $app = gp('gp_app');
        $sApp = SQLFC(gp('gp_app'));
        $sInst = SQLFC(gp('gp_inst'));
        $hApp = hSanitize(gp('gp_app'));
        $hInst = hSanitize(gp('gp_inst'));
        $rows = SQL_AllRows("SELECT * from instances \n           where application={$sApp} AND instance={$sInst}");
        if (count($rows) != 1) {
            ?>
         <div class="errorbox">Incorrect call to instance processing.</div>
         <?php 
            return;
        }
        $row = $rows[0];
        $hVer = hSanitize(trim($row['version']));
        // Maybe we are on processing branch
        if (gp('gp_posted') == 1) {
            $this->Process($rows[0]);
            return;
        }
        // KFD 2/4/08, Modify this to look for versions on disk
        //     for an svn-enabled server node
        $hWarn = '';
        $av = '';
        if (OptionGet('DEV_STATION', '') == 'N') {
            $sq = "Select * from applications where application={$sApp}";
            $rapp = SQL_OneRow($sq);
            if (trim($rapp['svn_url']) == '') {
                $hWarn = '<br/><br/><b>Subversion url needed.</b> ' . 'You can begin by providing a URL to the subversions ' . 'repository for this application on ' . '<a href="?gp_page=applications&gp_skey=' . $rapp['skey'] . '">the editing screen</a>.';
            }
            $versions = svnVersions();
            $verx = trim($versions[$app]['local']);
            $av = "<p>Latest Andromeda Version: " . trim($versions['andro']['local']);
        } else {
            // Get the current version, and get the latest version available
            $verx = SQL_OneValue("mv", "Select max(version) as mv from appversions\n               WHERE application={$sApp}");
            if (is_null($verx)) {
                $verx = '';
            }
        }
        ?>
        <h1>Instance Upgrade</h1>
        <p>Application: <?php 
        echo $hApp;
        ?>
   </p>
        <p>Instance: <?php 
        echo $hInst;
        ?>
     </p>
        <p>Current Version: <?php 
        echo $hVer == '' ? '-none-' : $hVer;
        ?>
 </p>
        <p>Latest Version Available: <?php 
        echo $verx == '' ? '-none-' : $verx;
        ?>
 </p>
        <?php 
        echo $av;
        ?>
 
        <p>&nbsp;</p>
        <p>
        <?php 
        if ($verx == '') {
            ?>
            <b>No official versions are available.</b>  An instance can only
            be upgraded when an official version is available.  You may
            download release code for this application, or you may
            generate files out of your development code.
            </p>
            <?php 
            echo $hWarn;
            ?>
            <?php 
            return;
        } else {
            $caption = $hVer == '' ? 'Build as ' : 'Upgrade To';
            echo hLinkPopup('', $caption . ' version ' . $verx, array('gp_app' => gp('gp_app'), 'gp_inst' => gp('gp_inst'), 'gp_posted' => 1, 'gp_page' => 'instances_p2', 'gp_out' => 'none', 'gp_ver' => $verx));
        }
    }
Exemple #6
0
 function PW_ForgotPage1()
 {
     // KFD 11/13/06.  Heavily modified for new system, threw out
     //   the older code entirely, now that all apps have a users
     //   table built into them.
     $eml = trim(gp('txt_email'));
     $seml = SQLFC(strtolower($eml));
     $heml = hx($eml);
     $ueml = urlencode($eml);
     //$leml= MakeUserId(strtolower($eml));
     $db2 = scDBConn_Push('usermaint');
     $sq = "Select skey,user_id,member_password,email FROM users " . " where LOWER(email)={$seml}";
     $member = SQL_AllRows($sq);
     // Nothing of any kind is a bummer, we can't do anything
     if (count($member) == 0) {
         ErrorAdd('There are no active accounts with that email address');
     } else {
         $leml = MakeUserID($eml);
         $member = $member[0];
         // If we know who they are, send a password and allow them to change it
         $user_pwkey = md5($member['member_password'] . $leml . time());
         //$ref=$_SERVER['HTTP_REFERER'];
         $http = httpWebSite() . "/";
         $row = array('skey' => $member['skey'], 'user_pwkey' => $user_pwkey);
         $UID = $member['user_id'];
         $PWD = $member['member_password'];
         // KFD 12/21/06.  Done for medinfo originally.  If UID looks like
         //  the email, send the email instead
         $emailUID = $member['email'];
         $table_dd = DD_Tableref('users');
         SQLX_Update($table_dd, $row);
         $emailuser_id = OptionGet('EMAIL_USERID', 'N') == 'Y' ? $emailUID : $leml;
         $text_email = "\nYour username and password are: {$emailuser_id} and {$PWD}.\n   \nIf you would like to change your password, click here:\n<{$http}?gp_page=x_password&gpp=2&eml={$ueml}&hash={$user_pwkey}>\n";
         scDBConn_Pop();
         //echo $text_email;
         EmailSend($eml, 'System Access Request', $text_email);
         ?>
         <b>Email Has Been Sent</b>.  An email has been sent to you with information
         needed to access the system.
         <?php 
         gpSet('gpp', 'X');
     }
 }
    function main_pr_execute()
    {
        ob_start();
        $sApp = SQLFC(gp('gp_app'));
        $sInst = SQLFC(gp('gp_inst'));
        $hApp = hSanitize(gp('gp_app'));
        $hInst = hSanitize(gp('gp_inst'));
        $rows = SQL_AllRows("SELECT * from instances \n           where application={$sApp} AND instance={$sInst}");
        if (count($rows) != 1) {
            ?>
         <div class="errorbox">Incorrect call to instance processing.</div>
         <?php 
            return;
        }
        $row = $rows[0];
        $sVer = SQLFC(gp('gp_ver'));
        $hVer = hSanitize(gp('gp_ver'));
        // KFD 2/4/08, If this is a subversion-enabled server,
        //     get version information from there
        if (OptionGet('DEV_STATION', '') != '') {
            $aversions = svnVersions();
            $mv = '-VER-' . $aversions['andro']['local'];
        } else {
            // Get information on latest version of Node Manager and
            // link to that
            $mv = SQL_OneValue("mv", "SELECT max(version) as mv \n                 FROM appversions\n                WHERE application='andro'");
        }
        $DIR_LINK_LIB = $GLOBALS['AG']['dirs']['root'] . '/pkg-apps/andro' . $mv;
        // Source of symlinks for app directories
        $DIR_LINK_APP = $GLOBALS['AG']['dirs']['root'] . "/pkg-apps/{$hApp}-VER-{$hVer}";
        // Get application information for the DO program
        $tsql = 'SELECT * from applications ' . ' WHERE application = ' . $sApp;
        $row_a = SQL_OneRow($tsql);
        $tsql = 'SELECT * from webpaths ' . ' WHERE webpath = ' . SQLFC($row_a['webpath']);
        $row_n = SQL_OneRow($tsql);
        $dirws = AddSlash(trim($row_n["dir_pub"]));
        //if (substr($dirws,-1,1)<>"/") $dirws.="/";
        //$row["webserver_dir_pub"] = $dirws;
        $string = '<?php
// To run this program from the command line, you must
// be logged in as a user that has superuser priveleges, such
// as root or postgres.  When running from the web app,
// the current user\'s priveleges are used.

$GLOBALS["parm"] = array(
   "DBSERVER_URL"=>"localhost"
   ,"UID"=>"' . SessionGet('UID') . '"
   ,"DIR_PUBLIC"=>"' . $dirws . '"
   ,"DIR_PUBLIC_APP"=>"' . $hApp . '_' . $hInst . '"
   ,"DIR_LINK_LIB"=>"' . $DIR_LINK_LIB . '"
   ,"DIR_LINK_APP"=>"' . $DIR_LINK_APP . '"
   ,"APP"=>"' . $hApp . '_' . $hInst . '"
   ,"INST"=>"' . $hInst . '"
   ,"IVER"=>"' . $hVer . '"
   ,"XDIRS"=>"' . trim($row_a['xdirs']) . '"
   ,"FLAG_PWMD5"=>"' . ArraySafe($row_a, 'flag_pwmd5', 'N') . '"
   ,"ROLE_LOGIN"=>"' . ArraySafe($row_a, 'flag_rolelogin', 'Y') . '"
   ,"TEMPLATE"=>"' . $row['template'] . '"
   ,"APPDSC"=>"' . trim($row_a["description"]) . '"
   ,"SPEC_BOOT"=>"' . trim($row_a["appspec_boot"]) . '"
   ,"SPEC_LIB"=>"' . trim($row_a["appspec_lib"]) . '"
   ,"SPEC_LIST"=>"' . trim($row_a["appspec"]) . '"
);
   
include("androBuild.php");  
?>
   ';
        $t = pathinfo(__FILE__);
        $dircur = AddSlash($t["dirname"]) . "../tmp/";
        //$dircur = $t["dirname"];
        if (substr($dircur, -1) != "/") {
            $dircur .= "/";
        }
        $file = $dircur . "do-{$hApp}-{$hInst}.php";
        $FILE = fopen($file, "w");
        fwrite($FILE, $string);
        fclose($FILE);
        include $file;
        if (ArraySafe($GLOBALS, 'retval', 0) == 1) {
            SQL("update instances set version={$sVer}\n               WHERE application = {$sApp}\n                 AND instance    = {$sInst}");
        }
        echo ob_get_clean();
    }