public function postCastingFeedback() { if (!Request::ajax()) { return App::abort(404); } $json_request = array('status' => FALSE, 'responseText' => '', 'responseErrorText' => '', 'redirect' => FALSE); $validation = Validator::make(Input::all(), Casting::$rules); if ($validation->passes()) { Casting::create(Input::all()); $json_request['responseText'] = 'Сообщение отправлено'; $json_request['status'] = TRUE; } else { $json_request['responseText'] = 'Неверно заполнены поля'; $json_request['responseErrorText'] = implode($validation->messages()->all(), '<br />'); } return Response::json($json_request, 200); }
public function castingDelete($casting_id) { if (!Request::ajax()) { App::abort(404); } $json_request = array('status' => FALSE, 'responseText' => ''); if (Casting::where('id', $casting_id)->delete()) { $json_request['responseText'] = 'Удалено'; $json_request['status'] = TRUE; return Response::json($json_request, 200); } else { App::abort(404); } }
echo "<td align='center'><b>" . $idade->y . " anos" . "</b></td>"; echo "</tr>"; } ?> </tbody> </table> </div> </div> </div> </div> </div> <div class="ls-box ls-board-box"> <?php $chart = new Chart(); $casting = new Casting(); $client = new Client(); $supplier = new Supplier(); $homens = count($casting->getLoadedModel()->getObjects(array("where" => "sexo = 'M'"))); $mulheres = count($casting->getLoadedModel()->getObjects(array("where" => "sexo = 'F'"))); $clientes = count($client->getLoadedModel()->getObjects()); $fornecedores = count($supplier->getLoadedModel()->getObjects()); ?> <div class="row"> <div class="col-md-3 col-sm-6"> <div class="ls-box"> <h6 class="ls-title-4 color-default"> Casting Mulheres (<?php echo $mulheres; ?> )</h6> <strong class="ls-board-info"><?php
public function showForm($user_id = -1) { include_once "Casting.php"; include_once "Client.php"; include_once "Supplier.php"; include_once "Product.php"; include_once "Task.php"; include_once "User.php"; include_once "Eyecolor.php"; include_once "Job.php"; include_once "Haircolor.php"; include_once "Profiletype.php"; include_once "Skincolor.php"; include_once "Relationship.php"; include_once "Languages.php"; include_once "Nationality.php"; $this->prepareForm(-1, array('method' => 'post', 'includeTabs' => false, 'action' => base_url() . 'permissoes/aplicar/' . $user_id)); $user = new User($user_id); if ($user->fields['administrador']) { AlertMessage::display(array("type" => AlertMessage::INFO, "msg" => "O usuário <b>" . $user->fields['usuario'] . "</b> é administrador, possui sempre permissão em tudo", "icon" => "ls-ico-info")); } echo "<ul id='tree_view_permissions' class='navmenu dree treeview treeviewPermissions'>"; echo '<a name="topMenuTerrace" id="topMenuTerrace"></a>'; echo '<li>Casting'; echo "<ul>"; $casting = new Casting(); $casting->defineActionOptions(); $actions = $casting->getActionOptions(); $perm_name = $actions["add"]["permName"]; echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $actions["add"]["label"] . "</li>"; $perm_name = $actions["edit"]["permName"]; echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $actions["edit"]["label"] . "</li>"; foreach ($actions["actions"] as $index => $action) { $perm_name = $action['permName']; echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $action["label"] . "</li>"; } echo "<li>Perfil"; echo "<ul>"; $profile_type = new Profiletype(); $profile_type->defineActionOptions(); $actions = $profile_type->getActionOptions(); $perm_name = $actions["add"]["permName"]; echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $actions["add"]["label"] . "</li>"; foreach ($actions["actions"] as $index => $action) { $perm_name = $action['permName']; echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $action["label"] . "</li>"; } echo "</ul>"; echo "</li>"; echo "<li>Cores de cabelo"; echo "<ul>"; $casting_hair = new Haircolor(); $casting_hair->defineActionOptions(); $actions = $casting_hair->getActionOptions(); $perm_name = $actions["add"]["permName"]; echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $actions["add"]["label"] . "</li>"; foreach ($actions["actions"] as $index => $action) { $perm_name = $action['permName']; echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $action["label"] . "</li>"; } echo "</ul>"; echo "</li>"; echo "<li>Cores de olhos"; echo "<ul>"; $casting_eye = new Eyecolor(); $casting_eye->defineActionOptions(); $actions = $casting_eye->getActionOptions(); $perm_name = $actions["add"]["permName"]; echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $actions["add"]["label"] . "</li>"; foreach ($actions["actions"] as $index => $action) { $perm_name = $action['permName']; echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $action["label"] . "</li>"; } echo "</ul>"; echo "</li>"; echo "<li>Etnias"; echo "<ul>"; $etnias = new Skincolor(); $etnias->defineActionOptions(); $actions = $etnias->getActionOptions(); $perm_name = $actions["add"]["permName"]; echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $actions["add"]["label"] . "</li>"; foreach ($actions["actions"] as $index => $action) { $perm_name = $action['permName']; echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $action["label"] . "</li>"; } echo "</ul>"; echo "</li>"; echo "<li>Nacionalidades"; echo "<ul>"; $nationality = new Nationality(); $nationality->defineActionOptions(); $actions = $nationality->getActionOptions(); $perm_name = $actions["add"]["permName"]; echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $actions["add"]["label"] . "</li>"; foreach ($actions["actions"] as $index => $action) { $perm_name = $action['permName']; echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $action["label"] . "</li>"; } echo "</ul>"; echo "</li>"; echo "<li>Estado cívil"; echo "<ul>"; $relationship = new Relationship(); $relationship->defineActionOptions(); $actions = $relationship->getActionOptions(); $perm_name = $actions["add"]["permName"]; echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $actions["add"]["label"] . "</li>"; foreach ($actions["actions"] as $index => $action) { $perm_name = $action['permName']; echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $action["label"] . "</li>"; } echo "</ul>"; echo "</li>"; echo "<li>Idiomas"; echo "<ul>"; $languages = new Languages(); $languages->defineActionOptions(); $actions = $languages->getActionOptions(); $perm_name = $actions["add"]["permName"]; echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $actions["add"]["label"] . "</li>"; foreach ($actions["actions"] as $index => $action) { $perm_name = $action['permName']; echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $action["label"] . "</li>"; } echo "</ul>"; echo "</li>"; echo "<li>Função"; echo "<ul>"; $job = new Job(); $job->defineActionOptions(); $actions = $job->getActionOptions(); $perm_name = $actions["add"]["permName"]; echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $actions["add"]["label"] . "</li>"; foreach ($actions["actions"] as $index => $action) { $perm_name = $action['permName']; echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $action["label"] . "</li>"; } echo "</ul>"; echo "</li>"; echo "</ul>"; echo '</li>'; echo '<li>Clientes'; echo "<ul>"; $client = new Client(); $client->defineActionOptions(); $actions = $client->getActionOptions(); $perm_name = $actions["add"]["permName"]; echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $actions["add"]["label"] . "</li>"; $perm_name = $actions["edit"]["permName"]; echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $actions["edit"]["label"] . "</li>"; foreach ($actions["actions"] as $index => $action) { $perm_name = $action['permName']; echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $action["label"] . "</li>"; } echo "</ul>"; echo '</li>'; echo '<li>Fornecedores'; echo "<ul>"; $supplier = new Supplier(); $supplier->defineActionOptions(); $actions = $supplier->getActionOptions(); $perm_name = $actions["add"]["permName"]; echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $actions["add"]["label"] . "</li>"; $perm_name = $actions["edit"]["permName"]; echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $actions["edit"]["label"] . "</li>"; foreach ($actions["actions"] as $index => $action) { $perm_name = $action["permName"]; echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $action["label"] . "</li>"; } echo "</ul>"; echo '</li>'; echo '<li>Produtos/Serviços'; echo "<ul>"; $product = new Product(); $product->defineActionOptions(); $actions = $product->getActionOptions(); $perm_name = $actions["add"]["permName"]; echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $actions["add"]["label"] . "</li>"; $perm_name = $actions["edit"]["permName"]; echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $actions["edit"]["label"] . "</li>"; foreach ($actions["actions"] as $index => $action) { $perm_name = $action["permName"]; echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $action["label"] . "</li>"; } echo "</ul>"; echo '</li>'; echo '<li>Trabalhos'; echo "<ul>"; $task = new Task(); $task->defineActionOptions(); $actions = $task->getActionOptions(); $perm_name = $actions["add"]["permName"]; echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $actions["add"]["label"] . "</li>"; $perm_name = $actions["edit"]["permName"]; echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $actions["edit"]["label"] . "</li>"; foreach ($actions["actions"] as $index => $action) { $perm_name = $action["permName"]; echo "<li data-havepermission='" . self::havePermission($perm_name, $user_id) . "' data-permname='" . $perm_name . "'>" . $action["label"] . "</li>"; } echo "</ul>"; echo '</li>'; /*echo '<li>Gráficos/Relatórios'; echo "<ul>"; echo '<li>Executar</li>'; echo "</ul>"; echo '</li>';*/ echo "</ul>"; SystemHelper::addSubmitButton(array('label' => 'Aplicar', 'icon' => 'ls-ico-checkmark')); SystemHelper::addButton(array('label' => 'Cancelar', 'data' => array('popupcloser' => true), 'icon' => 'ls-ico-close')); }