コード例 #1
0
ファイル: mattrib.php プロジェクト: nhom5UET/tichhophethong
 public function countAttribs()
 {
     //---------------------------------------------------------------------
     //
     //---------------------------------------------------------------------
     $this->attribCount = array();
     $idx = 0;
     if (bAllowAccess('showPeople')) {
         $this->attribCount[$idx] = new stdClass();
         $this->attribCount[$idx]->enumType = CENUM_CONTEXT_PEOPLE;
         $this->attribCount[$idx]->strEnumType = strXlateContext(CENUM_CONTEXT_PEOPLE);
         $this->attribCntViaType($this->attribCount[$idx]->attribList, $this->attribCount[$idx]->lNumAttrib, CENUM_CONTEXT_PEOPLE);
         ++$idx;
         $this->attribCount[$idx] = new stdClass();
         $this->attribCount[$idx]->enumType = CENUM_CONTEXT_BIZ;
         $this->attribCount[$idx]->strEnumType = strXlateContext(CENUM_CONTEXT_BIZ);
         $this->attribCntViaType($this->attribCount[$idx]->attribList, $this->attribCount[$idx]->lNumAttrib, CENUM_CONTEXT_BIZ);
         ++$idx;
     }
     if (bAllowAccess('showClients')) {
         $this->attribCount[$idx] = new stdClass();
         $this->attribCount[$idx]->enumType = CENUM_CONTEXT_CLIENT;
         $this->attribCount[$idx]->strEnumType = strXlateContext(CENUM_CONTEXT_CLIENT);
         $this->attribCntViaType($this->attribCount[$idx]->attribList, $this->attribCount[$idx]->lNumAttrib, CENUM_CONTEXT_CLIENT);
         ++$idx;
     }
     if (bAllowAccess('showSponsors')) {
         $this->attribCount[$idx] = new stdClass();
         $this->attribCount[$idx]->enumType = CENUM_CONTEXT_SPONSORSHIP;
         $this->attribCount[$idx]->strEnumType = strXlateContext(CENUM_CONTEXT_SPONSORSHIP);
         $this->attribCntViaType($this->attribCount[$idx]->attribList, $this->attribCount[$idx]->lNumAttrib, CENUM_CONTEXT_SPONSORSHIP);
         ++$idx;
     }
     if (bAllowAccess('showFinancials')) {
         $this->attribCount[$idx] = new stdClass();
         $this->attribCount[$idx]->enumType = CENUM_CONTEXT_GIFT;
         $this->attribCount[$idx]->strEnumType = strXlateContext(CENUM_CONTEXT_GIFT);
         $this->attribCntViaType($this->attribCount[$idx]->attribList, $this->attribCount[$idx]->lNumAttrib, CENUM_CONTEXT_GIFT);
         ++$idx;
     }
 }
コード例 #2
0
 public function view($enumGroupType)
 {
     //---------------------------------------------------------------------
     //
     //---------------------------------------------------------------------
     $displayData = array();
     //-------------------------
     // models & helpers
     //-------------------------
     $this->load->model('groups/mgroups', 'clsGroups');
     $this->load->helper('groups/groups');
     groupExtensionProperties($enumGroupType, $gProps);
     $displayData['gProps'] =& $gProps;
     $displayData['enumGroupType'] = $enumGroupType = htmlspecialchars($enumGroupType);
     $displayData['strGroupType'] = $strGroupType = strXlateContext($enumGroupType);
     $this->clsGroups->gp_enumGroupType = $enumGroupType;
     $this->clsGroups->loadActiveGroupsViaType($this->clsGroups->gp_enumGroupType, 'groupName', '', false, null);
     $displayData['lNumGroups'] = $lNumGroups = $this->clsGroups->lNumGroupList;
     $displayData['arrGroupList'] = $this->clsGroups->arrGroupList;
     if ($lNumGroups > 0) {
         $idx = 0;
         foreach ($this->clsGroups->arrGroupList as $clsList) {
             $this->clsGroups->lGroupID = $lGID = $clsList->lKeyID;
             $displayData['lMembersInGroup'][$idx] = $this->clsGroups->lCountMembersInGroup($lGID, $enumGroupType);
             ++$idx;
         }
     }
     //----------------------
     // set breadcrumbs
     //----------------------
     $displayData['title'] = CS_PROGNAME . ' | Groups';
     $displayData['pageTitle'] = anchor('main/menu/admin', 'Admin', 'class="breadcrumb"') . ' | ' . anchor('admin/alists/showLists', 'Lists', 'class="breadcrumb"') . ' | Groups: ' . $strGroupType;
     $displayData['nav'] = $this->mnav_brain_jar->navData();
     $displayData['mainTemplate'] = 'groups/group_view';
     $this->load->vars($displayData);
     $this->load->view('template');
 }
コード例 #3
0
 function remove($enumGroupType, $lGID)
 {
     //-------------------------------------------------------------------------------
     // remove group
     //-------------------------------------------------------------------------------
     $this->load->model('groups/mgroups', 'clsGroups');
     $this->load->helper('groups/groups');
     $lGID = $this->clsGroups->lGroupID = (int) $lGID;
     $strGroupCat = strXlateContext($enumGroupType);
     $this->clsGroups->remGroup();
     $this->session->set_flashdata('msg', $strGroupCat . ' Group removed');
     redirect('groups/groups_view/view/' . $enumGroupType);
 }
コード例 #4
0
<?php

global $genumDateFormat;
$strImportType = $logEntry->enumImportType;
if ($strImportType == CENUM_CONTEXT_SPONSORPAY) {
    $strImportType = 'Sponsor Payment';
}
$strImportType = strtoupper(substr($strImportType, 0, 1)) . substr($strImportType, 1);
$params = array('enumStyle' => 'terse', 'clsRpt');
$clsRpt = new generic_rpt($params);
$clsRpt->strWidthLabel = '100pt';
openBlock('Import Log', '');
echoT($clsRpt->openReport());
echoT($clsRpt->openRow() . $clsRpt->writeLabel('Import ID:') . $clsRpt->writeCell(str_pad($logEntry->lKeyID, 5, '0', STR_PAD_LEFT)) . $clsRpt->closeRow());
echoT($clsRpt->openRow() . $clsRpt->writeLabel('Import Type:') . $clsRpt->writeCell($strImportType) . $clsRpt->closeRow());
if ($bPTable) {
    echoT($clsRpt->openRow() . $clsRpt->writeLabel('Table:') . $clsRpt->writeCell('[' . strXlateContext($logEntry->enumAttachType, true, false) . '] ' . htmlspecialchars($logEntry->strUserTableName)) . $clsRpt->closeRow());
}
echoT($clsRpt->openRow() . $clsRpt->writeLabel('Date of Import:') . $clsRpt->writeCell(date($genumDateFormat . ' H:i:s', $logEntry->dteOrigin)) . $clsRpt->closeRow());
echoT($clsRpt->openRow() . $clsRpt->writeLabel('Imported By:') . $clsRpt->writeCell($logEntry->strUserCSafeName) . $clsRpt->closeRow());
echoT($clsRpt->closeReport());
closeBlock();
コード例 #5
0
<?php

echoT('<br>' . form_open('admin/import/pTableImportPrep/' . CENUM_CONTEXT_PTABLE . '/' . $lTableID));
$cform = new generic_form();
echoT($cform->strSubmitButton('Continue to Import', 'subNext', ''));
echoT(form_close('<br>'));
echoT('
      <table class="dlView">
         <tr>
            <td colspan="3" class="dlViewTitle">
               Personalized Table Import<br>
               [' . strXlateContext($userTable->enumTType, true, false) . '] ' . htmlspecialchars($userTable->strUserTableName) . '
            </td>
         </tr>');
echoT('
         <tr>
            <td class="dlViewLabel">
               Field / Column Title
            </td>
            <td class="dlViewLabel">
               Type
            </td>
            <td class="dlViewLabel">
               Required?
            </td>
         </tr>');
echoT('
      <tr>
         <td class="dlView">' . $userTable->enumTType . ' ID
         </td>
         <td class="dlView">
コード例 #6
0
    $lLogID = $entry->lKeyID;
    $strType = $entry->enumImportType;
    if ($strType == CENUM_CONTEXT_SPONSORPAY) {
        $strType = 'Sponsor Payment';
    }
    $strType = strtoupper(substr($strType, 0, 1)) . substr($strType, 1);
    $bPTable = !is_null($entry->lUTableID);
    echoT('
         <tr class="makeStripe">
            <td class="enpRpt" style="text-align: center;">' . strLinkView_ImportEntries($lLogID, 'View import records', true) . ' ' . str_pad($lLogID, 5, '0', STR_PAD_LEFT) . '
            </td>');
    if ($bPTable) {
        echoT('
            <td class="enpRpt"  style="text-align: left;">
               Personalized Table<br>
               [' . strXlateContext($entry->enumAttachType, true, false) . '] ' . htmlspecialchars($entry->strUserTableName) . '
            </td>');
    } else {
        echoT('
            <td class="enpRpt"  style="text-align: left;">' . $strType . ' 
            </td>');
    }
    echoT('            
            <td class="enpRpt">' . date($genumDateFormat . ' H:i:s', $entry->dteOrigin) . '               
            </td>
            <td class="enpRpt" style="text-align: right;">' . number_format($entry->lNumRecs) . '
            </td>
            <td class="enpRpt" style="text-align: left;">' . $entry->strUserCSafeName . '
            </td>
         </tr>');
}
コード例 #7
0
<?php

$strContext = strXlateContext($enumAttachType, true, false);
if ($bNoTables) {
    echoT('<br>There are no <b>' . $strContext . '</b> personalized tables. Unable to continue.<br><br>');
    return;
}
echoT('Hello');
コード例 #8
0
    private function personalizedLogSearch(&$results, $enumContext)
    {
        //---------------------------------------------------------------------
        //
        //---------------------------------------------------------------------
        global $genumDateFormat;
        $cPer = new muser_fields();
        $results->strLabel = 'Personalized Table / ' . strXlateContext($enumContext, true, false);
        $results->lNumResults = 0;
        $sqlStr = '
            SELECT
               uflog_lKeyID, uflog_lFieldID, uflog_lForeignID,
               uflog_strLogTitle, uflog_strLogEntry,
               uflog_dteOrigin,
               pff_lKeyID, pff_lTableID, pff_lSortIDX, pff_strFieldNameInternal, pff_strFieldNameUser,
               pft_lKeyID, pft_strUserTableName, pft_strDataTableName, pft_enumAttachType

            FROM uf_logs
               INNER JOIN uf_fields ON uflog_lFieldID=pff_lKeyID
               INNER JOIN uf_tables ON pff_lTableID=pft_lKeyID

            WHERE NOT pft_bRetired
               AND pft_enumAttachType=' . strPrepStr($enumContext) . ' AND (' . $this->textSearchWhere('uflog_strLogTitle') . ' OR ' . $this->textSearchWhere('uflog_strLogEntry') . ')
            ORDER BY pft_strUserTableName, uflog_dteOrigin, uflog_lKeyID;';
        $query = $this->db->query($sqlStr);
        $results->lNumResults = $lNumRows = $query->num_rows();
        if ($lNumRows > 0) {
            $idx = 0;
            $results->matches = array();
            $bModelLoaded = array();
            foreach ($query->result() as $row) {
                $enumContext = $enumContext;
                $lForeignID = $row->uflog_lForeignID;
                if (!isset($bModelLoaded[$enumContext])) {
                    $bModelLoaded[$enumContext] = true;
                    loadSupportModels($enumContext, $lForeignID);
                }
                $results->matches[$idx] = new stdClass();
                $match =& $results->matches[$idx];
                contextNameLink($enumContext, $lForeignID, $strContextName, $strContextLink);
                $match->links = $strContextLink . ' ' . htmlspecialchars($strContextName);
                $strLabelStyle = ' text-align: left; padding: 0px; ';
                $strEntryStyle = ' padding: 0px 0px 0px 4px; ';
                $match->searchInfo = '
                 <table class="enpRptView" style="padding: 0px; margin: 0px;">
                    <tr>
                       <td class="enpViewLabel" style="' . $strLabelStyle . '">
                          Table:
                       </td>
                       <td class="enpView" style="' . $strEntryStyle . '">' . htmlspecialchars($row->pft_strUserTableName) . '
                       </td>
                    </tr>
                    <tr>
                       <td class="enpViewLabel" style="' . $strLabelStyle . '">
                          Field:
                       </td>
                       <td class="enpView" style="' . $strEntryStyle . '">' . htmlspecialchars($row->pff_strFieldNameUser) . '
                       </td>
                    </tr>
                    <tr>
                       <td class="enpViewLabel" style="' . $strLabelStyle . '">
                          Entry date:
                       </td>
                       <td class="enpView" style="' . $strEntryStyle . '">' . date($genumDateFormat, dteMySQLDate2Unix($row->uflog_dteOrigin)) . '
                       </td>
                  </table>';
                $match->text = $row->uflog_strLogTitle . "\n\n" . $row->uflog_strLogEntry;
                $match->textHighlighted = '<u>' . $this->highlightMatchedText($row->uflog_strLogTitle) . '</u><br>' . nl2br($this->highlightMatchedText($row->uflog_strLogEntry));
                ++$idx;
            }
        }
    }
コード例 #9
0
 function loadGroupInfo($lGroupID)
 {
     //-----------------------------------------------------------------------
     //
     //-----------------------------------------------------------------------
     $this->groupTable = array();
     if (is_array($lGroupID)) {
         if (count($lGroupID) == 0) {
             $strWhere = ' AND gp_lKeyID IN ( -1 ) ';
         } else {
             $strWhere = ' AND gp_lKeyID IN (' . implode(',', $lGroupID) . ') ';
         }
     } else {
         $strWhere = " AND gp_lKeyID={$lGroupID} ";
     }
     $sqlStr = "SELECT\n            gp_strGroupName, gp_enumGroupType,  gp_bTempGroup,\n            gp_strNotes, gp_lOriginID, gp_lLastUpdateID,\n            gp_dteExpire,\n            UNIX_TIMESTAMP(gp_dteOrigin)     AS dteOrigin,\n            UNIX_TIMESTAMP(gp_dteLastUpdate) AS dteLastUpdate\n         FROM groups_parent\n         WHERE 1 {$strWhere};";
     $query = $this->db->query($sqlStr);
     $this->numGroups = $numRows = $query->num_rows();
     if ($numRows == 0) {
         $this->groupTable[0] = null;
     } else {
         $idx = 0;
         foreach ($query->result() as $row) {
             $this->groupTable[$idx] = new stdClass();
             $this->groupTable[$idx]->gp_strGroupName = $row->gp_strGroupName;
             $this->groupTable[$idx]->gp_enumGroupType = $gp_enumGroupType = $row->gp_enumGroupType;
             $this->groupTable[$idx]->gp_bTempGroup = $row->gp_bTempGroup;
             $this->groupTable[$idx]->gp_strNotes = $row->gp_strNotes;
             $this->groupTable[$idx]->gp_lOriginID = $row->gp_lOriginID;
             $this->groupTable[$idx]->gp_lLastUpdateID = $row->gp_lLastUpdateID;
             $this->groupTable[$idx]->gp_dteExpire = dteMySQLDate2Unix($row->gp_dteExpire);
             $this->groupTable[$idx]->gp_dteOrigin = $row->dteOrigin;
             $this->groupTable[$idx]->gp_dteLastUpdate = $row->dteLastUpdate;
             $this->groupTable[$idx]->strGroupCategory = strXlateContext($gp_enumGroupType);
             ++$idx;
         }
     }
 }
コード例 #10
0
<?php

$clsForm = new generic_form();
$clsForm->strLabelClass = $clsForm->strLabelRowLabelClass = $clsForm->strLabelClassRequired = 'enpViewLabel';
$clsForm->strTitleClass = 'enpViewTitle';
$clsForm->strEntryClass = 'enpView';
$clsForm->bValueEscapeHTML = false;
$attributes = array('name' => 'frmUpload');
echoT(form_open_multipart('admin/import/importPrep/' . $enumImportType . '/' . $lTableID, $attributes));
openBlock('Import ' . strUpFirst($enumImportType) . ' Records', '');
echoT('<table class="enpView">');
if ($bPTableImport) {
    $clsForm->strStyleExtraLabel = 'padding-top: 2px;';
    echoT($clsForm->strLabelRow('Personalized Table', '[' . strXlateContext($utable->enumAttachType, true, false) . '] ' . htmlspecialchars($utable->strUserTableName), 1));
}
$clsForm->strExtraFieldText = form_error('userfile');
$clsForm->strStyleExtraLabel = 'padding-top: 6px;';
echoT($clsForm->strLabelRow('Import file (.csv)', '<input type="file" name="userfile" size="80" />', 1));
// add imported records into one or more groups
if ($ddlGroups != '') {
    echoT($clsForm->strLabelRow('Add imported records<br>to group(s)', $ddlGroups, 1));
}
//----------------------
// submit
// for some reason, using the technique to disable the submit button
// causes the file name not to be passed back to the controller,
// and the error "no file selected" is presented.
//----------------------
//   echoT($clsForm->strSubmitEntry('Import File', 1, 'cmdSubmit', 'text-align: left;'));
//                <!--  onclick=" this.disabled=1;  this.form.submit();" -->
echoT('