本文整理汇总了PHP中General::getRecord方法的典型用法代码示例。如果您正苦于以下问题:PHP General::getRecord方法的具体用法?PHP General::getRecord怎么用?PHP General::getRecord使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类General
的用法示例。
在下文中一共展示了General::getRecord方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ProductUpdateCart
function ProductUpdateCart($argProductID, $argQty)
{
$objCore = new Core();
$objGeneral = new General();
$arrCartDetails = array();
$arrNewCart = array();
if (isset($_SESSION['sessCartDetails'])) {
$arrCartDetails = $_SESSION['sessCartDetails'];
}
foreach ($arrCartDetails as $arrTempCartData) {
$varPrdId = $arrTempCartData['ProductId'];
if ($varPrdId == $argProductID) {
$arrTempCartData['Qty'] = $argQty;
//getting details
$arrCol = array('pkProductID', 'ProductName', 'ProductCode', 'ProductDescription', 'ProductSpecifications', 'ProductWeight', 'ProductCost', 'ProductActualCost', 'ProductQuantity', 'ProductQuantityAvailable', 'ProductStatus', 'ProductIsFeatured', 'ProductImage', 'ProductIsSpecailOffer', 'ProductDateAdded', 'ProductDateModified');
$varWhr = 'pkProductID=' . $argProductID;
$arrProduct = $objGeneral->getRecord(TABLE_PRODUCTS, $arrCol, $varWhr);
}
array_push($arrNewCart, $arrTempCartData);
}
if ($_SESSION['sessMess']) {
$_SESSION['sessVarMsg'] = '';
$_SESSION['sessVarMsg'] = 'Cart details have been updated successfully .';
$_SESSION['sessFlag'] = false;
$objCore->setSuccessMsg($_SESSION['sessVarMsg']);
}
unset($_SESSION['sessCartDetails']);
$_SESSION['sessCartDetails'] = $arrNewCart;
}
示例2: sendNewsletter
function sendNewsletter($argArrPost)
{
$objValidation = new Validate_fields();
$objCore = new Core();
$objGeneral = new General();
$objValidation->check_4html = false;
// Server Side validation for fileds.
$objValidation->add_text_field('To', strip_tags($argArrPost['frmSendTo']), 'text', 'y');
$objValidation->add_text_field('Subject', strip_tags($argArrPost['frmNewsletterSubject']), 'text', 'y');
$objValidation->add_text_field('Message', $argArrPost['frmNewsletterMessage'], 'text', 'y');
if ($objValidation->validation()) {
$errorMsgFirst = 'Please enter required fields!';
} else {
$errorMsg = $objValidation->create_msg();
}
//Checking for Error.
if ($errorMsg) {
// Save Data into Session variable.
$objCore->setErrorMsg($errorMsg);
header("location: newsletter_send_uil.php?NewsletterID=" . $argArrPost['frmNewsletterID']);
exit;
} else {
$varWhr = "AdminUserName = '" . $_SESSION['sessAdminUserName'] . "' ";
$arrCols = array('AdminEmail');
$arrAdminInfo = $objGeneral->getRecord(TABLE_ADMIN, $arrCols, $varWhr);
$varAdminEmail = $arrAdminInfo[0]['AdminEmail'];
// MAIL CONTENT.
$varFromUser = SITE_NAME . '<' . $varToAdmin . '>';
$varSubject = SITE_NAME . ': Newsletter: ' . $argArrPost['frmNewsletterSubject'];
$varMessage = $argArrPost['frmNewsletterMessage'];
$varMessage = str_replace("\\", "", $varMessage);
$varMessage = str_replace("<IMG", "<img", $varMessage);
$chkStr = strstr($varMessage, "<img");
if ($chkStr) {
$varMessage = str_replace('src="/', 'src="' . SITE_ROOT_URL_HOST, $varMessage);
$varMessage = str_replace("html_editor//", "html_editor/", $varMessage);
}
// ARRAY
$arrColumns = array('pkSubscriberID', 'SubscriberEmail');
// CHECK FOR MEMBERS WHO WILL RECIEVED NEWSLETTER.
if ($argArrPost['frmSendTo'] == 'AllSubscribers') {
$varWhere = "1";
$arrSubscriberResult = $objGeneral->getRecord(TABLE_SUBSCRIBERS, $arrColumns, $varWhere);
for ($i = 0; $i < count($arrSubscriberResult); $i++) {
$varToUser = ' <' . $arrSubscriberResult[$i]['SubscriberEmail'] . '>';
//echo $varMessage;die;
$objCore->sendMail(ucwords($varToUser), $varFromUser, $varSubject, $varMessage);
}
$objCore->setSuccessMsg(ADMIN_NEWSLETTER_SEND_MAIL_TO_ALL_SUCCESS_MSG);
return true;
} else {
if ($argArrPost['frmSubscriberID']) {
foreach ($argArrPost['frmSubscriberID'] as $varSubscriberID) {
$varWhere = "pkSubscriberID = '" . $varSubscriberID . "'";
$arrResult = $objGeneral->getRecord(TABLE_SUBSCRIBERS, $arrColumns, $varWhere);
$varToUser = ' <' . $arrResult[0]['SubscriberEmail'] . '>';
//echo $varMessage;die;
$objCore->sendMail(ucwords($varToUser), $varFromUser, $varSubject, $varMessage);
}
}
$objCore->setSuccessMsg(ADMIN_NEWSLETTER_SEND_MAIL_SUCCESS_MSG);
return true;
}
}
}
示例3: sendOrderDetailMailToAdmin
function sendOrderDetailMailToAdmin($argUniqueOrderNumber, $arrCartDetails, $arrUserDetail)
{
$objCore = new Core();
$objGeneral = new General();
@extract($arrUserDetail);
$varPath = SITE_ROOT_URL . 'common/images/logo.jpg';
$arrAdminCol = array('pkadminID', 'AdminEmail');
//print_r($arrUserDetail);die;
$arrAdminInfo = $objGeneral->getRecord(admin, $arrAdminCol);
$varToAdmin = $arrAdminInfo[0]['AdminEmail'];
$varFrom = SITE_NAME . '<' . $varToAdmin . '>';
//code for emailTemplate
$varStr = '<table width="70%" border="0" cellspacing="0" cellpadding="0">
<tr><td>Dear Admin,<br>You have received a new order<br>
Below are order details:<br></td>
</tr>
</tr>
<tr><td>OrderID: ' . $argUniqueOrderNumber . '</td>
</tr>
</table>';
$varStr .= '<table width="70%" border="1" cellspacing="0" cellpadding="0">
<tr>
<th width="31%">Product</th>
<th width="21%">Unit Price</th>
<th width="23%">Qty.</th>
<th width="21%">Total</th>
</tr>';
foreach ($arrCartDetails as $arrTempCartData) {
$productid = $arrTempCartData['ProductId'];
$product = $arrTempCartData['ProductName'];
$productprice = $arrTempCartData['ProductPrice'];
$productcode = $arrTempCartData['ProductCode'];
$productqty = $arrTempCartData['Qty'];
$productimage = $arrTempCartData['ProductImage'];
/*$varDiscount = $_SESSION['sessOrderDiscount'];
$productprice = $productprice- $varDiscount;*/
$subtotal = $productqty * $productprice;
$total += $subtotal;
$_SESSION['sessAmount'] = '';
$_SESSION['sessAmount'] = $total;
if ($productimage != "") {
//Get file extention
$varExt = substr(strrchr($productimage, "."), 1);
$varImageFileNameNoExt = substr($productimage, 0, -(strlen($varExt) + 1));
//Create thumb file name
$varImageFileName = $varImageFileNameNoExt . '_thumb.' . $varExt;
$varPath = SITE_ROOT_URL;
//echo $varPath;
$path = $varPath . 'common/uploaded_files/products/' . $productimage;
$patExist = SOURCE_ROOT . 'common/uploaded_files/products/' . $productimage;
$noImage = SITE_ROOT_URL . 'common/images/bnoimage.jpg';
if (file_exists($patExist)) {
list($width, $height) = getimagesize($path);
$varImageFlag = 1;
} else {
$varImageFlag = 0;
$varImageFileName = '';
}
} else {
$varImageFileName = '';
}
$varStr .= '<tr><td> ';
if ($varImageFlag) {
$varPath = SITE_ROOT_URL;
$path = $varPath . 'common/uploaded_files/products/' . $productimage;
$varStr .= ' <img src=' . $path . ' width="132" height="80" >';
} else {
$varPath = SITE_ROOT_URL;
$path = $varPath . 'common/images/bnoimage.jpg';
$varStr .= ' <img src=' . $path . ' width="132" height="80" >';
}
$varStr .= '<br />
<td> ' . $objCore->setPriceFormat($productprice) . '</td>
<td> ' . $productqty . '</td>
<td> ' . $objCore->setPriceFormat($subtotal) . '</td>
</tr>';
}
if ($_SESSION['sessOrderDiscount']) {
$varStr .= '<tr>
<td colspan="3">Sub-Total:</td>
<td> ' . $objCore->setPriceFormat($total) . '</td>
</tr>';
$varStr .= '<tr>
<td colspan="3">Allowed Discount:</td>
<td> ' . $objCore->setPriceFormat($_SESSION['sessOrderDiscount']) . '</td>
</tr>';
$total = $total - $_SESSION['sessOrderDiscount'];
$varStr .= '<tr>
<td colspan="3">Final Amount:</td>
<td> ' . $objCore->setPriceFormat($total) . '</td>
</tr></table>';
} else {
$varStr .= '<tr>
<td colspan="3">Sub-Total:</td>
<td> ' . $objCore->setPriceFormat($total) . '</td>
</tr></table>';
}
$varStr .= '<table width="70%" border="0" cellspacing="0" cellpadding="0">
//.........这里部分代码省略.........
示例4: doCustomerLogin
function doCustomerLogin($argArrPOST)
{
$objCore = new Core();
$objGeneral = new General();
if ($argArrPOST) {
$varUserName = strip_tags(trim($argArrPOST['frmCustomerEmailID']));
$varPassword = strip_tags(trim($argArrPOST['frmCustomerPassword']));
$objValidation = new Validate_fields();
$objValidation->check_4html = true;
// Server Side validation for fileds.
$objValidation->add_text_field('Username', $varUserName, 'email', 'y');
$objValidation->add_text_field('Password', $varPassword, 'text', 'y');
if ($objValidation->validation()) {
$errorMsgFirst = 'Please enter required fields!';
} else {
$errorMsg = $objValidation->create_msg();
}
//Checking for Error.
if ($errorMsg) {
// Save Data into Session variable.
$_SESSION['sessArrLoginData'] = $argArrPOST;
$objCore->setErrorMsg($errorMsg);
return false;
} else {
$arrColumns = array('pkCustomerID', 'CustomerStatus', 'CustomerFirstName', 'CustomerLastName');
$varWhere = "CustomerEmailID = '" . $varUserName . "' AND CustomerPassword = encode('" . $varPassword . "','Demo Shop')";
$arrResult = $this->select(TABLE_CUSTOMERS, $arrColumns, $varWhere);
if ($arrResult) {
if ($arrResult['0']['CustomerStatus'] == 'Active') {
$_SESSION['sessCustomerID'] = $arrResult['0']['pkCustomerID'];
$_SESSION['sessCustomerUserName'] = $varUserName;
$_SESSION['sessCustomerFirstName'] = $arrResult['0']['CustomerFirstName'];
$_SESSION['sessCustomerLastName'] = $arrResult['0']['CustomerLastName'];
$_SESSION['sessCustomerPass'] = $varPassword;
return true;
} else {
$arrCol = array('AdminEmail');
//when Implement this then uncommented below two lines.
$arrAdminResult = $objGeneral->getRecord(TABLE_ADMIN, $arrCol);
$_SESSION['sessAdminEmail'] = $arrAdminResult[0]['AdminEmail'];
//$_SESSION['sessAdminEmail'] ='vineet.kumar@mail.Demo Shop.com';
$varEmail = '<a style="text-decoration:none; font-weight:normal; color:#Fcdeac;" href=mailto:' . $_SESSION['sessAdminEmail'] . '>' . $_SESSION['sessAdminEmail'] . '</a>';
$objCore->setErrorMsg('Sorry! Your account has been deactivated by site Administrator. For further queries contact at ' . $varEmail) . ".";
$_SESSION['sessCustomerID'] = '';
$_SESSION['sessCustomerUserName'] = '';
$_SESSION['sessCustomerPass'] = '';
$_SESSION['sessCustomerFirstName'] = '';
$_SESSION['sessCustomerLastName'] = '';
unset($_SESSION['sessCustomerID']);
unset($_SESSION['sessCustomerUserName']);
unset($_SESSION['sessCustomerPass']);
return false;
}
} else {
$objCore->setErrorMsg(USER_LOGIN_ERROR);
$_SESSION['sessArrLoginData'] = $argArrPOST;
$_SESSION['sessCustomerID'] = '';
$_SESSION['sessCustomerUserName'] = '';
$_SESSION['sessCustomerPass'] = '';
$_SESSION['sessAdminLastLogin'] = '';
$_SESSION['sessCustomerFirstName'] = '';
$_SESSION['sessCustomerLastName'] = '';
unset($_SESSION['sessCustomerID']);
unset($_SESSION['sessCustomerUserName']);
unset($_SESSION['sessCustomerPass']);
return false;
}
}
} else {
$objCore->setErrorMsg(USER_LOGIN_ERROR);
$_SESSION['sessArrLoginData'] = $argArrPOST;
$_SESSION['sessUserID'] = '';
$_SESSION['sessCustomerUserName'] = '';
$_SESSION['sessCustomerPass'] = '';
$_SESSION['sessCustomerFirstName'] = '';
$_SESSION['sessCustomerLastName'] = '';
unset($_SESSION['sessCustomerFirstName']);
unset($_SESSION['sessCustomerLastName']);
unset($_SESSION['sessUserID']);
unset($_SESSION['sessCustomerUserName']);
unset($_SESSION['sessCustomerPass']);
return false;
}
}
示例5: removeProductsInformation
function removeProductsInformation($argProductsID)
{
$objCore = new Core();
$objGeneral = new General();
$varPath = SOURCE_ROOT . 'common/uploaded_files/products/';
foreach ($argProductsID as $varDeleteProductsID) {
//delete and unlink images if exist
$arrColumn = array('ProductImage');
$varWhere = 'pkProductID =\'' . $varDeleteProductsID . '\'';
$varTableName = TABLE_PRODUCTS;
$arrResultProductImages = $objGeneral->getRecord($varTableName, $arrColumn, $varWhere);
if ($arrResultProductImages[0]['ProductImageName'] != '') {
//unlink image
$objGeneral->deleteImage($arrResultProductImages[0]['ProductImageName'], $varPath);
}
$varWhrCon = "pkProductID ='" . $varDeleteProductsID . "'";
$varTableName = TABLE_PRODUCTS;
$this->delete($varTableName, $varWhrCon);
}
//end for loop
$objCore->setSuccessMsg(ADMIN_DEL_PRODUCTS_SUCC_MSG);
$objCore->standardRedirect('product_list_uil.php');
}