<div class="page-heading"> <h1>Add Company</h1> </div> <div class="form-container"> <?php $company = new company(); $ID = isset($_GET['id']) ? $_GET['id'] : NULL; if (isset($_POST['add_company'])) { // Update old record if (isset($ID)) { $results = $company->update_company($_POST, $ID); } else { // Insert new $results = $company->insert_company($_POST); } if ($results) { echo '<div class="alert alert-success" role="alert">'; echo isset($_GET['id']) ? 'Updated ' : 'Added '; echo 'company Sucessfully </div>'; } else { echo '<div class="alert alert-danger" role="alert"> Error </div>'; } } if (isset($ID)) { $company_result = $company->get_companies($ID); } ?> <form class="form-horizontal" action="" method="post">
$company_name = $_POST['company_name']; $category = implode(",", $_POST['industry']); $company_description = $_POST['company_description']; $location = $_POST['location']; $country = $_POST['country']; $registration_no = $_POST['registration_no']; $address = $_POST['address']; $first_name = $_POST['first_name']; $last_name = $_POST['last_name']; $designation = $_POST['designation']; $contact_no = '+' . $_POST['code'] . "-" . $_POST['mobile']; $type = 2; $status = 0; include_once "../config/company.php"; $ob = new company(); $ob->insert_company($company_name, $category, $company_description, $country, $location, $registration_no, $address, $sales, $first_name, $last_name, $designation, $contact_no, $email, $password, $type, $status); } ?> </div> </div> </div> <!--footer--> <div class="footer"> <div class="container"> <div class="footer-left"></div> <div class="footer-right"> <p>© 2015 All rights reserved | Template by <a href="http://w3layouts.com/"> Salaj</a></p> </div> <div class="clearfix"> </div> </div> </div>