0byt3m1n1
Path:
C:
/
wamp64
/
www
/
cpms_new
/
ADMIN
/
[
Home
]
File: createuser.php
<?php $MAIN_HEADING = "Create User"; ?> <?php include("include/adminheader.php"); // ----------------------- $servername = "localhost"; $username = "root"; $password = ""; $dbname = "cpms"; $con = mysqli_connect($servername, $username, $password, $dbname); $sql = "select * from tab_user_types where is_static = 1"; $result = mysqli_query($con, $sql); $user_groups = array(); while ($row = mysqli_fetch_object($result)) { $user_groups[$row->id] = $row->name; } $sql = "select * from tab_master_fund_type"; $result = mysqli_query($con, $sql); $fund_types = array(); while ($row = mysqli_fetch_object($result)) { $fund_types[$row->id] = $row->name; } // --------------- $sql = "select name,user_id from user where is_admin = 0 order by name"; $result = mysqli_query($con, $sql); $pi_details = array(); while ($row = mysqli_fetch_object($result)) { $pi_details[$row->user_id] = $row->name; } $sql = "select * from tab_division_master where status = 1"; $result = mysqli_query($con, $sql); $division_master = array(); while ($row = mysqli_fetch_object($result)) { $division_master[$row->id] = $row->name; } ?> <p><span class="msgText"> <?php if(isset($_GET['message'])) { ?> <blink> <?php echo $_GET['message']; ?></blink> <?php } ?> <p class="msgText"> </p> <form action="createuser_ctrl.php" method="post" enctype="multipart/form-data" name="form1" id="form1"> <p> </p> <div class="col-md-12 col-sm-12 col-xs-12"> <table width="60%" class="class="table"" align="center"> <tr><td><br/></td></tr> <tr> <th height="24" class="projectboldtxt" scope="row"><div align="left">Salutation</div></th> <td><select name="salutation" class="form-control"> <option value="mr">Mr</option> <option value="ms">Ms</option> <option value="dr">Dr</option> </select></td> </tr> <tr><td><br/></td></tr> <tr> <th height="24" class="projectboldtxt" scope="row"><div align="left">Name</div></th> <td><input class="form-control" type="text" name="txtname" id="txtname" value="<?php if(isset($name) && $name!="") { echo $name; }?>"/><span class="valText"> <?php if(isset($error['name_null'])) { echo $error['name_null']; } ?></span></td> </tr> <tr><td><br/></td></tr> <tr> <th height="39" class="projectboldtxt" scope="row"><div align="left">User name</div></th> <td > <input class="form-control" type="text" name="txtusername" id="txtusername" value="<?php if(isset($username ) && $username!="") { echo $username; }?>"/><span class="valText"><?php if(isset($error['username_null'])) { echo $error['username_null']; } if(isset($error['username_exist'])) { echo $error['username_exist']; }?></span></td> </tr> <tr><td><br/></td></tr> <tr> <th height="" class="projectboldtxt" scope="row"><div align="left">Password</div></th> <td> <input class="form-control" type="password" name="txtpassword" id="txtpassword"value ="<?php if(isset($password) && $password!="") { echo $password; }?>"/> <span class="valText"> <?php if(isset($error['password_null'])) { echo $error['password_null']; } ?> </span></td> </tr> <!-- <tr> <th height="24" class="projectboldtxt" scope="row"><div align="left">Email</div></th> <td><input class="form-control" type="text" name="txtemail" id="txtemail" value="<?php if(isset($email) && $email!="") { echo $email; }?>"/><span class="valText"> <?php if(isset($error['email_null'])) { echo $error['email_null']; } ?></span></td> </tr> --> <tr><td><br/></td></tr> <tr> <th height="24" class="projectboldtxt" scope="row"><div align="left">Designation</div></th> <td><input class="form-control" type="text" name="txtdesignation" id="txtdesignation" value="<?php if(isset($designation) && $designation!="") { echo $designation; }?>"/><span class="valText"> <?php if(isset($error['designation_null'])) { echo $error['designation_null']; } ?></span></td> </tr> <tr><td><br/></td></tr> <tr> <th height="24" class="projectboldtxt" scope="row"><div align="left">Division</div></th> <td><select name="division" class="form-control"> <?php if(!empty($division_master)) foreach ($division_master as $key => $value) { ?> <option value="<?php echo $key ?>"><?php echo $value ?></option> <?php } ?> </select></td> </tr> <?php if(ADD_CUSTOM_USER){ // this is code is not complete //added just a design view only //even not write a jquery ?> <tr><td><br/></td></tr> <tr> <th height="24" class="projectboldtxt" scope="row"><div align="left">User Group</div></th> <td ><div class="clearfix"> <select name="user_group" id="user_group" class="form-control"> <?php if(!empty($user_groups)) foreach ($user_groups as $j => $value) {?> <option value="<?php echo $j; ?>"><?php echo $value; ?></option> <?php } ?> </select> </div></td> </tr> <tr><td><br/></td></tr> <tr id="row_fund"> <style type="text/css"> td span { line-height: inherit; } </style> <th height="24" class="projectboldtxt" scope="row"><div align="left">Fund Types</div></th> <td class=""><div class=""> <select name="fund_types" id="fund_types" class="select2_multiple form-control" multiple="multiple"> <?php if(!empty($fund_types)) foreach ($fund_types as $j => $value) { ?> <option value="<?php echo $j; ?>"><?php echo $value; ?></option> <?php } ?> </select> </div></td> </tr> <?php }?> <tr><td><br/></td></tr> <tr> <th height="24" class="projectboldtxt" scope="row"><div align="left">Photo</div></th> <td><input class="form-control" type="file" name="photo" id="photo"> </tr> <tr><td><br/></td></tr> <tr> <th height="24" scope="row"><div align="left"></div></th> <td><label> <input class="btn btn-success" type="submit" name="save" id="save" value="Submit" /> <!-- <a class="btn btn-info" href="search_user.php" class="projectboldtxt"> Search & Edit</a></label> --> <label></label></td> </tr> <tr></tr> </table> </div> </form> <?php include "include/footer.php"; ?> <!-- Select2 --> <script> $(document).ready(function() { $(".select2_single").select2({ placeholder: "Select a state", allowClear: true }); $(".select2_group").select2({}); $(".select2_multiple").select2({ maximumSelectionLength: 4, placeholder: "With Max Selection limit 4", allowClear: true }); }); </script> <!-- /Select2 -->