D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
shubmkcj
/
urbane.createerp.com
/
ajax
/
Filename :
check-profaramId-details.php
back
Copy
<?php ini_set('display_errors',0); error_reporting(0); ob_start(); session_start(); include_once("../config.php"); date_default_timezone_set( "Asia/Calcutta" ); $regDate = date( 'd-M-Y H:i' ); if (isset($_SESSION["login_email"]) && $_SESSION["login_email"] != "") { $loginedUserId = $_SESSION["login_email"]; } if (isset($_POST['profaramId']) && $_POST['profaramId'] != "") { $profaramId = filter_var( $_POST['profaramId'], FILTER_SANITIZE_STRING ); } if (isset($_POST['txtcomment']) && $_POST['txtcomment'] != "") { $prcomment = filter_var( $_POST['txtcomment'], FILTER_SANITIZE_STRING ); } if (isset($_POST['pr_Id']) && $_POST['pr_Id'] != "") { $profaramId = filter_var( $_POST['pr_Id'], FILTER_SANITIZE_STRING ); } $p_chat_row=''; $p_item_row=''; $companyd = mysqli_query($conn,"SELECT * FROM `company_details`"); $companyrow = mysqli_fetch_assoc($companyd); $contact_person = $companyrow['contact_person']; $company_name = $companyrow['company_name']; $company_logo = $companyrow['company_logo']; $GSTIN = $companyrow['GSTIN']; $phone = $companyrow['phone']; $eb_email = $companyrow['email']; $address = $companyrow['address']; $city = $companyrow['city']; $state = $companyrow['state']; $country = $companyrow['country']; $account_name = $companyrow['account_name']; $account_no = $companyrow['account_no']; $bank_name = $companyrow['bank_name']; $ifsc = $companyrow['ifsc']; $shift = $companyrow['shift']; $branch = $companyrow['branch']; $company_color = $companyrow['company_color']; $currency = $companyrow['currency']; $invoice_prifix = $companyrow['invoice_prifix']; $default_invoice = $companyrow['default_invoice']; $signature = $companyrow['signature']; $invoice_note = $companyrow['invoice_note']; //$instock_tem=0; $output=''; if (!empty( $profaramId)){ //check in stock po item $sql1 = "SELECT * FROM `proforma` WHERE `proforma`.`id` = '$profaramId';"; //echo $sql1; // die; $query1 = mysqli_query( $conn, $sql1 ); $count1 = mysqli_num_rows( $query1 ); $row = mysqli_fetch_assoc( $query1 ); $bill_pay_name = $row['bill_pay_name']; $proforma_id = $row['proforma_id']; $date = $row['date']; $terms = $row['terms']; $due_date = $row['due_date']; $billingAddress = $row['billingAddress']; $deliver_address = $row['deliver_address']; $client_name = $row['client_name']; $pincode = $row['pincode']; $mobile_no = $row['mobile_no']; $email = $row['email']; $gstin = $row['gstin']; $type = $row['type']; $buyer_reference = $row['buyer_reference']; $delivery_type = $row['delivery_type']; $delivery_terms = $row['delivery_terms']; $mode_of_shipment = $row['mode_of_shipment']; $shipping_date = $row['shipping_date']; $port_of_loading = $row['port_of_loading']; $port_of_delivery = $row['port_of_delivery']; $payment_method = $row['payment_method']; $hs_code = $row['hs_code']; $terms_of_payment = $row['terms_of_payment']; $bank_details = $row['bank_details']; $other_charges = $row['other_charges']; $other_charge_msg = $row['other_charge_msg']; $other_price = $row['other_price']; $subtotal_price = $row['subtotal_price']; $bank_charge = $row['bank_charge']; $amount_paid = $row['amount_paid']; $comment = $row['comment']; //insert comment $querycomment = "INSERT INTO `chat_proforma`(`proformaId`, `userId`, `comment`,`date`, `status`) VALUES ('$proforma_id', '$loginedUserId', '$prcomment','$regDate', 'active')"; if ( mysqli_query( $conn, $querycomment ) ) { //mail $fromSendMail='admin@urbane.createerp.com'; //$to = trim($loginedUserId); //$to='designpitara1@gmail.com'; $to='ravindra@designpitara.com'; $subject = "Comment on the behalf of Proforma id " . $proforma_id . " by " . $loginedUserId; $message = "<p style='text-align:left;margin-left:25px;'>$prcomment</p>"; $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n"; // More headers //$headers .= "From: $fromSendMail" . "\r\n"; // $headers .= "Reply-To: <$to>" . "\r\n"; // $headers .= 'Cc: webiteams6@gmail.com' . "\r\n"; $headers .= "From: $fromSendMail" . "\r\n" . //"Reply-To: $fromSendMail" . "\r\n" . "X-Mailer: PHP/" . phpversion(); $mail = mail( $to, $subject, $message, $headers ); } $contactsql = mysqli_query($conn,"SELECT * FROM `contact` where id='$bill_pay_name' and data_delete ='no'"); $contactrow = mysqli_fetch_assoc($contactsql); $customer_type = $contactrow['customer_type']; $bill_display_name = $contactrow['bill_display_name']; $contact_person_name = $contactrow['contact_person_name']; $contact_person_designation = $contactrow['contact_person_designation']; // billing address $getad_b = mysqli_query($conn,"SELECT * FROM `contact_address` where id='$billingAddress'"); $getadrow_b = mysqli_fetch_assoc($getad_b); $address_get_b = $getadrow_b['address'] .', '. $getadrow_b['city'] .', '. $getadrow_b['state'] .', '. $getadrow_b['country']; // delivery address $getad = mysqli_query($conn,"SELECT * FROM `contact_address` where id='$deliver_address'"); $getadrow = mysqli_fetch_assoc($getad); $address_get = $getadrow['address'] .', '. $getadrow['city'] .', '. $getadrow['state'] .', '. $getadrow['country']; $iecno = $getadrow['iecno']; //chat row $getchatsql = mysqli_query($conn,"SELECT * FROM `chat_proforma` WHERE `chat_proforma`.`proformaId`='$proforma_id' ORDER BY `id` DESC"); while($chat_row = mysqli_fetch_assoc($getchatsql)){ $c_userId = $chat_row['userId']; $c_comment = $chat_row['comment']; $c_date = $chat_row['date']; if($c_comment!=''){ $p_chat_row.=' <tr> <td> <div class="chatInner"> <p class="chatUser"><em>'.$c_userId.'</em> / '.$c_date.' </p> <span class="charDetails">'.$c_comment.'</span> </div> </td> </tr> '; } } //for proferm item $getitemsql = mysqli_query($conn,"SELECT * FROM proforma_item a left join inventory b on a.item_id = b.id where a.proforma_id = '$proforma_id'"); while($item_row = mysqli_fetch_assoc($getitemsql)){ $item_image = $item_row['item_image']; if(!empty($item_image)){ $if_image = '<img src="inventory/'.$item_image.'" width="50">'; }else{ $if_image = ''; } $p_item_row.=' <tr style="width:100%"> <td style="width:10%">'. $item_row['item_code'] .'</td> <td style="width:5%">'. $if_image .'</td> <td style="width:5%">'. $item_row['name'] .'</td> <td style="width:10%">'. $item_row['size'] .'</td> <td style="width:5%">'. $item_row['color'] .'</td> <td style="width:5%">'. $item_row['qty'] .'</td> <td style="width:5%">'. $item_row['unit_of_measure'] .'</td> <td style="width:10%">'. $item_row['price'] .'</td> <td style="width:10%">'. $item_row['row_total'] .'</td> </tr> <?php '; } if ( $count1 == 1 ) { $output=' <div class="row"> <div class="col-md-8"> <div class="card-box" ><div class="row"> <div class="col-md-8"> <p><b>SHIPPER :</b></p> <h5 class="mb-0"><b>'.$company_name .'</b></h5> <p class="mb-0">'. $address.','.$city.','.$state.','.$country.'</p> <p class="mb-0">Contact Person : '. $contact_person .'</p> <p class="mb-0">Contact Number : '. $phone .'</p> <p class="mb-0">Email : '. $eb_email .'</p> </div> <div class="col-md-4 text-right"> <h5 class="mb-0"><b>Proforma No. : '. $proforma_id .'</b></h5> <p class="mb-0">Proforma Date : '. $date .'</p> <p class="mb-0">Buyers Order : '. $buyer_reference . '</p> <p><b>Comment:</b> '. $comment .'</p> </div> </div> <hr> <div class="row"> <div class="col-md-8"> <p><b>CONSIGNEE :</b></p> <p class="mb-0"> <b>'. $bill_display_name .'</b> </p> <p class="mb-0"> '. $address_get_b .'</p> <p class="mb-0">Zip Code : '. $pincode .'</p> <p class="mb-0">GSTIN : '. $gstin .'</p> <p class="mb-0">IEC No.: '. $iecno .'</p> <p class="mb-0">Contact Person: '. $client_name .'</p> <p class="mb-0">Contact No.: '. $mobile_no .'</p> </div> <div class="col-md-4 text-right"> <p class="mb-0">Delivery Terms : '. $delivery_terms .'</p> <p class="mb-0">Delivery Type : '. $delivery_type .'</p> <p class="mb-0">Payment Method : '. $payment_method .'</p> <p class="mb-0">Payment Terms : '. $terms_of_payment .'</p> <p class="mb-0">Port Of loading : '. $port_of_loading .'</p> <p class="mb-0">Port Of Delivery : '. $port_of_delivery .'</p> <p class="mb-0">Country Of Origin Of goods : China</p> <p class="mb-0">Country Of Final Destination : India</p> </div> </div> <hr> <div class="row"> <div class="col-md-6"> <p><b>SHIP TO :</b></p> <p>'. $address_get .'</p> </div> <div class="col-md-6 text-right"> <h5 class="mb-0"><b>Beneficary Name : '. $account_name .'</b></h5> <p class="mb-0">Bank A/C No. : '. $account_no .'</p> <p class="mb-0">Bank Name : '. $bank_name .'</p> <p class="mb-0">Swift Name : '. $shift .'</p> <p class="mb-0">Address : '. $address .'</p> </div> </div> <div class="row" > <table class="table table-responsive" style=" margin-top: 15px;"> <thead> <tr style="width:100%"> <th>Item Code</th> <th>Image</th> <th>Item Name</th> <th>Size</th> <th>Color</th> <th>Qty.</th> <th>Unit</th> <th>Price ('. $currency.')</th> <th>Total ('. $currency.')</th> </tr> </thead> <tbody id="itemsadd"> '. $p_item_row .' <tr style="width:100%"> <td colspan="8" style="width:90%;text-align:right;">Bank Charges </td> <td style="width:10%;"><b>'. $bank_charge .'</b></td> </tr> <tr style="width:100%"> <td colspan="8" style="width:90%;text-align:right;border-top: 0px solid #dee2e6">Total Amount </td> <td style="width:10%;border-top: 0px solid #dee2e6"><b>'. $amount_paid .'</b></td> </tr> </tbody> </table> </div> </div> </div> <div class="col-md-4"> <div class="card-box"> <h5 style="text-align:center;margin-top: 0;"><b>Show Comments of '.$proforma_id.'</b></h5> <div id="mydivComment" ></div> <table class="chatTable"> '.$p_chat_row.' </table> <hr> <form id="chatFormAction" action="POST"> <div class="form-group"> <label for="comment">Comment:</label> <textarea class="form-control" rows="2" name="txtcomment" id="txtcomment" required></textarea> <input type="hidden" name="pr_Id" id="pr_Id" value="'.$profaramId.'"> <button type="button" id="AccountBtn" name="AccountBtn" class="form-control btn btn-primary" style="margin-top:10px">Comment</button> </div> </form> </div> </div> </div>'; } else { $output="Atul"; } } echo $output; ?>