[insert_php]
$db_host = ‘localhost’; // Nama Server
$db_user = ‘mueduhosterz_admin’; // User Server
$db_pass = ‘mlTk9?y(ItPN’; // Password Server
$db_name = ‘mueduhosterz_lms’; // Nama Database
$conn = mysqli_connect($db_host, $db_user, $db_pass, $db_name);
$conn->set_charset("utf8”);
$current_user = wp_get_current_user();
$username = $current_user->user_login;
$query13 = mysqli_query($conn, "SELECT count(*) as total FROM `datesheet` WHERE `username` LIKE ‘$username'” );
$row13 = mysqli_fetch_array($query13);
if ($row13[0]==0)
{
$ipaddress = get_client_ip();
if(!empty($_POST[kkdate])) {
$sqlinsert = "INSERT INTO `datesheet` (`id`, `username`, `book`, `date`, `time`, `ip`) VALUES (NULL, ‘$username’, ‘kk’, ‘$_POST[kkdate]’, ‘$_POST[kktime]’, ‘$ipaddress’)”;
$query1 = mysqli_query($conn, $sqlinsert);
}
if(!empty($_POST[wrdate])) {
$sqlinsert = "INSERT INTO `datesheet` (`id`, `username`, `book`, `date`, `time`, `ip`) VALUES (NULL, ‘$username’, ‘wr’, ‘$_POST[wrdate]’, ‘$_POST[wrtime]’, ‘$ipaddress’)”;
$query1 = mysqli_query($conn, $sqlinsert);
}
if(!empty($_POST[hadate])) {
$sqlinsert = "INSERT INTO `datesheet` (`id`, `username`, `book`, `date`, `time`, `ip`) VALUES (NULL, ‘$username’, ‘ha’, ‘$_POST[hadate]’, ‘$_POST[hatime]’, ‘$ipaddress’)”;
$query1 = mysqli_query($conn, $sqlinsert);
}
if(!empty($_POST[mtdate])) {
$sqlinsert = "INSERT INTO `datesheet` (`id`, `username`, `book`, `date`, `time`, `ip`) VALUES (NULL, ‘$username’, ‘mt’, ‘$_POST[mtdate]’, ‘$_POST[mttime]’, ‘$ipaddress’)”;
$query1 = mysqli_query($conn, $sqlinsert);
}
[/insert_php]
}
else
{
$querykk = mysqli_query($conn, "SELECT * FROM `datesheet` WHERE `username` LIKE ‘$username’ AND `book` LIKE ‘kk’ ");
$rowkk = mysqli_fetch_array($querykk);
$querywr = mysqli_query($conn, "SELECT * FROM `datesheet` WHERE `username` LIKE ‘$username’ AND `book` LIKE ‘wr’ ");
$rowwr = mysqli_fetch_array($querywr);
$queryha = mysqli_query($conn, "SELECT * FROM `datesheet` WHERE `username` LIKE ‘$username’ AND `book` LIKE ‘ha’ ");
$rowha = mysqli_fetch_array($queryha);
$querymt = mysqli_query($conn, "SELECT * FROM `datesheet` WHERE `username` LIKE ‘$username’ AND `book` LIKE ‘mt’ ");
$rowmt = mysqli_fetch_array($querymt);
[/insert_php]
وقت | دن | کتاب |
[insert_php] echo $rowkk[time]; [/insert_php] | [insert_php] echo $rowkk[date]; [/insert_php] October | کلام خدا |
[insert_php] echo $rowwr[time]; [/insert_php] | [insert_php] echo $rowwr[date]; [/insert_php] October | وضوء رسول |
[insert_php] echo $rowha[time]; [/insert_php] | [insert_php] echo $rowha[date]; [/insert_php] October | ہمارے عقائد |
[insert_php] echo $rowmt[time]; [/insert_php] | [insert_php] echo $rowmt[date]; [/insert_php] October | معلم تجوید |
[insert_php] } [/insert_php]