function new_image($s_time){
$tc=(date('U',time())-date("U",strtotime($s_time)))/86400;
$tc_image_new='';
if($tc<=3)
$tc_image_new="
";
return $tc_image_new;
}
PS. 一天86400秒
icon finder: http://www.iconfinder.com/
您可能有興趣的書單:
function new_image($s_time){
$tc=(date('U',time())-date("U",strtotime($s_time)))/86400;
$tc_image_new='';
if($tc<=3)
$tc_image_new="
";
return $tc_image_new;
}
PS. 一天86400秒
include_once("../XXX/phpexcel/PHPExcel/IOFactory.php");
include_once('../XXX/phpexcel/PHPExcel/Reader/Excel5.php');
if($_FILES['employeeData']['name']=="" )"ERROR!!no FILE!!";
$reader = new PHPExcel_Reader_Excel5;
$PHPExcel=$reader->load($_FILES['exployxeData']['tmp_name']);
$sheet=$PHPExcel->getSheet(0);
$highestRow=$sheet->getHighestRow();
for($row=1;$row<=$highestRow;$row++){
//echo $i."$$";
$str='';
for($column=0;$column<=6;$column++){
$aa=$sheet->getCellByColumnAndRow($column,$row)->getvalue();
$temp[$column]=$aa;
if($column=='0'){
$str.="'".$aa."',";//id
$str.="'".$aa."',";//pwd
}elseif($column=='6'){
if($temp[4]==$temp[0]){
$str.="'1',";
}elseif($temp[6]=='1'){
$str.="'2',";
}else{
$str.="'0',";
}
}elseif($column=='5'){
continue;
}else{
if($aa!=''){
$str.="'".$aa."',";
}
}
}
$str=substr($str,0,strlen($str)-1);
if($row>1){
$sql="insert into Base (`ID`,`Pwd`,`Name`,`Name`,`Email`,`lID`,`role`)values($str)";
mysql_query($sql);
if(! mysql_affected_rows()>0){
echo "error:name:{$temp[1]}";
exit;
}
}
}
include_once("../class/phpexcel/PHPExcel/IOFactory.php");
$path="../download/";
$objRD=PHPExcel_IOFactory::createReader("Excel5");
$objExcel=$objRD->load($path."temp.xls");
//$CobjExcel=new PHPExcel();
//$objExcel=$CobjExcel->load($path."temp.xls");
$objExcel->setActiveSheetIndex(0);
$sheet=$objExcel->getActiveSheet();
for($i=1;$i<$num;$i++){
//if($data[$i]['enable']==0) continue; #因為sql裡面排除不了enable為0的,所以做此處理
$sheet->setCellValueByColumnAndRow(0,$colum,$searchContent[$i]['userName']);
$sheet->setCellValueByColumnAndRow(1,$colum,$searchContent[$i]['ID']);
$sheet->setCellValueByColumnAndRow(2,$colum,$searchContent[$i]['shifName']);
$colum++;
}
$objExcel=PHPExcel_IOFactory::createWriter($objExcel,'Excel5');
$filePath=$path."labor_hour.xls";
$objExcel->save($filePath);
dl_file($filePath);
<script type='text/javascript'>
function windows_close(){
window.open('','_parent','');
window.opener = null;
window.open('','_parent','');
window.close();
}
</script>
<input type='button' onclick='windows_close()' value='關閉視窗'>
ex-2<script type='text/javascript'>
function doClose(){this.close();}
</script>
include_once 'css2less/class.css2less.php';
# sample: creates less source
$css = <<< EOD
#sidebar {
padding: 0;
margin: 0;
font-size: 11px;
width: 217px;
position: absolute;
top: 45px;
left: 0;
background-color: #EFEFEF;
color: #444;
}
#sidebar h3 {
clear: both;
padding: 0;
font-size: 12px;
font-weight: bold;
}
#sidebar input[type='text'],
#sidebar input[type='password'],
#sidebar textarea {
width: 186px;
padding: 6px 5px;
color: #626262;
font-family: "Lucida Grande", "Lucida Sans", "Lucida Sans Unicode", "Luxi Sans", Tahoma, sans-serif;
font-size: 1em;
border: 1px solid #CCC;
box-shadow: inset 0 1px 3px #E4E4E4;
}
EOD;
$cls = new CSS2LESS($css);
$less = $cls->convert();
echo sprintf('<pre>%s</pre>
', $less);
a:link, a:visited, a:hover, a:active{
text-decoration:underline;
color:#6a5acd;
background-color:transparent;
}
另一個範例: a:link, a:visited{
text-decoration:underline;
color:#6a5acd;
background-color:transparent;
}
a:hover, a:active {
text-decoration:underline overline;
color:#191970;
background-color:#c9c3ed;
}