Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php include 'header.php';
- if (isset($_GET['jid']) && isset($_GET['vid'])) {
- $jid = $_GET['jid'];
- $vid = $_GET['vid'];
- $sql_for_vloume = "SELECT DISTINCT vid, v_name,v_year FROM volume Where vid=".$vid;
- $sql_for_issues = "SELECT j_title,v_name,v_year,i_name,i_id
- FROM journal
- INNER JOIN volume
- ON volume.j_id=journal.jid
- INNER JOIN issue
- ON issue.v_id=volume.vid
- Where volume.j_id=".$jid;
- $disable=False;
- $readonly=True;
- $sql = "SELECT DISTINCT jid, j_title FROM journal Where jid=".$jid;
- }
- else if (isset($_GET['jid'])) {
- $jid = $_GET['jid'];
- $sql_for_vloume = "SELECT DISTINCT vid, v_name,v_year FROM volume Where j_id=".$jid;
- $sql_for_issues = "SELECT j_title,v_name,v_year,i_name,i_id
- FROM journal
- INNER JOIN volume
- ON volume.j_id=journal.jid
- INNER JOIN issue
- ON issue.v_id=volume.vid
- Where volume.j_id=".$jid;
- $sql = "SELECT DISTINCT jid, j_title FROM journal Where jid=".$jid;
- $disable=False;
- $readonly=True;
- }
- else{
- $sql = "SELECT DISTINCT jid, j_title FROM journal";
- $sql_for_issues = "SELECT j_title,v_name,v_year,i_name,i_id
- FROM journal
- INNER JOIN volume
- ON volume.j_id=journal.jid
- INNER JOIN issue
- ON issue.v_id=volume.vid";
- $disable=True;
- }
- ?>
- <div id="page-wrapper">
- <div class="row">
- <div class="col-lg-12">
- <h1 class="page-header">Add New Issue</h1>
- </div>
- <!-- /.col-lg-12 -->
- </div>
- <!-- /.row -->
- <div class="row">
- <div class="col-lg-12">
- <div class="panel panel-default">
- <div class="panel-heading">
- Add New Issue
- </div>
- <div class="panel-body">
- <div class="row">
- <div class="col-lg-12">
- <script>
- function myNewFunction(sel)
- {
- window.location.assign("?jid="+sel.value);
- // alert(sel.value);
- }
- </script>
- <form role="form" action="" method="POST" enctype="multipart/form-data">
- <div class="form-group">
- <label>Select Journal</label>
- <select class="form-control" name="author" onChange="myNewFunction(this);" required="required"
- <?php
- if ($readonly) {
- echo 'readonly="readonly">';
- }
- ?>
- >
- <?php
- if (!(isset($_GET['jid']))) {
- echo "<option>Select Journal</option>";
- }
- ?>
- <?php
- $result = $conn->query($sql);
- if ($result->num_rows > 0) {
- // output data of each row
- while($row = $result->fetch_assoc()) {
- ?>
- <option value="<?php echo $row["jid"];?>"><?php echo $row["j_title"];?></option>
- <?php
- }
- }
- ?>
- </select>
- </div>
- <div class="form-group">
- <label>Select Volume</label>
- <select class="form-control" required="required" name="voume_id" <?php
- if($disable){
- echo 'disabled="disabled">';
- echo "</select>";
- }
- else{
- ?>
- >
- <?php
- $result = $conn->query($sql_for_vloume);
- if ($result->num_rows > 0) {
- // output data of each row
- while($row = $result->fetch_assoc()) {
- ?>
- <option value="<?php echo $row["vid"];?>"><?php echo $row["v_name"];?> - <?php echo $row["v_year"];?></option>
- <?php
- }
- }
- } // end of else disable
- ?>
- </select>
- </div>
- <div class="form-group">
- <label>Issue Title</label>
- <input type="text" name="issue_title" class="form-control">
- </div>
- <div class="form-group">
- <div class="col-lg-4">
- <label>Publish</label>
- <input type="text" name="publsih" class="form-control">
- </div>
- <div class="col-lg-4">
- <label>Abstract</label>
- <textarea class="form-control" rows="5" id="comment" name="abstract"></textarea>
- </div>
- <div class="col-lg-4">
- <label>Total Citation</label>
- <input type="text" name="citation" class="form-control">
- </div>
- </div>
- <div class="form-group">
- <script type="text/javascript" src="http://js.nicedit.com/nicEdit-latest.js"></script>
- <script type="text/javascript">
- //<![CDATA[
- bkLib.onDomLoaded(function() {
- new nicEditor({fullPanel : true}).panelInstance('area');
- });
- //]]>
- </script>
- <label>Issue Details</label>
- <textarea class="form-control" name="detail" id="area" rows="13" cols="13"></textarea>
- </div>
- <div class="form-group">
- <label>Meta Tags For Journal</label>
- <input type="text" name="metatags" class="form-control">
- </div>
- <div class="form-group">
- <label>Meta Description For Journal</label>
- <textarea class="form-control" id="area" rows="5" cols="5" name="metadesc"></textarea>
- </div>
- <button type="submit" class="btn btn-default" name="uploades">Submit Button</button>
- <button type="reset" class="btn btn-default">Reset Button</button>
- <?php
- if (isset($_POST['uploades'])) {
- $issue_title = $_POST['issue_title'];
- $publsih =$_POST['publsih'];
- $abstract = $_POST['abstract'];
- $citation = $_POST['citation'];
- $detail = $_POST['detail'];
- $citation=$_POST['citation'];
- $metatags = $_POST['metatags'];
- $metadesc = $_POST['metadesc'];
- $voume_id=$_POST['voume_id'];
- $detail=str_replace("'","",$detail);
- if($issue_title==""){
- echo '<div class="form-group has-success"><div class="alert alert-danger alert-dismissable">
- <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
- Thats Not Right Check Again ! <a href="#" class="alert-link">Alert Link</a>.
- </div></div>';
- }
- else{
- $sql = "INSERT INTO issue (i_name, i_publish, i_abstract,i_cited,i_metatag,i_metadesc,v_id)
- VALUES ('$issue_title', '$publsih', '$abstract','$citation','$metatags','$metadesc','$voume_id')";
- if ($conn->query($sql) === TRUE) {
- $last_id = $conn->insert_id;
- echo '<div class="form-group has-success"><div class="alert alert-success alert-dismissable">
- <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
- Issue Added Successfully.
- </div></div>';
- } else {
- echo "Error: " . $sql . "<br>" . $conn->error;
- }
- // bakia kaam of upload
- }//bracket of file type jpg
- }
- ?>
- </form>
- </div>
- <!-- /.col-lg-6 (nested) -->
- </div>
- <!-- /.row (nested) -->
- </div>
- <!-- /.panel-body -->
- </div>
- <!-- /.panel -->
- </div>
- <!-- /.col-lg-12 -->
- </div>
- <!-- /.row -->
- <!-- /.row -->
- <div class="row">
- <div class="col-lg-12">
- <div class="panel panel-default">
- <div class="panel-heading">
- Issues Regaurding Volume
- </div>
- <!-- /.panel-heading -->
- <div class="panel-body">
- <table width="100%" class="table table-striped table-bordered table-hover" id="dataTables-example">
- <thead>
- <tr>
- <th>Issue #</th>
- <th>Journal</th>
- <th>Volume</th>
- <th>Volume Year</th>
- <th>Issue Name</th>
- <th>Option</th>
- </tr>
- </thead>
- <tbody>
- <?php
- //j_title,v_name,v_year,i_name,i_id
- $result = $conn->query($sql_for_issues);
- if ($result->num_rows > 0) { while($row = $result->fetch_assoc()) { ?>
- <tr class="odd gradeX">
- <td><?php echo $row["i_id"];?></td>
- <td><?php echo $row["j_title"];?></td>
- <td><?php echo $row["v_name"];?></td>
- <td><?php echo $row["v_year"];?></td>
- <td><?php echo $row["i_name"];?></td>
- <td class="center">
- <a href="?delete=<?php echo $row["i_id"];?>" data-placement="top" data-toggle="tooltip" title="Delete"><button class="btn btn-danger btn-xs" data-title="Delete" data-toggle="modal" data-target="#delete" title="Delete"><span class="fa fa-trash fa-2x"></span></button>
- </a>
- <a href="?iid=<?php echo $row["i_id"];?>" data-placement="top" data-toggle="tooltip" title="Delete"><button class="btn btn-info btn-xs" data-title="Edit" data-toggle="modal" data-target="#edit" title="Edit"><span class="fa fa-pencil fa-2x"></span></button>
- </a>
- </td>
- </tr>
- <?php }}
- $conn->close();?>
- </tbody>
- </table>
- <!-- /.table-responsive -->
- </div>
- <!-- /.panel-body -->
- </div>
- <!-- /.panel -->
- </div>
- <!-- /.col-lg-12 -->
- </div>
- <!-- /.row -->
- </div>
- <!-- /#page-wrapper -->
- </div>
- <!-- /#wrapper -->
- <!-- jQuery -->
- <?php
- include "footer.php";
- ?>
- </body>
- </html>
Add Comment
Please, Sign In to add comment