예제 #1
0
','addCity','row='+rowNumber+'&city='+encodeURIComponent(newCity.value)+'&country='+encodeURIComponent(country.value));
	rowNumber++;
	newCity.value='';
	//Refresh the city's dropdown
	attachFunctionEventOnChange(document.getElementById('form[USR_CITY]'),null);
	attachFunctionEventOnChange(document.getElementById('form[USR_COUNTRY]'),null);
	document.getElementById('form[USR_COUNTRY]').onchange();
	attachFunctionEventOnChange(document.getElementById('form[USR_CITY]'),changeRegion);
	attachFunctionEventOnChange(document.getElementById('form[USR_COUNTRY]'),changeRegion);
}
function deleteCity(locat)
{
	var lr = document.getElementById('DIV_LOCATIONS');
	var country=document.getElementById('form[USR_COUNTRY]');
	lr.innerHTML=ajax_function('<?php 
echo G::encryptLink('cityAjax.php');
?>
','delCity','row='+rowNumber+'&uid='+encodeURIComponent(locat)+'&country='+encodeURIComponent(country.value));
	rowNumber--;
	//Refresh the city's dropdown
	attachFunctionEventOnChange(document.getElementById('form[USR_CITY]'),null);
	attachFunctionEventOnChange(document.getElementById('form[USR_COUNTRY]'),null);
	document.getElementById('form[USR_COUNTRY]').onchange();
	attachFunctionEventOnChange(document.getElementById('form[USR_CITY]'),changeRegion);
	attachFunctionEventOnChange(document.getElementById('form[USR_COUNTRY]'),changeRegion);
}
function ajax_function(ajax_server, funcion, parameters)
{
    objetus = get_xmlhttp();
    var response;
    try
예제 #2
0
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 * 
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * 
 * For more information, contact Colosa Inc, 2566 Le Jeune Rd., 
 * Coral Gables, FL, 33134, USA, or email info@colosa.com.
 * 
 */
global $HTTP_SESSION_VARS;
global $G_FORM;
$path = '';
$showFieldAjax = 'showFieldAjax.php';
$serverAjax = G::encryptLink($path . $showFieldAjax);
?>
<script language="JavaScript">
function RefreshDependentFields(ObjectName, Fields, InitValue) { 

<?php 
//global $G_FORM;
$HTTP_SESSION_VARS['INIT_VALUES'] = $G_FORM->Values;
global $HTTP_GET_VARS;
if ($HTTP_SESSION_VARS['CURRENT_APPLICATION'] == '') {
    $HTTP_SESSION_VARS['CURRENT_APPLICATION'] = '0';
}
$appid = $HTTP_SESSION_VARS['CURRENT_APPLICATION'];
if ($HTTP_GET_VARS['dynaform'] != '') {
    $Dynaform = '&__dynaform__=' . $HTTP_GET_VARS['dynaform'];
}
예제 #3
0
 /**
  * to make an array for template
  *
  * @author Fernando Ontiveros Lira <*****@*****.**>
  * @access public
  * @param string $G_MAIN_MENU
  * @param string $classOn
  * @param string $classOff
  * @param string $G_MENU_SELECTED
  * @param string $G_ID_MENU_SELECTED
  * @return array
  */
 function generateArrayForTemplate($G_MAIN_MENU, $classOn, $classOff, $G_MENU_SELECTED, $G_ID_MENU_SELECTED)
 {
     $menus = array();
     if ($G_MAIN_MENU == null) {
         return $menus;
     }
     $this->Load($G_MAIN_MENU);
     $this->optionOn = $G_MENU_SELECTED;
     $this->id_optionOn = $G_ID_MENU_SELECTED;
     //$this->Class = $G_MENU_CLASS;
     if (is_array($this->Options)) {
         for ($ncount = 0; $ncount < $this->OptionCount(); $ncount++) {
             $target = $this->Options[$ncount];
             //$aux = $this->Icons[$ncount];
             $aux = $this->JS[$ncount];
             if ($this->Types[$ncount] == 'absolute') {
                 //$target = G::encryptLink(str_replace('sys' . SYS_TEMP, SYS_TEMP, $this->Options[$ncount]));
                 $target = $this->Options[$ncount];
             }
             if ($this->Types[$ncount] != 'absolute') {
                 if (defined('SYS_SYS')) {
                     $target = '/sys' . SYS_TEMP . G::encryptLink('/' . SYS_LANG . '/' . SYS_SKIN . '/' . $this->Options[$ncount]);
                 } else {
                     $target = '/sys/' . G::encryptLink(SYS_LANG . '/' . SYS_SKIN . '/' . $this->Options[$ncount]);
                 }
             }
             $label = $this->Labels[$ncount];
             if ($this->id_optionOn != '') {
                 $onMenu = $this->Id[$ncount] == $this->id_optionOn ? true : false;
             } else {
                 $onMenu = $ncount == $this->optionOn ? true : false;
             }
             $classname = $onMenu ? $classOn : $classOff;
             $imageLeft = $onMenu ? "<img src=\"/images/bulletSubMenu.jpg\" />" : '';
             $onclick = '';
             if ($this->JS[$ncount] !== '') {
                 $onclick = " onclick=\"" . $this->JS[$ncount] . "\"";
             }
             $icon = '';
             if ($this->Icons[$ncount] !== '') {
                 $icon = " <a href=\"#\" onclick=\"" . $this->JS[$ncount] . "\" class=\"{$classname}\">" . "<img src=\"" . $this->Icons[$ncount] . "\" border=\"0\"/></a>";
                 $icon = $this->Icons[$ncount];
             }
             if ($this->Classes[$ncount] != '') {
                 $classname = $this->Classes[$ncount];
                 $target = "#";
             }
             $idName = $this->Id[$ncount];
             $elementclass = '';
             if ($this->ElementClass[$ncount] != '') {
                 $elementclass = 'class="' . $this->ElementClass[$ncount] . '"';
             }
             $menus[] = array('id' => $ncount, 'target' => $target, 'label' => $label, 'onMenu' => $onMenu, 'classname' => $classname, 'imageLeft' => $imageLeft, 'onclick' => $onclick, 'icon' => $icon, 'aux' => $aux, 'idName' => $idName, 'elementclass' => $elementclass);
         }
     }
     return $menus;
 }
 /**
  * Function setupFromXmlform
  *
  * @author David S. Callizaya S. <*****@*****.**>
  * editedby Hugo Loza <*****@*****.**>
  * @access public
  * @param eter string xmlForm
  * @return string
  */
 public function setupFromXmlform($xmlForm)
 {
     $this->xmlForm = $xmlForm;
     //Config
     $this->name = $xmlForm->name;
     $this->id = $xmlForm->id;
     //$this->sqlConnection=((isset($this->xmlForm->sqlConnection))?$this->xmlForm->sqlConnection:'');
     if (isset($_GET['page'])) {
         $this->currentPage = $_GET['page'];
     } else {
         $this->currentPage = 1;
     }
     if (isset($_GET['order'])) {
         $this->orderBy = urldecode($_GET['order']);
     } else {
         $this->orderBy = "";
     }
     if (isset($_GET['filter'])) {
         $this->filter = urldecode($_GET['filter']);
     } else {
         $this->filter = "";
     }
     if ($xmlForm->ajaxServer != '') {
         $this->ajaxServer = G::encryptLink($xmlForm->ajaxServer);
     } else {
         $this->ajaxServer = G::encryptLink('../gulliver/propelTableAjax');
     }
     $this->ownerPage = G::encryptLink(SYS_CURRENT_URI);
     // Config attributes from XMLFORM file
     $myAttributes = get_class_vars(get_class($this));
     foreach ($this->xmlForm->xmlform->tree->attribute as $atrib => $value) {
         if (array_key_exists($atrib, $myAttributes)) {
             eval('settype($value, gettype($this->' . $atrib . '));');
             if ($value !== '') {
                 eval('$this->' . $atrib . '=$value;');
             }
         }
     }
     if ($this->masterdetail != "") {
         $this->masterdetail = explode(",", $this->masterdetail);
         foreach ($this->masterdetail as $keyMasterDetail => $valueMasterDetail) {
             $this->masterdetail[$keyMasterDetail] = trim($valueMasterDetail);
         }
     } else {
         $this->masterdetail = array();
     }
     //Prepare the fields
     $this->style = array();
     $this->gridWidth = "";
     $this->gridFields = "";
     $this->fieldsType = array();
     foreach ($this->xmlForm->fields as $f => $v) {
         $r = $f;
         $this->fields[$r]['Name'] = $this->xmlForm->fields[$f]->name;
         $this->fields[$r]['Type'] = $this->xmlForm->fields[$f]->type;
         if (isset($this->xmlForm->fields[$f]->size)) {
             $this->fields[$r]['Size'] = $this->xmlForm->fields[$f]->size;
         }
         $this->fields[$r]['Label'] = $this->xmlForm->fields[$f]->label;
     }
     //Set the default settings
     $this->defaultStyle();
     //continue with the setup
     $this->gridWidth = '';
     $this->gridFields = '';
     foreach ($this->xmlForm->fields as $f => $v) {
         $r = $f;
         //Parse the column properties
         foreach ($this->xmlForm->fields[$f] as $attribute => $value) {
             if (!is_object($value)) {
                 $this->style[$r][$attribute] = $value;
             }
         }
         //Needed for javascript
         //only the visible columns's width and name are stored
         if ($this->style[$r]['showInTable'] != '0') {
             $this->gridWidth .= ',' . $this->style[$r]['colWidth'];
             $this->gridFields .= ',"form[' . $this->fields[$r]['Name'] . ']"';
         }
     }
     $totalWidth = 0;
     foreach ($this->fields as $r => $rval) {
         if ($this->style[$r]['showInTable'] != '0') {
             $totalWidth += $this->style[$r]['colWidth'];
         }
     }
     $this->totalWidth = $totalWidth;
 }
예제 #5
0
	else
		msg=obj;
	alert(msg);
}
function on_submit(myForm)
{
	days='';values='';
	for(cbi in myForm.elements)
	if (cbi.substr(0,4)=='form')
	{
		cb=myForm.elements[cbi];
		days+=','+cb.id;
		values+=','+cb.checked;
	}
	ajax_function('<?php 
echo G::encryptLink('weekendAjax.php');
?>
','setDays','days='+days+'&values='+values);
	document.location.reload(true);
}
function ajax_function(ajax_server, funcion, parameters)
{
    objetus = get_xmlhttp();    
    var response;
    try
    {
    	if (parameters) parameters = '&' + encodeURI(parameters);
    	objetus.open("GET", ajax_server + "?function=" + funcion + parameters, false); 
  	}catch(ss)
  	{  	
  		alert("error"+ss.message);
예제 #6
0
 /**
  * Function setupFromXmlform
  * @author David S. Callizaya S. <*****@*****.**>
  * @access public
  * @param string xmlForm
  * @return string
  */
 function setupFromXmlform($xmlForm)
 {
     $this->xmlForm = $xmlForm;
     //Config
     $this->name = $xmlForm->name;
     $this->id = $xmlForm->id;
     $this->sqlConnection = isset($this->xmlForm->sqlConnection) ? $this->xmlForm->sqlConnection : '';
     if (isset($_GET['page'])) {
         $this->currentPage = $_GET['page'];
     } else {
         $this->currentPage = 1;
     }
     if (isset($_GET['order'])) {
         $this->orderBy = urldecode($_GET['order']);
     } else {
         $this->orderBy = "";
     }
     if (isset($_GET['filter'])) {
         $this->filter = urldecode($_GET['filter']);
     } else {
         $this->filter = "";
     }
     $this->ajaxServer = G::encryptLink('../gulliver/pagedTableAjax');
     $this->ownerPage = G::encryptLink(SYS_CURRENT_URI);
     //Needed for $mysql_real_escape_string
     $auxDbc = new DBConnection();
     if (isset($this->xmlForm->sql)) {
         $this->sqlSelect = G::replaceDataField($this->xmlForm->sql, $this->xmlForm->values);
     } else {
         trigger_Error('Warning: sql query is empty', E_USER_WARNING);
     }
     // Config attributes from XMLFORM file
     $myAttributes = get_class_vars(get_class($this));
     foreach ($this->xmlForm->xmlform->tree->attribute as $atrib => $value) {
         if (array_key_exists($atrib, $myAttributes)) {
             eval('settype($value,gettype($this->' . $atrib . '));');
             if ($value !== '') {
                 eval('$this->' . $atrib . '=$value;');
             }
         }
     }
     //Prepare the fields
     $this->style = array();
     $this->gridWidth = "";
     $this->gridFields = "";
     $this->fieldsType = array();
     foreach ($this->xmlForm->fields as $f => $v) {
         $r = $f;
         $this->fields[$r]['Name'] = $this->xmlForm->fields[$f]->name;
         $this->fields[$r]['Type'] = $this->xmlForm->fields[$f]->type;
         if (isset($this->xmlForm->fields[$f]->size)) {
             $this->fields[$r]['Size'] = $this->xmlForm->fields[$f]->size;
         }
         $this->fields[$r]['Label'] = $this->xmlForm->fields[$f]->label;
     }
     //Autocomplete the sql queries
     // Here we can to distribute the component of the query like: Select, Where, Group by and order by
     $this->analizeSql();
     //Set the default settings
     $this->defaultStyle();
     //continue whith the setup
     $this->gridWidth = '';
     $this->gridFields = '';
     foreach ($this->xmlForm->fields as $f => $v) {
         $r = $f;
         //Parse the column properties
         foreach ($this->xmlForm->fields[$f] as $attribute => $value) {
             if (!is_object($value)) {
                 $this->style[$r][$attribute] = $value;
             }
         }
         //Needed for javascript
         //only the visible columns's width and name are stored
         if ($this->style[$r]['showInTable'] != '0') {
             $this->gridWidth .= ',' . $this->style[$r]['colWidth'];
             $this->gridFields .= ',"form[' . $this->fields[$r]['Name'] . ']"';
         }
     }
     $totalWidth = 0;
     foreach ($this->fields as $r => $rval) {
         if ($this->style[$r]['showInTable'] != '0') {
             $totalWidth += $this->style[$r]['colWidth'];
         }
     }
     $this->totalWidth = $totalWidth;
 }