Advertisement
Guest User

Untitled

a guest
Feb 8th, 2013
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.08 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by deZender.Net
  5. * @ deZender (PHP5 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 1.1.5.0
  8. * @ Author : DeZender
  9. * @ Release on : 09.06.2012
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. class lknJobsCreditSystem {
  15. function save_package() {
  16. $_db = &lknDb::createinstance( );
  17.  
  18. $data = lknGetFormValues( );
  19. $sql = $_db->CreateInsertSql( $data, '#__jobs_package_plans' );
  20. $_db->query( $sql );
  21. $_db->setQuery( );
  22. $insert_id = $_db->get_insert_id( );
  23. return $insert_id;
  24. }
  25.  
  26. function update_package() {
  27. $_db = &lknDb::createinstance( );
  28.  
  29. $id = (int)lknGetParamatre( $_POST, 'cid' );
  30. $data = lknGetFormValues( );
  31. $sql = $_db->CreateUpdateSql( $data, '#__jobs_package_plans', '' . 'id=\'' . $id . '\'' );
  32. $_db->query( $sql );
  33. $_db->setQuery( );
  34. }
  35.  
  36. function sendMail($task, $id) {
  37. global $_config;
  38. $_db = &lknDb::createinstance( );
  39.  
  40. $where = array( );
  41. $where[] = '' . 'u.id=\'' . $id . '\'';
  42. $where = (count( $where ) ? ' WHERE ' . implode( ' AND ', $where ) : '');
  43. $sql = 'SELECT u.email AS email';
  44. $sql .= '
  45. FROM #__users AS u';
  46. $sql .= $where;
  47. $_db->query( $sql );
  48. $_db->setQuery( );
  49. $count = $_db->num_rows( );
  50.  
  51. if ($count == '0') {
  52. return null;
  53. }
  54.  
  55. $row = $_db->loadObject( );
  56. $inform_email = $row->email;
  57. $language = $_config['languageFile'];
  58. $email_texts = JOOMLA_ROOT;
  59. $email_texts .= LKN_DS . 'components' . LKN_DS . 'com_jobs' . LKN_DS . 'emails' . LKN_DS;
  60.  
  61. if (file_exists( $email_texts . $language . '.php' )) {
  62. require_once( $email_texts . $language . '.php' );
  63. } else {
  64. require_once( $email_texts . 'english.php' );
  65. }
  66.  
  67. $jconfig = new lknJoomlaConfig( );
  68. $site_email = $jconfig->get( 'mailfrom' );
  69. $site_name = $jconfig->get( 'sitename' );
  70. $domain = $_SERVER['HTTP_HOST'];
  71. $date = new lknDate( );
  72. $now = lknDate::formatdate( $date->getDate( ) );
  73. $credits = lknGetParamatre( $_REQUEST, 'credit_number' );
  74. $type = $_config['credit_system_based_on'];
  75.  
  76. if ($type == '1') {
  77. $credits .= ' ' . _lkn_credit_buying_history_credit_count;
  78. } else {
  79. if ($type == '2') {
  80. $package_name = lknJobsFunctions::getpackagename( $credits );
  81.  
  82. if ($package_name != '') {
  83. $credits = $package_name . ' ' . _lkn_package_package;
  84. } else {
  85. $credits = ' ';
  86. }
  87. }
  88. }
  89.  
  90.  
  91. if ($task == 'purchased_credit') {
  92. $subject = _lkn_employer_credit_purchased;
  93. $subject = str_replace( '{DOMAIN}', $domain, $subject );
  94. $body = _lkn_employer_credit_purchased_body;
  95. $body = str_replace( '{LIVE_SITE}', LIVE_SITE, $body );
  96. $body = str_replace( '{DOMAIN}', LIVE_SITE, $body );
  97. $body = str_replace( '{SITE_NAME}', $site_name, $body );
  98. $body = str_replace( '{PRICE}', lknGetParamatre( $_REQUEST, 'total' ), $body );
  99. $body = str_replace( '{DATE}', $now, $body );
  100. $body = str_replace( '{ITEM_NAME}', $credits, $body );
  101. } else {
  102. if ($task == 'purchased_credit_pending') {
  103. $subject = _lkn_employer_credit_purchased_pending_subject;
  104. $subject = str_replace( '{DOMAIN}', $domain, $subject );
  105. $body = _lkn_employer_credit_purchased_pending_body;
  106. $body = str_replace( '{LIVE_SITE}', LIVE_SITE, $body );
  107. $body = str_replace( '{DOMAIN}', LIVE_SITE, $body );
  108. $body = str_replace( '{SITE_NAME}', $site_name, $body );
  109. $body = str_replace( '{PRICE}', lknGetParamatre( $_REQUEST, 'total' ), $body );
  110. $body = str_replace( '{DATE}', $now, $body );
  111. $body = str_replace( '{ITEM_NAME}', $credits, $body );
  112. $pending_credits_url = 'index.php?option=com_jobs&task=list_employer_pending_credits&user_id=' . $id . lknJobsItemId( );
  113. $pending_credits_url = LIVE_SITE . '/' . $pending_credits_url;
  114. $body = str_replace( '{PENDING_CREDITS_URL}', $pending_credits_url, $body );
  115. }
  116. }
  117.  
  118. lknSendMail( $site_email, $site_name, $inform_email, $subject, $body );
  119. }
  120. }
  121. .............................................................
  122. ................................
  123. .............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement