function buildControl($value, $mode, $fieldNum, $validate, $additionalCtrlParams, $data)
 {
     parent::buildControl($value, $mode, $fieldNum, $validate, $additionalCtrlParams, $data);
     $nWidth = $this->pageObject->pSetEdit->getNCols($this->field);
     $nHeight = $this->pageObject->pSetEdit->getNRows($this->field);
     if ($this->pageObject->pSetEdit->isUseRTE($this->field)) {
         $value = $this->RTESafe($value);
         // creating src url
         $browser = "";
         if (@$_REQUEST["browser"] == "ie") {
             $browser = "&browser=ie";
         }
         // add JS code
         echo "<iframe frameborder=\"0\" vspace=\"0\" hspace=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" id=\"" . $this->cfield . "\" " . (($mode == MODE_INLINE_EDIT || $mode == MODE_INLINE_ADD) && $this->is508 == true ? "alt=\"" . $this->strLabel . "\" " : "") . "name=\"" . $this->cfield . "\" title=\"Basic rich text editor\" style='";
         if (!isMobile()) {
             echo "width: " . ($nWidth + 1) . "px;";
         }
         echo "height: " . ($nHeight + 100) . "px;'";
         echo " src=\"" . GetTableLink("rte", "", "ptype=" . $this->pageObject->pageType . "&table=" . GetTableURL($this->pageObject->tName) . "&" . "id=" . $this->id . "&" . $this->iquery . $browser . "&" . ($mode == MODE_ADD || $mode == MODE_INLINE_ADD ? "action=add" : '')) . "\">";
         echo "</iframe>";
     } else {
         echo '<textarea id="' . $this->cfield . '" ' . (($mode == MODE_INLINE_EDIT || $mode == MODE_INLINE_ADD) && $this->is508 == true ? 'alt="' . $this->strLabel . '" ' : '') . 'name="' . $this->cfield . '" style="';
         if (!isMobile()) {
             echo "width: " . $nWidth . "px;";
         }
         echo 'height: ' . $nHeight . 'px;">' . runner_htmlspecialchars($value) . '</textarea>';
     }
     $this->buildControlEnd($validate);
 }
Example #2
0
 function FBgetLoginUrl($params = array())
 {
     $url = "http://";
     if ($_SERVER["HTTPS"] && $_SERVER["HTTPS"] != "off") {
         $url = "https://";
     }
     $url .= $_SERVER["HTTP_HOST"] . substr($_SERVER['REQUEST_URI'], 0, strrpos($_SERVER['REQUEST_URI'], '/') + 1) . GetTableLink("login");
     return $this->fbObj->getLoginUrl(array('display' => 'popup', 'redirect_uri' => $url));
 }
    public function showDBValue(&$data, $keylink)
    {
        $value = "";
        if (@$data[$this->field] != NULL && $this->container->pageType != PAGE_PRINT) {
            $videoId = 'video_' . GoodFieldName(runner_htmlspecialchars($this->field)) . '_';
            $videoId .= $this->getContainer()->id . "_";
            if ($this->getContainer()->pageType != PAGE_ADD) {
                $videoId .= $this->getContainer()->recId;
            } else {
                $videoId .= postvalue("id");
            }
            $type = 'video/mp4';
            $fileName = 'file.mp4';
            $fileNameF = $this->getContainer()->pSet->getFilenameField($this->field);
            if ($fileNameF) {
                $fileName = $data[$fileNameF];
                if (!$fileName) {
                    $fileName = 'file.mp4';
                } else {
                    $type = getContentTypeByExtension(substr($fileName, strrpos($fileName, '.')));
                }
            }
            $href = GetTableLink("mfhandler", "", "filename=" . $fileName . "&table=" . rawurlencode($this->getContainer()->pSet->_table) . "&field=" . rawurlencode($this->field) . "&pageType=" . $this->getContainer()->pageType . $keylink);
            $vWidth = $this->getContainer()->pSet->getVideoWidth($this->field);
            $vHeight = $this->getContainer()->pSet->getVideoHeight($this->field);
            if ($vWidth == 0) {
                $vWidth = 300;
            }
            if ($vHeight == 0) {
                $vHeight = 200;
            }
            $value .= '
				<div style="width:' . $vWidth . 'px; height:' . $vHeight . 'px;">
				<video class="projekktor" width="' . $vWidth . '" height="' . $vHeight . '" id="' . $videoId . '" type="' . $type . '" src="' . $href . '" >
				</video></div>';
            if ($this->pageObject != null) {
                $this->pageObject->controlsMap['video'][] = $videoId;
            }
        } else {
            $fileNameF = $this->getContainer()->pSet->getFilenameField($this->field);
            if ($fileNameF) {
                $fileName = $data[$fileNameF];
                if (!$fileName) {
                    $value = $fileName;
                }
            }
        }
        return $value;
    }
 public function showDBValue(&$data, $keylink)
 {
     $value = "";
     $fileNameF = $this->container->pSet->getFilenameField($this->field);
     if ($fileNameF) {
         $fileName = $data[$fileNameF];
         if (!$fileName) {
             $fileName = "file.bin";
         }
     } else {
         $fileName = "file.bin";
     }
     if (strlen($data[$this->field])) {
         $value = "<a href='" . GetTableLink("getfile", "", "table=" . GetTableURL($this->container->pSet->_table) . "&filename=" . rawurlencode($fileName) . "&field=" . rawurlencode($this->field) . $keylink) . "'>";
         $value .= runner_htmlspecialchars($fileName);
         $value .= "</a>";
     }
     return $value;
 }
 public function showDBValue(&$data, $keylink)
 {
     $value = "";
     $title = "";
     $titleField = $this->container->pSet->getAudioTitleField($this->field);
     if ($titleField) {
         $title = runner_htmlspecialchars($data[$titleField]);
     }
     if (@$data[$this->field] != NULL && $this->container->pageType != PAGE_PRINT) {
         if (!$title) {
             $title = "Track.mp3";
         }
         $href = GetTableLink('getfile', '', 'table=' . GetTableURL($this->container->pSet->_table) . '&field=' . rawurlencode($this->field) . $keylink . '&filename=' . $title);
         $link = '<a title="' . $title . '" href="' . $href . '">' . $title . '</a>';
         $value = '<audio controls preload="none" src="' . $href . '">' . $link . '</audio>';
     } else {
         $value = $title;
     }
     return $value;
 }
 public function showDBValue(&$data, $keylink)
 {
     if (!$data[$this->field]) {
         return "";
     }
     $value = "";
     $fileName = 'file.jpg';
     $fileNameF = $this->container->pSet->getFilenameField($this->field);
     if ($fileNameF && $data[$fileNameF]) {
         $fileName = $data[$fileNameF];
     }
     if ($this->showThumbnails) {
         $thumbPref = $this->container->pSet->getStrThumbnail($this->field);
         $hrefBegin = GetTableLink("mfhandler", "", "filename=" . $fileName . "&table=" . rawurlencode($this->container->pSet->_table));
         $hrefEnd = "&nodisp=1&pageType=" . $this->container->pageType . $keylink . "&rndVal=" . rand(0, 32768);
         $linkClass = "zoombox";
         if ($this->thumbWidth && $this->thumbHeight) {
             $hasThumbnail = $thumbPref != "" && strlen($data[$thumbPref]);
             $thumbFileUrl = $hrefBegin . "&field=" . ($hasThumbnail ? rawurlencode($thumbPref) : rawurlencode($this->field)) . $hrefEnd;
             $smallThumbnailStyle = $this->getSmallThumbnailStyle($thumbFileUrl, $hasThumbnail);
             $linkClass .= " background-picture";
         }
         $value .= "<a target=_blank href='" . $hrefBegin . "&field=" . rawurlencode($this->field) . $hrefEnd . "' class='" . $linkClass . "' " . $smallThumbnailStyle . ">";
         $value .= "<img border=0";
         if ($this->is508) {
             $value .= " alt=\"Image from DB\"";
         }
         $value .= " src='" . $hrefBegin . "&field=" . rawurlencode($thumbPref) . $hrefEnd . "'>";
         $value .= "</a>";
     } else {
         $value = "<img";
         if ($this->is508) {
             $value .= " alt=\"Image from DB\"";
         }
         $value .= " border=0";
         $value .= $this->getImageSizeStyle(true) . " src='" . GetTableLink("mfhandler", "", "filename=" . $fileName . "&table=" . rawurlencode($this->container->pSet->_table) . "&field=" . rawurlencode($this->field) . "&nodisp=1" . "&pageType=" . $this->container->pageType . $keylink . "&rndVal=" . rand(0, 32768)) . "'>";
     }
     return $value;
 }
$jscode.="ShowHideControls();";
$body["end"]='<script type="text/javascript">'.$jscode.'</script>';
$xt->assignbyref("body",$body);

$contents_block=array();
$contents_block["begin"]='<form method="POST" ';
if(postvalue('rname'))
{
	$crossAttr="";
	if(postvalue("axis_x")<>"")
		$crossAttr = "&axis_x=".postvalue("axis_x")."&axis_y=".postvalue("axis_y")."&field=".postvalue("field")."&group_func=".postvalue("group_func");
	$contents_block["begin"].='action="'.GetTableLink("dreport").'?rname='.runner_htmlspecialchars(rawurlencode(postvalue("rname"))).$crossAttr.'" ';
}	
elseif (postvalue('cname'))
{
	$contents_block["begin"].='action="'.GetTableLink("dchart").'?cname='.runner_htmlspecialchars(rawurlencode(postvalue("cname"))).'" ';
}	
$contents_block["begin"] .= 'name="editform"><input type="hidden" id="a" name="a" value="advsearch">';
$contents_block["end"] = '</form>';
$xt->assignbyref("contents_block",$contents_block);

$xt->assign("searchbutton_attrs", 'name="SearchButton" onclick="document.forms.editform.submit();"');
$xt->assign("resetbutton_attrs", 'onclick="return ResetControls();"');
$xt->assign("backbutton_attrs", "onclick=\"document.forms.editform.a.value='return'; document.forms.editform.submit();\"");
$xt->assign("conditions_block",true);
$xt->assign("search_button",true);
$xt->assign("reset_button",true);
$xt->assign("back_button",true);
$xt->assign("wr_pagestylepath", $wr_pagestylepath);

$xt->assign("dynamic", "true");
Example #8
0
 $strLabel = GetFieldLabel("DashboardUsers", "email");
 $message .= $strLabel . ": " . $values["email"] . "\r\n";
 $strLabel = GetFieldLabel("DashboardUsers", "active");
 $message .= $strLabel . ": " . $values["active"] . "\r\n";
 $strLabel = GetFieldLabel("DashboardUsers", "fullname");
 $message .= $strLabel . ": " . $values["fullname"] . "\r\n";
 $strLabel = GetFieldLabel("DashboardUsers", "groupid");
 $message .= $strLabel . ": " . $values["groupid"] . "\r\n";
 $sentMailResults = runner_mail(array('to' => "*****@*****.**", 'subject' => "Notification on registering", 'body' => $message));
 if (!count($sentMailResults) || $sentMailResults['mailed']) {
     //	show Registartion successful message
     $pageObject->updatePageLayoutAndCSS('', 'success');
     $pageObject->addCommonJs();
     $pageObject->fillSetCntrlMaps();
     $pageObject->addButtonHandlers();
     $pageObject->body["begin"] .= $includes . "<form method=\"POST\" action=\"" . GetTableLink("login") . "\" name=\"loginform\">\n\t\t\t<input type=\"Hidden\" name=username value=\"" . runner_htmlspecialchars($strUsername) . "\">" . "<input type=\"Hidden\" name=password value=\"" . runner_htmlspecialchars($strPassword) . "\"></form>";
     $pageObject->body["end"] .= "<script>";
     $pageObject->body['end'] .= "window.controlsMap = " . my_json_encode($pageObject->controlsHTMLMap) . ";";
     $pageObject->body['end'] .= "window.viewControlsMap = " . my_json_encode($pageObject->viewControlsHTMLMap) . ";";
     $pageObject->body['end'] .= "window.settings = " . my_json_encode($pageObject->jsSettings) . ";</script>";
     $pageObject->body['end'] .= "<script language=\"JavaScript\" src=\"" . GetRootPathForResources("include/runnerJS/RunnerAll.js") . "\"></script>\r\n";
     $pageObject->body["end"] .= "<script>" . $pageObject->PrepareJS() . "</script>";
     $xt->assign("registered_block", true);
     $xt->assign("body", $pageObject->body);
     $xt->assign("loginlink_attrs", "onclick=\"document.forms.loginform.submit();return false;\" id=\"ProceedToLogin\"");
     if (postvalue("onFly") == 1) {
         $pageObject->templatefile = GetTemplateName("", "register_success");
         $xt->assign("id", $id);
         $xt->assign("footer", false);
         $xt->assign("header", false);
         $xt->assign("body", true);
Example #9
0
 /**
  * Add common assign for simple mode on list page
  */
 function commonAssign()
 {
     parent::commonAssign();
     //search permissions
     $searchPermis = $this->permis[$this->tName]['search'];
     //export permissions
     $exportPermis = $this->permis[$this->tName]['export'];
     $allowRecordControls = false;
     if ($this->permis[$this->tName]['export'] && ($this->pSet->hasExportPage() || $this->pSet->hasPrintPage()) || $this->permis[$this->tName]['delete'] && $this->pSet->hasDelete() || $this->permis[$this->tName]['edit'] && ($this->pSet->hasInlineEdit() || $this->pSet->hasEditPage()) || $this->permis[$this->tName]['add'] && $this->pSet->hasInlineAdd()) {
         $allowRecordControls = true;
     }
     //add edit delete print export links
     $this->xt->assign("record_controls_block", $allowRecordControls);
     // adds style displat none to hiderecord controls, edit selected, delete selected, export selected and print selected if found 0 recs
     $this->xt->assign("details_block", $searchPermis);
     if (!$this->rowsFound) {
         $this->xt->displayBrickHidden("details_found");
         $this->xt->displayBrickHidden("vdetails_found");
     }
     if ($searchPermis && count($this->arrRecsPerPage)) {
         $this->xt->assign("recordspp_block", true);
         $this->createPerPage();
         if (!$this->rowsFound) {
             $this->xt->displayBrickHidden("recsperpage");
             $this->xt->displayBrickHidden("vrecsperpage");
         }
     }
     $this->xt->assign("pages_block", $searchPermis);
     if (!$this->rowsFound) {
         $this->xt->displayBrickHidden("page_of");
         $this->xt->displayBrickHidden("vpage_of");
     }
     $this->xt->assign("pages_attrs", "id=\"pageOf" . $this->id . "\" name=\"pageOf" . $this->id . "\"");
     $this->xt->assign("left_block", true);
     //$this->xt->assign("toplinks_block", true);
     $advSearchPargeFields = $this->pSetEdit->getAdvSearchFields();
     $this->xt->assign("moreButtons", $exportPermis && ($this->pSet->hasExportPage() || $this->pSet->hasPrintPage()) || $this->permis[$this->tName]['import'] && $this->pSet->hasImportPage() || $searchPermis && count($advSearchPargeFields) > 0);
     $this->xt->assign("widhtSelected", $exportPermis || $this->permis[$this->tName]['edit'] || $this->permis[$this->tName]['delete']);
     //export selected link and attr
     $this->xt->assign("exportselected_link", $exportPermis);
     $this->xt->assign("exportselectedlink_span", $this->buttonShowHideStyle());
     $this->xt->assign("exportselectedlink_attrs", $this->getPrintExportLinkAttrs('export'));
     // print links and attrs
     $this->xt->assign("prints_block", $exportPermis && $this->rowsFound);
     $this->xt->assign("print_link", $exportPermis && $this->rowsFound);
     $this->xt->assign("printlink_attrs", "id='print_" . $this->id . "' name='print_" . $this->id . "'");
     //print selected link and attr
     $this->xt->assign("printselected_link", $exportPermis && $this->rowsFound);
     $this->xt->assign("printselectedlink_attrs", $this->getPrintExportLinkAttrs('print'));
     $this->xt->assign("printselectedlink_span", $this->buttonShowHideStyle());
     //print all link and attr
     $this->xt->assign("printall_link", $exportPermis && $this->numRowsFromSQL > $this->pageSize && $this->pageSize > 0);
     $this->xt->assign("printalllink_attrs", "id='printAll_" . $this->id . "' name='printAll_" . $this->id . "'");
     //export link and attr
     $this->xt->assign("export_link", $exportPermis);
     $this->xt->assign("exportlink_attrs", "id = 'export_" . $this->id . "'\n\t\t\t\t\t\t   name = 'export_" . $this->id . "'\n\t\t\t\t\t\t   onclick=\"window.open(this.href,'wExport');return false;\"");
     //add link and attr
     $this->xt->assign("add_link", $this->permis[$this->tName]['add']);
     $this->xt->assign("addlink_attrs", "href='" . GetTableLink($this->shortTableName, "add") . "' id=\"addButton" . $this->id . "\"");
     //advanced search and attr
     $this->xt->assign("advsearchlink_attrs", "id=\"advButton" . $this->id . "\"");
     //select all link and attr
     $this->selectAllLinkAttrs();
     //edit selected link and attr
     $this->editSelectedLinkAttrs();
     //save all link, attr, span
     $this->saveAllLinkAttrs();
     //cansel all link, attr, span
     $this->cancelAllLinkAttrs();
     if ($this->numRowsFromSQL == 0) {
         $this->xt->displayBrickHidden("recordcontrol");
     }
     $this->xt->assign("grid_block", true);
     $this->xt->assign('menu_block', $this->isShowMenu() || $this->isAdminTable());
     $this->xt->assign("languages_block", true);
     if (isMobile()) {
         $this->xt->assign('morelinkmobile_block', true);
         $this->xt->assign('tableinfomobile_block', true);
         $this->xt->displayBrickHidden("vmsearch2");
     }
 }
	
	$pageObject->fillSetCntrlMaps();
}
$xt->assign("style_block",true);
$xt->assign("stylefiles_block",true);

$editlink = "";
$editkeys = array();
	$editkeys["editid1"]=postvalue("editid1");
foreach($editkeys as $key=>$val)
{
	if($editlink)
		$editlink.= "&";
	$editlink.= $key."=".$val;
}
$xt->assign("editlink_attrs","id=\"editLink".$id."\" name=\"editLink".$id."\" onclick=\"window.location.href='".GetTableLink("webreport_users", "edit", $editlink)."'\"");

$strPerm = GetUserPermissions($strTableName);
if(CheckSecurity($ownerIdValue,"Edit") && !$inlineview && strpos($strPerm, "E")!==false)
	$xt->assign("edit_button",true);
else
	$xt->assign("edit_button",false);

if(!$pdf && !$all) 
{
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//Begin show Next Prev button
	$nextlink=$prevlink="";
	if(count($next))
	{
		$xt->assign("next_button", true);
	$create_butt="<a id=\"return_app\" class=\"rnr-button\" onmouseover=\"this.focus();\" name=\"return_app\" href=\"#\">"."Back to main application"."</a>";
	$xt->assign("back_to_app", $create_butt);
}
if($wr_is_standalone && isWRAdmin())	
{
	$create_butt="<a id=\"users_list\" class=\"rnr-button\" onmouseover=\"this.focus();\" name=\"users_list\" href=\"#\">"."Users list"."</a>";
	$xt->assign("users_list_page", $create_butt);
}

if(isLoggedAsGuest())
{
	$strLogin="******"".GetTableLink("login")."\">Log in</A>";
} 
else 
{
	$strLogin="******".$_SESSION["UserID"]."</b>&nbsp;&nbsp;&nbsp;<A class=tablelinks href=\"".GetTableLink("login")."?a=logout\">"."Log out"."</A>";
}


$xt->assign("login_mess",$strLogin);		

if(isWRAdmin() || !count($arr_UserGroups))
{
	$create_butt="<a id=\"admin_sql\" class=\"rnr-button\" onmouseover=\"this.focus();\" name=\"admin_sql\" href=\"#\">"."Custom SQL"."</a>";
	$xt->assign("admin_sql", $create_butt);
}	
else	
	$xt->assign("admin_sql",false);
	
if(count($arr_tables_db) || count($arr_tables_project) || count($arr_tables_custom))	
{                 
Example #12
0
    function buildControl($value, $mode, $fieldNum, $validate, $additionalCtrlParams, $data)
    {
        parent::buildControl($value, $mode, $fieldNum, $validate, $additionalCtrlParams, $data);
        if ($this->pageObject->pageType == PAGE_SEARCH || $this->pageObject->pageType == PAGE_LIST) {
            echo '<input id="' . $this->cfield . '" ' . $this->inputStyle . ' type="text" ' . ($mode == MODE_SEARCH ? 'autocomplete="off" ' : '') . (($mode == MODE_INLINE_EDIT || $mode == MODE_INLINE_ADD) && $this->is508 == true ? 'alt="' . $this->strLabel . '" ' : '') . 'name="' . $this->cfield . '" ' . $this->pageObject->pSetEdit->getEditParams($this->field) . ' value="' . runner_htmlspecialchars($value) . '">';
            $this->buildControlEnd($validate);
            return;
        }
        if ($mode == MODE_SEARCH) {
            $this->format = "";
        }
        $this->formStamp = generatePassword(15);
        $this->initUploadHandler();
        $this->upload_handler->formStamp = $this->formStamp;
        $filesArray = my_json_decode($value);
        if (!is_array($filesArray) || count($filesArray) == 0) {
            if (!$value) {
                $jsonValue = "[]";
            } else {
                $uploadedFile = $this->upload_handler->get_file_object($value);
                if (is_null($uploadedFile)) {
                    $filesArray = array();
                } else {
                    $filesArray = array(my_json_decode(my_json_encode($uploadedFile)));
                }
            }
        }
        if ($this->pageObject->pageType == PAGE_EDIT) {
            if (count($this->pageObject->keys) > 0) {
                $i = 1;
                foreach ($this->pageObject->keys as $keyName => $keyValue) {
                    $this->upload_handler->tkeys .= "&key" . $i . "=" . rawurlencode($keyValue);
                    $i++;
                }
            }
        }
        $_SESSION["mupload_" . $this->formStamp] = array();
        $userFilesArray = array();
        if (is_array($filesArray)) {
            foreach ($filesArray as $file) {
                $sessionArray = array();
                $sessionArray["file"] = $file;
                $sessionArray["fromDB"] = true;
                $sessionArray["deleted"] = false;
                $_SESSION["mupload_" . $this->formStamp][$file["usrName"]] = $sessionArray;
                $userFile = $this->upload_handler->buildUserFile($file);
                if (!$userFile["isImg"]) {
                    $userFile["isImg"] = true;
                    $userFile["isIco"] = true;
                    $userFile["thumbnail_url"] = $userFile["url"] . "&icon=1";
                }
                $userFilesArray[] = $userFile;
            }
        }
        $jsonValue = my_json_encode($userFilesArray);
        echo '
 <!-- The file upload form used as target for the file upload widget -->
    <form id="fileupload_' . $this->cfieldname . '" action="' . GetTableLink("mfhandler") . '" method="POST" enctype="multipart/form-data">
    
    <input type="hidden" name="formStamp_' . $this->cfieldname . '" id="formStamp_' . $this->cfieldname . '" value="' . $this->formStamp . '" />
    <input type="hidden" name="_action" value="POST" />
    <input type="hidden" id="value_' . $this->cfieldname . '" name="value_' . $this->cfieldname . '" value="' . runner_htmlspecialchars($jsonValue) . '" />
    
    <!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
        <div class="row fileupload-buttonbar">
            <div class="span7">
                <!-- The fileinput-button span is used to style the file input field as button -->
 				<SPAN class="btn btn-success fileinput-button">
					<A class="rnr-button filesUpload" href="#" ><input class="fileinput-button-input" type="file" name="files[]" value="' . "Añadir ficheros" . '" multiple />' . "Añadir ficheros" . '</A>
				</SPAN>' . ($this->pageObject->pSetEdit->isAutoUpload($this->field) ? '' : '
                <SPAN class="btn btn-primary start">
				<A class="rnr-button" href="#" >' . "Enviar" . '</A> 
				</SPAN>
				<SPAN class="btn btn-warning cancel">
				<A class="rnr-button" href="#" >' . "Cancelar" . '</A> 
				</SPAN>') . '
                
            </div>
            <!-- The global progress information -->
            <div class="fileupload-progress fade">
                <!-- The global progress bar -->
                <div class="progress progress-success progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100">
                    <div class="bar" style="width:0;"></div>
                </div>
                <!-- The extended global progress information -->
                <div class="progress-extended">&nbsp;</div>
            </div>
        </div>
        <!-- The loading indicator is shown during file processing -->
        <div class="fileupload-loading"></div>
        <!-- The dummy for FireFox -->
        <input type="text" name="focusDummy" class="rnr-focusDummy" />
        <br>
        <!-- The table listing the files available for upload/download -->
        <table><tbody class="files"></tbody></table>
    </form>
    ';
        if (!isset($this->container->globalVals["muploadTemplateIncluded"])) {
            echo '<script type="text/x-tmpl" id="template-download">{% for (var i=0, file; file=o.files[i]; i++) { %}
    <tr class="template-download fade">
        {% if (file.error) { %}
            <td></td>
            <td class="name"><span>{%=file.name%}</span></td>
            <td class="size"><span dir="LTR">{%=o.formatFileSize(file.size)%}</span></td>
            <td class="error" colspan="2"><span class="label label-important">' . "" . '</span> {%=locale.fileupload.errors[file.error] || file.error%}</td>
        {% } else { %}
            <td class="preview">{% if (file.thumbnail_url) { %}
                <a href="{%=file.url%}" title="{%=file.name%}" rel="gallery" download="{%=file.name%}" 
                	{% if (!file.isIco) { %} class="zoombox zgallery" {% } %} 
                	><img src="{%=file.thumbnail_url%}&src=1"></a>
            {% } else { %}
            	{% if (file.isImg) { %}
            		<a href="{%=file.url%}&nodisp=1" title="{%=file.name%}" rel="gallery" download="{%=file.name%}" class="zoombox zgallery"><img src="{%=file.url%}&src=1"></a>
            	{% } %}
            {% } %}</td>
            <td class="name">
                <a href="{%=file.url%}" title="{%=file.name%}" rel="{%=file.thumbnail_url&&\'gallery\'%}" download="{%=file.name%}">{%=file.name%}</a>
            </td>
            <td class="size"><span dir="LTR">{%=o.formatFileSize(file.size)%}</span></td>
            <td colspan="2"></td>
        {% } %}
        <td class="delete">
        	{% if (!file.error) { %}
        	<SPAN class="btn btn-danger delete" data-type="{%=file.delete_type%}" data-url="{%=file.delete_url%}" data-name="{%=file.name%}">
				<A href="#" >' . "Borrar artículos seleccionados" . '</A>
				</SPAN>
			{% } %}
        </td>
    </tr>
{% } %}
</script>
<script type="text/x-tmpl" id="template-upload">{% for (var i=0, file; file=o.files[i]; i++) { %}
    <tr class="template-upload fade">
        <td class="preview"><span class="fade"></span></td>
        <td class="name"><span>{%=file.name%}</span></td>
        <td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
        {% if (file.error) { %}
            <td class="error" colspan="2"><span class="label label-important">' . "" . '</span> {%=locale.fileupload.errors[file.error] || file.error%}</td>
        {% } else if (o.files.valid && !i) { %}
            <td>
                <div class="progress progress-success progress-striped active" role="progressbar" aria-valuemin="0" 
                	aria-valuemax="100" aria-valuenow="0"><div class="bar" style="width:0;"></div></div>
            </td>
            <td class="start">{% if (!o.options.autoUpload) { %}
        	<SPAN class="btn btn-primary">
				<A href="#" >' . "Enviar" . '</A>   
				</SPAN>       
            {% } %}</td>
        {% } else { %}
            <td colspan="2"></td>
        {% } %}
        <td class="cancel">{% if (!i) { %}
        	{% if (!file.error) { %}
        	<SPAN class="btn btn-warning">
				<A href="#" >' . "Cancelar" . '</A>
				</SPAN>
			{% } %}
        {% } %}</td>
    </tr>
{% } %}</script>';
            $this->container->globalVals["muploadTemplateIncluded"] = true;
        }
        $this->buildControlEnd($validate);
    }
Example #13
0
    $xt->assign("password_attrs", ($is508 == true ? " id=\"password\"" : "") . " value=\"" . runner_htmlspecialchars($pPassword) . "\"");
} else {
    $xt->assign("password_attrs", ($is508 == true ? " id=\"password\"" : "") . " value=\"" . runner_htmlspecialchars(refine(@$_COOKIE["password"])) . "\"");
}
if (@$_GET["message"] == "expired") {
    $message = "Your session has expired." . "Please login again.";
}
if (@$_GET["message"] == "invalidlogin") {
    $message = "Invalid Login";
}
if ($message) {
    $xt->assign("message_block", true);
    $xt->assign("message", "<div class='message rnr-error'>" . $message . "</div>");
}
$pageObject->body["begin"] .= GetBaseScriptsForPage(false);
$pageObject->body["begin"] .= "<form method=\"post\" action='" . GetTableLink("login") . "' id=\"form1\" name=\"form1\">\n\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"btnSubmit\" value=\"Login\">";
$pageObject->body["end"] .= "</form>";
$pageObject->addCommonJs();
// button handlers file names
//fill jsSettings and ControlsHTMLMap
$pageObject->fillSetCntrlMaps();
$pageObject->body['end'] .= '<script>';
$pageObject->body['end'] .= "window.controlsMap = " . my_json_encode($pageObject->controlsHTMLMap) . ";";
$pageObject->body['end'] .= "window.viewControlsMap = " . my_json_encode($pageObject->viewControlsHTMLMap) . ";";
$pageObject->body['end'] .= "window.settings = " . my_json_encode($pageObject->jsSettings) . ";</script>";
$pageObject->body["end"] .= "<script type=\"text/javascript\" src=\"" . GetRootPathForResources("include/runnerJS/RunnerAll.js") . "\"></script>";
$pageObject->body["end"] .= '<script>' . $pageObject->PrepareJS() . "</script>";
$pageObject->addButtonHandlers();
$xt->assignbyref("body", $pageObject->body);
$xt->assign("username_label", true);
$xt->assign("password_label", true);
	/**
	 * Assign values for links
	 *
	 * @param link $xt
	 */
	function assignLinks(&$xt) 
	{	
		// assign title between tag a
		$xt->assign("item".$this->id."_title", $this->title);
		// assign common attr
//		$attrForAssign = ' id="itemlink'.$this->id.'" title="'.$this->title.'" '.($this->style ? 'style="'.$this->style.'"' : '');
		$attrForAssign = ' id="itemlink'.$this->id.'" itemtitle="'.$this->title.'" '.($this->style ? 'style="'.$this->style.'"' : '');
		
		// add target blank attr
		if ($this->openType == "NewWindow"){
			//$attrForAssign .= ' target="_blank"';
			$attrForAssign .= ' rel="external"';
		}
		
		// for Internal links
		if ($this->linkType == "Internal")
		{
			if ($this->pageType!="WebReports")
			{
				// add menu id param. Used for setting current menu element
				$menuIdGetParam = '';
				if ($this->pageTypesInMenuForThisTable[$this->pageType]["count"]>1)
					$menuIdGetParam = 'menuItemId='.$this->id;
				if($this->params)
				{
					if($menuIdGetParam)
						$menuIdGetParam .='&'.$this->params;
					else
						$menuIdGetParam .= $this->params;
				}
				
				$attrForAssign .= ' href="'.GetTableLink(GetTableURL($this->table), strtolower($this->pageType), $menuIdGetParam).'"';					
				$xt->assign("item".$this->id."_optionattrs",'value="'.GetTableLink(GetTableURL($this->table), strtolower($this->pageType))
					.'" '.($this->openType == "NewWindow" ? 'link="External"' : ''));
			}
			else
			{
				$attrForAssign .= ' href="'.GetTableLink("webreport").'"';
				$xt->assign("item".$this->id."_optionattrs",' value="'.GetTableLink("webreport").'"');
			}
		// for External links
		}elseif($this->linkType == "External")
		{
			$attrForAssign .= ' href="'.$this->href.'"';
			$xt->assign("item".$this->id."_optionattrs",'value="'.$this->href.'" '.($this->openType == "NewWindow" ? 'link="External"' : ''));	
		}
		$xt->assign("item".$this->id."_menulink_attrs", $attrForAssign);

		
	}
Example #15
0
 /**
  *
  */
 public function doCommonAssignments()
 {
     $this->xt->assign("id", $this->id);
     $this->xt->assign("left_block", true);
     if ($this->crossTable) {
         $this->xt->assign("cross_controls", true);
         $this->body["begin"] .= '<script type="text/javascript" src="' . GetRootPathForResources("include/crosstable.js") . '"></script>';
     }
     $this->body["begin"] .= GetBaseScriptsForPage($this->isDisplayLoading);
     if (!isMobile()) {
         $this->body["begin"] .= "<div id=\"search_suggest\" class=\"search_suggest\"></div>";
     }
     // assign body end in such way, to prevent collisions with flyId increment
     $this->body['end'] = array();
     AssignMethod($this->body['end'], "assignBodyEnd", $this);
     $this->xt->assignbyref('body', $this->body);
     if ($this->isDynamicPerm && IsAdmin()) {
         $this->xt->assign("adminarea_link", true);
         $this->xt->assign("adminarealink_attrs", "id=\"adminArea" . $this->id . "\"");
     }
     $this->xt->assign("changepwd_link", $_SESSION["AccessLevel"] != ACCESS_LEVEL_GUEST && $_SESSION["fromFacebook"] == false);
     $this->xt->assign("changepwdlink_attrs", "onclick=\"window.location.href='" . GetTableLink("changepwd") . "';return false;\"");
     //set the Search panel
     $this->xt->assign("searchPanel", true);
     if ($this->isShowMenu()) {
         $this->xt->assign("menu_block", true);
     }
     if (isMobile()) {
         $this->xt->assign('tableinfomobile_block', true);
     }
     $allow_search = true;
     $allow_export = true;
     $this->xt->assign("toplinks_block", $allow_search);
     $this->xt->assign("asearch_link", $allow_search);
     $this->xt->assign("print_link", $allow_export);
     if (!$this->crossTable) {
         $this->xt->assign("printall_link", $allow_export && $this->arrReport['countRows'] > $this->pageSize && $this->pageSize > 0);
     }
     $this->xt->assign("export_link", $allow_export);
     $this->xt->assign("printlink_attrs", "id=print_" . $this->id . " href='#'");
     $this->xt->assign("printalllink_attrs", "id=printAll_" . $this->id . " href='#'");
     $this->xt->assign("excellink_attrs", "id=export_to_excel" . $this->id . " href='#'");
     $this->xt->assign("wordlink_attrs", "id=export_to_word" . $this->id . " href='#'");
     $this->xt->assign("pdflink_attrs", "id=export_to_pdf" . $this->id . " href='#'");
     $this->xt->assign("prints_block", $allow_export && ($this->crossTable || $this->arrReport['countRows'] > 0));
     $this->xt->assign("advsearchlink_attrs", "id=\"advButton" . $this->id . "\"");
     if (!$this->crossTable && $allow_search && count($this->arrGroupsPerPage)) {
         $this->xt->assign("recordspp_block", true);
         $this->createPerPage();
     }
     $this->xt->assign("grid_block", $allow_search);
 }
Example #16
0
include "include/dbcommon.php";
header("Expires: Thu, 01 Jan 1970 00:00:01 GMT");
include "include/reportfunctions.php";
if (postvalue("name") == "password") {
    if (DecodeUTF8(postvalue("password")) == $WRAdminPagePassword) {
        $_SESSION["WRAdmin"] = true;
        echo "OK";
    } else {
        unset($_SESSION["WRAdmin"]);
        echo "ERROR";
    }
    exit;
}
if (!isWRAdmin()) {
    $_SESSION["MyURL"] = $_SERVER["SCRIPT_NAME"] . "?" . $_SERVER["QUERY_STRING"];
    header("Location: " . GetTableLink("webreport", "", "message=expired"));
    return;
}
// #9875 It's expected that webreport_sql, webreport_admin tables belong to the same db connection
$_connection = $cman->getForWebReports();
if (postvalue("name") == "deletesql") {
    if (postvalue("idsql")) {
        $_connection->exec("delete from " . $_connection->addTableWrappers("webreport_sql") . "  where " . $_connection->addFieldWrappers("id") . "=" . postvalue("idsql"));
    }
    echo "OK";
    exit;
}
if (postvalue("name") == "sqledit") {
    $errstr = "";
    $sqlcontent = postvalue("sqlcontent");
    $_SESSION["object_sql"] = $sqlcontent;
			data: {
				name: "resultsql",
				output: $("#sql_list option:selected").val(),
				rnd: (new Date().getTime())
			},
			success: function(msg)
			{
				$("#a_resultsql").click();
			}
		});
		
	});
	$("#sql_list").change(function(){
		$.ajax({
			type: "POST",
			url: "'.GetTableLink("save-admin").'",
			data: {
				name: "getcustomsql",
				output: $("#sql_list option:selected").val(),
				rnd: (new Date().getTime())
			},
			success: function(msg)
			{
				$("#sql_content").html(msg);
			}
		});
	});';

if(postvalue("name"))
	$b_includes .= '
	$("#sql_list option").each(function(i){
Example #18
0
        Reload_Chart(postvalue("cname"));
    }
}
include 'include/xtempl.php';
$xt = new Xtempl();
$chrt_array = getChartArray(postvalue("cname"));
if (is_wr_project()) {
    include "include/" . $chrt_array['settings']['short_table_name'] . "_variables.php";
}
$show_dchart = '<script type="text/javascript" language="javascript">
	//<![CDATA[
	var chart = new AnyChart("' . GetRootPathForResources("libs/swf/AnyChart.swf") . '", "' . GetRootPathForResources("libs/swf/Preloader.swf") . '");
	chart.width = "780";
	chart.height = "570";

	var xmlFile = "' . GetTableLink("dchartdata", "", 'cname=' . jsreplace(runner_htmlspecialchars(postvalue('cname')))) . '";
	xmlFile += "&ctype=' . $chrt_array['chart_type']['type'] . '";
	chart.setXMLFile(xmlFile);
	chart.write();
	//]]>
</script>';
$load_flash_player = '
<script type="text/javascript">
	var svgSupported = window.SVGAngle != undefined;
		var str="";
		if (!svgSupported)
		{
			str = "<center>";
			str += "' . "" . '<br /><br />";
			str += "<a href=\\"http://www.adobe.com/go/getflashplayer\\"><img border=\\"0\\" src=\\"http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif\\" /></a><br />";
			str += "</center>";		
Example #19
0
 /**
  * Get an 'actions' block for a particular 'point'
  * @param Array data
  */
 function getActions($data)
 {
     if (!count($this->detailTablesData)) {
         return '';
     }
     global $strTableName, $useFlashChartLibrary;
     $delimiter = $useFlashChartLibrary ? '\\n' : '';
     if ($this->dashChart) {
         $masterKeysArr = array();
         foreach ($this->detailTablesData as $detailId => $detail) {
             foreach ($detail['masterKeys'] as $idx => $mk) {
                 $masterKeysArr[$detail['dDataSourceTable']] = array('masterkey' . ($idx + 1) => $data[$mk]);
             }
         }
         if (!$this->dashChartFirstPointSelected) {
             $this->dashChartFirstPointSelected = true;
             $this->detailMasterKeys = my_json_encode($masterKeysArr);
         }
         return '<actions>' . $delimiter . '<action type="call" function="Runner.updateDetailsForDashboardChart">' . $delimiter . '<arg>' . my_json_encode($masterKeysArr) . '</arg>' . $delimiter . '<arg>' . $this->pageId . '</arg>' . $delimiter . '</action>' . $delimiter . '</actions>' . $delimiter;
     } else {
         // The one detail table is allowed for a chart page only
         $detailTableData = $this->detailTablesData[0];
         $masterquery = "mastertable=" . rawurlencode($strTableName);
         foreach ($detailTableData['masterKeys'] as $idx => $mk) {
             $masterquery .= "&masterkey" . ($idx + 1) . "=" . rawurlencode($data[$mk]);
         }
         $url = runner_htmlspecialchars(GetTableLink($detailTableData['dShortTable'], $detailTableData['dType'], $masterquery));
         return '<actions>' . $delimiter . '<action type="navigateToURL" url="' . $url . '" target="_self"/>' . $delimiter . '</actions>' . $delimiter;
     }
 }
Example #20
0
    }
    $data = $qResult->fetchNumeric();
    if (!$data) {
        echo "Invalid validation code.";
        return;
    }
    $dbPassword = $regCipherer->DecryptField("password", $data[0]);
    $usercode = $username . md5($dbPassword);
    if ($code != md5($usercode)) {
        echo "Invalid validation code.";
        return;
    }
    $sql = "update " . $pageObject->connection->addTableWrappers("ConsolidatedStockEnquiry_users") . " set " . $pageObject->connection->addFieldWrappers("active1") . "=1 " . " where " . $pageObject->getFieldSQLDecrypt("username") . "=" . $strUsername;
    $pageObject->connection->exec($sql);
    $pageObject->updatePageLayoutAndCSS('', 'success');
    $pageObject->body["begin"] .= "<form method=\"POST\" action=\"" . GetTableLink("login") . "\" name=\"loginform\">\n\t<input type=\"Hidden\" name=\"username\" value=\"" . runner_htmlspecialchars($username) . "\">";
    $pageObject->body["begin"] .= "<input type=\"Hidden\" name=\"password\" value=\"" . runner_htmlspecialchars($data["password"]) . "\">";
    $pageObject->body["begin"] .= "</form>";
    $xt->assign("body", $pageObject->body);
    $xt->assign("registered_block", true);
    $xt->assign("loginlink_attrs", "onclick=\"document.forms.loginform.submit();return false;\" id=\"ProceedToLogin\"");
    return $pageObject->display(GetTemplateName("", "register_success"));
    // return $pageObject->display for .net compatibility
}
// proccess captcha
if ($isUseCaptcha) {
    $pageObject->doCaptchaCode();
}
if (!$pageObject->isCaptchaOk) {
    $allow_registration = false;
}
Example #21
0
}

$pageObject->body["begin"] .= GetBaseScriptsForPage(false);

$pageObject->body["begin"] .="<script language = JavaScript>
function OnKeyDown()
{
	e = window.event;
	if (e.keyCode == 13)
	{
		e.cancel = true;
		document.forms[0].submit();
	}	
}
</script>
<form method=post action=\"".GetTableLink("remind")."\" id=form1 name=form1>
<input type=hidden name=btnSubmit value=\"Remind\">
<input type=\"Hidden\" name=\"searchby\" value=\"".$strSearchBy."\">";
$pageObject->body["end"] .= "</form>
	<script language=\"JavaScript\">
	".$pageObject->PrepareJS()."
	</script>";

$xt->assignbyref("body",$pageObject->body);

if($globalEvents->exists("BeforeShowRemindPwd"))
	$globalEvents->BeforeShowRemindPwd($xt,$pageObject->templatefile, $pageObject);

// submit on popup page
if (postvalue("onFly") == 2)
{
Example #22
0
 /**
  * Set a successful update message.
  * Add the corresponding edit/view links to the info message
  */
 protected function setSuccessfulUpdateMessage()
 {
     if ($this->mode == ADD_INLINE) {
         $infoMessage = "" . "Record was added" . "";
     } else {
         $infoMessage = "<<< " . "Record was added" . " >>>";
     }
     if ($this->mode != ADD_SIMPLE && $this->mode != ADD_MASTER && $this->mode != ADD_MASTER_POPUP || !count($this->keys)) {
         $this->setMessage($infoMessage);
         return;
     }
     $k = 0;
     $keyParams = array();
     foreach ($this->keys as $idx => $val) {
         $keyParams[] = "editid" . ++$k . "=" . runner_htmlspecialchars(rawurlencode(@$val));
     }
     $keylink = implode("&", $keyParams);
     $infoMessage .= "<br>";
     if ($this->pSet->hasEditPage() && $this->permis[$this->tName]['edit']) {
         $infoMessage .= "&nbsp;<a href='" . GetTableLink($this->pSet->getShortTableName(), "edit", $keylink) . "'>" . "Edit" . "</a>&nbsp;";
     }
     if ($this->pSet->hasViewPage() && $this->permis[$this->tName]['search']) {
         $infoMessage .= "&nbsp;<a href='" . GetTableLink($this->pSet->getShortTableName(), "view", $keylink) . "'>" . "View" . "</a>&nbsp;";
     }
     $this->setMessage($infoMessage);
 }
			URL = "'.GetTableLink("menu").'";
		if ( this.id == "row7" )
			URL = "'.GetTableLink("dreport").'?edit=style&rname='.@$_SESSION['webreports']['settings']['name'].'";
		if (this.id == "backbtn" || this.id == "row10" || this.id == "row11") {
			window.location = URL;
			return;
		}
		
		var output = collect_input_data();

		thisid=this.id;

		if(this.id !="row0") {
			$.ajax({
				type: "POST",
				url: "'.GetTableLink("save-state").'",
				data: {
					name: "tables",
					web: "webreports",
					str_xml: output,
					rnd: (new Date().getTime())
				},
				success: function(msg){
					if ( msg == "OK" ) {
						window.location = URL;
					} else {
						$("#alert").html("<p>"+msg+"</p>").dialog("open");
						if( thisid == "row10" || thisid == "row11")
							window.location=URL;
					}
				}
 function buildControl($value, $mode, $fieldNum, $validate, $additionalCtrlParams, $data)
 {
     parent::buildControl($value, $mode, $fieldNum, $validate, $additionalCtrlParams, $data);
     $disp = "";
     $strfilename = "";
     if ($mode == MODE_EDIT || $mode == MODE_INLINE_EDIT) {
         $value = $this->connection->stripSlashesBinary($value);
         $itype = SupposeImageType($value);
         if ($itype) {
             if ($this->pageObject->pSetEdit->showThumbnail($this->field)) {
                 $disp = "<a target=_blank";
                 $disp .= " href=\"" . GetTableLink("imager", "", "table=" . GetTableURL($this->pageObject->tName) . "&" . $this->iquery . "&rndVal=" . rand(0, 32768)) . "\" class='zoombox'>";
                 $disp .= "<img id=\"image_" . GoodFieldName($this->field) . "_" . $this->id . "\" name=\"" . $this->cfield . "\" border=0";
                 if ($this->is508) {
                     $disp .= " alt=\"Image from DB\"";
                 }
                 $disp .= " src=\"" . GetTableLink("imager", "", "table=" . GetTableURL($this->pageObject->tName) . "&field=" . rawurlencode($this->pageObject->pSetEdit->getStrThumbnail($this->field)) . "&alt=" . rawurlencode($this->field) . $this->keylink . "&rndVal=" . rand(0, 32768)) . "\">";
                 $disp .= "</a>";
             } else {
                 $disp = '<img id="image_' . GoodFieldName($this->field) . '_' . $this->id . '" name="' . $this->cfield . '"';
                 if ($this->is508) {
                     $disp .= ' alt="Image from DB"';
                 }
                 $disp .= ' border=0 src="' . GetTableLink("imager", "", 'table=' . GetTableURL($this->pageObject->tName) . '&' . $this->iquery . "&src=1&rndVal=" . rand(0, 32768)) . '">';
             }
         } else {
             if (strlen($value)) {
                 $disp = '<img id="image_' . GoodFieldName($this->field) . '_' . $this->id . '" name="' . $this->cfield . '" border=0 ';
                 if ($this->is508) {
                     $disp .= ' alt="file"';
                 }
                 $disp .= ' src="' . GetRootPathForResources("images/file.gif") . '">';
             }
         }
         //	filename
         if ($this->format == EDIT_FORMAT_DATABASE_FILE && !$itype && strlen($value)) {
             if (!($filename = @$data[$this->pageObject->pSetEdit->getFilenameField($this->field)])) {
                 $filename = "file.bin";
             }
             $disp = '<a href="' . GetTableLink("getfile", "", 'table=' . GetTableURL($this->pageObject->tName) . '&filename=' . runner_htmlspecialchars($filename) . '&' . $this->iquery) . '".>' . $disp . '</a>';
         }
         //	filename edit
         if ($this->format == EDIT_FORMAT_DATABASE_FILE && $this->pageObject->pSetEdit->getFilenameField($this->field)) {
             if (!($filename = @$data[$this->pageObject->pSetEdit->getFilenameField($this->field)])) {
                 $filename = "";
             }
             if ($mode == MODE_INLINE_EDIT) {
                 $strfilename = '<br><label for="filename_' . $this->cfieldname . '">' . "Filename" . '</label>&nbsp;&nbsp;<input type="text" ' . $this->inputStyle . ' id="filename_' . $this->cfieldname . '" name="filename_' . $this->cfieldname . '" size="20" maxlength="50" value="' . runner_htmlspecialchars($filename) . '">';
             } else {
                 $strfilename = '<br><label for="filename_' . $this->cfieldname . '">' . "Filename" . '</label>&nbsp;&nbsp;<input type="text" ' . $this->inputStyle . ' id="filename_' . $this->cfieldname . '" name="filename_' . $this->cfieldname . '" size="20" maxlength="50" value="' . runner_htmlspecialchars($filename) . '">';
             }
         }
         if (strlen($value)) {
             $strtype = '<br><input id="' . $this->ctype . '_keep" type="Radio" name="' . $this->ctype . '" value="file0" checked class="rnr-uploadtype">' . "Keep";
             if (strlen($value) && !$this->pageObject->pSetEdit->isRequired($this->field)) {
                 $strtype .= '<input id="' . $this->ctype . '_delete" type="Radio" name="' . $this->ctype . '" value="file1" class="rnr-uploadtype">' . "Delete";
             }
             $strtype .= '<input id="' . $this->ctype . '_update" type="Radio" name="' . $this->ctype . '" value="file2" class="rnr-uploadtype">' . "Update";
         } else {
             $strtype = '<input id="' . $this->ctype . '_update" type="hidden" name="' . $this->ctype . '" value="file2" class="rnr-uploadtype">';
         }
     } else {
         //	if Add mode
         $strtype = '<input id="' . $this->ctype . '" type="hidden" name="' . $this->ctype . '" value="file2">';
         if ($this->format == EDIT_FORMAT_DATABASE_FILE && $this->pageObject->pSetEdit->getFilenameField($this->field)) {
             $strfilename = '<br><label for="filename_' . $this->cfieldname . '">' . "Filename" . '</label>&nbsp;&nbsp;<input type="text" ' . $this->inputStyle . ' id="filename_' . $this->cfieldname . '" name="filename_' . $this->cfieldname . '" size="20" maxlength="50">';
         }
     }
     if ($mode == MODE_INLINE_EDIT && $this->format == EDIT_FORMAT_DATABASE_FILE) {
         $disp = "";
     }
     echo $disp . $strtype;
     if (($mode == MODE_EDIT || $mode == MODE_INLINE_EDIT) && strlen($value)) {
         echo '<br>';
     }
     echo '<input type="File" ' . $this->inputStyle . ' id="' . $this->cfield . '" ' . (($mode == MODE_INLINE_EDIT || $mode == MODE_INLINE_ADD) && $this->is508 ? 'alt="' . $this->strLabel . '" ' : '') . ' name="' . $this->cfield . '" >' . $strfilename;
     echo '<input type="Hidden" id="notempty_' . $this->cfieldname . '" value="' . (strlen($value) ? 1 : 0) . '">';
     $this->buildControlEnd($validate);
 }
Example #25
0
 public function buildUserFile($file)
 {
     $userFile = array();
     $userFile["name"] = $file["usrName"];
     $userFile["size"] = $file["size"];
     $userFile["type"] = $file["type"];
     $userFile["isImg"] = CheckImageExtension($file["name"]) != false;
     if ($file["error"]) {
         $userFile["error"] = $file["error"];
     }
     $hasThumbnail = $file["thumbnail"] != "";
     $userFile["url"] = GetTableLink("mfhandler", "", "file=" . rawurlencode($userFile["name"]) . "&table=" . rawurlencode($this->table) . "&field=" . rawurlencode($this->field) . "&pageType=" . rawurlencode($this->pageType) . ($this->tkeys != "" ? $this->tkeys : "&fkey=" . $this->formStamp));
     if ($hasThumbnail) {
         $userFile["thumbnail_url"] = $userFile["url"] . "&thumbnail=1";
     } else {
         $userFile["thumbnail_url"] = '';
     }
     return $userFile;
 }
Example #26
0
$reportName = "";
if (postvalue('rname'))
    $reportName = runner_htmlspecialchars(postvalue('rname'));
else
    $reportName = runner_htmlspecialchars(@$_SESSION['webreports']['settings']['name']);
$xt->assign("reportName", $reportName);

if (postvalue("q"))
    $xt->assign("searchClause", "&q=" . postvalue("q"));
$xt->assign("reportNamejs", jsreplace(postvalue('rname')));
$xt->assign("reportTitle", runner_htmlspecialchars($rpt_array['settings']['title']));
$xt->assign("shortTableName", runner_htmlspecialchars($rpt_array['short_table_name']));
$xt->assign("shortTableNamejs", jsreplace($rpt_array['short_table_name']));

$searchType = (!is_wr_project()) ? GetTableLink("dsearch") : GetTableLink(runner_htmlspecialchars($rpt_array['short_table_name']), "search");
$xt->assign("searchHref", "href='" . $searchType . "?rname=" . $reportName . "'");

$xt->assign("ext", "php");

if (postvalue("param") == "preview")
    $preview = "_preview";

switch ($rpt_array['miscellaneous']['type']){
    case "stepped" :
	$templatefile = GetTemplateName("", "dreport" . $preview);
	break;
    case "block" :
	$templatefile = GetTemplateName("", "dreport1" . $preview);
	break;
    case "outline" :
							window.parent.location.href="'.GetTableLink("webreport_admin").'?username='******'&queryname="+$("#sql_name").val();';
	else
		$b_includes .= 'window.parent.location.href="'.$page.'?sqlname="+$("#sql_name").val();';
	$b_includes .= '} else {
						$("#alert").html("<p>"+msg+"</p>")
						.dialog("option", "buttons", {"OK": function() { $(this).dialog("close");}})
						.dialog("open");
					}
				}
			});
		});
		$("#view_sql").click(function(){
			$("#table-container").html("");
			$.ajax({
				type: "POST",
				url: "'.GetTableLink("web_query").'",
				data: {
					sql: "makesql",
					output: $("#sql_textarea").val(),
					rnd: (new Date().getTime())
				},
				success: function(msg)
				{
					$("#table-container").html(msg);
				}
			});
		});';
	if(postvalue("sql")=="result")
		$b_includes .= '$("#view_sql").click();';
	if(!postvalue("check"))
		$b_includes.='$("#check_button").hide();';		
 /**
  * Set order links attribute for order on list page
  *
  * @param {string} $field - name field, which is ordering
  * @param {string} $sort - how is filed ordering, "a" - asc or "d" - desc, default is "a"
  * @param String $setIcon
  * @return String		 
  */
 function setLinksAttr($field, $sort = "", $setIcon = false)
 {
     $href = GetTableLink($this->shortTableName, "list", "orderby=" . ($sort == "a" ? "d" : "a") . $field . "&" . $this->lookupParams);
     $orderlinkattrs = 'id="order_' . $field . '_' . $this->id . '" name="order_' . $field . '_' . $this->id . '" data-href="' . $href . '" class="rnr-orderlink"';
     return $orderlinkattrs;
 }
$layout->skinsparams["undermenu"] = array("button"=>"button1");
$layout->skinsparams["fields"] = array("button"=>"button1");
$layout->skinsparams["form"] = array("button"=>"button1");
$layout->skinsparams["1"] = array("button"=>"button1");
$layout->skinsparams["2"] = array("button"=>"button1");
$layout->skinsparams["3"] = array("button"=>"button1");




$cipherer = new RunnerCipherer($strTableName);

$xt = new Xtempl();
$id = postvalue("id") != "" ? postvalue("id") : 1;
$all = postvalue("all");
$pageName = GetTableLink("print");

//array of params for classes
$params = array("id" => $id,
				"tName" => $strTableName,
				"pageType" => PAGE_PRINT);
$params["xt"] = &$xt;
			
$pageObject = new RunnerPage($params);
$pageObject->init();

// add button events if exist
$pageObject->addButtonHandlers();

// Modify query: remove blob fields from fieldlist.
// Blob fields on a print page are shown using imager.php (for example).
Example #30
0
$pageObject->addCommonJs();
//fill jsSettings and ControlsHTMLMap
$pageObject->fillSetCntrlMaps();
$pageObject->body['end'] .= '<script>';
$pageObject->body['end'] .= "window.controlsMap = " . my_json_encode($pageObject->controlsHTMLMap) . ";";
$pageObject->body['end'] .= "window.viewControlsMap = " . my_json_encode($pageObject->viewControlsHTMLMap) . ";";
$pageObject->body['end'] .= "window.settings = " . my_json_encode($pageObject->jsSettings) . ";</script>";
$pageObject->body["end"] .= "<script type=\"text/javascript\" src=\"" . GetRootPathForResources("include/runnerJS/RunnerAll.js") . "\"></script>";
$pageObject->body["end"] .= '<script>' . $pageObject->PrepareJS() . "</script>";
$xt->assignbyref("body", $pageObject->body);
// The user might rewrite $_SESSION["UserName"] value with HTML code in an event, so no encoding will be performed while printing this value.
$xt->assign("username", $_SESSION["UserName"]);
$xt->assign("changepwd_link", $_SESSION["AccessLevel"] != ACCESS_LEVEL_GUEST && $_SESSION["fromFacebook"] == false);
$xt->assign("changepwdlink_attrs", "onclick=\"window.location.href='" . GetTableLink("changepwd") . "';return false;\"");
$xt->assign("logoutlink_attrs", "onclick=\"window.location.href='" . GetTableLink("login", "", "a=logout") . "';return false;\"");
$xt->assign("guestloginlink_attrs", "onclick=\"window.location.href='" . GetTableLink("login") . "';return false;\"");
$xt->assign("loggedas_block", !isLoggedAsGuest());
$xt->assign("loggedas_message", !isLoggedAsGuest());
$xt->assign("logout_link", true);
$xt->assign("guestloginbutton", isLoggedAsGuest());
$xt->assign("logoutbutton", isSingleSign() && !isLoggedAsGuest());
// get redirect location for menu page
$redirect = $pageObject->getRedirectForMenuPage();
if ($redirect) {
    header("Location: " . $redirect);
    exit;
}
$xt->assign("menu_block", true);
if ($globalEvents->exists("BeforeShowMenu")) {
    $globalEvents->BeforeShowMenu($xt, $pageObject->templatefile, $pageObject);
}