45 lines
2.0 KiB
PHP
Executable File
45 lines
2.0 KiB
PHP
Executable File
<?php
|
|
|
|
// require_once('fixed/config/go_con.php');
|
|
|
|
// $cash_pay = 2220;
|
|
// $payments = 2220;
|
|
// $admin_branch_id = 4;
|
|
// $tretment_id = 0;
|
|
|
|
// $number_style = date('y', strtotime($date_time)) . 'A';
|
|
// $get_bonds_sql = mysqli_query($db, "SELECT
|
|
// `number`,
|
|
// `number_style`
|
|
// FROM `bonds`
|
|
// WHERE `number_style` LIKE '$number_style%'
|
|
// AND `number` IN (SELECT MAX(`number`) FROM `bonds` WHERE `number_style` LIKE '$number_style%')"
|
|
// );
|
|
// $number = '';
|
|
// if (mysqli_num_rows($get_bonds_sql) > 0) {
|
|
// $row_bonds = mysqli_fetch_assoc($get_bonds_sql);
|
|
// $number = $row_bonds['number'] + 1;
|
|
// $number_style = date('y', strtotime($date_time)) . 'A' . str_pad($number, 7, '0', STR_PAD_LEFT);
|
|
// } else {
|
|
// $number_style = date('y', strtotime($date_time)) . 'A' . "0000001";
|
|
// $number = 1;
|
|
// }
|
|
// if(mysqli_query(
|
|
// $db,
|
|
// "INSERT INTO `bonds`(`number`, `number_style`, `price`, `notes`, `tretment_id`, `invoices_page_id`, `bonds_type_id`, `bonds_type_type_id`, `date_time`, `user_id`, `activation_id`)
|
|
// VALUES ('$number','$number_style','$payments','','$tretment_id','3','2','2','$date_time','$admin_id','2')"
|
|
// )) {
|
|
// $last_id = mysqli_insert_id($db);
|
|
// if(mysqli_query($db,
|
|
// "INSERT INTO `bonds_details`(`pay`, `notes`, `bonds_id`, `bonds_status_id`, `branch_id`, `date_time`, `user_id`, `activation_id`)
|
|
// VALUES ('$payments','','$last_id','1','$admin_branch_id','$date_time','$admin_id','2')"
|
|
// )) {
|
|
// $last_id_2 = mysqli_insert_id($db);
|
|
// if (!empty($cash_pay)) {
|
|
// mysqli_query($db,
|
|
// "INSERT INTO `bonds_details_has_how_pay`(`bonds_details_id`, `how_pay_id`, `pay`, `notes`, `date_time`, `user_id`, `activation_id`)
|
|
// VALUES ('$last_id_2','1','$cash_pay','$cash_note','$date_time','$admin_id','2')"
|
|
// );
|
|
// }
|
|
// }
|
|
// }
|