assign('user', $user); /* ------------------------------------------------------------------- */ $query = mysql_query("SELECT service_url FROM settings LIMIT 1"); $result = mysql_fetch_array($query); $smarty -> assign('service_url', $result['service_url']); /* ------------------------------------------------------------------- */ switch($section) { case 'add': $file = "add,offer.inc.php"; break; case 'addcv': $file = "add,cv.inc.php"; break; case 'cv': $file = "cv.inc.php"; break; case 'cv_account': $file = "cv,account.inc.php"; break; case 'edit_cv': $file = "edit,cv.inc.php"; break; case 'cv_base': $file = "cv,base.inc.php"; break; case 'cv_search': $file = "cv,search.inc.php"; break; case 'offer': $file = "offer.inc.php"; break; case 'employer_offers': $file = "employer,offers.inc.php"; break; case 'employer_settings': $file = "employer,settings.inc.php"; break; case 'edit_offer': $file = "edit,offer.inc.php"; break; case 'pay,dotpay': $file = "pay,dotpay.inc.php"; break; case 'pay,platnosci': $file = "pay,platnosci.inc.php"; break; case 'terms': $file = "terms.inc.php"; break; case 'contact': $file = "contact.inc.php"; break; case 'search': $file = "search.inc.php"; break; case 'offers_search': $file = "offers,search.inc.php"; break; case 'offers_types': $file = "offers,types.inc.php"; break; case 'admin_offers': $file = "admin,offers.inc.php"; break; case 'admin_delete_offer': $file = "admin,delete,offer.inc.php"; break; case 'admin_cvs': $file = "admin,cvs.inc.php"; break; case 'admin_delete_cv': $file = "admin,delete,cv.inc.php"; break; case 'admin_subscriptions':$file = "admin,subscriptions.inc.php"; break; case 'admin_pay': $file = "admin,pay.inc.php"; break; case 'admin_accounts': $file = "admin,accounts.inc.php"; break; case 'admin_employer': $file = "admin,employer.inc.php"; break; case 'admin_pages': $file = "admin,pages.inc.php"; break; case 'admin_settings': $file = "admin,settings.inc.php"; break; case 'admin_contact': $file = "admin,contact.inc.php"; break; case 'admin_account': $file = "admin,account.inc.php"; break; case 'logout': $file = "logout.inc.php"; break; default: $file = "start.inc.php"; } /* ------------------------------------------------------------------- */ if(isset($_POST['memail'])) { if(!eregi("^[_.0-9a-z-]{1,}@[_.0-9a-z-]{1,}.[a-z]{2,3}$" , $_POST['memail'])) $smarty -> assign('email_error', 1); else { $query = mysql_query("SELECT count(*) FROM mailing_list WHERE email = '".$_POST['memail']."' LIMIT 1;"); if(mysql_result($query, 0) > 0) { $smarty -> assign('email_exists', 1); } else { if(mysql_query("INSERT INTO `mailing_list` ( `id` , `email` ) VALUES (0, '".$_POST['memail']."');")) $smarty -> assign('email_added', 'ok'); else $smarty -> assign('email_added', 'failed'); } } } /* ------------------------------------------------------------------- */ $smarty -> assign('file', $file); $smarty -> display('index.tpl'); /* ------------------------------------------------------------------- */ ?>