Johngm Posted April 13, 2020 Share Posted April 13, 2020 <?php $GLOBALS['title']="Admission-HMS"; $base_url="http://localhost/hms/"; require('./../../inc/sessionManager.php'); require('./../../inc/dbPlayer.php'); require('./../../inc/fileUploader.php'); require('./../../inc/handyCam.php'); $ses = new \sessionManager\sessionManager(); $ses->start(); if($ses->isExpired()) { header( 'Location:'.$base_url.'login.php'); } else { $name=$ses->Get("loginId"); } $msg=""; if ($_SERVER["REQUEST_METHOD"] == "POST") { if (isset($_POST["btnSave"])) { $db = new \dbPlayer\dbPlayer(); $msg = $db->open(); echo '<script type="text/javascript"> alert("'.$msg.'");</script>'; if ($msg = "true") { $userIds = $db->getAutoId("U"); $flup = new fileUploader\fileUploader(); $perPhoto = $flup->upload("/hms/files/photos/",$_FILES['perPhoto'], $userIds[1]); // var_dump($perPhoto); $handyCam=new \handyCam\handyCam(); if (strpos($perPhoto, 'Error:') === false) { $dateNow=date("Y-m-d"); $data = array( 'userId' => $userIds[1], 'userGroupId' => "UG004", 'name' => $_POST['name'], 'studentId' => $_POST['stdId'], 'cellNo' => $_POST['cellNo'], 'gender' => $_POST['gender'], 'dob' => $handyCam->parseAppDate($_POST['dob']), 'passportNo' => $_POST['passportNo'], 'fatherName' => $_POST['fatherName'], 'fatherCellNo' => $_POST['fatherCellNo'], 'perPhoto' => $perPhoto, 'admitDate' => $dateNow, 'isActive' => 'Y' ); $result = $db->insertData("studentinfo",$data); if($result>=0) { $data = array( 'userId' => $userIds[1], 'userGroupId' => "UG004", 'name' => $_POST['name'], 'loginId' => $_POST['stdId'], 'verifyCode' => "vhms2115", 'expireDate' => "2115-01-4", 'isVerifed' => 'Y' ); $result=$db->insertData("users",$data); if($result>0) { $id =intval($userIds[0])+1; $query="UPDATE auto_id set number=".$id." where prefix='U';"; $result=$db->update($query); // $db->close(); echo '<script type="text/javascript"> alert("Admitted Successfully.");</script>'; } else { echo '<script type="text/javascript"> alert("' . $result . '");</script>'; } } elseif(strpos($result,'Duplicate') !== false) { echo '<script type="text/javascript"> alert("Student Already Exits!");</script>'; } else { echo '<script type="text/javascript"> alert("' . $result . '");</script>'; } } else { echo '<script type="text/javascript"> alert("' . $perPhoto . '");</script>'; } } else { echo '<script type="text/javascript"> alert("' . $msg . '");</script>'; } } Quote Link to comment Share on other sites More sharing options...
Barand Posted April 13, 2020 Share Posted April 13, 2020 If you post something, readable there's a chance someone might read it. Quote Link to comment Share on other sites More sharing options...
ginerjm Posted April 13, 2020 Share Posted April 13, 2020 I really don't think you are working with that code in the format as you posted. Please don't expect us to read it then. Quote Link to comment Share on other sites More sharing options...
Johngm Posted April 13, 2020 Author Share Posted April 13, 2020 Quote Link to comment Share on other sites More sharing options...
ginerjm Posted April 13, 2020 Share Posted April 13, 2020 (edited) What is this? A picture? Can you not choose the area where you think the problem is and help us focus in on actual code that needs looking at - not peering at with a magnifier? Have you not posted on any forum before? Show Us The Code please. And not all of it! BTW - what debugging have you done? Any echos to show the query that you have built to do this? Echos to show where your logic is taking you? An echo to show the success or failure of the query? Anything? Edited April 13, 2020 by ginerjm Quote Link to comment Share on other sites More sharing options...
Johngm Posted April 13, 2020 Author Share Posted April 13, 2020 Hey hey mind your wording...am quite new in the platform,and its candid to direct politely . Please am seeking for solution and not more problems. Quote Link to comment Share on other sites More sharing options...
ginerjm Posted April 13, 2020 Share Posted April 13, 2020 MInd my wording? I am just frustrated at the lack of responsiveness from you. It has been pointed out twice to post your code (the part that matters if you have found it) yet you still haven't. How can it be made more clear? Please - try again. Please. Quote Link to comment Share on other sites More sharing options...
Johngm Posted April 13, 2020 Author Share Posted April 13, 2020 Yes i mean your language, You have a big problem with common decency. There is no just reason as to why you should be frustrated not even if i don't respond or its pointed a million times. Its simple, if you are enable or am too much as per your own standards, kindly ignore the question!! Quote Link to comment Share on other sites More sharing options...
macfanpl Posted April 13, 2020 Share Posted April 13, 2020 @ginerjm whats your problem here? What if @Johngm is so newbie that he has no clue where the problem is? Seems like you are creating problems where there is (or should be) none of them. Grow up man. Quote Link to comment Share on other sites More sharing options...
ginerjm Posted April 13, 2020 Share Posted April 13, 2020 I"ll leave the OP to your assistance. IF he ever show you some code Quote Link to comment Share on other sites More sharing options...
macfanpl Posted April 13, 2020 Share Posted April 13, 2020 3 minutes ago, ginerjm said: IF he ever show you some code The problem is that he had already done this. He showed code he uses and asserted that you are inteligent enough that by seeing title you will focus on correct code-fragment. Quote Link to comment Share on other sites More sharing options...
Barand Posted April 13, 2020 Share Posted April 13, 2020 Normally, when someone posts a large amount of code, I'll copy and paste it into my code editor and check for errors and, in this case, search for the SQL bits. Tell me how to do that with a picture of the code. It's further obfuscated as all the database activity seems to happen inside the $db object EG so there is no way we can even see the query that is being executed or what may be happening. Are there any error messages? Are you even checking for errors? Have you checked the error log? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.