function ListByParashah($parashah) { $parashah = str_replace("\\", "", $parashah); $parashah = trim($parashah); // require 'mysql.php'; $result = mysql_query("SELECT filename, title, description, dir \n\t\t\t\t\t\t\tFROM descriptions \n\t\t\t\t\t\t\tWHERE parashah='" . mysql_real_escape_string($parashah) . "' \n\t\t\t\t\t\t\tORDER BY `dir` DESC, `filename` ASC"); mysql_close($con); //store shiurim in array $n = 0; while ($row = mysql_fetch_array($result)) { $shiurim['title'][$n] = $row['title']; $shiurim['filename'][$n] = $row['filename']; $shiurim['dir'][$n] = $row['dir']; $shiurim['description'][$n] = $row['description']; if (strcmp($shiurim['dir'][$n], 'mp3/') == 0) { $shiurim['date'][$n] = '(2004 - 2007)'; } else { if (strcmp($shiurim['dir'][$n], 'mp3/NC/') == 0) { $shiurim['date'][$n] = '(2012)'; } } $n++; } //print out shiurim according to series $currentSeries = $shiurim['dir'][0]; printHeadline('Classes for Parashas ' . $parashah . ' ' . $shiurim['date'][0]); for ($i = 0; $i < sizeof($shiurim['dir']); $i++) { if ($shiurim['dir'][$i] != $currentSeries) { $currentSeries = $shiurim['dir'][$i]; printNewHeadline('Classes for Parashas ' . $parashah . ' ' . $shiurim['date'][$i]); } printShiur($shiurim['title'][$i], $shiurim['filename'][$i], $shiurim['description'][$i], $shiurim['dir'][$i]); } //echo '<br />'; }
if (strcmp($new_filename, $filename) != 0) { if (!file_exists($new_path)) { $sql = "UPDATE descriptions \n\t\tSET title='" . mysql_real_escape_string($title) . "',\n\t\tfilename='" . mysql_real_escape_string($new_filename) . "', \n\t\tdescription='" . mysql_real_escape_string($description) . "' \n\t\tWHERE filename='" . mysql_real_escape_string($filename) . "'"; mysql_query($sql, $con); rename($old_path, $new_path); //echo 'The title of '.$filename.' has been updated to: <b>'.$new_filename.'</b><br />'; printHeadline('Preview'); printShiur($title, $new_filename, $description, $dir); printNewHeadline('Do Another Shiur'); } else { echo 'Sorry the file ' . $new_filename . ' already exists. Please choose a different name.'; } } else { $sql = "UPDATE descriptions \n\tSET description='" . mysql_real_escape_string($description) . "' \n\tWHERE filename='" . mysql_real_escape_string($filename) . "'"; mysql_query($sql, $con); printHeadline('Preview'); printShiur($title, $new_filename, $description, $dir); printNewHeadline('Do Another Shiur'); } ?> <form action="editdescription.php" method="post" enctype="multipart/form-data"> <table> <tr> <td>Chumash/Series:</td> <td><select name="chumash" id="chumash" onchange="getParashah()" > <option value="Bereishit">Bereishit</option> <option value="Shemot">Shemot</option> <option value="Vayikra">Vayikra</option> <option value="Bamidbar">Bamidbar</option> <option value="Devarim">Devarim</option>