D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
shubmkcj
/
urbane.createerp.com
/
Filename :
update_company_profile.php
back
Copy
<?php ob_start(); session_start(); $id = $_GET['id']; include 'config.php'; $company_name = addslashes(stripslashes($_POST['company_name'])); $file_name = ""; $sign_name = ""; if(isset($_FILES["image"]) && $_FILES['image']['size'] != 0){ $file_name = $_FILES['image']['name']; $temp = explode(".", $_FILES["image"]["name"]); $extension = end($temp); $result1 = preg_replace("/[^a-zA-Z0-9]+/", "", $company_name); $file_name = $result1."_".date("Ymdhis").".".$extension; $file_tmp =$_FILES['image']['tmp_name']; move_uploaded_file($file_tmp,"images/".$file_name); } if(isset($_FILES["signature"]) && $_FILES['signature']['size'] != 0){ $sign_name = $_FILES['signature']['name']; $temp = explode(".", $_FILES["signature"]["name"]); $extension = end($temp); $result1 = preg_replace("/[^a-zA-Z0-9]+/", "", $company_name); $sign_name = $result1."_".date("Ymdhis").".".$extension; $sign_tmp =$_FILES['signature']['tmp_name']; move_uploaded_file($sign_tmp,"signature/".$sign_name); } $gstin = addslashes(stripslashes($_POST['gstin'])); $phone = addslashes(stripslashes($_POST['phone'])); $reference = addslashes(stripslashes($_POST['reference'])); $address = $conn -> real_escape_string($_POST['address']); $city = addslashes(stripslashes($_POST['city'])); $state = addslashes(stripslashes($_POST['state'])); $country = addslashes(stripslashes($_POST['country'])); $account_name = addslashes(stripslashes($_POST['account_name'])); $account_no = addslashes(stripslashes($_POST['account_no'])); $bank_name = addslashes(stripslashes($_POST['bank_name'])); $ifsc = addslashes(stripslashes($_POST['ifsc'])); $shift = addslashes(stripslashes($_POST['shift'])); $branch = $conn -> real_escape_string($_POST['branch']); $company_color = addslashes(stripslashes($_POST['company_color'])); $currency = addslashes(stripslashes($_POST['currency'])); $invoice_prifix = addslashes(stripslashes($_POST['invoice_prifix'])); $invoice_note = $conn -> real_escape_string($_POST['invoice_note']); $contact_person = $_POST['contact_person']; $p_loading_g = $_POST['p_loading']; $p_loading = implode('--',$p_loading_g); $p_delivery_g = $_POST['p_delivery']; $p_delivery = implode('--',$p_delivery_g); $terms_g = $_POST['c_terms']; $terms = implode('--',$terms_g); $item_type_add = $_POST['itemtype']; $item_type = implode(',',$item_type_add); $payment_add = $_POST['payment']; $paymentmethod = implode(',',$payment_add); // Old Image Name $old_image = $_POST['old_image']; if($file_name == ''){ $a = $old_image; }else{ $a = $file_name ; } $old_signature = $_POST['old_signature']; $sign_name; if($sign_name == ''){ $signature = $old_signature; }else{ $signature = $sign_name ; } $sql = "UPDATE company_details SET contact_person = ?, company_name = ?, company_logo = ?, GSTIN = ?, phone = ?, email = ?, address = ?, city = ?, state = ?, country = ?, account_name = ?, account_no = ?, bank_name = ?, ifsc = ?, shift = ?, branch = ?, company_color = ?, currency = ?, invoice_prifix = ?, signature = ?, invoice_note = ? , item_type = ?, payment_method = ? , terms = ?, port_loading = ?, port_delivery = ? WHERE id = ?"; $stmt = $conn->prepare($sql); $stmt->bind_param("ssssssssssssssssssssssssssi", $contact_person, $company_name, $a, $gstin, $phone, $reference, $address, $city, $state, $country, $account_name, $account_no, $bank_name, $ifsc, $shift, $branch, $company_color, $currency, $invoice_prifix, $signature, $invoice_note, $item_type, $paymentmethod, $terms, $p_loading,$p_delivery, $id); $result = $stmt->execute(); if ($result){ echo '<script>localStorage.setItem("ProfileUpdated", "true");</script>'; echo '<script>location.replace("corporate-profile.php")</script>'; } else { echo "Error: <br>" . $conn->error; } ?>