52 lines
1.7 KiB
PHP
Executable File
52 lines
1.7 KiB
PHP
Executable File
<?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");
|
|
|
|
$not_in = '';
|
|
|
|
$check = mysqli_query($db,
|
|
"SELECT `name`, `username`, `pass`, `number` FROM `old_reception` WHERE `emp_id` IS NULL"
|
|
);
|
|
|
|
while($old_data_temp_id = mysqli_fetch_assoc($check)) {
|
|
$name = $old_data_temp_id['name'];
|
|
$username = $old_data_temp_id['username'];
|
|
$password = $old_data_temp_id['pass'];
|
|
$mo_number = $old_data_temp_id['number'];
|
|
if (mysqli_query(
|
|
$db,
|
|
"INSERT INTO `emplyee`(`name`, `branch_id`, `occupation_id`, `G_sex_id`, `emplyee_status_id`, `holi_days_id`, `user_id`, `activation_id`)
|
|
VALUES ('$name','2','1','1','1','1','1','2')"
|
|
)) {
|
|
$last_id = mysqli_insert_id($db);
|
|
if (mysqli_query(
|
|
$db,
|
|
"INSERT INTO `user`(`name`, `username`, `pass`, `number`, `emp_active_status_id`, `account_interaction_id`, `emplyee_id`, `user_id`, `activation_id`)
|
|
VALUES ('$name','$username','$password','$mo_number','2','1','$last_id','1','2')"
|
|
)) {
|
|
|
|
}
|
|
}
|
|
}
|
|
$not_in = rtrim($not_in, ",");
|
|
echo $not_in;
|
|
}
|
|
?>
|