$Form->setError('error', 'Please write user password'); } // Password if (!isset($_POST['phone']) || empty($_POST['phone'])) { $Form->setError('error', 'Please write user phone number'); } // Agency if (!isset($_POST['agency']) || empty($_POST['agency'])) { $Form->setError('error', 'Please select a agency'); } /** * Error Found! * Redirect back to form page */ if ($Form->num_errors > 0) { $Form->return_msg_to('add-a-user.php'); } $first_name = cleanData($_POST['first_name']); $last_name = cleanData($_POST['last_name']); $email = cleanData($_POST['email']); $password = cleanData($_POST['password']); $phone = cleanData($_POST['phone']); $agency = cleanData($_POST['agency']); $userAdd = insertQuery(TBL_USER, array('type' => 'user', 'agency_id' => $agency, 'first_name' => $first_name, 'last_name' => $last_name, 'email' => $email, 'password' => $password, 'phone_no' => $phone, 'create_date' => 'NOW()')); if (!$userAdd) { $Form->setError('error', 'Database error! Please try again.'); $Form->return_msg_to('add-a-user.php'); } else { $Form->setError('success', 'New user added successfully'); $Form->return_msg_to('user.php'); }
<?php /* Created on : Sep 15, 2014, 3:40:02 PM Author : me@rafi.pro Name : Mohammad Faozul Azim Rafi */ include '../../core.php'; $session->loginRequired('admin', false); $Form = new Form(); if (!isset($_POST['id'])) { $Form->setError('error', 'You must select a banner to delete!'); $Form->return_msg_to('banner.php'); } $id = cleanData($_POST['id']); $result = mysql_fetch_array(mysql_query('SELECT * FROM ' . TBL_BANNER . ' WHERE id="' . $id . '"')); if ($result == FALSE) { $Form->setError('error', 'Banner id not found!'); $Form->return_msg_to('banner.php'); } $delete_result = mysql_query('DELETE FROM ' . TBL_BANNER . ' WHERE id="' . $id . '"'); if ($delete_result) { if (file_exists(UPLOAD_DIR . $result['file_name'])) { unlink(UPLOAD_DIR . $result['file_name']); } $Form->setError('success', 'Banner delete success!'); $Form->return_msg_to('banner.php'); } $Form->setError('success', 'Banner delete failed!'); $Form->return_msg_to('banner.php');
<?php /** * Created by N0B0DY. * User: me@suvo.me * Date: 9/15/14 * Time: 1:41 AM */ include '../../core.php'; $session->loginRequired('admin', false); $form = new Form(); if (!isset($_POST['starter_id'])) { $form->setError('starter_error', 'Please select a starter!'); $form->return_msg_to('starters.php'); } if (isset($_POST['delete_starter']) && $_POST['delete_starter'] == 'DELETE') { $starter_id = $_POST['starter_id']; if (sizeof($starter_id) <= 0) { $form->setError('starter_error', 'Please select a conversation to delete!'); $form->return_msg_to('starters.php'); } foreach ($starter_id as $id) { mysql_query("DELETE FROM starter WHERE `id`={$id}"); } $form->setError('starter_success', 'Conversation(s) deleted successfully!'); $form->return_msg_to('starters.php'); } else { if (isset($_POST['edit_starter']) && $_POST['edit_starter'] == 'EDIT') { $starter_id = $_POST['starter_id']; if (sizeof($starter_id) <= 0) { $form->setError('starter_error', 'Please select a conversation to edit!');
<?php /** * Created by N0B0DY. * User: me@suvo.me * Date: 9/15/14 * Time: 1:41 AM */ require '../../core.php'; $session->loginRequired('admin', false); $Form = new Form(); if (!isset($_POST['id'])) { $Form->setError('error', 'Please select a admin!'); $Form->return_msg_to('administrator.php'); } if (isset($_POST['delete_admin']) && $_POST['delete_admin'] == 'DELETE') { $id = $_POST['id']; if (sizeof($id) <= 0) { $Form->setError('error', 'Please select an admin to delete!'); $Form->return_msg_to('administrator.php'); } foreach ($id as $id) { mysql_query("DELETE FROM " . TBL_USER . " WHERE `id`={$id}"); } $Form->setError('success', 'Admin(s) deleted successfully!'); $Form->return_msg_to('administrator.php'); } else { if (isset($_POST['edit_admin']) && $_POST['edit_admin'] == 'EDIT') { $id = $_POST['id']; if (sizeof($id) <= 0) { $Form->setError('error', 'Please select an admin to edit!');
<?php /** * Created by N0B0DY. * User: me@suvo.me * Date: 9/15/14 * Time: 1:41 AM */ require '../../core.php'; $session->loginRequired('admin', false); $Form = new Form(); //Agency ID if (!isset($_POST['agency_id']) || empty($_POST['agency_id'])) { $Form->setError('error', 'No Agency ID Found!'); $Form->return_msg_to('user.php'); } else { $agency_query = mysql_query("SELECT * FROM " . TBL_AGENCY . " WHERE id='" . cleanData($_POST['agency_id']) . "'"); if (mysql_num_rows($agency_query) < 1) { $Form->setError('error', 'No agency found!'); $Form->return_msg_to('user.php'); } } // First Name if (!isset($_POST['agency_name']) || empty($_POST['agency_name'])) { $Form->setError('error', 'Please write Agency Name'); } // Last Name if (!isset($_POST['primary_contact']) || empty($_POST['primary_contact'])) { $Form->setError('error', 'Please write Primary Contact'); } // Email
* Created by N0B0DY. * User: me@suvo.me * Date: 9/15/14 * Time: 1:41 AM */ include '../../core.php'; $session->loginRequired('admin', false); $form = new Form(); if (isset($_POST['add_agency']) && $_POST['add_agency'] == 'ADD') { $name = cleanData($_POST['name']); $contact = cleanData($_POST['contact']); $email = cleanData($_POST['email']); $phone = cleanData($_POST['phone']); if ($name == '') { $form->setError('agency_error', 'Agency Name is required!'); $form->return_msg_to(WEBSITE_URL . 'admin/user/add-an-agency.php'); } if ($contact == '') { $form->setError('agency_error', 'Primary Contact is required!'); $form->return_msg_to(WEBSITE_URL . 'admin/user/add-an-agency.php'); } if ($email == '' || !is_valid_email($email)) { $form->setError('agency_error', 'Agency Email is required and must be valid!'); $form->return_msg_to(WEBSITE_URL . 'admin/user/add-an-agency.php'); } if ($phone == '') { $form->setError('agency_error', 'Phone is required!'); $form->return_msg_to(WEBSITE_URL . 'admin/user/add-an-agency.php'); } $status = mysql_query("INSERT INTO agency (`agency_name`, `primary_contact`, `email`, `phone_no`, `create_date`) VALUES ('{$name}', '{$contact}', '{$email}', '{$phone}', NOW())"); if ($status) {
* Date: 9/15/14 * Time: 1:41 AM */ require 'core.php'; $Form = new Form(); if (!isset($_POST['submit'])) { redirect('login.php'); } else { if (!isset($_POST['email']) || empty($_POST['email'])) { $Form->setError('error', 'Your email or password is incorrect.'); } if (!isset($_POST['password']) || empty($_POST['password'])) { $Form->setError('error', 'Your email or password is incorrect.'); } if ($Form->num_errors > 0) { $Form->return_msg_to('login.php'); } else { $email = cleanData($_POST['email']); $password = cleanData($_POST['password']); $remember_me = isset($_POST['remember_me']) ? true : false; $login = $session->login($email, $password, $remember_me); if ($login) { if ($_SESSION['loginType'] == 'admin') { redirect(WEBSITE_URL . 'admin/dashboard.php'); } else { redirect('view.php'); } } else { $Form->setError('error', 'Database Error!'); $Form->return_msg_to('login.php'); }
<?php /** * Created by N0B0DY. * User: me@suvo.me * Date: 9/15/14 * Time: 1:41 AM */ require '../../core.php'; $session->loginRequired('admin', false); $Form = new Form(); //User ID if (!isset($_POST['user_id']) || empty($_POST['user_id'])) { $Form->setError('error', 'No User ID Found!'); $Form->return_msg_to('user.php'); } else { $user_query = mysql_query("SELECT * FROM " . TBL_USER . " WHERE id='" . cleanData($_POST['user_id']) . "'"); if (mysql_num_rows($user_query) < 1) { $Form->setError('error', 'No user found!'); $Form->return_msg_to('user.php'); } } // First Name if (!isset($_POST['first_name']) || empty($_POST['first_name'])) { $Form->setError('error', 'Please write user First Name'); } // Last Name if (!isset($_POST['last_name']) || empty($_POST['last_name'])) { $Form->setError('error', 'Please write user Last Name'); } // Email
<?php /** * Created by N0B0DY. * User: me@suvo.me * Date: 9/15/14 * Time: 1:41 AM */ include '../../core.php'; $session->loginRequired('admin', false); $form = new Form(); if (isset($_POST['submit_starter']) && $_POST['submit_starter'] == 'ADD') { if (!isset($_POST['starter'])) { $form->setError('starter_error', 'Please select a starter!'); $form->return_msg_to(WEBSITE_URL . 'admin/starter/add-starter.php'); } $starter = cleanData($_POST['starter']); if ($starter != '') { $status = mysql_query("INSERT INTO starter (`starter`, `create_date`) VALUES ('{$starter}', NOW())"); if ($status) { $form->setError('starter_success', 'Conversation added successfully!'); $form->return_msg_to(WEBSITE_URL . 'admin/starter/add-starter.php'); } } else { $form->setError('starter_error', 'Please enter some value!'); $form->return_msg_to(WEBSITE_URL . 'admin/starter/add-starter.php'); } } else { $form->return_msg_to(WEBSITE_URL . 'admin/starter/add-starter.php'); }
* Created by N0B0DY. * User: me@suvo.me * Date: 9/15/14 * Time: 1:41 AM */ require 'core.php'; $Form = new Form(); $Email = new Email(); if (!isset($_POST['submit'])) { redirect('forgot_password.php'); } else { if (!isset($_POST['email']) || empty($_POST['email'])) { $Form->setError('email', 'Please write your email address'); } if ($Form->num_errors > 0) { $Form->return_msg_to('forgot_password.php'); } else { $email = cleanData($_POST['email']); $user = mysql_fetch_assoc(mysql_query('SELECT * FROM ' . TBL_USER . ' WHERE email="' . $email . '"')); if (!$user) { $Form->setError('notFound', 'User Not Found.'); $Form->return_msg_to('forgot_password.php'); } else { $Email->setEmailSubject('Forgot Password'); $Email->setMessage('Your password is ' . $user['password']); $Email->setEmailTo($email); if ($Email->sendMail()) { $Form->setError('success', 'Your password has been sent to your email. Please check your mails.'); $Form->return_msg_to('forgot_password.php'); } else { $Form->setError('notFound', 'User Not Found.');
<?php /** * Created by N0B0DY. * User: me@suvo.me * Date: 9/15/14 * Time: 1:41 AM */ require '../../core.php'; $session->loginRequired('admin', false); $Form = new Form(); //User ID if (!isset($_POST['id']) || empty($_POST['id'])) { $Form->setError('error', 'No Admin ID Found!'); $Form->return_msg_to('administrator.php'); } else { $user_query = mysql_query("SELECT * FROM " . TBL_USER . " WHERE id='" . cleanData($_POST['id']) . "'"); if (mysql_num_rows($user_query) < 1) { $Form->setError('error', 'No admin found!'); $Form->return_msg_to('administrator.php'); } } // First Name if (!isset($_POST['first_name']) || empty($_POST['first_name'])) { $Form->setError('error', 'Please write user First Name'); } // Last Name if (!isset($_POST['last_name']) || empty($_POST['last_name'])) { $Form->setError('error', 'Please write user Last Name'); } // Email
<?php /** * Created by N0B0DY. * User: me@suvo.me * Date: 9/15/14 * Time: 1:41 AM */ include '../../core.php'; $session->loginRequired('admin'); $form = new Form(); $id = (int) $_GET['id']; if (!$id) { $form->return_msg_to(WEBSITE_URL . 'starter/starters.php'); } $data = mysql_fetch_object(mysql_query('SELECT * FROM starter WHERE id=' . $id)); if (!$data) { $form->return_msg_to(WEBSITE_URL . 'starter/starters.php'); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Life Department - View</title> <?php include ROOT_DIR . '/include/head.php'; ?> <script type="text/javascript" src="<?php echo JS;
if (!isset($_POST['last_name']) || empty($_POST['last_name'])) { $Form->setError('error', 'Please write your last name.'); } if (!isset($_POST['lead_result']) || empty($_POST['lead_result'])) { $Form->setError('error', 'Please select a lead result.'); } if ($_POST['lead_result'] == 'Y') { if (!isset($_POST['call_time']) || empty($_POST['call_time'])) { $Form->setError('leadsError', 'Please select call time and enter a phone number'); } if (!isset($_POST['phone_no']) || empty($_POST['phone_no'])) { $Form->setError('leadsError', 'Please select call time and enter a phone number'); } } if ($Form->num_errors > 0) { $Form->return_msg_to('view.php'); } else { $first_name = cleanData($_POST['first_name']); $last_name = cleanData($_POST['last_name']); $lead_result = cleanData($_POST['lead_result']); $call_time = cleanData($_POST['call_time']); $phone_no = cleanData($_POST['phone_no']); $notes = cleanData($_POST['notes']); $leadAdd = insertQuery(TBL_LEADS, array('user_id' => $_SESSION['user_id'], 'first_name' => $first_name, 'last_name' => $last_name, 'lead_result' => $lead_result, 'call_time' => $call_time, 'phone_no' => $phone_no, 'notes' => $notes, 'create_date' => 'NOW()')); if (!$leadAdd) { $Form->setError('error', 'Database error! Please try again.'); $Form->return_msg_to('view.php'); } else { if ($lead_result == 'Y') { $leadData = mysql_fetch_object(mysql_query("SELECT agency.agency_name, leads.first_name, leads.last_name, leads.phone_no, leads.call_time, leads.notes FROM leads LEFT JOIN user ON user.id = leads.user_id LEFT JOIN agency ON agency.id = user.agency_id WHERE leads.id = {$leadAdd}")); $Email->setEmailSubject('A new lead has been submitted.');