/** * Perform file(s) upload to the server. * * @route POST /api/v1/uploader * @authentication required */ public function store() { // TODO: to clean if (!Input::hasFile('file')) { return $this->jsonErrorResponse('"file" is required.'); } Subbly::events()->fire('subbly.upload:creating', array()); $file = Input::file('file'); $file_type = Input::get('file_type', 'product_image'); $destination = app_upload($file_type); $publicPath = public_upload($file_type); $filename = sprintf('%s.%s', uniqid(), $file->getClientOriginalExtension()); $inputFile = Input::all(); unset($inputFile['file']); $fileData = array('file' => array_merge($inputFile, array('filename' => $filename, 'file_path' => sprintf('%s/%s', $publicPath, $filename)))); $uploadSuccess = $file->move($destination, $filename); if ($uploadSuccess) { Subbly::events()->fire('subbly.upload:created', $fileData); } else { Subbly::events()->fire('subbly.upload:error', $fileData); } return $this->jsonResponse($fileData, array('status' => array('code' => 201, 'message' => 'Upload done'))); }
?> </textarea> </td> </tr> <tr> <td nowrap class="TableContent" width="150">培训要求:</td> <td colspan="3" class="TableData"> <textarea name="request" cols="60" rows="4" class="BigInput"><?php echo $user['request']; ?> </textarea> </td> </tr> <tr> <td nowrap class="TableContent" width="150">附件文档:</td> <td colspan="3" class="TableData"> <?php echo public_upload('appendix', $user['appendix']); ?> </td> </tr> </table> <table width="90%" style="border-left:#4686c6 solid 1px;border-right:#4686c6 solid 1px;" align="center"> <tr> <td nowrap class="TableContent" width="154" style="border-right:#cccccc solid 1px;">培训内容:<?php get_helps(); ?> </td> <td class="TableData" style="padding-top:10px; padding-bottom:10px; padding-left:3px;"> <script> KE.show({ id : 'content'
</td> <td class="TableData"> <input type="text" class="BigInput" name="sealtitle" value="<?php echo $user['sealtitle']; ?> " size=30 > </td> </tr> <tr> <td nowrap class="TableContent" width="120">上传印鉴:<?php get_helps(); ?> </td> <td class="TableData"> <?php echo public_upload('sealurl', $user['sealurl']); ?> 如果没有印鉴,请先制作印鉴(<a href="ntko/seal/index.php?uname=<?php echo get_realname($_USER->id); ?> &cname=<?php echo $_CONFIG->config_data('name'); ?> ">进入印鉴制作页面</a>)</td> </tr> <tr align="center" class="TableControl"> <td colspan="2" nowrap> <input type="button" value="保存" class="BigButtonBHover" onClick="sendForm();"> </td> </tr> </table>
public function getFilenameAttribute() { return public_upload('product_image/' . $this->attributes['filename']); }
<table class="TableBlock" border="0" width="90%" align="center" style="border-bottom:#4686c6 solid 0px;"> <tr> <td nowrap class="TableContent" width="15%"> 完成进度:<?php get_helps(); ?> </td> <td class="TableData"> <input type="text" name="progress" class="BigInput" size="15" value="" onKeyUp="value=value.replace(/[^0-9^.]/g,'');" /> %,注这里填写占总进度的百分之多少</td> </tr> <tr> <td nowrap class="TableContent"> 附件:</td> <td class="TableData"> <?php echo public_upload('appendix', ''); ?> </td> </tr> <tr> <td nowrap class="TableContent" width="15%"> 完成内容:<?php get_helps(); ?> </td> <td class="TableData"> <textarea name="content" cols="60" rows="5" class="BigInput"></textarea></td> </tr> <tr> <td nowrap class="TableContent" width="15%"> 备注:</td> <td class="TableData"> <textarea name="note" cols="60" rows="5" class="BigInput"></textarea></td>
</td> <td nowrap class="TableContent" width="90">姓名:<?php get_helps(); ?> </td> <td class="TableData"><?php echo $result['name']; ?> </td> </tr> <tr> <td nowrap class="TableContent" width="90">头像:</td> <td class="TableData"> <?php echo public_upload('pic', $result['pic']); ?> </td> <td nowrap class="TableContent" width="90">所属权限组:</td> <td class="TableData"><?php echo get_groupname($result['groupid']); ?> </td> </tr> <tr> <td nowrap class="TableContent" width="90">所属部门:</td> <td class="TableData"> <?php echo get_realdepaname($result['departmentid']); ?>
<td nowrap class="TableContent" width="15%"> 招聘部门:<?php get_helps(); ?> </td> <td class="TableData"> <?php get_depabox(2, "department", $blog['department'], "+选择部门", 60, 3); ?> </td> </tr> <tr> <td nowrap class="TableContent"> 附件文档:</td> <td class="TableData"> <?php echo public_upload('appendix', $blog['appendix']); ?> </td> </tr> </table> <table width="90%" style="border-left:#4686c6 solid 1px;border-right:#4686c6 solid 1px;" align="center"> <tr> <td width="15%" style="border-right:#CCCCCC solid 1px;"> 岗位要求:<?php get_helps(); ?> </td> <td width="85%" style="padding-top:10px; padding-bottom:10px; padding-left:3px;"><script charset="utf-8" src="eweb/kindeditor.js"></script> <script> KE.show({
?> </td> </tr> <tr> <td nowrap class="TableContent">附件二:</td> <td colspan="3" class="TableData"> <?php echo public_upload('file2', $appendix[1]); ?> </td> </tr> <tr> <td nowrap class="TableContent">附件三:</td> <td colspan="3" class="TableData"> <?php echo public_upload('file3', $appendix[2]); ?> </td> </tr> <tr> <td nowrap class="TableHeader" colspan="4"><b> 正文</b></td> </tr> </table> <table width="90%" style="border-left:#4686c6 solid 1px;border-right:#4686c6 solid 1px;" align="center"> <tr> <td width="124" style="border-right:#CCCCCC solid 1px;"> 内容:<?php
} elseif ($flowrow["inputtype1"] == '3') { //单选 echo get_project_radio($flowrow["inputname"], $flowrow["inputvaluenum"], $flowrow['inputvalue']); } elseif ($flowrow["inputtype1"] == '4') { //多选 echo get_project_checkbox($flowrow["inputname"], $flowrow["inputvaluenum"], $flowrow['inputvalue']); } elseif ($flowrow["inputtype1"] == '5') { //下拉 echo get_project_select($flowrow["inputname"], $flowrow["inputvaluenum"], $flowrow['inputvalue']); } } elseif ($flowrow["inputtype"] == '1') { //图片 public_upload($flowrow["inputname"], $flowrow["inputvalue"]); } elseif ($flowrow["inputtype"] == '2') { //附件 public_upload($flowrow["inputname"], $flowrow["inputvalue"]); } elseif ($flowrow["inputtype"] == '3') { //日期 echo get_project_date($flowrow["inputname"]); } elseif ($flowrow["inputtype"] == '4') { get_depabox(2, $flowrow["inputname"], "", "+选择部门", 60, 4); } elseif ($flowrow["inputtype"] == '5') { get_pubuser(2, $flowrow["inputname"], "", "+选择人员", 60, 4); } ?> </td> </tr> </table> <?php } ?>
} elseif ($row["inputtype1"] == '3') { //单选 echo get_project_radio($row["inputname"], $row["inputvaluenum"], $row['inputvalue']); } elseif ($row["inputtype1"] == '4') { //多选 echo get_project_checkbox($row["inputname"], $row["inputvaluenum"], $row['inputvalue']); } elseif ($row["inputtype1"] == '5') { //下拉 echo get_project_select($row["inputname"], $row["inputvaluenum"], $row['inputvalue']); } } elseif ($row["inputtype"] == '1') { //图片 public_upload($row["inputname"], $row["inputvalue"]); } elseif ($row["inputtype"] == '2') { //附件 public_upload($row["inputname"], $row["inputvalue"]); } elseif ($row["inputtype"] == '3') { //日期 echo get_project_date($row["inputname"]); } elseif ($row["inputtype"] == '4') { get_depabox(2, $row["inputname"], "", "+选择部门", 60, 4); } elseif ($row["inputtype"] == '5') { get_pubuser(2, $row["inputname"], "", "+选择人员", 60, 4); } ?> </td> </tr> </table> <?php } //处理多输入表单
function P_I_DB($typeid = 0, $tplid = 0, $inputname = '', $w = 0, $h = 0, $value = '', $type6 = 0) { global $db; $tpl = $db->fetch_one_array("SELECT * FROM " . DB_TABLEPRE . "project_from where typeid='" . $typeid . "' and tplid='" . $tplid . "' and inputname='" . $inputname . "' ORDER BY fromid Asc"); if ($tpl['inputtype'] == '0') { if ($tpl["inputtype1"] == '1') { echo get_project_input($tpl["inputname"], $w, $h, $tpl['inputvalue']); } elseif ($tpl["inputtype1"] == '2') { echo get_project_textarea($tpl["inputname"], $w, $h, $tpl['inputvalue']); } elseif ($tpl["inputtype1"] == '3') { echo get_project_radio($tpl["inputname"], $tpl["inputvaluenum"], $tpl['inputvalue']); } elseif ($tpl["inputtype1"] == '4') { echo get_project_checkbox($tpl["inputname"], $tpl["inputvaluenum"], $tpl['inputvalue']); } elseif ($tpl["inputtype1"] == '5') { echo get_project_select($tpl["inputname"], $tpl["inputvaluenum"], $tpl['inputvalue']); } } elseif ($tpl["inputtype"] == '1') { public_upload($tpl["inputname"], $w, $h); } elseif ($tpl["inputtype"] == '2') { public_upload($tpl["inputname"], $w, $h); } elseif ($tpl["inputtype"] == '3') { echo get_project_date($tpl["inputname"], $w, $h); } elseif ($tpl["inputtype"] == '4') { $_USER = new User(); get_depabox(1, $tpl["inputname"], get_depauseridname($_USER->id), "+选择部门", $w, $h); } elseif ($tpl["inputtype"] == '5') { get_pubuser(1, $tpl["inputname"], "", "+选择人员", $w, $h); } elseif ($tpl["inputtype"] == '6') { if ($type6 != 0) { echo '<textarea name="' . $tpl["inputname"] . '[]" style="width:' . $w . 'px;font-size:14px;" rows="' . $h . '">' . $value . '</textarea>'; } else { echo '<input type="text" name="' . $tpl["inputname"] . '[]" style="border:1px;line-height:' . $h . 'px;width:' . $w . 'px;height:' . $h . 'px;font-size:14px;" value="' . $value . '" />'; } } }
echo get_date('ymdHis', PHP_TIME); ?> " maxlength="100" /></td> </tr> <?php } ?> <tr> <td nowrap align="left" width="120" class="TableContent">姓名:</td> <td class="TableData" width="180"><input type="text" name="toa_1_1" id="toa_1_1" class="BigInput" value="<?php echo get_human_db($blog['id'], "toa_1_1"); ?> "></td> <td nowrap align="left" width="180" class="TableContent">照片:</td> <td class="TableData" width="180" colspan="3"><?php echo public_upload('toa_1_56', get_human_db($blog['id'], "toa_1_56")); ?> </td> </tr> <tr> <td nowrap align="left" width="120" class="TableContent">英文名:</td> <td class="TableData" width="180"><input type="text" name="toa_1_2" id="toa_1_2" class="BigInput" value="<?php echo get_human_db($blog['id'], "toa_1_2"); ?> "></td> <td nowrap align="left" width="180" class="TableContent">性别:</td> <td class="TableData" width="180" colspan="3"><?php echo get_human_radio('toa_1_3', get_human_form_value('toa_1_3', 1, 'inputvaluenum'), get_human_db($blog['id'], "toa_1_3")); ?> </td> </tr>
?> </td> </tr> <tr> <td nowrap class="TableContent">附件二:</td> <td colspan="3" class="TableData"> <?php echo public_upload('file2', ''); ?> </td> </tr> <tr> <td nowrap class="TableContent">附件三:</td> <td colspan="3" class="TableData"> <?php echo public_upload('file3', ''); ?> </td> </tr> <tr> <td nowrap class="TableHeader" colspan="4"><b> 正文</b></td> </tr> </table> <table width="90%" style="border-left:#4686c6 solid 1px;border-right:#4686c6 solid 1px;" align="center"> <tr> <td width="124" style="border-right:#CCCCCC solid 1px;"> 内容:<?php get_helps(); ?> </td> <td style="padding-top:10px; padding-bottom:10px; padding-left:3px;">
?> &do=excel&wid=<?php echo $_GET['wid']; ?> ">工资报表模板下载</a> </td> </tr> <tr> <tr> <td nowrap class="TableContent" width="140">上传导入文件:<?php get_helps(); ?> </td> <td class="TableData"> <?php echo public_upload('address', ''); ?> </td> </tr> <tr> <td nowrap class="TableContent" width="100">提示:</td> <td class="TableData"> 1、请导入工资报表模板后缀为".csv"文件。<br> 2、使用工资报表模板导入数据,先填内容后再导入。<br> 3、工资报表模板中,ID、姓名不能为空,也不能修改,修改或为空则不能导入。<BR> 4、导入数据执行后,之前从平台录入的信息将全部覆盖! </td> </tr> <tr align="center" class="TableControl"> <td colspan="2" nowrap>
<td class="TableData"> <select class="SelectStyle" name="documentid"> <option value="" >无目录</option> <?php GET_document_PUBLIC_LIST(0, $user['documentid'], 0, 0, $_USER->id); ?> </select></td> </tr> <tr> <td nowrap class="TableContent"> 附件:<?php get_helps(); ?> </td> <td class="TableData"> <?php echo public_upload('annex', $user['annex']); ?> </td> </tr> <?php if ($_GET["type"] != '1') { ?> <tr> <td nowrap class="TableContent"> 指定阅读人:<?php get_helps(); ?> </td> <td class="TableData"><?php get_pubuser(2, "readuser", $user['readuser'], "+选择阅读人", 60, 4); ?> <?php
function form_edit($name, $mod, $viewid) { if ($name != '') { echo '<table class="TableBlock" border="0" width="90%" align="center"> '; echo '<tr>'; echo '<td nowrap class="TableHeader" colspan="4">' . $name . '</td>'; echo '</tr>'; } else { echo '<table class="TableBlock" border="0" width="90%" style="border-top:0px;" align="center"> '; } echo '<tr>'; global $db; $num = $db->result("SELECT COUNT(*) AS num FROM " . DB_TABLEPRE . "crm_form where type1='" . $mod . "' and inputtype!='2' ORDER BY inputnumber Asc"); $query = $db->query("SELECT * FROM " . DB_TABLEPRE . "crm_form where type1='" . $mod . "' and inputtype!='2' ORDER BY inputnumber Asc"); $n = 0; while ($row = $db->fetch_array($query)) { $n++; echo '<td nowrap class="TableContent" width="15%">' . $row["formname"] . ':'; if ($row["confirmation"] == '1') { get_helps(); } echo '</td><td class="TableData">'; $name = $row["inputname"]; $value = crm_db($viewid, $row['inputname'], $mod); $w = $row["w"]; $h = $row["h"]; if ($row["type"] == '0') { if ($row["inputtype"] == '1') { echo crm_input($name, $value, $w, $h); } elseif ($row["inputtype"] == '2') { crm_textarea($name, $value, $w, $h); } elseif ($row["inputtype"] == '3') { echo crm_radio($name, $row["inputvaluenum"], $value); } elseif ($row["inputtype"] == '4') { echo crm_checkbox($name, $row["inputvaluenum"], $value); } elseif ($row["inputtype"] == '5') { echo crm_select($name, $row["inputvaluenum"], $value, $w, $h); } } elseif ($row["type"] == '1') { public_upload($name, $value, $w, $h, '图片上传'); } elseif ($row["type"] == '2') { public_upload($name, $value, $w, $h); } elseif ($row["type"] == '3') { echo crm_date($name, $w, $h, $value); } elseif ($row["type"] == '4') { if ($w == '' || $w == '0') { $w = '40'; } if ($h == '' || $h == '0') { $h = '4'; } get_depabox(2, $name, $value, "+选择部门", $w, $h); } elseif ($row["type"] == '5') { if ($w == '' || $w == '0') { $w = '40'; } if ($h == '' || $h == '0') { $h = '4'; } get_pubuser(2, $name, $value, "+选择人员", $w, $h); } echo '</td>'; if ($n % 2 == 0) { echo '</tr><tr>'; } if ($num == $n && $num % 2 != 0) { echo '<td nowrap class="TableContent" width="15%"> </td> <td class="TableData"></td>'; } } echo '</tr>'; echo '</table>'; }