Beispiel #1
8
    if (strtolower($firstArg) == strtolower($secondArg)) {
        return "true";
    }
    return "false";
}
if (!$logged) {
    header("Location: index.php?subtopic=accountmanagement");
}
$player = new Player();
$player->loadByName($_REQUEST['name']);
if ($player->isLoaded()) {
    $account = array('sessionKey' => generateSessionKey());
    $server = array('WorldID' => 1, 'ip' => $_SERVER['SERVER_ADDR'], 'port' => 7171);
    $accountCharacters = "";
    foreach ($account_logged->getPlayersList() as $character) {
        $accountCharacters .= "<character name='" . htmlspecialchars($character->getName()) . "' worldid='" . $server['WorldID'] . "' selected='" . isSelected($player->getName(), $character->getName()) . "' />";
    }
} else {
    header("Location: index.php?subtopic=accountmanagement");
}
?>

<html>
	<head>
		<title>Tibia Flash Client</title>
		<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
		<meta http-equiv="content-language" content="en" />
		<link rel="shortcut icon" href="https://a248.e.akamai.net/cipsoft.download.akamai.com/118500/tibia/static.tibia.com/images/global/general/favicon.ico" type="image/x-icon" />
		<link rel="icon" href="https://a248.e.akamai.net/cipsoft.download.akamai.com/118500/tibia/static.tibia.com/images/global/general/favicon.ico" type="image/x-icon" />
		<link rel="stylesheet" href="flash-regular-bin/common/style.css" />
		
function showProgramListAll()
{
    $list = selectAllPrograms();
    echo "<form action='../controller/controller_save_program_code.php' method='post'>";
    echo "<select name=\"CodeProgramme\" id=\"CodeProgramme\" style='width: 300px'>";
    echo "<option value='Tous' " . isSelected('Tous') . ">Afficher tous les plans-cadre</option>";
    if (sizeof($list) > 0) {
        foreach ($list as $row) {
            echo "<option value=\"" . $row['CodeProgramme'] . "\" " . isSelected($row['CodeProgramme']) . ">" . $row['CodeProgramme'] . " " . $row['NomProgramme'] . "</option>";
        }
    } else {
        echo "<option>" . "Aucun Programme" . "</option>";
    }
    echo "</select>";
    echo "<input type='submit' value='Rechercher'>";
    echo "</form>";
}
								<option <?php 
isSelected(1, $comp);
?>
 value = "1">1</option>
								<option <?php 
isSelected(2, $comp);
?>
 value = "2">2</option>
								<option <?php 
isSelected(3, $comp);
?>
 value = "3">3</option>
								<option <?php 
isSelected(4, $comp);
?>
 value = "4">4</option>
								<option <?php 
isSelected(5, $comp);
?>
 value = "5">5</option>
					 	 </select>   			 	
		<p> <input id="editar" type="submit" value = "Editar" />
	</form>

<?php 
function isSelected($pos, $comp)
{
    if ($pos == $comp) {
        echo "selected";
    }
}
Beispiel #4
0
function optionsFromArray($arr)
{
    global $pname;
    echo '<select id="fname" name="fname" >';
    foreach ($arr as $o) {
        echo '<option value="' . $o . '" ';
        isSelected($pname, $o);
        echo ' >' . $o . '</option>';
    }
    echo '</select>';
}
Beispiel #5
0
" <?php 
        echo isSelected(USER_ROLE, $u["role_id"]);
        ?>
>User</option>
								<option value="<?php 
        echo STAFF_ROLE;
        ?>
" <?php 
        echo isSelected(STAFF_ROLE, $u["role_id"]);
        ?>
>Faculty</option>
								<option value="<?php 
        echo ADMIN_ROLE;
        ?>
" <?php 
        echo isSelected(ADMIN_ROLE, $u["role_id"]);
        ?>
>Admin</option>
							</select>
						</div>
					</div>
					<div class="form-group">
						<div class="col-md-offset-4">
							<div class="col-md-6">
								<input type="submit" class="btn btn-default btn-block" id="submit" name="submit" value="Edit"/>
							</div>
						</div>
					</div>
				</form>
	<?php 
    } else {
Beispiel #6
0
            <div class="col-sm-10">
              <select class="form-control" id="justification" name="justification" readonly>
                  <option value="Instruction" <?php 
isSelected($_pinkie->s_Justification, "Instruction");
?>
 >Instruction</option>
                  <option value="Research" <?php 
isSelected($_pinkie->s_Justification, "Research");
?>
 >Research</option>
                  <option value="Fabrication" <?php 
isSelected($_pinkie->s_Justification, "Fabrication");
?>
 >Fabrication</option>
                  <option value="Other" <?php 
isSelected($_pinkie->s_Justification, "Other");
?>
 >Other</option>
              </select>
            </div>
          </div>

          <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
              <textarea class="form-control" rows="2" id="justificationText" name="justificationText" readonly><?php 
echo $_pinkie->s_JustificationText;
?>
</textarea>
            </div>
          </div>
    public static function output($post)
    {
        global $woocommerce, $post, $wpdb, $wp_roles, $order, $inicis_payment;
        $woocommerce->payment_gateways();
        $order = new WC_Order($post->ID);
        $payment_method = get_post_meta($order->id, '_payment_method', true);
        $tid = get_post_meta($order->id, 'inicis_paymethod_tid', true);
        $vbank_refund_add = get_post_meta($order->id, 'inicis_paymethod_vbank_add', true);
        $vbank_noti_received = get_post_meta($order->id, 'inicis_vbank_noti_received', true);
        $url = admin_url('post.php?post=' . $order->id . '&action=edit');
        ?>
        <style type="text/css">
        #mb_inipay {
            border-bottom: 1px solid #dfdfdf;
            margin:0 -12px;
            padding-bottom:10px;
        }
        #mb_inipay_sub {
            padding: 0px 12px;
        }
        .mb_inipay_h4 {
            margin:0px!important;
        }
        .mb_inipay_wide {
            width:100%;
        }
        .mb_inipay_note {
            padding: 10px;
            background: #efefef;
            position: relative;
            margin-top: 10px;
        }
        .mb_inipay_note p {
            margin: 0;
            padding: 0;
            word-wrap: break-word;
        }
        </style>

        <script type="text/javascript">
            function checkIsJSON(value) {
                try {
                    JSON.parse(value);
                    return true;
                } catch (ex) {
                    return false;
                }
            }
            function sleep(milliseconds) {
              var start = new Date().getTime();
              for (var i = 0; i < 1e7; i++) {
                if ((new Date().getTime() - start) > milliseconds){
                  break;
                }
              }
            }
            function onClickCancelRequest(){
                if(confirm("정말 취소 처리하시겠습니까?\n\n처리 이후에 이전 상태로 되돌릴 수 없습니다. 입금 통보 전에 취소하시는 경우이기 때문에 고객의 요청이 아니라면 취소 처리시 주의하여 주세요.")) {
                    var data = {
                        action: "<?php 
        echo 'refund_request_' . $payment_method;
        ?>
",
                        order_id: "<?php 
        echo $post->ID;
        ?>
",
                        refund_request: "<?php 
        echo wp_create_nonce('refund_request');
        ?>
"
                    };

                    jQuery("[name='refund-request']").attr('disabled','true');
                    jQuery("[name='refund-request']").attr('value', "<?php 
        echo __("처리중...", "inicis_payment");
        ?>
");

                    jQuery.post(ajaxurl, data, function(response) {
                        if (response) {
                            if (checkIsJSON(response)) {
                                response = JSON.parse(response);
                            }
                            if (response.success == 'true' || response.success) {
                                alert(response.data);
                                location.reload();
                            } else {
                                alert(response.data);
                                jQuery("[name='refund-request']").removeAttr('disabled');
                                jQuery("[name='refund-request']").attr('value', "취소하기");
                            }
                        } else {
                            alert('취소요청 결과를 수신하지 못하였습니다.\n처리 결과 확인을 위해 영수증을 확인해 보시기 바랍니다.');
                            jQuery("[name='refund-request']").removeAttr('disabled');
                            jQuery("[name='refund-request']").attr('value', "취소하기");
                        }
                    });
                } else {
                    return;
                }
            }
            function onClickRefundRequest(){
                if(confirm("정말 환불 처리하시겠습니까?\n\n처리 이후에 이전 상태로 되돌릴 수 없습니다. 신중하게 선택해주세요.")) {
                    var data = {
                        action: "<?php 
        echo $payment_method;
        ?>
_order_cancelled",
                        post_id: "<?php 
        echo $post->ID;
        ?>
",
                        inicis_vbank_refund_request: "<?php 
        echo wp_create_nonce('inicis_vbank_refund_request');
        ?>
"
                    };

                    jQuery("[name='vbank-refund-request']").attr('disabled','true');
                    jQuery("[name='vbank-refund-request']").attr('value', "<?php 
        echo __("처리중...", "inicis_payment");
        ?>
");

                    jQuery.post(ajaxurl, data, function(response) {
                        if (response) {
                            if (checkIsJSON(response)) {
                                response = JSON.parse(response);
                            }
                            if (response.success == 'true' || response.success) {
                                alert(response.data);
                                location.reload();
                            } else {
                                alert(response.data);
                                jQuery("[name='vbank-refund-request']").removeAttr('disabled');
                                jQuery("[name='vbank-refund-request']").attr('value', "<?php 
        echo __('환불하기', 'inicis_payment');
        ?>
");
                            }
                        } else {
                            alert("<?php 
        echo __('환불 처리가 실패되었습니다!\\n\\n다시 시도해 주세요!\\n\\n계속 동일 증상 발생시 주문상태를 확인해주세요!', 'inicis_payment');
        ?>
");
                            jQuery("[name='vbank-refund-request']").removeAttr('disabled');
                            jQuery("[name='vbank-refund-request']").attr('value', "<?php 
        echo __('환불하기', 'inicis_payment');
        ?>
");
                        }
                    });
                } else {
                    return;
                }
            }
            function checkReceipt(){
                window.open("https://iniweb.inicis.com/app/publication/apReceipt.jsp?noMethod=1&noTid=<?php 
        echo get_post_meta($post->ID, 'inicis_paymethod_tid', true);
        ?>
");
            }
            function onVbankRefundAdd() {
                if(confirm("환불 정보를 등록하시겠습니까?")) {
                    if (jQuery("#_order_refund_bankcode").val() != "-1" && jQuery("#_order_refund_vacc_num").val() != "" && jQuery("#_order_refund_vacc_name").val() != "" && jQuery("#_order_refund_reason").val() != "") {
                        jQuery("[name='vbank-refund-request-vacc-add']").attr('disabled', 'true');
                        jQuery("[name='vbank-refund-request-vacc-add']").val('처리중...');

                        jQuery.ajax({
                            type: 'POST',
                            dataType: 'text',
                            url: '<?php 
        echo home_url() . '/wc-api/WC_Gateway_Inicis_Vbank?type=vbank_refund_add';
        ?>
',
                            data: {
                                action: 'vbank_refund_add',
                                orderid: '<?php 
        echo $post->ID;
        ?>
',
                                refund_bankcode: jQuery("#_order_refund_bankcode").val(),
                                refund_vaccnum: jQuery("#_order_refund_vacc_num").val(),
                                refund_vaccname: jQuery("#_order_refund_vacc_name").val(),
                                refund_reason: jQuery("#_order_refund_reason").val(),
                                refund_wpnonce: '<?php 
        echo wp_create_nonce('inicis_vbank_refund_add');
        ?>
'
                            },
                            success: function (data, textStatus, jqXHR) {
                                if (data.match("success")) {
                                    alert('환불 정보 등록이 완료되었습니다.\n\n환불 정보를 확인하신 후 환불처리를 진행해 주시기 바랍니다.');
                                    location.href = '<?php 
        echo $url;
        ?>
';
                                } else {
                                    alert('관리자에게 문의하여주세요.\n\n에러 메시지 : \n' + data);
                                    jQuery("[name='vbank-refund-request-vacc-add']").removeAttr("disabled");
                                    jQuery("[name='vbank-refund-request-vacc-add']").val('정보등록');
                                    location.href = '<?php 
        echo $url;
        ?>
';
                                }
                            }
                        });
                    } else {
                        alert("환불 정보를 등록을 위한 값이 지정되지 않았습니다.\n\n - 환불은행, 계좌번호, 계좌주명, 취소사유를 확인하여 입력하여 주세요.");
                        return;
                    }
                }
            }
            function onVbankRefundModify() {
                if(confirm("환불 정보를 수정하시겠습니까?")) {
                    if (jQuery("#_order_refund_bankcode").val() != "-1" && jQuery("#_order_refund_vacc_num").val() != "" && jQuery("#_order_refund_vacc_name").val() != "" && jQuery("#_order_refund_reason").val() != "") {
                        jQuery("[name='vbank-refund-request-vacc-modify']").attr('disabled', 'true');
                        jQuery("[name='vbank-refund-request-vacc-modify']").val('처리중...');

                        jQuery.ajax({
                            type: 'POST',
                            dataType: 'text',
                            url: '<?php 
        echo home_url() . '/wc-api/WC_Gateway_Inicis_Vbank?type=vbank_refund_modify';
        ?>
',
                            data: {
                                action: 'vbank_refund_modify',
                                orderid: '<?php 
        echo $post->ID;
        ?>
',
                                refund_bankcode: jQuery("#_order_refund_bankcode").val(),
                                refund_vaccnum: jQuery("#_order_refund_vacc_num").val(),
                                refund_vaccname: jQuery("#_order_refund_vacc_name").val(),
                                refund_reason: jQuery("#_order_refund_reason").val(),
                                refund_wpnonce: '<?php 
        echo wp_create_nonce('inicis_vbank_refund_modify');
        ?>
'
                            },
                            success: function (data, textStatus, jqXHR) {
                                if (data.match("success")) {
                                    alert('환불 정보 수정이 완료되었습니다.\n\n환불 정보를 확인하신 후 환불처리를 진행해 주시기 바랍니다.');
                                    location.href = '<?php 
        echo $url;
        ?>
';
                                } else {
                                    alert('관리자에게 문의하여주세요.\n\n에러 메시지 : \n' + data);
                                    jQuery("[name='vbank-refund-request-vacc-modify']").removeAttr("disabled");
                                    jQuery("[name='vbank-refund-request-vacc-modify']").val('정보등록');
                                    location.href = '<?php 
        echo $url;
        ?>
';
                                }
                            }
                        });
                    } else {
                        alert("환불 정보 수정을 위한 값이 지정되지 않았습니다.\n\n - 환불은행, 계좌번호, 계좌주명, 취소사유를 확인하여 입력하여 주세요.");
                        return;
                    }
                }
            }
        </script>

        <?php 
        $vbank_refund_bankcode = get_post_meta($post->ID, 'vbank_refund_bankcode', true);
        $vbank_refund_vaccnum = get_post_meta($post->ID, 'vbank_refund_vaccnum', true);
        $vbank_refund_vaccname = get_post_meta($post->ID, 'vbank_refund_vaccname', true);
        $vbank_refund_reason = get_post_meta($post->ID, 'vbank_refund_reason', true);
        function isSelected($num, $val)
        {
            if ($num == $val) {
                echo " selected";
            } else {
                return;
            }
        }
        function isDisabled()
        {
            global $post;
            $vbank_refunded = get_post_meta($post->ID, 'inicis_paymethod_vbank_refunded', true);
            if ($vbank_refunded == 'yes') {
                echo ' disabled';
            }
        }
        ?>
        <?php 
        if ($vbank_noti_received == 'yes') {
            ?>
        <div class="mb_inipay_note">
            <p>이니시스 가상계좌 환불처리는 전액환불만 가능하며, 전액환불이 불가한 경우, 별도로 환불절차를 진행하시기 바랍니다. 가상계좌로 환불 처리를 진행하시는 경우, 이니시스 계약에 따라 환불 수수료가 부과됩니다.</p>
        </div>
            <div id="mb_inipay" class="total_row">
                <div id="mb_inipay_sub">
                    <div id="mb_inipay_group" class="totals_group">
                        <p class="wide"><h4 class="mb_inipay_h4"><label for="_order_refund_bankcode">환불 은행(코드)</label>
                        </h4>
                        <select id="_order_refund_bankcode" name="_order_refund_bankcode" class="mb_inipay_wide"
                                title="환불처리할 은행을 선택해주세요."<?php 
            isDisabled();
            ?>
>
                            <option value="-1"<?php 
            isSelected('-1', $vbank_refund_bankcode);
            ?>
>===== [ 선택 ] =====
                            </option>
                            <option value="02"<?php 
            isSelected('02', $vbank_refund_bankcode);
            ?>
>산업(02)</option>
                            <option value="03"<?php 
            isSelected('03', $vbank_refund_bankcode);
            ?>
>기업(03)</option>
                            <option value="04"<?php 
            isSelected('04', $vbank_refund_bankcode);
            ?>
>국민(04)</option>
                            <option value="05"<?php 
            isSelected('05', $vbank_refund_bankcode);
            ?>
>외환(05)</option>
                            <option value="06"<?php 
            isSelected('06', $vbank_refund_bankcode);
            ?>
>국민(주택)(06)</option>
                            <option value="07"<?php 
            isSelected('07', $vbank_refund_bankcode);
            ?>
>수협(07)</option>
                            <option value="11"<?php 
            isSelected('11', $vbank_refund_bankcode);
            ?>
>농협(11)</option>
                            <option value="12"<?php 
            isSelected('12', $vbank_refund_bankcode);
            ?>
>농협(12)</option>
                            <option value="16"<?php 
            isSelected('16', $vbank_refund_bankcode);
            ?>
>농협(축협)(16)</option>
                            <option value="20"<?php 
            isSelected('20', $vbank_refund_bankcode);
            ?>
>우리(20)</option>
                            <option value="21"<?php 
            isSelected('21', $vbank_refund_bankcode);
            ?>
>조흥(21)</option>
                            <option value="23"<?php 
            isSelected('23', $vbank_refund_bankcode);
            ?>
>제일(23)</option>
                            <option value="25"<?php 
            isSelected('25', $vbank_refund_bankcode);
            ?>
>서울(25)</option>
                            <option value="26"<?php 
            isSelected('26', $vbank_refund_bankcode);
            ?>
>신한(26)</option>
                            <option value="27"<?php 
            isSelected('27', $vbank_refund_bankcode);
            ?>
>한미(27)</option>
                            <option value="31"<?php 
            isSelected('31', $vbank_refund_bankcode);
            ?>
>대구(31)</option>
                            <option value="32"<?php 
            isSelected('32', $vbank_refund_bankcode);
            ?>
>부산(32)</option>
                            <option value="34"<?php 
            isSelected('34', $vbank_refund_bankcode);
            ?>
>광주(34)</option>
                            <option value="35"<?php 
            isSelected('35', $vbank_refund_bankcode);
            ?>
>제주(35)</option>
                            <option value="37"<?php 
            isSelected('37', $vbank_refund_bankcode);
            ?>
>전북(37)</option>
                            <option value="38"<?php 
            isSelected('38', $vbank_refund_bankcode);
            ?>
>강원(38)</option>
                            <option value="39"<?php 
            isSelected('39', $vbank_refund_bankcode);
            ?>
>경남(39)</option>
                            <option value="41"<?php 
            isSelected('41', $vbank_refund_bankcode);
            ?>
>비씨(41)</option>
                            <option value="45"<?php 
            isSelected('45', $vbank_refund_bankcode);
            ?>
>새마을(45)</option>
                            <option value="48"<?php 
            isSelected('48', $vbank_refund_bankcode);
            ?>
>신협(48)</option>
                            <option value="50"<?php 
            isSelected('50', $vbank_refund_bankcode);
            ?>
>상호저축은행(50)</option>
                            <option value="53"<?php 
            isSelected('53', $vbank_refund_bankcode);
            ?>
>씨티(53)</option>
                            <option value="54"<?php 
            isSelected('54', $vbank_refund_bankcode);
            ?>
>홍콩상하이은행(54)</option>
                            <option value="55"<?php 
            isSelected('55', $vbank_refund_bankcode);
            ?>
>도이치(55)</option>
                            <option value="56"<?php 
            isSelected('56', $vbank_refund_bankcode);
            ?>
>ABN암로(56)</option>
                            <option value="70"<?php 
            isSelected('70', $vbank_refund_bankcode);
            ?>
>신안상호(70)</option>
                            <option value="71"<?php 
            isSelected('71', $vbank_refund_bankcode);
            ?>
>우체국(71)</option>
                            <option value="81"<?php 
            isSelected('81', $vbank_refund_bankcode);
            ?>
>하나(81)</option>
                            <option value="87"<?php 
            isSelected('87', $vbank_refund_bankcode);
            ?>
>신세계(87)</option>
                            <option value="88"<?php 
            isSelected('88', $vbank_refund_bankcode);
            ?>
>신한(88)</option>
                        </select>
                        </p>
                        <p class="wide"><h4 class="mb_inipay_h4"><label for="_order_refund_vacc_num">환불 계좌번호</label>
                        </h4>
                        <input type="text" class="mb_inipay_wide" id="_order_refund_vacc_num"
                               name="_order_refund_vacc_num" placeholder="번호(숫자)만 입력하세요."
                               value="<?php 
            echo $vbank_refund_vaccnum;
            ?>
"
                               title="결제 플러그인 설정에서 배송회사 이름을 지정할수 있습니다."<?php 
            isDisabled();
            ?>
></p>
                        <p class="wide"><h4 class="mb_inipay_h4"><label for="_order_refund_vacc_name">환불 계좌주명</label>
                        </h4>
                        <input type="text" class="mb_inipay_wide" id="_order_refund_vacc_name"
                               name="_order_refund_vacc_name" placeholder="환불 계좌주명"
                               value="<?php 
            echo $vbank_refund_vaccname;
            ?>
" title="배송시 사용된 송장 번호를 입력해주세요."<?php 
            isDisabled();
            ?>
></p>
                        <p class="wide"><h4 class="mb_inipay_h4"><label for="_order_refund_reason">취소 사유</label></h4>
                        <input type="text" class="mb_inipay_wide" id="_order_refund_reason" name="_order_refund_reason"
                               placeholder="취소 사유" value="<?php 
            echo $vbank_refund_reason;
            ?>
"
                               title="취소 사유를 입력해주세요."<?php 
            isDisabled();
            ?>
></p>
                    </div>
                </div>
            </div>
        <?php 
        }
        echo '<p class="order-info">';
        if (apply_filters('ifw_is_admin_refundable_' . $payment_method, false, $order)) {
            if ($vbank_noti_received == 'yes') {
                if ($vbank_refund_add == 'yes') {
                    echo '<input style="margin-right:10px" type="button" class="button button-primary tips" id="ifw-refund-request" name="vbank-refund-request-vacc-modify" value="' . __('정보수정', 'inicis_payment') . '" onClick="javascript:onVbankRefundModify();" title="이니시스 가상계좌 환불정보를 수정합니다." data-tip="환불정보 수정">';
                    echo '<input style="margin-right:10px" type="button" class="button button-primary tips" id="ifw-refund-request" name="vbank-refund-request" value="' . __('환불하기', 'inicis_payment') . '" onClick="javascript:onClickRefundRequest();" title="이니시스 가상계좌 환불 처리를 수행합니다." data-tip="환불하기">';
                } else {
                    echo '<input style="margin-right:10px" type="button" class="button button-primary tips" id="ifw-refund-request" name="vbank-refund-request-vacc-add" value="' . __('정보등록', 'inicis_payment') . '" onClick="javascript:onVbankRefundAdd();" title="가상계좌 무통장입금 환불처리를 위한 환불정보를 등록합니다." data-tip="환불정보 등록">';
                    echo '<input style="margin-right:10px" type="button" class="button button-primary tips" id="ifw-refund-request" name="vbank-refund-request" value="' . __('환불하기', 'inicis_payment') . '" title="이니시스 가상계좌 환불 처리를 수행할 수 없습니다. 먼저 환불정보를 등록하셔야 환불처리를 할 수 있습니다." data-tip="환불하기" disabled>';
                }
            } else {
                echo '<input style="margin-right:10px" type="button" class="button button-primary tips" id="ifw-refund-request" name="refund-request" value="' . __('취소하기', 'inicis_payment') . '" onClick="javascript:onClickCancelRequest();" title="이니시스 가상계좌 가상계좌 입금전 취소 처리를 수행합니다." data-tip="가상계좌 입금전 취소하기">';
            }
        }
        if (!empty($tid)) {
            echo '<input type="button" class="button button-primary tips" id="ifw-check-receipt" name="refund-request-check-receipt" value="' . __('영수증 확인', 'inicis_payment') . '" onClick="javascript:checkReceipt();" data-tip="영수증 확인">';
        }
        echo '</p>';
    }
</option>
                    <option value="5" data-imagesrc="img/bt_type_art.png" data-description="<?php 
echo $nme_cat_Artistic_cap;
?>
" <?php 
isSelected($getBroadcast_Type, 5);
?>
><?php 
echo $nme_cat_Artistic;
?>
</option>
                    <option value="6" data-imagesrc="img/bt_type_education.png" data-description="<?php 
echo $nme_cat_Educational_cap;
?>
" <?php 
isSelected($getBroadcast_Type, 6);
?>
><?php 
echo $nme_cat_Educational;
?>
</option>
                </select>
              
              <select name="broadcast" id="broadcastHidden">
              <option value="0">0</option>
              <option value="1">0</option>
              <option value="2">0</option>
              <option value="3">0</option>
              <option value="4">0</option>
              <option value="5">0</option>
              <option value="6">0</option>
Beispiel #9
0
{
    if ($selectedType1 == $type1) {
        echo 'selected';
    } else {
        echo '';
    }
}
?>
			<div class="left-menu">
				<div class="category-label"><div>Category</div></div>
				<div class="sub-menu">
				<?php 
foreach ($typeList as $type) {
    ?>
					<div  class="<?php 
    isSelected($selectedSubtype, $type["ID"]);
    ?>
"  onclick="doFilter(<?php 
    echo $type['ID'];
    ?>
)">
						<?php 
    echo $type["Type"];
    ?>
					</div>
					<?php 
}
?>
				</div>
				<div id="support">
					<div class="category-label"><div>Hỗ trợ</div></div>
Beispiel #10
0
function optionsFromArray($arr, $sel)
{
    // return implode(",",$arr);
    global $pname;
    $str = "";
    //$str = $str.'<select id="fname" name="fname" >';
    foreach ($arr as $o) {
        $str = $str . '<option value="' . $o . '" ';
        $str = $str . isSelected($sel, $o);
        $str = $str . ' >' . $o . '</option>';
    }
    //$str=$str.'</select>';
    return $str;
}
Beispiel #11
0
function show_keyword_group_id($id_group, $id_parent = 0)
{
    global $system_kwg;
    $kwg = array();
    $sub_kwg = array();
    $parent_kwg = array();
    if (!$id_group) {
        // set default values (common to both new kwg or sub-kwg)
        $kwg['title'] = $kwg['description'] = '';
        $kwg['ac_author'] = 'Y';
        $kwg['policy'] = '';
        $kwg['suggest'] = '';
        $kwg['quantity'] = 'one';
        if ($id_parent) {
            // New keyword sub-group
            $parent_kwg = get_kwg_from_id($id_parent);
            // set default values (based on parent kwg)
            $kwg['type'] = $parent_kwg['type'];
            // recommend a new name
            $all_kws = get_subgroups_in_group_id($id_parent, false);
            $cpt = sprintf("%02d", count($all_kws) + 1);
            while (get_kw_from_name($parent_kwg['name'], $parent_kwg['name'] . '_sub' . $cpt)) {
                $cpt = sprintf("%02d", ++$cpt);
            }
            $kwg['name'] = $parent_kwg['name'] . '_sub' . $cpt;
            lcm_page_start(_T('title_subkwg_edit'));
        } else {
            // New keyword group, set default values
            if (_request('type')) {
                $kwg['name'] = '';
                $kwg['type'] = _request('type');
            } else {
                $kwg['name'] = '';
                $kwg['type'] = 'user';
            }
            lcm_page_start(_T('title_kwg_new'));
        }
    } else {
        // Editing existing (parent or sub) keyword group
        $kwg = get_kwg_from_id($id_group);
        lcm_page_start(_T('title_kwg_edit'));
        if ($kwg['id_parent']) {
            $parent_kwg = get_kwg_from_id($kwg['id_parent']);
            $id_parent = $kwg['id_parent'];
        }
    }
    echo show_all_errors($_SESSION['errors']);
    //
    // Start form
    //
    echo '<form action="keywords.php" method="post">' . "\n";
    echo '<input type="hidden" name="action" value="update_group" />' . "\n";
    echo '<input type="hidden" name="id_group" value="' . $id_group . '" />' . "\n";
    if ($id_parent) {
        echo '<input type="hidden" name="id_parent" value="' . $id_parent . '" />' . "\n";
    }
    echo "<table border='0' width='99%' align='left' class='tbl_usr_dtl'>\n";
    echo "<tr>\n";
    //
    // Parent group (if sub-group)
    //
    if ($id_parent || $kwg['id_parent']) {
        echo "<td>" . _Ti('keywords_parent_group_title') . "</td>\n";
        echo "<td>" . _T($parent_kwg['title']) . "</td>\n";
        echo "</tr><tr>\n";
    }
    //
    // Keyword group type (applies to..)
    //
    echo '<td width="30%"><label for="kwg_type">' . f_err_star('type') . _T('keywords_input_type') . "</label></td>\n";
    echo "<td>";
    if ($kwg['type'] == 'system' || $kwg['type'] == 'contact' || $id_parent) {
        echo _T('keywords_input_type_' . $kwg['type']);
        echo '<input type="hidden" name="kwg_type" value="' . $kwg['type'] . '" />' . "\n";
    } else {
        $all_types = array("case", "stage", "followup", "client", "org", "client_org");
        // "author"
        echo '<select name="kwg_type" id="kwg_type">';
        foreach ($all_types as $t) {
            $sel = isSelected($t == $kwg['type']);
            echo '<option value="' . $t . '"' . $sel . '>' . _T('keywords_input_type_' . $t) . '</option>';
        }
        echo "</select>\n";
    }
    echo "</td>\n";
    echo "</tr>\n";
    //
    // Policy
    // Note: if sub-group, there could be a per-subgroup policy
    // E.g. one kw from SubGroupAlpha mandatory, one kw from SubGroupBeta optional
    //
    echo "<tr>\n";
    echo '<td><label for="kwg_policy">' . f_err_star('policy') . _T('keywords_input_policy') . "</label></td>\n";
    echo "<td>";
    if ($kwg['type'] == 'system') {
        echo _T('keywords_input_policy_' . $kwg['policy']);
    } else {
        $all_policy = array('mandatory', 'optional', 'recommended');
        echo '<select name="kwg_policy" id="kwg_policy">';
        foreach ($all_policy as $pol) {
            $sel = isSelected($kwg['policy'] == $pol);
            echo '<option value="' . $pol . '"' . $sel . '>' . _T('keywords_input_policy_' . $pol) . "</option>\n";
        }
        echo "</select>\n";
    }
    echo "</td>\n";
    echo "</tr>\n";
    //
    // Default suggested keyword
    //
    if ($kwg['type'] != 'contact') {
        echo "<tr>\n";
        echo "<td>" . _T('keywords_input_suggest') . "</td>\n";
        echo "<td>";
        echo '<select name="kwg_suggest" class="sel_frm">';
        echo '<option value="">' . "none" . '</option>' . "\n";
        // TRAD
        if ($id_group) {
            $all_kw = get_keywords_in_group_name($kwg['name']);
            foreach ($all_kw as $kw) {
                $sel = isSelected($kw['name'] == $kwg['suggest']);
                echo '<option value="' . $kw['name'] . '"' . $sel . '>' . _T($kw['title']) . '</option>' . "\n";
            }
        }
        echo '</select>';
        echo "</td>\n";
        echo "</tr>\n";
    }
    echo "<tr>\n";
    //
    // Name (only for new keywords, must be unique and cannot be changed)
    //
    $disabled = $id_group ? ' disabled="disabled" ' : '';
    echo "<td colspan='2'>";
    echo "<p class='normal_text'>";
    echo "<strong>" . f_err_star('name') . _T('keywords_input_name') . "</strong> " . "(short identifier, unique to this keyword group)" . "<br />\n";
    // TRAD
    echo '<input ' . $disabled . ' type="text" style="width:99%;" id="kwg_name" name="kwg_name" size="45" value="' . $kwg['name'] . '" class="search_form_txt" />' . "\n";
    echo "</p>\n";
    //
    // Title
    //
    echo "<p class='normal_text'>";
    echo "<strong>" . f_err_star('title') . _T('keywords_input_title') . "</strong><br />\n";
    echo "<input type='text' style='width:99%;' id='kwg_title' name='kwg_title' size='45' value='" . $kwg['title'] . "' class='search_form_txt' />\n";
    echo "</p>\n";
    //
    // Description
    //
    echo "<p class='normal_text'>";
    echo "<strong>" . _T('keywords_input_description') . "</strong><br />\n";
    echo "<textarea id='kwg_description' name='kwg_description' style='width:99%' rows='2' cols='45' wrap='soft' class='frm_tarea'>";
    echo $kwg['description'];
    echo "</textarea>\n";
    echo "</p>\n";
    echo "</td>\n";
    echo "</tr><tr>\n";
    echo '<td colspan="2">';
    echo '<ul class="info">';
    // Quantity: relevevant only for user keywords (ex: 'thematics' for cases)
    if ($kwg['type'] == 'system') {
        $html_quantity = _T('keywords_option_quantity_' . $kwg['quantity']) . '<input type="hidden" name="kwg_quantity" value="' . $kwg['quantity'] . '" />';
    } else {
        $my_qty = $kwg['quantity'];
        // [ML] Yes, strange UI, but imho it works great (otherwise confusing, I hate checkboxes)
        $html_quantity = '<select name="kwg_quantity" id="kwg_quantity">' . (!$my_qty ? '<option value=""></option>' : '') . '<option value="one"' . isSelected($my_qty == 'one') . '>' . _T('keywords_option_quantity_one') . '</option>' . '<option value="many"' . isSelected($my_qty == 'many') . '>' . _T('keywords_option_quantity_many') . '</option>' . '</select>';
    }
    echo '<li>' . _T('keywords_info_quantity', array('quantity' => $html_quantity)) . "</li>\n";
    if ($kwg['type'] != 'system') {
        echo '<li>' . _T('keywords_info_kwg_ac_author') . " " . get_yes_no('kwg_ac_author', $kwg['ac_author']) . "</li>\n";
    }
    echo "</ul>\n";
    echo "</td>\n";
    echo "</tr>\n";
    echo "</table>\n\n";
    echo '<p><button name="submit" type="submit" value="submit" class="simple_form_btn">' . _T('button_validate') . "</button></p>\n";
    echo "</form>\n";
    // destroy error messages
    $_SESSION['errors'] = array();
    lcm_page_end();
    exit;
}
Beispiel #12
0
function renderFormElement($field_type, $field_id, $default_text, $field_elements, $field_value, $field_style = '', $row = array())
{
    global $modx;
    global $base_url;
    global $rb_base_url;
    global $manager_theme;
    global $_lang;
    global $content;
    if (!isset($modx->config['imanager_url'])) {
        $modx->config['imanager_url'] = "{$base_url}manager/media/browser/mcpuk/browser.html?Type=images&Connector={$base_url}manager/media/browser/mcpuk/connectors/php/connector.php&ServerPath={$base_url}";
    }
    if (!isset($modx->config['fmanager_url'])) {
        $modx->config['fmanager_url'] = "{$base_url}manager/media/browser/mcpuk/browser.html?Type=files&Connector={$base_url}manager/media/browser/mcpuk/connectors/php/connector.php&ServerPath={$base_url}";
    }
    $field_html = '';
    $field_value = $field_value != "" ? $field_value : $default_text;
    switch (strtolower($field_type)) {
        case "text":
            // handler for regular text boxes
        // handler for regular text boxes
        case "rawtext":
            // non-htmlentity converted text boxes
        // non-htmlentity converted text boxes
        case "email":
            // handles email input fields
        // handles email input fields
        case "number":
            // handles the input of numbers
            if ($field_type == 'text') {
                $field_type = '';
            } elseif ($field_type == 'number') {
                $field_type .= ' imeoff';
            }
            $field_html .= '<input type="text" class="text ' . $field_type . '" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . htmlspecialchars($field_value) . '" ' . $field_style . ' tvtype="' . $field_type . '" />';
            break;
        case "textareamini":
            // handler for textarea mini boxes
            $field_type .= " phptextarea";
            $field_html .= '<textarea class="' . $field_type . '" id="tv' . $field_id . '" name="tv' . $field_id . '" cols="40" rows="5">' . htmlspecialchars($field_value) . '</textarea>';
            break;
        case "textarea":
            // handler for textarea boxes
        // handler for textarea boxes
        case "rawtextarea":
            // non-htmlentity convertex textarea boxes
        // non-htmlentity convertex textarea boxes
        case "htmlarea":
            // handler for textarea boxes (deprecated)
        // handler for textarea boxes (deprecated)
        case "richtext":
            // handler for textarea boxes
            $field_type .= " phptextarea";
            $field_html .= '<textarea class="' . $field_type . '" id="tv' . $field_id . '" name="tv' . $field_id . '" cols="40" rows="15">' . htmlspecialchars($field_value) . '</textarea>';
            break;
        case "date":
            $field_id = str_replace(array('-', '.'), '_', urldecode($field_id));
            if ($field_value == '') {
                $field_value = 0;
            }
            $field_html .= '<input id="tv' . $field_id . '" name="tv' . $field_id . '" class="DatePicker" type="text" value="' . ($field_value == 0 || !isset($field_value) ? "" : $field_value) . '" onblur="documentDirty=true;" />';
            $field_html .= ' <a onclick="document.forms[\'mutate\'].elements[\'tv' . $field_id . '\'].value=\'\';document.forms[\'mutate\'].elements[\'tv' . $field_id . '\'].onblur(); return true;" style="cursor:pointer; cursor:hand"><img src="media/style/' . $manager_theme . '/images/icons/cal_nodate.gif" border="0" alt="No date"></a>';
            $field_html .= '<script type="text/javascript">';
            $field_html .= '	window.addEvent(\'domready\', function() {';
            $field_html .= '   	new DatePicker($(\'tv' . $field_id . '\'), {\'yearOffset\' : ' . $modx->config['datepicker_offset'] . ", 'format' : " . "'" . $modx->config['datetime_format'] . ' hh:mm:00\'' . '});';
            $field_html .= '});';
            $field_html .= '</script>';
            break;
        case "dateonly":
            $field_id = str_replace(array('-', '.'), '_', urldecode($field_id));
            if ($field_value == '') {
                $field_value = 0;
            }
            $field_html .= '<input id="tv' . $field_id . '" name="tv' . $field_id . '" class="DatePicker" type="text" value="' . ($field_value == 0 || !isset($field_value) ? "" : $field_value) . '" onblur="documentDirty=true;" />';
            $field_html .= ' <a onclick="document.forms[\'mutate\'].elements[\'tv' . $field_id . '\'].value=\'\';document.forms[\'mutate\'].elements[\'tv' . $field_id . '\'].onblur(); return true;" style="cursor:pointer; cursor:hand"><img src="media/style/' . $manager_theme . '/images/icons/cal_nodate.gif" border="0" alt="No date"></a>';
            $field_html .= '<script type="text/javascript">';
            $field_html .= '	window.addEvent(\'domready\', function() {';
            $field_html .= '   	new DatePicker($(\'tv' . $field_id . '\'), {\'yearOffset\' : ' . $modx->config['datepicker_offset'] . ", 'format' : " . "'" . $modx->config['datetime_format'] . "'" . '});';
            $field_html .= '});';
            $field_html .= '</script>';
            break;
        case "dropdown":
            // handler for select boxes
            $field_html .= '<select id="tv' . $field_id . '" name="tv' . $field_id . '" size="1">';
            $rs = ProcessTVCommand($field_elements, $field_id, '', 'tvform');
            $index_list = ParseIntputOptions($rs);
            while (list($label, $item) = each($index_list)) {
                list($label, $value) = splitOption($item);
                $selected = $value == $field_value ? ' selected="selected"' : '';
                $field_html .= '<option value="' . htmlspecialchars($value) . '"' . $selected . '>' . htmlspecialchars($label) . '</option>';
            }
            $field_html .= "</select>";
            break;
        case "listbox":
            // handler for select boxes
            $rs = ProcessTVCommand($field_elements, $field_id, '', 'tvform');
            $index_list = ParseIntputOptions($rs);
            $count = count($index_list) < 8 ? count($index_list) : 8;
            $field_html .= '<select id="tv' . $field_id . '" name="tv' . $field_id . '" size="' . $count . '">';
            while (list($label, $item) = each($index_list)) {
                list($label, $value) = splitOption($item);
                $selected = isSelected($label, $value, $item, $field_value) ? ' selected="selected"' : '';
                $field_html .= '<option value="' . htmlspecialchars($value) . '"' . $selected . '>' . htmlspecialchars($label) . '</option>';
            }
            $field_html .= "</select>";
            break;
        case "listbox-multiple":
            // handler for select boxes where you can choose multiple items
            $rs = ProcessTVCommand($field_elements, $field_id, '', 'tvform');
            $index_list = ParseIntputOptions($rs);
            $count = count($index_list) < 8 ? count($index_list) : 8;
            $field_value = explode("||", $field_value);
            $field_html .= '<select id="tv' . $field_id . '[]" name="tv' . $field_id . '[]" multiple="multiple" size="' . $count . '">';
            while (list($label, $item) = each($index_list)) {
                list($label, $value) = splitOption($item);
                $selected = isSelected($label, $value, $item, $field_value) ? ' selected="selected"' : '';
                $field_html .= '<option value="' . htmlspecialchars($value) . '"' . $selected . '>' . htmlspecialchars($label) . '</option>';
            }
            $field_html .= "</select>";
            break;
        case "url":
            // handles url input fields
            $urls = array('' => '--', 'http://' => 'http://', 'https://' => 'https://', 'ftp://' => 'ftp://', 'mailto:' => 'mailto:');
            $field_html = '<table border="0" cellspacing="0" cellpadding="0"><tr><td><select id="tv' . $field_id . '_prefix" name="tv' . $field_id . '_prefix">';
            foreach ($urls as $k => $v) {
                if (strpos($field_value, $v) === false) {
                    $field_html .= '<option value="' . $v . '">' . $k . '</option>';
                } else {
                    $field_value = str_replace($v, '', $field_value);
                    $field_html .= '<option value="' . $v . '" selected="selected">' . $k . '</option>';
                }
            }
            $field_html .= '</select></td><td>';
            $field_html .= '<input type="text" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . htmlspecialchars($field_value) . '" width="100" ' . $field_style . ' /></td></tr></table>';
            break;
        case "checkbox":
            // handles check boxes
            if (!is_array($field_value)) {
                $field_value = explode('||', $field_value);
            }
            $rs = ProcessTVCommand($field_elements, $field_id, '', 'tvform');
            $index_list = ParseIntputOptions($rs);
            static $i = 0;
            foreach ($index_list as $item) {
                list($label, $value) = splitOption($item);
                $checked = isSelected($label, $value, $item, $field_value) ? ' checked="checked"' : '';
                $value = htmlspecialchars($value);
                $field_html .= '<label for="tv_' . $i . '"><input type="checkbox" value="' . $value . '" id="tv_' . $i . '" name="tv' . $field_id . '[]" ' . $checked . ' />' . $label . '</label>';
                $i++;
            }
            break;
        case "option":
            // handles radio buttons
            $rs = ProcessTVCommand($field_elements, $field_id, '', 'tvform');
            $index_list = ParseIntputOptions($rs);
            static $i = 0;
            while (list($label, $item) = each($index_list)) {
                list($label, $value) = splitOption($item);
                $checked = isSelected($label, $value, $item, $field_value) ? 'checked="checked"' : '';
                $value = htmlspecialchars($value);
                $field_html .= '<label for="tv_' . $i . '"><input type="radio" value="' . $value . '" id="tv_' . $i . '" name="tv' . $field_id . '" ' . $checked . ' />' . $label . '</label>';
                $i++;
            }
            break;
        case "image":
            // handles image fields using htmlarea image manager
            global $_lang;
            global $ResourceManagerLoaded;
            global $content, $use_editor, $which_editor;
            $url_convert = get_js_trim_path_pattern();
            if (!$ResourceManagerLoaded && !(($content['richtext'] == 1 || $_GET['a'] == 4) && $use_editor == 1 && $which_editor == 3)) {
                $field_html .= tplFileBrowser();
                $ResourceManagerLoaded = true;
            }
            $field_html .= '<input type="text" id="tv' . $field_id . '" name="tv' . $field_id . '"  value="' . $field_value . '" ' . $field_style . ' />&nbsp;<input type="button" value="' . $_lang['insert'] . '" onclick="BrowseServer(\'tv' . $field_id . '\')" />';
            break;
        case "file":
            // handles the input of file uploads
            /* Modified by Timon for use with resource browser */
            global $_lang;
            global $ResourceManagerLoaded;
            global $content, $use_editor, $which_editor;
            $url_convert = get_js_trim_path_pattern();
            if (!$ResourceManagerLoaded && !(($content['richtext'] == 1 || $_GET['a'] == 4) && $use_editor == 1 && $which_editor == 3)) {
                /* I didn't understand the meaning of the condition above, so I left it untouched ;-) */
                $field_html .= tplFileBrowser();
                $ResourceManagerLoaded = true;
            }
            $field_html .= '<input type="text" id="tv' . $field_id . '" name="tv' . $field_id . '"  value="' . $field_value . '" ' . $field_style . ' />&nbsp;<input type="button" value="' . $_lang['insert'] . '" onclick="BrowseFileServer(\'tv' . $field_id . '\')" />';
            break;
        case "hidden":
            $field_type = 'hidden';
            $field_html .= '<input type="hidden" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . htmlspecialchars($field_value) . '" tvtype="' . $field_type . '" />';
            break;
        case 'custom_tv':
            $custom_output = '';
            /* If we are loading a file */
            if (substr($field_elements, 0, 5) == "@FILE") {
                $file_name = MODX_BASE_PATH . trim(substr($field_elements, 6));
                if (!file_exists($file_name)) {
                    $custom_output = $file_name . ' does not exist';
                } else {
                    $custom_output = file_get_contents($file_name);
                }
            } elseif (substr($field_elements, 0, 8) == '@INCLUDE') {
                $file_name = MODX_BASE_PATH . trim(substr($field_elements, 9));
                if (!file_exists($file_name)) {
                    $custom_output = $file_name . ' does not exist';
                } else {
                    ob_start();
                    include $file_name;
                    $custom_output = ob_get_contents();
                    ob_end_clean();
                }
            } elseif (substr($field_elements, 0, 6) == "@CHUNK") {
                $chunk_name = trim(substr($field_elements, 7));
                $chunk_body = $modx->getChunk($chunk_name);
                if ($chunk_body == false) {
                    $custom_output = $_lang['chunk_no_exist'] . '(' . $_lang['htmlsnippet_name'] . ':' . $chunk_name . ')';
                } else {
                    $custom_output = $chunk_body;
                }
            } elseif (substr($field_elements, 0, 5) == "@EVAL") {
                $eval_str = trim(substr($field_elements, 6));
                $custom_output = eval($eval_str);
            } else {
                $custom_output = $field_elements;
            }
            $replacements = array('[+field_type+]' => $field_type, '[+field_id+]' => $field_id, '[+default_text+]' => $default_text, '[+field_value+]' => htmlspecialchars($field_value), '[+field_style+]' => $field_style);
            $custom_output = str_replace(array_keys($replacements), $replacements, $custom_output);
            $modx->documentObject = $content;
            $custom_output = $modx->parseDocumentSource($custom_output);
            $field_html .= $custom_output;
            break;
        default:
            // the default handler -- for errors, mostly
            $sname = strtolower($field_type);
            $result = $modx->db->select('snippet', '[+prefix+]site_snippets', "name='input:{$field_type}'");
            if ($modx->db->getRecordCount($result) == 1) {
                $field_html .= eval($modx->db->getValue($result));
            } else {
                $field_html .= '<input type="text" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . htmlspecialchars($field_value) . '" ' . $field_style . ' />';
            }
    }
    // end switch statement
    return $field_html;
}
Beispiel #13
0
function get_yes_no_mand($name, $value = '')
{
    $ret = '';
    // [ML] sorry for this stupid patch, practical for keywords.php
    $yes_opt = isSelected($value == 'yes_optional');
    $yes_mand = isSelected($value == 'yes_mandatory');
    $no = isSelected($value == 'no');
    $other = isSelected(!($yes_mand || $yes_opt || $no));
    // until we format with tables, better to keep the starting space
    $ret .= ' <select name="' . $name . '" class="sel_frm">' . "\n";
    $ret .= '<option value="yes_optional"' . $yes_opt . '>' . _T('info_yes_optional') . '</option>';
    $ret .= '<option value="yes_mandatory"' . $yes_mand . '>' . _T('info_yes_mandatory') . '</option>';
    $ret .= '<option value="no"' . $no . '>' . _T('info_no') . '</option>';
    if ($other) {
        $ret .= '<option value=""' . $other . '> </option>';
    }
    $ret .= '</select>' . "\n";
    return $ret;
}
Beispiel #14
0
function show_new_contact($num_new, $type_person, $ctype = "__add__", $exceptions = array())
{
    $all_contact_types = get_kwg_all('contact');
    // There may be a config error, or admin removed all contact types
    if (!count($all_contact_types)) {
        return;
    }
    echo "<tr>\n";
    // Contact type (either specific or 'Add contact')
    echo '<td align="left" valign="top">' . f_err_star('new_contact_' . $num_new);
    if ($ctype == "__add__") {
        echo _Ti('generic_input_contact_other');
    } else {
        $c = get_kwg_from_name($ctype);
        echo f_err_star('contact_' . $c['name']);
        echo _Ti(remove_number_prefix($c['title']));
        echo $c['policy'] != 'optional' ? '<br/>(' . _T('keywords_input_policy_' . $c['policy']) . ')' : '';
    }
    echo '</td>';
    echo '<td align="left" valign="top">';
    // Avoids that the values in these fields get lost when there is an error after submitting the form
    $value = '';
    $type = '';
    if (isset($_SESSION['form_data']['new_contact_type_name'][$num_new])) {
        $type = $_SESSION['form_data']['new_contact_type_name'][$num_new];
    }
    if (isset($_SESSION['form_data']['new_contact_value'][$num_new])) {
        $value = $_SESSION['form_data']['new_contact_value'][$num_new];
    }
    if ($ctype == "__add__") {
        echo "<div>\n";
        echo '<select name="new_contact_type_name[]" id="new_contact_type_' . $num_new . '" class="sel_frm">' . "\n";
        echo "<option value=''>" . " ... " . "</option>\n";
        foreach ($all_contact_types as $contact) {
            if (!($contact['quantity'] == 'one' && isset($exceptions[$contact['name']]) && $type != $contact['name'])) {
                $sel = isSelected($type == $contact['name']);
                echo "<option value='" . $contact['name'] . "' {$sel}>" . _T($contact['title']) . "</option>\n";
            }
        }
        echo "</select>\n";
        echo "</div>\n";
        echo "<div>\n";
        echo '<input type="text" size="40" name="new_contact_value[]" id="new_contact_value_' . $num_new . '" ';
        echo ' value="' . $value . '" ';
        echo 'class="search_form_txt" />' . "\n";
        echo "</div>\n";
    } else {
        echo '<input name="new_contact_type_name[]" id="new_contact_type_name_' . $num_new . '" ' . 'type="hidden" value="' . $ctype . '" />' . "\n";
        echo '<input name="new_contact_value[]" id="new_contact_value_' . $num_new . '" type="text" ' . 'class="search_form_txt" size="35" value="' . $value . '"/>&nbsp;';
    }
    echo "</td>\n";
    echo "</tr>\n";
}
function printSelected($var, $val)
{
    if (isSelected($var, $val)) {
        echo "checked";
    }
}
Beispiel #16
0
 function printEdit()
 {
     global $prefs;
     $admin = allowed($this->getDataInt('id_case'), 'a');
     // FIXME
     $edit = allowed($this->getDataInt('id_case'), 'e');
     // FIXME
     $write = allowed($this->getDataInt('id_case'), 'w');
     // FIXME (put in constructor)
     // FIXME: not sure whether this works as previously
     $dis = isDisabled(!($admin || $edit));
     echo '<table class="tbl_usr_dtl" width="99%">' . "\n";
     echo '<tr><td>';
     echo f_err_star('date_start') . _T('fu_input_date_start');
     echo "</td>\n";
     echo "<td>";
     $name = $admin || $edit ? 'start' : '';
     echo get_date_inputs($name, $this->data['date_start'], false);
     echo ' ' . _T('time_input_time_at') . ' ';
     echo get_time_inputs($name, $this->data['date_start']);
     echo "</td>\n";
     echo "</tr>\n";
     echo "<tr><td>";
     echo f_err_star('date_end') . ($prefs['time_intervals'] == 'absolute' ? _T('fu_input_date_end') : _T('fu_input_time_length'));
     echo "</td>\n";
     echo '<td>';
     if ($prefs['time_intervals'] == 'absolute') {
         // Buggy code, so isolated most important cases
         if ($this->data['id_followup'] == 0) {
             $name = 'end';
         } elseif ($edit) {
             $name = 'end';
         } else {
             // user can 'finish' entering data
             $name = $admin || $edit && $this->data['date_end'] == '0000-00-00 00:00:00' ? 'end' : '';
         }
         echo get_date_inputs($name, $this->data['date_end']);
         echo ' ';
         echo _T('time_input_time_at') . ' ';
         echo get_time_inputs($name, $this->data['date_end']);
     } else {
         $name = '';
         // Buggy code, so isolated most important cases
         if ($this->getDataInt('id_followup') == 0) {
             $name = 'delta';
         } elseif ($edit) {
             $name = 'delta';
         } else {
             // user can 'finish' entering data
             $name = $admin || $edit && $this->getDataString('date_end') == '0000-00-00 00:00:00' ? 'delta' : '';
         }
         if (empty($_SESSION['errors'])) {
             $interval = $this->getDataString('date_end') != '0000-00-00 00:00:00' ? strtotime($this->getDataString('date_end')) - strtotime($this->getDataString('date_start')) : 0;
             echo get_time_interval_inputs($name, $interval);
         } else {
             echo get_time_interval_inputs_from_array($name, $this->data);
         }
     }
     echo "</td>\n";
     echo "</tr>\n";
     // Show 'conclusion' options
     if ($this->show_conclusion) {
         $kws_conclusion = get_keywords_in_group_name('conclusion');
         $kws_result = get_keywords_in_group_name('_crimresults');
         echo "<tr>\n";
         echo "<td>" . _Ti('fu_input_conclusion') . "</td>\n";
         echo '<td>';
         // Result
         if (read_meta('case_result') == 'yes') {
             echo '<select ' . $dis . ' name="result" size="1" class="sel_frm">' . "\n";
             $default = '';
             if ($this->data['result']) {
                 $default = $this->data['result'];
             }
             foreach ($kws_result as $kw) {
                 $sel = isSelected($kw['name'] == $default);
                 echo '<option ' . $sel . ' value="' . $kw['name'] . '">' . _T(remove_number_prefix($kw['title'])) . "</option>\n";
             }
             echo "</select><br/>\n";
         }
         // Conclusion
         echo '<select ' . $dis . ' name="conclusion" size="1" class="sel_frm">' . "\n";
         $default = '';
         if ($this->data['conclusion']) {
             $default = $this->data['conclusion'];
         }
         foreach ($kws_conclusion as $kw) {
             $sel = isSelected($kw['name'] == $default);
             echo '<option ' . $sel . ' value="' . $kw['name'] . '">' . _T(remove_number_prefix($kw['title'])) . "</option>\n";
         }
         echo "</select>\n";
         echo "</td>\n";
         echo "</tr>\n";
         // If guilty, what sentence?
         $kws_sentence = get_keywords_in_group_name('sentence');
         echo "<tr>\n";
         echo "<td>" . _Ti('fu_input_sentence') . "</td>\n";
         echo '<td>';
         echo '<select ' . $dis . ' name="sentence" size="1" class="sel_frm">' . "\n";
         $default = '';
         if ($this->data['sentence']) {
             $default = $this->data['sentence'];
         }
         echo "<!-- " . $default . " -->\n";
         foreach ($kws_sentence as $kw) {
             $sel = $kw['name'] == $default ? ' selected="selected"' : '';
             echo '<option ' . $sel . ' value="' . $kw['name'] . '">' . _T(remove_number_prefix($kw['title']), array('currency' => read_meta('currency'))) . "</option>\n";
         }
         echo "</select>\n";
         // If sentence, for how much?
         echo '<input type="text" name="sentence_val" size="10" value="' . $this->data['sentence_val'] . '" />';
         echo "</td>\n";
         echo "</tr>\n";
     }
     if (_request('submit') == 'set_status' || is_status_change($this->getDataString('type'))) {
         // Change status
         echo "<tr>\n";
         echo "<td>" . _T('case_input_status') . "</td>\n";
         echo "<td>";
         echo '<input type="hidden" name="type" value="' . $this->getDataString('type') . '" />' . "\n";
         echo _T('kw_followups_' . $this->data['type'] . '_title');
         echo "</td>\n";
         echo "</tr>\n";
     } elseif (_request('submit') == 'set_stage' || $this->getDataString('type') == 'stage_change') {
         // Change stage
         echo "<tr>\n";
         echo "<td>" . _T('fu_input_next_stage') . "</td>\n";
         echo "<td>";
         echo '<input type="hidden" name="type" value="' . $this->getDataString('type') . '" />' . "\n";
         // This is to compensate an old bug, when 'case stage' was not stored in fu.description
         // and therefore editing a follow-up would not give correct information.
         // Bug was in CVS of 0.4.3 between 19-20 April 2005. Should not affect many people.
         if ($s = $this->getDataString('new_stage')) {
             echo '<input type="hidden" name="new_stage" value="' . $s . '" />' . "\n";
             echo _Tkw('stage', $s);
         } else {
             echo "New stage information not available";
         }
         echo "</td>\n";
         echo "</tr>\n";
         if ($s = $this->getDataString('new_stage')) {
             // Update stage keywords (if any)
             $stage = get_kw_from_name('stage', $s);
             $id_stage = $stage['id_keyword'];
             show_edit_keywords_form('stage', $this->data['id_case'], $id_stage);
         }
     } elseif ($this->getDataString('type') == 'assignment' || $this->getDataString('type') == 'unassignment') {
         // Do not allow assignment/un-assignment follow-ups to be changed
         echo "<tr>\n";
         echo "<td>" . _T('fu_input_next_stage') . "</td>\n";
         echo "<td>";
         echo '<input type="hidden" name="type" value="' . $this->getDataString('type') . '" />' . "\n";
         echo _Tkw('followups', $this->getDataString('type'));
         echo "</td>\n";
         echo "</tr>\n";
     } else {
         // The usual follow-up
         echo "<tr>\n";
         echo "<td>" . _T('fu_input_type') . "</td>\n";
         echo "<td>";
         echo '<select ' . $dis . ' name="type" size="1" class="sel_frm">' . "\n";
         $default_fu = get_suggest_in_group_name('followups');
         $futype_kws = get_keywords_in_group_name('followups');
         $kw_found = false;
         foreach ($futype_kws as $kw) {
             $sel = isSelected($kw['name'] == $default_fu);
             if ($sel) {
                 $kw_found = true;
             }
             echo '<option value="' . $kw['name'] . '"' . $sel . '>' . _T(remove_number_prefix($kw['title'])) . "</option>\n";
         }
         // Exotic case where the FU keyword was hidden by the administrator,
         // but an old follow-up using that keyword is being edited.
         if (!$kw_found) {
             echo '<option selected="selected" value="' . $default_fu . '">' . _Tkw('followups', $default_fu) . "</option>\n";
         }
         echo "</select>\n";
         echo "</td>\n";
         echo "</tr>\n";
     }
     // Keywords (if any)
     show_edit_keywords_form('followup', $this->getDataInt('id_followup'));
     // Description
     echo "<tr>\n";
     echo '<td valign="top">' . f_err_star('description') . _T('fu_input_description') . "</td>\n";
     echo '<td>';
     if ($this->getDataString('type') == 'assignment' || $this->getDataString('type') == 'unassignment') {
         // Do not allow edit of assignment
         echo '<input type="hidden" name="description" value="' . $this->getDataString('description') . '" />' . "\n";
         echo get_fu_description($this->data);
     } else {
         echo '<textarea ' . $dis . ' name="description" rows="15" cols="60" class="frm_tarea">';
         echo clean_output($this->getDataString('description'));
         echo "</textarea>";
     }
     echo "</td></tr>\n";
     // Sum billed field
     if ($this->show_sum_billed == "yes") {
         echo '<tr>';
         echo '<td>' . _T('fu_input_sum_billed') . "</td>\n";
         echo '<td>';
         echo '<input ' . $dis . ' name="sumbilled" ' . 'value="' . clean_output($this->getDataString('sumbilled')) . '" ' . 'class="search_form_txt" size="10" />';
         // [ML] If we do this we may as well make a function
         // out of it, but not sure where to place it :-)
         // This code is also in config_site.php
         $currency = read_meta('currency');
         if (empty($currency)) {
             $current_lang = $GLOBALS['lang'];
             $GLOBALS['lang'] = read_meta('default_language');
             $currency = _T('currency_default_format');
             $GLOBALS['lang'] = $current_lang;
         }
         echo htmlspecialchars($currency);
         echo "</td></tr>\n";
     }
     echo "</table>\n\n";
     // XXX FIXME: Should probably be in some function "is_system_fu"
     // or even "is_deletable"
     if ($this->getDataInt('id_followup') && allowed($this->data['id_case'], 'a') && !(is_status_change($this->data['type']) || $this->data['type'] == 'assignment' || $this->data['type'] == 'unassignment')) {
         $checked = $this->getDataString('hidden') == 'Y' ? ' checked="checked" ' : '';
         echo '<p class="normal_text">';
         echo '<input type="checkbox"' . $checked . ' name="delete" id="box_delete" />';
         echo '<label for="box_delete">' . _T('fu_info_delete') . '</label>';
         echo "</p>\n";
     }
     // Add followup appointment
     if (!_request('followup')) {
         echo "<!-- Add appointment? -->\n";
         echo '<p class="normal_text">';
         echo '<input type="checkbox" name="add_appointment" id="box_new_app" onclick="display_block(\'new_app\', \'flip\')" />';
         echo '<label for="box_new_app">' . _T('fu_info_add_future_activity') . '</label>';
         echo "</p>\n";
         echo '<div id="new_app" style="display: none;">';
         echo '<table class="tbl_usr_dtl" width="99%">' . "\n";
         echo "<!-- Start time -->\n\t\t<tr><td>";
         echo _T('time_input_date_start');
         echo "</td><td>";
         echo get_date_inputs('app_start', $this->data['app_start_time'], false);
         echo ' ' . _T('time_input_time_at') . ' ';
         echo get_time_inputs('app_start', $this->data['app_start_time']);
         echo f_err_star('app_start_time');
         echo "</td></tr>\n";
         echo "<!-- End time -->\n\t\t<tr><td>";
         echo $prefs['time_intervals'] == 'absolute' ? _T('time_input_date_end') : _T('app_input_time_length');
         echo "</td><td>";
         if ($prefs['time_intervals'] == 'absolute') {
             echo get_date_inputs('app_end', $this->data['app_end_time']);
             echo ' ' . _T('time_input_time_at') . ' ';
             echo get_time_inputs('app_end', $this->data['app_end_time']);
             echo f_err_star('app_end_time');
         } else {
             $interval = $this->data['app_end_time'] != '0000-00-00 00:00:00' ? strtotime($this->data['app_end_time']) - strtotime($this->data['app_start_time']) : 0;
             //	echo _T('calendar_info_time') . ' ';
             echo get_time_interval_inputs('app_delta', $interval);
             echo f_err_star('app_end_time');
         }
         echo "</td></tr>\n";
         /* [ML] Removing, not useful for now
         			   echo "<!-- Reminder -->\n\t\t<tr><td>";
         			   echo (($prefs['time_intervals'] == 'absolute') ? _T('app_input_reminder_time') : _T('app_input_reminder_offset'));
         			   echo "</td><td>";
         			   if ($prefs['time_intervals'] == 'absolute') {
         			   echo get_date_inputs('app_reminder', $this->data['app_reminder']);
         			   echo ' ' . _T('time_input_time_at') . ' ';
         			   echo get_time_inputs('app_reminder', $this->data['app_reminder']);
         			   echo f_err_star('app_reminder');
         			   } else {
         			   $interval = ( ($this->data['app_end_time']!='0000-00-00 00:00:00') ?
         			   strtotime($this->data['app_start_time']) - strtotime($this->data['app_reminder']) : 0);
         			//	echo _T('calendar_info_time') . ' ';
         			echo get_time_interval_inputs('app_rem_offset', $interval);
         			echo " " . _T('time_info_before_start');
         			echo f_err_star('app_reminder');
         			}
         			echo "</td></tr>\n";
         			 */
         // TODO: [ML] a bit of testing to see if this survives an error on new case
         // I suspect it doesn't..
         echo "<!-- Appointment title -->\n\t\t<tr><td>";
         echo f_err_star('app_title') . _T('app_input_title');
         echo "</td><td>";
         echo '<input type="text" ' . $dis . ' name="app_title" size="50" value="';
         echo clean_output($this->getDataString('app_title')) . '" class="search_form_txt" />';
         echo "</td></tr>\n";
         echo "<!-- Appointment type -->\n\t\t<tr><td>";
         echo _T('app_input_type');
         echo "</td><td>";
         echo '<select ' . $dis . ' name="app_type" size="1" class="sel_frm">';
         global $system_kwg;
         if ($_SESSION['fu_app_data']['type']) {
             $default_app = $_SESSION['fu_app_data']['type'];
         } else {
             $app_kwg = get_kwg_from_name('appointments');
             $default_app = $app_kwg['suggest'];
         }
         $opts = array();
         foreach ($system_kwg['appointments']['keywords'] as $kw) {
             $opts[$kw['name']] = _T(remove_number_prefix($kw['title']));
         }
         asort($opts);
         foreach ($opts as $k => $opt) {
             $sel = isSelected($k == $default_app);
             echo "<option value='{$k}'{$sel}>{$opt}</option>\n";
         }
         echo '</select>';
         echo "</td></tr>\n";
         echo "<!-- Appointment description -->\n";
         echo "<tr><td valign=\"top\">";
         echo _T('app_input_description');
         echo "</td><td>";
         echo '<textarea ' . $dis . ' name="app_description" rows="5" cols="60" class="frm_tarea">';
         echo clean_output($this->getDataString('app_description'));
         echo '</textarea>';
         echo "</td></tr>\n";
         echo "</table>\n";
         echo "</div>\n";
     }
 }
Beispiel #17
0
                <label>Choose default format:</label>
                <select id="bookmarkletformat" name="format" form="bookmarkletform">
                  <option value="epub"<?php 
echo isSelected("epub", $format);
?>
>ePub</option>
                  <option value="pdf"<?php 
echo isSelected("pdf", $format);
?>
>PDF</option>
                  <option value="mobi"<?php 
echo isSelected("mobi", $format);
?>
>MOBI</option>
                  <option value="txt"<?php 
echo isSelected("txt", $format);
?>
>Text File</option>
                </select>
              </div>
              <div class="large-4 columns">
                <label>Enter your Email (optional, Kindle only!):</label>
                <input type="text" id="bookmarkletemail" name="email" placeholder="*****@*****.**" />
              </div>            
              <div class="large-4 columns" style="margin-top:22px">
                <input id="createbookmarklet" type="submit" class="button postfix" value="Create Bookmarklet">
              </div>
            </div>
          </form>
          <div style="padding-bottom: 20px; display: none" id="bookmarklet-container">
            <p style="margin-bottom: 5px; margin-top: -15px">Link created! Drag the link below to your bookmarks bar to begin using it.</p>
Beispiel #18
0
 function printEdit()
 {
     echo '<input type="hidden" name="id_case" value="' . $this->getDataInt('id_case') . '" />' . "\n";
     echo '<table width="99%" border="0" align="center" cellpadding="5" cellspacing="0" class="tbl_usr_dtl">' . "\n";
     // TODO:
     // Ajouter auteur, etc.
     // Ajouter "approved by" si id_admin != 0
     show_context_start();
     show_context_case_title($this->getDataInt('id_case'), 'exps');
     show_context_end();
     if ($this->getDataInt('id_expense')) {
         echo "<tr><td>" . _T('expense_input_id') . "</td>\n";
         echo "<td>" . $this->getDataInt('id_expense') . '<input type="hidden" name="id_expense" value="' . $this->getDataInt('id_expense') . '" /></td></tr>' . "\n";
     }
     echo '<tr><td>' . f_err_star('description') . _T('expense_input_description') . '</td>' . "\n";
     echo '<td><textarea name="description" id="input_expense_description" class="frm_tarea" rows="3" cols="60">' . clean_output($this->getDataString('description')) . "</textarea>\n" . "</td>\n";
     echo "</tr>\n";
     echo '<tr><td>' . f_err_star('type') . _T('expense_input_type') . '</td>' . "\n";
     echo '<td>';
     echo '<select ' . $dis . ' name="type" size="1" class="sel_frm">' . "\n";
     $default_exp = $this->getDataString('type', get_suggest_in_group_name('_exptypes'));
     $exptype_kws = get_keywords_in_group_name('_exptypes');
     foreach ($exptype_kws as $kw) {
         $sel = isSelected($kw['name'] == $default_exp);
         if ($sel) {
             $kw_found = true;
         }
         echo '<option value="' . $kw['name'] . '"' . $sel . '>' . _T(remove_number_prefix($kw['title'])) . "</option>\n";
     }
     echo '</td></tr>' . "\n";
     echo '<tr><td>' . f_err_star('cost') . _T('expense_input_cost') . '</td>' . "\n";
     echo '<td>';
     echo '<input type="text" name="cost" value="' . $this->getDataFloat('cost') . '" class="search_form_txt" size="10" />';
     echo ' ' . htmlspecialchars(read_meta('currency'));
     echo "</td></tr>\n";
     // Show comment box only if new expense (not edit)
     if (!$this->getDataInt('id_expense')) {
         echo "<tr>\n";
         echo "<td>" . f_err_star('comment') . _Ti('expense_input_comment') . "</td>\n";
         echo '<td><textarea name="comment" id="input_expense_comment" class="frm_tarea" rows="3" cols="60">' . clean_output($this->getDataString('comment')) . "</textarea>\n" . "</td>\n";
         echo "</tr>\n";
     }
     echo "</table>\n";
 }
Beispiel #19
0
			</a>
		</li>
	<?php 
}
?>
	</ul>
</div>

<div class="block">
	<h2 class="block-prefix">State:</h2>
	<ul class="block-content state-list">
		<?php 
foreach (array('new', 'waiting', 'done', 'denied') as $state) {
    ?>
			<li class="list issue-state-<?php 
    echo $state . (isSelected('state', $state) ? ' selected' : '');
    ?>
">
				<a href="<?php 
    echo renderListQuery('state', $state);
    ?>
">
					<span><?php 
    echo $state;
    ?>
</span>
				</a>
			</li>
		<?php 
}
?>
$examDetail = selectExamInfo($examId);
$questionSet = selectAllQuestionOf($examId);
echo '<div id="examTitle">
			<h3>' . $examDetail["examName"] . '</h3>';
$examinerInfo = selectUserInfo($examDetail["examinerId"]);
echo '<h4>
			<span>Exam Id : <span id="examId">' . $examId . '</span> , </span>
			<span><u>Exam By : ' . $examinerInfo["name"] . '</u></span>
			</h4>
			<h5>(Tick The Correct Answers, Your answer will save automatically)</h5>
			</div>';
echo '<br>';
$start = 0;
$end = count($questionSet);
for ($index = $start; $index < $end; $index++) {
    $order = $index + 1;
    $question = selectQuestionDetail($questionSet[$index]["questionId"]);
    echo '<div class="question">' . $order . ') ' . htmlspecialchars($question["question"], ENT_QUOTES, ini_get("default_charset")) . '</div>';
    echo '<br>';
    $options = selectAllOptionsOf($questionSet[$index]["questionId"]);
    foreach ($options as $op) {
        if (isSelected($_SESSION["currentUser"], $examId, $question["questionId"], htmlspecialchars($op["mcqOption"], ENT_QUOTES, ini_get("default_charset")))) {
            echo '<label class="mcqOptions"><input type="checkbox" class="clickOptions" onchange="submitAnswer()" name="' . $question["questionId"] . '" value="' . htmlspecialchars($op["mcqOption"], ENT_QUOTES, ini_get("default_charset")) . '" checked> ' . htmlspecialchars($op["mcqOption"], ENT_QUOTES, ini_get("default_charset")) . '</label>';
        } else {
            echo '<label class="mcqOptions"><input type="checkbox" class="clickOptions" onchange="submitAnswer()" name="' . $question["questionId"] . '" value="' . htmlspecialchars($op["mcqOption"], ENT_QUOTES, ini_get("default_charset")) . '"> ' . htmlspecialchars($op["mcqOption"], ENT_QUOTES, ini_get("default_charset")) . '</label>';
        }
        echo '<br>';
    }
    echo '<hr>';
    echo '<br>';
}
Beispiel #21
0
echo "<p class=\"normal_text\">\n";
echo _T('input_filter_case_owner');
echo '<select name="case_owner">';
foreach ($types_owner as $t => $foo) {
    $sel = isSelected($prefs['case_owner'] == $t);
    echo '<option value="' . $t . '"' . $sel . '>' . _T('expense_filter_owner_option_' . $t) . "</option>\n";
}
echo "</select>\n";
echo '<select name="case_period">';
foreach ($types_period as $key => $val) {
    $sel = isSelected($prefs['case_period'] == $val);
    echo '<option value="' . $val . '"' . $sel . '>' . _T('case_filter_period_option_' . $key) . "</option>\n";
}
$q_dates = "SELECT DISTINCT " . lcm_query_trunc_field('date_creation', 'year') . " as year\n\t\t\tFROM lcm_expense as e\n\t\t\tWHERE " . $q_owner;
$result = lcm_query($q_dates);
while ($row = lcm_fetch_array($result)) {
    $sel = isSelected($prefs['case_period'] == $row['year']);
    echo '<option value="' . $row['year'] . '"' . $sel . '>' . _T('case_filter_period_option_year', array('year' => $row['year'])) . "</option>\n";
}
echo "</select>\n";
echo ' <button name="submit" type="submit" value="submit" class="simple_form_btn">' . _T('button_validate') . "</button>\n";
echo "</p>\n";
echo "</form>\n";
// Process the output of the query
$exp_list = new LcmExpenseListUI();
$exp_list->setSearchTerm($find_exp_string);
$exp_list->start();
$exp_list->printList();
$exp_list->finish();
echo '<p><a href="edit_exp.php?case=0" class="create_new_lnk">' . _T('expense_button_new') . "</a></p>\n";
lcm_page_end();
" <?php 
            echo isSelected(USER_ROLE, $c["comment"]);
            ?>
>User</option>
							<option value="<?php 
            echo STAFF_ROLE;
            ?>
" <?php 
            echo isSelected(STAFF_ROLE, $c["comment"]);
            ?>
>Faculty</option>
							<option value="<?php 
            echo ADMIN_ROLE;
            ?>
" <?php 
            echo isSelected(ADMIN_ROLE, $c["comment"]);
            ?>
>Admin</option>
						</select>
					</div>
				</div>


				<div class="form-group">
					<div class="col-md-offset-4">
						<div class="col-md-6">
							<input type="submit" class="btn btn-default btn-block" id="submit" name="submit" value="Edit"/>
						</div>
					</div>
				</div>
			</form>
</p>
<hr>
<table width="100%" border="0">
<!-- Form Data -->
<?php 
$entryKey = $rowManagerXMLNodeName;
/*
 *  For each Form Field ...
 */
foreach ($listFields->{$entryKey} as $entry) {
    $templateTools->swapBGColor($rowColor);
    // open the row
    echo '<tr valign="top" ' . $rowColor . " >\n";
    // display checkbox
    echo '<td class="text" >';
    $isSelected = isSelected($entry->dafield_id, $currentListFields);
    $defaultValue = '';
    if ($isSelected) {
        $defaultValue = $entry->dafield_id;
    }
    $templateTools->showCheckBox('listField[]', $entry->dafield_id, $defaultValue);
    echo '</td>';
    // display Name
    echo '<td class="text" >';
    echo $entry->dafield_name;
    echo '</td>';
    // display description
    echo '<td class="text" >';
    echo $entry->dafield_desc;
    echo '</td>';
    // close the row
Beispiel #24
0
function show_author_form($tab)
{
    global $author_session;
    global $prefs;
    // Referer not always set (bookmark, reload, etc.)
    // [AG] This is to preserve page's referer in 'ref' GET value during tab transitions
    // giving it higher priority than the actual page referer
    if (isset($_GET['ref'])) {
        $http_ref = urldecode(clean_input($_GET['ref']));
    } else {
        $http_ref = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
    }
    $http_ref_link = new Link($http_ref);
    echo '<form name="upd_user_profile" method="post" action="config_author.php">' . "\n";
    echo '<input type="hidden" name="referer" value="' . $http_ref_link->getUrl() . '" />' . "\n";
    echo '<input type="hidden" name="author_' . ($tab == 'advanced' ? 'advanced_settings' : 'ui') . '_modified" value="yes" />' . "\n";
    if ($tab == 'advanced') {
        echo '<input type="hidden" name="tab" value="1" />' . "\n";
    }
    echo '<table width="99%" border="0" align="center" cellpadding="5" cellspacing="0" class="tbl_usr_dtl">' . "\n";
    echo "<tr>\n";
    echo '<td colspan="2" align="center" valign="middle" class="heading">';
    echo '<h4>' . _T('authorconf_subtitle_' . $tab) . "</h4></td>\n";
    echo "</tr>\n";
    switch ($tab) {
        //
        // User interface
        //
        case 'interface':
            if ($GLOBALS['all_langs']) {
                echo "\n\t\t\t\t\t<tr>\n\t\t\t\t\t<td align=\"right\" valign=\"top\">" . _T('authorconf_input_language') . "</td>\n\t\t\t\t\t<td align=\"left\" valign=\"top\">\n\t\t\t\t\t<input type='hidden' name='old_language' value='" . $GLOBALS['lcm_lang'] . "'/>\n";
                echo menu_languages('sel_language');
                echo "\n\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n";
            }
            ?>
	    <tr>
	    	<td align="right" valign="top" width="50%"><?php 
            echo _T('authorconf_input_screen');
            ?>
</td>
			<td align="left" valign="top">
				<input type="hidden" name="old_screen" id="old_screen" value="<?php 
            echo $prefs['screen'];
            ?>
" />
				<select name="sel_screen" class="sel_frm">
<?php 
            $screen_modes = array("wide", "narrow");
            foreach ($screen_modes as $scrm) {
                $selected_mode = $scrm == $prefs['screen'] ? " selected='selected'" : '';
                echo "<option value='" . $scrm . "'" . $selected_mode . ">" . _T('authorconf_input_screen_' . $scrm) . "</option>\n";
            }
            ?>
				</select>
			</td>
		</tr>
		<tr>
			<td align="right" valign="top"><?php 
            echo _T('authorconf_input_theme');
            ?>
</td>
			<td align="left" valign="top">
				<input type="hidden" name="old_theme" id="old_theme" value="<?php 
            echo $prefs['theme'];
            ?>
" />
				<select name="sel_theme" class="sel_frm" id="sel_theme">
<?php 
            $themes = get_theme_list();
            foreach ($themes as $t) {
                // If a theme has no translation, show only the file name
                $name = _T('authorconf_input_theme_' . $t);
                if ($name == 'authorconf_input_theme_' . $t) {
                    $name = $t;
                }
                $selected = $t == $prefs['theme'] ? " selected='selected'" : '';
                echo "<option value='" . $t . "'" . $selected . ">" . $name . "</option>\n";
            }
            ?>
				</select>
			</td>
		</tr>
		<tr>
			<td align="right" valign="top"><?php 
            echo _T('authorconf_input_font_size');
            ?>
</td>
			<td align="left" valign="top">

				<input type="hidden" name="old_font_size" id="old_font_size" value="<?php 
            echo $prefs['font_size'];
            ?>
" />
				<!-- <input name="inc_fnt" type="button" class="search_form_btn" id="inc_fnt" value="A -" />
                &nbsp; <input name="dec_fnt" type="button" class="search_form_btn" id="dec_fnt" value="A +" / >
				(not working yet) -->
				<select name="font_size" class="sel_frm" onchange="setActiveStyleSheet(document.upd_user_profile.font_size.options[document.upd_user_profile.font_size.options.selectedIndex].value)">

				<?php 
            $fonts = array('small_font', 'medium_font', 'large_font');
            // font_size gets default value in inc_auth.php
            foreach ($fonts as $f) {
                $sel = $f == $prefs['font_size'] ? 'selected="selected" ' : '';
                echo '<option ' . $sel . 'value="' . $f . '">' . _T('authorconf_input_' . $f) . '</option>' . "\n";
            }
            ?>

				</select>
			</td>
		</tr>
		<tr>
			<td align="right" valign="top"><?php 
            echo _T('authorconf_input_results_per_page');
            ?>
</td>
			<td align="left" valign="top">
				<input type="hidden" name="old_page_rows" id="old_page_rows" value="<?php 
            echo $prefs['page_rows'];
            ?>
" /> 
				<input name="page_rows" type="text" class="search_form_txt" id="page_rows" size="3" value="<?php 
            // page_rows gets default value in inc_auth.php
            echo $prefs['page_rows'];
            ?>
" />
			</td>
		</tr>
	</table>
<?php 
            break;
            //
            // Advanced settings
            //
        //
        // Advanced settings
        //
        case 'advanced':
            // Absolute/relative time intervals setting
            echo "<tr>\n";
            echo '<td align="left" valign="top">' . _T('authorconf_input_ui_time') . "</td>\n";
            echo '<td align="left" valign="top">' . '<input type="hidden" name="old_time_intervals" id="old_time_intervals" value="' . $prefs['time_intervals'] . '" />' . '<select name="sel_time_intervals" class="sel_frm">';
            $time_intervals = array("absolute", "relative");
            foreach ($time_intervals as $ti) {
                echo '<option value="' . $ti . '"' . isSelected($ti == $prefs['time_intervals']) . '>' . _T('authorconf_input_time_interval_' . $ti) . "</option>\n";
            }
            echo "</select>\n";
            echo "</td>\n";
            echo "</tr>\n";
            // Relative time intervals notation setting (hours only / float days,hours,minutes / float days, float hours, minutes)
            echo "<tr>\n";
            echo '<td align="left" valign="top">' . _T('authorconf_input_time_intervals_notation') . "</td>\n";
            echo '<td align="left" valign="top">' . '<input type="hidden" name="old_time_intervals_notation" id="old_time_intervals_notation" value="' . $prefs['time_intervals_notation'] . '" />' . '<select name="sel_time_intervals_notation" class="sel_frm">';
            $time_intervals_notation = array("hours_only", "floatdays_hours_minutes");
            foreach ($time_intervals_notation as $tin) {
                echo "<option value='" . $tin . "'" . isSelected($tin == $prefs['time_intervals_notation']) . ">" . _T('authorconf_input_time_intervals_notation_' . $tin) . "</option>\n";
            }
            echo "</select>\n";
            echo "</td>\n";
            echo "</tr>\n";
            echo "</table>\n";
            break;
    }
    // Submit button
    echo '<p align="' . $GLOBALS['lcm_lang_left'] . '">';
    echo '<input name="validate" type="submit" class="search_form_btn" id="submit" value="' . _T('authorconf_button_update_preferences') . '" />';
    echo "</p>\n";
    echo "</form>\n";
}
?>
><a href="<?php 
echo base_url();
?>
recruitment">Recruitment</a></li>
		    <li<?php 
echo isSelected('roster', $nav);
?>
><a href="<?php 
echo base_url();
?>
roster">Roster</a></li>
		    <li<?php 
echo isSelected('loot', $nav);
?>
><a href="<?php 
echo base_url();
?>
loot">Loot Tracker</a></li>
		    <li<?php 
echo isSelected('utilities', $nav);
?>
><a href="<?php 
echo base_url();
?>
utilities">Member Utilities</a></li>
		</ul>
	    </div>
	    
	    <div class="spacer" id="frontbodynavspacer">
	    </div>