patient.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 |
<?php require_once("common/config.php"); require_once("common/database.php"); require_once("common/functions.php"); require_once("common/messages.php"); require_once("common/initialize.php"); if (isset($_POST["email"]) && $_POST["email"] != "") { $email = trim($_POST['email']); $pwd = md5(trim($_POST['pwd'])); if (!$email == "" && !$pwd == "") { $query = "SELECT * FROM users WHERE email='$email' AND password='$pwd'"; $result = db::getRecord($query); if (!empty($result)) { $user = true; } else { $user = false; } //$pwd = md5($pwd); //$query = "select u.*, ut.refcode as userrole from users u left join usertypes as ut on ut.typeid=u.usertype where email='" . $email . "' and password='". $pwd ."'" ; //$user = db::getRecord($query); if ($user) { //saveLastActiveTime($user['id']); $_SESSION["loggedInUserRole"] = $result['role']; $_SESSION['firstname'] = $result['first_name']; $_SESSION['lastname'] = $result['last_name']; $_SESSION['email'] = $result['email']; $_SESSION["isAdminloggedin"] = true; $_SESSION['adminid'] = $result['id']; if ($result['role'] == 'Admin') { header('Location: ' . $site_root . 'admin/index.php'); } /* if (trim($user["usertype"])=="1"){ //Administrator $_SESSION["isAdminloggedin"]=true; $_SESSION['adminid'] = $user['id']; header('Location: '.$site_root.'admin/index.php'); } */ } else { $_SESSION['error'] = "incorrect_login"; $_SESSION["msgType"] = "danger"; } } else { $_SESSION['error'] = "incorrect_login"; $_SESSION["msgType"] = "danger"; } } $disease_list = db::getRecords("select id,title as name from diseas"); //print_r($disease_list); //exit; ?> <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta charset="utf-8"> <!-- Title and other stuffs --> <title>FSO ODA PATIENT <?php @showTitle($title); ?></title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link href="style/bootstrap.css" rel="stylesheet"> <link rel="stylesheet" href="style/font-awesome.css"> <link rel="stylesheet" href="style/jquery-ui-1.9.2.custom.min.css"> <link rel="stylesheet" href="style/fullcalendar.css"> <link rel="stylesheet" href="style/prettyPhoto.css"> <link rel="stylesheet" href="style/rateit.css"> <link rel="stylesheet" href="style/bootstrap-datetimepicker.min.css"> <link rel="stylesheet" href="style/jquery.cleditor.css"> <link rel="stylesheet" href="style/uniform.default.html"> <link rel="stylesheet" href="style/daterangepicker-bs3.css" /> <link rel="stylesheet" href="style/bootstrap-switch.css"> <link href="style/style.css" rel="stylesheet"> <link href="style/widgets.css" rel="stylesheet"> <link href="style/jquery.gritter.css" rel="stylesheet"> <link href="style/validationEngine.jquery.css" rel="stylesheet"> <link href="https://cdnjs.cloudflare.com/ajax/libs/chosen/1.8.7/chosen.css" rel="stylesheet"> <link href="https://cdnjs.cloudflare.com/ajax/libs/chosen/1.8.7/chosen.min.css" rel="stylesheet"> <!-- HTML5 Support for IE --> <!--[if lt IE 9]> <script src="js/html5shim.js"></script> <![endif]--> <!-- Favicon --> <link rel="shortcut icon" href="../img/favicon.png"> </head> <style> .container{max-width: 100%!important} </style> <body> <!-- Form area --> <div class="container"> <div class="row"> <div class="col-sm-12"> <!-- Widget starts --> <div class="widget"> <!-- Widget head --> <div class="widget-head"> <i class="icon-lock"></i> Sign up </div> <div class="widget-content"> <!-- Login form --> <?php if ($_GET["id"] != 1) { ?> <form class="validate form-horizontal" role="form" id="formLogin" action='actions.php' method="post" enctype="multipart/form-data"> <!-- Email --> <div class="form-group padd"> <label class="control-label col-sm-2" >First Name</label> <div class="col-sm-4"> <input type="text" name="first_name" class="validate[required] form-control" placeholder="first name" onChange="checkemail(this.value);"/> </div> <label class="control-label col-sm-2" for="inputEmail">Last Name</label> <div class="col-sm-4"> <input type="text" name="last_name" class="validate[required] form-control" placeholder="last Name" onChange="checkemail(this.value);"/> </div> </div> <div class="form-group padd"> <label class="control-label col-sm-2">Email</label> <div class="col-sm-4"> <input type="text" name="email" class="validate[required, custom[email]] form-control" placeholder="email" onChange="checkemail(this.value);"/> </div> <label class="control-label col-sm-2">Contact</label> <div class="col-sm-4"> <input type="text" name="contact" class="validate[required,custom[integer]] form-control" placeholder="contact" onChange="checkemail(this.value);"/> </div> </div> <div class="form-group padd"> <label class="control-label col-sm-2">Adress</label> <div class="col-sm-4"> <input type="text" name="adress" class="validate[required] form-control" placeholder="adress" onChange="checkemail(this.value);"/> </div> <label class="control-label col-sm-2">City</label> <div class="col-sm-4"> <input type="text" name="city" class="validate[required] form-control" placeholder="city" onChange="checkemail(this.value);"/> </div> </div> <div class="form-group padd"> <label class="control-label col-sm-2">Disease</label> <div class="col-sm-4"> <select name="diseas[]" id="diseas" class="form-control" multiple> <?php echo displayDropDown($disease_list, '') ?> </select> </div> <label class="control-label col-sm-2">Doctor</label> <div class="col-sm-4"> <select name="doctor" id="doctor" class="form-control" > </select> </div> </div> <div class="col-sm-9 col-sm-offset-3"> <button type="submit" class="btn btn-danger">Register</button> <!--<button type="reset" class="btn btn-default">Reset</button>--> </div> <br /> <input type="hidden" name="j" value="1"> </form> <?php } else { ?> <div class="well">YOU ARE SUCCESSFULLY REGISTERED</div> <?php } ?> </div> </div> </div> </div> </div> <?php require_once("common/scripts.php"); ?> <script src="https://cdnjs.cloudflare.com/ajax/libs/chosen/1.8.7/chosen.jquery.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/chosen/1.8.7/chosen.jquery.min.js"></script> <script type="text/javascript"> function checkemail(emailval) { $.post('admin/checkemail.php', {'emailid': emailval}, function (data) { $('#logcheck').html(data); }); } $("#diseas").chosen(); $("body").on("change", "#diseas", function (e) { // alert($(this).val()); $.ajax({ type: "POST", url: '../common/service.php?j=4', data: {diseas: $(this).val()}, // serializes the form's elements. dataType: 'json', success: function (data) { $("#doctor").html(""); $('#doctor').append('<option value="0">Select Doctor</option>'); if (data.doctors) { $.each(data.doctors, function (index, value) { $('#doctor').append('<option value="' + value['id'] + '">' + value['name'] + '</option>'); }); } else { $('#doctor').append('<option value="">No Doctor Found</option>'); } } }); }); </script> </body> </html> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 |
<?php require_once("common/config.php"); require_once("common/database.php"); require_once("common/functions.php"); require_once("common/messages.php"); require_once("common/initialize.php"); if (isset($_POST["email"]) && $_POST["email"] != "") { $email = trim($_POST['email']); $pwd = md5(trim($_POST['pwd'])); if (!$email == "" && !$pwd == "") { $query = "SELECT * FROM users WHERE email='$email' AND password='$pwd'"; $result = db::getRecord($query); if (!empty($result)) { $user = true; } else { $user = false; } //$pwd = md5($pwd); //$query = "select u.*, ut.refcode as userrole from users u left join usertypes as ut on ut.typeid=u.usertype where email='" . $email . "' and password='". $pwd ."'" ; //$user = db::getRecord($query); if ($user) { //saveLastActiveTime($user['id']); $_SESSION["loggedInUserRole"] = $result['role']; $_SESSION['firstname'] = $result['first_name']; $_SESSION['lastname'] = $result['last_name']; $_SESSION['email'] = $result['email']; $_SESSION["isAdminloggedin"] = true; $_SESSION['adminid'] = $result['id']; if ($result['role'] == 'Admin') { header('Location: ' . $site_root . 'admin/index.php'); } /* if (trim($user["usertype"])=="1"){ //Administrator $_SESSION["isAdminloggedin"]=true; $_SESSION['adminid'] = $user['id']; header('Location: '.$site_root.'admin/index.php'); } */ } else { $_SESSION['error'] = "incorrect_login"; $_SESSION["msgType"] = "danger"; } } else { $_SESSION['error'] = "incorrect_login"; $_SESSION["msgType"] = "danger"; } } $disease_list = db::getRecords("select id,title as name from diseas"); //print_r($disease_list); //exit; ?> <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta charset="utf-8"> <!-- Title and other stuffs --> <title>FSOODADOCTOR <?php @showTitle($title); ?></title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link href="style/bootstrap.css" rel="stylesheet"> <link rel="stylesheet" href="style/font-awesome.css"> <link rel="stylesheet" href="style/jquery-ui-1.9.2.custom.min.css"> <link rel="stylesheet" href="style/fullcalendar.css"> <link rel="stylesheet" href="style/prettyPhoto.css"> <link rel="stylesheet" href="style/rateit.css"> <link rel="stylesheet" href="style/bootstrap-datetimepicker.min.css"> <link rel="stylesheet" href="style/jquery.cleditor.css"> <link rel="stylesheet" href="style/uniform.default.html"> <link rel="stylesheet" href="style/daterangepicker-bs3.css" /> <link rel="stylesheet" href="style/bootstrap-switch.css"> <link href="style/style.css" rel="stylesheet"> <link href="style/widgets.css" rel="stylesheet"> <link href="style/jquery.gritter.css" rel="stylesheet"> <link href="style/validationEngine.jquery.css" rel="stylesheet"> <link href="https://cdnjs.cloudflare.com/ajax/libs/chosen/1.8.7/chosen.css" rel="stylesheet"> <link href="https://cdnjs.cloudflare.com/ajax/libs/chosen/1.8.7/chosen.min.css" rel="stylesheet"> <!-- HTML5 Support for IE --> <!--[if lt IE 9]> <script src="js/html5shim.js"></script> <![endif]--> <!-- Favicon --> <link rel="shortcut icon" href="../img/favicon.png"> </head> <style> .container{max-width: 100%!important} </style> <body> <!-- Form area --> <div class="container"> <div class="row"> <div class="col-sm-12"> <!-- Widget starts --> <div class="widget"> <!-- Widget head --> <div class="widget-head"> <i class="icon-lock"></i> Sign up </div> <div class="widget-content"> <!-- Login form --> <?php if ($_GET["id"] != 1) { ?> <form class="validate form-horizontal" role="form" id="formLogin" action='actions.php' method="post" enctype="multipart/form-data"> <!-- Email --> <div class="form-group padd"> <label class="control-label col-sm-2" >First Name</label> <div class="col-sm-4"> <input type="text" name="first_name" class="validate[required] form-control" placeholder="first name" onChange="checkemail(this.value);"/> </div> <label class="control-label col-sm-2" for="inputEmail">Last Name</label> <div class="col-sm-4"> <input type="text" name="last_name" class="validate[required] form-control" placeholder="last Name" onChange="checkemail(this.value);"/> </div> </div> <div class="form-group padd"> <label class="control-label col-sm-2">Email</label> <div class="col-sm-4"> <input type="text" name="email" class="validate[required, custom[email]] form-control" placeholder="email" onChange="checkemail(this.value);"/> </div> <label class="control-label col-sm-2">Contact</label> <div class="col-sm-4"> <input type="text" name="contact" class="validate[required,custom[integer]] form-control" placeholder="contact" onChange="checkemail(this.value);"/> </div> </div> <div class="form-group padd"> <label class="control-label col-sm-2">Adress</label> <div class="col-sm-4"> <input type="text" name="adress" class="validate[required] form-control" placeholder="adress" onChange="checkemail(this.value);"/> </div> <label class="control-label col-sm-2">City</label> <div class="col-sm-4"> <input type="text" name="city" class="validate[required] form-control" placeholder="city" onChange="checkemail(this.value);"/> </div> </div> <div class="form-group padd"> <label class="control-label col-sm-2">Disease</label> <div class="col-sm-4"> <select name="diseas[]" id="diseas" class="form-control" multiple> <?php echo displayDropDown($disease_list, '') ?> </select> </div> <label class="control-label col-sm-2">Registration Number</label> <div class="col-sm-4"> <input type="text" name="reg_no" class="validate[required] form-control" placeholder="Enter Reg No"/> </div> </div> <div class="col-sm-9 col-sm-offset-3"> <button type="submit" class="btn btn-danger">Register</button> <!--<button type="reset" class="btn btn-default">Reset</button>--> </div> <br /> <input type="hidden" name="j" value="4"> </form> <?php } else { ?> <div class="well">asdf</div> <?php } ?> </div> </div> </div> </div> </div> <?php require_once("common/scripts.php"); ?> <script src="https://cdnjs.cloudflare.com/ajax/libs/chosen/1.8.7/chosen.jquery.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/chosen/1.8.7/chosen.jquery.min.js"></script> <script type="text/javascript"> $("#diseas").chosen(); </script> </body> </html> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
<?php include ("common/config.php"); ?> <?php include ("common/initialize.php"); ?> <?php include ("common/database.php"); ?> <?php include ("common/imageprocessing.php"); ?> <?php include ("common/functions.php"); ?> <?php include ("common/mail.php"); ?> <?php secureIt("Admin"); if (!isset($_POST["j"]) && !isset($_GET['j'])) { $_SESSION['error'] = "901"; $_SESSION["msgType"] = "danger"; header("location: " . $site_root . "index.php?m=901"); } else { $task = trim($_REQUEST['j']); } switch ($task) { case 2: //Logout logout(); header('Location: ' . $site_root . 'index.php'); break; case 3: //send mail break; case 1: //Update Account $id = $_SESSION["adminid"]; $firstname = escape(trim($_POST['first_name'])); $obj['first_name'] = $firstname; $obj['last_name'] = escape(trim($_POST['last_name'])); $email = escape(trim($_POST['email'])); $obj['email'] = $email; $obj['contact_number'] = escape(trim($_POST['contact'])); $obj['adress'] = escape(trim($_POST['adress'])); $obj['role'] = "Patient"; $password = unique_id(); $obj['password'] = md5(trim($password)); $query = db::prepInsertQuery($obj, "users"); //(Associative array, table name, record id) // echo $query; // exit; $result = db::InsertRecord($query); $obj = null; foreach ($_POST['diseas'] as $disease) { $obj['user_id'] = $result; $obj['d_id'] = $disease; $obj['type'] = 0; $query = db::prepInsertQuery($obj, "user_disease"); //echo $query; db::InsertRecord($query); $obj = null; } // exit; $obj['p_id'] = $result; $obj['doc_id'] = $_POST['doctor']; $obj['created_by'] = 0; $obj['created'] = strtotime(date(date_format, time())); $query = db::prepInsertQuery($obj, "appointment"); // echo $query; // exit; $result = db::InsertRecord($query); $subject = "Welcome to Future Scope Of online Appointment"; $message = "Dear " . ucfirst($firstname) . ", Welcome to Future Scope Of online Appointment - The largest online appointment system of pakistan. <p>Your registration form for the doctor has been received.</P> <p>Our team shall contact you shortly.</P> <p>Please find your account credentials below:</P> <p><strong>User:</strong> " . $email . "<br> <strong>Password:</strong> " . $password . "</p>"; sendSMTP($message, $subject, 'umairmuhammad063@gmail.com', $toname = "", 'onlineappointment@axiomsoft.net', $fromname = "", $attachment = ""); adminRedirect("patient", $result, 1, 2); // (filename, true/false, record id, [update=1, insert=2, del=3]) break; case 4: //Update Account $id = $_SESSION["adminid"]; $firstname = escape(trim($_POST['first_name'])); $obj['first_name'] = $firstname; $obj['last_name'] = escape(trim($_POST['last_name'])); $email = escape(trim($_POST['email'])); $obj['email'] = $email; $obj['reg_no'] = $_POST['reg_no']; $obj['contact_number'] = escape(trim($_POST['contact'])); $obj['adress'] = escape(trim($_POST['adress'])); $obj['role'] = "Doctor"; $password = unique_id(); $obj['password'] = md5(trim($password)); $obj['created'] = strtotime(date(date_format, time())); $query = db::prepInsertQuery($obj, "users"); //(Associative array, table name, record id) // echo $query; // exit; $result = db::InsertRecord($query); $obj = null; foreach ($_POST['diseas'] as $disease) { $obj['user_id'] = $result; $obj['d_id'] = $disease; $obj['type'] = 1; $query = db::prepInsertQuery($obj, "user_disease"); //echo $query; db::InsertRecord($query); $obj = null; } // exit; $subject = "Welcome to Future Scope Of online Appointment"; $message = "Dear " . ucfirst($firstname) . ", Welcome to Future Scope Of online Appointment - The largest online appointment system of pakistan. <p>Your registration form for the doctor has been received.</P> <p>Our team shall contact you shortly.</P> <p>Please find your account credentials below:</P> <p><strong>User:</strong> " . $email . "<br> <strong>Password:</strong> " . $password . "</p>"; sendSMTP($message, $subject, 'umairmuhammad063@gmail.com', $toname = "", 'onlineappointment@axiomsoft.net', $fromname = "", $attachment = ""); adminRedirect("doctor", $result, 1, 2); // (filename, true/false, record id, [update=1, insert=2, del=3]) break; } ?> |