PageRenderTime 50ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/admin/classes/Lib/CheckInputs.php

https://github.com/rohitka07/zeuscart
PHP | 1082 lines | 707 code | 157 blank | 218 comment | 198 complexity | 8fe8a4bc9c91e045efcea9e55ec769fa MD5 | raw file
Possible License(s): MPL-2.0-no-copyleft-exception
  1. <?php
  2. /**
  3. * GNU General Public License.
  4. * This file is part of ZeusCart V4.
  5. * ZeusCart V4 is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 4 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * ZeusCart V4 is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with Foobar. If not, see <http://www.gnu.org/licenses/>.
  17. *
  18. */
  19. /**
  20. * This class contains functions related check inputs
  21. *
  22. * @package Lib_CheckInputs
  23. * @category Library
  24. * @author AjSquareInc Dev Team
  25. * @link http://www.zeuscart.com
  26. * @copyright Copyright (c) 2008 - 2013, AjSquare, Inc.
  27. * @version Version 4.0
  28. */
  29. class Lib_CheckInputs
  30. {
  31. /**
  32. * Function checks and invokes the validation module
  33. *
  34. * @param string $module
  35. *
  36. * @return void
  37. */
  38. function Lib_CheckInputs($module)
  39. {
  40. if($module=='category')
  41. $this->checkAddCategory();
  42. else if($module=='register')
  43. $this->register();
  44. else if($module=='validatelogin')
  45. $this->validatelogin();
  46. else if($module=='subadminmail')
  47. $this->validatSubAdminEmail();
  48. else if($module=='productreg')
  49. $this->validateEntry();
  50. else if($module=='attributes')
  51. $this->validateAttributes();
  52. else if($module=='editattributes')
  53. $this->validateEditAttributes();
  54. else if($module=='adminemail')
  55. $this->validateAdminEmail();
  56. else if($module=='productupdate')
  57. $this->validateEntryUpdate();
  58. else if($module=='useraccregister')
  59. $this->validateUserRegister();
  60. else if($module=='useraccregisterlight')
  61. $this->validateUserRegisterLight();
  62. else if($module=='frmship')
  63. $this->validateCheckout();
  64. else if($module=='regionwisetax')
  65. $this->validateRegionwisetaxEntry();
  66. else if($module=='regionwisetaxedit')
  67. $this->validateRegionwisetaxEdit();
  68. else if($module=='addnewcurrency')
  69. $this->validateCurrency();
  70. else if($module=='updatecurrency')
  71. $this->validateEditCurrency();
  72. else if($module=='updateslideshow')
  73. $this->validateSlideShow();
  74. else if($module=='addsociallink')
  75. $this->validateAddSocialLink();
  76. else if($module=='updatesociallink')
  77. $this->validateUpdateSocialLink();
  78. else if($module=='addhomepageads')
  79. $this->validateAddHomePageAds();
  80. else if($module=='edithomepageads')
  81. $this->validateEditHomePageAds();
  82. else if($module=='dynamiccms')
  83. $this->validateDynamicCms();
  84. else if($module=='editdynamiccms')
  85. $this->validateEditDynamicCms();
  86. else if($module=='csevalidation')
  87. $this->validateCsevalidation();
  88. else if($module=='digitalproductreg')
  89. $this->validateDigitalEntry();
  90. else if($module=='giftproductreg')
  91. $this->validateGiftEntry();
  92. else if($module=='customergroup')
  93. $this->validateCustomerGroup();
  94. else if($module=='editcustomergroup')
  95. $this->validateEditCustomerGroup();
  96. else if($module=='useraccupdate')
  97. $this->validateUserUpdate();
  98. else if($module=='addattributevalues')
  99. $this->validateAddAttributeValues();
  100. else if($module=='editattributevalues')
  101. $this->validateEditAttributeValues();
  102. else if($module=='sitesettings')
  103. $this->validateSiteSettings();
  104. else if($module=='editcategory')
  105. $this->validateEditCategory();
  106. else if($module=='footercontent')
  107. $this->validateFooterConnect();
  108. else if($module=='addnews')
  109. $this->validateAddNews();
  110. else if($module=='editnews')
  111. $this->validateEditNews();
  112. else if($module=='adminprofile')
  113. $this->validateAdminProfile();
  114. else if($module=='editmailmessage')
  115. $this->validateEditMailMessage();
  116. else if($module=='livechat')
  117. $this->validateLiveChat();
  118. else if($module=='productinventory')
  119. $this->validateProductInventory();
  120. else if($module=='homepagecontent')
  121. $this->validateHomePageContent();
  122. }
  123. function validateHomePageContent()
  124. {
  125. include('classes/Lib/FormValidation.php');
  126. if(strtolower($_SERVER['REQUEST_METHOD'])=="post")
  127. {
  128. if($_POST['home_page_content']!='' or $_POST['home_page_content']=='')
  129. {
  130. $obj = new Lib_FormValidation('homepagecontent');
  131. }
  132. else
  133. {
  134. header("Location:?do=homepage&action=content");
  135. exit();
  136. }
  137. }
  138. }
  139. function validateProductInventory()
  140. {
  141. include('classes/Lib/FormValidation.php');
  142. if(strtolower($_SERVER['REQUEST_METHOD'])=="post")
  143. {
  144. if($_POST['rol']!='' or $_POST['rol']=='' or $_POST['soh']!='' or $_POST['soh']=='')
  145. {
  146. $obj = new Lib_FormValidation('productinventory');
  147. }
  148. else
  149. {
  150. header("Location:?do=productinventory");
  151. exit();
  152. }
  153. }
  154. }
  155. function validateLiveChat()
  156. {
  157. include('classes/Lib/FormValidation.php');
  158. if(strtolower($_SERVER['REQUEST_METHOD'])=="post")
  159. {
  160. if($_REQUEST['live_chat_script']!='' or $_REQUEST['live_chat_script']=='')
  161. {
  162. $obj = new Lib_FormValidation('livechat');
  163. }
  164. else
  165. {
  166. header("Location:?do=livechat");
  167. exit();
  168. }
  169. }
  170. }
  171. function validateEditMailMessage()
  172. {
  173. include('classes/Lib/FormValidation.php');
  174. if(strtolower($_SERVER['REQUEST_METHOD'])=="post")
  175. {
  176. if($_POST['mail_msg_subject']!='' or $_POST['mail_msg_subject']=='' or $_POST['mailmessages']!='' or $_POST['mailmessages']=='' )
  177. {
  178. $obj = new Lib_FormValidation('editmailmessage');
  179. }
  180. else
  181. {
  182. header("Location:?do=mailmessages&action=disp&id=".$_GET['id']);
  183. exit();
  184. }
  185. }
  186. }
  187. function validateAdminProfile()
  188. {
  189. include('classes/Lib/FormValidation.php');
  190. if(strtolower($_SERVER['REQUEST_METHOD'])=="post")
  191. {
  192. if($_POST['admin_name']!='' or $_POST['admin_name']=='' or $_POST['admin_email']!='' or $_POST['admin_email']=='' or $_POST['admin_password']!='' or $_POST['admin_password']=='')
  193. {
  194. $obj = new Lib_FormValidation('adminprofile');
  195. }
  196. else
  197. {
  198. header("Location:?do=adminprofile");
  199. exit();
  200. }
  201. }
  202. }
  203. function validateEditNews()
  204. {
  205. include('classes/Lib/FormValidation.php');
  206. if(strtolower($_SERVER['REQUEST_METHOD'])=="post")
  207. {
  208. if($_POST['newstitle']!='' or $_POST['newstitle']=='' or $_POST['newscontent']!='' or $_POST['newscontent']=='' )
  209. {
  210. $obj = new Lib_FormValidation('editnews');
  211. }
  212. else
  213. {
  214. header("Location:?do=news&action=disp&id=".$_GET['id']);
  215. exit();
  216. }
  217. }
  218. }
  219. function validateAddNews()
  220. {
  221. include('classes/Lib/FormValidation.php');
  222. if(strtolower($_SERVER['REQUEST_METHOD'])=="post")
  223. {
  224. if($_POST['newstitle']!='' or $_POST['newstitle']=='' or $_POST['newscontent']!='' or $_POST['newscontent']=='' )
  225. {
  226. $obj = new Lib_FormValidation('addnews');
  227. }
  228. else
  229. {
  230. header("Location:?do=news");
  231. exit();
  232. }
  233. }
  234. }
  235. function validateFooterConnect()
  236. {
  237. include('classes/Lib/FormValidation.php');
  238. if(strtolower($_SERVER['REQUEST_METHOD'])=="post")
  239. {
  240. if($_POST['callus']!='' or $_POST['callus']=='' or $_POST['email']!='' or $_POST['email']=='' or $_POST['fax']!='' or $_POST['fax']=='' or $_POST['location']!='' or $_POST['location']=='' or $_POST['footercontent']!='' or $_POST['footercontent']=='' or $_POST['free_shipping_cost']!='' or $_POST['free_shipping_cost']=='')
  241. {
  242. $obj = new Lib_FormValidation('footercontent');
  243. }
  244. else
  245. {
  246. header("Location:?do=footersettings&action=connect");
  247. exit();
  248. }
  249. }
  250. }
  251. function validateEditCategory()
  252. {
  253. include('classes/Lib/FormValidation.php');
  254. if(strtolower($_SERVER['REQUEST_METHOD'])=="post")
  255. {
  256. if($_POST['category']!='' or $_POST['category']=='')
  257. {
  258. $obj = new Lib_FormValidation('editcategory');
  259. }
  260. else
  261. {
  262. header("Location:?do=showmain&action=disp&id=".$_GET['id']);
  263. exit();
  264. }
  265. }
  266. }
  267. function validateSiteSettings()
  268. {
  269. include('classes/Lib/FormValidation.php');
  270. if(strtolower($_SERVER['REQUEST_METHOD'])=="post")
  271. {
  272. if($_POST['site_moto']=='' || $_POST['attributevalues']!='' || $_POST['admin_email']=='' || $_POST['admin_email']!='')
  273. {
  274. $obj = new Lib_FormValidation('sitesettings');
  275. }
  276. else
  277. {
  278. header("Location:?do=site");
  279. exit();
  280. }
  281. }
  282. }
  283. function validateEditAttributeValues()
  284. {
  285. include('classes/Lib/FormValidation.php');
  286. if(strtolower($_SERVER['REQUEST_METHOD'])=="post")
  287. {
  288. if($_POST['attributevalues']=='' || $_POST['attributevalues']!='')
  289. {
  290. $obj = new Lib_FormValidation('editattributevalues');
  291. }
  292. else
  293. {
  294. header("Location:?do=addattributevalues&action=disp&id=".(int)$_GET['id']);
  295. exit();
  296. }
  297. }
  298. }
  299. function validateAddAttributeValues()
  300. {
  301. include('classes/Lib/FormValidation.php');
  302. if(strtolower($_SERVER['REQUEST_METHOD'])=="post")
  303. {
  304. if($_POST['attributevalues']=='' || $_POST['attributevalues']!='')
  305. {
  306. $obj = new Lib_FormValidation('addattributevalues');
  307. }
  308. else
  309. {
  310. header("Location:?do=attributevalues&action=add");
  311. exit();
  312. }
  313. }
  314. }
  315. /**
  316. * Function checks whether the request method is post and invokes the validation module
  317. *
  318. *
  319. *
  320. * @return void
  321. */
  322. function validateUserUpdate()
  323. {
  324. include('classes/Lib/FormValidation.php');
  325. if(strtolower($_SERVER['REQUEST_METHOD'])=="post")
  326. {
  327. if($_POST['txtdisname']=='' or $_POST['txtlname']=='' or $_POST['txtfname']=='' or $_POST['txtemail']==''
  328. or $_POST['txtpwd']=='' or $_POST['txtdisname']!='' or $_POST['txtlname']!='' or $_POST['txtfname']!=''
  329. or $_POST['txtemail']!='' or $_POST['txtpwd']!='')
  330. {
  331. $obj = new Lib_FormValidation('useraccupdate');
  332. }
  333. else
  334. {
  335. $userid=$_GET['userid'];
  336. header('?do=editreg&action=edit&userid='.$userid);
  337. exit();
  338. }
  339. }
  340. }
  341. /**
  342. * Function checks whether the request method is post and invokes the validation module
  343. *
  344. *
  345. *
  346. * @return void
  347. */
  348. function validateGiftEntry()
  349. {
  350. include('classes/Lib/FormValidation.php');
  351. if(strtolower($_SERVER['REQUEST_METHOD'])=="post")
  352. {
  353. if($_POST['price']==''||$_POST['price']!='')
  354. {
  355. $obj = new Lib_FormValidation('giftproductreg');
  356. }
  357. else
  358. {
  359. header("Location:?do=giftproductentry");
  360. exit();
  361. }
  362. }
  363. }
  364. /**
  365. * Function checks whether the request method is post and invokes the validation module
  366. *
  367. *
  368. *
  369. * @return void
  370. */
  371. function validateDigitalEntry()
  372. {
  373. include('classes/Lib/FormValidation.php');
  374. if(strtolower($_SERVER['REQUEST_METHOD'])=="post")
  375. {
  376. if($_POST['price']==''||$_POST['price']!='')
  377. {
  378. $obj = new Lib_FormValidation('digitalproductreg');
  379. }
  380. else
  381. {
  382. header("Location:?do=digitproductentry");
  383. exit();
  384. }
  385. }
  386. }
  387. /**
  388. * Function checks whether the request method is post and invokes the validation module
  389. *
  390. *
  391. *
  392. * @return void
  393. */
  394. function validateCsevalidation()
  395. {
  396. include('classes/Lib/FormValidation.php');
  397. if(strtolower($_SERVER['REQUEST_METHOD'])=="post")
  398. {
  399. if($_POST['regid']=='' or $_POST['regid']!='' )
  400. {
  401. $obj = new Lib_FormValidation('checkCse');
  402. }
  403. else
  404. {
  405. header('Location:?do=cse');
  406. exit();
  407. }
  408. }
  409. }
  410. /**
  411. * Function checks whether the request method is post and invokes the validation module
  412. *
  413. *
  414. *
  415. * @return void
  416. */
  417. function validateEditDynamicCms()
  418. {
  419. include('classes/Lib/FormValidation.php');
  420. if(strtolower($_SERVER['REQUEST_METHOD'])=="post")
  421. {
  422. if($_POST['cms_page_alias']=='' or $_POST['cms_page_alias']!='' )
  423. {
  424. $obj = new Lib_FormValidation('editdynamiccms');
  425. }
  426. else
  427. {
  428. header('Location:?do=dynamiccms&action=edit&id='.$_GET['id']);
  429. exit();
  430. }
  431. }
  432. }
  433. /**
  434. * Function checks whether the request method is post and invokes the validation module
  435. *
  436. *
  437. *
  438. * @return void
  439. */
  440. function validateDynamicCms()
  441. {
  442. include('classes/Lib/FormValidation.php');
  443. if(strtolower($_SERVER['REQUEST_METHOD'])=="post")
  444. {
  445. if($_POST['cms_page_alias']=='' or $_POST['cms_page_alias']!='' )
  446. {
  447. $obj = new Lib_FormValidation('dynamiccms');
  448. }
  449. else
  450. {
  451. header('Location:?do=dynamiccms');
  452. exit();
  453. }
  454. }
  455. }
  456. /**
  457. * Function checks whether the request method is post and invokes the validation module
  458. *
  459. *
  460. *
  461. * @return void
  462. */
  463. function validateAddHomePageAds()
  464. {
  465. include('classes/Lib/FormValidation.php');
  466. if(strtolower($_SERVER['REQUEST_METHOD'])=="post")
  467. {
  468. if($_POST['title']==''or $_POST['title']!='' or $_POST['url']=='' or $_POST['url']!='' or $_FILES['logo']['name']=='' or $_FILES['logo']['name']!='' )
  469. {
  470. $obj = new Lib_FormValidation('addhomepageads');
  471. }
  472. else
  473. {
  474. header('Location:?do=homepageads&action=show');
  475. exit();
  476. }
  477. }
  478. }
  479. /**
  480. * Function checks whether the request method is post and invokes the validation module
  481. *
  482. *
  483. *
  484. * @return void
  485. */
  486. function validateEditHomePageAds()
  487. {
  488. include('classes/Lib/FormValidation.php');
  489. if(strtolower($_SERVER['REQUEST_METHOD'])=="post")
  490. {
  491. if($_POST['home_page_ads_title']==''or $_POST['home_page_ads_title']!='' or $_POST['home_page_ads_url']=='' or $_POST['home_page_ads_url']!='' or $_FILES['home_page_ads_logo']['name']=='' or $_FILES['home_page_ads_logo']['name']!='' )
  492. {
  493. $obj = new Lib_FormValidation('edithomepageads');
  494. }
  495. else
  496. {
  497. header('Location:?do=homepageads&action=edit&id='.$_GET['id']);
  498. exit();
  499. }
  500. }
  501. }
  502. /**
  503. * Function checks whether the request method is post and invokes the validation module
  504. *
  505. *
  506. *
  507. * @return void
  508. */
  509. function validateUpdateSocialLink()
  510. {
  511. include('classes/Lib/FormValidation.php');
  512. if(strtolower($_SERVER['REQUEST_METHOD'])=="post")
  513. {
  514. if($_POST['social_link_title']!='' or $_POST['social_link_title']=='' or $_POST['social_link_url']=='' or $_POST['social_link_url']!='' )
  515. {
  516. $obj = new Lib_FormValidation('updatesociallink');
  517. }
  518. else
  519. {
  520. header("Location:?do=sociallink");
  521. exit();
  522. }
  523. }
  524. }
  525. /**
  526. * Function checks whether the request method is post and invokes the validation module
  527. *
  528. *
  529. *
  530. * @return void
  531. */
  532. function validateAddSocialLink()
  533. {
  534. include('classes/Lib/FormValidation.php');
  535. if(strtolower($_SERVER['REQUEST_METHOD'])=="post")
  536. {
  537. if($_POST['social_link_title']!='' or $_POST['social_link_title']=='' or $_POST['social_link_url']=='' or $_POST['social_link_url']!='' )
  538. {
  539. $obj = new Lib_FormValidation('addsociallink');
  540. }
  541. else
  542. {
  543. header("Location:?do=sociallink");
  544. exit();
  545. }
  546. }
  547. }
  548. /**
  549. * Function checks whether the request method is post and invokes the validation module
  550. *
  551. *
  552. *
  553. * @return void
  554. */
  555. function validateSlideShow()
  556. {
  557. include('classes/Lib/FormValidation.php');
  558. if(strtolower($_SERVER['REQUEST_METHOD'])=="post")
  559. {
  560. $obj = new Lib_FormValidation('updateslideshow');
  561. }
  562. }
  563. /**
  564. * Function checks whether the request method is post and invokes the validation module
  565. *
  566. *
  567. *
  568. * @return void
  569. */
  570. function validateCheckout()
  571. {
  572. include('classes/Lib/FormValidation.php');
  573. if(strtolower($_SERVER['REQUEST_METHOD'])=="post")
  574. {
  575. if($_POST['txtname']=='' or $_POST['txtstreet']=='' or $_POST['txtsuburb']=='' or $_POST['txtzipcode']!='' or $_POST['txtcountry']!='' or $_POST['txtstate']!='' or $_POST['txtsname']!='' or $_POST['txtsstreet']!='' or $_POST['txtssuburb']!='' or $_POST['txtszipcode']!='' or $_POST['txtscountry']!='' or $_POST['txtsstate']!='' or $_POST['selshipcountry']!='' or $_POST['selbillcountry']!='' or $_POST['txtzipcode']!='' or $_POST['selCustomer']!='' or $_POST['selCustomer']=='')
  576. {
  577. $obj = new Lib_FormValidation('frmship');
  578. }
  579. else
  580. {
  581. header("Location:?do=addUserProduct");
  582. exit();
  583. }
  584. }
  585. }
  586. /**
  587. * Function checks whether the request method is post and invokes the validation module
  588. *
  589. *
  590. *
  591. * @return void
  592. */
  593. function validateUserRegister()
  594. {
  595. include('classes/Lib/FormValidation.php');
  596. if(strtolower($_SERVER['REQUEST_METHOD'])=="post")
  597. {
  598. if($_POST['txtdisname']=='' or $_POST['txtlname']=='' or $_POST['txtfname']=='' or $_POST['txtemail']==''
  599. or $_POST['txtpwd']=='' or $_POST['txtdisname']!='' or $_POST['txtlname']!='' or $_POST['txtfname']!=''
  600. or $_POST['txtemail']!='' or $_POST['txtpwd']!='')
  601. {
  602. $obj = new Lib_FormValidation('useraccregister');
  603. }
  604. else
  605. {
  606. header("Location:?do=addUserAccount");
  607. exit();
  608. }
  609. }
  610. }
  611. /**
  612. * Function checks whether the request method is post and invokes the validation module
  613. *
  614. *
  615. *
  616. * @return void
  617. */
  618. function validateUserRegisterLight()
  619. {
  620. include('classes/Lib/FormValidation.php');
  621. if(strtolower($_SERVER['REQUEST_METHOD'])=="post")
  622. {
  623. if($_POST['txtdisname']=='' or $_POST['txtlname']=='' or $_POST['txtfname']=='' or $_POST['txtemail']==''
  624. or $_POST['txtpwd']=='' or $_POST['txtdisname']!='' or $_POST['txtlname']!='' or $_POST['txtfname']!=''
  625. or $_POST['txtemail']!='' or $_POST['txtpwd']!='')
  626. {
  627. $obj = new Lib_FormValidation('useraccregisterlight');
  628. }
  629. else
  630. {
  631. header("Location:?do=addUserAccountLight");
  632. exit();
  633. }
  634. }
  635. }
  636. /**
  637. * Function checks whether the request method is post and invokes the validation module
  638. *
  639. *
  640. *
  641. * @return void
  642. */
  643. function checkAddCategory()
  644. {
  645. include('classes/Lib/FormValidation.php');
  646. if(strtolower($_SERVER['REQUEST_METHOD'])=="post")
  647. {
  648. if($_POST['category']!='' or $_POST['category']=='')
  649. {
  650. $obj = new Lib_FormValidation('category');
  651. }
  652. else
  653. {
  654. header("Location:?do=managecategory");
  655. exit();
  656. }
  657. }
  658. }
  659. /**
  660. * Function checks whether the request method is post and invokes the validation module
  661. *
  662. *
  663. *
  664. * @return void
  665. */
  666. function validatelogin()
  667. {
  668. include('classes/Lib/FormValidation.php');
  669. if(strtolower($_SERVER['REQUEST_METHOD'])=="post")
  670. {
  671. if($_POST['username']!='' or $_POST['password']!='' or $_POST['username']=='' or $_POST['password']=='')
  672. {
  673. $obj = new Lib_FormValidation('validatelogin');
  674. }
  675. else
  676. {
  677. header("Location:?do=adminlogin");
  678. exit();
  679. }
  680. }
  681. }
  682. /**
  683. * Function checks whether the request method is post and invokes the validation module
  684. *
  685. *
  686. *
  687. * @return void
  688. */
  689. function validateAttributes()
  690. {
  691. include('classes/Lib/FormValidation.php');
  692. if(strtolower($_SERVER['REQUEST_METHOD'])=="post")
  693. {
  694. if($_POST['attributes']!='' or $_POST['attributes']=='')
  695. {
  696. $obj = new Lib_FormValidation('attributes');
  697. }
  698. else
  699. {
  700. header("Location:?do=adminlogin");
  701. exit();
  702. }
  703. }
  704. }
  705. /**
  706. * Function checks whether the request method is post and invokes the validation module
  707. *
  708. *
  709. *
  710. * @return void
  711. */
  712. function validateEditAttributes()
  713. {
  714. include('classes/Lib/FormValidation.php');
  715. if(strtolower($_SERVER['REQUEST_METHOD'])=="post")
  716. {
  717. if($_POST['attributes']!='' or $_POST['attributes']=='')
  718. {
  719. $obj = new Lib_FormValidation('editattributes');
  720. }
  721. else
  722. {
  723. header("Location:?do=adminlogin");
  724. exit();
  725. }
  726. }
  727. }
  728. /**
  729. * Function checks whether the request method is post and invokes the validation module
  730. *
  731. *
  732. *
  733. * @return void
  734. */
  735. function validatSubAdminEmail()
  736. {
  737. include('classes/Lib/FormValidation.php');
  738. if(strtolower($_SERVER['REQUEST_METHOD'])=="post")
  739. {
  740. if($_POST['subadminemail']!='' or $_POST['subadminemail']=='' or $_POST['subadminname']!='' or $_POST['subadminname']=='' or $_POST['subadminpassword']!='' or $_POST['subadminpassword']=='')
  741. {
  742. $obj = new Lib_FormValidation('subadminmail');
  743. }
  744. else
  745. {
  746. header("Location:?do=subadminmgt");
  747. exit();
  748. }
  749. }
  750. }
  751. /**
  752. * Function checks whether the request method is post and invokes the validation module
  753. *
  754. *
  755. *
  756. * @return void
  757. */
  758. function validateAdminEmail()
  759. {
  760. include('classes/Lib/FormValidation.php');
  761. if(strtolower($_SERVER['REQUEST_METHOD'])=="post")
  762. {
  763. if($_POST['adminemail']!='' or $_POST['adminemail']=='')
  764. {
  765. $obj = new Lib_FormValidation('adminemail');
  766. }
  767. else
  768. {
  769. header("Location:?do=adminlogin&action=showpage");
  770. exit();
  771. }
  772. }
  773. }
  774. /**
  775. * Function checks whether the request method is post and invokes the validation module
  776. *
  777. *
  778. *
  779. * @return void
  780. */
  781. function validateEntry()
  782. {
  783. include('classes/Lib/FormValidation.php');
  784. if(strtolower($_SERVER['REQUEST_METHOD'])=="post")
  785. {
  786. if($_POST['title']=='' or $_POST['price']=='' or $_POST['msrp']=='' or $_POST['title']!='' or $_POST['price']!='' or $_POST['msrp']!='' or count($_POST['shipcost'])>0 or count($_POST['rol'])>0 or count($_POST['soh'])>0 or count($_POST['sku'])>0)
  787. {
  788. $obj = new Lib_FormValidation('productreg');
  789. }
  790. else
  791. {
  792. header("Location:?do=productentry");
  793. exit();
  794. }
  795. }
  796. }
  797. /**
  798. * Function checks whether the request method is post and invokes the validation module
  799. *
  800. *
  801. *
  802. * @return void
  803. */
  804. function validateEntryUpdate()
  805. {
  806. $id=$_GET['prodid'];
  807. include('classes/Lib/FormValidation.php');
  808. if(strtolower($_SERVER['REQUEST_METHOD'])=="post")
  809. {
  810. if($_POST['title']=='' or $_POST['price']=='' or $_POST['msrp']=='' or $_POST['title']!='' or $_POST['price']!='' or $_POST['msrp']!='' or count($_POST['shipcost'])>0 or count($_POST['rol'])>0 or count($_POST['soh'])>0 or count($_POST['sku'])>0)
  811. {
  812. $obj = new Lib_FormValidation('productupdate');
  813. }
  814. else
  815. {
  816. header("Location:?do=manageproducts&action=editprod&prodid=".$id."");
  817. exit();
  818. }
  819. }
  820. }
  821. /**
  822. * Function checks whether the request method is post and invokes the validation module
  823. *
  824. *
  825. *
  826. * @return void
  827. */
  828. function validateRegionwisetaxEntry()
  829. {
  830. include('classes/Lib/FormValidation.php');
  831. if(strtolower($_SERVER['REQUEST_METHOD'])=="post")
  832. {
  833. $obj = new Lib_FormValidation('regionwisetax');
  834. }
  835. }
  836. /**
  837. * Function checks whether the request method is post and invokes the validation module
  838. *
  839. *
  840. *
  841. * @return void
  842. */
  843. function validateRegionwisetaxEdit()
  844. {
  845. include('classes/Lib/FormValidation.php');
  846. if(strtolower($_SERVER['REQUEST_METHOD'])=="post")
  847. {
  848. $obj = new Lib_FormValidation('regionwisetaxedit');
  849. }
  850. }
  851. /**
  852. * Function checks whether the request method is post and invokes the validation module
  853. *
  854. *
  855. *
  856. * @return void
  857. */
  858. function validateCurrency()
  859. {
  860. include('classes/Lib/FormValidation.php');
  861. if(strtolower($_SERVER['REQUEST_METHOD'])=="post")
  862. {
  863. if(isset($_POST['currency_name'])&&isset($_POST['currency_tocken'])&&isset($_POST['currency_code']))
  864. {
  865. $obj = new Lib_FormValidation('addnewcurrency');
  866. }
  867. else
  868. {
  869. header("Location:?do=showaddcurrency");
  870. exit();
  871. }
  872. }
  873. }
  874. /**
  875. * Function checks whether the request method is post and invokes the validation module
  876. *
  877. *
  878. *
  879. * @return void
  880. */
  881. function validateEditCurrency()
  882. {
  883. include('classes/Lib/FormValidation.php');
  884. if(strtolower($_SERVER['REQUEST_METHOD'])=="post")
  885. {
  886. $obj = new Lib_FormValidation('updatecurrency');
  887. }
  888. }
  889. function validateCustomerGroup()
  890. {
  891. include('classes/Lib/FormValidation.php');
  892. if(strtolower($_SERVER['REQUEST_METHOD'])=="post")
  893. {
  894. if(isset($_POST))
  895. {
  896. $obj = new Lib_FormValidation('customergrp');
  897. }
  898. else
  899. {
  900. header("Location:?do=custgroup&action=add");
  901. exit();
  902. }
  903. }
  904. }
  905. function validateEditCustomerGroup()
  906. {
  907. include('classes/Lib/FormValidation.php');
  908. if(strtolower($_SERVER['REQUEST_METHOD'])=="post")
  909. {
  910. if(isset($_POST))
  911. {
  912. $obj = new Lib_FormValidation('editcustomergrp');
  913. }
  914. else
  915. {
  916. $id = $_POST['groupid'];
  917. header("Location:?do=custgroup&action=edit&id=".$id);
  918. exit();
  919. }
  920. }
  921. }
  922. }
  923. ?>