query("SELECT * FROM `company` "); // while($rows = $BranchDetailall->fetch(PDO::FETCH_ASSOC)) { // $CompaynName = $rows['Coname']; // // $_SESSION["CoID"] = $rows['CoID']; // $CompanyLogo = $rows['CoLogo']; // UserID CompanyID UserPhone UserName UserPassword OldPassword UserFinishdate UserStartDate UserType UserDeparment CompID Company CustOwnername custTel custAddress Email custDate Servicetype status Contact DataBaseName 1 // $CompaynName = ''; $CompanyLogo = ''; $message=""; if(count($_POST)>0) { $status=""; $results = $con->query("SELECT * FROM `user` inner join company on company.CompID=user.CompanyID inner join dabasesystem on dabasesystem.DataID = company.DataID where UserPhone='" . $_POST["name"] . "' and UserPassword = '". $_POST["password"]."' and FinishDate is null "); if ($results ->rowCount() > 0) { while($row = $results->fetch(PDO::FETCH_ASSOC)) { $status= $row['status']; if($status=='Active'){ $StaffID=$row['UserID']; // $UsertypeID=$row['SoftDeparmentUser']; $CompanyID=$row['CompanyID']; $CompanType=$row['CompanType']; $Userverify=$row['Userverify']; $CostEmail=$row['UserEmail']; $WhatsappPhone=$row['WhatsappPhone']; // $results2 = $con->query("SELECT * FROM `userdeparment` where CompanyID=$CompanyID "); // while($rows = $results2->fetch(PDO::FETCH_ASSOC)) { $verification_code = substr(number_format(time() * rand(), 0, '', ''), 0, 4); $results2 = $con->query("INSERT INTO `verify` (`CompanyID`, `verUserid`, `verCode`) VALUES ('$CompanyID', '$StaffID', '$verification_code')"); // } /** * Requires the "PHP Email Form" library * The "PHP Email Form" library is available only in the pro version of the template * The library should be uploaded to: vendor/php-email-form/php-email-form.php * For more info and help: https://bootstrapmade.com/php-email-form/ */ // require_once('../Connection.php'); // $con = getConnected(); // $con = new PDO('mysql:host=localhost; dbname=SoftcareDb;charset=utf8','macruufm_mroot','Bashiir@9186'); // $PayID=$_POST["PayID"]; // OrderItem:OrderItem,CostName:CostName,CostPhone:CostPhone,CostEmail:CostEmail $CostName = 'Khayre Super Market'; $CostPhone ='0618272007'; $OrderItem = 45; $Reason='Asc Mudane '.$CostName.' Fariinta Waan Helnay Waxaan Kugu Soo jawaabi donaa sida ugu dhaqsiyaha badan Mahadsanid W.x Nagala soo xariir Mobile 618272007 '; // $CreditLimit = $_POST["CreditLimit"]; // FullName:FullName,Phone1:Phone1,Phone2:Phone2,Address:Address,Email:Email, // ContactUs:ContactUs // $result = $con->query("INSERT INTO costomerorder(CostName,CostPhone,CostEmail,CostReason) // VALUES('$CostName','$CostPhone','$CostEmail','$Reason')"); // Replace contact@example.com with your real receiving email address $bodyver='Verification Code:'.$verification_code; $phonewhats=$WhatsappPhone; require_once('home/SendWhatsapp.php'); // Uncomment below code if you want to use SMTP to send emails. You need to enter your correct SMTP credentials /* $contact->smtp = array( 'host' => 'example.com', 'username' => 'example', 'password' => 'pass', 'port' => '587' ); */ $ip = $_SERVER['HTTP_CLIENT_IP'] ? $_SERVER['HTTP_CLIENT_IP'] : ($_SERVER['HTTP_X_FORWARDED_FOR'] ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']); $_SESSION["SoftConame"] = $row['Company']; $_SESSION["SoftCoID"] = $row['CompanyID']; $_SESSION["SoftCoLogo"] = $row['CoLogo']; $_SESSION["SoftCoWebsite"] = $row['CoWebsite']; $_SESSION["SoftEmail"] = $row['Email']; $_SESSION["SoftcustTel"] = $row['custTel']; $_SESSION["SoftcustAddress"] = $row['custAddress']; $syssection= $row['SystemSections']; $DataBaseName=$row['DataName']; $_SESSION["SoftDatabs"] = $DataBaseName; $_SESSION["SoftCompanyID"] = $row['CompanyID']; $_SESSION["SoftuserFulname"] = $row['Name']; $_SESSION["SoftType"] = $row['UserType']; $_SESSION["SoftStafID"] = $StaffID; $_SESSION["Softusername"] = $row['UserName']; $_SESSION["Softstaftel"] = $row['UserPhone']; $_SESSION["SoftSysSection"] = $row['SystemSections']; $_SESSION["SoftUserRolle"] = $row['UserDeparment']; $_SESSION["SoftCoUserLimit"] = $row['CoUserLimit']; $_SESSION["ChangeUserID"] =$StaffID; $_SESSION["SoftUserIcon"] = $row['UserIcon']; }else{ $message = "User Block --Plaese Contact Administrator "; RemoveSesction(); } } } else { $message = "Invalid Username or Password!"; RemoveSesction(); } } if(isset($StaffID) ) { if($Userverify=='Pedding') { // header("Location:home/Bling.php"); RemoveSesction(); header("Location:UserNewPass.php"); $_SESSION["ChangeUserID"] =$StaffID; }else{ if($CompanType=='Biling') { // header("Location:home/Bling.php"); $message = "Fadlan Laxariir Qaybta Bilinkg!"; RemoveSesction(); }else{ $results2 = $con->query("INSERT INTO `loginsession` (`UserID`, `Iplocation`, `MacAddress`) VALUES ('$StaffID', '$ip', '$ip')"); header("Location:home/Home.php"); } } } function RemoveSesction() { unset($_SESSION["SoftDatabs"]); unset($_SESSION["Softusername"]); unset($_SESSION["SoftCompanyID"]); unset($_SESSION["SoftType"]); unset($_SESSION["SoftStafID"]); unset($_SESSION["Softusername"]); unset($_SESSION["Softstaftel"]); unset($_SESSION["SoftUserRolle"]); } ?> Login - Pos admin template