diff --git a/~dev_rating/application/classes/Controller/Admin/Students.php b/~dev_rating/application/classes/Controller/Admin/Students.php index 049b6abddfd6245b1ed4dfef92fc9449feea3510..cd18f7bd2f7605cd7581a0be5e359feef816e1e8 100644 --- a/~dev_rating/application/classes/Controller/Admin/Students.php +++ b/~dev_rating/application/classes/Controller/Admin/Students.php @@ -42,12 +42,70 @@ class Controller_Admin_Students extends Controller_UserEnvi { public function action_upload() { + if(!empty($_FILES['students'])AND $this->request->method() == 'POST') + { + $this->parseFile(); + } + $model = new Model_Admin_Students; + $faculties = $model->getFaculties(); + $facultiesHandled = array(); $i = 0; + foreach($faculties as $row) + { + $i++; + $facultiesHandled[$i]['ID'] = $row['FacultyID']; + $facultiesHandled[$i]['Name'] = $row['FacultyName']; + $facultiesHandled[$i]['Abbr'] = $row['FacultyAbbr']; + } + // VIEW $twig = Twig::factory('admin/students/upload'); - + $twig->Faculties = $facultiesHandled; $twig->User = $this->UserInfo; $this->response->body($twig); } + protected function parseFile() + { + $model = new Model_Admin_Students; + $post = Arr::map('trim', $_POST); + $facultyID = $post['facultyID']; + $file = fopen($_FILES["schedule"]["tmp_name"], "r"); + while ($line = fgetcsv($file, 0, ";")) + { + // РРјСЏ, фамилия, отчество + $studentName = explode(' ', $line[0]); $idx = 0; + if(UTF8::substr($studentName[1], 0, 1) == '(') + { + $idx = 1; + } + $lastName = $studentName[0]; + $firstName = $studentName[1 + $idx]; + $secondName = ''; + for($i = 2 + $idx; $i < count(); $i++) + { + $secondName .= $studentName[$i].' '; + } + $secondName = trim($secondName); + // РљСѓСЂСЃ, степень подготовки + $studentGradeNum = $line[1]; + switch($line[2]) + { + case 'Бакалавр': + $studentDegree = 'bachelor'; + break; + case 'Специалист': + $studentDegree = 'specialist'; + break; + case 'Магистр': + $studentDegree = 'master'; + break; + } + $studentGroupNum = $line[3]; + $studentGradeID = $model->getGradeID($studentGradeNum, $studentDegree); + Account::instance()->createStudent($lastName, $firstName, $secondName, + $studentGradeID, $studentGroupNum, $facultyID); + } + } + public function action_edit() { $twig = Twig::factory('admin/students/edit'); diff --git a/~dev_rating/application/views/admin/students/upload.twig b/~dev_rating/application/views/admin/students/upload.twig index 6d6a73f7ca8d5a2d6201bcea583274d4eb10b565..f70f997b75c9818dc71dfb398fec450539b92ab7 100644 --- a/~dev_rating/application/views/admin/students/upload.twig +++ b/~dev_rating/application/views/admin/students/upload.twig @@ -3,6 +3,36 @@ {% block title %}Студенты{% endblock %} {% block main_top_title %}Загрузка СЃРїРёСЃРєР° студентов{% endblock %} +{% block media %} + {{ HTML.style('media/css/admin/stepByStep.css')|raw }} + {{ HTML.script('media/js/admin/students/upload.js')|raw }} + {{ HTML.script('media/js/jquery.uploadfile.min.js')|raw }} + {{ HTML.style('media/js/uploadfile.css')|raw }} +{% endblock %} + {% block main_content %} - + <div class="stepBox" id="FirstStep"> + <div class="step_title"> + <span class='step_title_count'>Шаг 1:</span> <span class='step_title_description'>Выберите подразделение университета</span> + </div> + <div class="step_body"> + <select id="facultySelect"> + <option value="0">--- Подразделение ЮФУ ---</option> + {% for row in Faculties %} + <option value="{{ row.ID }}">{{ row.Name }} ({{ row.Abbr }})</option> + {% endfor %} + </select> + </div> + </div> + <div class="stepBox" id="SecondStep"> + <div class="step_title"> + <span class='step_title_count'>Шаг 2:</span> <span class='step_title_description'>Выберите файл для загрузки</span> + </div> + <div class="step_body"> + <form enctype="multipart/form-data" action="" method="POST"> + <input name="students" type="file"> + <input type="submit" value="Send"> + </form> + </div> + </div> {% endblock %} \ No newline at end of file diff --git a/~dev_rating/media/js/admin/students/upload.js b/~dev_rating/media/js/admin/students/upload.js new file mode 100644 index 0000000000000000000000000000000000000000..d4e49ef70f79aa173fb4fd9a4124c2a8bcee387f --- /dev/null +++ b/~dev_rating/media/js/admin/students/upload.js @@ -0,0 +1,15 @@ +$(function() +{ + $("#fileuploader").uploadFile({ + url:"/~dev_rating/handler/admStudents/loadXSLXFile", + allowedTypes:"xlsx", + fileName:"myfile" + }); + $("#facultySelect [value='0']").attr('selected', 'selected'); + + $('#facultySelect').change(function(){ + if (($('#facultySelect option:selected').val()!= '0')) { + $('#SecondStep').css('display', 'block'); + } + }); +}); \ No newline at end of file diff --git a/~dev_rating/media/js/jquery.uploadfile.min.js b/~dev_rating/media/js/jquery.uploadfile.min.js new file mode 100644 index 0000000000000000000000000000000000000000..8f13e5573c6b18890bfb26c0a2d5069f086543e9 --- /dev/null +++ b/~dev_rating/media/js/jquery.uploadfile.min.js @@ -0,0 +1,8 @@ +/*! + * jQuery Upload File Plugin + * version: 3.1.10 + * @requires jQuery v1.5 or later & form plugin + * Copyright (c) 2013 Ravishanker Kusuma + * http://hayageek.com/ + */ +(function(b){if(b.fn.ajaxForm==undefined){b.getScript(("https:"==document.location.protocol?"https://":"http://")+"malsup.github.io/jquery.form.js")}var a={};a.fileapi=b("<input type='file'/>").get(0).files!==undefined;a.formdata=window.FormData!==undefined;b.fn.uploadFile=function(f){var p=b.extend({url:"",method:"POST",enctype:"multipart/form-data",returnType:null,allowDuplicates:true,duplicateStrict:false,allowedTypes:"*",acceptFiles:"*",fileName:"file",formData:{},dynamicFormData:function(){return{}},maxFileSize:-1,maxFileCount:-1,multiple:true,dragDrop:true,autoSubmit:true,showCancel:true,showAbort:true,showDone:true,showDelete:false,showError:true,showStatusAfterSuccess:true,showStatusAfterError:true,showFileCounter:true,fileCounterStyle:"). ",showProgress:false,nestedForms:true,showDownload:false,onLoad:function(s){},onSelect:function(s){return true},onSubmit:function(s,x){},onSuccess:function(y,x,z,s){},onError:function(z,s,y,x){},onCancel:function(x,s){},downloadCallback:false,deleteCallback:false,afterUploadAll:false,abortButtonClass:"ajax-file-upload-abort",cancelButtonClass:"ajax-file-upload-cancel",dragDropContainerClass:"ajax-upload-dragdrop",dragDropHoverClass:"state-hover",errorClass:"ajax-file-upload-error",uploadButtonClass:"ajax-file-upload",dragDropStr:"<span><b>Drag & Drop Files</b></span>",abortStr:"Abort",cancelStr:"Cancel",deletelStr:"Delete",doneStr:"Done",multiDragErrorStr:"Multiple File Drag & Drop is not allowed.",extErrorStr:"is not allowed. Allowed extensions: ",duplicateErrorStr:"is not allowed. File already exists.",sizeErrorStr:"is not allowed. Allowed Max size: ",uploadErrorStr:"Upload is not allowed",maxFileCountErrorStr:" is not allowed. Maximum allowed files are:",downloadStr:"Download",customErrorKeyStr:"jquery-upload-file-error",showQueueDiv:false,statusBarWidth:500,dragdropWidth:500,showPreview:false,previewHeight:"auto",previewWidth:"100%",uploadFolder:"uploads/"},f);this.fileCounter=1;this.selectedFiles=0;this.fCounter=0;this.sCounter=0;this.tCounter=0;var e="ajax-file-upload-"+(new Date().getTime());this.formGroup=e;this.hide();this.errorLog=b("<div></div>");this.after(this.errorLog);this.responses=[];this.existingFileNames=[];if(!a.formdata){p.dragDrop=false}if(!a.formdata){p.multiple=false}var n=this;var q=b("<div>"+b(this).html()+"</div>");b(q).addClass(p.uploadButtonClass);(function l(){if(b.fn.ajaxForm){if(p.dragDrop){var s=b('<div class="'+p.dragDropContainerClass+'" style="vertical-align:top;"></div>').width(p.dragdropWidth);b(n).before(s);b(s).append(q);b(s).append(b(p.dragDropStr));c(n,p,s)}else{b(n).before(q)}p.onLoad.call(this,n);k(n,e,p,q)}else{window.setTimeout(l,10)}})();this.startUpload=function(){b("."+this.formGroup).each(function(x,s){if(b(this).is("form")){b(this).submit()}})};this.getFileCount=function(){return n.selectedFiles};this.stopUpload=function(){b("."+p.abortButtonClass).each(function(x,s){if(b(this).hasClass(n.formGroup)){b(this).click()}})};this.cancelAll=function(){b("."+p.cancelButtonClass).each(function(x,s){if(b(this).hasClass(n.formGroup)){b(this).click()}})};this.update=function(s){p=b.extend(p,s)};this.createProgress=function(y){var x=new j(this,p);x.progressDiv.show();x.progressbar.width("100%");var s="";if(p.showFileCounter){s=n.fileCounter+p.fileCounterStyle+y}else{s=y}x.filename.html(s);n.fileCounter++;n.selectedFiles++;if(p.showPreview){x.preview.attr("src",p.uploadFolder+y);x.preview.show()}if(p.showDownload){x.download.show();x.download.click(function(){if(p.downloadCallback){p.downloadCallback.call(n,[y])}})}x.del.show();x.del.click(function(){x.statusbar.hide().remove();var z=[y];if(p.deleteCallback){p.deleteCallback.call(this,z,x)}n.selectedFiles-=1;d(p,n)})};this.getResponses=function(){return this.responses};var m=false;function u(){if(p.afterUploadAll&&!m){m=true;(function s(){if(n.sCounter!=0&&(n.sCounter+n.fCounter==n.tCounter)){p.afterUploadAll(n);m=false}else{window.setTimeout(s,100)}})()}}function c(z,x,y){y.on("dragenter",function(s){s.stopPropagation();s.preventDefault();b(this).addClass(x.dragDropHoverClass)});y.on("dragover",function(A){A.stopPropagation();A.preventDefault();var s=b(this);if(s.hasClass(x.dragDropContainerClass)&&!s.hasClass(x.dragDropHoverClass)){s.addClass(x.dragDropHoverClass)}});y.on("drop",function(A){A.preventDefault();b(this).removeClass(x.dragDropHoverClass);z.errorLog.html("");var s=A.originalEvent.dataTransfer.files;if(!x.multiple&&s.length>1){if(x.showError){b("<div class='"+x.errorClass+"'>"+x.multiDragErrorStr+"</div>").appendTo(z.errorLog)}return}if(x.onSelect(s)==false){return}r(x,z,s)});y.on("dragleave",function(s){b(this).removeClass(x.dragDropHoverClass)});b(document).on("dragenter",function(s){s.stopPropagation();s.preventDefault()});b(document).on("dragover",function(A){A.stopPropagation();A.preventDefault();var s=b(this);if(!s.hasClass(x.dragDropContainerClass)){s.removeClass(x.dragDropHoverClass)}});b(document).on("drop",function(s){s.stopPropagation();s.preventDefault();b(this).removeClass(x.dragDropHoverClass)})}function t(s){var y="";var x=s/1024;if(parseInt(x)>1024){var z=x/1024;y=z.toFixed(2)+" MB"}else{y=x.toFixed(2)+" KB"}return y}function i(A){var B=[];if(jQuery.type(A)=="string"){B=A.split("&")}else{B=b.param(A).split("&")}var x=B.length;var s=[];var z,y;for(z=0;z<x;z++){B[z]=B[z].replace(/\+/g," ");y=B[z].split("=");s.push([decodeURIComponent(y[0]),decodeURIComponent(y[1])])}return s}function r(K,E,x){for(var F=0;F<x.length;F++){if(!g(E,K,x[F].name)){if(K.showError){b("<div class='"+K.errorClass+"'><b>"+x[F].name+"</b> "+K.extErrorStr+K.allowedTypes+"</div>").appendTo(E.errorLog)}continue}if(!K.allowDuplicates&&o(E,x[F].name)){if(K.showError){b("<div class='"+K.errorClass+"'><b>"+x[F].name+"</b> "+K.duplicateErrorStr+"</div>").appendTo(E.errorLog)}continue}if(K.maxFileSize!=-1&&x[F].size>K.maxFileSize){if(K.showError){b("<div class='"+K.errorClass+"'><b>"+x[F].name+"</b> "+K.sizeErrorStr+t(K.maxFileSize)+"</div>").appendTo(E.errorLog)}continue}if(K.maxFileCount!=-1&&E.selectedFiles>=K.maxFileCount){if(K.showError){b("<div class='"+K.errorClass+"'><b>"+x[F].name+"</b> "+K.maxFileCountErrorStr+K.maxFileCount+"</div>").appendTo(E.errorLog)}continue}E.selectedFiles++;E.existingFileNames.push(x[F].name);var G=K;var z=new FormData();var D=K.fileName.replace("[]","");z.append(D,x[F]);var B=K.formData;if(B){var I=i(B);for(var C=0;C<I.length;C++){if(I[C]){z.append(I[C][0],I[C][1])}}}G.fileData=z;var H=new j(E,K);var J="";if(K.showFileCounter){J=E.fileCounter+K.fileCounterStyle+x[F].name}else{J=x[F].name}H.filename.html(J);var y=b("<form style='display:block; position:absolute;left: 150px;' class='"+E.formGroup+"' method='"+K.method+"' action='"+K.url+"' enctype='"+K.enctype+"'></form>");y.appendTo("body");var A=[];A.push(x[F].name);w(y,G,H,A,E,x[F]);E.fileCounter++}}function g(z,y,B){var A=y.allowedTypes.toLowerCase().split(",");var x=B.split(".").pop().toLowerCase();if(y.allowedTypes!="*"&&jQuery.inArray(x,A)<0){return false}return true}function o(A,y){var z=false;if(A.existingFileNames.length){for(var s=0;s<A.existingFileNames.length;s++){if(A.existingFileNames[s]==y||p.duplicateStrict&&A.existingFileNames[s].toLowerCase()==y.toLowerCase()){z=true}}}return z}function h(y,z){if(y.existingFileNames.length){for(var s=0;s<z.length;s++){var A=y.existingFileNames.indexOf(z[s]);if(A!=-1){y.existingFileNames.splice(A,1)}}}}function v(x,y){if(x){y.show();var s=new FileReader();s.onload=function(z){y.attr("src",z.target.result)};s.readAsDataURL(x)}}function d(x,z){if(x.showFileCounter){var y=b(".ajax-file-upload-filename").length;z.fileCounter=y+1;b(".ajax-file-upload-filename").each(function(D,B){var s=b(this).html().split(x.fileCounterStyle);var A=parseInt(s[0])-1;var C=y+x.fileCounterStyle+s[1];b(this).html(C);y--})}}function k(D,C,z,x){var E="ajax-upload-id-"+(new Date().getTime());var B=b("<form method='"+z.method+"' action='"+z.url+"' enctype='"+z.enctype+"'></form>");var y="<input type='file' id='"+E+"' name='"+z.fileName+"' accept='"+z.acceptFiles+"'/>";if(z.multiple){if(z.fileName.indexOf("[]")!=z.fileName.length-2){z.fileName+="[]"}y="<input type='file' id='"+E+"' name='"+z.fileName+"' accept='"+z.acceptFiles+"' multiple/>"}var A=b(y).appendTo(B);A.change(function(){D.errorLog.html("");var L=z.allowedTypes.toLowerCase().split(",");var H=[];if(this.files){for(I=0;I<this.files.length;I++){H.push(this.files[I].name)}if(z.onSelect(this.files)==false){return}}else{var J=b(this).val();var G=[];H.push(J);if(!g(D,z,J)){if(z.showError){b("<div class='"+z.errorClass+"'><b>"+J+"</b> "+z.extErrorStr+z.allowedTypes+"</div>").appendTo(D.errorLog)}return}G.push({name:J,size:"NA"});if(z.onSelect(G)==false){return}}d(z,D);x.unbind("click");B.hide();k(D,C,z,x);B.addClass(C);if(a.fileapi&&a.formdata){B.removeClass(C);var K=this.files;r(z,D,K)}else{var F="";for(var I=0;I<H.length;I++){if(z.showFileCounter){F+=D.fileCounter+z.fileCounterStyle+H[I]+"<br>"}else{F+=H[I]+"<br>"}D.fileCounter++}if(z.maxFileCount!=-1&&(D.selectedFiles+H.length)>z.maxFileCount){if(z.showError){b("<div class='"+z.errorClass+"'><b>"+F+"</b> "+z.maxFileCountErrorStr+z.maxFileCount+"</div>").appendTo(D.errorLog)}return}D.selectedFiles+=H.length;var s=new j(D,z);s.filename.html(F);w(B,z,s,H,D,null)}});if(z.nestedForms){B.css({margin:0,padding:0});x.css({position:"relative",overflow:"hidden",cursor:"default"});A.css({position:"absolute",cursor:"pointer",top:"0px",width:"100%",height:"100%",left:"0px","z-index":"100",opacity:"0.0",filter:"alpha(opacity=0)","-ms-filter":"alpha(opacity=0)","-khtml-opacity":"0.0","-moz-opacity":"0.0"});B.appendTo(x)}else{B.appendTo(b("body"));B.css({margin:0,padding:0,display:"block",position:"absolute",left:"-250px"});if(navigator.appVersion.indexOf("MSIE ")!=-1){x.attr("for",E)}else{x.click(function(){A.click()})}}}function j(y,x){this.statusbar=b("<div class='ajax-file-upload-statusbar'></div>").width(x.statusBarWidth);this.preview=b("<img class='ajax-file-upload-preview' />").width(x.previewWidth).height(x.previewHeight).appendTo(this.statusbar).hide();this.filename=b("<div class='ajax-file-upload-filename'></div>").appendTo(this.statusbar);this.progressDiv=b("<div class='ajax-file-upload-progress'>").appendTo(this.statusbar).hide();this.progressbar=b("<div class='ajax-file-upload-bar "+y.formGroup+"'></div>").appendTo(this.progressDiv);this.abort=b("<div class='ajax-file-upload-red "+x.abortButtonClass+" "+y.formGroup+"'>"+x.abortStr+"</div>").appendTo(this.statusbar).hide();this.cancel=b("<div class='ajax-file-upload-red "+x.cancelButtonClass+" "+y.formGroup+"'>"+x.cancelStr+"</div>").appendTo(this.statusbar).hide();this.done=b("<div class='ajax-file-upload-green'>"+x.doneStr+"</div>").appendTo(this.statusbar).hide();this.download=b("<div class='ajax-file-upload-green'>"+x.downloadStr+"</div>").appendTo(this.statusbar).hide();this.del=b("<div class='ajax-file-upload-red'>"+x.deletelStr+"</div>").appendTo(this.statusbar).hide();if(x.showQueueDiv){b("#"+x.showQueueDiv).append(this.statusbar)}else{y.errorLog.after(this.statusbar)}return this}function w(D,C,x,z,E,B){var A=null;var y={cache:false,contentType:false,processData:false,forceSync:false,type:C.method,data:C.formData,formData:C.fileData,dataType:C.returnType,beforeSubmit:function(J,G,I){if(C.onSubmit.call(this,z)!=false){var F=C.dynamicFormData();if(F){var s=i(F);if(s){for(var H=0;H<s.length;H++){if(s[H]){if(C.fileData!=undefined){I.formData.append(s[H][0],s[H][1])}else{I.data[s[H][0]]=s[H][1]}}}}}E.tCounter+=z.length;u();return true}x.statusbar.append("<div class='"+C.errorClass+"'>"+C.uploadErrorStr+"</div>");x.cancel.show();D.remove();x.cancel.click(function(){h(E,z);x.statusbar.remove();C.onCancel.call(E,z,x);E.selectedFiles-=z.length;d(C,E)});return false},beforeSend:function(F,s){x.progressDiv.show();x.cancel.hide();x.done.hide();if(C.showAbort){x.abort.show();x.abort.click(function(){h(E,z);F.abort();E.selectedFiles-=z.length})}if(!a.formdata){x.progressbar.width("5%")}else{x.progressbar.width("1%")}},uploadProgress:function(I,s,H,G){if(G>98){G=98}var F=G+"%";if(G>1){x.progressbar.width(F)}if(C.showProgress){x.progressbar.html(F);x.progressbar.css("text-align","center")}},success:function(F,s,H){if(C.returnType=="json"&&b.type(F)=="object"&&F.hasOwnProperty(C.customErrorKeyStr)){x.abort.hide();var G=F[C.customErrorKeyStr];C.onError.call(this,z,200,G,x);if(C.showStatusAfterError){x.progressDiv.hide();x.statusbar.append("<span class='"+C.errorClass+"'>ERROR: "+G+"</span>")}else{x.statusbar.hide();x.statusbar.remove()}E.selectedFiles-=z.length;D.remove();E.fCounter+=z.length;return}E.responses.push(F);x.progressbar.width("100%");if(C.showProgress){x.progressbar.html("100%");x.progressbar.css("text-align","center")}x.abort.hide();C.onSuccess.call(this,z,F,H,x);if(C.showStatusAfterSuccess){if(C.showDone){x.done.show();x.done.click(function(){x.statusbar.hide("slow");x.statusbar.remove()})}else{x.done.hide()}if(C.showDelete){x.del.show();x.del.click(function(){x.statusbar.hide().remove();if(C.deleteCallback){C.deleteCallback.call(this,F,x)}E.selectedFiles-=z.length;d(C,E)})}else{x.del.hide()}}else{x.statusbar.hide("slow");x.statusbar.remove()}if(C.showDownload){x.download.show();x.download.click(function(){if(C.downloadCallback){C.downloadCallback(F)}})}D.remove();E.sCounter+=z.length},error:function(G,s,F){x.abort.hide();if(G.statusText=="abort"){x.statusbar.hide("slow").remove();d(C,E)}else{C.onError.call(this,z,s,F,x);if(C.showStatusAfterError){x.progressDiv.hide();x.statusbar.append("<span class='"+C.errorClass+"'>ERROR: "+F+"</span>")}else{x.statusbar.hide();x.statusbar.remove()}E.selectedFiles-=z.length}D.remove();E.fCounter+=z.length}};if(C.showPreview&&B!=null){if(B.type.toLowerCase().split("/").shift()=="image"){v(B,x.preview)}}if(C.autoSubmit){D.ajaxSubmit(y)}else{if(C.showCancel){x.cancel.show();x.cancel.click(function(){h(E,z);D.remove();x.statusbar.remove();C.onCancel.call(E,z,x);E.selectedFiles-=z.length;d(C,E)})}D.ajaxForm(y)}}return this}}(jQuery)); \ No newline at end of file diff --git a/~dev_rating/media/js/uploadfile.css b/~dev_rating/media/js/uploadfile.css new file mode 100644 index 0000000000000000000000000000000000000000..ef5dfe4d8b83e0fe9f8226f2128b70bf2b519f2f --- /dev/null +++ b/~dev_rating/media/js/uploadfile.css @@ -0,0 +1,131 @@ +.ajax-file-upload-statusbar { +border: 1px solid #0ba1b5; +margin-top: 10px; +margin-right: 10px; +margin: 5px; +-moz-border-radius: 4px; +-webkit-border-radius: 4px; +border-radius: 4px; +padding: 5px 5px 5px 5px +} +.ajax-file-upload-filename { +width: 100%; +height: auto; +margin: 0 5px 5px 10px; +color: #807579 +} +.ajax-file-upload-progress { +margin: 0 10px 5px 10px; +position: relative; +width: 250px; +border: 1px solid #ddd; +padding: 1px; +border-radius: 3px; +display: inline-block +} +.ajax-file-upload-bar { +background-color: #0ba1b5; +width: 0; +height: 20px; +border-radius: 3px; +color:#FFFFFF; +} +.ajax-file-upload-percent { +position: absolute; +display: inline-block; +top: 3px; +left: 48% +} +.ajax-file-upload-red { +-moz-box-shadow: inset 0 39px 0 -24px #e67a73; +-webkit-box-shadow: inset 0 39px 0 -24px #e67a73; +box-shadow: inset 0 39px 0 -24px #e67a73; +background-color: #e4685d; +-moz-border-radius: 4px; +-webkit-border-radius: 4px; +border-radius: 4px; +display: inline-block; +color: #fff; +font-family: arial; +font-size: 13px; +font-weight: normal; +padding: 4px 15px; +text-decoration: none; +text-shadow: 0 1px 0 #b23e35; +cursor: pointer; +vertical-align: top; +margin-right:5px; +} +.ajax-file-upload-green { +background-color: #77b55a; +-moz-border-radius: 4px; +-webkit-border-radius: 4px; +border-radius: 4px; +margin: 0; +padding: 0; +display: inline-block; +color: #fff; +font-family: arial; +font-size: 13px; +font-weight: normal; +padding: 4px 15px; +text-decoration: none; +cursor: pointer; +text-shadow: 0 1px 0 #5b8a3c; +vertical-align: top; +margin-right:5px; +} +.ajax-file-upload { + font-family: Arial, Helvetica, sans-serif; + font-size: 16px; + font-weight: bold; + padding: 15px 20px; + cursor:pointer; + line-height:20px; + height:25px; + margin:0 10px 10px 0; + display: inline-block; + background: #fff; + border: 1px solid #e8e8e8; + color: #888; + text-decoration: none; + border-radius: 3px; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + -moz-box-shadow: 0 2px 0 0 #e8e8e8; + -webkit-box-shadow: 0 2px 0 0 #e8e8e8; + box-shadow: 0 2px 0 0 #e8e8e8; + padding: 6px 10px 4px 10px; + color: #fff; + background: #2f8ab9; + border: none; + -moz-box-shadow: 0 2px 0 0 #13648d; + -webkit-box-shadow: 0 2px 0 0 #13648d; + box-shadow: 0 2px 0 0 #13648d; + vertical-align:middle; + } + +.ajax-file-upload:hover { + background: #3396c9; + -moz-box-shadow: 0 2px 0 0 #15719f; + -webkit-box-shadow: 0 2px 0 0 #15719f; + box-shadow: 0 2px 0 0 #15719f; +} + +.ajax-upload-dragdrop +{ + width: 100%; + border:2px dotted #A5A5C7; + color: #DADCE3; + text-align:left; + vertical-align:middle; + padding:10px 10px 0px 10px; +} + +.ajax-upload-dragdrop.state-hover +{ + border: 2px solid #A5A5C7; +} +.ajax-file-upload-error { + color: red; +} \ No newline at end of file