function form_location() {
     if (func_num_args()) {
         $arg_list = func_get_args();
         $menu_id = $arg_list[0];
         $post_vars = $arg_list[1];
         $get_vars = $arg_list[2];
         $validuser = $arg_list[3];
         $isadmin = $arg_list[4];
         if ($get_vars["location_id"]) {
             $sql = "select location_id, location_name ".
                    "from location where location_id = '".$get_vars["location_id"]."'";
             if ($result = mysql_query($sql)) {
                 if (mysql_num_rows($result)) {
                     $location = mysql_fetch_array($result);
                 }
             }
         }
     }
     $form = new GForm;
     $form->setWidth(300);
     $form->setFormLayout(0,5);
     $form->setMethod('post');
     $form->setFormBorder('dashed', '#A0A0A0');
     $form->setAction($_SERVER["SELF"]."?page=ADMIN&method=LOC");
     $form->setName('form_location');
     $form->addHeader("<span class='admin'>".FTITLE_USERLOCATION_FORM."</span><br>",'normal','#FFFFFF');
     $form->addBoxedText("<b>INSTRUCTIONS:</b> Users can be assigned to different locations and be given permission to access menu items assigned to those locations. ".
           "You can create those locations here and give them permissions in <b>MODULE-&gt;Menu By Location</b>.","");
     $text_locationid = new GForm_TextBox;
     $text_locationid->setName('location_id');
     $text_locationid->setWidth(10);
     $text_locationid->setLabel('<b>'.LBL_LOCATION_ID.'</b>','','top');
     $text_locationid->setValue(($location["location_id"]?$location["location_id"]:$post_vars["location_id"]));
     $form->addElement($text_locationid->widget());
     $text_locationname = new GForm_TextBox;
     $text_locationname->setName('location_name');
     $text_locationname->setWidth(30);
     $text_locationname->setLabel('<b>'.LBL_LOCATION_NAME.'</b>','','top');
     $text_locationname->setValue(($location["location_name"]?$location["location_name"]:$post_vars["location_name"]));
     $form->addElement($text_locationname->widget());
     $form->addBreak();
     if ($get_vars["location_id"]) {
         $hidden_locationid = new GForm_HiddenVariable;
         $hidden_locationid->setName('location_id');
         $hidden_locationid->setText($get_vars["location_id"]);
         $form->addElement($hidden_locationid->widget());
         if ($_SESSION["priv_update"]) {
             $button_update = new GForm_Button;
             $button_update->setName('submitlocation');
             $button_update->setText('Update Location');
         }
         if ($_SESSION["priv_delete"]) {
             $button_delete = new GForm_Button;
             $button_delete->setName('submitlocation');
             $button_delete->setText('Delete Location');
         }
         $form->addGroupedElements($button_update->widget(), $button_delete->widget());
     } else {
         if ($_SESSION["priv_add"]) {
             $button_add = new GForm_Button;
             $button_add->setName('submitlocation');
             $button_add->setText('Add Location');
         }
         $form->addElement($button_add->widget());
     }
     $form->display();
     /*
     print "<table width='300'>";
     print "<tr valign='top'><td>";
     print "<span class='admin'>USER LOCATION FORM</span><br><br>";
     print "</td></tr>";
     print "<tr valign='top'><td>";
     print "<b>INSTRUCTIONS:</b> Users can be assigned to different locations and be given permission to access menu items assigned to those locations. ".
           "You can create those locations here and given them permissions in <b>MODULE-&gt;Menu By Location</b>.<br><br>";
     print "</td></tr>";
     print "<form action = '".$_SERVER["SELF"]."?page=ADMIN&method=LOC' name='form_location' method='post'>";
     print "<tr valign='top'><td>";
     print "<span class='boxtitle'>LOCATION ID</span><br> ";
     print "<input type='text' size='10' maxlength='10' class='textbox' name='location_id' value='".($location["location_id"]?$location["location_id"]:$post_vars["location_id"])."' style='border: 1px solid #000000'><br>";
     print "</td></tr>";
     print "<tr valign='top'><td>";
     print "<span class='boxtitle'>LOCATION NAME</span><br> ";
     print "<input type='text' maxlength='30' class='textbox' name='location_name' value='".($location["location_name"]?$location["location_name"]:$post_vars["location_name"])."' style='border: 1px solid #000000'> <br>";
     print "</td></tr>";
     print "<tr><td><br>";
     if ($get_vars["role_id"]) {
         print "<input type='hidden' name='location_id' value='".$get_vars["location_id"]."'>";
         if ($_SESSION["priv_update"]) {
             print "<input type='submit' value = 'Update Location' class='textbox' name='submitlocation' style='border: 1px solid #000000'> ";
         }
         if ($_SESSION["priv_delete"]) {
             print "<input type='submit' value = 'Delete Location' class='textbox' name='submitlocation' style='border: 1px solid #000000'> ";
         }
     } else {
         if ($_SESSION["priv_add"]) {
             print "<input type='submit' value = 'Add Location' class='textbox' name='submitlocation' style='border: 1px solid #000000'> ";
         }
     }
     print "</td></tr>";
     print "</form>";
     print "</table><br>";
     */
 }