function saveUsers($argArrPost) { $objValid = new Validate_fields(); $objCore = new Core(); $objValid->check_4html = true; $objValid->add_text_field('Login ID', strip_tags($argArrPost['ClientLoginID']), 'text', 'y'); $objValid->add_text_field('Email', strip_tags($argArrPost['ClientEmailAddress']), 'email', 'y'); $objValid->add_text_field('Organization Name', strip_tags($argArrPost['ClientOrganizationName']), 'text', 'y'); $objValid->add_text_field('Street Address', strip_tags($argArrPost['ClientStreetAddress']), 'text', 'y'); $objValid->add_text_field('City', strip_tags($argArrPost['ClientCity']), 'text', 'y'); $objValid->add_text_field('State', strip_tags($argArrPost['ClientState']), 'text', 'y'); $objValid->add_text_field('Zip Code', strip_tags($argArrPost['ClientZipCode']), 'text', 'y'); $objValid->add_text_field('Organization Type', strip_tags($argArrPost['ClientOrganizationType']), 'text', 'y'); if (!$objValid->validation()) { $errorMsg = $objValid->create_msg(); } if ($errorMsg) { $_SESSION['sessUsersDetail'] = $argArrPost; $objCore->setErrorMsg($errorMsg); return false; } if ($argArrPost['user_id'] != '') { $arrUsersFlds = array('pkClientID'); //$varUsersWhere = ' 1 AND pkClientID != '.$argArrPost['user_id'].' AND ClientLoginID=\''.$argArrPost['ClientLoginID'].'\''; $varUsersWhere = ' 1 AND pkClientID != ' . $argArrPost['user_id'] . ' AND ClientEmailAddress=\'' . $argArrPost['ClientEmailAddress'] . '\''; $arrUsersList = $this->select(TABLE_CLIENTS, $arrUsersFlds, $varUsersWhere); if (isset($arrUsersList)) { $_SESSION['sessUsersDetail'] = $argArrPost; $objCore->setErrorMsg("<b>Client ID already exists.</b>"); return false; } else { $arrclm = array('ClientLoginID' => $argArrPost['ClientLoginID'], 'ClientEmailAddress' => $argArrPost['ClientEmailAddress'], 'ClientOrganizationName' => $argArrPost['ClientOrganizationName'], 'ClientFirstName' => $argArrPost['ClientFirstName'], 'ClientLastName' => $argArrPost['ClientLastName'], 'ClientStreetAddress' => $argArrPost['ClientStreetAddress'], 'ClientCity' => $argArrPost['ClientCity'], 'ClientState' => $argArrPost['ClientState'], 'ClientZipCode' => $argArrPost['ClientZipCode'], 'ClientPhoneNumber' => $argArrPost['ClientPhoneNumber'], 'ClientEmailAddress' => $argArrPost['ClientEmailAddress'], 'ClientOrganizationType' => $argArrPost['ClientOrganizationType'], 'ClientApprovalStatus' => $argArrPost['ClientApprovalStatus'], 'ClientExtra1' => $argArrPost['ClientExtra1'], 'ClientExtra2' => $argArrPost['ClientExtra2']); $varWhere = ' pkClientID =\'' . $argArrPost['user_id'] . '\''; $varUserID = $this->update(TABLE_CLIENTS, $arrclm, $varWhere); $objCore->setSuccessMsg("Successfully Updated"); return 2; } } else { $arrUserFlds = array('pkClientID'); $varUsersWhere = '1 AND ClientLoginID = \'' . $argArrPost['ClientLoginID'] . '\''; $arrUserList = $this->select(TABLE_CLIENTS, $arrUserFlds, $varUsersWhere); if (isset($arrUserList)) { $_SESSION['sessUsersDetail'] = $argArrPost; $objCore->setErrorMsg('<b>This Login ID is already taken. Please try another one.</b>'); return false; } else { $password = substr(rand() . rand(), 0, 6); $arrclm = array('ClientLoginID' => $argArrPost['ClientLoginID'], 'ClientEmailAddress' => $argArrPost['ClientEmailAddress'], 'ClientPassword' => $password, 'ClientFirstName' => $argArrPost['ClientFirstName'], 'ClientLastName' => $argArrPost['ClientLastName'], 'ClientOrganizationName' => $argArrPost['ClientOrganizationName'], 'ClientStreetAddress' => $argArrPost['ClientStreetAddress'], 'ClientCity' => $argArrPost['ClientCity'], 'ClientState' => $argArrPost['ClientState'], 'ClientZipCode' => $argArrPost['ClientZipCode'], 'ClientPhoneNumber' => $argArrPost['ClientPhoneNumber'], 'ClientEmailAddress' => $argArrPost['ClientEmailAddress'], 'ClientOrganizationType' => $argArrPost['ClientOrganizationType'], 'ClientAddedDate' => "now()", 'ClientModifiedDate' => "now()", 'ClientApprovalStatus' => $argArrPost['ClientApprovalStatus'], 'ClientExtra1' => $argArrPost['ClientExtra1'], 'ClientExtra2' => $argArrPost['ClientExtra2']); $varUserID = $this->insert(TABLE_CLIENTS, $arrclm); $to = ADMIN_EMAIL; if ($argArrPost['client_admin'] == 'yes') { // subject $subject = 'Urn-Registry.com Registration '; // message $message = '<html> <head> <title> Urn-Registry.com Registration</title> <style> body,tr,td{font-size:11px; font-family:arial} </style> </head> <body> <p>Dear Admin,<br/><br/>Below are the details.</p> <table> <tr> <td>Login ID : </td> <td>: ' . $argArrPost['ClientLoginID'] . '</td> </tr> <tr> <td>Email ID : </td> <td>: ' . $argArrPost['ClientEmailAddress'] . '</td> </tr> <tr> <td>Password : </td> <td>: ' . $password . '</td> </tr> <tr> <td>Organization: </td> <td>: ' . $argArrPost['ClientOrganizationName'] . '</td> </tr> <tr> <td>City: </td> <td>: ' . $argArrPost['ClientCity'] . '</td> </tr> <tr> <td>State: </td> <td>: ' . $argArrPost['ClientState'] . '</td> </tr> <tr> <td>Zip code: </td> <td>: ' . $argArrPost['ClientZipCode'] . '</td> </tr> <tr><td colspan="2">Regards, Urn-Registry.com Team</td></tr> <tr><td colspan="2"></td></tr> </table> </body> </html>'; $headers_client = 'MIME-Version: 1.0' . "\r\n"; $headers_client .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; //Additional headers $headers_client .= 'From: <' . ADMIN_EMAIL . '>' . "\r\n"; @mail($to, $subject, $message, $headers); } else { // subject $subject = 'Urn-Registry.com Registration Request Received- Account Request Pending'; $subject_client = ' Urn-Registry.com Registration Request Received '; //Account Request Pending // message $message = '<html> <head> <title> Urn-Registry.com Registration Request Received</title> <style> body,tr,td{font-size:11px; font-family:arial} </style> </head> <body> <p>Dear Admin,<br/><br/>Below are the details.</p> <table> <tr> <td>Login ID : </td> <td>: ' . $argArrPost['ClientLoginID'] . '</td> </tr> <tr> <td>Email ID : </td> <td>: ' . $argArrPost['ClientEmailAddress'] . '</td> </tr> <tr> <td>Password : </td> <td>: ' . $password . '</td> </tr> <tr> <td>Organization: </td> <td>: ' . $argArrPost['ClientOrganizationName'] . '</td> </tr> <tr> <td>City: </td> <td>: ' . $argArrPost['ClientCity'] . '</td> </tr> <tr> <td>State: </td> <td>: ' . $argArrPost['ClientState'] . '</td> </tr> <tr> <td>Zip code: </td> <td>: ' . $argArrPost['ClientZipCode'] . '</td> </tr> <tr><td colspan="2">Regards, Urn-Registry.com Team</td></tr> <tr><td colspan="2"></td></tr> </table> </body> </html>'; $message_Client = '<html> <head> <title>Urn-Registry.com Registration Request Received</title> <style> body,tr,td{font-size:11px; font-family:arial} </style> </head> <body> <p>Below are the details.</p> <table> <tr> <td>Dear, </td> <td>: ' . $argArrPost['ClientLoginID'] . '</td> </tr> <tr> <td> </td> <td> Your request has been received. We will reply shortly. Thank you for your interest. </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: ' . $argArrPost['ClientLoginID'] . ' <' . $argArrPost['ClientEmailAddress'] . '>' . "\r\n"; $headers_client = 'MIME-Version: 1.0' . "\r\n"; $headers_client .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Additional headers $headers_client .= 'From: <' . ADMIN_EMAIL . '>' . "\r\n"; @mail($argArrPost['ClientEmailAddress'], $subject_client, $message_Client, $headers_client); @mail($to, $subject, $message, $headers); } $objCore->setSuccessMsg('Successfully registerd.'); return true; } } }
function resetPassword($argArrPOST) { $objValid = new Validate_fields(); $objCore = new Core(); $objValid->check_4html = true; $varNewPassword = $argArrPOST['frmNewPassword']; $varConfirmPassword = $argArrPOST['frmConfirmNewPassword']; $objValid->add_text_field('New Password', strip_tags($argArrPOST['frmNewPassword']), 'text', 'y', 100); $objValid->add_text_field('Confirm New Password', strip_tags($argArrPOST['frmConfirmNewPassword']), 'text', 'y', 100); if (!$objValid->validation()) { $errorMsg = $objValid->create_msg(); } if ($varNewPassword != '' && $varConfirmPassword != '') { if ($varNewPassword != $varConfirmPassword) { $varErrorMessage = ADMIN_PASS_NEW_PASS; $errorMsg .= $varErrorMessage; } } if ($errorMsg) { $_SESSION["arrChangePassword"] = $argArrPOST; $objCore->setErrorMsg($errorMsg); return false; } else { if (!preg_match("/^[a-zA-Z0-9\\!\\-\\_\\#\\@]+\$/u", $varNewPassword)) { $_SESSION["arrChangePassword"] = $argArrPOST; $objCore->setErrorMsg(ADMIN_SETTING_PAGE_PASSWORD_CHECK); return false; } else { $arrColumns = array('AdminPassword' => $varNewPassword, 'AdminForgotPWStatus' => 'Inactive', 'AdminForgotPWCode' => ''); $varWhereCondition = 'pkAdminID = \'' . $argArrPOST['frmMember'] . '\' AND AdminForgotPWCode = \'' . $argArrPOST['frmCode'] . '\''; $this->update(TABLE_ADMIN, $arrColumns, $varWhereCondition); return true; } } }
function getValidationPageForm($argArrPost) { $objValid = new Validate_fields(); $_SESSION['sessObjCore'] = new Core(); $objValid->check_4html = true; $_SESSION["arrPageForm"] = array(); $objValid->add_text_field('Page Contents', strip_tags($argArrPost['frmPageContents']), 'text', 'y', 2000); if ($objValid->validation()) { $errorMsgFirst = 'Please enter required fields!'; } else { $errorMsg = $objValid->create_msg(); } if ($errorMsg) { $_SESSION["arrApplicationFormDetails"] = $argArrPost; $_SESSION['sessObjCore']->setErrorMsg($errorMsg); return false; } else { return true; } }
function getLoginValidation($argArrPOST) { $objValid = new Validate_fields(); $objCore = new Core(); $objValid->check_4html = true; $_SESSION["arrLogin"] = array(); $objValid->add_text_field('User Name', strip_tags($argArrPOST['frmClientLoginID']), 'text', 'y', 30); $objValid->add_text_field('Password', strip_tags($argArrPOST['frmClientPassword']), 'text', 'y', 20); if ($objValid->validation()) { $errorMsgFirst = 'Please enter required fields!'; } else { $errorMsg = $objValid->create_msg(); } if ($errorMsg) { $_SESSION["arrLoginDetails"] = $argArrPOST; $_SESSION["arrClientLoginErrorMsg"] = $errorMsg; $objCore->setErrorMsg($errorMsg); return false; } else { return true; } }
function saveUsers($argArrPost) { $objValid = new Validate_fields(); $objCore = new Core(); $objValid->check_4html = true; $objValid->add_text_field('Login ID', strip_tags($argArrPost['ClientLoginID']), 'email', 'y'); $objValid->add_text_field('Email', strip_tags($argArrPost['ClientEmailAddress']), 'email', 'y'); $objValid->add_text_field('Organization Name', strip_tags($argArrPost['ClientOrganizationName']), 'text', 'y'); $objValid->add_text_field('Street Address', strip_tags($argArrPost['ClientStreetAddress']), 'text', 'y'); $objValid->add_text_field('City', strip_tags($argArrPost['ClientCity']), 'text', 'y'); $objValid->add_text_field('State', strip_tags($argArrPost['ClientState']), 'text', 'y'); $objValid->add_text_field('Zip Code', strip_tags($argArrPost['ClientZipCode']), 'text', 'y'); $objValid->add_text_field('Organization Type', strip_tags($argArrPost['ClientOrganizationType']), 'text', 'y'); if (!$objValid->validation()) { $errorMsg = $objValid->create_msg(); } if ($errorMsg) { $_SESSION['sessUsersDetail'] = $argArrPost; $objCore->setErrorMsg($errorMsg); return false; } if ($argArrPost['user_id'] != '') { $arrUsersFlds = array('pkClientID'); $varUsersWhere = ' 1 AND pkClientID != ' . $argArrPost['user_id'] . ' AND ClientLoginID=\'' . $argArrPost['ClientLoginID'] . '\''; $arrUsersList = $this->select(TABLE_CLIENTS, $arrUsersFlds, $varUsersWhere); if (isset($arrUsersList)) { $_SESSION['sessUsersDetail'] = $argArrPost; $objCore->setErrorMsg("<b>Client ID already exists.</b>"); return false; } else { $arrclm = array('ClientLoginID' => $argArrPost['ClientLoginID'], 'ClientEmailAddress' => $argArrPost['ClientEmailAddress'], 'ClientOrganizationName' => $argArrPost['ClientOrganizationName'], 'ClientFirstName' => $argArrPost['ClientFirstName'], 'ClientLastName' => $argArrPost['ClientLastName'], 'ClientStreetAddress' => $argArrPost['ClientStreetAddress'], 'ClientCity' => $argArrPost['ClientCity'], 'ClientState' => $argArrPost['ClientState'], 'ClientZipCode' => $argArrPost['ClientZipCode'], 'ClientPhoneNumber' => $argArrPost['ClientPhoneNumber'], 'ClientEmailAddress' => $argArrPost['ClientEmailAddress'], 'ClientOrganizationType' => $argArrPost['ClientOrganizationType'], 'ClientApprovalStatus' => $argArrPost['ClientApprovalStatus'], 'ClientExtra1' => $argArrPost['ClientExtra1'], 'ClientExtra2' => $argArrPost['ClientExtra2']); $varWhere = ' pkClientID =\'' . $argArrPost['user_id'] . '\''; $varUserID = $this->update(TABLE_CLIENTS, $arrclm, $varWhere); $objCore->setSuccessMsg("Successfully Updated"); return 2; } } else { $arrUserFlds = array('pkClientID'); $varUsersWhere = '1 AND ClientLoginID = \'' . $argArrPost['ClientLoginID'] . '\''; $arrUserList = $this->select(TABLE_CLIENTS, $arrUserFlds, $varUsersWhere); if (isset($arrUserList)) { $_SESSION['sessUsersDetail'] = $argArrPost; $objCore->setErrorMsg('<b>Please select any other E-mail ID.</b>'); return false; } else { $password = substr(rand() . rand(), 0, 6); $arrclm = array('ClientLoginID' => $argArrPost['ClientLoginID'], 'ClientEmailAddress' => $argArrPost['ClientEmailAddress'], 'ClientPassword' => $password, 'ClientFirstName' => $argArrPost['ClientFirstName'], 'ClientLastName' => $argArrPost['ClientLastName'], 'ClientOrganizationName' => $argArrPost['ClientOrganizationName'], 'ClientStreetAddress' => $argArrPost['ClientStreetAddress'], 'ClientCity' => $argArrPost['ClientCity'], 'ClientState' => $argArrPost['ClientState'], 'ClientZipCode' => $argArrPost['ClientZipCode'], 'ClientPhoneNumber' => $argArrPost['ClientPhoneNumber'], 'ClientEmailAddress' => $argArrPost['ClientEmailAddress'], 'ClientOrganizationType' => $argArrPost['ClientOrganizationType'], 'ClientAddedDate' => "now()", 'ClientModifiedDate' => "now()", 'ClientApprovalStatus' => $argArrPost['ClientApprovalStatus'], 'ClientExtra1' => $argArrPost['ClientExtra1'], 'ClientExtra2' => $argArrPost['ClientExtra2']); $varUserID = $this->insert(TABLE_CLIENTS, $arrclm); $to = ADMIN_EMAIL; // subject $subject = 'Request Account'; // message $message = '<html> <head> <title>Request account</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>: ' . $argArrPost['ClientLoginID'] . '</td> </tr> <tr> <td>Email ID : </td> <td>: ' . $argArrPost['ClientEmailAddress'] . '</td> </tr> <tr> <td>Password : </td> <td>: ' . $password . '</td> </tr> <tr> <td>Oganisation: </td> <td>: ' . $argArrPost['ClientOrganizationName'] . '</td> </tr> <tr> <td>City: </td> <td>: ' . $argArrPost['ClientCity'] . '</td> </tr> <tr> <td>State: </td> <td>: ' . $argArrPost['ClientState'] . '</td> </tr> <tr> <td>Zip code: </td> <td>: ' . $argArrPost['ClientZipCode'] . '</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: ' . $argArrPost['ClientLoginID'] . ' <' . $argArrPost['ClientEmailAddress'] . '>' . "\r\n"; @mail($to, $subject, $message, $headers); $objCore->setSuccessMsg('Client details have been added successfully.'); return true; } } }
function saveNichesLocation($argArrPost) { $objValid = new Validate_fields(); $objCore = new Core(); $objValid->check_4html = true; $objValid->add_text_field('Section', strip_tags($argArrPost['Section']), 'text', 'y'); $objValid->add_text_field('Row', strip_tags($argArrPost['Row']), 'number', 'y'); $objValid->add_text_field('Column', strip_tags($argArrPost['Column']), 'number', 'y'); if (!$objValid->validation()) { $errorMsg = $objValid->create_msg(); } if ($errorMsg) { $_SESSION['sessNichesDetail'] = $argArrPost; $objCore->setErrorMsg($errorMsg); return false; } if ($argArrPost['niches_loc_id'] != '') { $arrNichesLocFlds = array('pkNicheLocationID'); $varNichesLocWhere = ' 1 AND pkNicheLocationID != ' . $argArrPost['niches_loc_id'] . " AND Row = " . $argArrPost['Row'] . " AND Columns = " . $argArrPost['Column']; $arrNichesLocList = $this->select(TABLE_NICHE_LOCATIONS, $arrNichesLocFlds, $varNichesLocWhere); if ($arrNichesLocList != NULL) { $_SESSION['sessNichesDetail'] = $argArrPost; $objCore->setErrorMsg("<b>Please select any other row or column</b>"); return false; } else { $Row = (int) $argArrPost['Row']; $Column = (int) $argArrPost['Column']; $arrclm = array('Section' => $argArrPost['Section'], 'Row' => $Row, 'Columns' => $Column); $varNichesLocWhere = ' pkNicheLocationID = ' . $argArrPost['niches_loc_id']; $varNichesLocID = $this->update(TABLE_NICHE_LOCATIONS, $arrclm, $varNichesLocWhere); $objCore->setSuccessMsg('Niches Location is updated successfully.'); return true; } } else { $arrNichesLocFlds = array('fkNicheID'); $varNichesLocWhere = ' 1 AND fkNicheID = ' . $argArrPost['niches_id'] . ' OR Row = ' . $argArrPost['Row'] . " AND Columns = " . $argArrPost['Column']; $arrNichesLocList = $this->select(TABLE_NICHE_LOCATIONS, $arrNichesLocFlds, $varNichesLocWhere); if ($arrNichesLocList != NULL) { $_SESSION['sessNichesDetail'] = $argArrPost; $objCore->setErrorMsg("<b>This niche location has already been used</b>"); return false; } else { $Row = (int) $argArrPost['Row']; $Column = (int) $argArrPost['Column']; $arrclm = array('fkNicheID' => $argArrPost['niches_id'], 'fkClientID' => $argArrPost['user_id'], 'Section' => $argArrPost['Section'], 'Row' => $Row, 'Columns' => $Column); $varNichesLocWhere = ' 1 AND pkNicheLocationID != ' . $argArrPost['niches_loc_id']; $varNichesLocID = $this->insert(TABLE_NICHE_LOCATIONS, $arrclm); $objCore->setSuccessMsg('Niches Location is added successfully.'); return true; } } }
function saveUrns($argArrPost) { $boolB_Date = checkdate((int) $argArrPost['B_Month'], (int) $argArrPost['B_Date'], (int) $argArrPost['B_Year']); $boolD_Date = checkdate((int) $argArrPost['D_Month'], (int) $argArrPost['D_Date'], (int) $argArrPost['D_Year']); $boolI_Date = checkdate((int) $argArrPost['I_Month'], (int) $argArrPost['I_Date'], (int) $argArrPost['I_Year']); $birthDate = $argArrPost['B_Year'] . '-' . $argArrPost['B_Month'] . '-' . $argArrPost['B_Date']; $deathDate = $argArrPost['D_Year'] . '-' . $argArrPost['D_Month'] . '-' . $argArrPost['D_Date']; $incurementDate = $argArrPost['I_Year'] . '-' . $argArrPost['I_Month'] . '-' . $argArrPost['I_Date']; $objValid = new Validate_fields(); $objCore = new Core(); $objValid->check_4html = true; $objValid->add_text_field('Urn First Name', strip_tags($argArrPost['UrnFirstName']), 'text', 'y'); $objValid->add_text_field('Urn Last Name', strip_tags($argArrPost['UrnLastName']), 'text', 'y'); $objValid->add_text_field('Urn Tag Number', strip_tags($argArrPost['UrnTagNumber']), 'number', 'y', 12); $objValid->add_text_field('Niches Name', strip_tags($argArrPost['fkNicheID']), 'text', 'y'); $objValid->add_text_field('Birth Date', strip_tags($birthDate), 'date', 'y'); $objValid->add_text_field('Death Date', strip_tags($deathDate), 'date', 'y'); $objValid->add_text_field('Inurement Date', strip_tags($incurementDate), 'date', 'y'); if (!$objValid->validation()) { $errorMsg = $objValid->create_msg(); } if ($errorMsg) { $_SESSION['sessUrnsDetail'] = $argArrPost; $objCore->setErrorMsg($errorMsg); return false; } if (!$boolB_Date) { $_SESSION['sessUrnsDetail'] = $argArrPost; $objCore->setErrorMsg('Birth Date is not valid'); return false; } if (!$boolD_Date) { $_SESSION['sessUrnsDetail'] = $argArrPost; $objCore->setErrorMsg('Death Date is not valid'); return false; } if (!$boolI_Date) { $_SESSION['sessUrnsDetail'] = $argArrPost; $objCore->setErrorMsg('Inurement Date is not valid'); return false; } $birthDate .= ' ' . '00:00:00'; $deathDate .= ' ' . '00:00:00'; $incurementDate .= ' ' . '00:00:00'; if ($birthDate > $deathDate) { $_SESSION['sessUrnsDetail'] = $argArrPost; $objCore->setErrorMsg('Birth Date should not be greater than Death Date'); return false; } if ($deathDate > $incurementDate) { $_SESSION['sessUrnsDetail'] = $argArrPost; $objCore->setErrorMsg('Death Date should not be greater than Inurement Date'); return false; } if ($argArrPost['urns_id'] != '') { $arrUrnsFlds = array('pkUrnID'); $varUrnsWhere = ' 1 AND pkUrnID != ' . $argArrPost['urns_id'] . ' AND UrnFirstName=\'' . $argArrPost['UrnFirstName'] . '\' AND UrnLastName=\'' . $argArrPost['UrnLastName'] . '\' '; $arrUrnsList = $this->select(TABLE_URNS, $arrUrnsFlds, $varUrnsWhere); if (isset($arrUrnsList)) { $_SESSION['sessUrnsDetail'] = $argArrPost; $objCore->setErrorMsg('Please select any other first name/last name'); return false; } else { $arrclm = array('pkUrnID' => $argArrPost['urns_id'], 'fkNicheID' => $argArrPost['fkNicheID'], 'fkClientID' => $argArrPost['user_id'], 'UrnTagNumber' => $argArrPost['UrnTagNumber'], 'UrnTitle' => $argArrPost['UrnTitle'], 'UrnFirstName' => $argArrPost['UrnFirstName'], 'UrnMiddleName' => $argArrPost['UrnMiddleName'], 'UrnMaidenName' => $argArrPost['UrnMaidenName'], 'UrnLastName' => $argArrPost['UrnLastName'], 'UrnSuffix' => $argArrPost['UrnSuffix'], 'BirthDate' => $birthDate, 'DeathDate' => $deathDate, 'DateInurement' => $incurementDate, 'Public' => $argArrPost['Public'], 'UrnExtra1' => $argArrPost['UrnExtra1'], 'UrnExtra2' => $argArrPost['UrnExtra2'], 'UrnAddedDate' => $argArrPost['UrnAddedDate'], 'UrnModifiedDate' => 'now()'); //var_dump($arrclm);die; $arrUrnsFlds = array('count(pkUrnID) as nichesCnt'); $varUrnsWhere = ' 1 AND fkNicheID = ' . $argArrPost['fkNicheID']; $arrUrnsList = $this->select(TABLE_URNS, $arrUrnsFlds, $varUrnsWhere); $CntUrnsList = $arrUrnsList[0]['nichesCnt']; $varUrnsWhere = ' 1 AND pkNicheID = ' . $argArrPost['fkNicheID'] . " AND NicheStatus='active'"; $arrNicehsFlds = array('pkNicheID'); $arrNichesList = $this->select(TABLE_NICHES, $arrNicehsFlds, $varUrnsWhere); //var_dump($CntUrnsList);die; if ($arrNichesList[0] != NULL) { if ($CntUrnsList >= 2) { $_SESSION['sessUrnsDetail'] = $argArrPost; $objCore->setErrorMsg("<b>One Niche can not have more than two Urns</b>"); return false; } else { $varWhere = ' pkUrnID =\'' . $argArrPost['urns_id'] . '\''; //var_dump($arrclm);die; $varNichesID = $this->update(TABLE_URNS, $arrclm, $varWhere); $objCore->setSuccessMsg("Urns is successfully updated"); return 2; } } } } else { $arrUrnsFlds = array('pkUrnID'); $varUrnsWhere = ' 1 AND UrnFirstName=\'' . $argArrPost['UrnFirstName'] . '\' AND UrnLastName=\'' . $argArrPost['UrnLastName'] . '\' '; $arrUrnsList = $this->select(TABLE_URNS, $arrUrnsFlds, $varUrnsWhere); if (isset($arrUrnsList)) { $_SESSION['sessUrnsDetail'] = $argArrPost; $objCore->setErrorMsg('Please select any other first name/last name'); return false; } else { $arrUrnsFlds = array('count(pkUrnID) as nichesCnt'); $varUrnsWhere = ' 1 AND fkNicheID = ' . $argArrPost['fkNicheID']; $arrUrnsList = $this->select(TABLE_URNS, $arrUrnsFlds, $varUrnsWhere); $CntUrnsList = $arrUrnsList[0]['nichesCnt']; //var_dump($CntUrnsList);die; $varUrnsWhere = ' 1 AND pkNicheID = ' . $argArrPost['fkNicheID'] . " AND NicheStatus='active'"; $arrNicehsFlds = array('pkNicheID'); $arrNichesList = $this->select(TABLE_NICHES, $arrNicehsFlds, $varUrnsWhere); if ($arrNichesList[0] != NULL) { if ($CntUrnsList >= 2) { $_SESSION['sessUrnsDetail'] = $argArrPost; $objCore->setErrorMsg("<b>One Niche can not have more than two Urns</b>"); return false; } else { $arrclm = array('fkNicheID' => $argArrPost['fkNicheID'], 'fkClientID' => $argArrPost['user_id'], 'UrnTagNumber' => $argArrPost['UrnTagNumber'], 'UrnTitle' => $argArrPost['UrnTitle'], 'UrnFirstName' => $argArrPost['UrnFirstName'], 'UrnMiddleName' => $argArrPost['UrnMiddleName'], 'UrnMaidenName' => $argArrPost['UrnMaidenName'], 'UrnLastName' => $argArrPost['UrnLastName'], 'UrnSuffix' => $argArrPost['UrnSuffix'], 'BirthDate' => $birthDate, 'DeathDate' => $deathDate, 'DateInurement' => $incurementDate, 'Public' => $argArrPost['Public'], 'UrnExtra1' => $argArrPost['UrnExtra1'], 'UrnExtra2' => $argArrPost['UrnExtra2'], 'UrnAddedDate' => 'now()', 'UrnModifiedDate' => 'now()'); } } //var_dump($arrclm);die; $varUrnsID = $this->insert(TABLE_URNS, $arrclm); $objCore->setSuccessMsg('Urn added successfully'); return true; } } }
function validateTaxDiscount($argArrPost) { $objValid = new Validate_fields(); $objCore = new Core(); $objValid->check_4html = true; $_SESSION['sessTaxDiscountAdd'] = array(); // CHECK SERVER SIDE VALIDATION $objValid->add_text_field('Type', strip_tags($argArrPost['frmTaxDiscountType']), 'text', 'y', 100); $objValid->add_text_field('Name', strip_tags($argArrPost['frmTaxDiscountName']), 'text', 'y', 100); $objValid->add_text_field('Percentage', strip_tags($argArrPost['frmTaxDiscountValue']), 'decimal', 'y'); if ($argArrPost['frmTaxDiscountValue'] > 100) { $errorMsg .= ADMIN_PERCENTAGE_NOT_VALID; } if ($objValid->validation()) { //$errorMsgFirst = 'Please enter required fields!'; } else { $errorMsg = $objValid->create_msg(); } if ($errorMsg) { $_SESSION['sessTaxDiscountAdd'] = $argArrPost; $objCore->setErrorMsg($errorMsg); return false; } else { // CHECKING THE RECORD UNIQUENESS $argclmn = array('count(pkTaxDiscountID) as count'); $varTaxDiscountWhere = 'TaxDiscountName = \'' . $argArrPost['frmTaxDiscountName'] . '\' AND TaxDiscountType = \'' . $argArrPost['frmTaxDiscountType'] . '\''; $arrTaxDiscount = $this->select(TABLE_TAX_DISCOUNTS, $argclmn, $varTaxDiscountWhere); // END CHEKING if ($arrTaxDiscount[0]['count'] != '' || $arrTaxDiscount[0]['count'] > 0) { $_SESSION['sessTaxDiscountAdd'] = $argArrPost; if ($argArrPost['frmTaxDiscountType'] == 'Tax') { $objCore->setErrorMsg(ADMIN_TAX_ALREADY_MSG); } else { $objCore->setErrorMsg(ADMIN_DISCOUNT_ALREADY_MSG); } return false; } else { return true; } } }
function checkCouponValidation($argArrPost) { $objValid = new Validate_fields(); $objCore = new Core(); $objValid->check_4html = true; $_SESSION['sessCoupon'] = array(); $objValid->add_text_field('coupon code', strip_tags($argArrPost['frmcoupon_code']), text, y, 30); $objValid->add_text_field('coupon start date', strip_tags($argArrPost['frmcoupon_start_date']), text, y, 30); $objValid->add_text_field('coupon end date', strip_tags($argArrPost['frmcoupon_end_date']), text, y, 30); $objValid->add_text_field('coupon type', strip_tags($argArrPost['frmcoupon_type']), text, y); $objValid->add_text_field('coupon price', strip_tags($argArrPost['frmcoupon_price']), text, y, 10); if ($objValid->validation()) { $errorMsgFirst = 'Please enter required fields!'; } else { $errorMsg = $objValid->create_msg(); } if ($errorMsg) { $_SESSION['sessCoupon'] = $argArrPost; $objCore->setErrorMsg($errorMsg); return true; } else { return false; } }
function resetPassword($argArrPOST) { $objValid = new Validate_fields(); $objCore = new Core(); $objValid->check_4html = true; //$_SESSION["arrChangePassword"] = array(); $varNewPassword = $argArrPOST['frmNewPassword']; $varConfirmPassword = $argArrPOST['frmConfirmNewPassword']; //*** server side validation will start from here . $objValid->add_text_field('New Password', strip_tags($argArrPOST['frmNewPassword']), 'text', 'y', 100); $objValid->add_text_field('Confirm New Password', strip_tags($argArrPOST['frmConfirmNewPassword']), 'text', 'y', 100); if ($objValid->validation()) { $errorMsgFirst = 'Please enter required fields!'; } else { $errorMsg = $objValid->create_msg(); } if ($varNewPassword != '' && $varConfirmPassword != '') { if ($varNewPassword != $varConfirmPassword) { $varErrorMessage = ADMIN_PASS_NEW_PASS; $errorMsg .= $varErrorMessage; } } if ($errorMsg) { $_SESSION["arrChangePassword"] = $argArrPOST; $objCore->setErrorMsg($errorMsg); return false; } else { //*** server side validation end here //$varAdminID = $argArrPOST['frmMember']; //$varWhereCondition = " AND pkAdminID ='".$varAdminID."' AND AdminPassword = binary '".$varOldPassword."'"; //$varResultRows = $this->getAdminNumRows($varWhereCondition); //if($varResultRows > 0) //{ //check for valid password if (!preg_match("/^[a-zA-Z0-9\\!\\-\\_\\#\\@]+\$/u", $varNewPassword)) { $_SESSION["arrChangePassword"] = $argArrPOST; $objCore->setErrorMsg(ADMIN_SETTING_PAGE_PASSWORD_CHECK); return false; } else { $arrColumns = array('AdminPassword' => $varNewPassword, 'AdminForgotPWStatus' => 'Inactive', 'AdminForgotPWCode' => ''); $varWhereCondition = 'pkAdminID = \'' . $argArrPOST['frmMember'] . '\' AND AdminForgotPWCode = \'' . $argArrPOST['frmCode'] . '\''; $this->update(TABLE_ADMIN, $arrColumns, $varWhereCondition); //end check for valid password /*$arrColumns = array('AdminPassword'=>$varNewPassword); $varWhere = "pkAdminID ='".$varAdminID."'"; unset($_SESSION['sessAdminPassword']); $_SESSION['sessAdminPassword'] = ''; $_SESSION['sessAdminPassword'] = $varNewPassword; $varAffectedRows = $this->update(TABLE_ADMIN, $arrColumns, $varWhere); $this->sendChangePassMailToAdmin($argArrPOST); $objCore->setSuccessMsg(ADMIN_CHANGE_PASSWORD_MSG);*/ return true; } //} //else //{ //$objCore->setErrorMsg(ADMIN_CHANGE_PASSWORD_ERR); //return false; //} } }
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); } }
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; } } }
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']); } }
function checkValidUserCheckOut($argArrPost) { $objCore = new Core(); $objValid = new Validate_fields(); $objValid->check_4html = true; $objValid->add_text_field('Card Type', strip_tags($argArrPost['frmCardType']), 'text', 'y', 255); $objValid->add_num_field('Card Number', strip_tags($argArrPost['frmCardNumber']), 'number'); $objValid->add_text_field('Card Expiry Date', strip_tags($argArrPost['frmDate']), 'text', 'y', 255); $objValid->add_text_field('Card Owner Name', strip_tags($argArrPost['frmCardOwnerName']), 'text', 'y', 255); $objValid->add_num_field('Card Security Code', strip_tags($argArrPost['frmCardSecurityCode']), 'text', 'y', 255); $objValid->add_text_field('First Name', strip_tags($argArrPost['frmFirstName']), 'text', 'y', 255); $objValid->add_text_field('Last Name', strip_tags($argArrPost['frmLastName']), 'text', 'y', 255); $objValid->add_text_field('Email', strip_tags($argArrPost['frmEmail']), 'email', 'y', 255); $objValid->add_num_field('Billing:Street Address', strip_tags($argArrPost['frmBillingStreetAddress']), 'text', 'y', 255); $objValid->add_num_field('Billing:City', strip_tags($argArrPost['frmBillingCity']), 'text', 'y', 255); $objValid->add_text_field('Billing:State', strip_tags($argArrPost['frmBillingState']), 'text', 'y', 255); $objValid->add_text_field('Billing:Zip', strip_tags($argArrPost['frmBillingZip']), 'number'); $objValid->add_text_field('Billing:Country', strip_tags($argArrPost['frmBillingCountry']), 'text', 'y', 255); $objValid->add_text_field('Shipping:Street Address', strip_tags($argArrPost['frmShippingStreetAddress']), 'text', 'y', 255); $objValid->add_text_field('Shipping:City', strip_tags($argArrPost['frmShippingCity']), 'text', 'y', 255); $objValid->add_text_field('Shipping:State', strip_tags($argArrPost['frmShippingState']), 'text', 'y', 255); $objValid->add_num_field('Shipping:Zip', strip_tags($argArrPost['frmShippingZip']), 'number'); $objValid->add_text_field('Shipping:Country', strip_tags($argArrPost['frmShippingCountry']), 'text', 'y', 255); if ($objValid->validation()) { $errorMsgFirst = 'Please enter required fields!'; } else { $errorMsg = $objValid->create_msg(); } if ($errorMsg) { $objCore->setErrorMsg($errorMsg); return true; } else { return false; } }
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; } }
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; } }
$my_error .= "You have marked West longitude but set an east time zone.<br>"; } if ($ew == '1' and $timezone < 0) { $my_error .= "You have marked East longitude but set a west time zone.<br>"; } if ($ew < 0) { $ew_txt = "w"; } else { $ew_txt = "e"; } if ($ns > 0) { $ns_txt = "n"; } else { $ns_txt = "s"; } $validation_error = $my_form->validation(); if (!$validation_error || $my_error != "") { $error = $my_form->create_msg(); echo "<TABLE align='center' WIDTH='98%' BORDER='0' CELLSPACING='15' CELLPADDING='0'><tr><td><center><b>"; echo "<font color='#ff0000' size=+2>Error! - The following error(s) occurred:</font><br>"; if ($error) { echo $error . $my_error; } else { echo $error . "<br>" . $my_error; } echo "</font>"; echo "<font color='#c020c0'"; echo "<br>PLEASE RE-ENTER YOUR TIME ZONE DATA. THANK YOU.<br><br>"; echo "</font>"; echo "</b></center></td></tr></table>"; } else {
function checkProductsValidation($argArrPost) { $objValid = new Validate_fields(); $objCore = new Core(); $objValid->check_4html = true; $_SESSION['sessProducts'] = array(); $objValid->add_text_field('Category', strip_tags($argArrPost['frmfkCategoryID']), 'text', 'y', 255); $objValid->add_text_field('Product Name', strip_tags($argArrPost['frmProductName']), 'text', 'y', 255); $objValid->add_text_field('Product Code', strip_tags($argArrPost['frmProductCode']), 'text', 'y', 255); $objValid->add_text_field('Product Description', strip_tags($argArrPost['frmProductDescription']), 'text', 'y'); $objValid->add_text_field('Product Specifications', strip_tags($argArrPost['frmProductSpecifications']), 'text', 'y'); $objValid->add_text_field('Product Set of Quantity', strip_tags($argArrPost['frmProductQuantity']), 'number', 'y'); //$objValid->add_text_field('Product Quantity Available', strip_tags($argArrPost['frmProductQuantityAvailable']), 'number', 'y'); $objValid->add_num_field('Product Cost', strip_tags($argArrPost['frmProductCost']), 'text', 'y'); //$objValid->add_num_field('Product Total Cost', strip_tags($argArrPost['frmProductActualCost']), 'text', 'y'); if ($objValid->validation()) { $errorMsgFirst = 'Please enter required fields!'; } else { $errorMsg = $objValid->create_msg(); } if (trim($argArrPost['frmProductCost']) != '') { if (!preg_match('/^[0-9]*\\.?[0-9]+$/', strip_tags(trim($argArrPost['frmProductCost'])))) { $errorMsg .= ERR_PRODUCT_PRICE_ERR; } } if (trim($argArrPost['frmProductActualCost']) != '') { if (!preg_match('/^[0-9]*\\.?[0-9]+$/', strip_tags(trim($argArrPost['frmProductActualCost'])))) { $errorMsg .= ERR_PRODUCT_RRP_ERR; } } if ($argArrPost['frmProductSeoFriendlyURL'] != '') { if (preg_match('/[^a-z-A-Z]/', $argArrPost['frmProductSeoFriendlyURL'])) { $errorMsg .= ERR_PRODUCTS_SEO_URL; } } if ($errorMsg) { $_SESSION['sessProducts'] = $argArrPost; $objCore->setErrorMsg($errorMsg); return true; } else { $arrProductCols = array('pkProductID'); if ($argArrPost['frmProductID'] != '') { $varWhereProduct = 'ProductCode =\'' . $argArrPost['frmProductCode'] . '\' AND pkProductID !=\'' . $argArrPost['frmProductID'] . '\''; } else { $varWhereProduct = 'ProductCode =\'' . $argArrPost['frmProductCode'] . '\''; } $arrProductCodeList = $this->select(TABLE_PRODUCTS, $arrProductCols, $varWhereProduct); if ($arrProductCodeList != '') { $objCore->setErrorMsg(ERR_PRODUCT_CODE_EXISTS); $_SESSION['sessProducts'] = $argArrPost; return true; } //check the number of featured count if ($argArrPost['frmProductID'] != '') { $varWhereCondition = 'AND ProductIsFeatured = \'' . $argArrPost['frmProductIsFeatured'] . '\' AND pkProductID != \'' . $argArrPost['frmProductID'] . '\''; } else { $varWhereCondition = 'AND ProductIsFeatured = \'' . $argArrPost['frmProductIsFeatured'] . '\''; } $varColumn = 'pkProductID'; $varResultCount = $this->getNumRows(TABLE_PRODUCTS, $varColumn, $varWhereCondition); $argArrPost['frmProductIsFeatured']; if ($varResultCount >= MAX_FEATURED_COUNT && $argArrPost['frmProductIsFeatured'] == 'Yes') { $objCore->setErrorMsg(ERR_FEATURED_PRODUCT); $_SESSION['sessProducts'] = $argArrPost; return true; } //check for valid image type $objUpload = new upload(); if ($_FILES['frmProductImage']['name'] != '') { $varIsImage = $objUpload->IsImageValid($_FILES['frmProductImage']['type']); if (!$varIsImage) { $varErrorMsg = IMAGE_TYPE_ERROR; $objCore->setErrorMsg(IMAGE_TYPE_ERROR); $_SESSION['sessProducts'] = $argArrPost; return true; } //chekc for image size $varMaxFileSize = MAX_UPLOAD_SIZE; $varFileSize = $_FILES['frmProductImage']['size']; if ($varFileSize > $varMaxFileSize) { $varErrorMsg = FILE_SIZE_ERROR; $objCore->setErrorMsg($varErrorMsg); $_SESSION['sessProducts'] = $argArrPost; return true; } //end chekc for image size } return false; } }