Ejemplo n.º 1
0
 public function index()
 {
     if (IS_POST) {
         $Category = M('Category');
         foreach ($_POST['sort'] as $id => $sort) {
             $Category->where(array('cateid' => $id))->save(array('sort' => $sort));
         }
         $this->success("排序更新成功!");
         exit;
     }
     $categorys = array();
     //栏目数据,可以设置为缓存的方式
     $result = D('Admins/Category')->getData();
     if (!empty($result)) {
         foreach ($result as $r) {
             $r = getCategory($r['cateid']);
             if ($r['child']) {
                 $r['yesadd'] = '';
             } else {
                 $r['yesadd'] = 'blue';
             }
             $r['status'] = showStatus($r['status']);
             if ($r['child']) {
                 $r['str_manage'] .= '<a href="' . U("Category/add", array("parentid" => $r['cateid'])) . '">添加子栏目</a> | ';
             }
             $r['str_manage'] .= '<a href="' . U("Category/edit", array("cateid" => $r['cateid'])) . '">修改</a> | <a class="J_ajax_del" data-msg="确定删除该栏目及栏目下的信息吗?" href="' . U("Category/delete", array("cateid" => $r['cateid'])) . '">删除</a>';
             //终极栏目转换
             $r['str_manage'] .= ' | <a href="' . U("Category/categoryTochild", array("cateid" => $r['cateid'])) . '">终极属性转换</a> ';
             $categorys[$r['cateid']] = $r;
         }
     }
     $str = "<tr><td align='center'><input name='sort[\$id]' type='text' size='3' value='\$sort' class='input'></td>\n\t<td align='center'>\$status</td>\n\t<td align='center'><font color='\$yesadd'>\$id</font></td>\n\t<td >\$spacer\$catename</td>\n\t<td align='center' >\$str_manage</td>\n\t</tr>";
     if (!empty($categorys) && is_array($categorys)) {
         $this->Tree->icon = array('&nbsp;&nbsp;&nbsp;│ ', '&nbsp;&nbsp;&nbsp;├─ ', '&nbsp;&nbsp;&nbsp;└─ ');
         $this->Tree->nbsp = '&nbsp;&nbsp;&nbsp;';
         $this->Tree->init($categorys);
         $categorydata = $this->Tree->get_tree(0, $str);
     } else {
         $categorydata = '';
     }
     $this->assign("categorys", $categorydata);
     $this->display();
 }
Ejemplo n.º 2
0
function updateRow_TicketDelivery($pDB, $pDB_2, $module_name)
{
    $sTicketId = trim(getParameter('ticket_id'));
    $pTicket_Delivery = new Ticket_Delivery($pDB);
    $pACL = new paloACL($pDB_2);
    $arrResult = $pTicket_Delivery->getTicket_DeliveryById($sTicketId);
    $img_dir = "modules/{$module_name}/images/";
    $value = $arrResult[0];
    $ticket = '';
    $name = $pACL->getUsers($value['accounting_id']);
    $elastix_user = is_null($value['accounting_id']) ? '(Chưa nhận)' : $name[0][1];
    // show files
    $download = '';
    foreach ($value['ticket_attachment'] as $row) {
        $url = "/modules/agent_console/ajax-attachments-handler.php?download=" . $row['filepath'] . "&name=" . $row['filename'];
        $filename = $row['filename'];
        $download .= "*<a href='{$url}' target='_blank' title='{$filename}'>" . shorten($filename) . "</a><br/>";
    }
    $print = '<a href="javascript:void(0)" onclick="print(\'' . $value['id'] . '\')"><img src="' . $img_dir . 'print.png" title="In phiếu"></a>';
    $enable = $value['isActive'] == '1' ? '<a href="javascript:void(0)" onclick="disable(\'' . $value['id'] . '\')"><img src="' . $img_dir . 'disable.png" title="Hủy yêu cầu giao vé"></a>&nbsp;' : '<a href="javascript:void(0)" onclick="enable(\'' . $value['id'] . '\')"><img src="' . $img_dir . 'enable.png" title="Tạo lại yêu cầu giao vé"></a>';
    $print .= '&nbsp;&nbsp;' . $enable;
    if ($value['isActive'] == '0') {
        $value['status'] = 'Đã hủy';
    }
    // function show base on status
    switch ($value['status']) {
        case 'Mới':
            $function = '<a href="javascript:void(1)" onclick="assign_form(\'' . $value['id'] . '\')"><img src="' . $img_dir . 'assign.png" title="Phân công"></a>';
            break;
        case 'Đang giao':
            $function = '<a href="javascript:void(1)" onclick="assign_form(\'' . $value['id'] . '\')"><img src="' . $img_dir . 'assign.png" title="Đổi phân công"></a>&nbsp;
                        <a href="javascript:void(1)" onclick="collect_form(\'' . $value['id'] . '\',\'' . $elastix_user . '\')"><img src="' . $img_dir . 'result.png" title="Kết quả"></a>';
            break;
        case 'Đã nhận tiền':
            $function = '<a href="javascript:void(1)" onclick="uncollect_form(\'' . $value['id'] . '\',\'' . $elastix_user . '\')"><img src="' . $img_dir . 'unpaid.png" title="Hủy nhận tiền"></a>';
            break;
        case 'Chờ xử lý':
            $function = '<a href="javascript:void(1)" onclick="assign_form(\'' . $value['id'] . '\')"><img src="' . $img_dir . 'assign.png" title="Phân công"></a>';
            break;
        default:
            $function = '';
    }
    // show ticket code
    foreach ($value['ticket_code'] as $row) {
        $ticket .= $row . '<br>';
    }
    // append html
    $html = '';
    $html .= '<td class="table_data">' . $value['id'] . '</td>';
    $html .= '<td class="table_data">' . $value['customer_name'] . '</td>';
    $html .= '<td class="table_data">' . $value['customer_phone'] . '</td>';
    $html .= '<td class="table_data"><span title="Chi nhánh: ' . $value['office'] . '">' . $value['agent_name'] . '</span></td>';
    $html .= '<td class="table_data">' . '<a href="javascript:void(1)" title="' . $value['deliver_address'] . '"
			                onclick="view_address(\'' . $value['deliver_address'] . '\')">' . shorten($value['deliver_address']) . '
			              </a></td>';
    $html .= '<td class="table_data">' . $value['pay_amount'] . '</td>';
    $html .= '<td class="table_data">' . $ticket . '</td>';
    $html .= '<td class="table_data">' . showStatus($value['status']) . '</td>';
    $html .= '<td class="table_data">' . $value['delivery_name'] . '</td>';
    $html .= '<td class="table_data">' . (is_null($value['delivery_date']) ? '' : date("d-m-Y H:m:s", strtotime($value['delivery_date']))) . '</td>';
    $html .= '<td class="table_data">' . $download . '</td>';
    $html .= '<td class="table_data">' . (is_null($value['collection_date']) ? '' : date("d-m-Y H:m:s", strtotime($value['collection_date']))) . '</td>';
    $html .= '<td class="table_data">' . $function . '</td>';
    $html .= '<td class="table_data"><a href="javascript:void(1)" onclick="view_log(\'' . $value['id'] . '\')">
			            <img src="' . $img_dir . 'extra.png" title="Xem chi tiết"></a></td>';
    $html .= '<td class="table_data">' . $print . '</td>';
    return $html;
}
Ejemplo n.º 3
0
</td>
                                      <td width="33%" class="<?php 
        echo $td_class;
        ?>
"><?php 
        list($year, $month, $day) = explode("-", $rsadvert->expiry_date);
        //$date = "".$day."/".$month."/".$year;
        $date = date("M d, Y", mktime(0, 0, 0, $month, $day, $year));
        echo $date;
        ?>
</td>
                                      <td width="17%" class="<?php 
        echo $td_class;
        ?>
"><?php 
        echo showStatus('code', 'code_id', $rsadvert->code_id, 'status', $rsadvert->status, 'job_voucher_code');
        ?>
</td>
                                      <td width="25%" class="<?php 
        echo $td_class;
        ?>
_end"><a href="code_add.php?action=edit&vid=<?php 
        echo $rsadvert->code_id;
        ?>
" class="paging_text">Edit</a> &nbsp;&nbsp;&nbsp;<a href="#" class="paging_text" onClick="return deletebanner(<?php 
        echo $rsadvert->code_id;
        ?>
)">Delete </a></td>
                                    </tr>
                                    <?php 
        $i++;
Ejemplo n.º 4
0
"><?php 
        echo $rsadvert->banner_title;
        ?>
</td>
                                      <td width="33%" class="<?php 
        echo $td_class;
        ?>
"><?php 
        echo $rsadvert->banner_url;
        ?>
</td>
                                      <td width="17%" class="<?php 
        echo $td_class;
        ?>
"><?php 
        echo showStatus('banner', 'banner_id', $rsadvert->banner_id, 'banner_status', $rsadvert->banner_status, 'job_banner');
        ?>
</td>
                                      <td width="25%" class="<?php 
        echo $td_class;
        ?>
_end"><a href="banner_edit.php?aid=<?php 
        echo $rsadvert->banner_id;
        ?>
" class="paging_text">Edit</a> &nbsp;&nbsp;&nbsp;<a href="#" class="paging_text" onClick="return deletebanner(<?php 
        echo $rsadvert->banner_id;
        ?>
)">Delete </a></td>
                                    </tr>
                                    <?php 
        $i++;
            ?>
</td>
				<td><?php 
            echo getNodeGroupName($vo['group_id']);
            ?>
</td>
				<td><?php 
            echo $vo['sequence'];
            ?>
</td>
				<td><?php 
            echo getStatus($vo['status']);
            ?>
</td>
				<td><?php 
            echo showStatus($vo['status'], $vo['id'], 'navTabAjaxMenu');
            ?>
 <a href="__URL__/edit/id/<?php 
            echo $vo['id'];
            ?>
" target="dialog">编辑</a></td>
			</tr><?php 
        }
    }
} else {
    echo "";
}
?>
		</tbody>
	</table>
</td>
				<td class="text-center"><input type="checkbox" name="ids" class="j-icheck" value="<?php 
            echo $vo['id'];
            ?>
">
                </td>
				<td>
                    <a href="<?php 
            echo U('edit', array('id' => $vo['id']));
            ?>
" rel="facultyedit<?php 
            echo $vo['id'];
            ?>
" class="btn bg-blue small" target="dialog" width="500px" height="280px" ><span class="button-content"><i class="glyph-icon icon-edit"></i> 编辑</span></a>
                    <?php 
            echo showStatus($vo['status'], $vo['id']);
            ?>
                    <a href="<?php 
            echo U('foreverdelete', array('id' => $vo['id']));
            ?>
" class="btn bg-red small" target="ajaxTodo" title="确定要删除该行信息吗?"><span class="button-content"><i class="glyph-icon icon-trash-o"></i> 删除</span></a>
                </td>
            </tr><?php 
        }
    }
} else {
    echo "";
}
?>
        </tbody>
    </table>
Ejemplo n.º 7
0
}
$sql = "SELECT a.id, a.customer_name, a.customer_phone, a.purchase_date, b.name as agent, a.status,\n        a.pay_amount, c.name as delivery_man, a.delivery_date, a.collection_date, a.isActive\n        FROM ticket_delivery a LEFT JOIN agent b ON a.agent_id = b.id\n        LEFT JOIN ticket_delivery_user c on a.user_id = c.id\n        {$where} {$sort} {$limit}";
$data = runSQL($sql);
//var_dump($sql);
$total = countRec("a.id", $where);
$jsonData = array('page' => $page, 'total' => $total, 'rows' => array());
foreach ($data as $row) {
    //If cell's elements have named keys, they must match column names
    //Only cell's with named keys and matching columns are order independent.
    $ticket_id = $row['id'];
    $codes = runSQL("SELECT ticket_code FROM ticket_delivery_code WHERE ticket_id='{$ticket_id}'");
    $code_list = '';
    foreach ($codes as $code) {
        $code_list .= $code['ticket_code'] . '<br/>';
    }
    $phone = '<a href="javascript:void(0)" onclick="make_call(\'' . $row['customer_phone'] . '\')"' . ">\n        <img border=0 src='modules/agent_console/images/call.png' \n\t\ttitle='Gọi số " . $row['customer_phone'] . "'/></a> " . $row['customer_phone'];
    // status "Da Huy"
    if ($row['isActive'] == '0') {
        $row['status'] = 'Đã hủy';
    }
    //date
    $delivery_man = is_null($row['delivery_man']) ? '(Chưa phân công)' : $row['delivery_man'];
    $view = '<a href="javascript:void(0)" onclick="view_delivery(\'' . $row['id'] . '\')">' . "<img src='modules/{$module_name}/images/extra.png' title='Xem chi tiết'></a>&nbsp;&nbsp;";
    $edit = '<a href="javascript:void(0)" onclick="edit_delivery(\'' . $row['id'] . '\')">' . "<img src='modules/{$module_name}/images/edit.png' title='Sửa'></a>";
    $disable = '<a href="javascript:void(0)" onclick="disable_delivery(\'' . $row['id'] . '\')">' . "<img src='modules/{$module_name}/images/disable.png' title='Hủy vé'></a>";
    $enable = '<a href="javascript:void(0)" onclick="enable_delivery(\'' . $row['id'] . '\')">' . "<img src='modules/{$module_name}/images/enable.png' title='Mở vé'></a>";
    $action = $row['isActive'] == 0 ? $enable : ($row['status'] == 'Mới' || $row['status'] == 'Chờ xử lý' ? $edit . '&nbsp' . $disable : '');
    $entry = array('id' => $row['id'], 'cell' => array('id' => $row['id'], 'agent' => $row['agent'], 'pay_amount' => $row['pay_amount'], 'status' => showStatus($row['status']), 'delivery_man' => $delivery_man, 'delivery_date' => isset($row['delivery_date']) ? date("d-m-Y h:i:s", strtotime($row['delivery_date'])) : '', 'collection_date' => isset($row['collection_date']) ? date("d-m-Y h:i:s", strtotime($row['collection_date'])) : '', 'customer_phone' => $phone, 'customer_name' => $row['customer_name'], 'purchase_date' => isset($row['purchase_date']) ? date("d-m-Y", strtotime($row['purchase_date'])) : '', 'ticket_code' => $code_list, 'action' => $view . '&nbsp' . $action));
    $jsonData['rows'][] = $entry;
}
echo $json->encode($jsonData);
Ejemplo n.º 8
0
function report_CashCollection($smarty, $module_name, $local_templates_dir, &$pDB, $pDB_2)
{
    $pCashCollection = new Cash_Collection($pDB);
    $pACL = new paloACL($pDB_2);
    // get filter parameters
    $filter = array('date_start' => trim($_POST['date_start']) == '' ? '' : date("Y-m-d", strtotime($_POST['date_start'])), 'date_end' => trim($_POST['date_end']) == '' ? '' : date("Y-m-d", strtotime($_POST['date_end'])), 'customer_name' => trim($_POST['customer_name']), 'customer_phone' => trim($_POST['customer_number']), 'ticket_code' => trim($_POST['ticket_code']), 'status' => trim($_POST['status']));
    //begin grid parameters
    $oGrid = new paloSantoGrid($smarty);
    $oGrid->setTitle("Thu tiền giao vé");
    $oGrid->pagingShow(true);
    // show paging section.
    $oGrid->enableExport();
    // enable export.
    $oGrid->setNameFile_Export("Cash_Collection");
    $url = array("menu" => $module_name);
    $oGrid->setURL($url);
    $arrColumns = array("ID", "Tên Khách Hàng", "Số điện thoại", "Ngày mua vé", "Booker", "Địa chỉ", "Tiền trả", "Mã số vé", "Tình trạng", "Nhân viên giao", "Ngày phân công", "Nhân viên nhận tiền", "Ngày nhận tiền", "   ");
    $oGrid->setColumns($arrColumns);
    $total = $pCashCollection->getNumCash_Collection($filter);
    $arrData = null;
    if ($oGrid->isExportAction()) {
        $limit = $total;
        // max number of rows.
        $offset = 0;
        // since the start.
    } else {
        $limit = 20;
        $oGrid->setLimit($limit);
        $oGrid->setTotal($total);
        $offset = $oGrid->calculateOffset();
    }
    $arrResult = $pCashCollection->getCash_Collection($limit, $offset, $filter);
    if (is_array($arrResult) && $total > 0) {
        foreach ($arrResult as $key => $value) {
            $ticket = '';
            $name = $pACL->getUsers($value['accounting_id']);
            $elastix_user = is_null($value['accounting_id']) ? '(Chưa nhận)' : $name[0][1];
            foreach ($value['ticket_code'] as $row) {
                $ticket .= $row . '<br>';
            }
            $arrTmp[0] = $value['id'];
            $arrTmp[1] = $value['customer_name'];
            $arrTmp[2] = $value['customer_phone'];
            $arrTmp[3] = is_null($value['purchase_date']) ? '' : date("d-m-Y H:m:s", strtotime($value['purchase_date']));
            $arrTmp[4] = $value['agent_name'];
            $arrTmp[5] = '<a href="javascript:void(1)" onclick="alert(\'' . $value['deliver_address'] . '\')">Xem</a>';
            $arrTmp[6] = $value['pay_amount'];
            $arrTmp[7] = $ticket;
            $arrTmp[8] = showStatus($value['status']);
            $arrTmp[9] = $value['delivery_name'];
            $arrTmp[10] = is_null($value['delivery_date']) ? '' : date("d-m-Y H:m:s", strtotime($value['delivery_date']));
            $arrTmp[11] = $elastix_user;
            $arrTmp[12] = is_null($value['collection_date']) ? '' : date("d-m-Y H:m:s", strtotime($value['collection_date']));
            $arrTmp[13] = $value['status'] == 'Đang giao' ? '<a href="javascript:void(1)" onclick="collect_form(\'' . $value['id'] . '\')">Nhận tiền</a>' : '';
            $arrData[] = $arrTmp;
        }
    }
    $oGrid->setData($arrData);
    //begin section filter
    $oFilterForm = new paloForm($smarty, createFieldFilter());
    // get delivery man list
    $delivery_man_list = $pCashCollection->getDeliveryMan();
    $smarty->assign("DELIVERY_MAN_LIST", $delivery_man_list);
    $htmlFilter = $oFilterForm->fetchForm("{$local_templates_dir}/filter.tpl", "", $_POST);
    //end section filter
    $oGrid->showFilter(trim($htmlFilter));
    $content = $oGrid->fetchGrid();
    //end grid parameters
    return $content;
}
Ejemplo n.º 9
0
             }
         }
     }
 } else {
     if ($data['tour_finished'] == "0") {
         echo "<span class='center'>Please, login for<br />register to tourney.</span>";
     } else {
         echo "Winners:<br />";
         for ($z = 1; $z <= 4; $z++) {
             $ui = dbarray(dbquery("SELECT user_name FROM " . DB_USERS . " WHERE user_id='" . $data['tour_w' . $z] . "'"));
             echo $z . ". <a href='" . BASEDIR . "profile.php?lookup=" . $data['tour_w' . $z] . "'><strong>" . $ui['user_name'] . "</strong></a><br />";
         }
     }
 }
 echo "</td></tr>";
 echo "<tr><td class='tbl2'>Status:</td><td class='tbl1'>" . showStatus($data['tour_id']) . "</td></tr>";
 echo "<tr><td class='tbl2'>Game:</td><td class='tbl1'>" . $data['tour_game'] . "</td></tr>";
 echo "<tr><td class='tbl2'>Players:<br /><i class='small'>(registered/confirmed/max)</i></td><td class='tbl1'>" . $r_ch . "/" . $r_tot . "/" . $data['tour_maxpl'] . "</td></tr>";
 echo "<tr><td class='tbl2'>Registration ends:</td><td class='tbl1'>" . date("G:i j-n-Y", $data['tour_date']) . "</td></tr>";
 echo "<tr><td class='tbl2'>Check-in start:</td><td class='tbl1'>" . date("G:i j-n-Y", $data['tour_date'] - 1800) . "</td></tr>";
 $asd = time() + ($settings['timeoffset'] + $settings['serveroffset']) * 3600;
 echo "<tr><td class='tbl2'>Current server time:<br /><i class='small'>(check your offset)</i></td><td class='tbl1'>" . date("G:i j-n-Y", $asd) . "</td></tr>";
 if (checkrights("T")) {
     echo "<tr><td class='tbl2' colspan='3'>Options: <a href='" . INFUSIONS . "al_tourney/admin/index.php" . $aidlink . "&p=newtour&a=edit&id=" . $data['tour_id'] . "''><img src='" . IMAGES . "edit.png' alt='edit tourney' /></a> <a href='" . INFUSIONS . "al_tourney/admin/index.php" . $aidlink . "&p=bracket&id=" . $data['tour_id'] . "''><img src='" . IMAGES . "arrow.png' alt='edit bracket' /></a> <a href='" . INFUSIONS . "al_tourney/admin/index.php" . $aidlink . "&p=newtour&a=delete&id=" . $data['tour_id'] . "''><img src='" . IMAGES . "no.png' alt='delete tourney' /></a></td></tr>";
 }
 if ($data['tour_grid'] == "1") {
     echo "<tr><td class='tbl2' colspan='3' align='center'><a href='" . BASEDIR . "tourney.php?p=viewbracket&id=" . $data['tour_id'] . "'>Go to brackets</a></td></tr>";
 }
 echo "<tr><td class='tbl2' colspan='3'>Description:</td></tr>";
 echo "<tr><td class='tbl1'>" . nl2br(parseubb($data['tour_desc'])) . "</td></tr>";
 echo "</table>";
Ejemplo n.º 10
0
	<?php 
    $user_path = $record->getUser()->getURL();
    ?>

	<?php 
    $judger_name = $record->getJudger()->getName();
    ?>
	<?php 
    $submit_time = $record->getSubmitTime();
    ?>
	<?php 
    $submit_time_text = $this->formatTime($submit_time);
    ?>

	<?php 
    $status_text = showStatus($record->getInfo()->status, $record->getInfo()->result_text);
    ?>

	<?php 
    $record_delete = $this->locator->getURL('admin_record_delete') . '/' . $record_id;
    ?>
	<?php 
    $record_rejudge = $this->locator->getURL('admin_record_rejudge') . '/record_id/' . $record_id;
    ?>
	<?php 
    $record_stopjudge = $this->locator->getURL('admin_record_stopjudge') . '/' . $record_id;
    ?>

	<tr>
		<td><?php 
    echo $record_id;
Ejemplo n.º 11
0
 function updateCacheHelper($recursive, $levelsLeft, $root, $showStatus, $readID3)
 {
     global $audio_types, $video_types, $ext_graphic, $default_art, $backend, $track_num_seperator, $hierarchy, $protocols;
     if ($root !== false) {
         $mediapath = $root;
     } else {
         $mediapath = $this->getFilePath();
     }
     if ($mediapath == "-") {
         // let's find it..
         $parent = $this->getParent();
         $mediapath = $parent->getFilePath() . "/" . $this->getName();
     }
     $nodepath = $this->getPath("String");
     /* Echo out our current status, if they want it: */
     if ($showStatus === true) {
         showStatus($mediapath);
     } else {
         if ($showStatus == "cli") {
             echo word("Scanning: ") . $mediapath . "\n";
         }
     }
     // First add $this.
     // Was I already cached?
     $cache = $this->readCache();
     if ($cache[0] == "-") {
         $cache[0] = $nodepath;
     }
     if ($cache[13] == "-") {
         $cache[13] = $mediapath;
     }
     if ($cache[6] == "-") {
         $cache[6] = jz_filemtime($mediapath);
     }
     if ($cache[15] == "-") {
         $ptype = findPType($this);
         $cache[15] = $ptype;
     }
     $blankfilecache = blankCache("track");
     // Recurse and add $this's media files.
     if (!($handle = opendir($mediapath))) {
         die("Could not access directory {$mediapath}");
     }
     // scan for info while going through directory:
     $trackcount = 0;
     $new_nodes = $cache[7];
     $new_tracks = $cache[8];
     $bestImage = "";
     $bestDescription = "";
     while ($file = readdir($handle)) {
         $childpath = $nodepath == "" ? $file : $nodepath . "/" . $file;
         $fullchildpath = $mediapath . "/" . $file;
         if ($file == "." || $file == "..") {
             continue;
         } else {
             if (is_dir($fullchildpath)) {
                 if ($recursive) {
                     $next =& new jzMediaNode($childpath);
                     $next->updateCacheHelper(true, $levelsLeft, $fullchildpath, $showStatus, $readID3);
                 } else {
                     if ($levelsLeft === false && $this->getNaturalDepth() > 1) {
                         $next =& new jzMediaNode($childpath);
                         $next->updateCacheHelper(false, $this->getNaturalDepth() - 2, $fullchildpath, $showStatus, $readID3);
                     } else {
                         if ($levelsLeft > 0) {
                             $next =& new jzMediaNode($childpath);
                             $next->updateCacheHelper(false, $levelsLeft - 1, $fullchildpath, $showStatus, $readID3);
                         }
                     }
                 }
                 if ($new_nodes != array()) {
                     $key = array_search($file, $new_nodes);
                     if (false === $key) {
                         $new_nodes[] = $file;
                         $next =& new jzMediaNode($childpath);
                     }
                 } else {
                     $new_nodes[] = $file;
                     $next =& new jzMediaNode($childpath);
                 }
             } else {
                 if (preg_match("/\\.(txt)\$/i", $file)) {
                     // TODO: GET THE CORRECT DESCRIPTION IN $bestDescription
                     // $bestDescription = $fullchildpath;
                 } else {
                     if (preg_match("/\\.({$ext_graphic})\$/i", $file) && !stristr($file, ".thumb.")) {
                         // An image
                         if (@preg_match("/({$default_art})/i", $file)) {
                             $bestImage = $fullchildpath;
                         } else {
                             if ($bestImage == "") {
                                 $bestImage = $fullchildpath;
                             }
                         }
                     } else {
                         if (preg_match("/\\.({$audio_types})\$/i", $file) || preg_match("/\\.({$video_types})\$/i", $file)) {
                             //* * * A track * * * *//
                             // Add it to the track list.
                             if ($new_tracks != array()) {
                                 $key = array_search($file, $new_tracks);
                                 if (false === $key) {
                                     $new_tracks[] = $file;
                                 }
                             } else {
                                 $new_tracks[] = $file;
                             }
                             // And at it's details..
                             $childnode =& new jzMediaTrack($childpath);
                             if ($cache[2] == "-" || $cache[2] < date("U", jz_filemtime($fullchildpath)) || !$childnode->readCache()) {
                                 // Add as a new/updated track.
                                 $filecache[$trackcount] = $childnode->readCache();
                                 if ($filecache[$trackcount][0] == "-") {
                                     $filecache[$trackcount][0] = $fullchildpath;
                                     $filecache[$trackcount][6] = jz_filemtime($fullchildpath);
                                     $filecache[$trackcount][2] = $file;
                                 }
                                 //////////
                                 // META //
                                 //////////
                                 $track =& new jzMediaTrack($childpath);
                                 $track->playpath = $fullchildpath;
                                 if ($readID3 === true) {
                                     $meta = $track->getMeta("file");
                                     // read meta info from the file;
                                 } else {
                                     $meta = array();
                                 }
                                 $filecache[$trackcount][7] = $meta['title'];
                                 $filecache[$trackcount][8] = $meta['frequency'];
                                 $filecache[$trackcount][9] = $meta['comment'];
                                 $filecache[$trackcount][11] = $meta['year'];
                                 $filecache[$trackcount][13] = $meta['size'];
                                 $filecache[$trackcount][14] = $meta['length'];
                                 $filecache[$trackcount][15] = $meta['genre'];
                                 $filecache[$trackcount][16] = $meta['artist'];
                                 $filecache[$trackcount][17] = $meta['album'];
                                 $filecache[$trackcount][18] = $meta['type'];
                                 $filecache[$trackcount][19] = $meta['lyrics'];
                                 $filecache[$trackcount][20] = $meta['bitrate'];
                                 $filecache[$trackcount][21] = $meta['number'];
                                 // Now let's see if there is a description file...
                                 $desc_file = str_replace("." . $meta['type'], "", $fullchildpath) . ".txt";
                                 $long_description = "";
                                 if (is_file($desc_file) and filesize($desc_file) != 0) {
                                     // Ok, let's read the description file
                                     $handle2 = fopen($desc_file, "rb");
                                     $filecache[$trackcount][10] = fread($handle2, filesize($desc_file));
                                     fclose($handle2);
                                 } else {
                                     $filecache[$trackcount][10] = "";
                                 }
                                 // Now let's see if there is a thumbnail for this track
                                 $filecache[$trackcount][1] = searchThumbnail($fullchildpath);
                             } else {
                                 // slow but necessary..
                                 //$filecache[$trackcount] = $childnode->readCache();
                             }
                             $trackcount++;
                             // Let's track this
                             writeLogData('importer', "Importing track: " . $fullchildpath);
                             $_SESSION['jz_import_full_progress']++;
                         }
                     }
                 }
             }
         }
     }
     if ($new_nodes != array()) {
         foreach ($new_nodes as $i => $my_path) {
             $me =& new jzMediaNode($nodepath . "/" . $my_path);
             if ($me->getFilePath() == "-") {
                 $arr = explode("/", $my_path);
                 $mfp = $this->getFilePath() . "/" . $arr[sizeof($arr) - 1];
             } else {
                 $mfp = $me->getFilePath();
             }
             if (!is_dir($mfp)) {
                 // TODO: The commented out part should check to see if there are 'permanent' subnodes.
                 // It is possible a directory was created to house links (and does not have
                 // any data on the filesystem)
                 $remove_me = true;
                 $list = $me->getSubNodes("tracks", -1);
                 foreach ($list as $el) {
                     if (stristr($el->getFilePath(), "://")) {
                         $remove_me = false;
                         break;
                     }
                 }
                 if ($remove_me) {
                     $me->deleteCache();
                     unset($new_nodes[$i]);
                 }
             }
         }
     }
     if ($new_tracks != array()) {
         foreach ($new_nodes as $i => $my_path) {
             $me =& new jzMediaTrack($nodepath . "/" . $my_path);
             if (!is_file($fpath = $me->getFilePath())) {
                 $valid = false;
                 $parr = explode("|", $protocols);
                 if (strlen($fpath) > 2) {
                     foreach ($parr as $p) {
                         if (stristr($fpath, $p) !== false) {
                             $valid = true;
                         }
                     }
                 }
                 if (!$valid) {
                     $me->deleteCache();
                     unset($new_tracks[$i]);
                 }
             }
         }
     }
     // Update $this
     if ($bestImage != "") {
         $cache[1] = $bestImage;
     }
     if ($bestDescription != "") {
         $cache[10] = file_get_contents($bestDescription);
     }
     $cache[2] = date("U");
     natcasesort($new_nodes);
     $cache[7] = array_values($new_nodes);
     natcasesort($new_tracks);
     $cache[8] = array_values($new_tracks);
     // * * * * * * * *
     // Write the cache.
     $this->writeCache($cache, "nodes");
     if ($filecache != array()) {
         $this->writeCache($filecache, "tracks");
     }
 }
Ejemplo n.º 12
0
    $messages = array();
    $errors = array();
    $runTestMethod = TRUE;
    if ($EXECUTE) {
        if (method_exists($class_name, 'execute')) {
            $status = call_user_func_array(array($class_name, 'execute'), array(&$messages, &$errors));
            $runTestMethod = FALSE;
        } else {
            echo "Test " . $test . " doesn't have an 'execute' option.\n";
        }
    }
    if ($runTestMethod) {
        $status = call_user_func_array(array($class_name, 'test'), array(&$messages, &$errors));
    }
    $name = call_user_func_array(array($class_name, 'getName'), array());
    showStatus($name, $status, $messages, $errors, $VERBOSE, $COLOURS);
}
//end foreach
// All done, cleaning up
$GLOBALS['SQ_SYSTEM']->restoreCurrentUser();
$GLOBALS['SQ_SYSTEM']->restoreRunLevel();
// Show stats
if ($STATS) {
    echo "Memory Usage: " . mem_check(NULL, TRUE) . "\n";
    echo "Time taken: ";
    speed_check('', FALSE, FALSE);
    echo "seconds\n";
}
//end if
exit;
/**
Ejemplo n.º 13
0
<?php

if (!defined("IN_FUSION")) {
    die("access denied");
}
$currents = dbquery("SELECT * FROM " . DB_T_TOURS . " WHERE tour_finished='0'");
opentable("Current tournies");
if (dbrows($currents)) {
    echo "<table width='95%' class='center'><tr align='center'><td class='tbl2' width='1%'><strong>#</strong></td><td class='tbl2'><strong>Name</strong></td><td class='tbl2' width='1%'><strong>Status</strong></td><td class='tbl2' width='1%'></td></tr>";
    while ($current = dbarray($currents)) {
        echo "<tr align='center'><td class='tbl1'>" . $current['tour_id'] . "</td><td class='tbl1'>" . $current['tour_name'] . "</td><td class='tbl1'>" . showStatus($current['tour_id']) . "</td><td class='tbl1'><a href='" . BASEDIR . "tourney.php?p=viewtour&id=" . $current['tour_id'] . "'>View more</a></td></tr>";
    }
    echo "</table>";
} else {
    echo "No opened tournies.";
}
closetable();
$finisheds = dbquery("SELECT tt.*, us.user_name FROM " . DB_T_TOURS . " tt LEFT JOIN " . DB_USERS . " us ON us.user_id=tt.tour_w1 WHERE tour_finished='1'");
opentable("Finished tournies");
if (dbrows($finisheds)) {
    echo "<table width='95%' class='center'><tr align='center'><td class='tbl2' width='1%'><strong>#</strong></td><td class='tbl2'><strong>Name</strong></td><td class='tbl2' width='1%'><strong>Winner</strong></td><td class='tbl2' width='1%'></td></tr>";
    while ($finished = dbarray($finisheds)) {
        echo "<tr align='center'><td class='tbl1'>" . $finished['tour_id'] . "</td><td class='tbl1'>" . $finished['tour_name'] . "</td><td class='tbl1'><a href='" . BASEDIR . "profile.php?lookup=" . $finished['tour_w1'] . "'>" . $finished['user_name'] . "</a></td><td class='tbl1'><a href='" . BASEDIR . "tourney.php?p=viewtour&id=" . $finished['tour_id'] . "'>View more</a></td></tr>";
    }
    echo "</table>";
} else {
    echo "No closed tournies.";
}
closetable();
Ejemplo n.º 14
0
	           <td class="key"><?php 
echo JText::_('JoomSEF plugin');
?>
</td>
	           <td><?php 
showStatus('plugin');
?>
</td>
	       </tr>
	       <tr>
	           <td class="key"><?php 
echo JText::_('Creation of new URLs');
?>
</td>
	           <td><?php 
showStatus('newurls');
?>
</td>
	       </tr>
	   </table>
	
	<?php 
echo $pane->endPanel();
echo $pane->endPane();
?>
    	
	<?php 
$sefConfig =& SEFConfig::getConfig();
if ($sefConfig->artioFeedDisplay) {
    echo $pane->startPane('feed-pane');
    echo $pane->startPanel(JText::_('ARTIO Newsfeed'), 'feed-panel');
Ejemplo n.º 15
0
function SERVICE_IMPORTMEDIA_filesystem($node, $root_path = false, $flags = array())
{
    global $ext_graphic, $audio_types, $video_types, $playlist_types, $default_art;
    if (!isset($playlist_types)) {
        $playlist_types = "m3u";
    }
    global $importerLevel;
    if (!isset($importerLevel)) {
        $importerLevel = 0;
    }
    $be = new jzBackend();
    if ($root_path !== false) {
        $folder = $root_path;
    } else {
        $folder = $node->getFilePath();
    }
    $bestImage = "";
    // TODO: FIX THE PARAMETER HERE FOR 3.0
    $thisPath = array_values($flags['path']);
    $parent = new jzMediaNode($thisPath);
    if (isset($flags['showstatus']) && $flags['showstatus'] && !(is_string($flags['showstatus']) && $flags['showstatus'] == "cli")) {
        if (!isset($_SESSION['jz_import_full_progress'])) {
            $_SESSION['jz_import_full_progress'] = 0;
        }
    }
    if (!($handle = opendir($folder))) {
        echo 'SERVICE_IMPORTMEDIA_filesystem: could not open ' . $folder;
        return false;
    }
    if (isset($flags['showstatus']) && is_string($flags['showstatus']) && $flags['showstatus'] == "cli") {
        echo word("Scanning: %s", $folder) . "\n";
    }
    $track_paths = array();
    $track_filenames = array();
    $track_metas = array();
    while ($file = readdir($handle)) {
        if (importSkipFile($file)) {
            continue;
        }
        $fullpath = $folder . '/' . $file;
        if (is_dir($fullpath)) {
            $entry = $be->lookupFile($fullpath);
            if ($entry === false || isset($flags['recursive']) && $flags['recursive']) {
                $flags2 = $flags;
                if (sizeof($flags2['hierarchy']) == 0) {
                    $val = 'disk';
                } else {
                    $val = array_shift($flags2['hierarchy']);
                    if ($val == 'track') {
                        $val = "disk";
                    }
                }
                $flags2['path'][$val] = $file;
                $flags2['recursive'] = true;
                $importerLevel++;
                SERVICE_IMPORTMEDIA_filesystem($node, $fullpath, $flags2);
                $importerLevel--;
            }
        } else {
            if (preg_match("/\\.({$ext_graphic})\$/i", $file) && !stristr($file, ".thumb.")) {
                // An image
                if (@preg_match("/({$default_art})/i", $file)) {
                    $bestImage = $fullpath;
                } else {
                    if ($bestImage == "") {
                        $bestImage = $fullpath;
                    }
                }
            } else {
                if (preg_match("/\\.({$playlist_types})\$/i", $file)) {
                    $ext = substr($file, strrpos($file, '.') + 1);
                    if (0 == strcasecmp($ext, 'm3u')) {
                        $m3u_lines = file($fullpath);
                        $is_local_m3u = false;
                        foreach ($m3u_lines as $line) {
                            if ($line == '#') {
                                // TODO: get metadata.
                                continue;
                            } else {
                                if (false === strpos($line, '://')) {
                                    $is_local_m3u = true;
                                    break;
                                }
                                $mediaref = $line;
                                $medianame = $mediaref;
                                while ($medianame[strlen($medianame) - 1] == '/') {
                                    $medianame = substr($medianame, 0, strlen($medianame) - 1);
                                }
                                $medianame = substr($medianame, strrpos($medianame, '/') + 1);
                                $mypath = $flags['path'];
                                $mypath['track'] = $medianame;
                                $track_paths[] = $mypath;
                                $track_filenames[] = $mediaref;
                                $track_metas[] = array();
                            }
                        }
                    }
                } else {
                    if (preg_match("/\\.({$audio_types})\$/i", $file) || preg_match("/\\.({$video_types})\$/i", $file)) {
                        $entry = $be->lookupFile($fullpath);
                        if (isset($flags['showstatus']) && !(is_string($flags['showstatus']) && $flags['showstatus'] == "cli")) {
                            if ($_SESSION['jz_import_full_progress'] % 50 == 0 or $_SESSION['jz_import_full_progress'] == 0 or $_SESSION['jz_import_full_progress'] == 1) {
                                showStatus();
                            }
                            $_SESSION['jz_import_full_progress']++;
                        }
                        if (isset($flags['force']) && $flags['force'] || !is_array($entry)) {
                            $mypath = $flags['path'];
                            $mypath['track'] = $file;
                            if (isset($flags['readtags']) && $flags['readtags']) {
                                $track =& new jzMediaTrack($fullpath);
                                $track->playpath = $fullpath;
                                $meta = $track->getMeta("file");
                            } else {
                                $meta = false;
                            }
                            $track_paths[] = $mypath;
                            $track_filenames[] = $fullpath;
                            $track_metas[] = $meta;
                        }
                    }
                }
            }
        }
    }
    $node->bulkInject($track_paths, $track_filenames, $track_metas);
    if ($bestImage != "") {
        $parent->addMainArt($bestImage);
    }
    $be->registerFile($folder, $thisPath);
    if ($parent->getFilePath() != $folder) {
        $parent->setFilePath($folder);
    }
    if ($importerLevel == 0) {
        $be->removeDeadFiles($folder, $flags['recursive']);
    }
}
Ejemplo n.º 16
0
    ?>
	<?php 
    $user_path = $record->getUser()->getURL();
    ?>

	<?php 
    $judger_name = $record->getJudger()->getName();
    ?>
	<?php 
    $submit_time_text = $this->formatTime($record->getSubmitTime());
    ?>

	<?php 
    $status_text = '隱藏';
    if ($record->canView('result')) {
        $status_text = showStatus($record->getStatus(), $record->getResultText());
    }
    ?>
	<tr>
		<td><?php 
    echo $record->getID();
    ?>
</td>
		<td><a href='<?php 
    echo $record->getURL();
    ?>
'><?php 
    echo $status_text;
    ?>
</a></td>
		<td><a href='<?php 
Ejemplo n.º 17
0
    ?>
        [
            "<input type='checkbox' name='row_sel' class='inpt_c1' value='<?php 
    echo $item->mid;
    ?>
'>",
            "<?php 
    echo $item->name;
    ?>
",
            "<?php 
    echo $item->title;
    ?>
",
            "<?php 
    echo showStatus('marketStatus', $item->mstatus);
    ?>
",
            "<a href='<?php 
    echo site_url("admin/marketing/view/" . $item->mid);
    ?>
'><?php 
    echo lang("view");
    ?>
</a>&nbsp;&nbsp;<a href='<?php 
    echo site_url("admin/marketing/edit/" . $item->mid);
    ?>
'><?php 
    echo lang("edit");
    ?>
</a>"
Ejemplo n.º 18
0
/** Updates a node's cache nonrecursively.
 *
 * @author Ben Dodson
 */
function updateNodeCache($node, $recursive = false, $showStatus = false, $force = false, $readTags = true, $root_path = false)
{
    global $media_dirs, $live_update, $jzSERVICES, $hierarchy, $backend, $default_importer, $jukebox, $include_path;
    $flags = array();
    $flags['showstatus'] = $showStatus;
    $flags['force'] = $force;
    $flags['readtags'] = $readTags;
    $flags['recursive'] = $recursive;
    $importer = $default_importer;
    // TODO: more dynamic choice of importer.
    if (false !== stristr($importer, "id3tags")) {
        // id3tag importer doesn't care about your hierarchy.
        // TODO: seperate hierarchy for display / import.
    } else {
        // TODO: Remove this stuff once we have a propper way
        // of getting the path from the node. Make
        // the function recursive with respect to the node.
        $mypath = array();
        if (false !== ($val = getInformation($node, "genre"))) {
            $mypath['genre'] = $val;
        }
        if (false !== ($val = getInformation($node, "subgenre"))) {
            $mypath['subgenre'] = $val;
        }
        if (false !== ($val = getInformation($node, "artist"))) {
            $mypath['artist'] = $val;
        }
        if (false !== ($val = getInformation($node, "album"))) {
            $mypath['album'] = $val;
        }
        if (false !== ($val = getInformation($node, "disk"))) {
            $mypath['disk'] = $val;
        }
        $flags['path'] = $mypath;
        $flags['hierarchy'] = array_slice($hierarchy, sizeof($mypath), sizeof($hierarchy) - sizeof($mypath));
    }
    $jzSERVICES->loadService("importing", $importer);
    // TODO: Move flags array into parameters of this function.
    /*if ($flags['recursive']) {
    		@ini_set("max_execution_time","0");
    		@ini_set("memory_limit","64");
    	}*/
    if ($node->getLevel() == 0 && $root_path === false) {
        $mediapaths = explode("|", $media_dirs);
        for ($i = 0; $i < sizeof($mediapaths); $i++) {
            if (is_dir($mediapaths[$i]) && $mediapaths[$i] != "/" && $mediapaths[$i] != "") {
                //$node->updateCache($recursive,$mediapaths[$i], $showStatus,$force,$readTags);
                $jzSERVICES->importMedia($node, $mediapaths[$i], $flags);
            }
        }
    } else {
        //$node->updateCache($recursive,$root_path,$showStatus,$force, $readTags);
        $jzSERVICES->importMedia($node, $root_path, $flags);
        if ($recursive === false && $node->getSubNodeCount('tracks', -1) == 0) {
            //$node->updateCache(true,$root_path,$showStatus,$force,$readTags);
            $flags['recursive'] = true;
            $jzSERVICES->importMedia($node, $root_path, $flags);
        }
    }
    if ($showStatus == true) {
        showStatus();
    }
    if ($jukebox == "true") {
        include_once $include_path . "jukebox/class.php";
        $jb = new jzJukebox();
        $jb->updateDB($node, $recursive, $root_path);
    }
}
Ejemplo n.º 19
0
            $td_class = "table_alternate_row";
        }
        ?>
                                    <tr align="left">
                                      <td width="60%" class="<?php 
        echo $td_class;
        ?>
"><?php 
        echo $rsLetter->title;
        ?>
</td>
                                      <td width="20%" class="<?php 
        echo $td_class;
        ?>
"><?php 
        echo showStatus('letter', 'letter_id', $rsLetter->letter_id, 'letter_status', $rsLetter->letter_status, 'job_cover_letters');
        ?>
</td>
                                      <td width="20%" class="<?php 
        echo $td_class;
        ?>
_end"><a href="letter_edit.php?letter_id=<?php 
        echo $rsLetter->letter_id;
        ?>
" class="paging_text">Edit</a> &nbsp;&nbsp;&nbsp;<a href="#" class="paging_text" onClick="return deleteLetter(<?php 
        echo $rsLetter->letter_id;
        ?>
)">Delete </a></td>
                                    </tr>
                                    <?php 
        $i++;
Ejemplo n.º 20
0
        echo "No";
    }
    ?>
</td>
                                  <td width="4%" class="<?php 
    echo $td_class;
    ?>
"><a href="../utility/rec_profile.php?rec_id=<?php 
    echo $rsRec->rec_id;
    ?>
" class="paging_text" title="Edit Profile">Edit</a></td>
                                  <td width="5%" class="<?php 
    echo $td_class;
    ?>
"><?php 
    echo showStatus('employer', 'rec_id', $rsRec->rec_id, 'rec_status', $rsRec->rec_status, 'job_recruiter');
    ?>
</td>
                                  <td width="10%" class="<?php 
    echo $td_class;
    ?>
"><a href="#" onClick="viewDetails('view_profile.php?rec_id=<?php 
    echo $rsRec->rec_id;
    ?>
&rec_status=<?php 
    echo $rr_st;
    ?>
');" class="paging_text">Detail View </a></td>
								   <td width="9%" class="<?php 
    echo $td_class;
    ?>
Ejemplo n.º 21
0
"><?php 
        echo $rsadvert->title;
        ?>
</td>
                                      <td width="33%" class="<?php 
        echo $td_class;
        ?>
"><?php 
        echo $rsadvert->url;
        ?>
</td>
                                      <td width="17%" class="<?php 
        echo $td_class;
        ?>
"><?php 
        echo showStatus('advert', 'site_id', $rsadvert->site_id, 'status', $rsadvert->status, 'job_top_sites');
        ?>
</td>
                                      <td width="25%" class="<?php 
        echo $td_class;
        ?>
_end"><a href="advert_edit.php?aid=<?php 
        echo $rsadvert->site_id;
        ?>
" class="paging_text">Edit</a> &nbsp;&nbsp;&nbsp;<a href="#" class="paging_text" onClick="return deleteadvert(<?php 
        echo $rsadvert->site_id;
        ?>
)">Delete </a></td>
                                    </tr>
                                    <?php 
        $i++;
Ejemplo n.º 22
0
<div id="content_wrapper">
	<div id="main_content" class="cf">
		<div class="cf">
			<div class="dp100">
				<div class="box_c">
					<div class="box_c_heading cf"><?php 
echo $marketingSpot['name'];
?>
</div>
					<div class="box_c_content cf">
						<?php 
echo lang('b_mkt_spot_mstatus') . ':' . showStatus('marketStatus', $marketingSpot['mstatus']);
?>
<br/>
						<?php 
echo lang('b_mkt_spot_template') . ':' . $marketingSpot['title'];
?>
<br/>
						<?php 
echo lang('b_mkt_spot_description') . ':' . $marketingSpot['description'];
?>
<br/>
					</div>
				</div>
			</div>
		</div>
		
		<h2><?php 
echo lang('admin_tools_marketing_pic_list');
?>
</h2>
Ejemplo n.º 23
0
/images/<?php 
    echo $rsLang->language_icon;
    ?>
"></td>
                                  <td width="7%" align="center" class="<?php 
    echo $td_class;
    ?>
"><?php 
    echo $rsLang->currency;
    ?>
</td>
                                  <td width="11%" align="center" class="<?php 
    echo $td_class;
    ?>
"><?php 
    echo showStatus('Language', 'id', $rsLang->id, 'status', $rsLang->status, 'job_language');
    ?>
</td>
                                  <td width="8%" align="center"  class="<?php 
    echo $td_class;
    ?>
">
								  <a class="paging_text" href="#">Edit </a>
								  </td>
								  <td width="11%" align="center" class="<?php 
    echo $td_class;
    ?>
_end">
								  <a class="paging_text"  onClick = "remove_single_language('<?php 
    echo $rsLang->id;
    ?>
Ejemplo n.º 24
0
function SERVICE_IMPORTMEDIA_id3tags($node, $root_path = false, $flags = array())
{
    global $ext_graphic, $default_art, $audio_types, $video_types;
    $be = new jzBackend();
    $root = new jzMediaNode();
    if (isset($flags['recursive']) && $flags['recursive'] === false || $root_path === false) {
        /*
        if ($node === false) { $node = new jzMediaNode(); }
        $tracks = $node->getSubNodes("tracks");
        foreach ($tracks as $track) {
        	$fname = $track->getFileName("host");
        	$entry = $be->lookupFile($fname);
        	if (!is_array($entry)) {
        		echo "Error in SERVICE_IMPORTMEDIA_id3tags. File added but does not exist in registry.";
        		return;
        	}
        	if ($entry['fs_sync'] && !file_exists($fname)) {
        		$be->unregisterFile($fname);
        		$root->removeMedia($track);
        	}
        	// TODO: CHECK THE ABOVE!!! CHECK UNREGISTERFILE!
        	// TODO: check modified time and move file if needed.
        }
        */
        return false;
    }
    $directory_list = array();
    $directory_list[] = $root_path;
    if (isset($flags['showstatus']) && $flags['showstatus'] && !(is_string($flags['showstatus']) && $flags['showstatus'] == "cli")) {
        $_SESSION['jz_import_full_progress'] = 0;
    }
    while (sizeof($directory_list) > 0) {
        $cur_dir = array_shift($directory_list);
        if (isset($flags['showstatus']) && is_string($flags['showstatus']) && $flags['showstatus'] == "cli") {
            echo word("Scanning: %s", $cur_dir) . "\n";
        }
        $bestImage = "";
        $albums = array();
        $track_paths = array();
        $track_filenames = array();
        $track_metas = array();
        if (!($handle = opendir($cur_dir))) {
            continue;
        }
        //die("Could not access directory $dir");
        while ($file = readdir($handle)) {
            if ($file == "." || $file == "..") {
                continue;
            }
            $fullpath = $cur_dir . "/" . $file;
            if (is_dir($fullpath)) {
                $directory_list[] = $fullpath;
            } else {
                if (preg_match("/\\.({$ext_graphic})\$/i", $file) && !stristr($file, ".thumb.")) {
                    // An image
                    if (@preg_match("/({$default_art})/i", $file)) {
                        $bestImage = $fullpath;
                    } else {
                        if ($bestImage == "") {
                            $bestImage = $fullpath;
                        }
                    }
                } else {
                    if (preg_match("/\\.({$audio_types})\$/i", $file) || preg_match("/\\.({$video_types})\$/i", $file)) {
                        $entry = $be->lookupFile($fullpath);
                        if (isset($flags['showstatus']) && $flags['showstatus'] && !(is_string($flags['showstatus']) && $flags['showstatus'] == "cli")) {
                            if ($_SESSION['jz_import_full_progress'] % 50 == 0 or $_SESSION['jz_import_full_progress'] == 0 or $_SESSION['jz_import_full_progress'] == 1) {
                                showStatus();
                            }
                            $_SESSION['jz_import_full_progress']++;
                        }
                        if (is_array($entry) && $entry['added'] < filemtime($fullpath)) {
                            // moved file
                            $track =& new jzMediaTrack($fullpath);
                            $track->playpath = $fullpath;
                            $meta = $track->getMeta("file");
                            $arr = array();
                            if (isset($meta['genre'])) {
                                $arr['genre'] = $meta['genre'];
                            }
                            if (isset($meta['subgenre'])) {
                                $arr['subgenre'] = $meta['subgenre'];
                            }
                            if (isset($meta['artist'])) {
                                $arr['artist'] = $meta['artist'];
                            }
                            if (isset($meta['album'])) {
                                $arr['album'] = $meta['album'];
                            }
                            if (isset($meta['disk'])) {
                                $arr['disk'] = $meta['disk'];
                            }
                            if (isset($meta['filename'])) {
                                $arr['track'] = $meta['filename'];
                            }
                            $old = new jzMediaTrack($entry['path']);
                            $child = $root->moveMedia($old, $arr);
                            if ($child !== false) {
                                $album = $child->getAncestor("album");
                                if ($album !== false) {
                                    $albums[$album->getPath("String")] = true;
                                }
                            }
                        } else {
                            if ($entry === false || isset($flags['force']) && $flags['force'] === true) {
                                // Set path so when getFileName is called and the filepath was not found,
                                // we get the correct path.
                                $track =& new jzMediaTrack($fullpath);
                                $track->playpath = $fullpath;
                                $meta = $track->getMeta("file");
                                $arr = array();
                                if (isset($meta['genre'])) {
                                    $arr['genre'] = $meta['genre'];
                                }
                                if (isset($meta['subgenre'])) {
                                    $arr['subgenre'] = $meta['subgenre'];
                                }
                                if (isset($meta['artist'])) {
                                    $arr['artist'] = $meta['artist'];
                                }
                                if (isset($meta['album'])) {
                                    $arr['album'] = $meta['album'];
                                }
                                if (isset($meta['disk'])) {
                                    $arr['disk'] = $meta['disk'];
                                }
                                if (isset($meta['filename'])) {
                                    $arr['track'] = $meta['filename'];
                                }
                                $track_paths[] = $arr;
                                $track_filenames[] = $fullpath;
                                $track_metas[] = $meta;
                            }
                        }
                    }
                }
            }
        }
        // while reading dir
        $art_dir = dirname(__FILE__) . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . "data" . DIRECTORY_SEPARATOR . "images" . DIRECTORY_SEPARATOR;
        if (sizeof($track_paths) > 0) {
            $results = $root->bulkInject($track_paths, $track_filenames, $track_metas);
            for ($i = 0; $i < sizeof($results); $i++) {
                if ($results[$i] !== false) {
                    $album = $results[$i]->getAncestor("album");
                    if ($album !== false) {
                        $albums[$album->getPath("String")] = true;
                        $newalbum = new jzMediaNode($album->getPath("String"));
                        // If we have album art in the tag, add it.
                        if ($track_metas[$i]['pic_data'] != "") {
                            $artloc = realpath($art_dir) . DIRECTORY_SEPARATOR . "art_" . $newalbum->getID() . ".jpg";
                            if ($artloc !== false) {
                                $filehandle = fopen($artloc, "wb");
                                fwrite($filehandle, $track_metas[$i]['pic_data']);
                                fclose($filehandle);
                                $newalbum->addMainArt("data" . DIRECTORY_SEPARATOR . "images" . DIRECTORY_SEPARATOR . "art_" . $newalbum->getID() . ".jpg");
                            }
                        }
                    }
                }
            }
        }
    }
    if (isset($flags['showstatus']) && is_string($flags['showstatus']) && $flags['showstatus'] == "cli") {
        echo word("Scanning for removed media.") . "\n";
    }
    $be->removeDeadFiles();
}
            echo $user["id"];
            ?>
"></td><td><?php 
            echo $user["id"];
            ?>
</td><td><a href="javascript:edit('<?php 
            echo addslashes($user["id"]);
            ?>
')" style="color:blue"><?php 
            echo $user["name"];
            ?>
</a></td><td><?php 
            echo $user["sort"];
            ?>
</td><td  style="text-align:left;height:auto;padding-left:8px;"> <?php 
            echo showStatus($user["status"], $user['id']);
            ?>
&nbsp;<a href="javascript:edit('<?php 
            echo $user["id"];
            ?>
')">编辑</a>&nbsp;<a href="javascript:typeset('<?php 
            echo $user["id"];
            ?>
')">排版</a>&nbsp;</td></tr><?php 
        }
    }
} else {
    echo "";
}
?>
</table>
Ejemplo n.º 26
0
require_once 'commandLine.inc';
if (count($argv) == 0) {
    echo "Available actions: status, check <ip>\n";
    exit(0);
}
function showStatus()
{
    try {
        $ret = MWBlocker::getStatus();
        echo $ret . "\n";
    } catch (MWEexception $e) {
        die($e->getMessage() . "\n");
    }
}
switch ($argv[count($argv) - 1]) {
    case "status":
        showStatus();
        break;
    case "check":
        try {
            MWBlocker::queueCheck($argv[1], "command-line check");
        } catch (MWEexception $e) {
            die($e->getMessage() . "\n");
        }
        showStatus();
        break;
    default:
        echo "Unrecognized verb.\n";
        exit(-1);
}
</td>
                <td><input type="checkbox" name="ids" class="j-icheck" value="<?php 
            echo $vo['id'];
            ?>
"></td>
                <td>
                <div class="mrg0A">
                 <a href="<?php 
            echo U('edit', array('id' => $vo['id']));
            ?>
" rel="editstudent<?php 
            echo $vo['id'];
            ?>
"   class="btn small bg-blue" target="dialog"  width="440px" height="400px" ><span class="button-content"><i class="glyph-icon icon-edit"></i> 编辑</span></a>
                    <?php 
            echo showStatus($vo['status'], $vo['id'], CONTROLLER_NAME);
            ?>
                    <a href="<?php 
            echo U('foreverdelete', array('id' => $vo['id']));
            ?>
" class="btn small bg-red" target="ajaxTodo" title="确定要删除该行信息吗?"><span class="button-content"><i class="glyph-icon icon-trash-o"></i> 删除</span></a>
                    </div>
                </td>
            </tr><?php 
        }
    }
} else {
    echo "";
}
?>
        </tbody>
Ejemplo n.º 28
0
 /**
  * Updates the cache using $this as the base node.
  * 
  * @author Ben Dodson <*****@*****.**>
  * @version 11/12/04
  * @since 5/13/04
  */
 function updateCacheHelper(&$be, &$link, $recursive, $root, $showStatus, $force = false, $readTags = true)
 {
     global $sql_usr, $sql_type, $sql_pw, $sql_socket, $sql_db, $audio_types, $video_types, $playlist_types, $ext_graphic, $default_art, $track_num_seperator, $hierarchy, $backend;
     // Make upgrades work.
     // This should be a more general routine,
     // like getSetting("playlist_types");
     if (!isset($playlist_types)) {
         $playlist_types = "m3u";
     }
     // The database adaptor builds itself based on the filesystem.
     if ($root !== false) {
         $media_dir = $root;
     } else {
         $media_dir = $this->getFilePath();
     }
     if (!is_readable($media_dir)) {
         return false;
     }
     $mySlashedName = jz_db_escape($this->getName());
     $pathArray = $this->getPath();
     $nodePath = $this->getPath("String");
     $slashedNodePath = jz_db_escape($nodePath);
     // SQL no likey the quotes.
     $fullSlashedNodePath = jz_db_escape($media_dir);
     $level = $this->getLevel();
     $ptype = findPType($this);
     /* Echo out our current status, if they want it: */
     if ($showStatus === true) {
         showStatus($media_dir);
     } else {
         if ($showStatus == "cli") {
             echo word("Scanning: ") . $media_dir . "\n";
         }
     }
     // Now handle $this.
     $mdate = filemtime($media_dir);
     if ($mdate > ($curtime = time())) {
         if (@touch($media_dir) === false) {
             $mdate = $curtime - ($mdate - $curtime);
         } else {
             $mdate = filemtime($media_dir);
         }
     }
     $stamp = $be->getUpdated($media_dir);
     $sql = "INSERT INTO jz_nodes(name,path,filepath,ptype,level,date_added,my_id) ";
     $sql .= "VALUES('{$mySlashedName}','{$slashedNodePath}','{$fullSlashedNodePath}','{$ptype}',{$level},'{$mdate}','" . uniqid("T") . "')";
     // ADD MORE INFO TO DB.
     if (!jz_db_query($link, $sql)) {
         // the node was already in the database.
         $sql = "UPDATE jz_nodes SET valid = 'true' ";
         $sql .= "WHERE path " . jz_db_case_sensitive() . " '{$slashedNodePath}'";
         jz_db_query($link, $sql);
     }
     writeLogData('importer', "Importing node: " . $mySlashedName . " - " . $fullSlashedNodePath);
     // Now move inside $this's path.
     if (!($handle = opendir($media_dir))) {
         die("Could not access directory {$media_dir} in database::updateCacheHelper.");
     }
     // let's look for the best files to use while we are scanning this directory:
     $leafcount = 0;
     $nodecount = 0;
     $bestImage = "";
     $bestDescription = "";
     while ($file = readdir($handle)) {
         $nextPath = $nodePath == "" ? $file : $nodePath . "/" . $file;
         $nextFile = $media_dir . "/" . $file;
         $slashedNextFile = jz_db_escape($nextFile);
         $slashedFileName = jz_db_escape($file);
         $slashedFilePath = jz_db_escape($nextPath);
         if ($file == "." || $file == "..") {
             continue;
         } else {
             if (is_dir($nextFile)) {
                 $next =& new jzMediaNode($nextPath);
                 if ($recursive) {
                     $next->updateCacheHelper($be, $link, true, $nextFile, $showStatus, $force, $readTags);
                 } else {
                     // NOT RECURSIVE, just mark as valid, or add if it wasn't there.
                     $sdate = filemtime($nextFile);
                     if ($sdate > ($curtime = time())) {
                         if (@touch($nextFile) === false) {
                             $sdate = $curtime - ($sdate - $curtime);
                         } else {
                             $sdate = filemtime($nextFile);
                         }
                     }
                     $spt = findPType($next);
                     if ($backend == "mysql") {
                         $n1 = jz_db_query($link, "SELECT COUNT(*) FROM jz_nodes WHERE path LIKE '{$slashedFilePath}'");
                         $n2 = jz_db_query($link, "SELECT COUNT(*) FROM jz_nodes WHERE path LIKE BINARY '{$slashedFilePath}'");
                         if ($n1->data[0][0] - $n2->data[0][0] > 0) {
                             // A folder was renamed.
                             jz_db_query($link, "DELETE FROM jz_nodes WHERE path LIKE '{$slashedFilePath}%'");
                         }
                     }
                     $sqln = "INSERT INTO jz_nodes(name,path,filepath,ptype,level,date_added,my_id)";
                     $sqln .= " VALUES('{$slashedFileName}','{$slashedFilePath}','{$slashedNextFile}','{$spt}',{$level}+1,'{$sdate}','" . uniqid("T") . "')";
                     $sqlu = "UPDATE jz_nodes SET valid = 'true' ";
                     $sqlu .= "WHERE path " . jz_db_case_sensitive() . " '{$slashedFilePath}'";
                     jz_db_query($link, $sqln) || jz_db_query($link, $sqlu);
                 }
                 $nodecount++;
             } else {
                 // is a regular file.
                 // That means check for media file (leaf),
                 // or picture or text for $this.
                 if (preg_match("/\\.(txt)\$/i", $file)) {
                     // TODO: GET THE CORRECT DESCRIPTION IN $bestDescription
                     // $bestDescription = $slashedNodePath . "/" . jz_db_escape($file);
                     // This will need testing...
                     $descFile = $media_dir . "/" . jz_db_escape($file);
                     if (is_file($descFile)) {
                         $bestDescription = jz_db_escape(nl2br(implode("\n", @file($descFile))));
                     }
                 }
                 if (preg_match("/\\.({$ext_graphic})\$/i", $file) && !stristr($file, ".thumb.")) {
                     $fav_image_name = $default_art;
                     // An image
                     if (@preg_match("/({$fav_image_name})/i", $file)) {
                         $bestImage = $slashedNextFile;
                     } else {
                         if ($bestImage == "") {
                             $bestImage = $slashedNextFile;
                         }
                     }
                 } else {
                     if (preg_match("/\\.({$playlist_types})\$/i", $file)) {
                         echo 'm3u: ' + $file;
                         $ext = substr($file, strrpos($file, '.') + 1);
                         if (0 == strcasecmp($ext, 'm3u')) {
                             $m3u_lines = file($nextFile);
                             $is_local_m3u = false;
                             foreach ($m3u_lines as $line) {
                                 if ($lines[0] == '#') {
                                     // TODO: get metadata.
                                     continue;
                                 } else {
                                     if (false === strpos($lines[0], '://')) {
                                         $is_local_m3u = true;
                                         break;
                                     }
                                     $mediaref = $lines[0];
                                     // add to DB
                                     $mdate = filemtime($nextFile);
                                     if ($mdate > ($curtime = time())) {
                                         if (@touch($nextFile) === false) {
                                             $mdate = $curtime - ($mdate - $curtime);
                                         } else {
                                             $mdate = filemtime($nextFile);
                                         }
                                     }
                                     $leafcount++;
                                     addWebTrack($mediaref, $nodePath, $mdate, $level, $link);
                                 }
                             }
                         }
                     } else {
                         if (preg_match("/\\.({$audio_types})\$/i", $file) || preg_match("/\\.({$video_types})\$/i", $file)) {
                             // A media file
                             // add it as an element.
                             $leafcount++;
                             $mdate = filemtime($nextFile);
                             if ($mdate > ($curtime = time())) {
                                 if (@touch($nextFile) === false) {
                                     $mdate = $curtime - ($mdate - $curtime);
                                 } else {
                                     $mdate = filemtime($nextFile);
                                 }
                             }
                             // First, try putting me in the DB.
                             $slashedFileName = jz_db_escape($file);
                             $slashedFilePath = $slashedNodePath == "" ? $slashedFileName : $slashedNodePath . "/" . $slashedFileName;
                             $fullSlashedFilePath = jz_db_escape($media_dir) . "/" . $slashedFileName;
                             $mid = uniqid("T");
                             $sql = "INSERT INTO jz_nodes(name,path,filepath,ptype,level,date_added,leaf,my_id) ";
                             $sql .= "VALUES('{$slashedFileName}','{$slashedFilePath}','{$fullSlashedFilePath}','track',{$level}+1,'{$mdate}','true','" . $mid . "') ";
                             $updatesql = "UPDATE jz_nodes SET valid = 'true' WHERE path " . jz_db_case_sensitive() . " '{$slashedFilePath}'";
                             jz_db_query($link, $sql) || jz_db_query($link, $updatesql);
                             // Now, did they want to force this?
                             if ($stamp < $mdate or $force) {
                                 $track =& new jzMediaTrack($nextPath);
                                 $track->filepath = $track->getPath("String");
                                 $track->playpath = $nextFile;
                                 if ($readTags === true) {
                                     $meta = $track->getMeta("file");
                                     // read meta info from the file;
                                 } else {
                                     $meta = array();
                                     $meta['bitrate'] = "";
                                     $meta['length'] = "";
                                     $meta['size'] = "";
                                     $meta['title'] = "";
                                     $meta['artist'] = "";
                                     $meta['album'] = "";
                                     $meta['year'] = "";
                                     $meta['number'] = "";
                                     $meta['genre'] = "";
                                     $meta['frequency'] = "";
                                     $meta['comment'] = "";
                                     $meta['lyrics'] = "";
                                     $meta['type'] = "";
                                 }
                                 $pname = jz_db_escape($file);
                                 $bitrate = $meta['bitrate'];
                                 $length = $meta['length'];
                                 $filesize = $meta['size'];
                                 $name = jz_db_escape($meta['title']);
                                 $artist = jz_db_escape($meta['artist']);
                                 $album = jz_db_escape($meta['album']);
                                 $year = jz_db_escape($meta['year']);
                                 $track = $meta['number'];
                                 $genre = jz_db_escape($meta['genre']);
                                 $frequency = $meta['frequency'];
                                 $description = jz_db_escape($meta['comment']);
                                 $lyrics = jz_db_escape($meta['lyrics']);
                                 $fileExt = $meta['type'];
                                 // Now let's see if there is a description file...
                                 $desc_file = str_replace("." . $fileExt, "", $media_dir . "/" . $file) . ".txt";
                                 $long_description = "";
                                 if (@is_file($desc_file) and filesize($desc_file) != 0) {
                                     // Ok, let's read the description file
                                     $handle2 = fopen($desc_file, "rb");
                                     $long_description = jz_db_escape(fread($handle2, filesize($desc_file)));
                                     fclose($handle2);
                                 }
                                 // Now let's see if there is a thumbnail for this track
                                 $thumb_file = jz_db_escape(searchThumbnail($media_dir . "/" . $file));
                                 $sql = "INSERT INTO jz_tracks(path,level,my_id,filepath,name,trackname,bitrate,filesize,frequency,length,lyrics,genre,artist,album,year,number,extension)\n\t\t\t       VALUES('{$slashedFilePath}',{$level}+1,'" . $mid . "','{$fullSlashedFilePath}','{$pname}','{$name}','{$bitrate}','{$filesize}','{$frequency}','{$length}','{$lyrics}','{$genre}','{$artist}','{$album}','{$year}','{$track}','{$fileExt}')";
                                 // Now let's update status and log this
                                 if (isset($_SESSION['jz_import_full_progress'])) {
                                     $_SESSION['jz_import_full_progress']++;
                                 } else {
                                     $_SESSION['jz_import_full_progress'] = 1;
                                 }
                                 writeLogData('importer', "Importing track: " . $fullSlashedFilePath);
                                 $updatesql = "UPDATE jz_tracks SET valid = 'true',\n\t\t\t\t\tlevel = {$level}+1,\n\t\t\t\t\ttrackname = '{$name}',\n\t\t\t\t\tbitrate = '{$bitrate}',\n\t\t\t\t\tfilesize = '{$filesize}',\n\t\t\t\t\tfrequency = '{$frequency}',\n\t\t\t\t\tlength = '{$length}',";
                                 if (!isNothing($lyrics)) {
                                     $updatesql .= "lyrics = '{$lyrics}',";
                                 }
                                 $updatesql .= "year = '{$year}',\n\t\t\t\t\tgenre = '{$genre}',\n\t\t\t\t\tartist = '{$artist}',\n\t\t\t\t\talbum = '{$album}',\n\t\t\t\t\tnumber = '{$track}',\n\t\t\t\t\textension = '{$fileExt}'";
                                 $updatesql .= " WHERE path " . jz_db_case_sensitive() . " '{$slashedFilePath}'";
                                 jz_db_query($link, $sql) || jz_db_query($link, $updatesql);
                             } else {
                                 $sql = "UPDATE jz_tracks SET valid = 'true' WHERE path " . jz_db_case_sensitive() . " '{$slashedFilePath}'";
                                 jz_db_query($link, $sql);
                             }
                             // last thing: add thumb and/or descriptions.
                             $sql = "valid = 'true'";
                             if (isset($thumb_file)) {
                                 $sql .= ", main_art = '{$thumb_file}'";
                             }
                             if (isset($description)) {
                                 $sql .= ", descr = '{$description}'";
                             }
                             if (isset($long_description)) {
                                 $sql .= ", longdesc = '{$long_description}'";
                             }
                             jz_db_query($link, "UPDATE jz_nodes SET {$sql} WHERE path " . jz_db_case_sensitive() . " '{$slashedFilePath}'");
                         }
                     }
                 }
             }
         }
     }
     // Back to $this node:
     // add new info to $this's database entry.
     if ($readTags === true) {
         $be->setUpdated($media_dir);
     } else {
         $be->setUpdated($media_dir, 0);
         // pretend it hasn't been updated since 1979.
     }
     $sqlUpdate = "nodecount = {$nodecount}, leafcount = {$leafcount}";
     if ($bestImage != "") {
         $sqlUpdate .= ", main_art = '{$bestImage}'";
     }
     if ($bestDescription != "") {
         //$bestDescription = jz_db_escape(file_get_contents($bestDescription));
         $sqlUpdate .= ", longdesc = '{$bestDescription}'";
     }
     $sql = "UPDATE jz_nodes SET {$sqlUpdate} WHERE path LIKE '{$slashedNodePath}'";
     if (false === jz_db_query($link, $sql)) {
         die(jz_db_error($link));
     }
     $slash = $level == 0 ? "" : "/";
     // all done; remove everything beyond $this's path that is still not valid.
     $sql = "DELETE FROM jz_nodes WHERE ";
     $sql .= "level > {$level} AND path LIKE '{$slashedNodePath}{$slash}%' AND valid = 'false'";
     $sql .= " AND filepath LIKE '{$fullSlashedNodePath}%'";
     jz_db_query($link, $sql);
     $sql = "DELETE FROM jz_tracks WHERE ";
     $sql .= "path LIKE '{$slashedNodePath}{$slash}%' AND valid = 'false'";
     $sql .= " AND filepath LIKE '{$fullSlashedNodePath}%'";
     jz_db_query($link, $sql);
 }
Ejemplo n.º 29
0
            echo "<a href='post.php?action=reply&amp;forum_id=" . $data['forum_id'] . "&amp;thread_id=" . $data['thread_id'] . "&amp;post_id=" . $data['post_id'] . "&amp;quote=" . $data['post_id'] . "'>" . $locale['569'] . "</a>\n";
            if (iMOD || $lock_edit && $last_post['post_id'] == $data['post_id'] && $userdata['user_id'] == $data['post_author'] || !$lock_edit && $userdata['user_id'] == $data['post_author']) {
                echo "&nbsp;::&nbsp;<a href='post.php?action=edit&amp;forum_id=" . $data['forum_id'] . "&amp;thread_id=" . $data['thread_id'] . "&amp;post_id=" . $data['post_id'] . "'>" . $locale['568'] . "</a>\n";
            }
        } else {
            if (iMOD) {
                echo "<a href='post.php?action=edit&amp;forum_id=" . $data['forum_id'] . "&amp;thread_id=" . $data['thread_id'] . "&amp;post_id=" . $data['post_id'] . "'>" . $locale['568'] . "</a>\n";
            }
        }
    } elseif (iMEMBER && ($can_post || $can_reply)) {
        if (!$fdata['thread_locked']) {
            echo "<a href='post.php?action=reply&amp;forum_id=" . $data['forum_id'] . "&amp;thread_id=" . $data['thread_id'] . "&amp;post_id=" . $data['post_id'] . "&amp;quote=" . $data['post_id'] . "'><img src='" . get_image("quote") . "' alt='" . $locale['569'] . "' style='border:0px;vertical-align:middle' /></a>\n";
            if (iMOD || $lock_edit && $last_post['post_id'] == $data['post_id'] && $userdata['user_id'] == $data['post_author'] || !$lock_edit && $userdata['user_id'] == $data['post_author']) {
                echo "<a href='post.php?action=edit&amp;forum_id=" . $data['forum_id'] . "&amp;thread_id=" . $data['thread_id'] . "&amp;post_id=" . $data['post_id'] . "'><img src='" . get_image("forum_edit") . "' alt='" . $locale['568'] . "' style='border:0px;vertical-align:middle' /></a>\n";
            }
        } else {
            if (iMOD) {
                echo "<a href='post.php?action=edit&amp;forum_id=" . $data['forum_id'] . "&amp;thread_id=" . $data['thread_id'] . "&amp;post_id=" . $data['post_id'] . "'><img src='" . get_image("forum_edit") . "' alt='" . $locale['568'] . "' style='border:0px;vertical-align:middle' /></a>\n";
            }
        }
    }
    if (!$fb4['buttons']) {
        echo (iMEMBER && ($can_post || $can_reply) ? " :: " : "") . showStatus($data['user_id'], false);
    } else {
        echo (iMEMBER && ($can_post || $can_reply) ? " " : "") . showStatus($data['user_id']);
    }
    echo "</td>\n</tr>\n";
    $current_row++;
    echo "</table><br />";
}
echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border'>\n";
Ejemplo n.º 30
0
<?php

if (!defined("IN_FUSION")) {
    die("ACCESS DENIED");
}
opentable("all tournies");
showAdminNav();
$result = dbquery("SELECT * FROM " . DB_T_TOURS . " ORDER BY tour_id DESC");
if (dbrows($result)) {
    echo "<table width='100%'>";
    echo "<tr><td class='tbl2' width='1%'>id</td><td class='tbl2' width='1%'>status</td><td class='tbl2'>name</td><td class='tbl2' width='1%'>date</td><td class='tbl2' width='1%'>options</td></tr>";
    while ($data = dbarray($result)) {
        echo "<tr><td class='tbl2' width='1%'>" . $data['tour_id'] . "</td><td class='tbl1' width='1%'>" . showStatus($data['tour_id']) . "</td><td class='tbl1'><a href='" . BASEDIR . "tourney.php?p=viewtour&id=" . $data['tour_id'] . "'>" . $data['tour_name'] . "</a></td><td class='tbl1' width='1%'>" . showdate("longdate", $data['tour_date']) . "</td><td class='tbl1' width='1%'><a href='" . INFUSIONS . "al_tourney/admin/index.php" . $aidlink . "&p=newtour&a=edit&id=" . $data['tour_id'] . "''><img src='" . IMAGES . "edit.png' alt='edit tourney' /></a> <a href='" . INFUSIONS . "al_tourney/admin/index.php" . $aidlink . "&p=bracket&id=" . $data['tour_id'] . "''><img src='" . IMAGES . "arrow.png' alt='edit bracket' /></a> <a href='" . INFUSIONS . "al_tourney/admin/index.php" . $aidlink . "&p=newtour&a=delete&id=" . $data['tour_id'] . "''><img src='" . IMAGES . "no.png' alt='delete tourney' /></a></td></tr>";
    }
    echo "</table>";
} else {
    echo "no tournies";
}
closetable();