61 lines
1.6 KiB
PHP
61 lines
1.6 KiB
PHP
<?php
|
|
$done = false;
|
|
if (!$done) {
|
|
|
|
ini_set('memory_limit', '10G');
|
|
|
|
$name_db = "aqdamypanel_aqdamy";
|
|
$host_db = "localhost";
|
|
$user_db = "aqdamypanel_mysql";
|
|
$pass_db = "AST4dxy6vEsi";
|
|
|
|
$db = new mysqli($host_db, $user_db, $pass_db, $name_db);
|
|
if ($db->connect_error) {
|
|
die("Connection failed: " . $db->connect_error);
|
|
}
|
|
|
|
|
|
// Change db to "test" db //// mysqli_select_db($db, "test");
|
|
$Arabic= 'SET CHARACTER SET utf8';
|
|
mysqli_query($db,$Arabic) or die ('Can\'t charset in DataBase');
|
|
$db->set_charset("utf8");
|
|
|
|
|
|
$itis_in = '';
|
|
|
|
|
|
$check = mysqli_query($db,
|
|
"SELECT `old_points`.`point`, `old_points`.`number`
|
|
FROM `old_points`
|
|
"
|
|
);
|
|
|
|
if (mysqli_num_rows($check) > 0) {
|
|
while ($check_row = mysqli_fetch_assoc($check)) {
|
|
|
|
$point = $check_row['point'];
|
|
$mobile22 = $check_row['number'];
|
|
$mobile = $check_row['number'];
|
|
|
|
|
|
$sel_mobile = mysqli_query($db,"SELECT `id` FROM `tretment` WHERE `number` = '$mobile' AND `commercial_register_id` = 2");
|
|
if (mysqli_num_rows($sel_mobile) == 1) {
|
|
$row_mobile = mysqli_fetch_assoc($sel_mobile);
|
|
$mobile = $row_mobile['id'];
|
|
} else {
|
|
echo 'mobile :'. $mobile22;
|
|
exit;
|
|
}
|
|
|
|
|
|
if(!mysqli_query($db,
|
|
"INSERT INTO `points` (`point`, `tretment_id`, `points_reason_id`, `user_id`, `activation_id`)
|
|
VALUES ('$point', '$mobile','1','1','2')
|
|
"
|
|
)){
|
|
exit;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
?>
|