function GetPage($res = '') { $image = $res[image]; if (empty($image)) { $image = '0.jpg'; } $data = ' <div id="dialog-form"> <fieldset style="width: 350px; float: left;"> <legend>ძირითადი ინფორმაცია</legend> <table class="dialog-form-table"> <tr> <td style="width: 170px;"><label for="code">კოდი</label></td> <td> <input type="text" id="code" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['code'] . '" /> </td> </tr> <tr> <td style="width: 170px;"><label for="name">დასახელება</label></td> <td> <input type="text" id="name" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['name'] . '" /> </td> </tr> <tr> <td style="width: 170px;"><label for="category">კატეგორია</label></td> <td> <select id="category" class="idls">' . GetCategory($res[category]) . '</select> </td> </tr> <tr> <td style="width: 170px;"><label for="unit">ზომის ერთეული</label></td> <td> <select id="unit" class="idls num" style="width: 165px !important;">' . GetSize($res[unit]) . '</select> </td> </tr> <tr> <td style="width: 170px;"><label for="unit">მინ. რაოდენობა</label></td> <td> <input type="text" id="min" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['min_amount'] . '" /> </td> </tr> <tr> <td style="width: 170px;"><label for="unit">შენიშვნა</label></td> <td> <textarea id="comment" class="idle large" cols="30" rows="1" style="width:159px !important; height:50px !important;">' . $res['comment'] . '</textarea> </td> </tr> </table> </fieldset> <fieldset style="width: 350px;"> <legend>პროდუქტის სურათი</legend> <table class="dialog-form-table" width="100%"> <tr> <td id="img_colum" colspan="2"> <img id="upload_img" src="media/uploads/images/production/' . $image . '"> </td> </tr> <tr><!-- Upload Image --> <td id="act"> <span> <a href="#" id="view_image" class="complate">View</a> | <a href="#" id="delete_image" class="delete">Delete</a> </span> </td> <td> <div class="file-uploader"> <input id="choose_file" type="file" name="choose_file" class="input" style="display: none;"> <button id="choose_button" class="center">აირჩიეთ ფაილი</button> </div> </td> </tr> </table> </fieldset> <div class="clear"></div> <!-- ID --> <input type="hidden" id="prod_id" value="' . $res['id'] . '" /> </div> '; return $data; }
function GetPage($res = '') { $image = $res[image]; if (empty($image)) { $image = '0.jpg'; } $data = ' <!-- jQuery Dialog --> <div id="add-edit-prod-form-field" title="შემადგენლობა"> <!-- aJax --> </div> <div id="dialog-form"> <fieldset style="width: 300px; float: left;"> <legend>ძირითადი ინფორმაცია</legend> <table class="dialog-form-table"> <tr> <td style="width: 170px;"><label for="code">კოდი</label></td> <td> <input type="text" id="code" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['code'] . '" /> </td> </tr> <tr> <td style="width: 170px;"><label for="name">დასახელება</label></td> <td> <input type="text" id="name" class="idle" onblur="this.className=\'idle\'" onfocus="this.className=\'activeField\'" value="' . $res['name'] . '" /> </td> </tr> <tr> <td style="width: 170px;"><label for="category">კატეგორია</label></td> <td> <select id="category" class="idls">' . GetCategory($res[pos_menu_category]) . '</select> </td> </tr> <tr> <td style="width: 170px;"><label for="unit">ზომის ერთეული</label></td> <td> <select id="unit" class="idls num" style = " width: 165px !important;">' . GetSize($res[unit]) . '</select> </td> </tr> <tr> <td style="width: 170px;"><label for="unit">შენიშვნა</label></td> <td> <textarea id="comment" class="idle large" cols="30" rows="1" style="width:159px !important; height:50px !important;">' . $res['comment'] . '</textarea> </td> </tr> </table> </fieldset> <fieldset style="width: 300px; float: left; margin-left:6px !important; height:190px !important;"> <legend>პროდუქტის სურათი</legend> <table class="dialog-form-table" width="100%"> <tr> <td id="img_colum" colspan="2"> <img id="upload_img" src="media/uploads/images/production/' . $image . '"> </td> </tr> <tr><!-- Upload Image --> <td id="act"> <span> <a href="#" id="view_image" class="complate" style="float:left; margin-left:14px;">View</a> <p style="float:left; margin-left:5px;">|</p> <a href="#" id="delete_image" class="delete" style="float:left; margin-left:5px;">Delete</a> </span> </td> <td> <div class="file-uploader"> <input id="choose_file" type="file" name="choose_file" class="input" style="display: none;"> <button id="choose_button" class="center">აირჩიეთ ფაილი</button> </div> </td> </tr> </table> </fieldset> <fieldset> <legend>პროდუქტი</legend> <div class="inner-table"> <div id="dt_example" class="ex_highlight_row"> <div id="container" class="overhead_container"> <div id="button_area"> <button id="add_button_prod">დამატება</button><button id="delete_button_prod">წაშლა</button> </div> <div id="dynamic"> <table class="display" id="prod_list"> <thead> <tr id="datatable_header"> <th>ID</th> <th style="width : 100%">პროდუქტი</th> <th class="min" style="width:90px !important;">რაოდენობა</th> <th class="min" style="width:100px !important;">თვითღირებ.</th> <th class="min" style="width:90px !important;">ნამ. ფასი</th> <th class="check">#</th> </tr> </thead> <thead> <tr class="search_header"> <th class="colum_hidden"> <input type="text" name="search_id" value="ფილტრი" class="search_init" /> </th> <th> <input type="text" name="search_prod" value="ფილტრი" class="search_init" /> </th> <th></th> <th></th> <th></th> <th> <input type="checkbox" name="check-all" id="check-all-prod" style="margin-left: 13px;"> </th> </tr> </thead> </table> </div> </div> </div> </div> </fieldset> <!-- ID --> <input type="hidden" id="rec_id" value="' . $res['id'] . '" /> <input type="hidden" id="local_rec_id"/> </div> '; return $data; }
$path = $io->CombinePath("/", $path); $path = $GLOBALS["APPLICATION"]->ConvertCharset($path, "UTF-8", LANG_CHARSET); $arPath = array($site, $path); if (!$USER->CanDoFileOperation('fm_download_file', $arPath)) { $strWarning = GetMessage("ACCESS_DENIED"); } else { if (!$io->FileExists($arFile["tmp_name"])) { $strWarning = GetMessage("FILEMAN_FILENOT_FOUND") . " "; } elseif (!$USER->CanDoOperation('edit_php') && (HasScriptExtension($path) || substr(CFileman::GetFileName($path), 0, 1) == ".")) { $strWarning .= GetMessage("FILEMAN_FILE_DOWNLOAD_PHPERROR") . "\n"; } } if (strlen($strWarning) <= 0) { $flTmp = $io->GetFile($arFile["tmp_name"]); $fsize = $flTmp->GetFileSize(); $memoryLimit = (GetSize(ini_get("memory_limit")) - memory_get_usage()) / 10; //http://jabber.bx/view.php?id=16063 if ($fsize <= $memoryLimit) { $bufSize = $fsize; } else { $bufSize = $memoryLimit; } session_write_close(); set_time_limit(0); header("Content-Type: application/force-download; name=\"" . $arFile["name"] . "\""); header("Content-Transfer-Encoding: binary"); header("Content-Length: " . $fsize); header("Content-Disposition: attachment; filename=\"" . $arFile["name"] . "\""); header("Expires: 0"); header("Cache-Control: no-cache, must-revalidate"); header("Pragma: no-cache");