/da_catalog_inputWebLink.php
PHP | 135 lines | 84 code | 43 blank | 8 comment | 9 complexity | 2e40f375f13aea28ff36dbfc51a26b10 MD5 | raw file
- <html>
- <head><title>Data Archive Catalog: Input Dataset Record</title>
- <link rel="stylesheet" href="2col_leftNav.css" type="text/css">
- </head>
- <body>
- <?php
-
- $sscnetHTTP = "http://www.sscnet.ucla.edu/issr/da/da_catalog/";
- $sscnetHTTP_maintenance_test = "http://www.sscnet.ucla.edu/issr/da/da_catalog_maintenance_test/";
- $sscnetHTTP_maintenance_live = "http://www.sscnet.ucla.edu/issr/da/da_catalog_maintenance/";
- $mydestopHTTP = "http://localhost/da_catalog/";
- $currentHTTP = $sscnetHTTP_maintenance_live;
-
-
- if (isset($_SESSION['studynumber']))
- $studynumber = $_SESSION['studynumber'];
- else
- $studynumber = "";
-
-
- echo "studynumber: " . $studynumber . "<br>";
-
- if (isset($_SESSION['wwwtext']))
- $wwwtest = $_SESSION['wwwtext'];
- else
- $wwwtext = "";
-
- if (isset($_SESSION['wwwlink']))
- $wwwlink = $_SESSION['wwwlink'];
- else
- $wwwlink = "";
-
-
- $sscnetInclude = "ISSRDA_login.php";
- $currentInclude = $sscnetInclude;
- include($currentInclude);
-
- // for desktop test system
- //$db_name = "da_catalog";
-
-
-
-
- $queryTitleStudyNumFileType = "SELECT title.StudyNum FROM title ORDER BY title.StudyNum";
-
- // PDO connect
- $PDO_string = "mysql:host=" . $db_host . ";port=" . $db_port . ";dbname=" . $db_name ;
-
- try {
- $PDO_connection = new PDO($PDO_string, $db_username, $db_password);
-
- } catch(PDOException $e) {
- echo "Could not connect to the database because: ". $e->getMessage()."<br>";
- die();
- }
-
- // PDO - create prepared statement: get the table.pifull
- // --------------------------------------------------------
- $PDO_query = $PDO_connection->prepare($queryTitleStudyNumFileType);
- // PDO - execute the query
- $result = $PDO_query->execute();
- if (!$result) {
- die ("Could not query the database: <br />". mysql_error());
- }
- $studynumberList = array();
-
- $result = $PDO_query->fetch(PDO::FETCH_ASSOC);
- $row_index = 0;
- while ($row = $PDO_query->fetch(PDO::FETCH_ASSOC)) {
-
- $studynumberList[$row_index] = $row["StudyNum"];
-
- $row_index++;
- }
-
-
- $studynumberList = array_unique($studynumberList);
- sort($studynumberList);
- $studynumberListTotal = count($studynumberList);
-
-
- ?>
- <div id="masthead">
- <h1 id="siteName">UCLA Institute for Social Research Data Archives</h1>
- <h2 id="siteName"><a href="index.php" target="_self">Maintenance Menu</a> / Input Web Link ("Useful Link")</h2>
-
-
- </div> <!--end masthead--><!--end masthead-->
- <div style="margin: 1% 5% 2% 2%;line-height: 1.5; ">
- <form method="post" name="addRecord" action="da_catalog_insertWebLinkCheck.php">
- <label>
- <input type="submit" name="searchStudynumber" id="searchStudynumber" value="Add Web Link ("Useful Link") to this Studynumber"></label>
- Studynumber:
- <?php
- echo '<select name="studynumber" id="studynumber"';
- echo '<option value="">choose studynumber</option>';
-
- foreach ($studynumberList as $key => $value) {
-
- echo '<option value="' . $value . '">' . $value;
-
- }
-
- echo '</select>';
-
-
- ?>
-
- <hr align="center" width="100%" size="1">
-
-
- <div id="dynamicInput">
- <p>
- wwwlink name:
- <input name="wwwtext" type="text" size="50" maxlength="255">
- wwwlink: http://<input name="wwwlink" type="text" size="50" maxlength="255"> <br><br><input name="reset form" type="reset" value="reset">
-
- <input type="button" onClick="history.go(0)" value="Reload page">
- </p>
- </div>
- </form>
- <?php
-
- // close the connection
- // mysql_close($connection);
- $PDO_connection = null;
-
- ?>
-
- </div> <!-- end content-->
-
- </body></html>