如何分别在vs代码中编辑巨大文件中的特定代码部分?

时间:2019-06-10 07:11:54

标签: visual-studio-code

有没有什么办法可以并排编辑正在处理的编程文件的特定部分?周围没有垃圾吗?

我想在VS Code中使用它!

<div class="row">
<table class="table table-striped table-advance table-hover">
<tbody>
<tr>
<th>Title</th>
<th>Date</th>
<th>Short Note</th>
<th>Sales</th>
<th>Rental</th>
<th>Brand</th>
<th>More</th>

</tr> 
<?php
$bills = $mysqli->prepare("
SELECT  bill.bill_id,
bill.bill_no,
bill.created,
bill.last_updated,
bill.reference_code,
bill.item_count,
bill.total_amount ,
customer.name,
customer.address
FROM bill
INNER JOIN customer
ON bill.reference_code = customer.reference_code
ORDER BY bill.bill_id desc limit 1
");

if ($bills->execute()) {
$bills->bind_result(
$bill_id,
$bill_no,
$created,
$last_updated,
$reference_code,
$item_count,
$total_amount,
$customer_name,
$customer_address
);

while ($bills->fetch()) {
echo '
<div class=" bill_title_div ">
<h1 class="color_gray">Cash<span class="bold_text color_gray">Bill</span></h1>
<p class="color_gray">#XCBill No: #' . $bill_no . '</p>
</div>
<div class=" bill_details_div ">
<p><span>Date: </span>' . date_format(date_create($created), "l, d M Y") . '</p>
<p class="tt_upper"><span>To: </span>' . $customer_name . ', ' . $customer_address . '</p>
<p class=" reference "><span>Reference Code: </span>' . $reference_code . '</p>
</div>
';
}
$table = $mysqli->prepare("
SELECT  invoice.invoice_id,
invoice.bill_no,
invoice.item_no,
product.description,
product.price
FROM invoice
INNER JOIN product
ON invoice.product_id = product.product_id
");
if ($table->execute()) {
$table->bind_result(
$invoice_id,
$bill_no,
$item_no,
$description,
$price
);  
$total = 0;
while ($table->fetch()) {
$total += $price;
echo '
<tr class="table-row">
<th>' . $item_no . '</th>
<th>' . $description . '</th>
<th><span>&#8377</span>' . $price . '</th>
</tr>
';
}
if ($total == $total_amount) {
echo '
<tr class="total-row">
<td colspan="2">GRAND TOTAL</td>
<td><span>&#8377</span> ' . $total . '/-</td>
</tr>
';
}

?>


</table>
<?php
}

?>
</tbody>
</table>

如上面的代码所示,当我们处理一个php文件时,如果我们可以在一个虚拟文件中编辑它的php部分或mysql部分,并在实际文件中影响它,那将是有帮助的。

0 个答案:

没有答案