Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting(E_ALL ^ E_DEPRECATED);
- ini_set('display_errors', 0);
- $owner_id = $_POST['owner'];
- function get_options_mld($select, $owner_id){
- include ('//db_joomla.php');
- $price = "Obiadokolacja";
- $types_mld = array();
- $index = 0;
- $types_mld[0]= 0;
- $index = 1;
- $query_disp = "SELECT * FROM jos_program_prices WHERE owner_id = '$owner_id ' AND pricefor= '$price'";
- $resultSet = mysql_query($query_disp, $con);
- while($row = mysql_fetch_array($resultSet)) {
- $type =$row['type'];
- $pricefor =$row['pricefor'];
- $price_mld=$row['price'];
- $types_mld[$type." : ".$price_mld] = $type." : ".$price_mld;
- $index++;
- }
- $options =' ';
- while(list($k, $v)=each($types_mld)){
- if($select==$k){
- $options.='<option value=" '.$k.' "selected> ' .$v. ' </option>';
- }
- else{
- $options.='<option value=" '.$k.' "> ' .$v. ' </option>';
- }
- }
- return $options;
- }
- function get_options_mb($select, $owner_id){
- include ('//db_joomla.php');
- $price = "Śniadanie";
- $types_mb = array();
- $index = 0;
- $types_mb[0]= 0;
- $index = 1;
- $query_disp = "SELECT * FROM jos_program_prices WHERE owner_id = '$owner_id ' AND pricefor= '$price'";
- $resultSet = mysql_query($query_disp, $con);
- while($row = mysql_fetch_array($resultSet)) {
- $type =$row['type'];
- $pricefor =$row['pricefor'];
- $price_mb=$row['price'];
- $types_mb[$type." : ".$price_mb] = $type." : ".$price_mb;
- $index++;
- }
- $options =' ';
- while(list($k, $v)=each($types_mb)){
- if($select==$k){
- $options.='<option value=" '.$k.' "selected> ' .$v. ' </option>';
- }
- else{
- $options.='<option value=" '.$k.' "> ' .$v. ' </option>';
- }
- }
- return $options;
- }
- function get_options_ml($select, $owner_id){
- include ('//db_joomla.php');
- $price = "Obiad";
- $types_ml = array();
- $index = 0;
- $types_ml[0]= 0;
- $index = 1;
- $query_disp = "SELECT * FROM jos_program_prices WHERE owner_id = '$owner_id ' AND pricefor= '$price'";
- $resultSet = mysql_query($query_disp, $con);
- while($row = mysql_fetch_array($resultSet)) {
- $type =$row['type'];
- $pricefor =$row['pricefor'];
- $price_ml=$row['price'];
- $types_ml[$type." : ".$price_ml] = $type." : ".$price_ml;
- $index++;
- }
- $options =' ';
- while(list($k, $v)=each($types_ml)){
- if($select==$k){
- $options.='<option value=" '.$k.' "selected> ' .$v. ' </option>';
- }
- else{
- $options.='<option value=" '.$k.' "> ' .$v. ' </option>';
- }
- }
- return $options;
- }
- function get_options_md($select, $owner_id){
- include ('//db_joomla.php');
- $price = "Kolacja";
- $types_md = array();
- $index = 0;
- $types_md[0]= 0;
- $index = 1;
- $query_disp = "SELECT * FROM jos_program_prices WHERE owner_id = '$owner_id ' AND pricefor= '$price'";
- $resultSet = mysql_query($query_disp, $con);
- while($row = mysql_fetch_array($resultSet)) {
- $type =$row['type'];
- $pricefor =$row['pricefor'];
- $price_md=$row['price'];
- $types_md[$type." : ".$price_md] = $type." : ".$price_md;
- $index++;
- }
- $options =' ';
- while(list($k, $v)=each($types_md)){
- if($select==$k){
- $options.='<option value=" '.$k.' "selected> ' .$v. ' </option>';
- }
- else{
- $options.='<option value=" '.$k.' "> ' .$v. ' </option>';
- }
- }
- return $options;
- }
- $date1 = $_POST['data1'];
- $date2 = $_POST['data2'];
- $range = strtotime($date2)-strtotime($date1);
- $range = floor($range/(60*60*24));
- $tmp0 = array();
- $tmp4 = "";
- $index = 0;
- $result = '<div id="resg_s2"><a href="#"><span class="icon-question-sign" style="color: white;font-size: 1.4em;position: relative;left: 510px;top: 13px;"></span></a></div></br></br> <div id="mres-form41" style="position:relative; width:240px;"><label for="types_mb">*CENA ŚNIADANIA</br>(zł/porcja):</label> <select name = "types_mb" id ="types_mb" style="width: 210px;" required>'.get_options_mb($selected, $owner_id).'</select></div><div id="mres-form42" style="position:relative; width: 220px;left: 219px;top: -78px;"><label for="types_ml">*CENA OBIADU</br>(zł/porcja):</label><select name = "types_ml" id ="types_ml" style="width: 210px;" required>'.get_options_ml($selected, $owner_id).'</select></div><div id="mres-form43" style="position:relative; width: 240px;left: 424px;top: -156px;"><label for="types_md">*CENA KOLACJI </br>(zł/porcja):</label> <select name = "types_md" id ="types_md" style="width: 210px;" required>'.get_options_md($selected, $owner_id).'</select></div><div id="mres-form44" style="position:relative; width: 240px;left: 635px;top: -234px;"><label for="types_mld">*CENA OBIADOKOLACJI</br>(zł/porcja):</label> <select name = "types_mld" id ="types_mld" style="width: 210px;" required>'.get_options_mld($selected, $owner_id).'</select></div></br><table name="table" id="table_food" border="1" style="color:1c4e93; position:relative; top:-240px; border-bottom:none; background:Transparent; border-color: #d4d2d2; color: #08C;"><thead><th class = "th" style="background-color: #57c7da;border-color: #d4d2d2; color: #fff;text-shadow: 0 -1px 0 rgba(0,0,0,0.25); width:70px;"><input type="hidden" name="lp" value="lp" />DZIEŃ</th><th class = "th" style="width: 70px; background-color: #57c7da;border-color: #d4d2d2; color: #fff;text-shadow: 0 -1px 0 rgba(0,0,0,0.25);"><input type="hidden" name="type" value="type" />ŚNIADANIE</th><th class = "th" style="width: 45px; background-color: #57c7da;border-color: #d4d2d2; color: #fff;text-shadow: 0 -1px 0 rgba(0,0,0,0.25);"><input type="hidden" name="vac" value="vac" />ŚNIADANIE</br>PÓŁ PORCJI</th><th class = "th" style="width:60px; background-color: #57c7da;border-color: #d4d2d2; color: #fff;text-shadow: 0 -1px 0 rgba(0,0,0,0.25);"><input type="hidden" name=" " value=" " />OBIAD</th><th class = "th" style="width: 60px; background-color: #57c7da;border-color: #d4d2d2; color: #fff;text-shadow: 0 -1px 0 rgba(0,0,0,0.25);"><input type="hidden" name="blc" value="blc" />OBIAD</br>PÓŁ PORCJI</th><th class ="th" style="width: 40px; background-color: #57c7da; border-color: #d4d2d2; color: #fff;text-shadow: 0 -1px 0 rgba(0,0,0,0.25);"><input type="hidden" name="room_nr" value="" />KOLACJA</th><th class = "th" style="width: 40px; background-color: #57c7da;border-color: #d4d2d2; color: #fff;text-shadow: 0 -1px 0 rgba(0,0,0,0.25);"><input type="hidden" name="floor" value="" />KOLACJA</br> PÓŁ PORCJI</th><th class = "th" style="width: 55px; background-color: #57c7da; border-color: #d4d2d2; color: #fff;text-shadow: 0 -1px 0 rgba(0,0,0,0.25);"><input type="hidden" name="dost" value="" />OBIADO-</br>KOLACJA</th><th class = "th" style="width: 55px; background-color: #57c7da; border-color: #d4d2d2; color: #fff;text-shadow: 0 -1px 0 rgba(0,0,0,0.25);"><input type="hidden" name="dost" value="" />OBIADO-</br>KOLACJA</br>PÓŁ PORCJI</th><th class = "th" style="width: 55px; background-color: #57c7da; border-color: #d4d2d2; color: #fff;text-shadow: 0 -1px 0 rgba(0,0,0,0.25);"><input type="hidden" name="dost" value="" />ŁACZNIE</br>PEŁNYCH</br>POSIŁKÓW</th><th class = "th" style="width: 55px; background-color: #57c7da; border-color: #d4d2d2; color: #fff;text-shadow: 0 -1px 0 rgba(0,0,0,0.25);"><input type="hidden" name="dost" value="" />ŁACZNIE</br>PÓŁ PORCJI</br>POSIŁKÓW</th><th class = "th" style="width: 55px; background-color: #57c7da; border-color: #d4d2d2; color: #fff;text-shadow: 0 -1px 0 rgba(0,0,0,0.25);"><input type="hidden" name="dost" value="" />ŁĄCZNA</br>CENA</th></thead><tbody>';
- for($i=0; $i<$range+1; $i++){
- $result.='<tr><td class="container_rom" width = "40px;"><center><b>'.date("Y-m-d", strtotime($date1."+".$i."day")).'</b></td><td class="container_rom" ><div style="text-align: center; width:70px;"><input type="number" name="breakfastf[]" value="0" style="width: 60px;" min="0"/></div></td><td class="container_rom"><div class="td_div" style="text-align: center; width:80px;"><input type="number" name="breakfasth[]" value="0" style="width: 60px;" min="0"/></div></td><td class="container_rom"><div style="text-align: center; width:60px;"><input type="number" name="lunchf[]" value="0" style="width: 55px;" min="0"/></div></td><td class="container_rom"><div style="text-align: center; width:70px;"><input type="number" name="lunchh[]" value="0" style="width: 55px;" min="0"/></div></td><td class="container_rom"><div style="text-align: center; width:60px;"><input type="number" name="dinnerf[]" value="0" style="width: 50px;" min="0"/></div></td><td class="container_rom"><div style="text-align: center; width:75px;"><input type="number" name="dinnerh[]" value="0" style="width: 60px;" min="0"/></div></td><td class="container_rom"><div style="text-align: center; width:70px;"><input type="number" name="ldinnerf[]" value="0" min="0" style="width: 60px;"></div></td><td class="container_rom"><div style="text-align: center; width:70px;"><input type="number" name="ldinnerh[]" value="0" style="width: 60px;" min="0"/></div></td><td class="container_rom"><div style="text-align: center; width:70px;"><input type="number" name="fmeals_total[]" id="meals_tf'.$i.'" value="0" style="width: 55px;" readonly="readonly"/></div></td><td class="container_rom"><div style="text-align: center; width:70px;"><input type="number" name="hmeals_total[]" id="meals_th'.$i.'" value="0" style="width: 55px;" readonly="readonly"/></div></td><td class="container_rom"><div style="text-align: center; width:70px;"><input style="width: 60px;" type="number" name="meals_price[]" id="meals_p'.$i.'" value="0" readonly="readonly"/></div></td></tr>';
- }
- $result.='</tbody></table>';
- echo $result;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement