当前位置: 首页>>代码示例>>PHP>>正文


PHP RSFormProHelper::getMappingQuery方法代码示例

本文整理汇总了PHP中RSFormProHelper::getMappingQuery方法的典型用法代码示例。如果您正苦于以下问题:PHP RSFormProHelper::getMappingQuery方法的具体用法?PHP RSFormProHelper::getMappingQuery怎么用?PHP RSFormProHelper::getMappingQuery使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RSFormProHelper的用法示例。


在下文中一共展示了RSFormProHelper::getMappingQuery方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: function_exists

        echo $i;
        ?>
">
					<?php 
        echo !empty($row->database) ? $this->escape($row->database) . '.' : '';
        ?>
`<?php 
        echo $this->escape($row->table);
        ?>
` (<?php 
        echo $row->connection ? JText::_('RSFP_FORM_MAPPINGS_CONNECTION_REMOTE') : JText::_('RSFP_FORM_MAPPINGS_CONNECTION_LOCAL');
        ?>
)
				</td>
				<td><?php 
        echo function_exists('wordwrap') ? wordwrap($this->escape(RSFormProHelper::getMappingQuery($row)), 150, '<br />', true) : $this->escape(RSFormProHelper::getMappingQuery($row));
        ?>
</td>
				<td class="order">
					<span><?php 
        echo str_replace(array('cb' . $i, 'listItemTask'), array('mp' . $i, 'orderMapping'), $this->mpagination->orderUpIcon($i, true, 'orderup', 'Move Up', 'ordering'));
        ?>
</span>
					<span><?php 
        echo str_replace(array('cb' . $i, 'listItemTask'), array('mp' . $i, 'orderMapping'), $this->mpagination->orderDownIcon($i, $n, true, 'orderdown', 'Move Down', 'ordering'));
        ?>
</span>
					<input type="text" name="mporder[]" size="5" value="<?php 
        echo $row->ordering;
        ?>
" disabled="disabled" class="text_area" style="text-align:center" />
开发者ID:jtresca,项目名称:nysurveyor,代码行数:31,代码来源:edit_mappings.php

示例2: processForm


//.........这里部分代码省略.........
         $mainframe->triggerEvent('rsfp_f_onBeforeStoreSubmissions', array(array('formId' => $formId, 'post' => &$post, 'SubmissionId' => $SubmissionId)));
         // Add to db (values)
         foreach ($post as $key => $val) {
             $val = is_array($val) ? implode("\n", $val) : $val;
             $val = RSFormProHelper::stripJava($val);
             $db->setQuery("INSERT INTO #__rsform_submission_values SET `SubmissionId`='" . $SubmissionId . "', `FormId`='" . $formId . "', `FieldName`='" . $db->getEscaped($key) . "', `FieldValue`='" . $db->getEscaped($val) . "'");
             $db->query();
         }
         //Trigger Event - onAfterStoreSubmissions
         $mainframe->triggerEvent('rsfp_f_onAfterStoreSubmissions', array(array('SubmissionId' => $SubmissionId, 'formId' => $formId)));
         // Send emails
         list($replace, $with) = RSFormProHelper::sendSubmissionEmails($SubmissionId);
         // Thank You Message
         $thankYouMessage = str_replace($replace, $with, $form->Thankyou);
         $form->ReturnUrl = str_replace($replace, $with, $form->ReturnUrl);
         // Set redirect link
         $u = RSFormProHelper::getURL();
         // Create the Continue button
         $continueButton = '';
         if ($form->ShowContinue) {
             // Create goto link
             $goto = 'document.location.reload();';
             // Cache workaround #1
             if ($cache_enabled) {
                 $goto = "document.location='" . addslashes($u) . "';";
             }
             if (!empty($form->ReturnUrl)) {
                 $goto = "document.location='" . addslashes($form->ReturnUrl) . "';";
             }
             // Continue button
             $continueButtonLabel = JText::_('RSFP_THANKYOU_BUTTON');
             if (strpos($continueButtonLabel, 'input')) {
                 $continueButton = JText::sprintf('RSFP_THANKYOU_BUTTON', $goto);
             } else {
                 $continueButton = '<br/><input type="button" class="rsform-submit-button" name="continue" value="' . JText::_('RSFP_THANKYOU_BUTTON') . '" onclick="' . $goto . '"/>';
             }
         }
         $RSadapter = RSFormProHelper::getLegacyAdapter();
         eval($form->ScriptProcess2);
         $thankYouMessage .= $continueButton;
         //Mappings
         //get mappings data
         $db->setQuery("SELECT * FROM #__rsform_mappings WHERE formId = " . (int) $formId . " ORDER BY ordering ASC ");
         $mappings = $db->loadObjectList();
         if (!empty($mappings)) {
             $lastinsertid = '';
             $replacewith = $with;
             array_walk($replacewith, array('RSFormProHelper', 'escapeSql'));
             foreach ($mappings as $mapping) {
                 //get the query
                 $query = RSFormProHelper::getMappingQuery($mapping);
                 //replace the placeholders
                 $query = str_replace($replace, $replacewith, $query);
                 //replace the last insertid placeholder
                 $query = str_replace('{last_insert_id}', $lastinsertid, $query);
                 if ($mapping->connection) {
                     $options = array('host' => $mapping->host, 'user' => $mapping->username, 'password' => $mapping->password, 'database' => $mapping->database);
                     $database = JDatabase::getInstance($options);
                     //is a valid database connection
                     if (is_a($database, 'JException')) {
                         continue;
                     }
                     $database->setQuery($query);
                     $database->query();
                     $lastinsertid = $database->insertid();
                 } else {
                     $db->setQuery($query);
                     $db->query();
                     $lastinsertid = $db->insertid();
                 }
             }
         }
         if (!$form->Keepdata) {
             $db->setQuery("DELETE FROM #__rsform_submission_values WHERE SubmissionId = " . (int) $SubmissionId . " ");
             $db->query();
             $db->setQuery("DELETE FROM #__rsform_submissions WHERE SubmissionId = " . (int) $SubmissionId . " ");
             $db->query();
         }
         //Trigger - After form process
         $mainframe->triggerEvent('rsfp_f_onAfterFormProcess', array(array('SubmissionId' => $SubmissionId, 'formId' => $formId)));
         if (!$form->ShowThankyou && $form->ReturnUrl) {
             $mainframe->redirect($form->ReturnUrl);
             return;
         }
         // SESSION quick hack - we base64 encode it here and decode it when we show it
         $session =& JFactory::getSession();
         $formParams = new stdClass();
         $formParams->formProcessed = true;
         $formParams->submissionId = $SubmissionId;
         $formParams->thankYouMessage = base64_encode($thankYouMessage);
         $session->set('com_rsform.formparams.' . $formId, $formParams);
         // Cache workaround #2
         if ($cache_enabled) {
             $uniqid = uniqid('rsform');
             $u .= strpos($u, '?') === false ? '?skipcache=' . $uniqid : '&skipcache=' . $uniqid;
         }
         $mainframe->redirect($u);
     }
     return false;
 }
开发者ID:atikahmed,项目名称:joomla-probid,代码行数:101,代码来源:rsform.php

示例3: processForm


//.........这里部分代码省略.........
             }
             // Continue button
             $continueButtonLabel = JText::_('RSFP_THANKYOU_BUTTON');
             if (strpos($continueButtonLabel, 'input')) {
                 $continueButton = JText::sprintf('RSFP_THANKYOU_BUTTON', $goto);
             } else {
                 if ($form->FormLayoutName == 'responsive') {
                     $continueButton .= '<div class="formResponsive">';
                 } else {
                     $continueButton .= '<br/>';
                 }
                 $continueButton .= '<input type="button" class="rsform-submit-button btn btn-primary" name="continue" value="' . JText::_('RSFP_THANKYOU_BUTTON') . '" onclick="' . $goto . '"/>';
                 if ($form->FormLayoutName == 'responsive') {
                     $continueButton .= '</div>';
                 }
             }
         }
         // get mappings data
         $db->setQuery("SELECT * FROM #__rsform_mappings WHERE formId = " . (int) $formId . " ORDER BY ordering ASC");
         $mappings = $db->loadObjectList();
         // get Post to another location
         $db->setQuery("SELECT * FROM #__rsform_posts WHERE form_id='" . (int) $formId . "' AND enabled='1'");
         $silentPost = $db->loadObject();
         $RSadapter = RSFormProHelper::getLegacyAdapter();
         eval($form->ScriptProcess2);
         $thankYouMessage .= $continueButton;
         //Mappings
         if (!empty($mappings)) {
             $lastinsertid = '';
             $replacewith = $with;
             array_walk($replacewith, array('RSFormProHelper', 'escapeSql'));
             foreach ($mappings as $mapping) {
                 //get the query
                 $query = RSFormProHelper::getMappingQuery($mapping);
                 //replace the placeholders
                 $query = str_replace($replace, $replacewith, $query);
                 //replace the last insertid placeholder
                 $query = str_replace('{last_insert_id}', $lastinsertid, $query);
                 if ($mapping->connection) {
                     $options = array('driver' => 'mysql', 'host' => $mapping->host, 'user' => $mapping->username, 'password' => $mapping->password, 'database' => $mapping->database);
                     if (RSFormProHelper::isJ('3.0')) {
                         $database = JDatabaseDriver::getInstance($options);
                     } else {
                         $database = JDatabase::getInstance($options);
                     }
                     //is a valid database connection
                     if (is_a($database, 'JException')) {
                         continue;
                     }
                     $database->setQuery($query);
                     $database->execute();
                     $lastinsertid = $database->insertid();
                 } else {
                     $db->setQuery($query);
                     $db->execute();
                     $lastinsertid = $db->insertid();
                 }
             }
         }
         if (!$form->Keepdata) {
             $db->setQuery("DELETE FROM #__rsform_submission_values WHERE SubmissionId = " . (int) $SubmissionId . " ");
             $db->execute();
             $db->setQuery("DELETE FROM #__rsform_submissions WHERE SubmissionId = " . (int) $SubmissionId . " ");
             $db->execute();
         }
         if ($silentPost && !empty($silentPost->url) && $silentPost->url != 'http://') {
开发者ID:renekreijveld,项目名称:rsformpro-bootstrapped,代码行数:67,代码来源:rsform.php

示例4: function_exists

        echo $i;
        ?>
">
					<?php 
        echo !empty($row->database) ? $row->database . '.' : '';
        ?>
`<?php 
        echo $row->table;
        ?>
` (<?php 
        echo $row->connection ? JText::_('RSFP_FORM_MAPPINGS_CONNECTION_REMOTE') : JText::_('RSFP_FORM_MAPPINGS_CONNECTION_LOCAL');
        ?>
)
				</td>
				<td><?php 
        echo function_exists('wordwrap') ? wordwrap(RSFormProHelper::getMappingQuery($row), 150, '<br />', true) : RSFormProHelper::getMappingQuery($row);
        ?>
</td>
				<td class="order">
					<span><?php 
        echo str_replace(array('cb' . $i, 'listItemTask'), array('mp' . $i, 'orderMapping'), $this->mpagination->orderUpIcon($i, true, 'orderup', 'Move Up', 'ordering'));
        ?>
</span>
					<span><?php 
        echo str_replace(array('cb' . $i, 'listItemTask'), array('mp' . $i, 'orderMapping'), $this->mpagination->orderDownIcon($i, $n, true, 'orderdown', 'Move Down', 'ordering'));
        ?>
</span>
					<input type="text" name="mporder[]" size="5" value="<?php 
        echo $row->ordering;
        ?>
" disabled="disabled" class="text_area" style="text-align:center" />
开发者ID:atikahmed,项目名称:joomla-probid,代码行数:31,代码来源:edit_mappings.php


注:本文中的RSFormProHelper::getMappingQuery方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。