예제 #1
0
 function updateSubscriberList($argArrPost)
 {
     $objCore = new Core();
     $varID = implode('\',\'', $argArrPost['frmSubscriberID']);
     $varWhere = "pkSubscriberID IN('" . $varID . "')";
     $this->delete(TABLE_SUBSCRIBERS, $varWhere);
     //***end here
     $objCore->setSuccessMsg(ADMIN_SUBSCRIBER_DELETE);
     return true;
 }
예제 #2
0
 function saveClientExtras($argArrPost)
 {
     $objCore = new Core();
     $clientExtra1 = $argArrPost['ClientExtra1'];
     $clientExtra2 = $argArrPost['ClientExtra2'];
     if ($argArrPost['client_id'] != '') {
         $varWhere = 'pkClientID = ' . $argArrPost['client_id'];
         $arrclm = array('ClientExtra1' => $clientExtra1, 'ClientExtra2' => $clientExtra2);
         $varExtraID = $this->update(TABLE_CLIENTS, $arrclm, $varWhere);
         $objCore->setSuccessMsg("Extra settings updated successfully");
         return 2;
     }
 }
예제 #3
0
 function ProductDeleteFromWishlist($argProductID)
 {
     $objCore = new Core();
     $arrWishlistDetails = array();
     $arrNewWishlist = array();
     if (isset($_SESSION['sessWishlistDetails'])) {
         $arrWishlistDetails = $_SESSION['sessWishlistDetails'];
     }
     foreach ($arrWishlistDetails as $arrTempWishlistData) {
         $varPrdId = $arrTempWishlistData['ProductId'];
         if ($varPrdId != $argProductID) {
             array_push($arrNewWishlist, $arrTempWishlistData);
         }
     }
     $_SESSION['msg'] = '';
     $_SESSION['msg'] = 'Product(s) have been deleted successfully from your wishlist.';
     $objCore->setSuccessMsg($_SESSION['msg']);
     unset($_SESSION['sessWishlistDetails']);
     $_SESSION['sessWishlistDetails'] = $arrNewWishlist;
 }
예제 #4
0
 function updateUserList($argArrPost)
 {
     $objCore = new Core();
     if ($argArrPost['frmChangeAction1'] == 'Delete' || $argArrPost['frmChangeAction2'] == 'Delete') {
         foreach ($argArrPost['user_ids'] as $varNewsID) {
             $varWhr = "pkClientID = " . $varNewsID;
             $this->delete(TABLE_CLIENTS, $varWhr);
             $nichVarWhr = "fkClientID = " . $varNewsID;
             $this->delete(TABLE_NICHES, $nichVarWhr);
             $this->delete(TABLE_NICHE_LOCATIONS, $nichVarWhr);
             $urnsVarWhr = "fkClientID = " . $varNewsID;
             $this->delete(TABLE_URNS, $urnsVarWhr);
         }
         $objCore->setSuccessMsg("Client is successfully deleted");
         return 1;
     }
     if ($argArrPost['frmChangeAction1'] == 'Freezed' || $argArrPost['frmChangeAction2'] == 'Freezed') {
         foreach ($argArrPost['user_ids'] as $varNewsID) {
             $varWhr = "pkClientID = " . $varNewsID;
             $arrCln = array('ClientApprovalStatus' => 'freeze');
             $this->update(TABLE_CLIENTS, $arrCln, $varWhr);
         }
         $objCore->setSuccessMsg("Client Approval status is changed");
         return 2;
     }
     if ($argArrPost['frmChangeAction1'] == 'Approved' || $argArrPost['frmChangeAction2'] == 'Approved') {
         foreach ($argArrPost['user_ids'] as $varNewsID) {
             $varWhr = "pkClientID = '" . $varNewsID . "'";
             $arrCln = array('ClientApprovalStatus' => 'approve');
             $this->update(TABLE_CLIENTS, $arrCln, $varWhr);
         }
         $objCore->setSuccessMsg("Client Approval status is changed ");
         return 4;
     }
 }
예제 #5
0
  <div id="middlepart">

<!--  Login Box -->
   <div id="login">
<!-- ERROR DIV -->
    <div class="error" style="display:none;">
        <span>Invalid UserName!</span>
        <p> you have entered wrong UserName</p>
    </div>
<!-- ERROR DIV -->		
<table width="550" align="center">
<thead>
<?php 
if ($objCore->displaySessMsg() != '') {
    echo $objCore->displaySessMsg();
    $objCore->setSuccessMsg('');
    $objCore->setErrorMsg('');
}
?>
<tr><th colspan="2">
Client Forgot Password
</th>
</tr></thead>
<tr><td>
<!-- LOGIN FORM -->
	<form action="forgot_password_action.php" method="post" id="frm_forgot_pass" onsubmit="return validateForgotPassword('frm_forgot_pass');">
		<fieldset>
			<label><span style="color:#FF0000;">*</span> Login ID:</label>
			<input type="text" id="frmUserName" name="frmUserName" tabindex="1" class="input" value="<?php 
echo $varUserName;
?>
예제 #6
0
 function changePaging($argArrPOST)
 {
     //print_r($argArrPOST);die;
     $objCore = new Core();
     $varWhr = 'pkClientID=' . $argArrPOST['ClientID'];
     $arrColumns = array('ClientRecordLimit' => $argArrPOST['frmRecordLimit']);
     $_SESSION['sessClientPagingLimit'] = '';
     $_SESSION['sessClientPagingLimit'] = $argArrPOST['frmRecordLimit'];
     $this->update(TABLE_CLIENTS, $arrColumns, $varWhr);
     $objCore->setSuccessMsg("Page limit record is updated");
     return true;
 }
예제 #7
0
 function updateShippingDetails($argArrPOST)
 {
     //print_r($argArrPOST);die;
     $objCore = new Core();
     $objValid = new Validate_fields('');
     $objGeneral = new General();
     @extract($argArrPOST);
     //echo '<pre>';
     $objValid->check_4html = true;
     //Check card details
     /*$objValid->add_text_field('Card Number', strip_tags($argArrPOST['frmCustomerCardNumber']), 'number', 'y', 200);
     		$objValid->add_text_field('Card Type', strip_tags($argArrPOST['frmCustomerCardType']), 'text', 'y',100);
     	    $objValid->add_text_field('Card Expiry Year', strip_tags($argArrPOST['frmCardExpiryYear']), 'text', 'y', 30);
     		$objValid->add_text_field('Card Expiry Month', strip_tags($argArrPOST['frmCardExpiryMonth']), 'text', 'y', 30);
     		$objValid->add_text_field('Card Owner Name', strip_tags($argArrPOST['frmCustomerCardName']), 'text', 'y',100);
     		$objValid->add_text_field('Card Security Code', strip_tags($argArrPOST['frmCustomerCardSecCode']), 'number', 'y',100);*/
     $objValid->add_text_field('Billing Country', strip_tags(trim($argArrPOST['frmCustomerCountry'])), 'text', 'y');
     $objValid->add_text_field('Billing State', strip_tags(trim($argArrPOST['frmCustomerState'])), 'text', 'y');
     $objValid->add_text_field('Billing City', strip_tags(trim($argArrPOST['frmCustomerCity'])), 'text', 'y');
     $objValid->add_text_field('Billing Street Address 1', strip_tags(trim($argArrPOST['frmCustomerAddressOne'])), 'text', 'y');
     $objValid->add_text_field('Billing Zip Code', strip_tags(trim($argArrPOST['frmCustomerZipcode'])), 'text', 'y');
     //shipping address validation
     if ($objValid->validation()) {
         //$errorMsgFirst = 'Please enter required fields!';
     } else {
         $errorMsg = $objValid->create_msg();
     }
     if ($errorMsg) {
         $_SESSION['sessEditAccountDetails'] = $_POST;
         $objCore->setErrorMsg($errorMsg);
         return false;
     } else {
         //Server Side Error Msg for Billing ZipCode
         if ($argArrPOST['frmUserZipCode'] == '0') {
             $_SESSION['sessEditAccountDetails'] = $_POST;
             $errorMsg = 'Invalid Billing ZipCode';
             $objCore->setErrorMsg($errorMsg);
             return false;
         }
         //Server Side Error Msg Shipping ZipCode
         if ($argArrPOST['frmUserShippingZipCode'] == '0') {
             $_SESSION['sessEditAccountDetails'] = $_POST;
             $errorMsg = 'Invalid Shipping ZipCode';
             $objCore->setErrorMsg($errorMsg);
             return false;
         }
         //if no value in UserPhone field
         if ($frmAccountcheck == 'Yes') {
             //echo 'if';die;
             $arrClm = array('CustomerCity' => $argArrPOST['frmCustomerCity'], 'CustomerState' => $argArrPOST['frmCustomerState'], 'CustomerCountry' => $argArrPOST['frmCustomerCountry'], 'CustomerAddressOne' => $argArrPOST['frmCustomerAddressOne'], 'CustomerAddressTwo' => $argArrPOST['frmCustomerAddressTwo'], 'CustomerZipCode' => $argArrPOST['frmCustomerZipcode'], 'CustomerPhone' => $frmCustomerPhone, 'CustomerShippingCity' => $frmCustomerCity, 'CustomerShippingState' => $frmCustomerState, 'CustomerShippingCountry' => $frmCustomerCountry, 'CustomerShippingAddressOne' => $frmCustomerAddressOne, 'CustomerShippingAddressTwo' => $frmCustomerAddressTwo, 'CustomerShippingZipCode' => $frmCustomerZipcode, 'CustomerShippingPhone' => $frmCustomerPhone, 'CustomerIsAddressSame' => 'Yes', 'CustomerDateModified' => 'now()');
         } else {
             //echo 'else';die;
             $arrClm = array('CustomerCity' => $argArrPOST['frmCustomerCity'], 'CustomerState' => $argArrPOST['frmCustomerState'], 'CustomerCountry' => $argArrPOST['frmCustomerCountry'], 'CustomerAddressOne' => $argArrPOST['frmCustomerAddressOne'], 'CustomerAddressTwo' => $argArrPOST['frmCustomerAddressTwo'], 'CustomerZipcode' => $argArrPOST['frmCustomerZipcode'], 'CustomerPhone' => $argArrPOST['frmCustomerPhone'], 'CustomerShippingCity' => $argArrPOST['frmCustomerShippingCity'], 'CustomerShippingState' => $argArrPOST['frmCustomerShippingState'], 'CustomerShippingCountry' => $argArrPOST['frmCustomerShippingCountry'], 'CustomerShippingAddressOne' => $argArrPOST['frmCustomerShippingAddressOne'], 'CustomerShippingAddressTwo' => $argArrPOST['frmCustomerShippingAddressTwo'], 'CustomerShippingZipCode' => $argArrPOST['frmCustomerShippingZipcode'], 'CustomerShippingPhone' => $argArrPOST['frmCustomerShippingPhone'], 'CustomerIsAddressSame' => 'No', 'CustomerDateModified' => 'now()');
         }
         $varWhereCond = ' pkCustomerID = \'' . $_SESSION['sessCustomerID'] . '\'';
         $this->update(TABLE_CUSTOMERS, $arrClm, $varWhereCond);
         /*$arrclm = array(
         		'CustomerCardNumber'			        =>	$argArrPOST['frmCustomerCardNumber'], 
         		'CustomerCardType'		                =>	$argArrPOST['frmCustomerCardType'], 
         		'CustomerCardExpiryDate'			    =>	$argArrPOST['frmCardExpiryMonth'].':'.$argArrPOST['frmCardExpiryYear'], 
         		'CustomerCardName'			            =>	$argArrPOST['frmCustomerCardName'], 
         		'CustomerCardSecCode'					=>  $argArrPOST['frmCustomerCardSecCode'],
         		'CustomerCardDateModified'				=>	'now()');
         		$varWhereCond = ' fkCustomerID = \''.$_SESSION['sessCustomerID'].'\'';
         		$this->update(TABLE_CARD_INFO, $arrclm, $varWhereCond);		*/
         $objCore->setSuccessMsg(USER_ACCOUNT_DETAILS_SUCC_MSG);
         return true;
     }
 }
예제 #8
0
 function deleteUrns($urnID)
 {
     $objCore = new Core();
     $varWhr = "pkUrnID = " . $urnID;
     $this->delete(TABLE_URNS, $varWhr);
     $objCore->setSuccessMsg("Urn is successfully deleted");
     return 1;
 }
예제 #9
0
    function updateUserList($argArrPost)
    {
        $objCore = new Core();
        if ($argArrPost['frmChangeAction1'] == 'Delete' || $argArrPost['frmChangeAction2'] == 'Delete') {
            foreach ($argArrPost['user_ids'] as $varNewsID) {
                $varWhr = "pkClientID = " . $varNewsID;
                $this->delete(TABLE_CLIENTS, $varWhr);
                $nichVarWhr = "fkClientID = " . $varNewsID;
                $this->delete(TABLE_NICHES, $nichVarWhr);
                $this->delete(TABLE_NICHE_LOCATIONS, $nichVarWhr);
                $urnsVarWhr = "fkClientID = " . $varNewsID;
                $this->delete(TABLE_URNS, $urnsVarWhr);
            }
            $objCore->setSuccessMsg("Client is successfully deleted");
            return 1;
        }
        if ($argArrPost['frmChangeAction1'] == 'Freezed' || $argArrPost['frmChangeAction2'] == 'Freezed') {
            foreach ($argArrPost['user_ids'] as $varNewsID) {
                $varWhr = "pkClientID = " . $varNewsID;
                $arrCln = array('ClientApprovalStatus' => 'freeze');
                $this->update(TABLE_CLIENTS, $arrCln, $varWhr);
            }
            $objCore->setSuccessMsg("Client Approval status is changed");
            return 2;
        }
        if ($argArrPost['frmChangeAction1'] == 'Approved' || $argArrPost['frmChangeAction2'] == 'Approved') {
            foreach ($argArrPost['user_ids'] as $varNewsID) {
                $varWhr = "pkClientID = '" . $varNewsID . "'";
                $arrCln = array('ClientApprovalStatus' => 'approve');
                $this->update(TABLE_CLIENTS, $arrCln, $varWhr);
                $arrUsersFlds = array('pkClientID', 'ClientLoginID', 'ClientEmailAddress', 'ClientPassword');
                $varUsersWhere = ' 1 AND pkClientID = \'' . $varNewsID . '\'';
                $arrUsersList = $this->select(TABLE_CLIENTS, $arrUsersFlds, $varUsersWhere);
                $subject_client = 'Account Request Approve';
                // message
                $message = '<html>
				<head>
				  <title>Account request approve</title>
					<style>
					body,tr,td{font-size:11px; font-family:arial}
					</style>
				</head>
				<body>
				  <p>Below are the details.</p>
					<table>
						<tr>
						  <td>Login ID : </td>
						  <td>: ' . $arrUsersList['ClientLoginID'] . '</td>
						</tr>
						<tr>
						  <td>Email ID : </td>
						  <td>: ' . $arrUsersList['ClientEmailAddress'] . '</td> 
						</tr>
						<tr>
						  <td>Password : </td>
						  <td>: ' . $arrUsersList['ClientPassword'] . '</td>
						</tr>
						<tr><td >Regards, Urn-Registry.com Team</td></tr>
						<tr><td colspan="2"></td></tr>
				  </table>
				</body>
				</html>';
                // To send HTML mail, the Content-type header must be set
                $headers = 'MIME-Version: 1.0' . "\r\n";
                $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
                // Additional headers
                $headers .= 'From: <' . ADMIN_EMAIL . '>' . "\r\n";
                @mail($arrUsersList['ClientEmailAddress'], $subject_client, $message, $headers);
            }
            $objCore->setSuccessMsg("Client Approval status is changed ");
            return 4;
        }
    }
예제 #10
0
 function AddCategory($argArrPostData)
 {
     //print_r($argArrPostData);exit;
     $objCore = new Core();
     $objValid = new Validate_fields('');
     $objGeneral = new General();
     $objValid->check_4html = true;
     $objValid->add_text_field('Category Name', strip_tags(trim($argArrPostData['frmCategoryName'])), 'text', 'y');
     if ($objValid->validation()) {
         $errorMsgFirst = 'Please enter required fields!';
     } else {
         $errorMsg = $objValid->create_msg();
     }
     $arrSelectCol = array('pkCategoryID');
     if ($argArrPostData['frmCategoryID'] == '') {
         $varWhereCategoryName = 'CategoryName =\'' . trim($argArrPostData['frmCategoryName']) . '\'';
     } else {
         if ($argArrPostData['frmCategoryID'] != '') {
             $varWhereCategoryName = 'CategoryName =\'' . trim($argArrPostData['frmCategoryName']) . '\' AND pkCategoryID !=\'' . $argArrPostData['frmCategoryID'] . '\'';
         }
     }
     $arrCategoryID = $this->select(TABLE_CATEGORIES, $arrSelectCol, $varWhereCategoryName);
     if ($arrCategoryID) {
         $errorMsg .= ERR_CATEGORY_NAME_EXISTS;
     }
     if ($errorMsg) {
         //print_r($_POST);
         $_SESSION['sessCategory'] = $_POST;
         $objCore->setErrorMsg($errorMsg);
         return false;
     } else {
         if ($argArrPostData['frmCategoryID'] != '') {
             $arrCol = array('CategoryName' => $argArrPostData['frmCategoryName'], 'CategoryDateModified' => 'now()');
             $varWhere = '1 AND pkCategoryID = \'' . $argArrPostData['frmCategoryID'] . '\'';
             $this->update(TABLE_CATEGORIES, $arrCol, $varWhere);
             $varMsg = SUCC_CATEGORY_UPDATED;
         } else {
             $arrCol = array('CategoryName' => $argArrPostData['frmCategoryName'], 'CategoryDateAdded' => 'now()');
             $varResult = $this->insert(TABLE_CATEGORIES, $arrCol);
         }
         $objCore->setSuccessMsg($varMsg);
         $objCore->standardRedirect($_SESSION['sessCategoryRedirectURL']);
     }
 }
예제 #11
0
 function saveFeedback($argArrPOST)
 {
     $objTemplate = new EmailTemplate();
     $objValid = new Validate_fields();
     $objCore = new Core();
     $objGeneral = new General();
     $objValid->check_4html = true;
     $varUserUserName = $argArrPOST['frmEmail'];
     $varUserFirstName = $argArrPOST['frmName'];
     $varUserSubject = $argArrPOST['frmSubject'];
     $varMessage = $argArrPOST['frmMessage'];
     $objValid->add_text_field('Email', strip_tags($argArrPOST['frmEmail']), 'email', 'y', 255);
     $objValid->add_text_field('Name', strip_tags($argArrPOST['frmName']), 'text', 'y', 100);
     $objValid->add_text_field('Subject', strip_tags($argArrPOST['frmSubject']), 'text', 'y', 255);
     $objValid->add_text_field('Message', strip_tags($argArrPOST['frmMessage']), 'text', 'y');
     if ($objValid->validation()) {
         $errorMsgFirst = 'Please enter required fields!';
     } else {
         $errorMsg = $objValid->create_msg();
     }
     if ($errorMsg) {
         $objCore->setErrorMsg($errorMsg);
         return false;
     } else {
         $objAdminLogin = new AdminLogin();
         $varWhere = '';
         $arrAdminResult = $objAdminLogin->getAdminInfo($varWhere);
         $varAdminEmail = $arrAdminResult['0']['AdminEmail'];
         $varPath = "<img src = " . SITE_ROOT_URL . 'common/images/logo.jpg' . ">";
         $varFromUser = SITE_NAME . '<' . $varAdminEmail . '>';
         $varSiteName = SITE_NAME;
         $varWhereTemplate = ' EmailTemplateTitle = binary \'Feedback email to admin\' AND EmailTemplateStatus = \'Active\' ';
         $arrMailTemplate = $objTemplate->getTemplateInfo($varWhereTemplate);
         $varOutput = html_entity_decode(stripcslashes($arrMailTemplate[0]['EmailTemplateDescription']));
         $varSubject = html_entity_decode(stripcslashes($arrMailTemplate[0]['EmailTemplateSubject']));
         $varKeyword = array('{IMAGE_PATH}', '{SITE_NAME}', '{USER_FNAME}', '{USER_USERNAME}', '{USER_SUBJECT}', '{USER_MESSAGE}');
         $varKeywordValues = array($varPath, $varSiteName, $varUserFirstName, $varUserUserName, $varUserSubject, $varMessage);
         $varOutPutValues = str_replace($varKeyword, $varKeywordValues, $varOutput);
         $varSubject = str_replace('{SITE_NAME}', $varSiteName, $varSubject);
         //echo $varOutPutValues;echo $varAdminEmail;echo $varFromUser;echo $varSubject;die;
         $objCore->sendMail($varAdminEmail, $varFromUser, $varSubject, $varOutPutValues);
         $arrclm = array('FeedbackName' => $varUserFirstName, 'FeedbackEmail' => $varUserUserName, 'FeedbackSubject' => $varUserSubject, 'FeedbackDesc' => $varMessage, 'FeedbackStatus' => 'Unread', 'FeedbackDate' => 'now()');
         $varFeedbackID = $this->insert(TABLE_FEEDBACK, $arrclm);
         $objCore->setSuccessMsg(ADMIN_FEEDBACK_MSG);
     }
 }
예제 #12
0
 function updateTaxDiscount($argArrPost)
 {
     $objCore = new Core();
     $objTaxDiscount = new TaxDiscount();
     if ($argArrPost['frmChangeAction'] == 'Delete') {
         foreach ($argArrPost['frmTaxDiscountID'] as $varTaxDiscountID) {
             //check tax or discount exist or not
             $arrTaxDiscountWhere = " fkTaxDiscountID ='" . $varTaxDiscountID . "'";
             $arrColumn = array('pkProductTaxDiscountID');
             $arrTaxExist = $this->select(TABLE_PRODUCT_TAX_DISCOUNTS, $arrColumn, $arrTaxDiscountWhere);
             if ($arrTaxExist == '') {
                 //	DELETE ALL TaxDiscountS FIRST
                 $arrDelTaxDiscountWhere = " pkTaxDiscountID ='" . $varTaxDiscountID . "'";
                 $this->delete(TABLE_TAX_DISCOUNTS, $arrDelTaxDiscountWhere);
             } else {
                 $objCore->setErrorMsg(ADMIN_TAX_DISCOUNT_CANNOT_DELETE);
                 return false;
             }
         }
         // SET SUCCESS DELETE MESSAGE.
         $objCore->setSuccessMsg(ADMIN_TAX_DISCOUNT_DELETE);
         return true;
     }
     if ($argArrPost['frmChangeAction'] == 'Active') {
         foreach ($argArrPost['frmTaxDiscountID'] as $varTaxDiscountID) {
             // CREATE CONDITION FOR DELETE user RECORD.
             $varWhere = "pkTaxDiscountID = '" . $varTaxDiscountID . "'";
             $arrColumn = array('TaxDiscountStatus' => 'Active');
             $this->update(TABLE_TAX_DISCOUNTS, $arrColumn, $varWhere);
         }
         $objCore->setSuccessMsg(ADMIN_TAX_DISCOUNT_ACTIVE_MSG);
         return true;
     } else {
         foreach ($argArrPost['frmTaxDiscountID'] as $varTaxDiscountID) {
             // CREATE CONDITION FOR DELETE user RECORD.
             $varWhere = "pkTaxDiscountID = '" . $varTaxDiscountID . "'";
             $arrColumn = array('TaxDiscountStatus' => 'Inactive');
             $this->update(TABLE_TAX_DISCOUNTS, $arrColumn, $varWhere);
         }
         $objCore->setSuccessMsg(ADMIN_TAX_DISCOUNT_INACTIVE_MSG);
         return true;
     }
 }
예제 #13
0
 function forgotPasswordMail($argArrPOST)
 {
     $objTemplate = new EmailTemplate();
     $objValid = new Validate_fields();
     $objCore = new Core();
     $objGeneral = new General();
     $objValid->check_4html = true;
     $_SESSION['sessForgotValues'] = array();
     $objValid->add_text_field('Username (E-mail) ', strip_tags($argArrPOST['frmUserName']), 'email', 'y', 255);
     $objValid->add_text_field('Verification Code', strip_tags($argArrPOST['frmSecurityCode']), 'text', 'y', 255);
     if ($objValid->validation()) {
         $errorMsgFirst = 'Please enter required fields!';
     } else {
         $errorMsg = $objValid->create_msg();
     }
     if ($errorMsg) {
         $_SESSION['sessForgotValues'] = $argArrPOST;
         $objCore->setErrorMsg($errorMsg);
         return false;
     } else {
         if ($_SESSION['security_code'] == $argArrPOST['frmSecurityCode'] && !empty($_SESSION['security_code'])) {
             $varWhereCond = " AND AdminUserName  ='******'frmUserName'] . "'";
             $userRecords = $this->getAdminNumRows($varWhereCond);
             $userInfo = $this->getAdminInfo($varWhereCond);
             //if($userRecords > 0 && $userInfo['0']['AdminForgotPWStatus'] == 'Inactive')
             if ($userRecords > 0) {
                 $varAdminID = $userInfo['0']['pkAdminID'];
                 //memberdata contain member username
                 $varMemberData = trim(strip_tags($argArrPOST['frmUserName']));
                 $varForgotPasswordCode = $objGeneral->getValidRandomKey(TABLE_ADMIN, array('pkAdminID'), 'AdminForgotPWCode', '25');
                 $varForgotPasswordLink = '<a href="' . SITE_ROOT_URL . 'admin/reset_password.php?mid=' . $varAdminID . '&code=' . $varForgotPasswordCode . '">' . SITE_ROOT_URL . 'admin/reset_password.php?mid=' . $varAdminID . '&code=' . $varForgotPasswordCode . '</a>';
                 $arrColumns = array('AdminForgotPWStatus' => 'Active', 'AdminForgotPWCode' => $varForgotPasswordCode);
                 $varWhereCondition = 'pkAdminID = \'' . $varAdminID . '\'';
                 $this->update(TABLE_ADMIN, $arrColumns, $varWhereCondition);
                 $varAdminEmail = $userInfo[0]['AdminEmail'];
                 $varToUser = $varAdminEmail;
                 $varFromUser = SITE_NAME . '<' . $varAdminEmail . '>';
                 $varSiteName = SITE_NAME;
                 $varWhereTemplate = ' EmailTemplateTitle= \'Admin forgot password\' AND EmailTemplateStatus = \'Active\' ';
                 $arrMailTemplate = $objTemplate->getTemplateInfo($varWhereTemplate);
                 $varOutput = html_entity_decode(stripcslashes($arrMailTemplate[0]['EmailTemplateDescription']));
                 $varSubject = html_entity_decode(stripcslashes($arrMailTemplate[0]['EmailTemplateSubject']));
                 /********/
                 $varSubject = str_replace('{PROJECT_NAME}', SITE_NAME, html_entity_decode(stripcslashes($arrMailTemplate['0']['EmailTemplateSubject'])));
                 $varKeyword = array('{IMAGE_PATH}', '{MEMBER}', '{PROJECT_NAME}', '{USER_DATA}', '{FORGOT_PWD_LINK}', '{SITE_NAME}');
                 $varKeywordValues = array($varPathImage, 'Admin', SITE_NAME, $varMemberData, $varForgotPasswordLink, SITE_NAME);
                 $varOutPutValues = str_replace($varKeyword, $varKeywordValues, $varOutput);
                 // Calling mail function
                 //echo $varToUser . $varFromUser . $varSubject . $varOutPutValues;die;
                 $objCore->sendMail($varToUser, $varFromUser, $varSubject, $varOutPutValues);
                 $_SESSION['sessForgotValues'] = '';
                 $objCore->setSuccessMsg(ADMIN_FORGOT_PASSWORD_CONFIRM_MSG);
                 return true;
             } else {
                 $_SESSION['sessForgotValues'] = $argArrPOST;
                 $objCore->setErrorMsg(EMAIL_NOT_EXIST_MSG);
                 return true;
             }
         } else {
             $_SESSION['sessForgotValues'] = $argArrPOST;
             $objCore->setErrorMsg(INVALID_SECURITY_CODE_MSG);
             return false;
         }
     }
 }
예제 #14
0
 function ProductDeleteFromCart($argProductID)
 {
     $objCore = new Core();
     $arrCartDetails = array();
     $arrNewCart = array();
     if (isset($_SESSION['sessCartDetails'])) {
         $arrCartDetails = $_SESSION['sessCartDetails'];
     }
     foreach ($arrCartDetails as $arrTempCartData) {
         $varPrdId = $arrTempCartData['ProductId'];
         if ($varPrdId != $argProductID) {
             array_push($arrNewCart, $arrTempCartData);
         }
     }
     $_SESSION['msg'] = '';
     $_SESSION['msg'] = 'Product(s) have been deleted successfully from your shopping cart.';
     $objCore->setSuccessMsg($_SESSION['msg']);
     unset($_SESSION['sessCartDetails']);
     $_SESSION['sessCartDetails'] = $arrNewCart;
     $_SESSION['sessTotalQty'] = '';
     $_SESSION['sessSubTotal'] = '';
     $_SESSION['sessTotalWeight'] = '';
     $_SESSION['sessFlag'] = '';
 }
예제 #15
0
 function changeCustomerPassword($argArrPOST)
 {
     //print_r($argArrPOST);die;
     $objValid = new Validate_fields();
     $objCore = new Core();
     $objValid->check_4html = true;
     //print_r($argArrPOST);die;
     $_SESSION["sessChangeUserPassword"] = array();
     $varOldPassword = $argArrPOST['frmUserOldPassword'];
     $varNewPassword = $argArrPOST['frmUserNewPassword'];
     $varConfirmPassword = $argArrPOST['frmUserConfirmPassword'];
     //*** server side validation will start from here .
     $objValid->add_text_field('Current Password', strip_tags($argArrPOST['frmUserOldPassword']), 'text', 'y', 100);
     $objValid->add_text_field('New Password', strip_tags($argArrPOST['frmUserNewPassword']), 'text', 'y', 100);
     $objValid->add_text_field('Confirm New Password', strip_tags($argArrPOST['frmUserConfirmPassword']), 'text', 'y', 100);
     if ($objValid->validation()) {
         $errorMsgFirst = 'Please enter required fields!';
     } else {
         $errorMsg = $objValid->create_msg();
     }
     if ($varNewPassword != '' && $varConfirmPassword != '') {
         if ($varNewPassword != $varConfirmPassword) {
             $varErrorMessage = "New Password and Confirm New Password must be same.<br />";
             $errorMsg .= $varErrorMessage;
         }
     }
     if ($errorMsg) {
         $_SESSION["sessChangeUserPassword"] = $argArrPOST;
         $objCore->setErrorMsg($errorMsg);
         return false;
     } else {
         //*** server side validation end here
         $arrCol = array('pkCustomerID');
         $varWhereCondition = " AND CustomerEmailID ='" . $_SESSION['sessCustomerUserName'] . "' AND CustomerPassword = encode('" . $varOldPassword . "','Demo Shop')";
         $varResultRows = $this->getUserNumRows($varWhereCondition);
         if ($varResultRows) {
             //check for valid password
             if (!preg_match("/^[a-zA-Z0-9\\-\\!\\_\\#\\@]+\$/u", $varNewPassword)) {
                 $_SESSION["sessChangeUserPassword"] = $argArrPOST;
                 $objCore->setErrorMsg(ADMIN_SETTING_PAGE_PASSWORD_CHECK);
                 return false;
             } else {
                 //end check for valid password
                 $arrColumns = array('CustomerPassword' => 'encode(\'' . $varNewPassword . '\',\'Demo Shop\')');
                 $varWhere = "pkCustomerID ='" . $_SESSION['sessCustomerID'] . "'";
                 $_SESSION['sessChangeUserPassword'] = '';
                 $_SESSION['sessChangeUserPassword'] = $varNewPassword;
                 $varAffectedRows = $this->update(TABLE_CUSTOMERS, $arrColumns, $varWhere);
                 $this->sendChangePassMailToUser($argArrPOST);
                 $objCore->setSuccessMsg(ADMIN_CHANGE_PASSWORD_MSG);
                 return true;
             }
         } else {
             $objCore->setErrorMsg(ADMIN_CHANGE_PASSWORD_ERR);
             return false;
         }
     }
 }
예제 #16
0
 function changePaging($argArrPOST)
 {
     $objCore = new Core();
     $varWhr = 'pkAdminID = 1';
     $arrColumns = array('AdminRecordLimit' => $argArrPOST['frmRecordLimit']);
     $_SESSION['sessAdminPagingLimit'] = '';
     $_SESSION['sessAdminPagingLimit'] = $argArrPOST['frmRecordLimit'];
     $this->update(TABLE_ADMIN, $arrColumns, $varWhr);
     $objCore->setSuccessMsg("Record per page limit is updated");
     return true;
 }
예제 #17
0
 function updateNichesList($argArrPost)
 {
     $objCore = new Core();
     if ($argArrPost['frmChangeAction1'] == 'Delete' || $argArrPost['frmChangeAction2'] == 'Delete') {
         foreach ($argArrPost['niches_ids'] as $varNewsID) {
             $varWhr = "pkNicheID = " . $varNewsID;
             $this->delete(TABLE_NICHES, $varWhr);
             $locVarWhr = "fkNicheID = " . $varNewsID;
             $this->delete(TABLE_NICHE_LOCATIONS, $locVarWhr);
             $urnsVarWhr = "fkNicheID = " . $varNewsID;
             $this->delete(TABLE_URNS, $urnsVarWhr);
         }
         $objCore->setSuccessMsg("Niche is successfully deleted");
         return 1;
     }
     if ($argArrPost['frmChangeAction1'] == 'Active' || $argArrPost['frmChangeAction2'] == 'Active') {
         foreach ($argArrPost['niches_ids'] as $varNewsID) {
             $varWhr = "pkNicheID = " . $varNewsID;
             $arrCln = array('NicheStatus' => 'active');
             $this->update(TABLE_NICHES, $arrCln, $varWhr);
         }
         $objCore->setSuccessMsg("Niche status is activated");
         return 2;
     }
     if ($argArrPost['frmChangeAction1'] == 'Inactive' || $argArrPost['frmChangeAction2'] == 'Inactive') {
         foreach ($argArrPost['niches_ids'] as $varNewsID) {
             $varWhr = "pkNicheID = '" . $varNewsID . "'";
             $arrCln = array('NicheStatus' => 'inactive');
             $this->update(TABLE_NICHES, $arrCln, $varWhr);
         }
         $objCore->setSuccessMsg("Niche status is deactivated");
         return 3;
     }
 }
예제 #18
0
 function removeCouponInformation($argCouponID)
 {
     $objCore = new Core();
     foreach ($argCouponID as $varDeleteCouponID) {
         $varWhrCon = "pkcoupon_id ='" . $varDeleteCouponID . "'";
         $varTableName = coupon;
         $this->delete($varTableName, $varWhrCon);
     }
     $objCore->setSuccessMsg(ADMIN_DEL_COUPON_SUCC_MSG);
     $objCore->standardRedirect('Coupon_list_uil.php');
     exit;
 }
예제 #19
0
 function DeleteOrderDetail($argArrPost)
 {
     $objCore = new Core();
     if ($argArrPost['frmChangeAction'] == 'Delete') {
         //Declare Associative array and call database method for update all selected ids status as Active
         if ($argArrPost['frmOrderID']) {
             foreach ($argArrPost['frmOrderID'] as $varID) {
                 $varWhere = "pkOrderID = '" . $varID . "'";
                 $this->delete(orders, $varWhere);
             }
             //***end here
             $objCore->setSuccessMsg(ADMIN_ORDER_DELETE);
             return true;
         }
     }
 }
예제 #20
0
 function sendTellAFriend($argArrPost)
 {
     $objValidation = new Validate_fields();
     $objCore = new Core();
     $objGeneral = new General();
     $objValidation->check_4html = false;
     $objValidation->add_text_field('To', strip_tags($argArrPost['email']), 'text', 'y');
     $objAdminLogin = new AdminLogin();
     $arrAdminInfo = $objAdminLogin->getAdminInfo($varWhere);
     $varToAdmin = $arrAdminInfo[0]['AdminEmail'];
     $varFrom = SITE_NAME . '<' . $varToAdmin . '>';
     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: " . $argArrPost['reUrl']);
         exit;
     } else {
         if (!empty($argArrPost['yourname'])) {
             $subject = $argArrPost['yourname'] . $subject;
         } else {
             $subject = 'Somebody' . $subject;
         }
         $message = "Please visit this page: " . SITE_ROOT_URL . "\n\n";
         if (!empty($argArrPost['yourname'])) {
             $message .= "This link was sent to you by: " . $argArrPost['yourname'];
             if (!empty($argArrPost['youremail'])) {
                 $message .= " - " . $argArrPost['youremail'] . "\n\n";
             }
             if (!empty($argArrPost['message'])) {
                 $message .= "Message:" . "\n" . $argArrPost['message'];
             }
         }
         //echo $message;die;
         $objCore->sendMail(ucwords($to), $varFrom, $subject, $message);
         $objCore->setSuccessMsg(ADMIN_TELLFRIEND_SEND_MAIL_SUCCESS_MSG);
         return true;
     }
 }
예제 #21
0
 function deleteProductImage($ProductDetails)
 {
     $ProductImageId = $ProductDetails['ProductImageId'];
     $ProductId = $ProductDetails['ProductId'];
     $objCore = new Core();
     $objGeneral = new General();
     $arrImageColumn = array('ProductImageName');
     $varTable = TABLE_PRODUCTS_IMAGES;
     $varWhere = ' 1 AND pkProductImageID =\'' . $ProductImageId . '\'';
     $arrImageName = $this->select($varTable, $arrImageColumn, $varWhere);
     $varImageName = $arrImageName[0]['ProductImageName'];
     $varPath = SOURCE_ROOT . 'common/uploaded_files/products/';
     $ImageUnlink = $objGeneral->deleteImage($varImageName, varPath);
     $varWhere = ' 1 AND pkProductImageID =\'' . $ProductImageId . '\'';
     $this->delete(TABLE_PRODUCTS_IMAGES, $varWhere);
     $objCore->setSuccessMsg('Image deleted successfully.');
     return true;
 }