コード例 #1
0
 $row = array();
 $row["grid_record"] = array();
 $row["grid_record"]["data"] = array();
 for ($col = 1; $data && ($all || $recno <= $PageSize) && $col <= 1; $col++) {
     $record = array();
     $recno++;
     $records++;
     $keylink = "";
     $keylink .= "&key1=" . htmlspecialchars(rawurlencode(@$data["Units"]));
     //	Units -
     $value = "";
     $value = ProcessLargeText(GetData($data, "Units", ""), "field=Units" . $keylink, "", MODE_PRINT);
     $record["Units_value"] = $value;
     //	PerUnit Price - Number
     $value = "";
     $value = ProcessLargeText(GetData($data, "PerUnit Price", "Number"), "field=PerUnit+Price" . $keylink, "", MODE_PRINT);
     $record["PerUnit_Price_value"] = $value;
     if ($col < $colsonpage) {
         $record["endrecord_block"] = true;
     }
     $record["grid_recordheader"] = true;
     $record["grid_vrecord"] = true;
     if ($eventObj->exists("BeforeMoveNextPrint")) {
         $eventObj->BeforeMoveNextPrint($data, $row, $record);
     }
     $row["grid_record"]["data"][] = $record;
     if ($eventObj->exists("ListFetchArray")) {
         $data = $eventObj->ListFetchArray($rs);
     } else {
         $data = db_fetch_array($rs);
     }
コード例 #2
0
 $record = array();
 $recno++;
 $records++;
 $keylink = "";
 $keylink .= "&key1=" . htmlspecialchars(rawurlencode(@$data["UserID"]));
 //	UserID -
 $value = "";
 $value = ProcessLargeText(GetData($data, "UserID", ""), "field=UserID" . $keylink, "", MODE_PRINT);
 $record["UserID_value"] = $value;
 //	Password -
 $value = "";
 $value = ProcessLargeText(GetData($data, "Password", ""), "field=Password" . $keylink, "", MODE_PRINT);
 $record["Password_value"] = $value;
 //	User Name -
 $value = "";
 $value = ProcessLargeText(GetData($data, "User Name", ""), "field=User+Name" . $keylink, "", MODE_PRINT);
 $record["User_Name_value"] = $value;
 //	Role -
 $value = "";
 $value = DisplayLookupWizard("Role", $data["Role"], $data, $keylink, MODE_PRINT);
 $record["Role_value"] = $value;
 if ($col < $colsonpage) {
     $record["endrecord_block"] = true;
 }
 $record["grid_recordheader"] = true;
 $record["grid_vrecord"] = true;
 if ($eventObj->exists("BeforeMoveNextPrint")) {
     $eventObj->BeforeMoveNextPrint($data, $row, $record);
 }
 $row["grid_record"]["data"][] = $record;
 if ($eventObj->exists("ListFetchArray")) {
コード例 #3
0
 //IsSync - Checkbox
 $value = "";
 $value = GetData($data, "IsSync", "Checkbox");
 if ($mainTableOwnerID == "IsSync") {
     $ownerIdValue = $value;
 }
 $xt->assign("IsSync_value", $value);
 if (!$pageObject->isAppearOnTabs("IsSync")) {
     $xt->assign("IsSync_fieldblock", true);
 } else {
     $xt->assign("IsSync_tabfieldblock", true);
 }
 ////////////////////////////////////////////
 //Currunt Readings -
 $value = "";
 $value = ProcessLargeText(GetData($data, "Currunt Readings", ""), "", "", MODE_VIEW);
 if ($mainTableOwnerID == "Currunt Readings") {
     $ownerIdValue = $value;
 }
 $xt->assign("Currunt_Readings_value", $value);
 if (!$pageObject->isAppearOnTabs("Currunt Readings")) {
     $xt->assign("Currunt_Readings_fieldblock", true);
 } else {
     $xt->assign("Currunt_Readings_tabfieldblock", true);
 }
 /*$jsKeysObj = 'window.recKeysObj = {';
 	$jsKeysObj .= "'".jsreplace("Record ID")."': '".(jsreplace(@$data["Record ID"]))."', ";
 $jsKeysObj = substr($jsKeysObj, 0, strlen($jsKeysObj)-2);
 $jsKeysObj .= '};';
 $pageObject->AddJsCode($jsKeysObj);	
 */
コード例 #4
0
function DisplayMasterTableInfo_Customers($params)
{
    $detailtable = $params["detailtable"];
    $keys = $params["keys"];
    global $conn, $strTableName;
    $xt = new Xtempl();
    $oldTableName = $strTableName;
    $strTableName = "dbo.Customers";
    //$strSQL = "SELECT ID,   Name,   [Father Name],   Address,   Contact,   Location,   [Customer Type]  FROM dbo.Customers";
    $sqlHead = "SELECT ID,   Name,   [Father Name],   Address,   Contact,   Location,   [Customer Type]";
    $sqlFrom = "FROM dbo.Customers";
    $sqlWhere = "";
    $sqlTail = "";
    $where = "";
    $mKeys = array();
    $showKeys = "";
    global $page_styles, $page_layouts, $page_layout_names, $container_styles;
    $layout = new TLayout("masterlist", "BoldOrange", "MobileOrange");
    $layout->blocks["bare"] = array();
    $layout->containers["0"] = array();
    $layout->containers["0"][] = array("name" => "masterlistheader", "block" => "", "substyle" => 1);
    $layout->skins["0"] = "empty";
    $layout->blocks["bare"][] = "0";
    $layout->containers["mastergrid"] = array();
    $layout->containers["mastergrid"][] = array("name" => "masterlistfields", "block" => "", "substyle" => 1);
    $layout->skins["mastergrid"] = "grid";
    $layout->blocks["bare"][] = "mastergrid";
    $page_layouts["Customers_masterlist"] = $layout;
    if ($detailtable == "dbo.Customer Module Assignment") {
        $where .= GetFullFieldName("ID") . "=" . make_db_value("ID", $keys[1 - 1]);
        $showKeys .= " " . GetFieldLabel("dbo_Customers", "ID") . ": " . $keys[1 - 1];
        $xt->assign('showKeys', $showKeys);
    }
    if (!$where) {
        $strTableName = $oldTableName;
        return;
    }
    $str = SecuritySQL("Search");
    if (strlen($str)) {
        $where .= " and " . $str;
    }
    $strWhere = whereAdd($sqlWhere, $where);
    if (strlen($strWhere)) {
        $strWhere = " where " . $strWhere . " ";
    }
    $strSQL = $sqlHead . ' ' . $sqlFrom . $strWhere . $sqlTail;
    //	$strSQL=AddWhere($strSQL,$where);
    LogInfo($strSQL);
    $rs = db_query($strSQL, $conn);
    $data = db_fetch_array($rs);
    if (!$data) {
        $strTableName = $oldTableName;
        return;
    }
    $keylink = "";
    $keylink .= "&key1=" . htmlspecialchars(rawurlencode(@$data["ID"]));
    //	ID -
    $value = "";
    $value = ProcessLargeText(GetData($data, "ID", ""), "field=ID" . $keylink);
    $xt->assign("ID_mastervalue", $value);
    //	Name -
    $value = "";
    $value = ProcessLargeText(GetData($data, "Name", ""), "field=Name" . $keylink);
    $xt->assign("Name_mastervalue", $value);
    //	Father Name -
    $value = "";
    $value = ProcessLargeText(GetData($data, "Father Name", ""), "field=Father+Name" . $keylink);
    $xt->assign("Father_Name_mastervalue", $value);
    //	Address -
    $value = "";
    $value = ProcessLargeText(GetData($data, "Address", ""), "field=Address" . $keylink);
    $xt->assign("Address_mastervalue", $value);
    //	Contact -
    $value = "";
    $value = ProcessLargeText(GetData($data, "Contact", ""), "field=Contact" . $keylink);
    $xt->assign("Contact_mastervalue", $value);
    //	Location -
    $value = "";
    $value = DisplayLookupWizard("Location", $data["Location"], $data, $keylink, MODE_LIST);
    $xt->assign("Location_mastervalue", $value);
    //	Customer Type -
    $value = "";
    $value = DisplayLookupWizard("Customer Type", $data["Customer Type"], $data, $keylink, MODE_LIST);
    $xt->assign("Customer_Type_mastervalue", $value);
    $xt->display("Customers_masterlist.htm");
    $strTableName = $oldTableName;
}
コード例 #5
0
        $row["ID_value"] = $value;
        //	Name -
        $value = "";
        $value = ProcessLargeText(GetData($data, "Name", ""), "field=Name" . $keylink, "", MODE_PRINT);
        $row["Name_value"] = $value;
        //	Father Name -
        $value = "";
        $value = ProcessLargeText(GetData($data, "Father Name", ""), "field=Father+Name" . $keylink, "", MODE_PRINT);
        $row["Father_Name_value"] = $value;
        //	Address -
        $value = "";
        $value = ProcessLargeText(GetData($data, "Address", ""), "field=Address" . $keylink, "", MODE_PRINT);
        $row["Address_value"] = $value;
        //	Contact -
        $value = "";
        $value = ProcessLargeText(GetData($data, "Contact", ""), "field=Contact" . $keylink, "", MODE_PRINT);
        $row["Contact_value"] = $value;
        //	Location -
        $value = "";
        $value = DisplayLookupWizard("Location", $data["Location"], $data, $keylink, MODE_PRINT);
        $row["Location_value"] = $value;
        //	Customer Type -
        $value = "";
        $value = DisplayLookupWizard("Customer Type", $data["Customer Type"], $data, $keylink, MODE_PRINT);
        $row["Customer_Type_value"] = $value;
        $rowinfo[] = $row;
    }
    $xt->assign_loopsection("details_row", $rowinfo);
} else {
}
$xt->display("Customers_detailspreview.htm");
コード例 #6
0
 $row = array();
 $row["grid_record"] = array();
 $row["grid_record"]["data"] = array();
 for ($col = 1; $data && ($all || $recno <= $PageSize) && $col <= 1; $col++) {
     $record = array();
     $recno++;
     $records++;
     $keylink = "";
     $keylink .= "&key1=" . htmlspecialchars(rawurlencode(@$data["Code"]));
     //	Code -
     $value = "";
     $value = ProcessLargeText(GetData($data, "Code", ""), "field=Code" . $keylink, "", MODE_PRINT);
     $record["Code_value"] = $value;
     //	Action -
     $value = "";
     $value = ProcessLargeText(GetData($data, "Action", ""), "field=Action" . $keylink, "", MODE_PRINT);
     $record["Action_value"] = $value;
     if ($col < $colsonpage) {
         $record["endrecord_block"] = true;
     }
     $record["grid_recordheader"] = true;
     $record["grid_vrecord"] = true;
     if ($eventObj->exists("BeforeMoveNextPrint")) {
         $eventObj->BeforeMoveNextPrint($data, $row, $record);
     }
     $row["grid_record"]["data"][] = $record;
     if ($eventObj->exists("ListFetchArray")) {
         $data = $eventObj->ListFetchArray($rs);
     } else {
         $data = db_fetch_array($rs);
     }
コード例 #7
0
 $record["Previous_Readings_value"] = $value;
 //	Currunt Readings -
 $value = "";
 $value = ProcessLargeText(GetData($data, "Currunt Readings", ""), "field=Currunt+Readings" . $keylink, "", MODE_PRINT);
 $record["Currunt_Readings_value"] = $value;
 //	Unit Consumed -
 $value = "";
 $value = ProcessLargeText(GetData($data, "Unit Consumed", ""), "field=Unit+Consumed" . $keylink, "", MODE_PRINT);
 $record["Unit_Consumed_value"] = $value;
 //	Bill Amount -
 $value = "";
 $value = ProcessLargeText(GetData($data, "Bill Amount", ""), "field=Bill+Amount" . $keylink, "", MODE_PRINT);
 $record["Bill_Amount_value"] = $value;
 //	Due Date -
 $value = "";
 $value = ProcessLargeText(GetData($data, "Due Date", ""), "field=Due+Date" . $keylink, "", MODE_PRINT);
 $record["Due_Date_value"] = $value;
 if ($col < $colsonpage) {
     $record["endrecord_block"] = true;
 }
 $record["grid_recordheader"] = true;
 $record["grid_vrecord"] = true;
 if ($eventObj->exists("BeforeMoveNextPrint")) {
     $eventObj->BeforeMoveNextPrint($data, $row, $record);
 }
 $row["grid_record"]["data"][] = $record;
 if ($eventObj->exists("ListFetchArray")) {
     $data = $eventObj->ListFetchArray($rs);
 } else {
     $data = db_fetch_array($rs);
 }
$fieldsArr[] = $arr;
$arr = array();
$arr['fName'] = "Module ID";
$arr['viewFormat'] = ViewFormat("Module ID", $strTableName);
$fieldsArr[] = $arr;
$mainTableOwnerID = GetTableData($strTableName, ".mainTableOwnerID", '');
$ownerIdValue = "";
$pageObject->setGoogleMapsParams($fieldsArr);
while ($data) {
    $xt->assign("show_key1", htmlspecialchars(GetData($data, "ID", "")));
    $keylink = "";
    $keylink .= "&key1=" . htmlspecialchars(rawurlencode(@$data["ID"]));
    ////////////////////////////////////////////
    //ID -
    $value = "";
    $value = ProcessLargeText(GetData($data, "ID", ""), "", "", MODE_VIEW);
    if ($mainTableOwnerID == "ID") {
        $ownerIdValue = $value;
    }
    $xt->assign("ID_value", $value);
    if (!$pageObject->isAppearOnTabs("ID")) {
        $xt->assign("ID_fieldblock", true);
    } else {
        $xt->assign("ID_tabfieldblock", true);
    }
    ////////////////////////////////////////////
    //Customer ID -
    $value = "";
    $value = DisplayLookupWizard("Customer ID", $data["Customer ID"], $data, $keylink, MODE_VIEW);
    if ($mainTableOwnerID == "Customer ID") {
        $ownerIdValue = $value;
コード例 #9
0
 //Code -
 $value = "";
 $value = ProcessLargeText(GetData($data, "Code", ""), "", "", MODE_VIEW);
 if ($mainTableOwnerID == "Code") {
     $ownerIdValue = $value;
 }
 $xt->assign("Code_value", $value);
 if (!$pageObject->isAppearOnTabs("Code")) {
     $xt->assign("Code_fieldblock", true);
 } else {
     $xt->assign("Code_tabfieldblock", true);
 }
 ////////////////////////////////////////////
 //Condition -
 $value = "";
 $value = ProcessLargeText(GetData($data, "Condition", ""), "", "", MODE_VIEW);
 if ($mainTableOwnerID == "Condition") {
     $ownerIdValue = $value;
 }
 $xt->assign("Condition_value", $value);
 if (!$pageObject->isAppearOnTabs("Condition")) {
     $xt->assign("Condition_fieldblock", true);
 } else {
     $xt->assign("Condition_tabfieldblock", true);
 }
 /*$jsKeysObj = 'window.recKeysObj = {';
 	$jsKeysObj .= "'".jsreplace("Code")."': '".(jsreplace(@$data["Code"]))."', ";
 $jsKeysObj = substr($jsKeysObj, 0, strlen($jsKeysObj)-2);
 $jsKeysObj .= '};';
 $pageObject->AddJsCode($jsKeysObj);	
 */
コード例 #10
0
 function proccessRecordValue(&$data, &$keylink, $listFieldInfo)
 {
     if (NeedEncode($listFieldInfo['fName'], $this->tName) && $this->customField == $listFieldInfo['fName']) {
         $value = ProcessLargeText(GetData($data, $this->linkField, $listFieldInfo['viewFormat']), "field=" . rawurlencode($listFieldInfo['fName']) . $keylink, "", MODE_LIST);
     } else {
         $value = parent::proccessRecordValue($data, $keylink, $listFieldInfo);
     }
     if ($this->lookupSelectField == $listFieldInfo['fName']) {
         $value = '<a href="#" type="lookupSelect' . $this->id . '">' . $value . "</a>";
     }
     return $value;
 }
コード例 #11
0
 /**
  * Proccess record values
  *
  * @param array $record
  * @param array $data
  * @param string $keylink
  */
 function proccessRecordValue(&$data, &$keylink, $listFieldInfo)
 {
     $value = "";
     if ($listFieldInfo['viewFormat'] == FORMAT_DATABASE_IMAGE) {
         if (ShowThumbnail($listFieldInfo['fName'], $this->tName)) {
             $thumbPref = GetThumbnailPrefix($listFieldInfo['fName'], $this->tName);
             $value .= "<a";
             if (IsUseiBox($listFieldInfo['fName'], $this->tName)) {
                 $value .= " rel='ibox'";
             } else {
                 $value .= " target=_blank";
             }
             $value .= " href='imager.php?table=" . $this->shortTableName . "&field=" . rawurlencode($listFieldInfo['fName']) . $keylink . "'>";
             $value .= "<img border=0";
             if ($this->is508) {
                 $value .= " alt=\"Image from DB\"";
             }
             $value .= " src='imager.php?table=" . $this->shortTableName . "&field=" . rawurlencode($thumbPref) . "&alt=" . rawurlencode($listFieldInfo['fName']) . $keylink . "'>";
             $value .= "</a>";
         } else {
             $value = "<img";
             if ($this->is508) {
                 $value .= " alt=\"Image from DB\"";
             }
             $imgWidth = GetImageWidth($listFieldInfo['fName'], $this->tName);
             $value .= $imgWidth ? " width=" . $imgWidth : "";
             $imgHeight = GetImageHeight($listFieldInfo['fName'], $this->tName);
             $value .= $imgHeight ? " height=" . $imgHeight : "";
             $value .= " border=0";
             $value .= " src='imager.php?table=" . $this->shortTableName . "&field=" . rawurlencode($listFieldInfo['fName']) . $keylink . "'>";
         }
     } else {
         if ($listFieldInfo['viewFormat'] == FORMAT_FILE_IMAGE) {
             if (CheckImageExtension($data[$listFieldInfo['fName']])) {
                 if (ShowThumbnail($listFieldInfo['fName'], $this->tName)) {
                     // show thumbnail
                     $thumbPref = GetThumbnailPrefix($listFieldInfo['fName'], $this->tName);
                     $thumbname = $thumbPref . $data[$listFieldInfo['fName']];
                     if (substr(GetLinkPrefix($listFieldInfo['fName'], $this->tName), 0, 7) != "http://" && !myfile_exists(GetUploadFolder($listFieldInfo['fName']) . $thumbname)) {
                         $thumbname = $data[$listFieldInfo['fName']];
                     }
                     $value = "<a";
                     if (IsUseiBox($listFieldInfo['fName'], $this->tName)) {
                         $value .= " rel='ibox'";
                     } else {
                         $value .= " target=_blank";
                     }
                     $value .= " href=\"" . htmlspecialchars(AddLinkPrefix($listFieldInfo['fName'], $data[$listFieldInfo['fName']])) . "\">";
                     $value .= "<img";
                     if ($thumbname == $data[$listFieldInfo['fName']]) {
                         $imgWidth = GetImageWidth($listFieldInfo['fName'], $this->tName);
                         $value .= $imgWidth ? " width=" . $imgWidth : "";
                         $imgHeight = GetImageHeight($listFieldInfo['fName'], $this->tName);
                         $value .= $imgHeight ? " height=" . $imgHeight : "";
                     }
                     $value .= " border=0";
                     if ($this->is508) {
                         $value .= " alt=\"" . htmlspecialchars($data[$listFieldInfo['fName']]) . "\"";
                     }
                     $value .= " src=\"" . htmlspecialchars(AddLinkPrefix($listFieldInfo['fName'], $thumbname)) . "\"></a>";
                 } else {
                     $value = "<img";
                     $imgWidth = GetImageWidth($listFieldInfo['fName'], $this->tName);
                     $value .= $imgWidth ? " width=" . $imgWidth : "";
                     $imgHeight = GetImageHeight($listFieldInfo['fName'], $this->tName);
                     $value .= $imgHeight ? " height=" . $imgHeight : "";
                     $value .= " border=0";
                     if ($this->is508) {
                         $value .= " alt=\"" . htmlspecialchars($data[$listFieldInfo['fName']]) . "\"";
                     }
                     $value .= " src=\"" . htmlspecialchars(AddLinkPrefix($listFieldInfo['fName'], $data[$listFieldInfo['fName']])) . "\">";
                 }
             }
         } else {
             if ($listFieldInfo['viewFormat'] == FORMAT_DATABASE_FILE) {
                 $fileNameF = GetFilenameField($listFieldInfo['fName'], $this->tName);
                 if ($fileNameF) {
                     $fileName = $data[$fileNameF];
                     if (!$fileName) {
                         $fileName = "file.bin";
                     }
                 } else {
                     $fileName = "file.bin";
                 }
                 if (strlen($data[$listFieldInfo['fName']])) {
                     $value = "<a href='getfile.php?table=" . $this->shortTableName . "&filename=" . rawurlencode($fileName) . "&field=" . rawurlencode($listFieldInfo['fName']) . $keylink . "'>";
                     $value .= htmlspecialchars($fileName);
                     $value .= "</a>";
                 }
             } else {
                 if ($listFieldInfo['viewFormat'] == FORMAT_AUDIO) {
                     $fileName = GetData($data, $listFieldInfo['fName'], FORMAT_NONE);
                     $fieldIsUrl = GetFieldData($this->tName, $listFieldInfo['fName'], "fieldIsVideoUrl", false);
                     if (strlen($fileName)) {
                         $absFileName = "";
                         if (!$fieldIsUrl && GetFieldData($this->tName, $listFieldInfo['fName'], "Absolute", false)) {
                             $absFileName = GetUploadFolder($listFieldInfo['fName']) . $fileName;
                         } elseif (!$fieldIsUrl) {
                             $absFileName = getabspath(GetUploadFolder($listFieldInfo['fName']) . $fileName);
                         }
                         // if file
                         if ($fieldIsUrl || file_exists($absFileName)) {
                             $titleField = GetFieldData($this->tName, $listFieldInfo['fName'], 'audioTitleField', "");
                             $title = "";
                             if ($titleField) {
                                 $title = htmlspecialchars(GetData($data, $titleField, ViewFormat($titleField, $titleField)));
                             }
                             if ($fieldIsUrl) {
                                 $href = $fileName;
                             } else {
                                 $href = 'download.php?table=' . $this->shortTableName . '&field=' . rawurlencode($listFieldInfo['fName']) . $keylink;
                             }
                             $value = '<a class="htrack" type="audio/mpeg" title="' . $title . '" href="' . $href . '">' . $title . '</a>';
                         }
                     }
                 } else {
                     if ($listFieldInfo['viewFormat'] == FORMAT_DATABASE_AUDIO) {
                         $titleField = GetFieldData($this->tName, $listFieldInfo['fName'], 'audioTitleField', "");
                         $title = "";
                         if ($titleField) {
                             $title = htmlspecialchars(GetData($data, $titleField, ViewFormat($titleField, $titleField)));
                         }
                         if (@$data[$listFieldInfo['fName']] != NULL) {
                             $value = '<a class="htrack" type="audio/mpeg" title="' . $title . '" href="getfile.php?table=' . $this->shortTableName . '&field=' . rawurlencode($listFieldInfo['fName']) . $keylink . '">' . $title . '</a>';
                         } else {
                             $value = $title;
                         }
                     } else {
                         if ($listFieldInfo['viewFormat'] == FORMAT_VIDEO) {
                             $value = "";
                             $fieldIsUrl = GetFieldData($this->tName, $listFieldInfo['fName'], "fieldIsVideoUrl", false);
                             $fileName = GetData($data, $listFieldInfo['fName'], FORMAT_NONE);
                             if (strlen($fileName)) {
                                 $absFileName = "";
                                 if (!$fieldIsUrl && GetFieldData($this->tName, $listFieldInfo['fName'], "Absolute", false)) {
                                     $absFileName = GetUploadFolder($listFieldInfo['fName']) . $fileName;
                                 } elseif (!$fieldIsUrl) {
                                     $absFileName = getabspath(GetUploadFolder($listFieldInfo['fName']) . $fileName);
                                 }
                                 // if file
                                 if ($fieldIsUrl || file_exists($absFileName)) {
                                     $videoId = 'video_' . GoodFieldName(htmlspecialchars($listFieldInfo['fName'])) . '_' . $this->recId;
                                     if ($fieldIsUrl) {
                                         $href = $fileName;
                                     } else {
                                         $href = 'download.php?table=' . $this->shortTableName . '&field=' . rawurlencode($listFieldInfo['fName']) . $keylink;
                                     }
                                     $value = '<a href="' . $href . '" style="display:block;width:' . GetFieldData($this->tName, $listFieldInfo['fName'], 'videoWidth', "") . 'px;height:' . GetFieldData($this->tName, $listFieldInfo['fName'], 'videoHeight', "") . 'px;" id="' . $videoId . '"></a>';
                                     $this->controlsMap['video'][] = $videoId;
                                 }
                             }
                         } else {
                             if ($listFieldInfo['viewFormat'] == FORMAT_DATABASE_VIDEO) {
                                 if (@$data[$listFieldInfo['fName']] != NULL) {
                                     $videoId = 'video_' . GoodFieldName(htmlspecialchars($listFieldInfo['fName'])) . '_' . $this->recId;
                                     $value = '<a href="getfile.php?table=' . $this->shortTableName . '&field=' . rawurlencode($listFieldInfo['fName']) . $keylink . '" style="display:block;width:' . GetFieldData($this->tName, $listFieldInfo['fName'], 'videoWidth', 0) . 'px;height:' . GetFieldData($this->tName, $listFieldInfo['fName'], 'videoHeight', 0) . 'px;" id="' . $videoId . '"></a>';
                                     $this->controlsMap['video'][] = $videoId;
                                 }
                             } else {
                                 if ($listFieldInfo['viewFormat'] == FORMAT_MAP) {
                                     $value = '<div id="littleMap_' . GoodFieldName($listFieldInfo['fName']) . '_' . $this->recId . '" style="width: ' . $this->googleMapCfg['fieldsAsMap'][$listFieldInfo['fName']]['width'] . 'px; height: ' . $this->googleMapCfg['fieldsAsMap'][$listFieldInfo['fName']]['height'] . 'px;"></div>';
                                 } else {
                                     if (($listFieldInfo['editFormat'] == EDIT_FORMAT_LOOKUP_WIZARD || $listFieldInfo['editFormat'] == EDIT_FORMAT_RADIO) && GetLookupType($listFieldInfo['fName'], $this->tName) == LT_LOOKUPTABLE && GetLWLinkField($listFieldInfo['fName'], $this->tName) != GetLWDisplayField($listFieldInfo['fName'], $this->tName)) {
                                         $value = DisplayLookupWizard($listFieldInfo['fName'], $data[$listFieldInfo['fName']], $data, $keylink, MODE_LIST);
                                     } else {
                                         if (NeedEncode($listFieldInfo['fName'], $this->tName)) {
                                             $value = ProcessLargeText(GetData($data, $listFieldInfo['fName'], $listFieldInfo['viewFormat']), "field=" . rawurlencode($listFieldInfo['fName']) . $keylink, "", MODE_LIST);
                                         } else {
                                             $value = GetData($data, $listFieldInfo['fName'], $listFieldInfo['viewFormat']);
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     // create address field as center link
     $value = $this->addCenterLink($value, $listFieldInfo['fName']);
     return $value;
 }
コード例 #12
0
 //Password -
 $value = "";
 $value = ProcessLargeText(GetData($data, "Password", ""), "", "", MODE_VIEW);
 if ($mainTableOwnerID == "Password") {
     $ownerIdValue = $value;
 }
 $xt->assign("Password_value", $value);
 if (!$pageObject->isAppearOnTabs("Password")) {
     $xt->assign("Password_fieldblock", true);
 } else {
     $xt->assign("Password_tabfieldblock", true);
 }
 ////////////////////////////////////////////
 //User Name -
 $value = "";
 $value = ProcessLargeText(GetData($data, "User Name", ""), "", "", MODE_VIEW);
 if ($mainTableOwnerID == "User Name") {
     $ownerIdValue = $value;
 }
 $xt->assign("User_Name_value", $value);
 if (!$pageObject->isAppearOnTabs("User Name")) {
     $xt->assign("User_Name_fieldblock", true);
 } else {
     $xt->assign("User_Name_tabfieldblock", true);
 }
 ////////////////////////////////////////////
 //Role -
 $value = "";
 $value = DisplayLookupWizard("Role", $data["Role"], $data, $keylink, MODE_VIEW);
 if ($mainTableOwnerID == "Role") {
     $ownerIdValue = $value;
コード例 #13
0
 //Code -
 $value = "";
 $value = ProcessLargeText(GetData($data, "Code", ""), "", "", MODE_VIEW);
 if ($mainTableOwnerID == "Code") {
     $ownerIdValue = $value;
 }
 $xt->assign("Code_value", $value);
 if (!$pageObject->isAppearOnTabs("Code")) {
     $xt->assign("Code_fieldblock", true);
 } else {
     $xt->assign("Code_tabfieldblock", true);
 }
 ////////////////////////////////////////////
 //Tamper Type -
 $value = "";
 $value = ProcessLargeText(GetData($data, "Tamper Type", ""), "", "", MODE_VIEW);
 if ($mainTableOwnerID == "Tamper Type") {
     $ownerIdValue = $value;
 }
 $xt->assign("Tamper_Type_value", $value);
 if (!$pageObject->isAppearOnTabs("Tamper Type")) {
     $xt->assign("Tamper_Type_fieldblock", true);
 } else {
     $xt->assign("Tamper_Type_tabfieldblock", true);
 }
 /*$jsKeysObj = 'window.recKeysObj = {';
 	$jsKeysObj .= "'".jsreplace("Code")."': '".(jsreplace(@$data["Code"]))."', ";
 $jsKeysObj = substr($jsKeysObj, 0, strlen($jsKeysObj)-2);
 $jsKeysObj .= '};';
 $pageObject->AddJsCode($jsKeysObj);	
 */
コード例 #14
0
 function getFormattedRow($value)
 {
     $row = array('row_data' => true);
     $keylink = "";
     for ($i = 0; $i < count($this->tKeyFields); $i++) {
         $keylink .= "&key" . ($i + 1) . "=" . htmlspecialchars(rawurlencode(@$value[$this->tKeyFields[$i]]));
     }
     for ($i = 0; $i < count($this->fieldsArr); $i++) {
         // for change pseudo foreach with condition with PHP for
         // foreach Fields as @f filter @f.bReportPage && (@TABLE.bReportShowDetails || @TABLE.arrReportGroupFields[strGroupField==@f.strName && nGroupInterval==0].len) order nReportPageOrder
         $pass = false;
         for ($j = 0; $j < count($this->repGroupFields); $j++) {
             if (!$this->fieldsArr[$i]['repPage'] || !($this->repShowDet || $this->repGroupFields[$j]['strGroupField'] == $this->fieldsArr[$i]['name'] && $this->repGroupFields[$j]['groupInterval'] === 0)) {
                 $pass = true;
             }
         }
         if ($pass) {
             continue;
         }
         if ($this->fieldsArr[$i]['viewFormat'] == FORMAT_DATABASE_IMAGE) {
             if (!$this->forExport) {
                 if ($this->fieldsArr[$i]['showThumb']) {
                     $val .= "<a ";
                     if (IsUseiBox($this->fieldsArr[$i]['name'], $this->tName)) {
                         $val .= " rel='ibox'";
                     } else {
                         $val .= " target=_blank";
                     }
                     $val .= " href=\"imager.php?table=" . $this->shortTName . "&field=" . rawurlencode(htmlspecialchars($this->fieldsArr[$i]['name'])) . $keylink . "\">";
                     $val .= "<img border=0";
                     if (isEnableSection508()) {
                         $val .= " alt=\"Image from DB\"";
                     }
                     $val .= " src=\"imager.php?table=" . $this->shortTName . "&field=" . rawurlencode(htmlspecialchars($this->fieldsArr[$i]['thumbnail'])) . "&alt=" . rawurlencode(htmlspecialchars($this->fieldsArr[$i]['repPage'])) . $keylink . "\">";
                     $val .= "</a>";
                 } else {
                     $val = "<img";
                     if ($this->fieldsArr[$i]['imageWidth']) {
                         $val .= " width=" . $this->fieldsArr[$i]['imageWidth'];
                     }
                     if ($this->fieldsArr[$i]['imageHeight']) {
                         $val .= " height=" . $this->fieldsArr[$i]['imageHeight'];
                     }
                     $val .= " border=0";
                     if (isEnableSection508()) {
                         $val .= " alt=\"Image from DB\"";
                     }
                     $val .= " src=\"imager.php?table=" . $this->shortTName . "&field=" . rawurlencode(htmlspecialchars($this->fieldsArr[$i]['name'])) . $keylink . "\">";
                 }
             } else {
                 $val = mlang_message("LONG_BINARY");
             }
         } elseif ($this->fieldsArr[$i]['viewFormat'] == FORMAT_FILE_IMAGE) {
             if (!$this->forExport) {
                 if (CheckImageExtension($value[$this->fieldsArr[$i]['name']])) {
                     if ($this->fieldsArr[$i]['showThumb']) {
                         // show thumbnail
                         $thumbname = $this->fieldsArr[$i]['thumbnail'] . $value[$this->fieldsArr[$i]['name']];
                         if (substr($this->fieldsArr[$i]['strhlPrefix'], 0, 7) != "http://" && !myfile_exists(getabspath($this->fieldsArr[$i]['strhlPrefix'] . $thumbname))) {
                             $thumbname = $value[$this->fieldsArr[$i]['name']];
                         }
                         $val = "<a";
                         if (IsUseiBox($this->fieldsArr[$i]['name'], $this->tName)) {
                             $val .= " rel='ibox'";
                         } else {
                             $val .= " target=_blank";
                         }
                         $val .= " href=\"" . htmlspecialchars(AddLinkPrefix($this->fieldsArr[$i]['name'], $value[$this->fieldsArr[$i]['name']])) . "\">";
                         $val .= "<img";
                         if ($thumbname == $value[$this->fieldsArr[$i]['name']]) {
                             if ($this->fieldsArr[$i]['imageWidth']) {
                                 $val .= " width=" . $this->fieldsArr[$i]['imageWidth'];
                             }
                             if ($this->fieldsArr[$i]['imageHeight']) {
                                 $val .= " height=" . $this->fieldsArr[$i]['imageHeight'];
                             }
                         }
                         $val .= " border=0";
                         if (isEnableSection508()) {
                             $val .= " alt=\"" . htmlspecialchars($value[$this->fieldsArr[$i]['name']]) . "\"";
                         }
                         $val .= " src=\"" . htmlspecialchars(AddLinkPrefix($this->fieldsArr[$i]['name'], $thumbname)) . "\"></a>";
                     } else {
                         $val = "<img";
                         if ($this->fieldsArr[$i]['imageWidth']) {
                             $val .= " width=" . $this->fieldsArr[$i]['imageWidth'];
                         }
                         if ($this->fieldsArr[$i]['imageHeight']) {
                             $val .= " height=" . $this->fieldsArr[$i]['imageHeight'];
                         }
                         $val .= " border=0";
                         if (isEnableSection508()) {
                             $val .= " alt=\"" . htmlspecialchars($value[$this->fieldsArr[$i]['name']]) . "\"";
                         }
                         $val .= " src=\"" . htmlspecialchars(AddLinkPrefix($this->fieldsArr[$i]['name'], $value[$this->fieldsArr[$i]['name']])) . "\">";
                     }
                 }
             } else {
                 $val = mlang_message("LONG_BINARY");
             }
         } elseif ($this->fieldsArr[$i]['viewFormat'] == FORMAT_DATABASE_FILE) {
             if (!$this->forExport) {
                 if ($this->fieldsArr[$i]['fileName']) {
                     $filename = $value[$this->fieldsArr[$i]['fileName']];
                     if (!$filename) {
                         $filename = "file.bin";
                     }
                 } else {
                     $filename = "file.bin";
                 }
                 if (strlen($value[$this->fieldsArr[$i]['name']])) {
                     $val = "<a href=\"getfile.php?table=" . $this->shortTName . "&filename=" . rawurlencode($filename) . "&field=" . rawurlencode(htmlspecialchars($this->fieldsArr[$i]['name'])) . $keylink . "\">";
                     $val .= htmlspecialchars($filename);
                     $val .= "</a>";
                 }
             } else {
                 $val = mlang_message("LONG_BINARY");
             }
         } elseif (($this->fieldsArr[$i]['editFormat'] == EDIT_FORMAT_LOOKUP_WIZARD || $this->fieldsArr[$i]['editFormat'] == EDIT_FORMAT_RADIO) && GetLookupType($this->fieldsArr[$i]['name'], $this->tName) == LT_LOOKUPTABLE) {
             $val = DisplayLookupWizard($this->fieldsArr[$i]['name'], $value[$this->fieldsArr[$i]['name']], $value, $keylink, $this->mode);
         } elseif (NeedEncode($this->fieldsArr[$i]['name'], $this->tName)) {
             $val = ProcessLargeText(GetData($value, $this->fieldsArr[$i]['name'], $this->fieldsArr[$i]['viewFormat']), "field=" . rawurlencode($this->fieldsArr[$i]['name']) . $keylink, "", $this->mode);
         } else {
             //$val = GetData($value, $this->fieldsArr[$i]['name'], $this->fieldsArr[$i]['viewFormat']);
             if ($this->fieldsArr[$i]['viewFormat'] == FORMAT_CHECKBOX && $this->forExport) {
                 $val = GetData($value, $this->fieldsArr[$i]['name'], FORMAT_NONE);
             } else {
                 $val = GetData($value, $this->fieldsArr[$i]['name'], $this->fieldsArr[$i]['viewFormat']);
             }
         }
         $row[$this->fieldsArr[$i]['goodName'] . "_value"] = $val;
     }
     if ($this->repLayout == REPORT_BLOCK) {
         $row[GoodFieldName('nonewgroup')] = true;
     }
     return $row;
 }
コード例 #15
0
ファイル: ViewControl.php プロジェクト: aagusti/padl-tng
 public function checkForEncoding($value, $keylink)
 {
     if ($this->container->pSet->NeedEncode($this->field) && $this->container->forExport != "excel" && $this->container->forExport != "csv") {
         $isMobileLookup = false;
         if (!is_null($this->pageObject)) {
             if ($this->pageObject->mode == LIST_LOOKUP && isMobile()) {
                 $isMobileLookup = true;
             }
         }
         if ($this->container->pageType == PAGE_ADD || $this->container->pageType == PAGE_EDIT) {
             $pageType = PAGE_LIST;
         } else {
             $pageType = $this->container->pageType;
         }
         $value = ProcessLargeText($this->container->pSet, $value, "field=" . rawurlencode($this->field) . $keylink, "", $pageType, "", $isMobileLookup, $this->container->pSet->isTableType() == "report");
     }
     return $value;
 }
コード例 #16
0
function DisplayLookupWizard($field, $value, $data, $keylink, $mode)
{
    global $conn, $strTableName;
    if (!strlen($value)) {
        return "";
    }
    $LookupSQL = "SELECT ";
    $LookupSQL .= GetLWDisplayField($field);
    $LookupSQL .= " FROM " . AddTableWrappers(GetLookupTable($field)) . " WHERE ";
    $where = "";
    $lookupvalue = $value;
    $iquery = "field=" . htmlspecialchars(rawurlencode($field)) . $keylink;
    $out = "";
    if (Multiselect($field)) {
        $arr = splitvalues($value);
        $numeric = true;
        $type = GetLWLinkFieldType($field);
        if (!$type) {
            foreach ($arr as $val) {
                if (strlen($val) && !is_numeric($val)) {
                    $numeric = false;
                    break;
                }
            }
        } else {
            $numeric = !NeedQuotes($type);
        }
        $in = "";
        foreach ($arr as $val) {
            if ($numeric && !strlen($val)) {
                continue;
            }
            if (strlen($in)) {
                $in .= ",";
            }
            if ($numeric) {
                $in .= $val + 0;
            } else {
                $in .= db_prepare_string($val);
            }
        }
        if (strlen($in)) {
            $LookupSQL .= GetLWLinkField($field) . " in (" . $in . ")";
            $where = GetLWWhere($field);
            if (strlen($where)) {
                $LookupSQL .= " and (" . $where . ")";
            }
            LogInfo($LookupSQL);
            $rsLookup = db_query($LookupSQL, $conn);
            $found = false;
            while ($lookuprow = db_fetch_numarray($rsLookup)) {
                $lookupvalue = $lookuprow[0];
                if ($found) {
                    $out .= ",";
                }
                $found = true;
                $out .= GetDataInt($lookupvalue, $data, $field, ViewFormat($field));
            }
            if ($found) {
                if (NeedEncode($field) && $mode != MODE_EXPORT) {
                    return ProcessLargeText($out, $iquery, "", $mode, GetEditFormat($field));
                } else {
                    return $out;
                }
            }
        }
    } else {
        $strdata = make_db_value($field, $value);
        $LookupSQL .= GetLWLinkField($field) . " = " . $strdata;
        $where = GetLWWhere($field);
        if (strlen($where)) {
            $LookupSQL .= " and (" . $where . ")";
        }
        LogInfo($LookupSQL);
        $rsLookup = db_query($LookupSQL, $conn);
        if ($lookuprow = db_fetch_numarray($rsLookup)) {
            $lookupvalue = $lookuprow[0];
        }
    }
    if (!$out) {
        $out = GetDataInt($lookupvalue, $data, $field, ViewFormat($field));
    }
    if (NeedEncode($field) && $mode != MODE_EXPORT) {
        $value = ProcessLargeText($out, $iquery, "", $mode, GetEditFormat($field));
    } else {
        $value = $out;
    }
    return $value;
}
    }
    if ($rowcount > $display_count + 2) {
        $xt->assign("display_first", true);
        $xt->assign("display_count", $display_count);
    } else {
        $display_count = $rowcount;
    }
    $rowinfo = array();
    while (($data = db_fetch_array($rs)) && $recordsCounter < $display_count) {
        $recordsCounter++;
        $row = array();
        $keylink = "";
        $keylink .= "&key1=" . htmlspecialchars(rawurlencode(@$data["ID"]));
        //	ID -
        $value = "";
        $value = ProcessLargeText(GetData($data, "ID", ""), "field=ID" . $keylink, "", MODE_PRINT);
        $row["ID_value"] = $value;
        //	Customer ID -
        $value = "";
        $value = DisplayLookupWizard("Customer ID", $data["Customer ID"], $data, $keylink, MODE_PRINT);
        $row["Customer_ID_value"] = $value;
        //	Module ID -
        $value = "";
        $value = DisplayLookupWizard("Module ID", $data["Module ID"], $data, $keylink, MODE_PRINT);
        $row["Module_ID_value"] = $value;
        $rowinfo[] = $row;
    }
    $xt->assign_loopsection("details_row", $rowinfo);
} else {
}
$xt->display("Customer_Module_Assignment_detailspreview.htm");
コード例 #18
0
 $record["Module_Type_value"] = $value;
 //	Module Status -
 $value = "";
 $value = DisplayLookupWizard("Module Status", $data["Module Status"], $data, $keylink, MODE_PRINT);
 $record["Module_Status_value"] = $value;
 //	Module Condition -
 $value = "";
 $value = DisplayLookupWizard("Module Condition", $data["Module Condition"], $data, $keylink, MODE_PRINT);
 $record["Module_Condition_value"] = $value;
 //	Serial Num -
 $value = "";
 $value = ProcessLargeText(GetData($data, "Serial Num", ""), "field=Serial+Num" . $keylink, "", MODE_PRINT);
 $record["Serial_Num_value"] = $value;
 //	Entry Date - Short Date
 $value = "";
 $value = ProcessLargeText(GetData($data, "Entry Date", "Short Date"), "field=Entry+Date" . $keylink, "", MODE_PRINT);
 $record["Entry_Date_value"] = $value;
 if ($col < $colsonpage) {
     $record["endrecord_block"] = true;
 }
 $record["grid_recordheader"] = true;
 $record["grid_vrecord"] = true;
 if ($eventObj->exists("BeforeMoveNextPrint")) {
     $eventObj->BeforeMoveNextPrint($data, $row, $record);
 }
 $row["grid_record"]["data"][] = $record;
 if ($eventObj->exists("ListFetchArray")) {
     $data = $eventObj->ListFetchArray($rs);
 } else {
     $data = db_fetch_array($rs);
 }
コード例 #19
0
 $row = array();
 $row["grid_record"] = array();
 $row["grid_record"]["data"] = array();
 for ($col = 1; $data && ($all || $recno <= $PageSize) && $col <= 1; $col++) {
     $record = array();
     $recno++;
     $records++;
     $keylink = "";
     $keylink .= "&key1=" . htmlspecialchars(rawurlencode(@$data["Code"]));
     //	Code -
     $value = "";
     $value = ProcessLargeText(GetData($data, "Code", ""), "field=Code" . $keylink, "", MODE_PRINT);
     $record["Code_value"] = $value;
     //	Tamper Type -
     $value = "";
     $value = ProcessLargeText(GetData($data, "Tamper Type", ""), "field=Tamper+Type" . $keylink, "", MODE_PRINT);
     $record["Tamper_Type_value"] = $value;
     if ($col < $colsonpage) {
         $record["endrecord_block"] = true;
     }
     $record["grid_recordheader"] = true;
     $record["grid_vrecord"] = true;
     if ($eventObj->exists("BeforeMoveNextPrint")) {
         $eventObj->BeforeMoveNextPrint($data, $row, $record);
     }
     $row["grid_record"]["data"][] = $record;
     if ($eventObj->exists("ListFetchArray")) {
         $data = $eventObj->ListFetchArray($rs);
     } else {
         $data = db_fetch_array($rs);
     }
コード例 #20
0
function DisplayMasterTableInfo_LU_Module_Status($params)
{
    $detailtable = $params["detailtable"];
    $keys = $params["keys"];
    global $conn, $strTableName;
    $xt = new Xtempl();
    $oldTableName = $strTableName;
    $strTableName = "dbo.LU_Module Status";
    //$strSQL = "SELECT Code,   Status  FROM dbo.[LU_Module Status]";
    $sqlHead = "SELECT Code,   Status";
    $sqlFrom = "FROM dbo.[LU_Module Status]";
    $sqlWhere = "";
    $sqlTail = "";
    $where = "";
    $mKeys = array();
    $showKeys = "";
    global $page_styles, $page_layouts, $page_layout_names, $container_styles;
    $layout = new TLayout("masterlist", "BoldOrange", "MobileOrange");
    $layout->blocks["bare"] = array();
    $layout->containers["0"] = array();
    $layout->containers["0"][] = array("name" => "masterlistheader", "block" => "", "substyle" => 1);
    $layout->skins["0"] = "empty";
    $layout->blocks["bare"][] = "0";
    $layout->containers["mastergrid"] = array();
    $layout->containers["mastergrid"][] = array("name" => "masterlistfields", "block" => "", "substyle" => 1);
    $layout->skins["mastergrid"] = "grid";
    $layout->blocks["bare"][] = "mastergrid";
    $page_layouts["LU_Module_Status_masterlist"] = $layout;
    if ($detailtable == "dbo.Module") {
        $where .= GetFullFieldName("Code") . "=" . make_db_value("Code", $keys[1 - 1]);
        $showKeys .= " " . GetFieldLabel("dbo_LU_Module_Status", "Code") . ": " . $keys[1 - 1];
        $xt->assign('showKeys', $showKeys);
    }
    if (!$where) {
        $strTableName = $oldTableName;
        return;
    }
    $str = SecuritySQL("Search");
    if (strlen($str)) {
        $where .= " and " . $str;
    }
    $strWhere = whereAdd($sqlWhere, $where);
    if (strlen($strWhere)) {
        $strWhere = " where " . $strWhere . " ";
    }
    $strSQL = $sqlHead . ' ' . $sqlFrom . $strWhere . $sqlTail;
    //	$strSQL=AddWhere($strSQL,$where);
    LogInfo($strSQL);
    $rs = db_query($strSQL, $conn);
    $data = db_fetch_array($rs);
    if (!$data) {
        $strTableName = $oldTableName;
        return;
    }
    $keylink = "";
    $keylink .= "&key1=" . htmlspecialchars(rawurlencode(@$data["Code"]));
    //	Code -
    $value = "";
    $value = ProcessLargeText(GetData($data, "Code", ""), "field=Code" . $keylink);
    $xt->assign("Code_mastervalue", $value);
    //	Status -
    $value = "";
    $value = ProcessLargeText(GetData($data, "Status", ""), "field=Status" . $keylink);
    $xt->assign("Status_mastervalue", $value);
    $xt->display("LU_Module_Status_masterlist.htm");
    $strTableName = $oldTableName;
}
コード例 #21
0
 //Units -
 $value = "";
 $value = ProcessLargeText(GetData($data, "Units", ""), "", "", MODE_VIEW);
 if ($mainTableOwnerID == "Units") {
     $ownerIdValue = $value;
 }
 $xt->assign("Units_value", $value);
 if (!$pageObject->isAppearOnTabs("Units")) {
     $xt->assign("Units_fieldblock", true);
 } else {
     $xt->assign("Units_tabfieldblock", true);
 }
 ////////////////////////////////////////////
 //PerUnit Price - Number
 $value = "";
 $value = ProcessLargeText(GetData($data, "PerUnit Price", "Number"), "", "", MODE_VIEW);
 if ($mainTableOwnerID == "PerUnit Price") {
     $ownerIdValue = $value;
 }
 $xt->assign("PerUnit_Price_value", $value);
 if (!$pageObject->isAppearOnTabs("PerUnit Price")) {
     $xt->assign("PerUnit_Price_fieldblock", true);
 } else {
     $xt->assign("PerUnit_Price_tabfieldblock", true);
 }
 /*$jsKeysObj = 'window.recKeysObj = {';
 	$jsKeysObj .= "'".jsreplace("Units")."': '".(jsreplace(@$data["Units"]))."', ";
 $jsKeysObj = substr($jsKeysObj, 0, strlen($jsKeysObj)-2);
 $jsKeysObj .= '};';
 $pageObject->AddJsCode($jsKeysObj);	
 */
コード例 #22
0
 $row = array();
 $row["grid_record"] = array();
 $row["grid_record"]["data"] = array();
 for ($col = 1; $data && ($all || $recno <= $PageSize) && $col <= 1; $col++) {
     $record = array();
     $recno++;
     $records++;
     $keylink = "";
     $keylink .= "&key1=" . htmlspecialchars(rawurlencode(@$data["Code"]));
     //	Code -
     $value = "";
     $value = ProcessLargeText(GetData($data, "Code", ""), "field=Code" . $keylink, "", MODE_PRINT);
     $record["Code_value"] = $value;
     //	Module Type -
     $value = "";
     $value = ProcessLargeText(GetData($data, "Module Type", ""), "field=Module+Type" . $keylink, "", MODE_PRINT);
     $record["Module_Type_value"] = $value;
     if ($col < $colsonpage) {
         $record["endrecord_block"] = true;
     }
     $record["grid_recordheader"] = true;
     $record["grid_vrecord"] = true;
     if ($eventObj->exists("BeforeMoveNextPrint")) {
         $eventObj->BeforeMoveNextPrint($data, $row, $record);
     }
     $row["grid_record"]["data"][] = $record;
     if ($eventObj->exists("ListFetchArray")) {
         $data = $eventObj->ListFetchArray($rs);
     } else {
         $data = db_fetch_array($rs);
     }
コード例 #23
0
function DisplayMasterTableInfo_LU_Anomaly_Type($params)
{
    $detailtable = $params["detailtable"];
    $keys = $params["keys"];
    global $conn, $strTableName;
    $xt = new Xtempl();
    $oldTableName = $strTableName;
    $strTableName = "dbo.LU_Anomaly Type";
    //$strSQL = "SELECT Code,   [Tamper Type]  FROM dbo.[LU_Anomaly Type]";
    $sqlHead = "SELECT Code,   [Tamper Type]";
    $sqlFrom = "FROM dbo.[LU_Anomaly Type]";
    $sqlWhere = "";
    $sqlTail = "";
    $where = "";
    global $page_styles, $page_layouts, $page_layout_names, $container_styles;
    $layout = new TLayout("masterprint", "BoldOrange", "MobileOrange");
    $layout->blocks["bare"] = array();
    $layout->containers["0"] = array();
    $layout->containers["0"][] = array("name" => "masterprintheader", "block" => "", "substyle" => 1);
    $layout->skins["0"] = "empty";
    $layout->blocks["bare"][] = "0";
    $layout->containers["mastergrid"] = array();
    $layout->containers["mastergrid"][] = array("name" => "masterprintfields", "block" => "", "substyle" => 1);
    $layout->skins["mastergrid"] = "grid";
    $layout->blocks["bare"][] = "mastergrid";
    $page_layouts["LU_Anomaly_Type_masterprint"] = $layout;
    if ($detailtable == "dbo.Anomalies") {
        $where .= GetFullFieldName("Code") . "=" . make_db_value("Code", $keys[1 - 1]);
    }
    if (!$where) {
        $strTableName = $oldTableName;
        return;
    }
    $str = SecuritySQL("Export");
    if (strlen($str)) {
        $where .= " and " . $str;
    }
    $strWhere = whereAdd($sqlWhere, $where);
    if (strlen($strWhere)) {
        $strWhere = " where " . $strWhere . " ";
    }
    $strSQL = $sqlHead . ' ' . $sqlFrom . $strWhere . $sqlTail;
    //	$strSQL=AddWhere($strSQL,$where);
    LogInfo($strSQL);
    $rs = db_query($strSQL, $conn);
    $data = db_fetch_array($rs);
    if (!$data) {
        $strTableName = $oldTableName;
        return;
    }
    $keylink = "";
    $keylink .= "&key1=" . htmlspecialchars(rawurlencode(@$data["Code"]));
    //	Code -
    $value = "";
    $value = ProcessLargeText(GetData($data, "Code", ""), "field=Code" . $keylink, "", MODE_PRINT);
    $xt->assign("Code_mastervalue", $value);
    //	Tamper Type -
    $value = "";
    $value = ProcessLargeText(GetData($data, "Tamper Type", ""), "field=Tamper+Type" . $keylink, "", MODE_PRINT);
    $xt->assign("Tamper_Type_mastervalue", $value);
    $xt->display("LU_Anomaly_Type_masterprint.htm");
    $strTableName = $oldTableName;
}
コード例 #24
0
 //Anomaly Type -
 $value = "";
 $value = DisplayLookupWizard("Anomaly Type", $data["Anomaly Type"], $data, $keylink, MODE_VIEW);
 if ($mainTableOwnerID == "Anomaly Type") {
     $ownerIdValue = $value;
 }
 $xt->assign("Anomaly_Type_value", $value);
 if (!$pageObject->isAppearOnTabs("Anomaly Type")) {
     $xt->assign("Anomaly_Type_fieldblock", true);
 } else {
     $xt->assign("Anomaly_Type_tabfieldblock", true);
 }
 ////////////////////////////////////////////
 //Date Time - Short Date
 $value = "";
 $value = ProcessLargeText(GetData($data, "Date Time", "Short Date"), "", "", MODE_VIEW);
 if ($mainTableOwnerID == "Date Time") {
     $ownerIdValue = $value;
 }
 $xt->assign("Date_Time_value", $value);
 if (!$pageObject->isAppearOnTabs("Date Time")) {
     $xt->assign("Date_Time_fieldblock", true);
 } else {
     $xt->assign("Date_Time_tabfieldblock", true);
 }
 ////////////////////////////////////////////
 //Action Taken -
 $value = "";
 $value = DisplayLookupWizard("Action Taken", $data["Action Taken"], $data, $keylink, MODE_VIEW);
 if ($mainTableOwnerID == "Action Taken") {
     $ownerIdValue = $value;
コード例 #25
0
        $row["PF_Yellow_value"] = $value;
        //	Peak Power -
        $value = "";
        $value = ProcessLargeText(GetData($data, "Peak Power", ""), "field=Peak+Power" . $keylink, "", MODE_PRINT);
        $row["Peak_Power_value"] = $value;
        //	Date Time - Short Date
        $value = "";
        $value = ProcessLargeText(GetData($data, "Date Time", "Short Date"), "field=Date+Time" . $keylink, "", MODE_PRINT);
        $row["Date_Time_value"] = $value;
        //	IsSync - Checkbox
        $value = "";
        $value = GetData($data, "IsSync", "Checkbox");
        $row["IsSync_value"] = $value;
        //	Currunt Readings -
        $value = "";
        $value = ProcessLargeText(GetData($data, "Currunt Readings", ""), "field=Currunt+Readings" . $keylink, "", MODE_PRINT);
        $row["Currunt_Readings_value"] = $value;
        $rowinfo[] = $row;
    }
    $xt->assign_loopsection("details_row", $rowinfo);
} else {
}
$xt->display("Readings_detailspreview.htm");
if ($mode != "inline") {
    echo "counterSeparator" . postvalue("counter");
    $layout = GetPageLayout(GoodFieldName($strTableName), 'detailspreview');
    if ($layout) {
        $rtl = $xt->getReadingOrder() == 'RTL' ? 'RTL' : '';
        echo "counterSeparator" . "styles/" . $layout->style . "/style" . $rtl . "counterSeparator" . "pagestyles/" . $layout->name . $rtl . "counterSeparator" . $layout->style . " page-" . $layout->name;
    }
}
コード例 #26
0
 //Code -
 $value = "";
 $value = ProcessLargeText(GetData($data, "Code", ""), "", "", MODE_VIEW);
 if ($mainTableOwnerID == "Code") {
     $ownerIdValue = $value;
 }
 $xt->assign("Code_value", $value);
 if (!$pageObject->isAppearOnTabs("Code")) {
     $xt->assign("Code_fieldblock", true);
 } else {
     $xt->assign("Code_tabfieldblock", true);
 }
 ////////////////////////////////////////////
 //Module Type -
 $value = "";
 $value = ProcessLargeText(GetData($data, "Module Type", ""), "", "", MODE_VIEW);
 if ($mainTableOwnerID == "Module Type") {
     $ownerIdValue = $value;
 }
 $xt->assign("Module_Type_value", $value);
 if (!$pageObject->isAppearOnTabs("Module Type")) {
     $xt->assign("Module_Type_fieldblock", true);
 } else {
     $xt->assign("Module_Type_tabfieldblock", true);
 }
 /*$jsKeysObj = 'window.recKeysObj = {';
 	$jsKeysObj .= "'".jsreplace("Code")."': '".(jsreplace(@$data["Code"]))."', ";
 $jsKeysObj = substr($jsKeysObj, 0, strlen($jsKeysObj)-2);
 $jsKeysObj .= '};';
 $pageObject->AddJsCode($jsKeysObj);	
 */
コード例 #27
0
    }
    $pageObject->fillControlsMap($controls);
    //fill field tool tips
    $pageObject->fillFieldToolTips($fName);
    // fill special settings for timepicker
    if (GetEditFormat($fName) == 'Time') {
        $pageObject->fillTimePickSettings($fName, $data[$fName]);
    }
    if (ViewFormat($fName) == FORMAT_MAP) {
        $pageObject->googleMapCfg['isUseGoogleMap'] = true;
    }
    if ($detailKeys && in_array($fName, $detailKeys) && array_key_exists($fName, $data)) {
        if ((GetEditFormat($fName) == EDIT_FORMAT_LOOKUP_WIZARD || GetEditFormat($fName) == EDIT_FORMAT_RADIO) && GetpLookupType($fName) == LT_LOOKUPTABLE) {
            $value = DisplayLookupWizard($fName, $data[$fName], $data, "", MODE_VIEW);
        } elseif (NeedEncode($fName)) {
            $value = ProcessLargeText(GetData($data, $fName, ViewFormat($fName)), "field=" . rawurlencode(htmlspecialchars($fName)), "", MODE_VIEW);
        } else {
            $value = GetData($data, $fName, ViewFormat($fName));
        }
        $xt->assign($gfName . "_editcontrol", $value);
    }
}
//fill tab groups name and sections name to controls
$pageObject->fillCntrlTabGroups();
$pageObject->jsSettings['tableSettings'][$strTableName]["keys"] = $keys;
$pageObject->jsSettings['tableSettings'][$strTableName]["prevKeys"] = $prev;
$pageObject->jsSettings['tableSettings'][$strTableName]["nextKeys"] = $next;
if ($pageObject->lockingObj) {
    $pageObject->jsSettings['tableSettings'][$strTableName]["sKeys"] = $skeys;
    $pageObject->jsSettings['tableSettings'][$strTableName]["enableCtrls"] = $enableCtrlsForEditing;
    $pageObject->jsSettings['tableSettings'][$strTableName]["confirmTime"] = $pageObject->lockingObj->ConfirmTime;
コード例 #28
0
 $row = array();
 $row["grid_record"] = array();
 $row["grid_record"]["data"] = array();
 for ($col = 1; $data && ($all || $recno <= $PageSize) && $col <= 1; $col++) {
     $record = array();
     $recno++;
     $records++;
     $keylink = "";
     $keylink .= "&key1=" . htmlspecialchars(rawurlencode(@$data["Code"]));
     //	Code -
     $value = "";
     $value = ProcessLargeText(GetData($data, "Code", ""), "field=Code" . $keylink, "", MODE_PRINT);
     $record["Code_value"] = $value;
     //	Status -
     $value = "";
     $value = ProcessLargeText(GetData($data, "Status", ""), "field=Status" . $keylink, "", MODE_PRINT);
     $record["Status_value"] = $value;
     if ($col < $colsonpage) {
         $record["endrecord_block"] = true;
     }
     $record["grid_recordheader"] = true;
     $record["grid_vrecord"] = true;
     if ($eventObj->exists("BeforeMoveNextPrint")) {
         $eventObj->BeforeMoveNextPrint($data, $row, $record);
     }
     $row["grid_record"]["data"][] = $record;
     if ($eventObj->exists("ListFetchArray")) {
         $data = $eventObj->ListFetchArray($rs);
     } else {
         $data = db_fetch_array($rs);
     }
コード例 #29
0
function DisplayMasterTableInfo_Module($params)
{
    $detailtable = $params["detailtable"];
    $keys = $params["keys"];
    global $conn, $strTableName;
    $xt = new Xtempl();
    $oldTableName = $strTableName;
    $strTableName = "dbo.Module";
    //$strSQL = "SELECT ID,   [Module Type],   [Module Status],   [Module Condition],   [Serial Num],   [Entry Date]  FROM dbo.[Module]";
    $sqlHead = "SELECT ID,   [Module Type],   [Module Status],   [Module Condition],   [Serial Num],   [Entry Date]";
    $sqlFrom = "FROM dbo.[Module]";
    $sqlWhere = "";
    $sqlTail = "";
    $where = "";
    global $page_styles, $page_layouts, $page_layout_names, $container_styles;
    $layout = new TLayout("masterprint", "BoldOrange", "MobileOrange");
    $layout->blocks["bare"] = array();
    $layout->containers["0"] = array();
    $layout->containers["0"][] = array("name" => "masterprintheader", "block" => "", "substyle" => 1);
    $layout->skins["0"] = "empty";
    $layout->blocks["bare"][] = "0";
    $layout->containers["mastergrid"] = array();
    $layout->containers["mastergrid"][] = array("name" => "masterprintfields", "block" => "", "substyle" => 1);
    $layout->skins["mastergrid"] = "grid";
    $layout->blocks["bare"][] = "mastergrid";
    $page_layouts["Module_masterprint"] = $layout;
    if ($detailtable == "dbo.Anomalies") {
        $where .= GetFullFieldName("ID") . "=" . make_db_value("ID", $keys[1 - 1]);
    }
    if ($detailtable == "dbo.Customer Module Assignment") {
        $where .= GetFullFieldName("ID") . "=" . make_db_value("ID", $keys[1 - 1]);
    }
    if ($detailtable == "dbo.Readings") {
        $where .= GetFullFieldName("ID") . "=" . make_db_value("ID", $keys[1 - 1]);
    }
    if (!$where) {
        $strTableName = $oldTableName;
        return;
    }
    $str = SecuritySQL("Export");
    if (strlen($str)) {
        $where .= " and " . $str;
    }
    $strWhere = whereAdd($sqlWhere, $where);
    if (strlen($strWhere)) {
        $strWhere = " where " . $strWhere . " ";
    }
    $strSQL = $sqlHead . ' ' . $sqlFrom . $strWhere . $sqlTail;
    //	$strSQL=AddWhere($strSQL,$where);
    LogInfo($strSQL);
    $rs = db_query($strSQL, $conn);
    $data = db_fetch_array($rs);
    if (!$data) {
        $strTableName = $oldTableName;
        return;
    }
    $keylink = "";
    $keylink .= "&key1=" . htmlspecialchars(rawurlencode(@$data["ID"]));
    //	ID -
    $value = "";
    $value = ProcessLargeText(GetData($data, "ID", ""), "field=ID" . $keylink, "", MODE_PRINT);
    $xt->assign("ID_mastervalue", $value);
    //	Module Type -
    $value = "";
    $value = DisplayLookupWizard("Module Type", $data["Module Type"], $data, $keylink, MODE_PRINT);
    $xt->assign("Module_Type_mastervalue", $value);
    //	Module Status -
    $value = "";
    $value = DisplayLookupWizard("Module Status", $data["Module Status"], $data, $keylink, MODE_PRINT);
    $xt->assign("Module_Status_mastervalue", $value);
    //	Module Condition -
    $value = "";
    $value = DisplayLookupWizard("Module Condition", $data["Module Condition"], $data, $keylink, MODE_PRINT);
    $xt->assign("Module_Condition_mastervalue", $value);
    //	Serial Num -
    $value = "";
    $value = ProcessLargeText(GetData($data, "Serial Num", ""), "field=Serial+Num" . $keylink, "", MODE_PRINT);
    $xt->assign("Serial_Num_mastervalue", $value);
    //	Entry Date - Short Date
    $value = "";
    $value = ProcessLargeText(GetData($data, "Entry Date", "Short Date"), "field=Entry+Date" . $keylink, "", MODE_PRINT);
    $xt->assign("Entry_Date_mastervalue", $value);
    $xt->display("Module_masterprint.htm");
    $strTableName = $oldTableName;
}
コード例 #30
0
 $record["ID_value"] = $value;
 //	Module ID -
 $value = "";
 $value = DisplayLookupWizard("Module ID", $data["Module ID"], $data, $keylink, MODE_PRINT);
 $record["Module_ID_value"] = $value;
 //	Anomaly Description -
 $value = "";
 $value = ProcessLargeText(GetData($data, "Anomaly Description", ""), "field=Anomaly+Description" . $keylink, "", MODE_PRINT);
 $record["Anomaly_Description_value"] = $value;
 //	Anomaly Type -
 $value = "";
 $value = DisplayLookupWizard("Anomaly Type", $data["Anomaly Type"], $data, $keylink, MODE_PRINT);
 $record["Anomaly_Type_value"] = $value;
 //	Date Time - Short Date
 $value = "";
 $value = ProcessLargeText(GetData($data, "Date Time", "Short Date"), "field=Date+Time" . $keylink, "", MODE_PRINT);
 $record["Date_Time_value"] = $value;
 //	Action Taken -
 $value = "";
 $value = DisplayLookupWizard("Action Taken", $data["Action Taken"], $data, $keylink, MODE_PRINT);
 $record["Action_Taken_value"] = $value;
 if ($col < $colsonpage) {
     $record["endrecord_block"] = true;
 }
 $record["grid_recordheader"] = true;
 $record["grid_vrecord"] = true;
 if ($eventObj->exists("BeforeMoveNextPrint")) {
     $eventObj->BeforeMoveNextPrint($data, $row, $record);
 }
 $row["grid_record"]["data"][] = $record;
 if ($eventObj->exists("ListFetchArray")) {